1/* 2* @license 3* Broadcast Theme (c) Invisible Themes 4* 5* Modified versions of the theme code 6* are not supported by Groupthought. 7* 8*/(function(AOS,bodyScrollLock,themeAddresses,themeCurrency,Sqrl,themeImages,Flickity,FlickityFade,Rellax,MicroModal){"use strict";window.theme=window.theme||{},window.theme.sizes={mobile:480,small:750,large:990,widescreen:1400},window.theme.keyboardKeys={TAB:9,ENTER:13,ESCAPE:27,SPACE:32,LEFTARROW:37,RIGHTARROW:39},window.theme.focusable='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function floatLabels(container){container.querySelectorAll(".form-field").forEach(element=>{const label=element.querySelector("label"),input=element.querySelector("input, textarea");label&&input&&(input.addEventListener("keyup",event=>{event.target.value!==""?label.classList.add("label--float"):label.classList.remove("label--float")}),input.value&&input.value.length&&label.classList.add("label--float"))})}let screenOrientation=getScreenOrientation();function readHeights(){const h={};return h.windowHeight=Math.min(window.screen.height,window.innerHeight),h.announcementHeight=getHeight('[data-section-type*="announcement"] [data-bar-top]'),h.footerHeight=getHeight('[data-section-type*="footer"]'),h.menuHeight=getHeight("[data-header-height]"),h.headerHeight=h.menuHeight+h.announcementHeight,h.collectionNavHeight=getHeight("[data-collection-nav]"),h.logoHeight=getFooterLogoWithPadding(),h}function setVarsOnResize(){document.addEventListener("theme:resize",resizeVars),setVars()}function setVars(){const{windowHeight,announcementHeight,headerHeight,logoHeight,menuHeight,footerHeight,collectionNavHeight}=readHeights(),newsletterSmallLeft=document.querySelector("[data-newsletter-holder].newsletter--top-left"),cookiePopup=document.querySelector("[data-tracking-consent]"),articleSocials=document.querySelector("[data-article-socials]");let defaultOuter=16;document.documentElement.style.setProperty("--full-screen",`${windowHeight}px`),document.documentElement.style.setProperty("--three-quarters",`${windowHeight*(3/4)}px`),document.documentElement.style.setProperty("--two-thirds",`${windowHeight*(2/3)}px`),document.documentElement.style.setProperty("--one-half",`${windowHeight/2}px`),document.documentElement.style.setProperty("--one-third",`${windowHeight/3}px`),document.documentElement.style.setProperty("--menu-height",`${menuHeight}px`),document.documentElement.style.setProperty("--announcement-height",`${announcementHeight}px`),document.documentElement.style.setProperty("--header-height",`${headerHeight}px`),document.documentElement.style.setProperty("--collection-nav-height",`${collectionNavHeight}px`),document.documentElement.style.setProperty("--footer-height",`${footerHeight}px`),document.documentElement.style.setProperty("--content-full",`${windowHeight-headerHeight-logoHeight/2}px`),document.documentElement.style.setProperty("--content-min",`${windowHeight-headerHeight-footerHeight}px`),document.querySelector("[data-tracking-consent].popup-cookies--bottom")&&document.documentElement.style.setProperty("--cookie-bar-height",`${document.querySelector("[data-tracking-consent].popup-cookies--bottom").offsetHeight}px`),document.documentElement.style.setProperty("--newsletter-small-height",newsletterSmallLeft?`${newsletterSmallLeft.offsetHeight}px`:"0px"),document.documentElement.style.setProperty("--scrollbar-width",`${getScrollbarWidth()}px`),cookiePopup&&cookiePopup.offsetHeight>0?defaultOuter=cookiePopup.offsetHeight+Number(getComputedStyle(cookiePopup).bottom.replace("px","")):articleSocials&&articleSocials.offsetHeight>0&&(defaultOuter+=articleSocials.offsetHeight),document.documentElement.style.setProperty("--mobile-newsletter-with-cookie-height",`${defaultOuter}px`)}function resizeVars(){const{windowHeight,announcementHeight,headerHeight,logoHeight,menuHeight,footerHeight,collectionNavHeight}=readHeights(),newsletterSmallLeft=document.querySelector("[data-newsletter-holder].newsletter--top-left"),cookiePopup=document.querySelector("[data-tracking-consent]"),articleSocials=document.querySelector("[data-article-socials]"),currentScreenOrientation=getScreenOrientation();let defaultOuter=16;currentScreenOrientation!==screenOrientation&&(document.documentElement.style.setProperty("--full-screen",`${windowHeight}px`),document.documentElement.style.setProperty("--three-quarters",`${windowHeight*(3/4)}px`),document.documentElement.style.setProperty("--two-thirds",`${windowHeight*(2/3)}px`),document.documentElement.style.setProperty("--one-half",`${windowHeight/2}px`),document.documentElement.style.setProperty("--one-third",`${windowHeight/3}px`),screenOrientation=currentScreenOrientation),document.documentElement.style.setProperty("--menu-height",`${menuHeight}px`),document.documentElement.style.setProperty("--announcement-height",`${announcementHeight}px`),document.documentElement.style.setProperty("--header-height",`${headerHeight}px`),document.documentElement.style.setProperty("--collection-nav-height",`${collectionNavHeight}px`),document.documentElement.style.setProperty("--footer-height",`${footerHeight}px`),document.documentElement.style.setProperty("--content-full",`${windowHeight-headerHeight-logoHeight/2}px`),document.documentElement.style.setProperty("--content-min",`${windowHeight-headerHeight-footerHeight}px`),document.querySelector("[data-tracking-consent].popup-cookies--bottom")&&document.documentElement.style.setProperty("--cookie-bar-height",`${document.querySelector("[data-tracking-consent].popup-cookies--bottom").offsetHeight}px`),document.documentElement.style.setProperty("--newsletter-small-height",newsletterSmallLeft?`${newsletterSmallLeft.offsetHeight}
8px`:"0px"),cookiePopup&&cookiePopup.offsetHeight>0?defaultOuter=cookiePopup.offsetHeight+Number(getComputedStyle(cookiePopup).bottom.replace("px","")):articleSocials&&articleSocials.offsetHeight>0&&(defaultOuter+=articleSocials.offsetHeight),document.documentElement.style.setProperty("--mobile-newsletter-with-cookie-height",`${defaultOuter}px`)}function getScreenOrientation(){if(window.matchMedia("(orientation: portrait)").matches)return"portrait";if(window.matchMedia("(orientation: landscape)").matches)return"landscape"}function getHeight(selector){const el=document.querySelector(selector);return el?el.offsetHeight:0}function getFooterLogoWithPadding(){const height=getHeight("[data-footer-logo]");return height>0?height+20:0}function getScrollbarWidth(){const outer=document.createElement("div");outer.style.visibility="hidden",outer.style.overflow="scroll",outer.style.msOverflowStyle="scrollbar",document.body.appendChild(outer);const inner=document.createElement("div");outer.appendChild(inner);const scrollbarWidth=outer.offsetWidth-inner.offsetWidth;return outer.parentNode.removeChild(outer),scrollbarWidth}function singles(frame,wrappers){let padding=64,tallest=0;wrappers.forEach(wrap2=>{if(wrap2.offsetHeight>tallest){const getMarginTop=parseInt(window.getComputedStyle(wrap2).marginTop),getMarginBottom=parseInt(window.getComputedStyle(wrap2).marginBottom),getMargin=getMarginTop+getMarginBottom;getMargin>padding&&(padding=getMargin),tallest=wrap2.offsetHeight}});const images=frame.querySelectorAll("[data-overflow-background]");[frame,...images].forEach(el=>{el.style.setProperty("min-height",`calc(${tallest+padding}px + var(--header-padding))`)})}function doubles(section){if(window.innerWidth<window.theme.sizes.small){section.querySelectorAll("[data-overflow-frame]").forEach(singleframe=>{const wrappers=singleframe.querySelectorAll("[data-overflow-content]");singles(singleframe,wrappers)});return}const padding=parseInt(getComputedStyle(section).getPropertyValue("--outer"))*2;let tallest=0;const frames=section.querySelectorAll("[data-overflow-frame]");section.querySelectorAll("[data-overflow-content]").forEach(content=>{content.offsetHeight>tallest&&(tallest=content.offsetHeight)});const images=section.querySelectorAll("[data-overflow-background]");[...frames,...images].forEach(el=>{el.style.setProperty("min-height",`${tallest+padding}px`)}),section.style.setProperty("min-height",`${tallest+padding+2}px`)}function preventOverflow(container){const singleFrames=container.querySelectorAll(".js-overflow-container");singleFrames&&singleFrames.forEach(frame=>{const wrappers=frame.querySelectorAll(".js-overflow-content");singles(frame,wrappers),document.addEventListener("theme:resize",()=>{singles(frame,wrappers)})});const doubleSections=container.querySelectorAll("[data-overflow-wrapper]");doubleSections&&doubleSections.forEach(section=>{doubles(section),document.addEventListener("theme:resize",()=>{doubles(section)})})}function debounce(fn,time){let timeout;return function(){if(fn){const functionCall=()=>fn.apply(this,arguments);clearTimeout(timeout),timeout=setTimeout(functionCall,time)}}}let lastWindowWidth=window.innerWidth,lastWindowHeight=window.innerHeight;function dispatch(){document.dispatchEvent(new CustomEvent("theme:resize",{bubbles:!0})),lastWindowWidth!==window.innerWidth&&(document.dispatchEvent(new CustomEvent("theme:resize:width",{bubbles:!0})),lastWindowWidth=window.innerWidth),lastWindowHeight!==window.innerHeight&&(document.dispatchEvent(new CustomEvent("theme:resize:height",{bubbles:!0})),lastWindowHeight=window.innerHeight)}function resizeListener(){window.addEventListener("resize",debounce(function(){dispatch()},50))}let prev=window.pageYOffset,up=null,down=null,wasUp=null,wasDown=null,scrollLockTimeout=0;function dispatch$1(){const position=window.pageYOffset;position>prev?(down=!0,up=!1):position<prev?(down=!1,up=!0):(up=null,down=null),prev=position,document.dispatchEvent(new CustomEvent("theme:scroll",{detail:{up,down,position},bubbles:!1})),up&&!wasUp&&document.dispatchEvent(new CustomEvent("theme:scroll:up",{detail:{position},bubbles:!1})),down&&!wasDown&&document.dispatchEvent(new CustomEvent("theme:scroll:down",{detail:{position},bubbles:!1})),wasDown=down,wasUp=up}function lock(e){bodyScrollLock.disableBodyScroll(e.detail,{allowTouchMove:el=>el.tagName==="TEXTAREA"}),document.documentElement.setAttribute("data-scroll-locked","")}function unlock(){if(scrollLockTimeout=setTimeout(()=>{document.body.removeAttribute("data-drawer-closing")},20),document.body.hasAttribute("data-drawer-closing")){document.body.removeAttribute("data-drawer-closing"),scrollLockTimeout&&clearTimeout(scrollLockTimeout);return}else document.body.setAttribute("data-drawer-closing","");document.documentElement.removeAttribute("data-scroll-locked"),bodyScrollLock.clearAllBodyScrollLocks()}function scrollListener(){let timeout;window.addEventListener("scroll",function(){timeout&&window.cancelAnimationFrame(timeout),timeout=window.requestAnimationFrame(function(){dispatch$1()})},{passive:!0}),window.addEventListener("theme:scroll:lock",lock),window.addEventListener("theme:scroll:unlock",unlock)}const wrap=(toWrap,wrapperClass="",wrapperOption)=>{const wrapper=wrapperOption||document.createElement("div");return wrapper.classList.add(wrapperClass),toWrap.parentNode.insertBefore(wrapper,toWrap),wrapper.appendChild(toWrap)};function wrapElements(container){container.querySelectorAll(".rte table").forEach(table=>{wrap(table,"rte__table-wrapper")}),container.querySelectorAll('.rte iframe[src*="youtube.com/embed"], .rte iframe[src*="player.vimeo"], .rte iframe#admin_bar_iframe').forEach(frame=>{wrap(frame,"rte__video-wrapper")})}function isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function isTouch(){isTouchDevice()?(document.documentElement.className=document.documentElement.className.replace("no-touch","supp
8orts-touch"),window.theme.touch=!0):window.theme.touch=!1}function ariaToggle(container){const toggleButtons=container.querySelectorAll("[data-aria-toggle]");toggleButtons.length&&toggleButtons.forEach(element=>{element.addEventListener("click",function(event){event.preventDefault();const currentTarget=event.currentTarget;currentTarget.setAttribute("aria-expanded",currentTarget.getAttribute("aria-expanded")=="false"?"true":"false");const toggleID=currentTarget.getAttribute("aria-controls");document.querySelector(`#${toggleID}`).classList.toggle("expanding"),document.querySelector(`#${toggleID}`).classList.toggle("expanded"),setTimeout(function(){document.querySelector(`#${toggleID}`).classList.remove("expanding")},500)})})}function loading(){document.body.classList.add("is-loaded")}window.theme.settings.enableAnimations&&AOS.init({once:!0,offset:50,duration:1e3,startEvent:"load"}),resizeListener(),scrollListener(),isTouch(),ariaToggle(document),window.addEventListener("load",()=>{setVarsOnResize(),floatLabels(document),preventOverflow(document),wrapElements(document),loading()}),document.addEventListener("shopify:section:load",e=>{const container=e.target;floatLabels(container),preventOverflow(container),wrapElements(container),ariaToggle(document),setVarsOnResize()}),(function(){function n(n2){var i2=window.innerWidth||document.documentElement.clientWidth,r2=window.innerHeight||document.documentElement.clientHeight,t2=n2.getBoundingClientRect();return t2.top>=0&&t2.bottom<=r2&&t2.left>=0&&t2.right<=i2}function t(n2){var i2=window.innerWidth||document.documentElement.clientWidth,r2=window.innerHeight||document.documentElement.clientHeight,t2=n2.getBoundingClientRect(),u=t2.left>=0&&t2.left<=i2||t2.right>=0&&t2.right<=i2,f=t2.top>=0&&t2.top<=r2||t2.bottom>=0&&t2.bottom<=r2;return u&&f}function i(n2,i2){function r2(){var r3=t(n2);r3!=u&&(u=r3,typeof i2=="function"&&i2(r3,n2))}var u=t(n2);window.addEventListener("load",r2),window.addEventListener("resize",r2),window.addEventListener("scroll",r2)}function r(t2,i2){function r2(){var r3=n(t2);r3!=u&&(u=r3,typeof i2=="function"&&i2(r3,t2))}var u=n(t2);window.addEventListener("load",r2),window.addEventListener("resize",r2),window.addEventListener("scroll",r2)}window.visibilityHelper={isElementTotallyVisible:n,isElementPartiallyVisible:t,inViewportPartially:i,inViewportTotally:r}})();const showElement=(elem,removeProp=!1,prop="block")=>{elem&&(removeProp?elem.style.removeProperty("display"):elem.style.display=prop)};Shopify.Products=(function(){const config={howManyToShow:4,howManyToStoreInMemory:10,wrapperId:"recently-viewed-products",section:null,onComplete:null};let productHandleQueue=[],wrapper=null,howManyToShowItems=null;const cookie={configuration:{expires:90,path:"/",domain:window.location.hostname},name:"shopify_recently_viewed",write:function(recentlyViewed){const recentlyViewedString=recentlyViewed.join(" ");document.cookie=`${this.name}=${recentlyViewedString}; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}`},read:function(){let recentlyViewed=[],cookieValue=null;const templateProduct=document.querySelector("#template-product");if(document.cookie.indexOf("; ")!==-1&&document.cookie.split("; ").find(row=>row.startsWith(this.name))&&(cookieValue=document.cookie.split("; ").find(row=>row.startsWith(this.name)).split("=")[1]),cookieValue!==null&&(recentlyViewed=cookieValue.split(" ")),templateProduct){const currentProduct=templateProduct.getAttribute("data-product-handle");if(recentlyViewed.indexOf(currentProduct)!=-1){const currentProductIndex=recentlyViewed.indexOf(currentProduct);recentlyViewed.splice(currentProductIndex,1)}}return recentlyViewed},destroy:function(){document.cookie=`${this.name}=null; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}`},remove:function(productHandle){const recentlyViewed=this.read(),position=recentlyViewed.indexOf(productHandle);position!==-1&&(recentlyViewed.splice(position,1),this.write(recentlyViewed))}},finalize=(wrapper2,section)=>{showElement(wrapper2,!0);const cookieItemsLength=cookie.read().length;if(Shopify.recentlyViewed&&howManyToShowItems&&cookieItemsLength&&cookieItemsLength<howManyToShowItems&&wrapper2.children.length){let allClassesArr=[],addClassesArr=[],objCounter=0;for(const property in Shopify.recentlyViewed){objCounter+=1;const objArr=Shopify.recentlyViewed[property].split(" "),propertyIdx=parseInt(property.split("_")[1]);allClassesArr=[...allClassesArr,...objArr],(cookie.read().length===propertyIdx||objCounter===Object.keys(Shopify.recentlyViewed).length&&!addClassesArr.length)&&(addClassesArr=[...addClassesArr,...objArr])}for(let i=0;i<wrapper2.children.length;i++){const element=wrapper2.children[i];allClassesArr.length&&element.classList.remove(...allClassesArr),addClassesArr.length&&element.classList.add(...addClassesArr)}}if(config.onComplete)try{config.onComplete(wrapper2,section)}catch{console.log("error")}},moveAlong=(shown,productHandleQueue2,wrapper2,section)=>{productHandleQueue2.length&&shown<config.howManyToShow?fetch(`${window.theme.routes.root}products/${productHandleQueue2[0]}?section_id=api-product-grid-item`).then(response=>response.text()).then(product=>{const aosDelay=shown*150,aosImageDuration=shown*100+800,aosTextDuration=shown*50+800,anchorAnimation=wrapper2.id?`#${wrapper2.id}`:"",fresh=document.createElement("div");let productReplaced=product.includes("||itemIndex||")?product.replaceAll("||itemIndex||",shown):product;productReplaced=productReplaced.includes("||itemAosDelay||")?productReplaced.replaceAll("||itemAosDelay||",aosDelay):productReplaced,productReplaced=productReplaced.includes("||itemAosImageDuration||")?productReplaced.replaceAll("||itemAosImageDuration||",aosImageDuration):productReplaced,productReplaced=productReplaced.includes("||itemAosTextDuration||")?productReplaced.replaceAll("||itemAosTextDuration||",aosTextDuration):productReplaced,productReplaced=productReplaced.includes("||itemAnimationAnchor||")?productReplaced.replaceAll("||itemAnimationAnchor||",anchorAnimation):productReplaced,fresh.innerHTML=productReplaced,wrapper2.innerHTML+=fresh.querySelector("[data-api-content]").innerHTML,productHandleQueue2.shift(),shown++,moveAlong(shown,productHandleQueue2,wrapper2,section)}).catch(()=>{cookie.remove(productHandleQueue2[0]),productHandleQueue2.shift(),moveAlong(shown,productHandleQueue2,wrapper2,section)}):finalize(wrapper2,section)};return{showRecentlyViewed:function(params){const paramsNew=params||{},shown=0;Object.assign(config,paramsNew),productHandleQueue=cookie.read(),wrapper=document.querySelector(`#${config.wrapperId}`),howManyToShowItems=config.howManyToShow,config.howManyToShow=Math.min(productHandleQueue.length,config.howManyToShow),config.howManyToShow&&wrapper&&moveAlong(shown,productHandleQueue,wrapper,config.section)},getConfig:function(){return config},clearList:function(){cookie.destroy()},recordRecentlyViewed:function(params){Object.assign(config,params||{});let recentlyViewed=cookie.read();if(window.location.pathname.indexOf("/products/")!==-1){const productHandle=decodeURIComponent(window.location.pathname).match(/\/products\/([a-z0-9\-]|[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]|[\u4E00-\u9FAF]|[\u2605-\u2606]|[\u2190-\u2195]|[\u203B]|[\w\u0430-\u044f]|[\u0400-\u04FF]|[\u0900-\u097F]|[\u0590-\u05FF\u200f\u200e]|[\u0621-\u064A\u0660-\u0669 ])+/)[0].split("/products/")[1],position=recentlyViewed.indexOf(productHandle);position===-1?(recentlyViewed.unshift(productHandle),recentlyViewed=recentlyViewed.splice(0,config.howManyToStoreInMemory)):(recentlyViewed.splice(position,1),recentlyViewed.unshift(productHandle)),cookie.write(recentlyViewed)}},hasProducts:cookie.read().length>0}})();const getUrlString=(params,keys=[],isArray=!1)=>{const p=Object.keys(params).map(key=>{let val=params[key];if(Object.prototype.toString.call(val)==="[object Object]"||Array.isArray(val))return Array.isArray(params)?keys.push(""):keys.push(key),getUrlString(val,keys,Array.isArray(val));{let tKey=key;return keys.length>0&&(tKey=(isArray?keys:[...keys,key]).reduce((str,k)=>str===""?k:`${str}[${k}]`,"")),isArray?`${tKey}[]=${val}`:`${tKey}=${val}`}}).join("&");return keys.pop(),p},hideElement=elem=>{elem&&(elem.style.display="none")},fadeIn=(el,display,callback=null)=>{el.style.opacity=0,el.style.display=display||"block";let flag=!0;(function fade(){let val=parseFloat(el.style.opacity);(val+=.1)>1||(el.style.opacity=val,requestAnimationFrame(fade)),parseInt(val)===1&&flag&&typeof callback=="function"&&(flag=!1,callback())})()};typeof Shopify.Cart>"u"&&(Shopify.Cart={}),Shopify.Cart.ShippingCalculator=(function(){const _config={submitButton:theme.strings.shippingCalcSubmitButton,submitButtonDisabled:theme.strings.shippingCalcSubmitButtonDisabled,templateId:"shipping-calculator-response-template",wrapperId:"wrapper-response",customerIsLoggedIn:!1},_render=function(response){const template2=document.querySelector(`#${_config.templateId}`),wrapper=document.querySelector(`#${_config.wrapperId}`);if(template2&&wrapper){wrapper.innerHTML="";let ratesList="",ratesText="",successClass="error center",markup=template2.innerHTML;const rateRegex=/[^[\]]+(?=])/g;if(response.rates&&response.rates.length){let rateTemplate=rateRegex.exec(markup)[0];
8response.rates.forEach(rate=>{let rateHtml=rateTemplate;rateHtml=rateHtml.replace(/\|\|rateName\|\|/,rate.name),rateHtml=rateHtml.replace(/\|\|ratePrice\|\|/,Shopify.Cart.ShippingCalculator.formatRate(rate.price)),ratesList+=rateHtml})}if(response.success){successClass="success center";const createdNewElem=document.createElement("div");createdNewElem.innerHTML=template2.innerHTML;const noShippingElem=createdNewElem.querySelector("[data-template-no-shipping]");response.rates.length<1&&noShippingElem&&(ratesText=noShippingElem.getAttribute("data-template-no-shipping"))}else ratesText=response.errorFeedback;markup=markup.replace(rateRegex,"").replace("[]",""),markup=markup.replace(/\|\|ratesList\|\|/g,ratesList),markup=markup.replace(/\|\|successClass\|\|/g,successClass),markup=markup.replace(/\|\|ratesText\|\|/g,ratesText),wrapper.innerHTML+=markup}},_enableButtons=function(){const getRatesButton=document.querySelector(".get-rates");getRatesButton.removeAttribute("disabled"),getRatesButton.classList.remove("disabled"),getRatesButton.value=_config.submitButton},_disableButtons=function(){const getRatesButton=document.querySelector(".get-rates");getRatesButton.setAttribute("disabled","disabled"),getRatesButton.classList.add("disabled"),getRatesButton.value=_config.submitButtonDisabled},_getCartShippingRatesForDestination=function(shipping_address){const encodedShippingAddressData=encodeURI(getUrlString({shipping_address})),url=`${window.theme.routes.cart}/shipping_rates.json?${encodedShippingAddressData}`,request=new XMLHttpRequest;request.open("GET",url,!0),request.onload=function(){if(this.status>=200&&this.status<400){const rates=JSON.parse(this.response).shipping_rates;_onCartShippingRatesUpdate(rates,shipping_address)}else _onError(this)},request.onerror=function(){_onError(this)},request.send()},_fullMessagesFromErrors=function(errors){const fullMessages=[];for(const error in errors)for(const message of errors[error])fullMessages.push(error+" "+message);return fullMessages},_onError=function(XMLHttpRequest){hideElement(document.querySelector("#estimated-shipping"));const shippingChild=document.querySelector("#estimated-shipping em");if(shippingChild)for(;shippingChild.firstChild;)shippingChild.removeChild(shippingChild.firstChild);_enableButtons();let feedback="";const data=eval("("+XMLHttpRequest.responseText+")");data.message?feedback=data.message+"("+data.status+"): "+data.description:feedback="Error : "+_fullMessagesFromErrors(data).join("; "),feedback==="Error : country is not supported."&&(feedback="We do not ship to this destination."),_render({rates:[],errorFeedback:feedback,success:!1}),showElement(document.querySelector(`#${_config.wrapperId}`))},_onCartShippingRatesUpdate=function(rates,shipping_address){_enableButtons();let readable_address="";shipping_address.zip&&(readable_address+=shipping_address.zip+", "),shipping_address.province&&(readable_address+=shipping_address.province+", "),readable_address+=shipping_address.country;const shippingChild2=document.querySelector("#estimated-shipping em");rates.length&&shippingChild2&&(shippingChild2.textContent=rates[0].price=="0.00"?window.theme.strings.free:themeCurrency.formatMoney(rates[0].price,theme.moneyFormat)),_render({rates,address:readable_address,success:!0});const fadeElements=document.querySelectorAll(`#${_config.wrapperId}, #estimated-shipping`);fadeElements.length&&fadeElements.forEach(element=>{fadeIn(element)})},_init=function(){const getRatesButton=document.querySelector(".get-rates"),fieldsContainer=document.querySelector("#address_container"),selectCountry=document.querySelector("#address_country"),selectProvince=document.querySelector("#address_province"),htmlEl=document.querySelector("html");let locale="en";if(htmlEl.hasAttribute("lang")&&htmlEl.getAttribute("lang")!==""&&(locale=htmlEl.getAttribute("lang")),fieldsContainer&&themeAddresses.AddressForm(fieldsContainer,locale,{shippingCountriesOnly:!0}),selectCountry&&selectCountry.hasAttribute("data-default")&&selectProvince&&selectProvince.hasAttribute("data-default")&&selectCountry.addEventListener("change",function(){selectCountry.removeAttribute("data-default"),selectProvince.removeAttribute("data-default")}),getRatesButton&&(getRatesButton.addEventListener("click",function(e){_disableButtons();const wrapper=document.querySelector(`#${_config.wrapperId}`);for(;wrapper.firstChild;)wrapper.removeChild(wrapper.firstChild);hideElement(wrapper);const shippingAddress={};let elemCountryVal=selectCountry.value,elemProvinceVal=selectProvince.value;const elemCountryData=selectCountry.getAttribute("data-default-fullname");elemCountryVal===""&&elemCountryData&&elemCountryData!==""&&(elemCountryVal=elemCountryData);const elemProvinceData=selectProvince.getAttribute("data-default-fullname");elemProvinceVal===""&&elemProvinceData&&elemProvinceData!==""&&(elemProvinceVal=elemProvinceData),shippingAddress.zip=document.querySelector("#address_zip").value||"",shippingAddress.country=elemCountryVal||"",shippingAddress.province=elemProvinceVal||"",_getCartShippingRatesForDestination(shippingAddress)}),_config.customerIsLoggedIn&&getRatesButton.classList.contains("get-rates--trigger"))){const zipElem=document.querySelector("#address_zip");zipElem&&zipElem.value&&getRatesButton.dispatchEvent(new Event("click"))}};return{show:function(params){params=params||{},Object.assign(_config,params),document.addEventListener("DOMContentLoaded",function(){_init()})},getConfig:function(){return _config},formatRate:function(cents){return cents==="0.00"?window.theme.strings.free:themeCurrency.formatMoney(cents,theme.moneyFormat)}}})();function isVisible(el){var style=window.getComputedStyle(el);return style.display!=="none"&&style.visibility!=="hidden"}function forceFocus(element,options){options=options||{};var savedTabIndex=element.tabIndex;element.tabIndex=-1,element.dataset.tabIndex=savedTabIndex,element.focus(),typeof options.className<"u"&&element.classList.add(options.className),element.addEventListener("blur",callback);function callback(event){event.target.removeEventListener(event.type,callback),element.tabIndex=savedTabIndex,delete element.dataset.tabIndex,typeof options.className<"u"&&element.classList.remove(options.className)}}function focusHash(options){options=options||{};var hash=window.location.hash,element=document.getElementById(hash.slice(1));if(element&&options.ignore&&element.matches(options.ignore))return!1;hash&&element&&forceFocus(element,options)}function bindInPageLinks(options){options=options||{};var links=Array.prototype.slice.call(document.querySelectorAll('a[href^="#"]'));function queryCheck(selector){return document.getElementById(selector)!==null}return links.filter(function(link){if(link.hash==="#"||link.hash===""||options.ignore&&link.matches(options.ignore)||!queryCheck(link.hash.substr(1)))return!1;var element=document.querySelector(link.hash);return element?(link.addEventListener("click",function(){forceFocus(element,options)}),!0):!1})}function focusable(container){var elements=Array.prototype.slice.call(container.querySelectorAll("[tabindex],[draggable],a[href],area,button:enabled,input:not([type=hidden]):enabled,object,select:enabled,textarea:enabled"));return elements.filter(function(element){return!!((element.offsetWidth||element.offsetHeight||element.getClientRects().length)&&isVisible(element))})}var trapFocusHandlers={};function trapFocus(container,options){options=options||{};var elements=focusable(container),elementToFocus=options.elementToFocus||container,first=elements[0],last=elements[elements.length-1];removeTrapFocus(),trapFocusHandlers.focusin=function(event){container!==event.target&&!container.contains(event.target)&&first&&first===event.target&&first.focus(),!(event.target!==container&&event.target!==last&&event.target!==first)&&document.addEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.focusout=function(){document.removeEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.keydown=function(event){event.keyCode===window.theme.keyboardKeys.TAB&&(event.target===last&&!event.shiftKey&&(event.preventDefault(),first.focus()),(event.target===container||event.target===first)&&event.shiftKey&&(event.preventDefault(),last.focus()))},document.addEventListener("focusout",trapFocusHandlers.focusout),document.addEventListener("focusin",trapFocusHandlers.focusin),forceFocus(elementToFocus,options)}function removeTrapFocus(){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown)}function accessibleLinks(elements,options){if(typeof elements!="str
8ing")throw new TypeError(elements+" is not a String.");if(elements=document.querySelectorAll(elements),elements.length===0)return;options=options||{},options.messages=options.messages||{};var messages={newWindow:options.messages.newWindow||"Opens in a new window.",external:options.messages.external||"Opens external website.",newWindowExternal:options.messages.newWindowExternal||"Opens external website in a new window."},prefix=options.prefix||"a11y",messageSelectors={newWindow:prefix+"-new-window-message",external:prefix+"-external-message",newWindowExternal:prefix+"-new-window-external-message"};function generateHTML(messages2){var container=document.createElement("ul"),htmlMessages=Object.keys(messages2).reduce(function(html,key){return html+="<li id="+messageSelectors[key]+">"+messages2[key]+"</li>"},"");container.setAttribute("hidden",!0),container.innerHTML=htmlMessages,document.body.appendChild(container)}function externalSite(link){return link.hostname!==window.location.hostname}elements.forEach(function(link){var target=link.getAttribute("target"),rel=link.getAttribute("rel"),isExternal=externalSite(link),isTargetBlank=target==="_blank",missingRelNoopener=rel===null||rel.indexOf("noopener")===-1;if(isTargetBlank&&missingRelNoopener){var relValue=rel===null?"noopener":rel+" noopener";link.setAttribute("rel",relValue)}isExternal&&isTargetBlank?link.setAttribute("aria-describedby",messageSelectors.newWindowExternal):isExternal?link.setAttribute("aria-describedby",messageSelectors.external):isTargetBlank&&link.setAttribute("aria-describedby",messageSelectors.newWindow)}),generateHTML(messages)}var a11y=Object.freeze({__proto__:null,forceFocus,focusHash,bindInPageLinks,focusable,trapFocus,removeTrapFocus,accessibleLinks});const slideDown=(target,duration=500,showDisplay="block",checkHidden=!0)=>{let display=window.getComputedStyle(target).display;if(checkHidden&&display!=="none")return;target.style.removeProperty("display"),display==="none"&&(display=showDisplay),target.style.display=display;let height=target.offsetHeight;target.style.overflow="hidden",target.style.height=0,target.style.paddingTop=0,target.style.paddingBottom=0,target.style.marginTop=0,target.style.marginBottom=0,target.offsetHeight,target.style.boxSizing="border-box",target.style.transitionProperty="height, margin, padding",target.style.transitionDuration=duration+"ms",target.style.height=height+"px",target.style.removeProperty("padding-top"),target.style.removeProperty("padding-bottom"),target.style.removeProperty("margin-top"),target.style.removeProperty("margin-bottom"),window.setTimeout(()=>{target.style.removeProperty("height"),target.style.removeProperty("overflow"),target.style.removeProperty("transition-duration"),target.style.removeProperty("transition-property")},duration)},slideUp=(target,duration=500)=>{target.style.transitionProperty="height, margin, padding",target.style.transitionDuration=duration+"ms",target.style.boxSizing="border-box",target.style.height=target.offsetHeight+"px",target.offsetHeight,target.style.overflow="hidden",target.style.height=0,target.style.paddingTop=0,target.style.paddingBottom=0,target.style.marginTop=0,target.style.marginBottom=0,window.setTimeout(()=>{target.style.display="none",target.style.removeProperty("height"),target.style.removeProperty("padding-top"),target.style.removeProperty("padding-bottom"),target.style.removeProperty("margin-top"),target.style.removeProperty("margin-bottom"),target.style.removeProperty("overflow"),target.style.removeProperty("transition-duration"),target.style.removeProperty("transition-property")},duration)},slideToggle=(target,duration=500,showDisplay="block")=>window.getComputedStyle(target).display==="none"?slideDown(target,duration,showDisplay):slideUp(target,duration);function FetchError(object){this.status=object.status||null,this.headers=object.headers||null,this.json=object.json||null,this.body=object.body||null}FetchError.prototype=Error.prototype;function fetchProduct(handle){const requestRoute=`${window.theme.routes.root}products/${handle}.js`;return window.fetch(requestRoute).then(response=>response.json()).catch(e=>{console.error(e)})}const selectors={saleClass:"sale",soldClass:"sold-out",doubleImage:"double__image"};function formatPrices(product){const on_sale=product.price<=product.compare_at_price_min;let classes2=on_sale?selectors.saleClass:"";if(classes2+=product.available?"":selectors.soldClass,product.price=product.price===0?window.theme.strings.free:themeCurrency.formatMoney(product.price,theme.moneyFormat),product.price_with_from=product.price,product.price_varies){const min=product.price_min===0?window.theme.strings.free:themeCurrency.formatMoney(product.price_min,theme.moneyFormat);product.price_with_from=`<small>${window.theme.strings.from}</small> ${min}`}let double_class="";return product.media!==void 0&&product.media.length>1&&(double_class+=selectors.doubleImage),{...product,classes:classe
8s2,on_sale,double_class,sold_out:!product.available,sold_out_translation:window.theme.strings.soldOut,compare_at_price:themeCurrency.formatMoney(product.compare_at_price,theme.moneyFormat),compare_at_price_max:themeCurrency.formatMoney(product.compare_at_price_max,theme.moneyFormat),compare_at_price_min:themeCurrency.formatMoney(product.compare_at_price_min,theme.moneyFormat),price_max:themeCurrency.formatMoney(product.price_max,theme.moneyFormat),price_min:themeCurrency.formatMoney(product.price_min,theme.moneyFormat),unit_price:themeCurrency.formatMoney(product.unit_price,theme.moneyWithoutCurrencyFormat)}}const selectors$1={template:"[pair-product-template]",pairProducts:"[data-pair-products]",upsellButton:"[data-upsell-btn]",upsellButtonText:"[data-upsell-btn-text]"};class PairWithProduct{constructor(handle){this.handle=handle,this.template=document.querySelector(selectors$1.template).innerHTML,this.pairProducts=document.querySelector(selectors$1.pairProducts),this.resizeEventUpsell=()=>this.calcUpsellButtonDemensions(),this.variant=null,this.variantObject=null,this.init()}init(){if(this.handle.includes("_")){const parts=this.handle.split("_");this.handle=parts[0],this.variant=parts[1]}this.upsellButtonDemensionsListener(),fetchProduct(this.handle).then(response=>{if(response===void 0){document.dispatchEvent(new CustomEvent("theme:upsell:fetch-error"));return}const formatted=formatPrices(response);let availableVariant=!1;this.variant!==null&&formatted.variants.filter(variant=>(variant.id===Number(this.variant)&&variant.available&&(this.variantObject=variant,availableVariant=!0),variant)),formatted.available&&this.variant===null?this.renderPairProduct(formatted):availableVariant?this.renderPairProduct(formatted):(this.pairProducts.innerHTML="",document.dispatchEvent(new CustomEvent("theme:upsell:unavailable")))}).catch(e=>{console.error(e)})}renderPairProduct(formatted){const productMarkup=this.renderProduct(formatted);this.pairProducts.innerHTML=productMarkup,this.calcUpsellButtonDemensions()}upsellButtonDemensionsListener(){document.addEventListener("theme:resize",this.resizeEventUpsell)}calcUpsellButtonDemensions(){const upsellButtonText=this.pairProducts.querySelector(selectors$1.upsellButtonText),button=this.pairProducts.querySelector(selectors$1.upsellButton);upsellButtonText&&button.style.setProperty("--btn-text-width",`${upsellButtonText.clientWidth}px`)}renderProduct(currentProduct){let media=null,image="",firstAvailableVariant="",hasVariants=!0,hasUnitPrice=!1;if(currentProduct.media!==void 0&&(media=currentProduct.media[0]),this.variantObject!==null&&this.variantObject.featured_media!==void 0&&(media=this.variantObject.featured_media),currentProduct.options[0].name==="Title"&¤tProduct.options.length===1&¤tProduct.options[0].values[0]==="Default Title"&&(hasVariants=!1),this.variantObject===null)for(let index=0;index<currentProduct.variants.length;index++){const variant=currentProduct.variants[index];if(variant.available){const title2=variant.title.replaceAll("/","<span> </span>");hasUnitPrice=variant.unit_price!==void 0,firstAvailableVariant={...formatPrices(variant),title:title2,hasUnitPrice};break}}if(this.variantObject!==null){const title2=this.variantObject.title.replaceAll("/","<span> </span>");hasUnitPrice=this.variantObject.unit_price!==void 0,firstAvailableVariant={...formatPrices(this.variantObject),title:title2,hasUnitPrice}}if(firstAvailableVariant==="")return"";const title=currentProduct.title.replace(/(<([^>]+)>)/gi,"");firstAvailableVariant.unit_price_measurement&&(firstAvailableVariant.unitValue=firstAvailableVariant.unit_price_measurement.reference_unit,firstAvailableVariant.unit_price_measurement.reference_value!==1&&(firstAvailableVariant.unitCount=firstAvailableVariant.unit_price_measurement.reference_value)),firstAvailableVariant.featured_media?image={thumb:themeImages.getSizedImageUrl(firstAvailableVariant.featured_media.preview_image.src,"240x240")}:media?image={thumb:themeImages.getSizedImageUrl(media.preview_image.src,"240x240")}:image={thumb:window.theme.assets.no_image};
8const updateValues={...currentProduct,title,image,firstAvailableVariant,hasVariants,addToCartText:theme.strings.upsellAddToCart,unitPriceLabel:theme.strings.unitPrice,unitPriceSeparator:theme.strings.unitPriceSeparator};return Sqrl.render(this.template,{product:updateValues})}}const selectors$2={quantityHolder:"[data-quantity-holder]",quantityField:"[data-quantity-field]",quantityButton:"[data-quantity-button]",quantityMinusButton:"[data-quantity-minus]",quantityPlusButton:"[data-quantity-plus]",quantityReadOnly:"read-only",isDisabled:"is-disabled"};class QuantityCounter{constructor(holder,inCart=!1){this.holder=holder,this.quantityUpdateCart=inCart}init(){this.settings=selectors$2,this.quantity=this.holder.querySelector(this.settings.quantityHolder),this.quantity&&(this.field=this.quantity.querySelector(this.settings.quantityField),this.buttons=this.quantity.querySelectorAll(this.settings.quantityButton),this.increaseButton=this.quantity.querySelector(this.settings.quantityPlusButton),this.quantityValue=Number(this.field.value||0),this.cartItemID=this.field.getAttribute("data-id"),this.maxValue=Number(this.field.getAttribute("max"))>0?Number(this.field.getAttribute("max")):null,this.minValue=Number(this.field.getAttribute("min"))>0?Number(this.field.getAttribute("min")):0,this.disableIncrease=this.disableIncrease.bind(this),this.emptyField=!1,this.updateQuantity=this.updateQuantity.bind(this),this.decrease=this.decrease.bind(this),this.increase=this.increase.bind(this),this.disableIncrease(),this.quantity.classList.contains(this.settings.quantityReadOnly)||(this.changeValueOnClick(),this.changeValueOnInput()))}changeValueOnClick(){const that=this;this.buttons.forEach(element=>{element.addEventListener("click",event=>{event.preventDefault();const clickedElement=event.target,isDescrease=clickedElement.matches(that.settings.quantityMinusButton)||clickedElement.closest(that.settings.quantityMinusButton),isIncrease=clickedElement.matches(that.settings.quantityPlusButton)||clickedElement.closest(that.settings.quantityPlusButton);isDescrease&&that.decrease(),isIncrease&&that.increase(),that.updateQuantity()})})}changeValueOnInput(){const that=this;this.field.addEventListener("input",function(){that.quantityValue=this.value,this.value===""&&(that.emptyField=!0),that.updateQuantity()},this)}updateQuantity(){this.maxValue<this.quantityValue&&this.maxValue!==null&&(this.quantityValue=this.maxValue),this.minValue>this.quantityValue&&(this.quantityValue=this.minValue),this.field.value=this.quantityValue,this.disableIncrease(),document.dispatchEvent(new CustomEvent("theme:popout:update")),this.quantityUpdateCart&&this.updateCart()}decrease(){if(this.quantityValue>this.minValue){this.quantityValue--;return}this.quantityValue=0}increase(){this.quantityValue++}disableIncrease(){this.increaseButton.classList.toggle(this.settings.isDisabled,this.quantityValue>=this.maxValue&&this.maxValue!==null)}updateCart(){const event=new CustomEvent("theme:cart:update",{bubbles:!0,detail:{id:this.cartItemID,quantity:this.quantityValue,valueIsEmpty:this.emptyField}});this.holder.dispatchEvent(event)}}const classes={active:"is-active",added:"is-added",disabled:"is-disabled",drawerVisible:"drawer--visible",error:"has-error",headerStuck:"js__header__stuck",hidden:"is-hidden",htmlClasses:"has-open-cart-dropdown",loading:"is-loading",open:"is-open",success:"is-success",visible:"is-visible",focused:"is-focused"},attributes={transparent:"data-header-transparent",upsellButton:"data-upsell-btn"},selectors$3={additionalCheckoutButtons:".additional-checkout-buttons",burgerButton:"[data-drawer-toggle]",buttonAddToCart:"[data-add-to-cart]",buttonHolder:"[data-foot-holder]",buttonSkipPairProduct:"[data-skip-pair-product]",cartCloseError:"[data-cart-error-close]",cartCount:"[data-cart-count]",cartCountValue:"data-cart-count",cartDiscountsHolder:"[data-cart-discounts-holder]",cartDropdown:"[data-cart-dropdown]",cartDropdownBody:"[data-cart-dropdown-body]",cartEmpty:"[data-cart-empty]",cartErrors:"[data-cart-errors]",cartItemRemove:"[data-item-remove]",cartMessage:"[data-cart-message]",cartMessageValue:"data-cart-message",cartOriginalTotal:"[data-cart-original-total]",cartOriginaTotalPrice:"[data-cart-original-total-price]",cartProgress:"[data-cart-progress]",cartToggleElement:"[data-cart-toggle]",cartTotal:"[data-cart-total]",cartTotalDiscountsTemplate:"[data-cart-total-discount]",cartWidget:"[data-cart-widget]",clickedElementForExpanding:"[data-expand-button]",errorMessage:"[data-error-message]",formCloseError:"[data-close-error]",formErrorsContainer:"[data-cart-errors-container]",headerWrapper:"[data-header-wrapper]",item:"[data-item]",itemsHolder:"[data-items-holder]",leftToSpend:"[data-left-to-spend]",navDrawer:"[data-drawer]",outerSection:"[data-section-id]",pairProducts:"[data-pair-products]",pairProductsHolder:"[data-pair-products-holder]",pairProductsScript:"[data-pair-products-script]",productIDAttribute:"data-product-id",quickAddHolder:"[data-quick-add-h
8older]",upsellHolder:"[data-upsell-holder]",upsellModal:"[data-upsell-modal]"},settings={cartDrawerEnabled:window.theme.settings.cartDrawerEnabled,times:{timeoutAddProduct:1e3,closeDropdownAfter:5e3}};class CartDrawer{constructor(){window.location.pathname.endsWith("/password")||this.init()}init(){this.html=document.documentElement,this.body=document.body,this.cartDropdown=document.querySelector(selectors$3.cartDropdown),this.cartDropdownBody=document.querySelector(selectors$3.cartDropdownBody),this.cartEmpty=document.querySelector(selectors$3.cartEmpty),this.buttonHolder=document.querySelector(selectors$3.buttonHolder),this.itemsHolder=document.querySelector(selectors$3.itemsHolder),this.items=document.querySelectorAll(selectors$3.item),this.counterHolders=document.querySelectorAll(selectors$3.cartCount),this.cartTotal=document.querySelector(selectors$3.cartTotal),this.cartMessage=document.querySelectorAll(selectors$3.cartMessage),this.cartOriginalTotal=document.querySelector(selectors$3.cartOriginalTotal),this.cartOriginaTotalPrice=document.querySelector(selectors$3.cartOriginaTotalPrice),this.cartDiscountHolder=document.querySelector(selectors$3.cartDiscountsHolder),this.clickedElementForExpanding=document.querySelectorAll(selectors$3.clickedElementForExpanding),this.cartTotalDiscountTemplate=document.querySelector(selectors$3.cartTotalDiscountsTemplate).innerHTML,this.cartErrorHolder=document.querySelector(selectors$3.cartErrors),this.cartCloseErrorMessage=document.querySelector(selectors$3.cartCloseError),this.headerWrapper=document.querySelector(selectors$3.headerWrapper),this.accessibility=a11y,this.navDrawer=document.querySelector(selectors$3.navDrawer),this.pairProductsHolder=document.querySelector(selectors$3.pairProductsHolder),this.pairProducts=document.querySelector(selectors$3.pairProducts),this.form=null,this.build=this.build.bind(this),this.addToCart=this.addToCart.bind(this),this.updateCart=this.updateCart.bind(this),this.openCartDropdown=this.openCartDropdown.bind(this),this.closeCartDropdown=this.closeCartDropdown.bind(this),this.toggleCartDropdown=this.toggleCartDropdown.bind(this),this.hasItemsInCart=this.hasItemsInCart.bind(this),this.toggleClassesOnContainers=this.toggleClassesOnContainers.bind(this),this.cartDropdownIsBuilded=this.items.length>0,this.totalItems=this.cartDropdownIsBuilded,this.cartDropdownIsOpen=!1,this.cartDiscounts=0,this.cartDrawerEnabled=settings.cartDrawerEnabled,this.cartLimitErrorIsHidden=!0,this.eventToggleCart(),this.expandEvents(),this.cartEvents(),this.cartEventAdd(),this.cartEventRemoveError(),this.initQuantity(),this.customEventAddProduct(),this.estimateShippingCalculator(),this.cartMessage.length>0&&(this.cartFreeLimitShipping=Number(this.cartMessage[0].getAttribute("data-limit"))*100*window.Shopify.currency.rate,this.subtotal=window.theme.subtotal,this.circumference=28*Math.PI,this.freeShippingMessageHandle(this.subtotal),this.updateProgress()),this.pairWithArray=window.pairWithProducts,this.sessionStorage=window.sessionStorage,this.getAvailablePairProducts(),this.renderPairProducts(),this.skipPairProductEvent(),document.addEventListener("theme:upsell:unavailable",()=>{this.checkPairProductIsSoldOut()})}initQuantity(){this.items=document.querySelectorAll(selectors$3.item),this.items.forEach(item=>{new QuantityCounter(item,!0).init(),this.customEventsHandle(item)})}expandEvents(){const holders=document.querySelectorAll(selectors$3.cartWidget);this.clickedElementForExpanding.forEach(item=>{item.addEventListener("click",event=>{event.preventDefault();const holder=document.querySelector(item.getAttribute("href"));item.classList.toggle(classes.active),slideToggle(holder,400),holders.length>1&&holders.forEach(content=>{if(content!==holder.parentElement){const buttonExpand=content.querySelector(selectors$3.clickedElementForExpanding);buttonExpand.classList.remove(classes.active),slideUp(buttonExpand.nextElementSibling,400)}})})})}customEventsHandle(holder){holder.addEventListener("theme:cart:update",debounce(event=>{this.updateCart({id:event.detail.id,quantity:event.detail.quantity},holder,event.detail.valueIsEmpty)},500))}customEventAddProduct(){this.html.addEventListener("theme:cart:add",debounce(event=>{this.addToCart(`id=${event.detail.data.id}`,event.detail)},500))}cartEvents(){document.querySelectorAll(selectors$3.cartItemRemove).forEach(item=>{item.addEventListener("click",event=>
8{event.preventDefault(),!item.classList.contains(classes.disabled)&&(item.classList.add(classes.disabled),this.updateCart({id:item.dataset.id,quantity:0}))})}),this.cartCloseErrorMessage&&this.cartCloseErrorMessage.addEventListener("click",event=>{event.preventDefault(),slideUp(this.cartErrorHolder,400)})}cartEventAdd(){document.addEventListener("click",event=>{const clickedElement=event.target;if(clickedElement.matches(selectors$3.buttonAddToCart)||clickedElement.closest(selectors$3.buttonAddToCart)&&clickedElement){let formData="",button=clickedElement.matches(selectors$3.buttonAddToCart)?clickedElement:clickedElement.closest(selectors$3.buttonAddToCart);if(button.hasAttribute(selectors$3.productIDAttribute)?formData=`id=${Number(button.getAttribute(selectors$3.productIDAttribute))}`:(this.form=clickedElement.closest("form"),formData=new FormData(this.form),formData=new URLSearchParams(formData).toString()),this.form!==null&&this.form.querySelector('[type="file"]')||(event.preventDefault(),clickedElement.hasAttribute("disabled")||clickedElement.parentNode.hasAttribute("disabled")))return;this.addToCart(formData,null,button),this.html.dispatchEvent(new CustomEvent("theme:cart:add-item",{bubbles:!0,detail:{selector:clickedElement}}))}})}cartEventRemoveError(){document.addEventListener("click",event=>{const clickedElement=event.target;if(clickedElement.matches(selectors$3.formCloseError)||clickedElement.closest(selectors$3.formCloseError)){event.preventDefault();const errorContainer=clickedElement.closest(selectors$3.formErrorsContainer);errorContainer&&errorContainer.classList.remove(classes.visible)}})}estimateShippingCalculator(){Shopify.Cart.ShippingCalculator.show({submitButton:theme.strings.shippingCalcSubmitButton,submitButtonDisabled:theme.strings.shippingCalcSubmitButtonDisabled,customerIsLoggedIn:theme.settings.customerLoggedIn,moneyFormat:theme.moneyWithCurrencyFormat})}getCart(){fetch(theme.routes.root+"cart.js").then(this.handleErrors).then(response=>response.json()).then(response=>(this.updateCounter(response.item_count),this.newTotalItems=response.items.length,this.buildTotalPrice(response),this.freeShippingMessageHandle(response.total_price),this.cartMessage.length>0&&(this.subtotal=response.total_price,this.updateProgress()),fetch(theme.routes.cart+"?section_id=api-cart-items"))).then(response=>response.text()).then(response=>{const element=document.createElement("div");element.innerHTML=response,element.querySelector(selectors$3.pairProductsScript)?this.pairWithArray=JSON.parse(element.querySelector(selectors$3.pairProductsScript).innerText.split("=")[1].replace(";","")):this.pairWithArray=void 0,this.getAvailablePairProducts(),this.renderPairProducts();const cleanResponse=element.querySelector("[data-api-content]").innerHTML;this.build(cleanResponse)}).catch(error=>console.log(error))}addToCart(data2,quickAddHolder=null,button=null,json=null){this.form===null&&quickAddHolder!==null&&quickAddHolder.label&&(this.form=quickAddHolder.label.parentNode.querySelector("form")),this.cartDrawerEnabled&&button&&button.classList.add(classes.loading),fetch(theme.routes.root+"cart/add.js",{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/x-www-form-urlencoded"},body:data2}).then(response=>response.json()).then(response=>{if(button&&button.setAttribute("disabled","disabled"),response.status){quickAddHolder!==null?this.addToCartError(response,quickAddHolder.element,button):this.addToCartError(response,null,button);return}this.cartDrawerEnabled?(quickAddHolder!==null&&quickAddHolder.label&&(quickAddHolder.label.classList.remove(classes.hidden,classes.loading),quickAddHolder.label.classList.add(classes.added)),this.getCart(),setTimeout(()=>{button!==null&&(button.classList.remove(classes.loading),button.removeAttribute("disabled"),button.classList.add(classes.success),document.dispatchEvent(new CustomEvent("theme:product:button-update",{detail:{response},bubbles:!1})),button.closest(selectors$3.pairProductsHolder)&&setTimeout(()=>{button.classList.remove(classes.success)},settings.times.timeoutAddProduct*2)),this.cartDropdown&&(this.openCartDropdown(),this.cartDropdownIsOpen=!0)},settings.times.timeoutAddProduct)):window.location=theme.routes.cart}).catch(error=>console.log(error))}updateCart(updateData={},holder=null,valueIsEmpty=!1){let newCount=null,oldCount=null,newItem=null,settedQuantity=updateData.quantity;holder!==null&&holder.closest(selectors$3.item).classList.add(classes.loading),this.items.forEac
8h(item=>{const itemInput=item.querySelector("input"),itemButtons=item.querySelectorAll("button");item.classList.add(classes.disabled),itemInput.blur(),itemInput.disabled=!0,itemButtons.length&&itemButtons.forEach(itemButton=>{itemButton.disabled=!0})}),fetch(theme.routes.root+"cart.js").then(this.handleErrors).then(response=>response.json()).then(response=>{const matchKeys=item=>item.key===updateData.id,index=response.items.findIndex(matchKeys);oldCount=response.item_count,newItem=response.items[index].title;const data2={line:`${index+1}`,quantity:settedQuantity};return fetch(theme.routes.root+"cart/change.js",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(data2)})}).then(this.handleErrors).then(response=>response.json()).then(response=>{newCount=response.item_count,valueIsEmpty&&(settedQuantity=1),settedQuantity!==0&&(this.cartLimitErrorIsHidden=newCount!==oldCount,this.toggleLimitError(newItem)),this.updateCounter(newCount),this.buildTotalPrice(response),this.freeShippingMessageHandle(response.total_price),this.cartDiscounts=response.total_discount,this.cartMessage.length>0&&(this.subtotal=response.total_price,this.updateProgress()),this.getCart()}).catch(error=>console.log(error))}toggleLimitError(itemTitle){this.cartErrorHolder.querySelector(selectors$3.errorMessage).innerText=itemTitle,this.cartLimitErrorIsHidden?slideUp(this.cartErrorHolder,400):slideDown(this.cartErrorHolder,400)}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}addToCartError(data2,quickAddHolder,button){let errorContainer=null;this.cartDrawerEnabled&&button&&button.closest(selectors$3.cartDropdown)!==null&&!button.closest(selectors$3.cartDropdown)&&this.closeCartDropdown(),button!==null&&(errorContainer=(button.closest(selectors$3.outerSection)||button.closest(selectors$3.upsellHolder)||button.closest(selectors$3.upsellModal))?.querySelector(selectors$3.formErrorsContainer),button.classList.remove(classes.loading),button.removeAttribute("disabled"),document.dispatchEvent(new CustomEvent("theme:product:button-update",{detail:{response:data2},bubbles:!1}))),errorContainer&&(errorContainer.innerHTML=`<div class="errors">${data2.message}: ${data2.description}<span class="errors__close" data-close-error><svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-close-thin" viewBox="0 0 27 27"><g stroke="#979797" fill="none" fill-rule="evenodd" stroke-linecap="square"><path d="M.5.5l26 26M26.5.5l-26 26"></path></g></svg></span></div>`,errorContainer.classList.add(classes.visible),document.dispatchEvent(new CustomEvent("theme:product:button-error",{bubbles:!1}))),quickAddHolder&&this.html.dispatchEvent(new CustomEvent("theme:cart:error",{bubbles:!0,detail:{message:data2.message,description:data2.description,holder:quickAddHolder}}))}openCartDropdown(){document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.cartDropdown})),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.cartDropdownBody})),this.html.classList.add(classes.htmlClasses),this.cartDropdown.classList.add(classes.open),this.accessibility.trapFocus(this.cartDropdown,{elementToFocus:this.cartDropdown.querySelector(selectors$3.cartToggleElement)}),this.cartDropdownIsBuilded||this.getCart(),this.observeAdditionalCheckoutButtons()}closeCartDropdown(){if(document.dispatchEvent(new CustomEvent("theme:cart:close",{bubbles:!0})),this.accessibility.removeTrapFocus(),slideUp(this.cartErrorHolder,400),this.body.classList.contains(classes.focused)){const buttonOpenCart=this.headerWrapper.querySelectorAll(`${selectors$3.cartToggleElement}`);buttonOpenCart.length&&buttonOpenCart.forEach(button=>{if(isVisible(button))return setTimeout(()=>{button.focus()},200),!0})}const upsellButton=document.querySelector(`[${attributes.upsellButton}].${classes.success}`);upsellButton&&setTimeout(()=>{upsellButton.classList.remove(classes.success)},2e3),this.html.classList.remove(classes.htmlClasses),this.cartDropdown.classList.remove(classes.open),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}toggleCartDropdown(){this.cartDropdownIsOpen=!this.cartDropdownIsOpen,this.cartDropdownIsOpen?this.openCartDropdown():this.closeCartDropdown()}eventToggleCart(){document.addEventListener("click",event=>{const clickedElement=event.target,isNotCartButton=!(clickedElement.matches(selectors$3.cartToggleElement)||clickedElement.closest(selectors$3.cartToggleElement)),isNotCartDropdownOrCartDropdownChild=!(clickedElement.matches(selectors$3.cartDropdown)||clickedElement.closest(selectors$3.cartDropdown)),isNotPairProduct=!(clickedElement.matches(selectors$3.buttonSkipPairProduct)||clickedElement.closest(selectors$3.buttonSkipPairProduct));clickedElement.matches(selectors$3.cartToggleElement)||clickedElement.closest(selectors$3.cartToggleElement)?(event.preventDefault(),this.toggleCartDropdown()):this.cartDropdownIsOpen&&isNotCartButton&&isNotCartDropdownOrCartDropdownChild&&isNotPairProduct&&(this.cartDropdownIsOpen=!1,this.closeCartDropdown())}),this.cartDropdown&&this.cartDropdown.addEventListener("keyup",event=>{event.which===window.theme.keyboardKeys.ESCAPE&&(this.cartDropdownIsOpen=!1,this.closeCartDropdown())})}toggleClassesOnContainers(){this.cartEmpty.classList.toggle(classes.hidden,this.hasItemsInCart()),this.buttonHolder.classList.toggle(classes.hidden,!this.hasItemsInCart()),this.itemsHolder.classList.toggle(classes.hidden,!this.hasItemsInCart())}build(data2){this.totalItems!==this.newTotalItems&&(this.totalItems=this.newTotalItems,this.toggleClassesOnContainers()),this.itemsHolder.innerHTML=data2,this.cartEvents(),this.initQuantity()}updateCounter(countItems){this.counterHolders.length&&this.counterHolders.forEac
8h(holder=>{holder.innerHTML=countItems<10?countItems:"9+",holder.setAttribute(selectors$3.cartCountValue,countItems)})}hasItemsInCart(){return this.totalItems>0}buildTotalPrice(data2){if(data2.original_total_price>data2.total_price&&data2.cart_level_discount_applications.length>0?(this.cartOriginalTotal.classList.remove(classes.hidden),this.cartOriginaTotalPrice.innerHTML=data2.original_total_price===0?window.theme.strings.free:themeCurrency.formatMoney(data2.original_total_price,theme.moneyFormat)):this.cartOriginalTotal.classList.add(classes.hidden),this.cartTotal.innerHTML=data2.total_price===0?window.theme.strings.free:themeCurrency.formatMoney(data2.total_price,theme.moneyWithCurrencyFormat),data2.cart_level_discount_applications.length>0){const discountsMarkup=this.buildCartTotalDiscounts(data2.cart_level_discount_applications);this.cartDiscountHolder.classList.remove(classes.hidden),this.cartDiscountHolder.innerHTML=discountsMarkup}else this.cartDiscountHolder.classList.add(classes.hidden)}buildCartTotalDiscounts(discounts){let discountMarkup="";return discounts.forEach(discount=>{discountMarkup+=Sqrl.render(this.cartTotalDiscountTemplate,{discountTitle:discount.title,discountTotalAllocatedAmount:themeCurrency.formatMoney(discount.total_allocated_amount,theme.moneyFormat)})}),discountMarkup}freeShippingMessageHandle(total){this.cartMessage.length>0&&document.querySelectorAll(selectors$3.cartMessage).forEach(message=>{const hasQualifiedShippingMessage=message.hasAttribute(selectors$3.cartMessageValue)&&message.getAttribute(selectors$3.cartMessageValue)==="true"&&total!==0;message.classList.toggle(classes.success,hasQualifiedShippingMessage&&total>=this.cartFreeLimitShipping),message.classList.toggle(classes.hidden,total===0||!hasQualifiedShippingMessage)})}cartBarProgress(progress=null){document.querySelectorAll(selectors$3.cartProgress).forEach(element=>{this.setProgress(element,progress===null?element.getAttribute("data-percent"):progress)})}setProgress(holder,percent){const offset=this.circumference-percent/100*this.circumference/2;holder.style.strokeDashoffset=offset}updateProgress(){const newPercentValue=this.subtotal/this.cartFreeLimitShipping*100,leftToSpend=themeCurrency.formatMoney(this.cartFreeLimitShipping-this.subtotal,theme.moneyFormat);document.querySelectorAll(selectors$3.leftToSpend).forEach(element=>{element.innerHTML=leftToSpend}),this.cartBarProgress(newPercentValue>100?100:newPercentValue)}renderPairProducts(){if(this.pairProductsHolder!==null){if(this.pairWithArray===void 0||this.pairWithArray.length<=0){this.pairProductsHolder.classList.add(classes.hidden);return}new PairWithProduct(this.pairWithArray[0]),document.addEventListener("theme:upsell:fetch-error",()=>{this.checkPairProductIsSoldOut()}),this.pairProductsHolder.classList.remove(classes.hidden)}}getAvailablePairProducts(){this.pairWithArray!==void 0&&this.sessionStorage!==void 0&&this.sessionStorage.getItem("pair_products")!==null&&(this.pairWithArray=this.pairWithArray.filter(handle=>this.sessionStorage.getItem("pair_products").indexOf(`,${handle},`)===-1))}skipPairProductEvent(){this.pairProductsHolder!==null&&this.pairProductsHolder.addEventListener("click",event=>{const target=event.target;(target.matches(selectors$3.buttonSkipPairProduct)||target.closest(selectors$3.buttonSkipPairProduct))&&(event.preventDefault(),this.sessionStorage!==void 0&&this.sessionStorage.setItem("pair_products",this.sessionStorage.getItem("pair_products")!==null?`${this.sessionStorage.getItem("pair_products")},${this.pairWithArray[0]},`:`,${this.pairWithArray[0]},`),this.getAvailablePairProducts(),this.pairWithArray.length<=0?this.pairProductsHolder.classList.add(classes.hidden):new PairWithProduct(this.pairWithArray[0]))})}checkPairProductIsSoldOut(){this.sessionStorage!==void 0&&(this.sessionStorage.setItem("pair_products",this.sessionStorage.getItem("pair_products")!==null?`${this.sessionStorage.getItem("pair_products")},${this.pairWithArray[0]},`:`,${this.pairWithArray[0]},`),this.getAvailablePairProducts(),this.pairWithArray.length<=0?this.pairProductsHolder.classList.add(classes.hidden):this.renderPairProducts())}observeAdditionalCheckoutButtons(){const additionalCheckoutButtons=this.cartDropdown.querySelector(selectors$3.additionalCheckoutButtons);if(additionalCheckoutButtons){const observer=new MutationObserver(()=>{this.accessibility.removeTrapFocus(),this.accessibility.trapFocus(this.cartDropdown,{elementToFocus:this.cartDropdown.querySelector(selectors$3.cartToggleElement)}),observer.disconnect()});observer.observe(additionalCheckoutButtons,{subtree:!0,childList:!0})}}}window.cart=new CartDrawer;
8const classes$1={focus:"is-focused",open:"is-open",accordionToggle:"accordion-toggle",tabLink:"tab-link"},selectors$4={inPageLink:"[data-skip-content]",linkesWithOnlyHash:'a[href="#"]',triggerFocusElement:"[data-focus-element]",cartDropdown:"#cart-dropdown",search:"#search-popdown",accordionContent:".accordion-content",tabs:".tabs",accordionDataToggle:"data-accordion-toggle"};class Accessibility{constructor(){this.init()}init(){this.a11y=a11y,this.html=document.documentElement,this.body=document.body,this.inPageLink=document.querySelector(selectors$4.inPageLink),this.linkesWithOnlyHash=document.querySelectorAll(selectors$4.linkesWithOnlyHash),this.lastFocused=null,this.isFocused=!1,this.a11y.focusHash(),this.a11y.bindInPageLinks(),this.clickEvents(),this.focusEvents(),this.focusEventsOff(),this.closeExpandedElements()}clickEvents(){this.inPageLink&&this.inPageLink.addEventListener("click",event=>{event.preventDefault()}),this.linkesWithOnlyHash&&this.linkesWithOnlyHash.forEach(item=>{item.addEventListener("click",event=>{event.preventDefault()})})}focusEvents(){document.addEventListener("keyup",event=>{event.keyCode===window.theme.keyboardKeys.TAB&&(this.body.classList.add(classes$1.focus),this.isFocused=!0)}),document.addEventListener("keyup",event=>{if(!this.isFocused)return;const target=event.target,pressEnterOrSpace=event.keyCode===window.theme.keyboardKeys.ENTER||event.keyCode===window.theme.keyboardKeys.SPACE,targetElement=target.matches(selectors$4.triggerFocusElement)||target.closest(selectors$4.triggerFocusElement),isAccordion=target.classList.contains(classes$1.accordionToggle)||target.parentNode.classList.contains(classes$1.accordionToggle)||target.hasAttribute(selectors$4.accordionDataToggle)||target.parentNode.hasAttribute(selectors$4.accordionDataToggle),isTab=target.classList.contains(classes$1.tabLink)||target.parentNode.classList.contains(classes$1.tabLink);pressEnterOrSpace&&targetElement&&(this.lastFocused===null&&(this.lastFocused=target),isAccordion&&target.click(),isTab&&target.click())}),this.html.addEventListener("theme:cart:add-item",event=>{this.lastFocused=event.detail.selector})}focusEventsOff(){document.addEventListener("mousedown",()=>{this.body.classList.remove(classes$1.focus),this.isFocused=!1})}closeExpandedElements(){document.addEventListener("keyup",event=>{if(event.keyCode!==window.theme.keyboardKeys.ESCAPE)return;const accordionContents=document.querySelectorAll(selectors$4.accordionContent);if(accordionContents.length)for(let i=0;i<accordionContents.length;i++){if(accordionContents[i].style.display!=="block")continue;accordionContents[i].previousElementSibling.classList.remove(classes$1.open),slideUp(accordionContents[i])}this.lastFocused!==null&&setTimeout(()=>{this.lastFocused.focus(),this.lastFocused=null},600)})}}window.accessibility=new Accessibility,theme.ProductModel=(function(){let modelJsonSections={},models={},xrButtons={};const selectors2={productMediaWrapper:"[data-product-single-media-wrapper]",productSlideshow:"[data-product-slideshow]",productXr:"[data-shopify-xr]",dataMediaId:"data-media-id",dataModelId:"data-model-id",dataModel3d:"data-shopify-model3d-id",modelViewer:"model-viewer",modelJson:"#ModelJson-",classMediaHidden:"media--hidden",deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]"},classes2={isLoading:"is-loading"};function init(mediaContainer,sectionId){modelJsonSections[sectionId]={loaded:!1};const deferredMediaButton=mediaContainer.querySelector(selectors2.deferredMediaButton);deferredMediaButton&&deferredMediaButton.addEventListener("click",loadContent.bind(this,mediaContainer,sectionId))}function loadContent(mediaContainer,sectionId){if(mediaContainer.querySelector(selectors2.deferredMedia).getAttribute("loaded"))return;mediaContainer.classList.add(classes2.isLoading);const content=document.createElement("div");content.appendChild(mediaContainer.querySelector("template").content.firstElementChild.cloneNode(!0));const modelViewerElement=content.querySelector("model-viewer"),deferredMedia=mediaContainer.querySelector(selectors2.deferredMedia);deferredMedia.appendChild(modelViewerElement).focus(),deferredMedia.setAttribute("loaded",!0);const mediaId=mediaContainer.dataset.mediaId,modelId=modelViewerElement.dataset.modelId,xrButton=mediaContainer.closest(selectors2.productSlideshow).parentElement.querySelector(selectors2.productXr);xrButtons[sectionId]={element:xrButton,defaultId:modelId},models[mediaId]={modelId,mediaId,sectionId,container:mediaContainer,element:modelViewerElement},window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:setupShopifyXr}
8,{name:"model-viewer-ui",version:"1.0",onLoad:setupModelViewerUi}])}function setupShopifyXr(errors){if(errors){console.warn(errors);return}if(!window.ShopifyXR){document.addEventListener("shopify_xr_initialized",function(){setupShopifyXr()});return}for(const sectionId in modelJsonSections)if(modelJsonSections.hasOwnProperty(sectionId)){const modelSection=modelJsonSections[sectionId];if(modelSection.loaded)continue;const modelJson=document.querySelector(`${selectors2.modelJson}${sectionId}`);modelJson&&(window.ShopifyXR.addModels(JSON.parse(modelJson.innerHTML)),modelSection.loaded=!0)}window.ShopifyXR.setupXRElements()}function setupModelViewerUi(errors){if(errors){console.warn(errors);return}for(const key in models)if(models.hasOwnProperty(key)){const model=models[key];model.modelViewerUi||(model.modelViewerUi=new Shopify.ModelViewerUI(model.element)),setupModelViewerListeners(model)}}function setupModelViewerListeners(model){const xrButton=xrButtons[model.sectionId];model.container.addEventListener("theme:media:visible",function(){xrButton.element.setAttribute(selectors2.dataModel3d,model.modelId),pauseOtherMedia(model.mediaId),!window.theme.touch&&model.modelViewerUi.play()}),model.container.addEventListener("theme:media:hidden",function(){model.modelViewerUi.pause()}),model.container.addEventListener("xrLaunch",function(){model.modelViewerUi.pause()}),model.element.addEventListener("load",()=>{model.container.classList.remove(classes2.isLoading),pauseOtherMedia(model.mediaId)}),model.element.addEventListener("shopify_model_viewer_ui_toggle_play",function(){pauseOtherMedia(model.mediaId)})}function pauseOtherMedia(mediaId){const mediaIdString=`[${selectors2.dataMediaId}="${mediaId}"]`,currentMedia=document.querySelector(`${selectors2.productMediaWrapper}${mediaIdString}`),otherMedia=document.querySelectorAll(`${selectors2.productMediaWrapper}:not(${mediaIdString})`);currentMedia.classList.remove(selectors2.classMediaHidden),otherMedia.length&&otherMedia.forEach(element=>{element.dispatchEvent(new CustomEvent("theme:media:hidden")),element.classList.add(selectors2.classMediaHidden)})}function removeSectionModels(sectionId){for(const key in models)models.hasOwnProperty(key)&&models[key].sectionId===sectionId&&delete models[key];delete modelJsonSections[sectionId],delete theme.mediaInstances[sectionId]}return{init,loadContent,removeSectionModels}})();const selectors$5={templateAddresses:".template-addresses",addressNewForm:"#AddressNewForm",btnNew:".address-new-toggle",btnEdit:".address-edit-toggle",btnDelete:".address-delete",classHide:"hide",dataFormId:"data-form-id",dataConfirmMessage:"data-confirm-message",editAddress:"#EditAddress",addressCountryNew:"AddressCountryNew",addressProvinceNew:"AddressProvinceNew",addressProvinceContainerNew:"AddressProvinceContainerNew",addressCountryOption:".address-country-option",addressCountry:"AddressCountry",addressProvince:"AddressProvince",addressProvinceContainer:"AddressProvinceContainer"};class Addresses{constructor(section){this.section=section,this.addressNewForm=this.section.querySelector(selectors$5.addressNewForm),this.init()}init(){if(this.addressNewForm){const section=this.section,newAddressForm=this.addressNewForm;this.customerAddresses();const newButtons=section.querySelectorAll(selectors$5.btnNew);newButtons.length&&newButtons.forEach(element=>{element.addEventListener("click",function(){newAddressForm.classList.toggle(selectors$5.classHide)})});const editButtons=section.querySelectorAll(selectors$5.btnEdit);editButtons.length&&editButtons.forEach(element=>{element.addEventListener("click",function(){const formId=this.getAttribute(selectors$5.dataFormId);section.querySelector(`${selectors$5.editAddress}_${formId}`).classList.toggle(selectors$5.classHide)})});const deleteButtons=section.querySelectorAll(selectors$5.btnDelete);deleteButtons.length&&deleteButtons.forEach(element=>{element.addEventListener("click",function(){const formId=this.getAttribute(selectors$5.dataFormId),confirmMessage=this.getAttribute(selectors$5.dataConfirmMessage);confirm(confirmMessage)&&Shopify.postLink(window.theme.routes.addresses_url+"/"+formId,{parameters:{_method:"delete"}})})})}}customerAddresses(){Shopify.CountryProvinceSelector&&new Shopify.CountryProvinceSelector(selectors$5.addressCountryNew,selectors$5.addressProvinceNew,{hideElement:selectors$5.addressProvinceContainerNew}),this.section.querySelectorAll(selectors$5.addressCountryOption).forEac
8h(element=>{const formId=element.getAttribute(selectors$5.dataFormId),countrySelector=`${selectors$5.addressCountry}_${formId}`,provinceSelector=`${selectors$5.addressProvince}_${formId}`,containerSelector=`${selectors$5.addressProvinceContainer}_${formId}`;new Shopify.CountryProvinceSelector(countrySelector,provinceSelector,{hideElement:containerSelector})})}}const template=document.querySelector(selectors$5.templateAddresses);template&&new Addresses(template);const selectors$6={accountTemplateLogged:".customer-logged-in",account:".account",accountSidebarMobile:".account-sidebar--mobile"};class Account{constructor(section){this.section=section,this.init()}init(){this.section.querySelector(selectors$6.account)&&this.accountMobileSidebar()}accountMobileSidebar(){this.section.querySelector(selectors$6.accountSidebarMobile).addEventListener("click",function(){const nextElem=this.nextElementSibling;nextElem&&nextElem.tagName==="UL"&&nextElem.classList.toggle("visible")})}}const template$1=document.querySelector(selectors$6.accountTemplateLogged);template$1&&new Account(template$1);const selectors$7={form:"[data-account-form]",showReset:"[data-show-reset]",hideReset:"[data-hide-reset]",recover:"[data-recover-password]",login:"[data-login-form]",recoverHash:"#recover",hideClass:"is-hidden"};class Login{constructor(form){this.form=form,this.showButton=form.querySelector(selectors$7.showReset),this.hideButton=form.querySelector(selectors$7.hideReset),this.recover=form.querySelector(selectors$7.recover),this.login=form.querySelector(selectors$7.login),this.init()}init(){window.location.hash==selectors$7.recoverHash?this.showRecoverPasswordForm():this.hideRecoverPasswordForm(),this.showButton.addEventListener("click",function(e){e.preventDefault(),this.showRecoverPasswordForm()}.bind(this),!1),this.hideButton.addEventListener("click",function(e){e.preventDefault(),this.hideRecoverPasswordForm()}.bind(this),!1)}showRecoverPasswordForm(){return this.login.classList.add(selectors$7.hideClass),this.recover.classList.remove(selectors$7.hideClass),window.location.hash=selectors$7.recoverHash,!1}hideRecoverPasswordForm(){return this.recover.classList.add(selectors$7.hideClass),this.login.classList.remove(selectors$7.hideClass),window.location.hash="",!1}}const loginForm=document.querySelector(selectors$7.form);loginForm&&new Login(loginForm),window.Shopify=window.Shopify||{},window.Shopify.theme=window.Shopify.theme||{},window.Shopify.theme.sections=window.Shopify.theme.sections||{},window.Shopify.theme.sections.registered=window.Shopify.theme.sections.registered||{},window.Shopify.theme.sections.instances=window.Shopify.theme.sections.instances||[];const registered=window.Shopify.theme.sections.registered,instances=window.Shopify.theme.sections.instances,selectors$8={id:"data-section-id",type:"data-section-type"};class Registration{constructor(type=null,components=[]){this.type=type,this.components=validateComponentsArray(components),this.callStack={onLoad:[],onUnload:[],onSelect:[],onDeselect:[],onBlockSelect:[],onBlockDeselect:[],onReorder:[]},components.forEach(comp=>{for(const[key,value]of Object.entries(comp)){const arr=this.callStack[key];Array.isArray(arr)&&typeof value=="function"?arr.push(value):(console.warn(`Unregisted function: '${key}' in component: '${this.type}'`),console.warn(value))}})}getStack(){return this.callStack}}class Section{constructor(container,registration){this.container=validateContainerElement(container),this.id=container.getAttribute(selectors$8.id),this.type=registration.type,this.callStack=registration.getStack();try{this.onLoad()}catch(e){console.warn(`Error in section: ${this.id}`),console.warn(this),console.warn(e)}}callFunctions(key,e=null){this.callStack[key].forEach(func=>
8{const props={id:this.id,type:this.type,container:this.container};e?func.call(props,e):func.call(props)})}onLoad(){this.callFunctions("onLoad")}onUnload(){this.callFunctions("onUnload")}onSelect(e){this.callFunctions("onSelect",e)}onDeselect(e){this.callFunctions("onDeselect",e)}onBlockSelect(e){this.callFunctions("onBlockSelect",e)}onBlockDeselect(e){this.callFunctions("onBlockDeselect",e)}onReorder(e){this.callFunctions("onReorder",e)}}function validateContainerElement(container){if(!(container instanceof Element))throw new TypeError("Theme Sections: Attempted to load section. The section container provided is not a DOM element.");if(container.getAttribute(selectors$8.id)===null)throw new Error("Theme Sections: The section container provided does not have an id assigned to the "+selectors$8.id+" attribute.");return container}function validateComponentsArray(value){if(typeof value<"u"&&typeof value!="object"||value===null)throw new TypeError("Theme Sections: The components object provided is not a valid");return value}function register(type,components){if(typeof type!="string")throw new TypeError("Theme Sections: The first argument for .register must be a string that specifies the type of the section being registered");if(typeof registered[type]<"u")throw new Error('Theme Sections: A section of type "'+type+'" has already been registered. You cannot register the same section type twice');Array.isArray(components)||(components=[components]);const section=new Registration(type,components);return registered[type]=section,registered}function load(types,containers){types=normalizeType(types),typeof containers>"u"&&(containers=document.querySelectorAll("["+selectors$8.type+"]")),containers=normalizeContainers(containers),types.forEach(function(type){const registration=registered[type];typeof registration>"u"||(containers=containers.filter(function(container){return isInstance(container)||container.getAttribute(selectors$8.type)===null?!1:container.getAttribute(selectors$8.type)!==type?!0:(instances.push(new Section(container,registration)),!1)}))})}function reorder(selector){var instancesToReorder=getInstances(selector);instancesToReorder.forEach(function(instance){instance.onReorder()})}function unload(selector){var instancesToUnload=getInstances(selector);instancesToUnload.forEach(function(instance){var index=instances.map(function(e){return e.id}).indexOf(instance.id);instances.splice(index,1),instance.onUnload()})}function getInstances(selector){var filteredInstances=[];if(NodeList.prototype.isPrototypeOf(selector)||Array.isArray(selector))var firstElement=selector[0];if(selector instanceof Element||firstElement instanceof Element){var containers=normalizeContainers(selector);containers.forEach(function(container){filteredInstances=filteredInstances.concat(instances.filter(function(instance){return instance.container===container}))})}else if(typeof selector=="string"||typeof firstElement=="string"){var types=normalizeType(selector);types.forEach(function(type){filteredInstances=filteredInstances.concat(instances.filter(function(instance){return instance.type===type}))})}return filteredInstances}function getInstanceById(id){for(var instance,i=0;i<instances.length;i++)if(instances[i].id===id){instance=instances[i];break}return instance}function isInstance(selector){return getInstances(selector).length>0}function normalizeType(types){return types==="*"?types=Object.keys(registered):typeof types=="string"?types=[types]:types.constructor===Section?types=[types.prototype.type]:Array.isArray(types)&&types[0].constructor===Section&&(types=types.map(function(Section2){return Section2.type})),types=types.map(function(type){return type.toLowerCase()}),types}function normalizeContainers(containers){return NodeList.prototype.isPrototypeOf(containers)&&containers.length>
80?containers=Array.prototype.slice.call(containers):NodeList.prototype.isPrototypeOf(containers)&&containers.length===0?containers=[]:containers===null?containers=[]:!Array.isArray(containers)&&containers instanceof Element&&(containers=[containers]),containers}window.Shopify.designMode&&(document.addEventListener("shopify:section:load",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+selectors$8.id+'="'+id+'"]');container!==null&&load(container.getAttribute(selectors$8.type),container)}),document.addEventListener("shopify:section:reorder",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+selectors$8.id+'="'+id+'"]'),instance=getInstances(container)[0];typeof instance=="object"&&reorder(container)}),document.addEventListener("shopify:section:unload",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+selectors$8.id+'="'+id+'"]'),instance=getInstances(container)[0];typeof instance=="object"&&unload(container)}),document.addEventListener("shopify:section:select",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onSelect(event)}),document.addEventListener("shopify:section:deselect",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onDeselect(event)}),document.addEventListener("shopify:block:select",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onBlockSelect(event)}),document.addEventListener("shopify:block:deselect",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onBlockDeselect(event)}));const selectors$9={collectionImage:".collection-item__image",columnImage:".column__image__wrapper",aos:"[data-aos]",flickityNextArrow:".flickity-button.next",flickityPrevArrow:".flickity-button.previous",heroContent:".hero__content",heroContentWrapper:".hero__content__wrapper",link:"a:not(.hero__btn)",nextArrow:"[data-next-arrow]",prevArrow:"[data-prev-arrow]",productItemImage:".product-item__image",slide:"[data-slide]",slideValue:"data-slide",slider:"[data-slider]",sliderThumb:"[data-slider-thumb]",sliderThumbClick:"[data-slider-thumb-click]",slideshowSlideImg:".slide-image-img"},attributes$1={adaptiveHeight:"data-adaptive-height",arrowPositionMiddle:"data-arrow-position-middle",arrows:"data-arrows",aspectRatio:"data-aspectratio",autoplay:"data-autoplay",autoplaySpeed:"data-speed",cellAlign:"data-cell-align",dots:"data-dots",draggable:"data-draggable",equalizeHeight:"data-equalize-height",fade:"data-fade",groupCells:"data-group-cells",infinite:"data-infinite",percentPosition:"data-percent-position",setHeight:"data-set-height",slideIndex:"data-slide-index",sliderAnimate:"data-slider-animate",sliderAnimateOnce:"data-slider-animate-once",sliderStartIndex:"data-slider-start-index",slidesDesktop:"data-slides-desktop",slidesLargeDesktop:"data-slides-large-desktop",slidesMobileDesktop:"data-slides-mobile",slidesTabletDesktop:"data-slides-tablet",watchCss:"data-watch-css",slideTextColor:"data-slide-text-color"},classes$2={aosAnimated:"aos-animated",flickityResize:"flickity-resize",heroContentTransparent:"hero__content--transparent",isSelected:"is-selected",sliderArrowsHidden:"flickity-button-hide",sliderInitialized:"js-slider--initialized",aosAnimate:"aos-animate"},sections={};class Slider{constructor(container,slideshow=null){this.container=container,this.slideshow=slideshow||this.container.querySelector(selectors$9.slider),this.slideshow&&(this.slideshowSlides=this.slideshow.querySelectorAll(selectors$9.slide),this.sliderPrev=this.container.querySelector(selectors$9.prevArrow),this.sliderNext=this.container.querySelector(selectors$9.nextArrow),this.sliderThumbs=this.container.querySelectorAll(selectors$9.sliderThumb),this.sliderThumbsClick=this.container.querySelectorAll(selectors$9.sliderThumbClick),this.showDots=this.slideshow.getAttribute(attributes$1.dots)!="hidden",this.showArrows=this.slideshow.getAttribute(attributes$1.arrows)==="true",this.autoPlay=this.slideshow.getAttribute(attributes$1.autoplay)==="true",this.autoPlaySpeed=this.slideshow.getAttribute(attributes$1.autoplaySpeed),this.infinite=this.slideshow.getAttribute(attributes$1.infinite)!=="false",this.setMinHeightFlag=this.slideshow.getAttribute(attributes$1.setHeight)==="true",this.watchCss=this.slideshow.getAttribute(attributes$1.watchCss)==="true",this.adaptiveHeight=this.slideshow.getAttribute(attributes$1.adaptiveHeight)!=="false",this.cellAlignLeft=this.slideshow.getAttribute(attributes$1.cellAlign)==="left",this.cellAlignRight=this.slideshow.getAttribute(attributes$1.cellAlign)==="right",this.draggable=this.slideshow.getAttribute(attributes$1.draggable)!=="false",this.percentPosition=this.slideshow.getAttribute(attributes$1.percentPosition)!=="false",this.multipleSlides=this.slideshow.hasAttribute(attributes$1.slidesLargeDesktop),this.sliderStartIndex=this.slideshow.hasAttribute(attributes$1.sliderStartIndex),this.groupCells=this.slideshow.getAttribute(attributes$1.groupCells)==="true",this.sliderAnimate=this.slideshow.getAttribute(attributes$1.sliderAnimate)==="true",this.sliderAnimateOnce=this.slideshow.getAttribute(attributes$1.sliderAnimateOnce)==="true",this.dataEqualizeHeight=this.slideshow.getAttribute(attributes$1.equalizeHeight)==="true",this.fade=this.slideshow.getAttribute(attributes$1.fade)==="true",this.resizeEvent=debounce(()=>this.resizeEvents(),100),this.resizeEventAlt=debounce(()=>this.addRemoveSlidesForDevices(),100),this.resetSliderEvent=()=>this.resetSlider(),this.flkty=null,this.init())}init(){this.setMinHeight();const sliderOptions={initialIndex:this.sliderStartIndex?parseInt(this.slideshow.getAttribute(attributes$1.sliderStartIndex)):0,autoPlay:this.autoPlay&&this.autoPlaySpeed?parseInt(this.autoPlaySpeed):!1,contain:!0,pageDots:this.showDots,prevNextButtons:this.showArrows,adaptiveHeight:this.adaptiveHeight,wrapAround:this.infinite,percentPosition:this.percentPosition,watchCSS:this.watchCss,cellAlign:this.cellAlignLeft?"left"
8:this.cellAlignRight?"right":"center",groupCells:this.groupCells,draggable:this.draggable?">1":!1,on:{ready:()=>{this.sliderAnimate&&this.sliderAnimateOnce&&!this.autoPlay&&this.slideshow.querySelector(`.${classes$2.isSelected}`).classList.add(classes$2.aosAnimated),setTimeout(()=>{this.slideshow.parentNode.dispatchEvent(new CustomEvent("theme:slider:loaded",{bubbles:!0,detail:{slider:this}}))},10),this.slideActions(),this.slideshow.classList.contains(classes$2.isSelected)&&this.slideshow.classList.remove(classes$2.isSelected),this.showArrows&&(this.initArrows(),this.positionArrows())},resize:()=>{this.showArrows&&this.positionArrows()}}};this.fade&&(sliderOptions.fade=!0,this.flkty=new FlickityFade(this.slideshow,sliderOptions)),this.fade||(this.flkty=new Flickity(this.slideshow,sliderOptions)),this.dataEqualizeHeight&&this.equalizeHeight(),this.sliderPrev&&this.sliderPrev.addEventListener("click",e=>{e.preventDefault(),this.flkty.previous(!0)}),this.sliderNext&&this.sliderNext.addEventListener("click",e=>{e.preventDefault(),this.flkty.next(!0)}),this.flkty.on("change",()=>this.slideActions(!0)),this.addRemoveSlidesForDevices(),window.addEventListener("resize",this.resizeEventAlt),this.sliderAnimate&&this.flkty.on("settle",()=>this.sliderSettle()),(this.setMinHeightFlag||this.multipleSlides)&&window.addEventListener("resize",this.resizeEvent),this.sliderThumbsClick.length&&this.sliderThumbsClick.forEach(element=>{element.addEventListener("click",e=>{e.preventDefault();const slideIndex=[...element.parentElement.children].indexOf(element);this.flkty.select(slideIndex)})}),this.container.addEventListener("theme:tab:change",this.resetSliderEvent)}sliderSettle(){let animatedItems=this.slideshow.querySelectorAll(`.${classes$2.isSelected} ${selectors$9.aos}`);this.sliderAnimateOnce&&(animatedItems=this.slideshow.querySelectorAll(`.${classes$2.isSelected}:not(.${classes$2.aosAnimated}) .${classes$2.aosAnimated}`)),animatedItems.length&&animatedItems.forEach(animatedItem=>{animatedItem.classList.add(classes$2.aosAnimate),this.sliderAnimateOnce&&animatedItem.closest(`.${classes$2.isSelected}`).classList.add(classes$2.aosAnimated)})}resetSlider(){this.slideshow&&(this.flkty&&this.flkty.isActive?this.flkty.select(0,!1,!0):this.slideshow.scrollTo({left:0,behavior:"auto"}))}addRemoveSlidesForDevices(){if(this.hasDiffSlidesForMobileDesktop=Array.prototype.filter.call(this.slideshowSlides,slide=>{if(slide.classList.contains("desktop")||slide.classList.contains("mobile"))return slide}).length>0,!this.hasDiffSlidesForMobileDesktop)return;const windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;let selectorSlides=null;windowWidth<theme.sizes.small?selectorSlides=`${selectors$9.slide}.mobile, ${selectors$9.slide}:not(.desktop)`:selectorSlides=`${selectors$9.slide}.desktop, ${selectors$9.slide}:not(.mobile)`,this.flkty.options.cellSelector=selectorSlides,this.flkty.selectCell(0,!1,
8!0),this.flkty.reloadCells(),this.flkty.reposition(),this.flkty.resize(),this.slideActions()}resizeEvents(){this.setMinHeight(),this.multipleSlides&&(this.showArrows&&this.initArrows(),this.flkty.resize(),this.slideshow.classList.contains(classes$2.sliderInitialized)||this.flkty.select(0))}slideActions(changeEvent=!1){const currentSlide=this.slideshow.querySelector(`.${classes$2.isSelected}`),currentSlideTextColor=currentSlide.getAttribute(attributes$1.slideTextColor),currentSlideLink=currentSlide.querySelector(selectors$9.link),buttons=this.slideshow.querySelectorAll(`${selectors$9.slide} a, ${selectors$9.slide} button`);if(currentSlideLink&&this.groupCells&&changeEvent&¤tSlideLink.focus(),buttons.length&&buttons.forEach(button=>{const slide=button.closest(selectors$9.slide);if(slide){const tabIndex=slide.classList.contains(classes$2.isSelected)?0:-1;button.setAttribute("tabindex",tabIndex)}}),currentSlideTextColor!=="rgba(0,0,0,0)"&¤tSlideTextColor!==""&&this.slideshow.style.setProperty("--text",currentSlideTextColor),this.setMinHeight(),this.sliderAnimate){let animatedItems=this.slideshow.querySelectorAll(`.${classes$2.isSelected} .${classes$2.aosAnimate}`);this.sliderAnimateOnce&&(animatedItems=this.slideshow.querySelectorAll(`.${classes$2.isSelected}:not(.${classes$2.aosAnimated}) .${classes$2.aosAnimate}`)),animatedItems.length&&animatedItems.forEach(animatedItem=>{animatedItem.classList.remove(classes$2.aosAnimate),this.sliderAnimateOnce&&animatedItem.classList.add(classes$2.aosAnimated)})}if(this.sliderThumbs.length&&this.sliderThumbs.length===this.slideshowSlides.length&¤tSlide.hasAttribute(attributes$1.slideIndex)){const slideIndex=parseInt(currentSlide.getAttribute(attributes$1.slideIndex)),currentThumb=this.container.querySelector(`${selectors$9.sliderThumb}.${classes$2.isSelected}`);currentThumb&¤tThumb.classList.remove(classes$2.isSelected),this.sliderThumbs[slideIndex].classList.add(classes$2.isSelected)}}setMinHeight(){this.setMinHeightFlag&&this.slideshowSlides.forEach(element=>{const slideImageImg=element.querySelector(selectors$9.slideshowSlideImg);let slideAspectRatio="";slideImageImg&&slideImageImg.hasAttribute(attributes$1.aspectRatio)&&(slideAspectRatio=slideImageImg.getAttribute(attributes$1.aspectRatio));let slideTextContentHeight=0,getMargin=0;const slideTextContent=element.querySelector(selectors$9.heroContent);if(slideTextContent){const getMarginTop=parseInt(window.getComputedStyle(slideTextContent).marginTop),getMarginBottom=parseInt(window.getComputedStyle(slideTextContent).marginBottom);getMargin=getMarginTop+getMarginBottom,slideTextContentHeight=slideTextContent.offsetHeight+getMargin}const slideWidth=parseInt(getComputedStyle(element,null).width.replace("px",""));let slideHeight=parseInt(slideWidth/slideAspectRatio)||0;const isCurrentSlide=element.classList.contains(classes$2.isSelected);slideTextContentHeight>slideHeight&&(slideHeight=slideTextContentHeight);const minHeightValue=`calc(${slideHeight}px + var(--header-padding))`;element.style.setProperty("min-height",minHeightValue);const heroContentWrapper=element.querySelector(selectors$9.heroContentWrapper);heroContentWrapper&&heroContentWrapper.style.setProperty("min-height",minHeightValue),isCurrentSlide&&this.slideshow.parentElement.style.setProperty("min-height",minHeightValue)})}positionArrows(){if(this.slideshow.hasAttribute(attributes$1.arrowPositionMiddle)&&this.showArrows){const itemImage=this.slideshow.querySelector(selectors$9.collectionImage)||this.slideshow.querySelector(selectors$9.productItemImage)||this.slideshow.querySelector(selectors$9.columnImage);if(!itemImage)return;this.slideshow.querySelector(selectors$9.flickityPrevArrow).style.top=itemImage.clientHeight/2+"px",this.slideshow.querySelector(selectors$9.flickityNextArrow).style.top=itemImage.clientHeight/2+"px"}}initArrows(){if(!this.multipleSlides)return;const slidesNumberCustom=parseInt(this.slideshow.getAttribute(attributes$1.slidesLargeDesktop)),windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,desktopSlides=this.slideshow.hasAttribute(attributes$1.slidesDesktop)?parseInt(this.slideshow.getAttribute(attributes$1.slidesDesktop)):3,tabletSlides=this.slideshow.hasAttribute(attributes$1.slidesTabletDesktop)?parseInt(this.slideshow.getAttribute(attributes$1.slidesTabletDesktop)):2,mobileSlides=this.slideshow.hasAttribute(attributes$1.slidesMobileDesktop)?parseInt(this.slideshow.getAttribute(attributes$1.slidesMobileDesktop)):1,largeDesktopCheck=windowWidth>1339&&this.slideshowSlides.length>slidesNumberCustom,desktopCheck=windowWidth<=1339&&windowWidth>1023&&this.slideshowSlides.length>desktopSlides,tabletCheck=windowWidth<=1023&&windowWidth>749&&this.slideshowSlides.length>tabletSlides,mobileCheck=windowWidth<=749&&this.slideshowSlides.length>mobileSlides,flag=!!(largeDesktopCheck||desktopCheck||tabletCheck||mobileCheck);this.slideshow.classList.toggle(classes$2.sliderArrowsHidden,!flag),this.slideshow.classList.toggle(classes$2.sliderInitialized,flag)}equalizeHeight(){Flickity.prototype._createResizeClass=function(){setTimeout(()=>{this.element.classList.add(classes$2.flickityResize)})},Flickity.createMethods.push("_createResizeClass");const resize=Flickity.prototype.resize;Flickity.prototype.resize=function(){this.element.classList.remove(classes$2.flickityResize),resize.call(this),this.element.classList.add(classes$2.flickityResize)},this.flkty.resize()}onUnload(){(this.setMinHeightFlag||this.multipleSlides)&&window.removeEventListener("resize",this.resizeEvent),this.slideshow&&this.flkty&&(this.flkty.options.watchCSS=!1,this.flkty.destroy()),this.container.removeEventListener("theme:tab:change",this.resetSliderEvent)}onBlockSelect(evt){if(!this.slideshow)return;const slide=this.slideshow.querySelector(`[${selectors$9.slideValue}="${evt.detail.blockId}"]`);if(!slide)return;let slideIndex=parseInt(slide.getAttribute(attributes$1.slideIndex));
8this.multipleSlides&&!this.slideshow.classList.contains(classes$2.sliderInitialized)&&(slideIndex=0),this.slideshow.classList.add(classes$2.isSelected),this.flkty.selectCell(slideIndex),this.flkty.stopPlayer()}onBlockDeselect(){this.slideshow&&(this.slideshow.classList.remove(classes$2.isSelected),this.autoPlay&&this.flkty.playPlayer())}}const slider={onLoad(){sections[this.id]=[],this.container.querySelectorAll(selectors$9.slider).forEach(el=>{sections[this.id].push(new Slider(this.container,el))})},onUnload(){sections[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload()})},onBlockSelect(e){sections[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})},onBlockDeselect(e){sections[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(e)})}},throttle=(fn,wait)=>{let prev2,next;return function invokeFn(...args){const now=Date.now();next=clearTimeout(next),!prev2||now-prev2>=wait?(fn.apply(null,args),prev2=now):next=setTimeout(invokeFn.bind(null,...args),wait-(now-prev2))}},selectors$a={tooltip:"data-tooltip",tooltipStopMouseEnter:"data-tooltip-stop-mouseenter"},classes$3={tooltipDefault:"tooltip-default",visible:"is-visible",hiding:"is-hiding"};let sections$1={};class Tooltip{constructor(el,options={}){this.tooltip=el,this.tooltip.hasAttribute(selectors$a.tooltip)&&(this.label=this.tooltip.getAttribute(selectors$a.tooltip),this.class=options.class||classes$3.tooltipDefault,this.transitionSpeed=options.transitionSpeed||200,this.hideTransitionTimeout=0,this.addPinEvent=()=>this.addPin(),this.addPinMouseEvent=()=>this.addPin(!0),this.removePinEvent=event=>throttle(this.removePin(event),50),this.removePinMouseEvent=event=>this.removePin(event,!0,!0),this.init())}init(){if(!document.querySelector(`.${this.class}`)){const tooltipTemplate=`<div class="${this.class}__arrow"></div><div class="${this.class}__inner"><div class="${this.class}__text"></div></div>`,tooltipElement=document.createElement("div");tooltipElement.className=this.class,tooltipElement.innerHTML=tooltipTemplate,document.body.appendChild(tooltipElement)}this.tooltip.addEventListener("mouseenter",this.addPinMouseEvent),this.tooltip.addEventListener("mouseleave",this.removePinMouseEvent),this.tooltip.addEventListener("theme:tooltip:init",this.addPinEvent),document.addEventListener("theme:tooltip:close",this.removePinEvent)}addPin(stopMouseEnter=!1){const tooltipTarget=document.querySelector(`.${this.class}`);if(tooltipTarget&&(stopMouseEnter&&!this.tooltip.hasAttribute(selectors$a.tooltipStopMouseEnter)||!stopMouseEnter)){const tooltipTargetArrow=tooltipTarget.querySelector(`.${this.class}__arrow`),tooltipTargetInner=tooltipTarget.querySelector(`.${this.class}__inner`),tooltipTargetText=tooltipTarget.querySelector(`.${this.class}__text`);tooltipTargetText.textContent=this.label;const windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,tooltipTargetWidth=tooltipTargetInner.offsetWidth,tooltipRect=this.tooltip.getBoundingClientRect(),tooltipTop=tooltipRect.top,tooltipWidth=tooltipRect.width,tooltipHeight=tooltipRect.height,tooltipTargetPositionTop=tooltipTop+tooltipHeight+window.scrollY;let tooltipTargetPositionLeft=tooltipRect.left-tooltipTargetWidth/2+tooltipWidth/2;const tooltipTargetWindowDifference=tooltipTargetPositionLeft+tooltipTargetWidth-windowWidth;tooltipTargetWindowDifference>0&&(tooltipTargetPositionLeft-=tooltipTargetWindowDifference),tooltipTargetPositionLeft<0&&(tooltipTargetPositionLeft=0),tooltipTargetArrow.style.left=`${tooltipRect.left+tooltipWidth/2}px`,tooltipTarget.style.top=`${tooltipTargetPositionTop}px`,tooltipTargetInner.style.transform=`translateX(${tooltipTargetPositionLeft}px)`,tooltipTarget.classList.remove(classes$3.hiding),tooltipTarget.classList.add(classes$3.visible),document.addEventListener("theme:scroll",this.removePinEvent)}}removePin(event,stopMouseEnter=!1,hideTransition=!1){const tooltipTarget=document.querySelector(`.${this.class}`),tooltipVisible=tooltipTarget.classList.contains(classes$3.visible);tooltipTarget&&(stopMouseEnter&&!this.tooltip.hasAttribute(selectors$a.tooltipStopMouseEnter)||!stopMouseEnter)&&(tooltipVisible&&(hideTransition||event.detail.hideTransition)&&(tooltipTarget.classList.add(classes$3.hiding),this.hideTransitionTimeout&&clearTimeout(this.hideTransitionTimeout),this.hideTransitionTimeout=setTimeout(()=>{tooltipTarget.classList.remove(classes$3.hiding)},this.transitionSpeed)),tooltipTarget.classList.remove(classes$3.visible),document.removeEventListener("theme:scroll",this.removePinEvent))}unload(){this.tooltip.removeEventListener("mouseenter",this.addPinMouseEvent),this.tooltip.removeEventListener("mouseleave",this.removePinMouseEvent),this.tooltip.removeEventListener("theme:tooltip:init",this.addPinEvent),document.removeEventListener("theme:tooltip:close",this.removePinEvent),document.removeEventListener("theme:scroll",this.removePinEvent)}}const tooltipSection={onLoad(){sections$1[this.id]=[],this.container.querySelectorAll(`[${selectors$a.tooltip}]`).forEach(el=>{sections$1[this.id].push(new Tooltip(el))})}
8,onUnload:function(){sections$1[this.id].forEach(el=>{typeof el.unload=="function"&&el.unload()})}},selectors$b={copyClipboard:"[data-copy-clipboard]",tooltip:"data-tooltip"},classes$4={visible:"is-visible"},sections$2={};class CopyClipboard{constructor(section){this.container=section.container,this.copyButtons=this.container.querySelectorAll(selectors$b.copyClipboard),this.copyButtons.length&&this.init()}init(){this.copyButtons.forEach(el=>{el.addEventListener("click",function(e){e.preventDefault();const windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,copyText=this.getAttribute("href");this.style.position="static";let inputElem=document.createElement("input");inputElem.type="text",this.appendChild(inputElem);const newInput=this.querySelector("input");newInput.value=copyText,newInput.select(),newInput.setSelectionRange(0,99999),document.execCommand("copy"),this.style.removeProperty("position"),this.removeChild(newInput),this.hasAttribute(selectors$b.tooltip)&&windowWidth>=theme.sizes.small&&(this.classList.add(classes$4.visible),this.dispatchEvent(new CustomEvent("theme:tooltip:init",{bubbles:!0})),setTimeout(()=>{this.classList.remove(classes$4.visible),document.dispatchEvent(new CustomEvent("theme:tooltip:close",{bubbles:!1,detail:{hideTransition:!0}}))},2e3))})})}}const copyClipboard={onLoad(){sections$2[this.id]=new CopyClipboard(this)}};var sections$3={};const parallaxHero={onLoad(){sections$3[this.id]=[],this.container.querySelectorAll("[data-parallax-wrapper]").forEach(frame=>{const inner=frame.querySelector("[data-parallax-img]");sections$3[this.id].push(new Rellax(inner,{center:!0,round:!0,frame}))}),window.addEventListener("load",()=>{sections$3[this.id].forEach(image=>{typeof image.refresh=="function"&&image.refresh()})})},onUnload:function(){sections$3[this.id].forEach(image=>{typeof image.destroy=="function"&&image.destroy()})}},selectors$c={sidebar:".sidebar",widgetCategories:".widget--categories",widgetLinksEl:".widget__links",widgetLinks:".widget__links .has-sub-nav > a",widgetLinksSub:".widget__links .submenu > li > a",listEl:"li",linkEl:"a",articleSingle:".article--single",sidebarContents:".sidebar__contents",hasSubNav:".has-sub-nav"},classes$5={open:"open",active:"active",submenu:"submenu"},sections$4={};class Article{constructor(section){this.container=section.container,this.sidebar=this.container.querySelector(selectors$c.sidebar),this.widgetCategories=this.container.querySelector(selectors$c.widgetCategories),this.resizeEvent=()=>this.categories(),this.init()}init(){this.sidebar&&this.sidebarNav()}sidebarNav(){this.navStates(),this.container.addEventListener("click",e=>{const checkLinkTag=e.target.tagName.toLowerCase()===selectors$c.linkEl,checkLinkParent=e.target.closest(`${selectors$c.listEl}${selectors$c.hasSubNav}`),checkLinkClosest=e.target.closest(selectors$c.widgetLinksEl),checkLink=checkLinkTag&&checkLinkParent&&checkLinkClosest,submenu=e.target.nextElementSibling;!((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small)&&checkLink&&submenu&&(submenu.parentElement.classList.toggle(classes$5.active),submenu.classList.toggle(classes$5.open),submenu.setAttribute("aria-expanded",submenu.classList.contains(classes$5.open)),slideToggle(submenu),e.preventDefault())}),this.widgetCategories&&(this.widgetCategoriesNext=this.widgetCategories.nextSibling,this.widgetCategoriesParentNode=this.widgetCategories.parentNode,this.categories(),document.addEventListener("theme:resize",this.resizeEvent))}navStates(){const links=this.container.querySelectorAll(`${selectors$c.widgetLinks}, ${selectors$c.widgetLinksSub}`);links.length&&links.forEach(element=>{const href=element.getAttribute("href"),location2=window.location.pathname;if(href===location2){const elementClosest=element.closest(selectors$c.hasSubNav);if(element.closest("li").classList.add(classes$5.active),!elementClosest)return;elementClosest.classList.add(classes$5.active);const submenu=elementClosest.querySelector(`.${classes$5.submenu}`);submenu&&(submenu.classList.toggle(classes$5.open),submenu.setAttribute("aria-expanded",submenu.classList.contains(classe
8s$5.open)),showElement(submenu))}})}categories(){const isMobile=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small,widgetCategories=document.querySelector(selectors$c.widgetCategories);isMobile?document.querySelector(selectors$c.articleSingle).prepend(widgetCategories):this.widgetCategoriesParentNode.insertBefore(widgetCategories,this.widgetCategoriesNext)}onUnload(){this.widgetCategories&&document.removeEventListener("theme:resize",this.resizeEvent)}}const articleSection={onLoad(){sections$4[this.id]=new Article(this)},onUnload(e){sections$4[this.id].onUnload(e)}};register("article",[articleSection,slider,tooltipSection,copyClipboard,parallaxHero]),register("blog-template",[slider]),register("hero",parallaxHero);const selectors$d={popoutWrapper:"[data-popout]",popoutList:"[data-popout-list]",popoutToggle:"[data-popout-toggle]",popoutInput:"[data-popout-input]",popoutOptions:"[data-popout-option]",popoutPrevent:"data-popout-prevent",popoutQuantity:"data-quantity-field",dataValue:"data-value",ariaExpanded:"aria-expanded",ariaCurrent:"aria-current",productGridImage:"[data-product-image]",productGrid:"[data-product-grid-item]"},classes$6={listVisible:"popout-list--visible",currentSuffix:"--current",popoutAlternative:"popout-container--alt",visible:"is-visible"};let sections$5={};class Popout{constructor(popout){this.container=popout,this.popoutList=this.container.querySelector(selectors$d.popoutList),this.popoutToggle=this.container.querySelector(selectors$d.popoutToggle),this.popoutInput=this.container.querySelector(selectors$d.popoutInput),this.popoutOptions=this.container.querySelectorAll(selectors$d.popoutOptions),this.productGrid=this.popoutList.closest(selectors$d.productGrid),this.popoutPrevent=this.container.getAttribute(selectors$d.popoutPrevent)==="true",this.popupToggleFocusoutEvent=evt=>this.popupToggleFocusout(evt),this.popupListFocusoutEvent=evt=>this.popupListFocusout(evt),this.popupToggleClickEvent=evt=>this.popupToggleClick(evt),this.containerKeyupEvent=evt=>this.containerKeyup(evt),this.popupOptionsClickEvent=evt=>this.popupOptionsClick(evt),this._connectOptionsDispatchEvent=evt=>this._connectOptionsDispatch(evt),this._connectOptions(),this._connectToggle(),this._onFocusOut(),this.popupListMaxWidth(),this.popoutInput&&this.popoutInput.hasAttribute(selectors$d.popoutQuantity)&&document.addEventListener("theme:popout:update",this.updatePopout.bind(this))}unload(){this.popoutOptions.length&&this.popoutOptions.forEach(element=>{element.removeEventListener("theme:popout:click",this.popupOptionsClickEvent),element.removeEventListener("click",this._connectOptionsDispatchEvent)}),this.popoutToggle.removeEventListener("click",this.popupToggleClickEvent),this.popoutToggle.removeEventListener("focusout",this.popupToggleFocusoutEvent),this.popoutList.removeEventListener("focusout",this.popupListFocusoutEvent),this.container.removeEventListener("keyup",this.containerKeyupEvent)}popupToggleClick(evt){const ariaExpanded=evt.currentTarget.getAttribute(selectors$d.ariaExpanded)==="true";if(this.productGrid){const productGridItemImage=this.productGrid.querySelector(selectors$d.productGridImage);productGridItemImage&&productGridItemImage.classList.toggle(classes$6.visible,!ariaExpanded),this.popoutList.style.maxHeight=`${Math.abs(this.popoutToggle.getBoundingClientRect().bottom-this.productGrid.getBoundingClientRect().bottom)}px`}evt.currentTarget.setAttribute(selectors$d.ariaExpanded,!ariaExpanded),this.popoutList.classList.toggle(classes$6.listVisible),this.popupListMaxWidth()}popupToggleFocusout(evt){this.container.contains(evt.relatedTarget)||this._hideList()}popupListFocusout(evt){const childInFocus=evt.currentTarget.contains(evt.relatedTarget);this.popoutList.classList.contains(classes$6.listVisible)&&!childInFocus&&this._hideList()}popupListMaxWidth(){this.popoutList.style.maxWidth=`${parseInt(document.body.clientWidth-this.popoutList.getBoundingClientRect().left)}px`}popupOptionsClick(evt){if(evt.target.closest(selectors$d.popoutOptions).attributes.href.value==="#"){evt.preventDefault();let attrValue="";if(evt.currentTarget.getAttribute(selectors$d.dataValue)&&(attrValue=evt.currentTarget.getAttribute(selectors$d.dataValue)),this.popoutInput.value=attrValue,this.popoutPrevent){this.popoutInput.dispatchEvent(new Event("change")),!evt.detail.preventTrigger&&this.popoutInput.hasAttribute(selectors$d.popoutQuantity)&&this.popoutInput.dispatchEvent(new Event("input"));
8const currentElement=this.popoutList.querySelector(`[class*="${classes$6.currentSuffix}"]`);let targetClass=classes$6.currentSuffix;if(currentElement&¤tElement.classList.length){for(const currentElementClass of currentElement.classList)if(currentElementClass.includes(classes$6.currentSuffix)){targetClass=currentElementClass;break}}const listTargetElement=this.popoutList.querySelector(`.${targetClass}`);listTargetElement&&(listTargetElement.classList.remove(`${targetClass}`),evt.currentTarget.parentElement.classList.add(`${targetClass}`));const targetAttribute=this.popoutList.querySelector(`[${selectors$d.ariaCurrent}]`);targetAttribute&&targetAttribute.hasAttribute(`${selectors$d.ariaCurrent}`)&&(targetAttribute.removeAttribute(`${selectors$d.ariaCurrent}`),evt.currentTarget.setAttribute(`${selectors$d.ariaCurrent}`,"true")),attrValue!==""&&(this.popoutToggle.textContent=attrValue),this.popupToggleFocusout(evt),this.popupListFocusout(evt)}else this._submitForm(attrValue)}}updatePopout(){const targetElement=this.popout
8List.querySelector(`[${selectors$d.dataValue}="${this.popoutInput.value}"]`);targetElement?(targetElement.dispatchEvent(new CustomEvent("theme:popout:click",{cancelable:!0,bubbles:!0,detail:{preventTrigger:!0}})),targetElement.parentElement.nextSibling||this.container.classList.add(classes$6.popoutAlternative)):this.container.classList.add(classes$6.popoutAlternative)}containerKeyup(evt){evt.which===window.theme.keyboardKeys.ESCAPE&&(this._hideList(),this.popoutToggle.focus())}bodyClick(evt){const isOption=this.container.contains(evt.target);this.popoutList.classList.contains(classes$6.listVisible)&&!isOption&&this._hideList()}_connectToggle(){this.popoutToggle.addEventListener("click",this.popupToggleClickEvent)}_connectOptions(){this.popoutOptions.length&&this.popoutOptions.forEach(element=>{element.addEventListener("theme:popout:click",this.popupOptionsClickEvent),element.addEventListener("click",this._connectOptionsDispatchEvent)})}_connectOptionsDispatch(evt){const event=new CustomEvent("theme:popout:click",{cancelable:!0,bubbles:!0,detail:{preventTrigger:!1}});evt.target.dispatchEvent(event)||evt.preventDefault()}_onFocusOut(){this.popoutToggle.addEventListener("focusout",this.popupToggleFocusoutEvent),this.popoutList.addEventListener("focusout",this.popupListFocusoutEvent),this.container.addEventListener("keyup",this.containerKeyupEvent),document.body.addEventListener("click",this.bodyClick.bind(this))}_submitForm(){const form=this.container.closest("form");form&&form.submit()}_hideList(){this.popoutList.classList.remove(classes$6.listVisible),this.popoutToggle.setAttribute(selectors$d.ariaExpanded,!1)}}const popoutSection={onLoad(){sections$5[this.id]=[],this.container.querySelectorAll(selectors$d.popoutWrapper).forEach(wrapper=>{sections$5[this.id].push(new Popout(wrapper))})},onUnload(){sections$5[this.id].forEach(popout=>{typeof popout.unload=="function"&&popout.unload()})}},selectors$e={headerSticky:"[data-header-sticky]",headerHeight:"[data-header-height]"},scrollTo=elementTop=>{const headerHeight=document.querySelector(selectors$e.headerSticky)&&document.querySelector(selectors$e.headerHeight)?document.querySelector(selectors$e.headerHeight).getBoundingClientRect().height:0;window.scrollTo({top:elementTop+window.scrollY-headerHeight,left:0,behavior:"smooth"})};class PopupCookie{constructor(name,value,expires){this.configuration={expires,path:"/",domain:window.location.hostname},this.name=name,this.value=value}write(){(document.cookie.indexOf("; ")!==-1&&!document.cookie.split("; ").find(row=>row.startsWith(this.name))||document.cookie.indexOf("; ")===-1)&&(document.cookie=`${this.name}=${this.value}; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}`)}read(){return document.cookie.indexOf("; ")!==-1&&document.cookie.split("; ").find(row=>row.startsWith(this.name))?document.cookie.split("; ").find(row=>row.startsWith(this.name)).split("=")[1]:!1}destroy(){document.cookie.split("; ").find(row=>row.startsWith(this.name))&&(document.cookie=`${this.name}=null; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}`)}}const selectors$f={newsletterForm:"[data-newsletter-form]",newsletterHeading:"[data-newsletter-heading]",newsletterPopup:"[data-newsletter]"},classes$7={success:"has-success",error:"not-success",hide:"hide"},attributes$2={cookieNameAttribute:"data-cookie-name"},sections$6={};class NewsletterCheckForResult{constructor(newsletter){this.sessionStorage=window.sessionStorage,this.newsletter=newsletter,this.popup=this.newsletter.closest(selectors$f.newsletterPopup),this.popup&&(this.cookie=new PopupCookie(this.popup.getAttribute(attributes$2.cookieNameAttribute),"user_has_closed",null)),this.stopSubmit=!0,this.isChallengePage=!1,this.formID=null,this.checkForChallengePage(),this.newsletterSubmit=e=>this.newsletterSubmitEvent(e),this.isChallengePage||this.init()}init(){this.newsletter.addEventListener("submit",this.newsletterSubmit),this.showMessage()}newsletterSubmitEvent(e){this.stopSubmit&&(e.preventDefault(),this.removeStorage(),this.writeStorage(),this.stopSubmit=!1,this.newsletter.submit())}checkForChallengePage(){this.isChallengePage=window.location.pathname==="/challenge"}writeStorage(){this.sessionStorage!==void 0&&this.sessionStorage.setItem("newsletter_form_id",this.newsletter.id)}readStorage(){this.formID=this.sessionStorage.getItem("newsletter_form_id")}removeStorage(){this.sessionStorage.removeItem("newsletter_form_id")}showMessage(){if(this.readStorage(),this.newsletter.id===this.formID){const newsletter=document.getElementById(this.formID),newsletterHeading=newsletter.parentElement.querySelector(selectors$f.newsletterHeading),submissionSuccess=window.location.search.indexOf("?customer_posted=true")!==-1,submissionFailure=window.location.search.indexOf("accepts_marketing")!==-1;submissionSuccess?(newsletter.classList.remove(classes$7.error),newsletter.classList.add(classes$7.success),newsletterHeading&&(newsletterHeading.classList.add(classes$7.hide),newsletter.classList.remove(classes$7.hide)),this.popup&&this.cookie.write()):submissionFailure&&(newsletter.classList.remove(classes$7.success),newsletter.classList.add(classes$7.error),newsletterHeading&&(newsletterHeading.classList.add(classes$7.hide),newsletter.classList.remove(classes$7.hide))),(submissionSuccess||submissionFailure)&&window.addEventListener("load",()=>{this.scrollToForm(newsletter)})}}scrollToForm(newsletter){const rect=newsletter.getBoundingClientRect();rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth)||setTimeout(()=>{scrollTo(newsletter.getBoundingClientRect().top)},500)}unload(){this.newsletter.removeEventListener("submit",this.newsletterSubmit)}}const newsletterCheckForResultSection={onLoad(){sections$6[this.id]=[],this.container.querySelectorAll(selectors$f.newsletterForm).forEach(form=>{sections$6[this.id].push(new NewsletterCheckForResult(form))})}
8,onUnload(){sections$6[this.id].forEach(form=>{typeof form.unload=="function"&&form.unload()})}};register("footer",[popoutSection,parallaxHero,newsletterCheckForResultSection]);function Listeners(){this.entries=[]}Listeners.prototype.add=function(element,event,fn){this.entries.push({element,event,fn}),element.addEventListener(event,fn)},Listeners.prototype.removeAll=function(){this.entries=this.entries.filter(function(listener){return listener.element.removeEventListener(listener.event,listener.fn),!1})};function getVariantFromSerializedArray(product,collection){_validateProductStructure(product);var optionArray=_createOptionArrayFromOptionCollection(product,collection);return getVariantFromOptionArray(product,optionArray)}function getVariantFromOptionArray(product,options){_validateProductStructure(product),_validateOptionsArray(options);var result=product.variants.filter(function(variant){return options.every(function(option,index){return variant.options[index]===option})});return result[0]||null}function _createOptionArrayFromOptionCollection(product,collection){_validateProductStructure(product),_validateSerializedArray(collection);var optionArray=[];return collection.forEach(function(option){for(var i=0;i<product.options.length;i++){var name=product.options[i].name||product.options[i];if(name.toLowerCase()===option.name.toLowerCase()){optionArray[i]=option.value;break}}}),optionArray}function _validateProductStructure(product){if(typeof product!="object")throw new TypeError(product+" is not an object.");if(Object.keys(product).length===0&&product.constructor===Object)throw new Error(product+" is empty.")}function _validateSerializedArray(collection){if(!Array.isArray(collection))throw new TypeError(collection+" is not an array.");if(collection.length===0)throw new Error(collection+" is empty.");if(collection[0].hasOwnProperty("name")){if(typeof collection[0].name!="string")throw new TypeError("Invalid value type passed for name of option "+collection[0].name+". Value should be string.")}else throw new Error(collection[0]+"does not contain name key.")}function _validateOptionsArray(options){if(Array.isArray(options)&&typeof options[0]=="object")throw new Error(options+"is not a valid array of options.")}var selectors$g={idInput:'[name="id"]',planInput:'[name="selling_plan"]',optionInput:'[name^="options"]',quantityInput:'[name="quantity"]',propertyInput:'[name^="properties"]'};function getUrlWithVariant(url,id){return/variant=/.test(url)?url.replace(/(variant=)[^&]+/,"$1"+id):/\?/.test(url)?url.concat("&variant=").concat(id):url.concat("?variant=").concat(id)}class ProductForm{constructor(element,product,options){this.element=element,this.form=this.element.tagName=="FORM"?this.element:this.element.querySelector("form"),this.product=this._validateProductObject(product),this.variantElement=this.element.querySelector(selectors$g.idInput),options=options||{},this._listeners=new Listeners,this._listeners.add(this.element,"submit",this._onSubmit.bind(this,options)),this.optionInputs=this._initInputs(selectors$g.optionInput,options.onOptionChange),this.planInputs=this._initInputs(selectors$g.planInput,options.onPlanChange),this.quantityInputs=this._initInputs(selectors$g.quantityInput,options.onQuantityChange),this.propertyInputs=this._initInputs(selectors$g.propertyInput,options.onPropertyChange)}destroy(){this._listeners.removeAll()}options(){return this._serializeInputValues(this.optionInputs,function(item){var regex=/(?:^(options\[))(.*?)(?:\])/;return item.name=regex.exec(item.name)[2],item})}variant(){const opts=this.options();return opts.length?getVariantFromSerializedArray(this.product,opts):this.product.variants[0]}plan(variant){let plan={allocation:null,group:null,detail:null};const id=new FormData(this.form).get("selling_plan");return id&&variant&&(plan.allocation=variant.selling_plan_allocations.find(function(item){return item.selling_plan_id.toString()===id.toString()})),plan.allocation&&(plan.group=this.product.selling_plan_groups.find(function(item){return item.id.toString()===plan.allocation.selling_plan_group_id.toString()})),plan.group&&(plan.detail=plan.group.selling_plans.find(function(item){return item.id.toString()===id.toString()})),plan&&plan.allocation&&plan.detail&&plan.allocation?plan:null}properties(){return this._serializeInputValues(this.propertyInput
8s,function(item){var regex=/(?:^(properties\[))(.*?)(?:\])/;return item.name=regex.exec(item.name)[2],item})}quantity(){return this.quantityInputs[0]?Number.parseInt(this.quantityInputs[0].value,10):1}getFormState(){const variant=this.variant();return{options:this.options(),variant,properties:this.properties(),quantity:this.quantity(),plan:this.plan(variant)}}_setIdInputValue(variant){variant&&variant.id?this.variantElement.value=variant.id.toString():this.variantElement.value="",this.variantElement.dispatchEvent(new Event("change"))}_onSubmit(options,event){event.dataset=this.getFormState(),options.onFormSubmit&&options.onFormSubmit(event)}_onOptionChange(event){this._setIdInputValue(event.dataset.variant)}_onFormEvent(cb){return typeof cb>"u"?Function.prototype.bind():function(event){event.dataset=this.getFormState(),this._setIdInputValue(event.dataset.variant),cb(event)}.bind(this)}_initInputs(selector,cb){var elements=Array.prototype.slice.call(this.element.querySelectorAll(selector));return elements.map(function(element){return this._listeners.add(element,"change",this._onFormEvent(cb)),element}.bind(this))}_serializeInputValues(inputs,transform){return inputs.reduce(function(options,input){return(input.checked||input.type!=="radio"&&input.type!=="checkbox")&&options.push(transform({name:input.name,value:input.value})),options},[])}_validateProductObject(product){if(typeof product!="object")throw new TypeError(product+" is not an object.");if(typeof product.variants[0].options>"u")throw new TypeError("Product object is invalid. Make sure you use the product object that is output from {{ product | json }} or from the http://[your-product-url].js route");return product}}function getScript(url,callback,callbackError){let head=document.getElementsByTagName("head")[0],done=!1,script=document.createElement("script");script.src=url,script.onload=script.onreadystatechange=function(){!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")?(done=!0,callback()):callbackError()},head.appendChild(script)}const loaders={};window.isYoutubeAPILoaded=!1,window.isVimeoAPILoaded=!1;function loadScript(options={}){if(options.type||(options.type="json"),options.url)return loaders[options.url]?loaders[options.url]:getScriptWithPromise(options.url,options.type);if(options.json)return loaders[options.json]?Promise.resolve(loaders[options.json]):window.fetch(options.json).then(response=>response.json()).then(response=>(loaders[options.json]=response,response));if(options.name){const key="".concat(options.name,options.version);return loaders[key]?loaders[key]:loadShopifyWithPromise(options)}else return Promise.reject()}function getScriptWithPromise(url,type){const loader=new Promise((resolve,reject)=>{type==="text"?fetch(url).then(response=>response.text()).then(data2=>{resolve(data2)}).catch(error=>{reject(error)}):getScript(url,function(){resolve()},function(){reject()})});return loaders[url]=loader,loader}function loadShopifyWithPromise(options){const key="".concat(options.name,options.version),loader=new Promise((resolve,reject)=>{try{window.Shopify.loadFeatures([{name:options.name,version:options.version,onLoad:err=>{onLoadFromShopify(resolve,reject,err)}}])}catch(err){reject(err)}});return loaders[key]=loader,loader}function onLoadFromShopify(resolve,reject,err){return err?reject(err):resolve()}const selectors$h={scrollbarAttribute:"data-scrollbar",scrollbar:"data-scrollbar-slider",scrollbarSlideFullWidth:"data-scrollbar-slide-fullwidth",scrollbarArrowPrev:"[data-scrollbar-arrow-prev]",scrollbarArrowNext:"[data-scrollbar-arrow-next]"},classes$8={hide:"is-hidden"},settings$1={delay:200};class NativeScrollbar{constructor(scrollbar){this.scrollbar=scrollbar,this.arrowNext=this.scrollbar.parentNode.querySelector(selectors$h.scrollbarArrowNext),this.arrowPrev=this.scrollbar.parentNode.querySelector(selectors$h.scrollbarArrowPrev),this.scrollbar.hasAttribute(selectors$h.scrollbarAttribute)&&(this.init(),this.resize()),this.scrollbar.hasAttribute(selectors$h.scrollbar)&&this.scrollToVisibleElement()}init(){this.arrowNext&&this.arrowPrev&&(this.toggleNextArrow(),this.events())}resize(){document.addEventListener("theme:resize",()=>{this.toggleNextArrow()})}events(){this.arrowNext.addEventListener("click",event=>{event.preventDefault(),this.goToNext()}),this.arrowPrev.addEventListener("click",event=>{event.preventDefault(),this.goToPrev()}),this.scrollbar.addEventListener("scroll",()=>{this.togglePrevArrow(),this.toggleNextArrow()})}goToNext(){const position=(this.scrollbar.hasAttribute(selectors$h.scrollbarSlideFullWidth)?this.scrollbar.getBoundingClientRect().width:this.scrollbar.getBoundingClientRect().width/2)+this.scrollbar.scrollLeft;this.move(position),this.arrowPrev.classList.remove(classes$8.hide),this.toggleNextArrow()}goToPrev(){const moveWith=this.scrollbar.hasAttribute(selectors$h.scrollbarSlideFullWidth)?this.scrollbar.getBoundingClientRect().width:this.scrollbar.getBoundingClientRect().width/2,position=this.scrollbar.scrollLeft-moveWith;this.move(position),this.arrowNext.classList.remove(classes$8.hide),this.togglePrevArrow()}toggleNextArrow(){setTimeout(()=>{this.arrowNext.classList.toggle(classes$8.hide,Math.round(this.scrollbar.scrollLeft+this.scrollbar.getBoundingClientRect().width+1)>=this.scrollbar.scrollWidth)},settings$1.delay)}togglePrevArrow(){setTimeout(()=>{this.arrowPrev.classList.toggle(classes$8.hide,this.scrollbar.scrollLeft<=0)},settings$1.delay)}scrollToVisibleElement(){[].forEach.call(this.scrollbar.children,element=>{element.addEventListener("click",event=>{event.preventDefault(),this.move(element.offsetLeft-element.clientWidth)})})}move(offsetLeft){this.scrollbar.scrollTo({top:0,left:offsetLeft,behavior:"smooth"})}}const defaults={color:"ash"},selectors$i={gridSwatchForm:"[data-grid-swatch-form]",swatch:"data-swatch",outerGrid:"[data-product-grid-item]",slide:"[data-grid-slide]",image:"data-swatch-image",productInfo:"[data-product-information]",variant:"data-swatch-variant",variantName:"data-swatch-variant-name",button:"[data-swatch-button]",link:"[data-grid-link]",wrapper:"[data-grid-swatches]",template:"[data-swatch-template]",handle:"data-swatch-handle",label:"data-swatch-label",tooltip:"data-tooltip",swatchCount:"data-swatch-count",scrollbar:"data-scrollbar",dataVariantTitle:"data-variant-title",quickAddHolder:"[data-quick-add-h
8older]"},classes$9={visible:"is-visible",stopEvents:"no-events"};class ColorMatch{constructor(options={}){this.settings={...defaults,...options},this.match=this.init()}getColor(){return this.match}init(){return loadScript({json:window.theme.assets.swatches}).then(colors=>this.matchColors(colors,this.settings.color)).catch(e=>{console.log("failed to load swatch colors script"),console.log(e)})}matchColors(colors,name){let bg="#E5E5E5",img=null;const path=window.theme.assets.base||"/",comparisonName=name.toLowerCase().replace(/\s/g,""),array=colors.colors;if(array){let indexArray=null;if(array.filter((colorObj,index)=>{if(Object.keys(colorObj).toString().toLowerCase().replace(/\s/g,"")===comparisonName)return indexArray=index,colorObj}).length&&indexArray!==null){const value=Object.values(array[indexArray])[0];bg=value,(value.includes(".jpg")||value.includes(".jpeg")||value.includes(".png")||value.includes(".svg"))&&(img=`${path}${value}`,bg="#888888")}}return{color:this.settings.color,path:img,hex:bg}}}class Swatch{constructor(element){this.element=element,this.colorString=element.getAttribute(selectors$i.swatch),this.image=element.getAttribute(selectors$i.image),this.variant=element.getAttribute(selectors$i.variant),this.variantName=element.getAttribute(selectors$i.variantName),this.tooltip=this.element.closest(`[${selectors$i.tooltip}]`),new ColorMatch({color:this.colorString}).getColor().then(result=>{this.colorMatch=result,this.init()})}init(){this.setStyles(),this.variant&&this.handleEvents(),this.tooltip&&new Tooltip(this.tooltip)}setStyles(){this.colorMatch.hex&&this.element.style.setProperty("--swatch",`${this.colorMatch.hex}`),this.colorMatch.path&&(this.element.style.setProperty("background-image",`url(${this.colorMatch.path})`),this.element.style.setProperty("background-size","cover"),this.element.style.setProperty("background-position","center center"))}handleEvents(){this.outer=this.element.closest(selectors$i.outerGrid),this.outer&&(this.slide=this.outer.querySelector(selectors$i.slide),this.linkElement=this.outer.querySelector(selectors$i.link),this.linkElementAll=this.outer.querySelectorAll(selectors$i.link),this.linkDestination=getUrlWithVariant(this.linkElement.getAttribute("href"),this.variant),this.button=this.element.closest(selectors$i.button),this.button.closest(selectors$i.gridSwatchForm)&&this.button.addEventListener("mouseenter",function(){this.changeImage()}.bind(this)),this.button.closest(selectors$i.gridSwatchForm)||this.button.addEventListener("click",function(){this.changeImage()}.bind(this)))}changeImage(){if(this.linkElementAll.forEach(link=>{link.setAttribute("href",this.linkDestination)}),this.slide.setAttribute("src",this.linkDestination),this.image){const variantName=this.variantName.replaceAll('"',"'"),imageTarget=this.slide.querySelector(`[${selectors$i.dataVariantTitle}="${variantName}"]`);if(imageTarget){const imageVisible=this.slide.querySelector(`[${selectors$i.dataVariantTitle}].${classes$9.visible}`);imageVisible&&imageVisible.classList.remove(classes$9.visible),imageTarget.classList.add(classes$9.visible)}}}}class GridSwatch{constructor(wrap2,container){this.container=container,this.wrap=wrap2,this.outerGrid=wrap2.closest(selectors$i.outerGrid),this.productLink=wrap2.closest(selectors$i.link),this.productInfo=wrap2.closest(selectors$i.productInfo),this.template=document.querySelector(selectors$i.template).innerHTML,this.handle=wrap2.getAttribute(selectors$i.handle),this.quickAddHolder=this.outerGrid.querySelector(selectors$i.quickAddHolder);const label=wrap2.getAttribute(selectors$i.label).trim().toLowerCase();fetchProduct(this.handle).then(product=>{this.product=product,this.colorOption=product.options.find(function(element){return element.name.toLowerCase()===label||null}),this.colorOption&&(this.swatches=this.colorOption.values,this.init())})}init(){this.wrap.innerHTML="",this.count=0,this.swatches.forEach(swatch=>{let variant=null,variantAvailable=!1,image="";for(const productVariant of this.product.variants){const optionWithSwatch=productVariant.options.includes(swatch);if(!variant&&optionWithSwatch&&(variant=productVariant),optionWithSwatch&&productVariant.featured_media){image=productVariant.featured_media.preview_image.src,variant=productVariant;break}}for(const productVariant of this.product.variants)if(productVariant.options.includes(swatch)&&productVariant.available){variantAvailable=!0;break}variant&&(this.wrap.innerHTML+=Sqrl.render(this.template,{animation:window.theme.settings.enableAnimations?` style=--animation-delay:${100*this.count/1e3}s; data-fades-in`:"",color:swatch,swatchStyle:window.theme.settings.swatchStyle,uniq:`${this.product.id}-${variant.id}`,variant:variant.id,variantName:variant.title.replaceAll('"',"'"),available:variantAvailable,image}),this.count++)}),this.swatchCount=this.productLink.querySelector(`[${selectors$i.swatchCount}]`),this.swatchElements=this.wrap.querySelectorAll(`[${selectors$i.swatch}]`),this.swatchForm=this.productLink.querySelector(selectors$i.gridSwatchForm),this.hideSwatchesTimer=0,this.swatchCount.hasAttribute(selectors$i.swatchCount)&&(this.swatchCount.innerText=`${this.count} ${this.count>1?theme.strings.otherColor:theme.strings.oneColor}`,this.swatchCount.addEventListener("mouseenter",()=>{this.hideSwatchesTimer&&clearTimeout(this.hideSwatchesTimer),this.productLink.classList.add(classes$9.stopEvents),this.swatchForm.classList.add(classes$9.visible),this.quickAddHolder&&this.quickAddHolder.classList.remove(classes$9.visible)}),this.productInfo.addEventListener("mouseleave",()=>{this.hideSwatchesTimer=setTimeout(()=>{this.productLink.classList.remove(classes$9.stopEvents),this.swatchForm.classList.remove(classes$9.visible)},100)})),this.wrap.hasAttribute(selectors$i.scrollbar)&&new NativeScrollbar(this.wrap),this.swatchElements.forEac
8h(el=>{new Swatch(el)})}}const makeGridSwatches=section=>{section.container.querySelectorAll(selectors$i.wrapper).forEach(wrap2=>{new GridSwatch(wrap2,void 0)})},swatchSection={onLoad(){this.swatches=[],this.container.querySelectorAll(`[${selectors$i.swatch}]`).forEach(el=>{this.swatches.push(new Swatch(el))})}},swatchGridSection={onLoad(){makeGridSwatches(this)}},selectors$j={elements:{html:"html",body:"body",apiContent:"[data-api-content]",sectionId:"data-section-id",sectionOuter:"[data-section-id]",productGridItem:"data-product-grid-item",formQuickAdd:"[data-form-quick-add]",quickAddLabel:"data-quick-add-label",quickCollectionHande:"data-collection-handle",selectOption:"[data-select-option]:not([data-quick-add-button])",holderFormQuickAdd:"[data-quick-add-holder]",goToNextElement:"data-go-to-next",quickAddElement:"data-quick-add-button",productJson:"[data-product-json]",productOptionsJson:"[data-product-options-json]",quickAddFormHolder:"[data-quick-add-form-holder]",featuredImageHolder:"[data-grid-slide]",productImagesHolder:"[data-product-image]",productInformationHolder:"[data-product-information]",scrollbarHolder:"[data-scrollbar]",radioOption:"[data-radio-option]",popoutWrapper:"[data-popout]",popupList:"[data-popout-list]",popupoutOption:"[data-popout-option]",popupoutOptionValue:"data-value",popupoutToggle:"[data-popout-toggle]",optionPosition:"data-option-position",swatch:"data-swatch",backButton:"[data-back-button]",messageError:"[data-message-error]",idInput:'[name="id"]',buttonQuickAddMobile:"[data-button-quick-add-mobile]",ariaExpanded:"aria-expanded",input:"input",dataVariantTitle:"data-variant-title",dataGridLink:"data-grid-link",legendLabel:"[data-legend-label]",legendText:"[data-legend-text]",fieldset:"[data-fieldset]"},classes:{active:"is-active",select:"is-selected",disable:"is-disable",hide:"is-hidden",added:"is-added",loading:"is-loading",visible:"is-visible",error:"has-error",focus:"is-focused",popupoutVisible:"popout-list--visible",overlayText:"product-item--overlay-text"},times:{debounce:500,delay:400,delayMedium:2e3,delayLarge:5e3},imageSize:"800x800"},attributes$3={tabindex:"tabindex"},instances$1=[];class QuickAddProduct{constructor(el){this.themeAccessibility=window.accessibility,this.document=document,this.html=this.document.querySelector(selectors$j.elements.html),this.body=this.document.querySelector(selectors$j.elements.body),this.productGridItem=el,this.holder=this.productGridItem.querySelector(selectors$j.elements.holderFormQuickAdd),this.quickAddLabel=this.productGridItem.querySelector(`[${selectors$j.elements.quickAddLabel}]`),this.quickAddFormHolder=this.productGridItem.querySelector(selectors$j.elements.quickAddFormHolder),this.featuredImageHolder=this.productGridItem.querySelector(selectors$j.elements.featuredImageHolder),this.productInformationHolder=this.productGridItem.querySelector(selectors$j.elements.productInformationHolder),this.buttonQuickAddMobile=this.productGridItem.querySelector(selectors$j.elements.buttonQuickAddMobile),this.sectionOuter=this.productGridItem.closest(selectors$j.elements.sectionOuter),this.sectionId=this.sectionOuter.getAttribute(selectors$j.elements.sectionId),this.productJSON=null,this.productOptionsJSON=null,this.productForm=null,this.selectedOptions=[],this.filteredOptions=[],this.enableMobileMode=!1,this.accessibilityStopEvent=!1,this.quickAddFormIsLoaded=!1,theme.settings.enableQuickAdd?(this.accessibility(),this.show(),this.hide(),this.errorHandle()):this.productGridItem&&this.productGridItem.addEventListener("mouseenter",()=>this.addVariantImages())}initNativeScrollbar(){this.scrollbarHolder.length&&this.scrollbarHolder.forEach(scrollbar=>{new NativeScrollbar(scrollbar)})}getForm(){if(this.quickAddFormIsLoaded)return;this.quickAddFormIsLoaded=!0;const root=theme.routes.root==="/"?"":theme.routes.root;fetch(root+"/products/"+this.quickAddLabel.getAttribute(selectors$j.elements.quickAddLabel)+"?section_id=api-quick-add").then(response=>response.text()).then(data2=>{const fresh=document.createElement("div");fresh.innerHTML=data2;const cleanResponse=fresh.querySelector(selectors$j.elements.apiContent).innerHTML,unique=`${this.quickAddLabel.getAttribute(selectors$j.elements.quickCollectionHande)}-${this.sectionId}`;this.quickAddFormHolder.innerHTML=cleanResponse.replaceAll("||collection-index||",unique),this.loadForm()}).catch(e=>{console.warn(e)})}loadForm(){this.form=this.quickAddFormHolder.querySelector(selectors$j.elements.formQuickAdd),this.selectOption=this.quickAddFormHolder.querySelectorAll(selectors$j.elements.selectOption),this.productElemJSON=this.quickAddFormHolder.querySelector(selectors$j.elements.productJson),this.productOptionsElemJSON=this.quickAddFormHolder.querySelector(selectors$j.elements.productOptionsJson),this.scrollbarHolder=this.quickAddFormHolder.querySelectorAll(selectors$j.elements.scrollbarHolder),this.popoutWrapper=this.quickAddFormHolder.querySelectorAll(selectors$j.elements.popoutWrapper),this.swatches=this.quickAddFormHolder.querySelectorAll(`[${selectors$j.elements.swatch}]`),this.backButtons=this.quickAddFormHolder.querySelectorAll(selectors$j.elements.backButton),this.swatches.length&&(this.swatches.forEac
8h(swatch=>{new Swatch(swatch)}),this.changeVariantImageOnHover()),this.popoutWrapper.length&&this.popoutWrapper.forEach(wrapper=>{new Popout(wrapper)}),this.initNativeScrollbar(),this.initGoToBack();const hasProductJSON=this.productElemJSON&&this.productElemJSON.innerHTML!=="",hasProductOptionsJSON=this.productOptionsElemJSON&&this.productOptionsElemJSON.innerHTML!=="";hasProductJSON&&hasProductOptionsJSON?(this.productJSON=JSON.parse(this.productElemJSON.innerHTML),this.productOptionsJSON=JSON.parse(this.productOptionsElemJSON.innerHTML),this.initForm()):console.error("Missing product JSON or product options with values JSON")}initForm(){this.filterFirstOptionValues(),this.productForm=new ProductForm(this.form,this.productJSON,{onOptionChange:this.onOptionChange.bind(this)}),this.enableMobileMode?(this.addFirstVariantIsDefault(this.buttonQuickAddMobile.hasAttribute(selectors$j.elements.quickAddElement)),this.buttonQuickAddMobile.classList.add(selectors$j.classes.hide),this.buttonQuickAddMobile.classList.remove(selectors$j.classes.loading),this.quickAddLabel.classList.add(selectors$j.classes.hide),this.toggleClasses()):this.quickAddLabel.classList.remove(selectors$j.classes.disable,selectors$j.classes.hide)}onOptionChange(event){const targetElement=event.target,optionHolder=targetElement.closest(selectors$j.elements.selectOption),position=Number(optionHolder.getAttribute(selectors$j.elements.optionPosition)),firstOptionValue=event.dataset.variant?event.dataset.variant.options[position-1]:event.dataset.options[position-1],focusedIsEnable=this.body.classList.contains(selectors$j.classes.focus);this.changeVariantImage(event.dataset.variant),!(focusedIsEnable&&this.accessibilityStopEvent)&&(this.selectedOptions.push(event.target.value),optionHolder.classList.add(selectors$j.classes.select),this.filterAvailableOptions(firstOptionValue,position),targetElement.hasAttribute(selectors$j.elements.goToNextElement)&&(optionHolder.classList.remove(selectors$j.classes.active),optionHolder.nextElementSibling.classList.add(selectors$j.classes.active)),targetElement.hasAttribute(selectors$j.elements.quickAddElement)&&event.dataset.variant.available&&(theme.settings.cartDrawerEnabled&&(this.quickAddLabel.classList.remove(selectors$j.classes.hide),this.quickAddLabel.classList.add(selectors$j.classes.loading)),this.html.dispatchEvent(new CustomEvent("theme:cart:add",{bubbles:!0,detail:{element:this.holder,label:this.quickAddLabel,data:{id:event.dataset.variant.id,quantity:1}}})),setTimeout(()=>{this.selectedOptions=[],this.resetInputsOfInstance()},selectors$j.times.delayMedium),optionHolder.classList.remove(selectors$j.classes.active)),this.accessibilityStopEvent=!1)}initGoToBack(){this.backButtons.length&&this.backButtons.forEach(button=>{button.addEventListener("click",event=>{event.preventDefault();const isFocused=this.body.classList.contains(selectors$j.classes.focus);this.selectedOptions.pop();const optionHolder=button.closest(selectors$j.elements.selectOption);let previousHolder=optionHolder.previousElementSibling.matches(selectors$j.elements.selectOption)?optionHolder.previousElementSibling:this.quickAddLabel;if(this.quickAddLabel,previousHolder===this.quickAddLabel&&isFocused&&(this.themeAccessibility.lastFocused=this.quickAddLabel),previousHolder===this.quickAddLabel&&this.enableMobileMode&&(previousHolder=this.buttonQuickAddMobile),previousHolder!==this.quickAddLabel){const inputs=optionHolder.querySelectorAll(selectors$j.elements.input),selects=optionHolder.querySelectorAll(selectors$j.elements.popupoutOption),previousInputs=previousHolder.querySelectorAll(selectors$j.elements.input),previousSelects=previousHolder.querySelectorAll(selectors$j.elements.popupoutOption);inputs&&inputs.forEach(input=>{input.checked=!1}),selects&&selects.forEach(option=>{option.classList.remove(selectors$j.classes.visible)}),previousInputs&&previousInputs.forEach(input=>{input.checked=!1}),previousSelects&&previousSelects.forEach(option=>{option.classList.remove(selectors$j.classes.visible)})}previousHolder!==this.buttonQuickAddMobile&&previousHolder.classList.add(selectors$j.classes.active,selectors$j.classes.select),previousHolder===this.buttonQuickAddMobile&&this.holder.classList.remove(selectors$j.classes.visible),previousHolder.classList.remove(selectors$j.classes.hide),optionHolder.classList.remove(selectors$j.classes.active,selectors$j.classes.select),isFocused&&previousHolder.focus()})})}toggleClasses(){this.holder.classList.add(selectors$j.classes.visible),this.selectOption&&this.selectOption.length&&this.quickAddFormHolder.innerHTML!==" "&&(this.quickAddLabel.classList.add(selectors$j.classes.hide),Array.from(this.selectOption).filter(option=>option.classList.contains(selectors$j.classes.active)).length===0&&this.selectOption[0].classList.add(selectors$j.classes.active))}addFirstVariantIsDefault(targetHasQuickAddAttribute){const firstVariant=this.productJSON.variants[0];targetHasQuickAddAttribute&&firstVariant.available&&(theme.settings.cartDrawerEnabled&&(this.quickAddLabel.classList.remove(selectors$j.classes.hide),this.quickAddLabel.classList.add(selectors$j.classes.loading)),this.html.dispatchEvent(new CustomEvent("theme:cart:add",{bubbles:!0,detail:{element:this.holder,label:this.quickAddLabel,data:{id:firstVariant.id,quantity:1}}})))}show(){this.buttonQuickAddMobile&&this.buttonQuickAddMobile.addEventListener("click",()=>{this.enableMobileMode=!0,this.buttonQuickAddMobile.classList.add(selectors$j.classes.loading),this.quickAddFormHolder.innerHTML===" "&&!this.quickAddFormIsLoaded?this.getForm():(this.toggleClasses(),this.buttonQuickAddMobile.classList.remove(selectors$j.classes.loading),this.buttonQuickAddMobile.classList.add(selectors$j.classes.hide),this.holder.classList.add(selectors$j.classes.visible)),this.productJSON!==null&&this.addFirstVariantIsDefault(this.buttonQuickAddMobile.hasAttribute(selectors$j.elements.quickAddElement))}),this.productGridItem&&this.productGridItem.addEventListener("mouseenter",()=>{this.enableMobileMode=!1,this.hideOtherHolders(),this.quickAddFormHolder&&this.quickAddFormHolder.innerHTML===" "&&!this.quickAddFormIsLoaded&&this.getForm(),this.addVariantImages()}),this.quickAddLabel&&(this.quickAddLabel.addEventListener("focusin",()=>{this.enableMobileMode=!1,this.quickAddFormHolder.innerHTML===" "&&!this.quickAddFormIsLoaded&&this.getForm()}),this.quickAddLabel.addEventListener("click",()=>{this.enableMobileMode=!1,!(this.quickAddLabel.classList.contains(selectors$j.classes.added)||this.quickAddLabel.classList.contains(selectors$j.classes.disable)||this.productJSON===null)&&(this.selectedOptions=[],this.addFirstVariantIsDefault(this.quickAddLabel.hasAttribute(selectors$j.elements.quickAddElement)),this.quickAddFormHolder.innerHTML!==" "&&this.toggleClasses(),this.addVariantImages())})),this.productInformationHolder.addEventListener("mouseenter",()=>{this.featuredImageHolder.closest(selectors$j.elements.productImagesHolder).classList.remove(selectors$j.classes.visible)})}hide(){(this.quickAddLabel||this.buttonQuickAddMobile)&&(theme.settings.cartDrawerEnabled?this.document.addEventListener("theme:cart:close",()=>{setTimeout(()=>{this.resetButtonsOfInstance()},selectors$j.times.delayLarge)}):setTimeout(()=>{this.resetButtonsOfInstance()},selectors$j.times.delayLarge))}accessibility(){this.productGridItem.addEventListener("keyup",event=>{event.target.closest(`[${selectors$j.elements.productGridItem}]`).classList.contains(selectors$j.classes.overlayText)&&this.handleItemsWithTextOverlayFocus(event.target),event.keyCode===window.theme.keyboardKeys.TAB&&(this.accessibilityStopEvent=!0),event.keyCode===window.theme.keyboardKeys.ENTER&&(this.accessibilityStopEvent=!1,(event.target.hasAttribute(selectors$j.elements.popupoutOptionValue)?event.target.closest(selectors$j.elements.popupList).nextElementSibling:event.target).dispatchEvent(new Event("change")))})}handleItemsWithTextOverlayFocus(element){const parentProduct=element.closest(`[${selectors$j.elements.productGridItem}]`),productInfo=parentProduct.querySelector(selectors$j.elements.productInformationHolder),quickAddHolder=parentProduct.querySelector(selectors$j.elements.holderFormQuickAdd),doubleImage=parentProduct.querySelector(selectors$j.elements.productImagesHolder),isHolderVisible=quickAddHolder.classList.contains(selectors$j.classes.visible),isButtonQuickAdd=element.hasAttribute(selectors$j.elements.quickAddLabel),isProductLink=element.hasAttribute(selectors$j.elements.dataGridLink),isRadioOption=element.type==="radio",isButtonBack=element===parentProduct.querySelector(selectors$j.elements.backButton);if(parentProduct.previousElementSibling!==null&&(parentProduct.previousElementSibling.querySelector(selectors$j.elements.productInformationHolder).classList.remove(selectors$j.classes.hide),parentProduct.previousElementSibling.querySelector(selectors$j.elements.holderFormQuickAdd).classList.remove(selectors$j.classes.visible),parentProduct.previousElementSibling.querySelector(selectors$j.elements.productImagesHolder).classList.remove(selectors$j.classes.visible)),parentProduct.nextElementSibling!==null&&(parentProduct.nextElementSibling.querySelector(selectors$j.elements.productInformationHolder).classList.remove(selectors$j.classes.hide),parentProduct.nextElementSibling.querySelector(selectors$j.elements.holderFormQuickAdd).classList.remove(selectors$j.classes.visible),parentProduct.nextElementSibling.querySelector(selectors$j.elements.productImagesHolder).classList.remove(selectors$j.classes.visible)),isProductLink&&(productInfo.classList.remove(selectors$j.classes.hide),quickAddHolder.classList.remove(selectors$j.classes.visible),doubleImage.classList.remove(selectors$j.classes.visible)),isButtonQuickAdd||isHolderVisible||isRadioOption||isButtonBack){productInfo.classList.add(selectors$j.classes.hide);return}productInfo.classList.remove(selectors$j.classes.hide)}filterAvailableOptions(value,optionIndex,enableCheck=!0){const variants=this.productJSON.variants.filter(variant=>{if(variant.options.length>1){let available=[];
8if(this.selectedOptions.forEach((option,index)=>{available.push(variant[`option${optionIndex}`]===value&&variant.options[index]===option&&variant.available)}),!available.includes(!1)&&available.length>0)return variant}else return variant[`option${optionIndex}`]===value&&variant.available});this.productOptionsJSON.forEach(option=>{if(option.position!==optionIndex){const filteredObject={};filteredObject.name=option.name,filteredObject.position=option.position,filteredObject.values=[],option.values.forEach(value2=>{variants.filter(variant=>variant[`option${option.position}`]===value2).length&&filteredObject.values.push(value2)}),this.filteredOptions=[...this.filteredOptions,filteredObject]}}),enableCheck&&(this.disableUnavailableValues(),this.filteredOptions=[])}filterFirstOptionValues(){this.productOptionsJSON[0].values.forEach(value=>{if(this.productJSON.variants.filter(variant=>variant.option1===value&&variant.available).length===0&&this.selectOption[0]!==void 0){const inputsArr=this.selectOption[0].querySelectorAll("input"),elementsArr=this.selectOption[0].querySelectorAll(`[${selectors$j.elements.popupoutOptionValue}]`);let currentInput=null,currentOption=null;if(inputsArr.length){for(const input of inputsArr)if(input.value===value){currentInput=input;break}}if(elementsArr.length){for(const element of elementsArr)if(element.getAttribute(selectors$j.elements.popupoutOptionValue)===value){currentOption=element;break}}currentInput&&(currentInput.checked=!1,currentInput.disabled=!0),currentOption&¤tOption.classList.add(selectors$j.classes.disable)}})}disableUnavailableValues(){this.selectOption&&this.selectOption.forEach(option=>{const inputs=option.querySelectorAll(selectors$j.elements.input),selects=option.querySelectorAll(selectors$j.elements.popupoutOption);inputs.forEach(input=>{option.classList.contains(selectors$j.classes.select)||(input.checked=!1,input.disabled=!0),this.filteredOptions.forEach(data2=>{data2.values.includes(input.value)&&(input.disabled=!1)})}),selects.forEach(item=>{option.classList.contains(selectors$j.classes.select)||(item.setAttribute(attributes$3.tabindex,-1),item.classList.add(selectors$j.classes.disable)),this.filteredOptions.forEach(data2=>{data2.values.includes(item.getAttribute(`${selectors$j.elements.popupoutOptionValue}`))&&(item.classList.remove(selectors$j.classes.disable),item.setAttribute(attributes$3.tabindex,0))})})})}changeVariantImageOnHover(){this.swatches.forEach(swatch=>{swatch.previousElementSibling&&swatch.previousElementSibling.tagName==="INPUT"&&swatch.previousElementSibling.addEventListener("change",e=>this.changeVariantImageOnHoverActions(e,swatch)),swatch.addEventListener("mouseover",e=>this.changeVariantImageOnHoverActions(e,swatch))}),this.productGridItem.addEventListener("mouseenter",e=>{const legend=e.target.querySelector(selectors$j.elements.fieldset).querySelector(`${selectors$j.elements.legendText}`);legend&&(legend.innerText=theme.strings.selectColor)})}changeVariantImageOnHoverActions(e,swatch){const swatchLabel=e.target.parentElement.dataset.label,legend=e.target.closest(selectors$j.elements.fieldset).querySelector(`${selectors$j.elements.legendText}`);legend.innerText=swatchLabel;for(let index=0;index<this.productJSON.variants.length;index++){const variant=this.productJSON.variants[index];if(variant.featured_media!==void 0&&variant.options[this.selectedOptions.length]===swatch.getAttribute(selectors$j.elements.swatch)){this.changeVariantImage(variant);break}}}changeVariantImage(currentVariant){const imageExists=currentVariant&¤tVariant.featured_media&¤tVariant.featured_media!==void 0,currentVariantTitle=currentVariant.title.replaceAll('"',"'");if(imageExists){const imageTarget=this.featuredImageHolder.querySelector(`[${selectors$j.elements.dataVariantTitle}="${currentVariantTitle}"]`);if(imageTarget){const imageVisible=this.featuredImageHolder.querySelector(`[${selectors$j.elements.dataVariantTitle}].${selectors$j.classes.visible}`);imageVisible&&imageVisible.classList.remove(selectors$j.classes.visible),imageTarget.classList.add(selectors$j.classes.visible)}else{const currentImage=themeImages.getSizedImageUrl(currentVariant.featured_media.preview_image.src,selectors$j.imageSize);this.featuredImageHolder.style.setProperty("background-image",`url(${currentImage})`)}this.featuredImageHolder.closest(selectors$j.elements.productImagesHolder).classList.add(selectors$j.classes.visible)}}addVariantImages(){const images=this.productGridItem.querySelectorAll(`[${selectors$j.elements.dataVariantTitle}][style*="display: none;"]`);
8images.length&&images.forEach(image=>{image.style.removeProperty("display")})}resetOptions(option){option.querySelectorAll(selectors$j.elements.input).forEach(input=>{input.checked=!1,input.disabled=!1}),option.querySelectorAll(selectors$j.elements.popupoutOption).forEach(option2=>{option2.classList.remove(selectors$j.classes.disable),option2.setAttribute(attributes$3.tabindex,1)})}hideOtherHolders(){const otherHolderFormQuickAdd=this.document.querySelectorAll(selectors$j.elements.holderFormQuickAdd);otherHolderFormQuickAdd&&otherHolderFormQuickAdd.forEach(holder=>{if(holder!==this.holder){holder.classList.remove(selectors$j.classes.visible);const parentProduct=holder.closest(`[${selectors$j.elements.productGridItem}]`),selectToggleButton=holder.querySelector(selectors$j.elements.popupoutToggle),productInfo=parentProduct.querySelector(selectors$j.elements.productInformationHolder),hasOverlayText=parentProduct.classList.contains(selectors$j.classes.overlayText),hasError=holder.classList.contains(selectors$j.classes.error);selectToggleButton&&(selectToggleButton.setAttribute(selectors$j.elements.ariaExpanded,!1),selectToggleButton.nextElementSibling.classList.remove(selectors$j.classes.popupoutVisible)),this.popoutWrapper&&parentProduct.querySelector(selectors$j.elements.productImagesHolder).classList.remove(selectors$j.classes.visible),hasOverlayText&&(productInfo.classList.remove(selectors$j.classes.hide),productInfo.classList.toggle(selectors$j.classes.hide,hasError))}})}resetInputsOfInstance(){this.selectOption&&(this.quickAddLabel.classList.remove(selectors$j.classes.hide),this.initNativeScrollbar(),this.selectOption.forEach(option=>{option.classList.remove(selectors$j.classes.active,selectors$j.classes.select);const selectToggleButton=option.querySelector(selectors$j.elements.popupoutToggle);selectToggleButton&&(selectToggleButton.innerText=theme.strings.selectValue,selectToggleButton.setAttribute(selectors$j.elements.ariaExpanded,!1)),this.resetOptions(option)}),this.filterFirstOptionValues(),this.filteredOptions=[])}resetButtonsOfInstance(){this.quickAddLabel.classList.remove(selectors$j.classes.select,selectors$j.classes.added,selectors$j.classes.visible),this.buttonQuickAddMobile.classList.remove(selectors$j.classes.hide)}errorHandle(){this.html.addEventListener("theme:cart:error",event=>{const holder=event.detail.holder,errorMessageHolder=holder.querySelector(selectors$j.elements.messageError),parentProduct=holder.closest(`[${selectors$j.elements.productGridItem}]`),hasOverlayText=parentProduct.classList.contains(selectors$j.classes.overlayText),productInfo=parentProduct.querySelector(selectors$j.elements.productInformationHolder);holder.querySelector(`[${selectors$j.elements.quickAddLabel}]`).classList.remove(selectors$j.classes.visible,selectors$j.classes.added,selectors$j.classes.loading),holder.classList.add(selectors$j.classes.error),errorMessageHolder.innerText=event.detail.description,hasOverlayText&&productInfo.classList.add(selectors$j.classes.hide),setTimeout(()=>{holder.classList.remove(selectors$j.classes.error),holder.classList.add(selectors$j.classes.visible),holder.previousElementSibling.classList.remove(selectors$j.classes.hide),hasOverlayText&&productInfo.classList.remove(selectors$j.classes.hide)},selectors$j.times.delayLarge)})}}const quickAddProduct={onLoad(){this.container.querySelectorAll(`[${selectors$j.elements.productGridItem}]`).forEach(item=>{instances$1.push(new QuickAddProduct(item))})}},selectors$k={rangeSlider:"[data-range-slider]",rangeDotLeft:"[data-range-left]",rangeDotRight:"[data-range-right]",rangeLine:"[data-range-line]",rangeHolder:"[data-range-holder]",dataMin:"data-se-min",dataMax:"data-se-max",dataMinValue:"data-se-min-value",dataMaxValue:"data-se-max-value",dataStep:"data-se-step",dataFilterUpdate:"data-range-filter-update",priceMin:"[data-field-price-min]",priceMax:"[data-field-price-max]"},classes$a={initialized:"is-initialized"};class RangeSlider{constructor(section){this.container=section.container,this.slider=section.querySelector(selectors$k.rangeSlider),this.resizeFilters=()=>this.init(),this.slider&&(this.onMoveEvent=event=>this.onMove(event),this.onStopEvent=event=>this.onStop(event),this.onStartEvent=event=>this.onStart(event),this.startX=0,this.x=0,this.touchLeft=this.slider.querySelector(selectors$k.rangeDotLeft),this.touchRight=this.slider.querySelector(selectors$k.rangeDotRight),this.lineSpan=this.slider.querySelector(selectors$k.rangeLine),this.min=parseFloat(this.slider.getAttribute(selectors$k.dataMin)),this.max=parseFloat(this.slider.getAttribute(selectors$k.dataMax)),this.step=0,this.normalizeFact=26,this.init())}init(){let defaultMinValue=this.min;this.slider.hasAttribute(selectors$k.dataMinValue)&&(defaultMinValue=parseFloat(this.slider.getAttribute(selectors$k.dataMinValue)));let defaultMaxValue=this.max;this.slider.hasAttribute(selectors$k.dataMaxValue)&&(defaultMaxValue=parseFloat(this.slider.getAttribute(selectors$k.dataMaxValue))),defaultMinValue<this.min&&(defaultMinValue=this.min),defaultMaxValue>this.max&&(defaultMaxValue=this.max),defaultMinValue>defaultMaxValue&&(defaultMinValue=defaultMaxValue),this.slider.getAttribute(selectors$k.dataStep)&&(this.step=Math.abs(parseFloat(this.slider.getAttribute(selectors$k.dataStep)))),this.reset(),document.addEventListener("theme:resize",this.resizeFilters),this.maxX=this.slider.offsetWidth-this.touchRight.offsetWidth,this.selectedTouch=null,this.initialValue=this.lineSpan.offsetWidth-this.normalizeFact,this.setMinValue(defaultMinValue),this.setMaxValue(defaultMaxValue),this.touchLeft.addEventListener("mousedown",this.onStartEvent),this.touchRight.addEventListener("mousedown",this.onStartEvent),this.touchLeft.addEventListener("touchstart",this.onStartEvent),this.touchRight.addEventListener("touchstart",this.onStartEvent),this.slider.classList.add(classes$a.initialized)}reset(){this.touchLeft.style.left="0px",this.touchRight.style.left=this.slider.offsetWidth-this.touchLeft.offsetWidth+"px",this.lineSpan.style.marginLeft="0px",this.lineSpan.style.width=this.slider.offsetWidth-this.touchLeft.offsetWidth+"px",this.startX=0,this.x=0}setMinValue(minValue){const ratio=(minValue-this.min)/(this.max-this.min);this.touchLeft.style.left=Math.ceil(ratio*(this.slider.offsetWidth-(this.touchLeft.offsetWidth+this.normalizeFact)))+"px",this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.slider.setAttribute(selectors$k.dataMinValue,minValue)}setMaxValue(maxValue){const ratio=(maxValue-this.min)/(this.max-this.min);this.touchRight.style.left=Math.ceil(ratio*(this.slider.offsetWidth-(this.touchLeft.offsetWidth+this.normalizeFact))+this.normalizeFact)+"px",this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.slider.setAttribute(selectors$k.dataMaxValue,maxValue)}onStart(event){event.preventDefault();let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),event.currentTarget===this.touchLeft?this.x=this.touchLeft.offsetLeft:event.currentTarget===this.touchRight&&(this.x=this.touchRight.offsetLeft),this.startX=eventTouch.pageX-this.x,this.selectedTouch=event.currentTarget,document.addEventListener("mousemove",this.onMoveEvent),document.addEventListener("mouseup",this.onStopEvent),document.addEventListener("touchmove",this.onMoveEvent),document.addEventListener("touchend",this.onStopEvent)}onMove(event){let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),this.x=eventTouch.pageX-this.startX,this.selectedTouch===this.touchLeft?(this.x>this.touchRight.offsetLeft-this.selectedTouch.offsetWidth+10?this.x=this.touchRight.offsetLeft-this.selectedTouch.offsetWidth+10:this.x<0&&(this.x=0),this.selectedTouch.style.left=this.x+"px"):this.selectedTouch===this.touchRight&&(this.x<this.touchLeft.offsetLeft+this.touchLeft.offsetWidth-10?this.x=this.touchLeft.offsetLeft+this.touchLeft.offsetWidth-10:this.x>this.maxX&&(this.x=this.maxX),this.selectedTouch.style.left=this.x+"px"),this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.calculateValue(),this.slider.getAttribute("on-change")&&new Function("min, max",this.slider.getAttribute("on-change"))(this.slider.getAttribute(selectors$k.dataMinValue),this.slider.getAttribute(selectors$k.dataMaxValue)),this.onChange(this.slider.getAttribute(selectors$k.dataMinValue),this.slider.getAttribute(selectors$k.dataMaxValue))}onStop(event){document.removeEventListener("mousemove",this.onMoveEvent),document.removeEventListener("mouseup",this.onStopEvent),document.removeEventListener("touchmove",this.onMoveEvent),document.removeEventListener("touchend",this.onStopEvent),this.selectedTouch=null,this.calculateValue(),this.onChanged(this.slider.getAttribute(selectors$k.dataMinValue),this.slider.getAttribute(selectors$k.dataMaxValue))}onChange(min,max){const rangeHolder=this.slider.closest(selectors$k.rangeHolder);if(rangeHolder){const priceMin=rangeHolder.querySelector(selectors$k.priceMin),priceMax=rangeHolder.querySelector(selectors$k.priceMax);priceMin&&priceMax&&(priceMin.value=min,priceMax.value=max)}}onChanged(min,max){this.slider.hasAttribute(selectors$k.dataFilterUpdate)&&this.slider.dispatchEvent(new CustomEvent("theme:range:update",{bubbles:!0}))}calculateValue(){const newValue=(this.lineSpan.offsetWidth-this.normalizeFact)/this.initialValue;let minValue=this.lineSpan.offsetLeft/this.initialValue,maxValue=minValue+newValue;if(minValue=minValue*(this.max-this.min)+this.min,maxValue=maxValue*(this.max-this.min)+this.min,this.step!==0){let multi=Math.floor(minValue/this.step);minValue=this.step*multi,multi=Math.floor(maxValue/this.step),maxValue=this.step*multi}this.selectedTouch===this.touchLeft&&this.slider.setAttribute(selectors$k.dataMinValue,minValue),this.selectedTouch===this.touchRight&&this.slider.setAttribute(selectors$k.dataMaxValue,maxValue)}onUnload(){this.resizeFilters&&document.removeEventListener("theme:resize",this.resizeFilters)}}const selectors$l={collectionSidebar:"[data-collection-sidebar]",form:"[data-collection-filters-form]",input:"input",select:"select",label:"label",textarea:"textarea",priceMin:"[data-field-price-min]",priceMax:"[data-field-price-max]",priceMinValue:"data-field-price-min",priceMaxValue:"data-field-price-max",rangeMin:"[data-se-min-value]",rangeMax:"[data-se-max-value]",rangeMinValue:"data-se-min-value",rangeMaxValue:"data-se-max-value",rangeMinDefault:"data-se-min",rangeMaxDefault:"data-se-max",productsContainer:"[data-products-grid]",product:"[data-product-grid-item]",filterUpdateUrlButton:"[data-filter-update-url]",dataActiveFilters:"[data-active-filters]",dataActiveFiltersCount:"data-active-filters-count",dataSort:"data-sort-enabled",collectionNav:"[data-collection-nav]"},classes$b={hidden:"hidden",loading:"is-loading"};let sections$7={};class FiltersForm{constructor(section){this.section=section,this.container=this.section.container,this.sidebar=this.container.querySelector(selectors$l.collectionSidebar),this.form=this.container.querySelector(selectors$l.form),this.sort=this.container.querySelector(`[${selectors$l.dataSort}]`),this.productsContainer=this.container.querySelector(selectors$l.productsContainer),this.collectionNav=this.container.querySelector(selectors$l.collectionNav),this.init()}init(){this.form&&(this.initRangeSlider(),this.sidebar.addEventListener("input",debounce(e=>{const type=e.type,target=e.target;if((type===selectors$l.input||type===selectors$l.select||type===selectors$l.label||type===selectors$l.textarea)&&this.form&&typeof this.form.submit=="function"){const priceMin=this.form.querySelector(selectors$l.priceMin),priceMax=this.form.querySelector(selectors$l.priceMax);priceMin&&priceMax&&(target.hasAttribute(selectors$l.priceMinValue)&&!priceMax.value?priceMax.value=priceMax.placeholder:target.hasAttribute(selectors$l.priceMaxValue)&&!priceMin.value&&(priceMin.value=priceMin.placeholder)),this.submitForm(e)}},500)),this.sidebar.addEventListener("theme:range:update",e=>this.updateRange(e))),this.sidebar&&this.sidebar.addEventListener("click",e=>this.filterUpdateFromUrl(e)),this.productsContainer&&this.productsContainer.addEventListener("click",e=>this.filterUpdateFromUrl(e)),this.sort&&this.container.addEventListener("theme:filter:update",e=>this.submitForm(e)),(this.sidebar||this.sort)&&window.addEventListener("popstate",e=>this.submitForm(e))}initRangeSlider(){new RangeSlider(this.form)}filterUpdateFromUrl(e){const target=e.target;if(target.matches(selectors$l.filterUpdateUrlButton)||target.closest(selectors$l.filterUpdateUrlButton)&&target){e.preventDefault();const button=target.matches(selectors$l.filterUpdateUrlButton)?target:target.closest(selectors$l.filterUpdateUrlButton);this.submitForm(e,button.getAttribute("href"))}}submitForm(e,replaceHref=""){this.sort=this.container.querySelector(`[${selectors$l.dataSort}]`);const sortValue=this.sort?this.sort.getAttribute(selectors$l.dataSort):"";if(!e||e&&e.type!=="popstate")if(replaceHref===""){let filterUrl=new window.URL(window.location.href).searchParams;const filterUrlParams=Object.fromEntries(filterUrl),filterUrlRemoveString=filterUrl.toString();if(filterUrlRemoveString.includes("filter.")||filterUrlRemoveString.includes("page="))for(const key in filterUrlParams)(key.includes("filter.")||key==="page")&&filterUrl.delete(key);if(this.form){const formData=new FormData(this.form),formParams=new URLSearchParams(formData),rangeMin=this.form.querySelector(selectors$l.rangeMin),rangeMax=this.form.querySelector(selectors$l.rangeMax),rangeMinDefaultValue=rangeMin&&rangeMin.hasAttribute(selectors$l.rangeMinDefault)?rangeMin.getAttribute(selectors$l.rangeMinDefault):"",rangeMaxDefaultValue=rangeMax&&rangeMax.hasAttribute(selectors$l.rangeMaxDefault)?rangeMax.getAttribute(selectors$l.rangeMaxDefault):"";let priceFilterDefaultCounter=0;
8for(let[key,val]of formParams.entries())key.includes("filter.")&&val&&(filterUrl.append(key,val),(val===rangeMinDefaultValue&&key==="filter.v.price.gte"||val===rangeMaxDefaultValue&&key==="filter.v.price.lte")&&(priceFilterDefaultCounter+=1));priceFilterDefaultCounter===2&&(filterUrl.delete("filter.v.price.gte"),filterUrl.delete("filter.v.price.lte"))}if(sortValue||e&&e.detail&&e.detail.href){const sortString=sortValue||e.detail.href;filterUrl.set("sort_by",sortString)}const filterUrlString=filterUrl.toString(),filterNewParams=filterUrlString?`?${filterUrlString}`:location.pathname;window.history.pushState(null,"",filterNewParams)}else window.history.pushState(null,"",replaceHref);else this.sort&&this.sort.dispatchEvent(new CustomEvent("theme:filter:sort",{bubbles:!1}));this.productsContainer&&(this.productsContainer.classList.add(classes$b.loading),fetch(`${window.location.pathname}${window.location.search}`).then(response=>response.text()).then(data2=>{if(this.productsContainer.innerHTML=new DOMParser().parseFromString(data2,"text/html").querySelector(selectors$l.productsContainer).innerHTML,this.sidebar){this.sidebar.innerHTML=new DOMParser().parseFromString(data2,"text/html").querySelector(selectors$l.collectionSidebar).innerHTML;const activeFiltersCountContainer=this.sidebar.querySelector(`[${selectors$l.dataActiveFiltersCount}]`),activeFiltersContainer=this.container.querySelector(selectors$l.dataActiveFilters);if(activeFiltersCountContainer&&activeFiltersContainer){const activeFiltersCount=parseInt(activeFiltersCountContainer.getAttribute(selectors$l.dataActiveFiltersCount));activeFiltersContainer.textContent=activeFiltersCount,activeFiltersContainer.classList.toggle(classes$b.hidden,activeFiltersCount<1)}}this.form&&(this.form=this.container.querySelector(selectors$l.form),this.initRangeSlider()),new Collection(this.section).onUnload(!1);const products=this.productsContainer.querySelectorAll(selectors$l.product);products.length&&products.forEach(item=>{new QuickAddProduct(item)}),makeGridSwatches(this.section),document.dispatchEvent(new CustomEvent("theme:tooltip:close",{bubbles:!1,detail:{hideTransition:!1}})),this.collectionNav&&scrollTo(this.collectionNav.getBoundingClientRect().top),setTimeout(()=>{this.productsContainer.classList.remove(classes$b.loading)},500)}).catch(()=>{console.log("error")}))}updateRange(e){if(this.form&&typeof this.form.submit=="function"){const rangeMin=this.form.querySelector(selectors$l.rangeMin),rangeMax=this.form.querySelector(selectors$l.rangeMax),priceMin=this.form.querySelector(selectors$l.priceMin),priceMax=this.form.querySelector(selectors$l.priceMax);if(rangeMin&&rangeMax&&priceMin&&priceMax&&rangeMin.hasAttribute(selectors$l.rangeMinValue)&&rangeMax.hasAttribute(selectors$l.rangeMaxValue)){const priceMinValue=parseInt(priceMin.placeholder),priceMaxValue=parseInt(priceMax.placeholder),rangeMinValue=parseInt(rangeMin.getAttribute(selectors$l.rangeMinValue)),rangeMaxValue=parseInt(rangeMax.getAttribute(selectors$l.rangeMaxValue));(priceMinValue!==rangeMinValue||priceMaxValue!==rangeMaxValue)&&(priceMin.value=rangeMinValue,priceMax.value=rangeMaxValue,this.submitForm(e))}}}unload(){this.form&&document.removeEventListener("theme:resize",this.resizeEvent)}}const collectionFiltersForm={onLoad(){sections$7[this.id]=new FiltersForm(this)},onUnload:function(){sections$7[this.id]&&typeof sections$7[this.id].unload=="function"&§ions$7[this.id].unload()}},selectors$m={dataSort:"data-sort-enabled",sortLinks:"[data-sort-link]",sortValue:"data-value",sortButton:"[data-popout-toggle]",sortButtonText:"[data-sort-button-text]",collectionSidebarHeading:"[data-collection-sidebar-heading]",collectionSidebar:"[data-collection-sidebar]",collectionSidebarSlider:"[data-collection-sidebar-slider]",collectionSidebarSlideOut:"[data-collection-sidebar-slide-out]",collectionSidebarCloseButton:"[data-collection-sidebar-close]",showMoreOptions:"[data-show-more]",groupTagsButton:"[data-aria-toggle]",collectionNav:"[data-collection-nav]",linkAdd:"[data-link-add]",linkRemove:"[data-link-remove]",linkHidden:"[data-link-hidden]",underlay:"[data-drawer-underlay]",swatch:"data-swatch"},classes$c={expanded:"expanded",expanding:"expanding",noMobileAnimation:"no-mobile-animation",hidden:"is-hidden",active:"is-active",sortActive:"popout-list__item--current",sortPopoutActive:"popout--active",focused:"is-focused"};let sections$8={};class Collection{constructor(section){this.container=section.container,this.sort=this.container.querySelector(`[${selectors$m.dataSort}]`),this.sortLinks=this.container.querySelectorAll(selectors$m.sortLinks),this.collectionSidebar=this.container.querySelector(selectors$m.collectionSidebar),this.collectionSidebarCloseButton=this.container.querySelector(selectors$m.collectionSidebarCloseButton),this.groupTagsButton=this.container.querySelector(selectors$m.groupTagsButton),this.collectionNav=this.container.querySelector(selectors$m.collectionNav),this.showMoreOptions=this.container.querySelectorAll(selectors$m.showMoreOptions),this.collectionSidebarHeading=this.container.querySelectorAll(selectors$m.collectionSidebarHeading),this.underlay=this.container.querySelector(selectors$m.underlay),this.swatches=this.container.querySelectorAll(`[${selectors$m.swatch}]`),this.accessibility=a11y,this.groupTagsButtonClickEvent=evt=>this.groupTagsButtonClick(evt),this.collectionSidebarCloseEvent=evt=>this.collectionSidebarClose(evt),this.collectionSidebarScrollEvent=()=>this.collectionSidebarScroll(),this.onClickEvent=e=>this.onClick(e),this.onSortCheckEvent=e=>this.onSortCheck(e),this.sidebarResizeEvent=()=>this.toggleSidebarSlider(),this.init()}init(){this.sort&&this.initSort(),this.groupTagsButton!==null&&(this.toggleSidebarSlider(),document.addEventListener("theme:resize",this.sidebarResizeEvent),this.groupTagsButton.addEventListener("click",this.groupTagsButtonClickEvent),setTimeout(()=>{this.collectionSidebar.classList.remove(classes$c.noMobileAnimation)},1e3)),this.collectionSidebarCloseButton!==null&&this.collectionSidebarCloseButton.addEventListener("click",this.collectionSidebarCloseEvent),this.container.addEventListener("keyup",function(evt){evt.which===window.theme.keyboardKeys.ESCAPE&&this.hideSidebar()}.bind(this)),this.underlay&&this.underlay.addEventListener("click",this.collectionSidebarCloseEvent),this.showMoreOptions&&this.showMoreOptions.forEach(element=>{element.addEventListener("click",event=>{event.preventDefault(),element.parentElement.classList.add(classes$c.hidden),element.parentElement.previousElementSibling.querySelectorAll(selectors$m.linkHidden).forEac
8h((link,index)=>{link.classList.remove(classes$c.hidden),index===0&&(window.accessibility.lastFocused=link)}),this.container.querySelector(selectors$m.collectionSidebarSlideOut)&&(this.accessibility.removeTrapFocus(),this.accessibility.trapFocus(this.collectionSidebar,{elementToFocus:window.accessibility.lastFocused}))})}),this.collectionSidebarHeading&&this.collectionSidebarHeading.forEach(element=>{element.addEventListener("click",event=>this.collectionAccordion(event)),element.addEventListener("keyup",event=>{(event.which===window.theme.keyboardKeys.SPACE||event.which===window.theme.keyboardKeys.ENTER)&&document.body.classList.contains(classes$c.focused)&&(window.accessibility.lastFocused=event.currentTarget,this.collectionAccordion(event))})}),this.swatches&&this.swatches.forEach(swatch=>{new Swatch(swatch)}),this.showSidebarCallback(!0)}collectionAccordion(event){event.preventDefault();const currentTarget=event.currentTarget,duration=500;currentTarget.classList.toggle(classes$c.active),slideToggle(currentTarget.nextElementSibling,duration),currentTarget.nextElementSibling.nextElementSibling&&slideToggle(currentTarget.nextElementSibling.nextElementSibling,duration),this.container.querySelector(selectors$m.collectionSidebarSlideOut)&&setTimeout(()=>{this.accessibility.removeTrapFocus(),this.accessibility.trapFocus(this.collectionSidebar),this.accessibility.trapFocus(this.collectionSidebar,{elementToFocus:window.accessibility.lastFocused})},duration)}collectionSidebarScroll(){document.dispatchEvent(new CustomEvent("theme:tooltip:close",{bubbles:!1,detail:{hideTransition:!1}}))}sortActions(link,submitForm=!0){const sort=link?link.getAttribute(selectors$m.sortValue):"";this.sort.setAttribute(selectors$m.dataSort,sort);const sortButtonText=this.sort.querySelector(selectors$m.sortButtonText),sortActive=this.sort.querySelector(`.${classes$c.sortActive}`);if(sortButtonText){const linkText=link?link.textContent.trim():"";sortButtonText.textContent=linkText}sortActive&&sortActive.classList.remove(classes$c.sortActive),this.sort.classList.toggle(classes$c.sortPopoutActive,link),link&&(link.parentElement.classList.add(classes$c.sortActive),submitForm&&link.dispatchEvent(new CustomEvent("theme:filter:update",{bubbles:!0,detail:{href:sort}})))}onClick(e){e.preventDefault();const sortButton=this.sort.querySelector(selectors$m.sortButton);sortButton&&sortButton.dispatchEvent(new Event("click")),this.sortActions(e.currentTarget)}onSortCheck(e){let link=null;if(window.location.search.includes("sort_by")){const urlParams=new window.URL(window.location.href).searchParams;for(const[key,val]of urlParams.entries()){const linkSort=this.sort.querySelector(`[${selectors$m.sortValue}="${val}"]`);if(key.includes("sort_by")&&linkSort){link=linkSort;break}}}this.sortActions(link,!1)}initSort(){this.sortLinks.forEach(link=>{link.addEventListener("click",this.onClickEvent)}),this.sort.addEventListener("theme:filter:sort",this.onSortCheckEvent)}showSidebarCallback(onLoad=!1){const windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,collectionSidebarSlider=this.container.querySelector(selectors$m.collectionSidebarSlider),collectionSidebarSlideOut=this.container.querySelector(selectors$m.collectionSidebarSlideOut),collectionSidebarScrollable=collectionSidebarSlider||collectionSidebarSlideOut;if(!onLoad){if(collectionSidebarSlideOut===null)if(windowWidth<theme.sizes.small){const scrollTopPosition=this.collectionNav?this.collectionNav.getBoundingClientRect().top:this.groupTagsButton.getBoundingClientRect().top;scrollTo(scrollTopPosition)}else this.accessibility.removeTrapFocus(),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}));(windowWidth<theme.sizes.small||collectionSidebarSlideOut!==null)&&(collectionSidebarSlideOut&&this.accessibility.trapFocus(this.collectionSidebar,{elementToFocus:this.collectionSidebar.querySelector(selectors$m.collectionSidebarCloseButton)}),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:collectionSidebarScrollable})))}collectionSidebarScrollable&&collectionSidebarScrollable.addEventListener("scroll",this.collectionSidebarScrollEvent)}hideSidebar(){const collectionSidebarSlider=this.container.querySelector(selectors$m.collectionSidebarSlider),collectionSidebarSlideOut=this.container.querySelector(selectors$m.collectionSidebarSlideOut),collectionSidebarScrollable=collectionSidebarSlider||collectionSidebarSlideOut;
8this.groupTagsButton.setAttribute("aria-expanded","false"),this.collectionSidebar.classList.add(classes$c.expanding),this.collectionSidebar.classList.remove(classes$c.expanded),collectionSidebarScrollable&&collectionSidebarScrollable.removeEventListener("scroll",this.collectionSidebarScrollEvent),collectionSidebarSlideOut&&this.accessibility.removeTrapFocus(),setTimeout(()=>{this.collectionSidebar.classList.remove(classes$c.expanding)},500),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}toggleSidebarSlider(){(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small?this.hideSidebar():this.collectionSidebar.classList.contains(classes$c.expanded)&&this.showSidebarCallback()}collectionSidebarClose(evt){evt.preventDefault(),this.hideSidebar(),document.body.classList.contains(classes$c.focused)&&this.groupTagsButton&&this.groupTagsButton.focus()}groupTagsButtonClick(){this.collectionSidebar.classList.contains(classes$c.expanded)?this.showSidebarCallback():document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}onUnload(flag=!0){this.groupTagsButton!==null&&(document.removeEventListener("theme:resize",this.sidebarResizeEvent),this.groupTagsButton.removeEventListener("click",this.groupTagsButtonClickEvent)),this.collectionSidebarCloseButton!==null&&flag&&this.collectionSidebarCloseButton.removeEventListener("click",this.collectionSidebarCloseEvent),this.collectionSidebarScrollable&flag&&this.collectionSidebarScrollable.removeEventListener("scroll",this.collectionSidebarScrollEvent),this.underlay&&this.underlay.removeEventListener("click",this.collectionSidebarCloseEvent),this.sort&&(this.sortLinks.forEach(link=>{link.removeEventListener("click",this.onClickEvent)}),this.sort.removeEventListener("theme:filter:sort",this.onSortCheckEvent))}}const collectionSection={onLoad(){sections$8[this.id]=new Collection(this)},onUnload(){sections$8[this.id].onUnload()}};register("collection",[slider,parallaxHero,quickAddProduct,collectionSection,popoutSection,swatchGridSection,collectionFiltersForm,tooltipSection]);const selectors$n={frame:"[data-ticker-frame]",scale:"[data-ticker-scale]",text:"[data-ticker-text]",clone:"data-clone"},attributes$4={speed:"data-marquee-speed"},classes$d={animation:"ticker--animated",unloaded:"ticker--unloaded",comparitor:"ticker__comparitor"},settings$2={textAnimationTime:1.63,space:100};class Ticker{constructor(el,stopClone=!1){this.frame=el,this.stopClone=stopClone,this.scale=this.frame.querySelector(selectors$n.scale),this.text=this.frame.querySelector(selectors$n.text),this.comparitor=this.text.cloneNode(!0),this.comparitor.classList.add(classes$d.comparitor),this.frame.appendChild(this.comparitor),this.scale.classList.remove(classes$d.unloaded),this.resizeEvent=debounce(()=>this.checkWidth(),100),this.listen()}unload(){document.removeEventListener("theme:resize",this.resizeEvent)}listen(){document.addEventListener("theme:resize",this.resizeEvent),this.checkWidth()}checkWidth(){const padding=window.getComputedStyle(this.frame).paddingLeft.replace("px","")*2,speed=this.frame.getAttribute(attributes$4.speed)?this.frame.getAttribute(attributes$4.speed):settings$2.textAnimationTime;if(this.frame.clientWidth-padding<this.comparitor.clientWidth||this.stopClone){if(this.text.classList.add(classes$d.animation),this.scale.childElementCount===1){if(this.clone=this.text.cloneNode(!0),this.clone.setAttribute(selectors$n.clone,""),this.scale.appendChild(this.clone),this.stopClone)for(let index=0;index<10;index++){const cloneSecond=this.text.cloneNode(!0);cloneSecond.setAttribute(selectors$n.clone,""),this.scale.appendChild(cloneSecond)}const animationTimeFrame=(this.text.clientWidth/settings$2.space*Number(speed)).toFixed(2);this.scale.style.setProperty("--animation-time",`${animationTimeFrame}s`)}}else{this.text.classList.add(classes$d.animation);let clone=this.scale.querySelector(`[${selectors$n.clone}]`);clone&&this.scale.removeChild(clone),this.text.classList.remove(classes$d.animation)}}}
8const selectors$o={bar:"[data-bar]",barSlide:"[data-slide]",frame:"[data-ticker-frame]",header:"[data-header-wrapper]",slider:"[data-slider]",slideValue:"data-slide",tickerScale:"[data-ticker-scale]",tickerText:"[data-ticker-text]",dataTargetReferrer:"data-target-referrer"},sections$9={};class Bar{constructor(holder){this.barHolder=holder,this.locationPath=location.href,this.slides=this.barHolder.querySelectorAll(selectors$o.barSlide),this.slider=this.barHolder.querySelector(selectors$o.slider),this.init()}init(){this.removeAnnouncement(),this.slider&&this.initSliders(),this.slider||this.initTickers(!0)}removeAnnouncement(){for(let index=0;index<this.slides.length;index++){const element=this.slides[index];element.hasAttribute(selectors$o.dataTargetReferrer)&&this.locationPath.indexOf(element.getAttribute(selectors$o.dataTargetReferrer))===-1&&!window.Shopify.designMode&&element.parentNode.removeChild(element)}}initSliders(){this.slider=new Slider(this.barHolder),this.slider.flkty.reposition(),this.barHolder.addEventListener("theme:slider:loaded",()=>{this.initTickers()})}initTickers(stopClone=!1){this.barHolder.querySelectorAll(selectors$o.frame).forEach(element=>{new Ticker(element,stopClone)})}toggleTicker(e,isStoped){const tickerScale=document.querySelector(selectors$o.tickerScale),element=document.querySelector(`[${selectors$o.slideValue}="${e.detail.blockId}"]`);isStoped&&element&&(tickerScale.setAttribute("data-stop",""),tickerScale.querySelectorAll(selectors$o.tickerText).forEach(textHolder=>{textHolder.classList.remove("ticker--animated"),textHolder.style.transform=`translate3d(${-(element.offsetLeft-element.clientWidth)}px, 0, 0)`})),!isStoped&&element&&(tickerScale.querySelectorAll(selectors$o.tickerText).forEach(textHolder=>{textHolder.classList.add("ticker--animated"),textHolder.removeAttribute("style")}),tickerScale.removeAttribute("data-stop"))}onBlockSelect(e){this.slider?this.slider.onBlockSelect(e):this.toggleTicker(e,!0)}onBlockDeselect(e){this.slider?this.slider.onBlockDeselect(e):this.toggleTicker(e,!1)}}const bar={onLoad(){sections$9[this.id]=[];const element=this.container.querySelector(selectors$o.bar);element&§ions$9[this.id].push(new Bar(element))},onBlockSelect(e){sections$9[this.id].length&§ions$9[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})},onBlockDeselect(e){sections$9[this.id].length&§ions$9[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockDeselect(e)})}};register("announcement",[bar]);const selectors$p={body:"body",drawerWrappper:"[data-drawer]",drawerInner:"[data-drawer-inner]",underlay:"[data-drawer-underlay]",stagger:"[data-stagger-animation]",wrapper:"[data-header-transparent]",transparent:"data-header-transparent",drawerToggle:"data-drawer-toggle",focusable:'button, [href], select, textarea, [tabindex]:not([tabindex="-1"])'},classes$e={isVisible:"drawer--visible",isFocused:"is-focused",headerStuck:"js__header__stuck"};let sections$a={};class Drawer{constructor(el){this.drawer=el,this.drawerWrapper=this.drawer.closest(selectors$p.drawerWrappper),this.drawerInner=this.drawer.querySelector(selectors$p.drawerInner),this.underlay=this.drawer.querySelector(selectors$p.underlay),this.wrapper=this.drawer.closest(selectors$p.wrapper),this.key=this.drawer.dataset.drawer;const btnSelector=`[${selectors$p.drawerToggle}='${this.key}']`;this.buttons=document.querySelectorAll(btnSelector),this.staggers=this.drawer.querySelectorAll(selectors$p.stagger),this.body=document.querySelector(selectors$p.body),this.initWatchFocus=evt=>this.watchFocus(evt),this.connectToggle(),this.connectDrawer(),this.closers(),this.staggerChildAnimations()}connectToggle(){this.buttons.forEach(btn=>{btn.addEventListener("click",()=>{this.drawer.dispatchEvent(new CustomEvent("theme:drawer:toggle",{bubbles:!1}))})})}connectDrawer(){this.drawer.addEventListener("theme:drawer:toggle",()=>{this.drawer.classList.contains(classes$e.isVisible)?this.drawer.dispatchEvent(new CustomEvent("theme:drawer:close",{bubbles:!0})):this.drawer.dispatchEvent(new CustomEvent("theme:drawer:open",{bubbles:!0}))}),document.addEventListener("theme:drawer:close",this.hideDrawer.bind(this)),document.addEventListener("theme:drawer:open",this.showDrawer.bind(this))}
8staggerChildAnimations(){this.staggers.forEach(el=>{el.querySelectorAll(":scope > * > [data-animates]").forEach((child,index)=>{child.style.transitionDelay=`${index*50+10}ms`})})}watchFocus(evt){!this.wrapper.contains(evt.target)&&this.body.classList.contains(classes$e.isFocused)&&this.hideDrawer()}closers(){this.wrapper.addEventListener("keyup",function(evt){evt.which===window.theme.keyboardKeys.ESCAPE&&(this.hideDrawer(),this.buttons[0].focus())}.bind(this)),this.underlay.addEventListener("click",()=>{this.hideDrawer()})}showDrawer(){document.dispatchEvent(new CustomEvent("theme:drawer:close",{bubbles:!1})),this.buttons.forEach(el=>{el.setAttribute("aria-expanded",!0),el.classList.add(classes$e.isVisible)}),this.drawer.classList.add(classes$e.isVisible),this.drawer.querySelector(selectors$p.focusable).focus(),this.wrapper.setAttribute(selectors$p.transparent,!1),document.addEventListener("focusin",this.initWatchFocus),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.drawerInner}))}hideDrawer(){this.buttons.forEach(el=>{el.setAttribute("aria-expanded",!0),el.classList.remove(classes$e.isVisible)}),this.drawer.classList.remove(classes$e.isVisible),document.removeEventListener("focusin",this.initWatchFocus),this.wrapper.classList.contains(classes$e.headerStuck)||this.wrapper.setAttribute(selectors$p.transparent,theme.settings.transparentHeader),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})),document.dispatchEvent(new CustomEvent("theme:sliderule:close",{bubbles:!1}))}}const drawer={onLoad(){sections$a[this.id]=[],this.container.querySelectorAll(selectors$p.drawerWrappper).forEach(el=>{sections$a[this.id].push(new Drawer(el))})}},selectors$q={announcement:"[data-announcement-wrapper]",headerWrapper:"[data-header-wrapper]",header:"[data-header-wrapper] header"},classes$f={stuck:"js__header__stuck",stuckAnimated:"js__header__stuck--animated",triggerAnimation:"js__header__stuck--trigger-animation",stuckBackdrop:"js__header__stuck__backdrop",headerIsNotVisible:"is-not-visible",hasStickyHeader:"has-sticky-header"},attributes$5={transparent:"data-header-transparent",stickyHeader:"data-header-sticky",scrollLock:"data-scroll-locked"};let sections$b={};class Sticky{constructor(el){this.wrapper=el,this.type=this.wrapper.dataset.headerSticky,this.sticks=!1,this.static=!0,this.wrapper.hasAttribute(attributes$5.stickyHeader)&&(this.sticks=!0,this.static=!1),this.win=window,this.animated=this.type==="directional",this.currentlyStuck=!1,this.cls=this.wrapper.classList;const announcementEl=document.querySelector(selectors$q.announcement),announcementHeight=announcementEl?announcementEl.clientHeight:0;this.headerHeight=document.querySelector(selectors$q.header).clientHeight,this.blur=this.headerHeight+announcementHeight,this.stickDown=this.headerHeight+announcementHeight,this.stickUp=announcementHeight,this.scrollEventStatic=()=>this.checkIsVisible(),this.scrollEventListen=e=>this.listenScroll(e),this.scrollEventUpListen=()=>this.scrollUpDirectional(),this.scrollEventDownListen=()=>this.scrollDownDirectional(),this.wrapper.getAttribute(attributes$5.transparent)!=="false"&&(this.blur=announcementHeight),this.sticks&&(this.stickDown=announcementHeight,this.scrollDownInit(),document.body.classList.add(classes$f.hasStickyHeader)),this.static&&document.addEventListener("theme:scroll",this.scrollEventStatic),this.listen()}unload(){(this.sticks||this.animated)&&document.removeEventListener("theme:scroll",this.scrollEventListen),this.animated&&(document.removeEventListener("theme:scroll:up",this.scrollEventUpListen),document.removeEventListener("theme:scroll:down",this.scrollEventDownListen)),this.static&&document.removeEventListener("theme:scroll",this.scrollEventStatic)}listen(){(this.sticks||this.animated)&&document.addEventListener("theme:scroll",this.scrollEventListen),this.animated&&(document.addEventListener("theme:scroll:up",this.scrollEventUpListen),document.addEventListener("theme:scroll:down",this.scrollEventDownListen))}listenScroll(e){e.detail.down?(!this.currentlyStuck&&e.detail.position>this.stickDown&&this.stickSimple(),!this.currentlyBlurred&&e.detail.position>this.blur&&this.addBlur()):(e.detail.position<=this.stickUp&&this.unstickSimple(),e.detail.position<=this.blur&&this.removeBlur())}stickSimple(){this.animated&&this.cls.add(classes$f.stuckAnimated),this.cls.add(classes$f.stuck),this.wrapper.setAttribute(attributes$5.transparent,!1),this.currentlyStuck=!0}unstickSimple(){document.documentElement.hasAttribute(attributes$5.scrollLock)||(this.cls.remove(classes$f.stuck),this.wrapper.setAttribute(attributes$5.transparent,theme.settings.transparentHeader),this.animated&&this.cls.remove(classes$f.stuckAnimated),this.currentlyStuck=!1)}scrollDownInit(){window.scrollY>this.stickDown&&this.stickSimple(),window.scrollY>this.blur&&this.addBlur()}stickDirectional(){this.cls.add(classes$f.triggerAnimation)}unstickDirectional(){this.cls.remove(classes$f.triggerAnimation)}scrollDownDirectional(){this.unstickDirectional()}scrollUpDirectional(){window.scrollY<=this.stickDown?this.unstickDirectional():this.stickDirectional()}addBlur(){this.cls.add(classes$f.stuckBackdrop),this.currentlyBlurred=!0}
8removeBlur(){this.cls.remove(classes$f.stuckBackdrop),this.currentlyBlurred=!1}checkIsVisible(){const header2=document.querySelector(selectors$q.headerWrapper),isHeaderSticky=header2.getAttribute(attributes$5.stickyHeader),currentScroll=this.win.pageYOffset;isHeaderSticky||header2.classList.toggle(classes$f.headerIsNotVisible,currentScroll>=this.headerHeight)}}const stickyHeader={onLoad(){sections$b=new Sticky(this.container)},onUnload:function(){typeof sections$b.unload=="function"&§ions$b.unload()}},selectors$r={disclosureToggle:"data-hover-disclosure-toggle",disclosureWrappper:"[data-hover-disclosure]",link:"[data-top-link]",wrapper:"[data-header-wrapper]",stagger:"[data-stagger]",staggerPair:"[data-stagger-first]",staggerAfter:"[data-stagger-second]",focusable:'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'},classes$g={isVisible:"is-visible",meganavVisible:"meganav--visible",meganavIsTransitioning:"meganav--is-transitioning"};let sections$c={},disclosures={};class HoverDisclosure{constructor(el){this.disclosure=el,this.wrapper=el.closest(selectors$r.wrapper),this.key=this.disclosure.id,this.trigger=document.querySelector(`[${selectors$r.disclosureToggle}='${this.key}']`),this.link=this.trigger.querySelector(selectors$r.link),this.grandparent=this.trigger.classList.contains("grandparent"),this.transitionTimeout=0,this.trigger.setAttribute("aria-haspopup",!0),this.trigger.setAttribute("aria-expanded",!1),this.trigger.setAttribute("aria-controls",this.key),this.connectHoverToggle(),this.handleTablets(),this.staggerChildAnimations()}onBlockSelect(evt){this.disclosure.contains(evt.target)&&this.showDisclosure(evt)}onBlockDeselect(evt){this.disclosure.contains(evt.target)&&this.hideDisclosure()}showDisclosure(e){e&&e.type&&e.type==="mouseenter"&&this.wrapper.classList.add(classes$g.meganavIsTransitioning),this.grandparent?this.wrapper.classList.add(classes$g.meganavVisible):this.wrapper.classList.remove(classes$g.meganavVisible),this.trigger.setAttribute("aria-expanded",!0),this.trigger.classList.add(classes$g.isVisible),this.disclosure.classList.add(classes$g.isVisible),this.transitionTimeout&&clearTimeout(this.transitionTimeout),this.transitionTimeout=setTimeout(()=>{this.wrapper.classList.remove(classes$g.meganavIsTransitioning)},200)}hideDisclosure(){this.disclosure.classList.remove(classes$g.isVisible),this.trigger.classList.remove(classes$g.isVisible),this.trigger.setAttribute("aria-expanded",!1),this.wrapper.classList.remove(classes$g.meganavVisible,classes$g.meganavIsTransitioning)}staggerChildAnimations(){this.disclosure.querySelectorAll(selectors$r.stagger).forEach((el,index)=>{el.style.transitionDelay=`${index*50+10}ms`}),this.disclosure.querySelectorAll(selectors$r.staggerPair).forEach((child,i)=>{const d1=i*150;child.style.transitionDelay=`${d1}ms`,child.parentElement.querySelectorAll(selectors$r.staggerAfter).forEach((grandchild,i2)=>{const d2=(i2+1)*20;grandchild.style.transitionDelay=`${d1+d2}ms`})})}handleTablets(){this.trigger.addEventListener("touchstart",function(e){this.disclosure.classList.contains(classes$g.isVisible)||(e.preventDefault(),this.showDisclosure(e))}.bind(this),{passive:!0})}connectHoverToggle(){this.trigger.addEventListener("mouseenter",e=>this.showDisclosure(e)),this.link.addEventListener("focus",e=>this.showDisclosure(e)),this.trigger.addEventListener("mouseleave",()=>this.hideDisclosure()),this.trigger.addEventListener("focusout",e=>{this.trigger.contains(e.relatedTarget)||this.hideDisclosure()}),this.disclosure.addEventListener("keyup",evt=>{evt.which===window.theme.keyboardKeys.ESCAPE&&this.hideDisclosure()})}}const hoverDisclosure={onLoad(){sections$c[this.id]=[],disclosures=this.container.querySelectorAll(selectors$r.disclosureWrappper),disclosures.forEach(el=>{sections$c[this.id].push(new HoverDisclosure(el))})},onBlockSelect(evt){sections$c[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(evt)})},onBlockDeselect(evt){sections$c[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(evt)})}},selectors$s={count:"data-cart-count"};class Totals{constructor(el){this.section=el,this.counts=this.section.querySelectorAll(`[${selectors$s.count}]`),this.cart=null,this.listen()}listen(){document.addEventListener("theme:cart:change",function(event){this.cart=event.detail.cart,this.update()}.bind(this))}
8update(){this.cart&&this.counts.forEach(count=>{count.setAttribute(selectors$s.count,this.cart.item_count),count.innerHTML=`${this.cart.item_count}`})}}const headerTotals={onLoad(){new Totals(this.container)}},selectors$t={append:"[data-predictive-search-append]",input:"data-predictive-search-input",productTemplate:"[product-grid-item-template]",productWrapper:"[data-product-wrap]",productWrapperOuter:"[data-product-wrap-outer]",titleTemplate:"[data-predictive-search-title-template]",titleWrapper:"[data-search-title-wrap]",searchPopdown:"search-popdown",productResultsOuter:"[data-product-results-outer]"},classes$h={isSearched:"is-searched",loadingClass:"is-loading"};class SearchPredictive{constructor(input){this.input=input,this.key=this.input.getAttribute(selectors$t.input);const appendSelector=`[id='${this.key}']`;this.append=document.querySelector(appendSelector),this.productTemplate=document.querySelector(selectors$t.productTemplate).innerHTML,this.titleTemplate=document.querySelector(selectors$t.titleTemplate).innerHTML,this.titleWrapper=document.querySelector(selectors$t.titleWrapper),this.productWrapper=this.append.querySelector(selectors$t.productWrapper),this.productWrapperOuter=this.append.querySelector(selectors$t.productWrapperOuter),this.popdown=document.getElementById(selectors$t.searchPopdown),this.result=null,this.accessibility=a11y,this.initSearch()}initSearch(){this.input.addEventListener("input",debounce(function(event){const val=event.target.value;val&&val.length>1?(this.productWrapperOuter.classList.add(classes$h.loadingClass),this.popdown.classList.add(classes$h.isSearched),this.render(val)):(this.reset(),this.popdown.classList.remove(classes$h.isSearched))}.bind(this),300)),this.input.addEventListener("clear",this.reset.bind(this))}render(terms){fetch(`${window.theme.routes.root}search/suggest.json?q=${encodeURIComponent(terms)}&resources[type]=product&resources[limit]=8&resources[options][unavailable_products]=last`).then(this.handleErrors).then(response=>response.json()).then(response=>(this.result=response.resources.results,this.result.products.length||this.popdown.classList.remove(classes$h.isSearched),this.fetchProducts(response.resources.results.products))).then(response=>{this.reset(!1),this.productWrapperOuter.classList.remove(classes$h.loadingClass),this.injectTitle(terms),this.injectProduct(response)}).catch(e=>{console.error(e)})}reset(clearTerms=!0){this.productWrapper.innerHTML="",this.input.val="",this.accessibility.removeTrapFocus(),clearTerms&&(this.titleWrapper.innerHTML="")}injectTitle(terms){let title=window.theme.strings.noResultsFor,count="";this.result&&this.result.products.length>0&&(count=this.result.products.length,title=window.theme.strings.resultsFor),this.titleWrapper.innerHTML=Sqrl.render(this.titleTemplate,{count,title,query:terms})}injectProduct(productHTML){this.productWrapper.innerHTML+=productHTML}fetchProducts(products){const promises=[];return products.forEach(product=>{promises.push(fetchProduct(product.handle).then(productJSON=>{const formatted=formatPrices(productJSON);return this.renderProduct(formatted)}))}),Promise.all(promises).then(result=>{let str="";return result.forEach(render=>{str+=render}),str})}renderProduct(product){let media=null,mediaHover=null,image="",secondImage="";product.media!==void 0&&(media=product.media[0],mediaHover=product.media[1]),media?image={thumb:themeImages.getSizedImageUrl(media.preview_image.src,"800x800"),alt:media.preview_image.src}:image={thumb:window.theme.assets.no_image,alt:""},mediaHover&&(secondImage={thumb:themeImages.getSizedImageUrl(mediaHover.preview_image.src,"800x800"),alt:mediaHover.preview_image.src});const stripHtmlRegex=/(<([^>]+)>)/gi,title=product.title.replace(stripHtmlRegex,""),updateValues={...product,title,image,secondImage};return Sqrl.render(this.productTemplate,{product:updateValues})}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}}const selectors$u={body:"body",popdownTrigger:"data-popdown-toggle",close:"[data-close-popdown]",input:"[data-predictive-search-input]",productResultsOuter:"[data-product-results-outer]"},classes$i={isVisible:"is-visible",productGridOuter:"product-grid-outer",focu
8sed:"is-focused"};let sections$d={};class SearchPopdownTriggers{constructor(trigger){this.trigger=trigger,this.key=this.trigger.getAttribute(selectors$u.popdownTrigger),this.search=null;const popdownSelector=`[id='${this.key}']`;this.document=document,this.popdown=document.querySelector(popdownSelector),this.input=this.popdown.querySelector(selectors$u.input),this.close=this.popdown.querySelector(selectors$u.close),this.body=document.querySelector(selectors$u.body),this.accessibility=a11y,this.initTriggerEvents(),this.initPopdownEvents()}initTriggerEvents(){this.trigger.setAttribute("aria-haspopup",!0),this.trigger.setAttribute("aria-expanded",!1),this.trigger.setAttribute("aria-controls",this.key),this.trigger.addEventListener("click",evt=>{evt.preventDefault(),this.body.classList.contains(classes$i.focused)||this.showPopdown()}),this.trigger.addEventListener("keyup",evt=>{(evt.which===window.theme.keyboardKeys.SPACE||evt.which===window.theme.keyboardKeys.ENTER)&&this.body.classList.contains(classes$i.focused)&&this.showPopdown()})}initPopdownEvents(){this.search=new SearchPredictive(this.input),this.popdown.addEventListener("keyup",function(evt){evt.which===window.theme.keyboardKeys.ESCAPE&&this.hidePopdown()}.bind(this)),this.close.addEventListener("click",function(){this.hidePopdown()}.bind(this)),this.document.addEventListener("click",event=>{const clickedElement=event.target,isNotSearchExpandButton=!(clickedElement.matches(`[${selectors$u.popdownTrigger}]`)||clickedElement.closest(`[${selectors$u.popdownTrigger}]`)),isNotSearchPopdownChild=!(clickedElement.matches(`#${this.key}`)||clickedElement.closest(`#${this.key}`));isNotSearchExpandButton&&isNotSearchPopdownChild&&this.popdown.classList.contains(classes$i.isVisible)&&this.hidePopdown()})}hidePopdown(){this.popdown.classList.remove(classes$i.isVisible),this.input.form.reset(),this.input.dispatchEvent(new CustomEvent("clear",{bubbles:!1})),this.accessibility.removeTrapFocus(),this.popdown.querySelector(selectors$u.productResultsOuter).classList.remove(classes$i.productGridOuter),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})),this.body.classList.contains(classes$i.focused)&&setTimeout(()=>{this.trigger.focus()},200)}showPopdown(){document.dispatchEvent(new CustomEvent("theme:drawer:close",{bubbles:!1})),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.popdown})),this.popdown.classList.add(classes$i.isVisible);const val=this.input.value;this.input.value="",this.input.value=val,this.accessibility.trapFocus(this.popdown),this.input.focus()}}const searchPopdown={onLoad(){sections$d[this.id]=[],this.container.querySelectorAll(`[${selectors$u.popdownTrigger}]`).forEach(el=>{sections$d[this.id].push(new SearchPopdownTriggers(el))})}},selectors$v={slideruleOpen:"data-sliderule-open",slideruleClose:"data-sliderule-close",sliderulePane:"data-sliderule-pane",slideruleWrappper:"[data-sliderule]",focusable:'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',dataAnimates:"data-animates",children:`:scope > [data-animates], 9 :scope > * > [data-animates], 10 :scope > * > * >[data-animates], 11 :scope > * > .sliderule-grid > *`},classes$j={isVisible:"is-visible",isHiding:"is-hiding",isHidden:"is-hidden"};let sections$e={};class HeaderMobileSliderule{constructor(el){this.sliderule=el,this.wrapper=el.closest(selectors$v.wrapper),this.key=this.sliderule.id;const btnSelector=`[${selectors$v.slideruleOpen}='${this.key}']`,exitSelector=`[${selectors$v.slideruleClose}='${this.key}']`;this.trigger=document.querySelector(btnSelector),this.exit=document.querySelectorAll(exitSelector),this.pane=document.querySelector(`[${selectors$v.sliderulePane}]`),this.children=this.sliderule.querySelectorAll(selectors$v.children),this.trigger.setAttribute("aria-haspopup",!0),this.trigger.setAttribute("aria-expanded",!1),this.trigger.setAttribute("aria-controls",this.key),this.clickEvents(),this.staggerChildAnimations(),document.addEventListener("theme:sliderule:close",this.closeSliderule.bind(this))}clickEvents(){this.trigger.addEventListener("click",function(){this.showSliderule()}.bind(this)),this.exit.forEach(element=>{element.addEventListener("click",function(){this.hideSliderule()}.bind(this))})}keyboardEvents(){this.trigger.addEventListener("keyup",function(evt){evt.which===window.theme.keyboardKeys.SPACE&&this.showSliderule()}.bind(this)),this.sliderule.addEventListener("keyup",function(evt){evt.which===window.theme.keyboardKeys.ESCAPE&&(this.hideSliderule(),this.buttons[0].focus())}.bind(this))}staggerChildAnimations(reverse=!1){(reverse?Array.prototype.slice.call(this.children).slice().reverse():this.children).forEac
11h((child,index)=>{child.style.transitionDelay=`${index*50+10}ms`})}hideSliderule(close=!1){const paneStyle=window.getComputedStyle(this.pane),paneTransitionDuration=parseFloat(paneStyle.getPropertyValue("transition-duration"))*1e3,children=close?this.pane.querySelectorAll(`.${classes$j.isVisible}`):this.children;this.pane.style.setProperty("--sliderule-height","auto"),this.staggerChildAnimations(!0),this.pane.classList.add(classes$j.isHiding),this.sliderule.classList.add(classes$j.isHiding),this.sliderule.classList.remove(classes$j.isVisible),children.forEach(el=>{el.classList.remove(classes$j.isVisible)});const newPosition=parseInt(this.pane.dataset.sliderulePane,10)-1;this.pane.setAttribute(selectors$v.sliderulePane,newPosition);const hidedSelector=close?`[${selectors$v.dataAnimates}].${classes$j.isHidden}`:`[${selectors$v.dataAnimates}="${newPosition}"].${classes$j.isHidden}`,hidedItems=this.pane.querySelectorAll(hidedSelector);hidedItems.length&&hidedItems.forEach(element=>{element.classList.remove(classes$j.isHidden)}),setTimeout(()=>{this.pane.classList.remove(classes$j.isHiding),this.sliderule.classList.remove(classes$j.isHiding),this.staggerChildAnimations()},paneTransitionDuration)}showSliderule(){this.pane.style.setProperty("--sliderule-height","auto"),this.sliderule.classList.add(classes$j.isVisible),this.children.forEach(el=>{el.classList.add(classes$j.isVisible)});const oldPosition=parseInt(this.pane.dataset.sliderulePane,10),newPosition=oldPosition+1;this.pane.setAttribute(selectors$v.sliderulePane,newPosition);const hidedItems=this.pane.querySelectorAll(`[${selectors$v.dataAnimates}="${oldPosition}"]`);if(hidedItems.length){const hidedItemsTransition=parseFloat(window.getComputedStyle(hidedItems[0]).getPropertyValue("transition-duration"))*1e3;setTimeout(()=>{hidedItems.forEach(element=>{element.classList.add(classes$j.isHidden)})},hidedItemsTransition)}const newHeight=parseInt(this.trigger.nextElementSibling.offsetHeight);this.pane.style.setProperty("--sliderule-height",`${newHeight}px`)}closeSliderule(){this.pane&&this.pane.hasAttribute(selectors$v.sliderulePane)&&parseInt(this.pane.getAttribute(selectors$v.sliderulePane))>0&&(this.hideSliderule(!0),parseInt(this.pane.getAttribute(selectors$v.sliderulePane))>0&&this.pane.setAttribute(selectors$v.sliderulePane,0))}}const headerMobileSliderule={onLoad(){sections$e[this.id]=[],this.container.querySelectorAll(selectors$v.slideruleWrappper).forEach(el=>{sections$e[this.id].push(new HeaderMobileSliderule(el))})}},selectors$w={wrapper:"[data-header-wrapper]",html:"html",style:"data-header-style",widthContentWrapper:"[data-takes-space-wrapper]",widthContent:"[data-child-takes-space]",desktop:"[data-header-desktop]",cloneClass:"js__header__clone",showMobileClass:"js__show__mobile",backfill:"[data-header-backfill]",transparent:"data-header-transparent",overrideBorder:"header-override-border",firstSectionHasImage:".main-content > .shopify-section:first-child [data-overlay-header]",preventTransparentHeader:".main-content > .shopify-section:first-child [data-prevent-transparent-header]",deadLink:'.navlink[href="#"]'};let sections$f={};class Header{constructor(el){this.wrapper=el,this.html=document.querySelector(selectors$w.html),this.style=this.wrapper.dataset.style,this.desktop=this.wrapper.querySelector(selectors$w.desktop),this.isTransparentHeader=this.wrapper.getAttribute(selectors$w.transparent)!=="false",this.overlayedImages=document.querySelectorAll(selectors$w.firstSectionHasImage),this.deadLinks=document.querySelectorAll(selectors$w.deadLink),this.headerUpdateEvent=debounce(()=>this.checkForImage(),500),this.resizeEventWidth=()=>this.checkWidth(),this.resizeEventOverlay=()=>this.subtractAnnouncementHeight(),this.killDeadLinks(),this.style!=="drawer"&&this.desktop&&(this.minWidth=this.getMinWidth(),this.listenWidth()),this.checkForImage(),this.listenSectionEvents()}checkForImage(){this.overlayedImages=document.querySelectorAll(selectors$w.firstSectionHasImage);let preventTransparentHeader=document.querySelectorAll(selectors$w.preventTransparentHeader).length;this.overlayedImages.length&&!preventTransparentHeader&&this.isTransparentHeader?(this.listenOverlay(),this.wrapper.setAttribute(selectors$w.transparent,!0),document.querySelector(selectors$w.backfill).style.display="none",theme.settings.transparentHeader=!0):(this.wrapper.setAttribute(selectors$w.transparent,!1),document.querySelector(selectors$w.backfill).style.display="block",theme.settings.transparentHeader=!1),this.overlayedImages.length&&!preventTransparentHeader&&!this.isTransparentHeader&&this.wrapper.classList.add(selectors$w.overrideBorder),this.subtractAnnouncementHeight()}listenOverlay(){document.addEventListener("theme:resize",this.resizeEventOverlay),this.subtractAnnouncementHeight()}listenWidth(){document.addEventListener("theme:resize",this.resizeEventWidth),this.checkWidth()}listenSectionEvents(){document.addEventListener("shopify:section:load",this.headerUpdateEvent),document.addEventListener("shopify:section:unload",this.headerUpdateEvent),document.addEventListener("shopify:section:reorder",this.headerUpdateEvent)}killDeadLinks(){this.deadLinks.forEach(el=>{el.onclick=e=>{e.preventDefault()}})}subtractAnnouncementHeight(){const{windowHeight,announcementHeight,headerHeight}=readHeights();
11this.overlayedImages.forEach(el=>{theme.settings.transparentHeader?el.style.setProperty("--full-screen",`${windowHeight-announcementHeight}px`):el.style.setProperty("--full-screen",`${windowHeight-headerHeight}px`),el.classList.add("has-overlay")})}checkWidth(){document.body.clientWidth<this.minWidth?this.wrapper.classList.add(selectors$w.showMobileClass):this.wrapper.classList.remove(selectors$w.showMobileClass)}getMinWidth(){const comparitor=this.wrapper.cloneNode(!0);comparitor.classList.add(selectors$w.cloneClass),document.body.appendChild(comparitor);const widthWrappers=comparitor.querySelectorAll(selectors$w.widthContentWrapper);let minWidth=0,spaced=0;return widthWrappers.forEach(context=>{const wideElements=context.querySelectorAll(selectors$w.widthContent);let thisWidth=0;wideElements.length===3?thisWidth=_sumSplitWidths(wideElements):thisWidth=_sumWidths(wideElements),thisWidth>minWidth&&(minWidth=thisWidth,spaced=wideElements.length*20)}),document.body.removeChild(comparitor),minWidth+spaced}unload(){document.removeEventListener("theme:resize",this.resizeEventWidth),document.removeEventListener("theme:resize",this.resizeEventOverlay),document.removeEventListener("shopify:section:load",this.headerUpdateEvent),document.removeEventListener("shopify:section:unload",this.headerUpdateEvent),document.removeEventListener("shopify:section:reorder",this.headerUpdateEvent)}}function _sumSplitWidths(nodes){let arr=[];return nodes.forEach(el=>{el.firstElementChild&&arr.push(el.firstElementChild.clientWidth)}),arr[0]>arr[2]?arr[2]=arr[0]:arr[0]=arr[2],arr.reduce((a,b)=>a+b)}function _sumWidths(nodes){let width=0;return nodes.forEach(el=>{width+=el.clientWidth}),width}const header={onLoad(){sections$f=new Header(this.container),setVarsOnResize()},onUnload(){typeof sections$f.unload=="function"&§ions$f.unload()}};register("header",[header,drawer,popoutSection,headerMobileSliderule,stickyHeader,hoverDisclosure,headerTotals,searchPopdown]);const selectors$x={slider:"[data-slider]",slide:"[data-slide]",thumb:"[data-slider-thumb]"},classes$k={isSelected:"is-selected"},sections$g={};class Look{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$x.slider),this.slides=this.container.querySelectorAll(selectors$x.slide),this.thumbs=this.container.querySelectorAll(selectors$x.thumb),this.slider&&this.slides.length&&this.thumbs.length&&(this.resizeEvent=()=>this.checkPosition(),this.slider.addEventListener("scroll",this.resizeEvent),document.addEventListener("theme:resize",this.resizeEvent),this.thumbs.forEach((thumb,i)=>{thumb.addEventListener("click",()=>{if((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small){const parentPadding=parseInt(window.getComputedStyle(this.slider).paddingLeft),thumbLeft=this.slides[i].offsetLeft;this.slider.scrollTo({top:0,left:thumbLeft-parentPadding,behavior:"smooth"})}})}))}checkPosition(){if((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small){const sliderWidth=this.slider.offsetWidth,sliderPositionRight=this.slider.scrollLeft+sliderWidth;this.slides.forEach((slide,i)=>{const slideWidth=slide.offsetWidth,slidePositionRight=slide.offsetLeft+slideWidth;let nextSlideCheck=!1;const nextSlide=this.slides[i+1];if(nextSlide){const nextSlidePositionWidth=nextSlide.offsetWidth,nextSlidePositionRight=nextSlide.offsetLeft+nextSlidePositionWidth;sliderPositionRight>=nextSlidePositionRight&&(nextSlideCheck=!0)}this.thumbs[i].classList.toggle(classes$k.isSelected,sliderPositionRight>=slidePositionRight&&!nextSlideCheck)})}}onUnload(){this.slider&&this.slides.length&&this.thumbs.length&&(document.removeEventListener("theme:resize",this.resizeEvent),this.slider.removeEventListener("scroll",this.resizeEvent))}}const lookSection={onLoad(){sections$g[this.id]=new Look(this)},onUnload(e){sections$g[this.id].onUnload(e)}};register("look",[lookSection,slider,quickAddProduct,swatchGridSection]);const selectors$y={body:"body",dataRelatedSectionElem:"[data-related-section]",dataTabsHolder:"[data-tabs-holder]",dataTab:"data-tab",dataTabIndex:"data-tab-index",dataTabStartIndex:"data-start-index",dataTabStartIndexMobile:"data-start-index-mobile",dataAos:"[data-aos]",blockId:"data-block-id",tabsLi:"[data-tab]",tabLink:".tab-link",tabLinkRecent:".tab-link__recent",tabContent:".tab-content",scrollbarHolder:"[data-scrollbar]",scrollbarArrowPrev:"[data-scrollbar-arrow-prev]",scrollbarArrowNext:"[data-scrollbar-arrow-next]",productModal:"[data-product-modal]"},classes$l={current:"current",hide:"hide",alt:"alt",aosAnimate:"aos-animate",aosNoTransition:"aos-no-transition",focused:"is-focused"},sections$h={};class GlobalTabs{constructor(holder){this.container=holder,this.body=document.querySelector(selectors$y.body),this.accessibility=window.accessibility,this.container&&(this.scrollbarHolder=this.container.querySelectorAll(selectors$y.scrollbarHolder),this.init(),this.initNativeScrollbar())}init(){const windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,ctx=this.container,tabsNavList=ctx.querySelectorAll(selectors$y.tabsLi),startIdx=ctx.hasAttribute(selectors$y.dataTabStartIndex)?ctx.getAttribute(selectors$y.dataTabStartIndex):0;let firstTabLink=ctx.querySelector(`${selectors$y.tabLink}-${startIdx}`),firstTabContent=ctx.querySelector(`${selectors$y.tabContent}-${startIdx}`);if(windowWidth<theme.sizes.small){const startIdxMobile=ctx.hasAttribute(selectors$y.dataTabStartIndexMobile)?ctx.getAttribute(selectors$y.dataTabStartIndexMobile):startIdx;firstTabLink=ctx.querySelector(`${selectors$y.tabLink}-${startIdxMobile}`),firstTabContent=ctx.querySelector(`${selectors$y.tabContent}-${startIdxMobile}`)}firstTabContent&&firstTabContent.classList.add(classes$l.current),firstTabLink&&firstTabLink.classList.add(classes$l.current),this.checkVisibleTabLinks(),this.container.addEventListener("theme:tab:check",()=>this.checkRecentTab()),this.container.addEventListener("theme:tab:hide",()=>this.hideRelatedTab()),tabsNavList.length&&tabsNavList.forEach(element=>{const tabId=parseInt(element.getAttribute(selectors$y.dataTab)),tab=ctx.querySelector(`${selectors$y.tabContent}-${tabId}`);element.addEventListener("click",()=>{this.tabChange(element,tab)}),element.addEventListener("keyup",event=>{(event.which===window.theme.keyboardKeys.SPACE||event.which===window.theme.keyboardKeys.ENTER)&&this.body.classList.contains(classe
11s$l.focused)&&this.tabChange(element,tab)})})}tabChange(element,tab){if(element.classList.contains(classes$l.current))return;this.container.querySelector(`${selectors$y.tabsLi}.${classes$l.current}`).classList.remove(classes$l.current),this.container.querySelector(`${selectors$y.tabContent}.${classes$l.current}`).classList.remove(classes$l.current),element.classList.add(classes$l.current),tab.classList.add(classes$l.current),element.classList.contains(classes$l.hide)&&tab.classList.add(classes$l.hide),this.checkVisibleTabLinks(),this.accessibility.a11y.removeTrapFocus(),this.container.dispatchEvent(new CustomEvent("theme:tab:change",{bubbles:!0})),element.dispatchEvent(new CustomEvent("theme:form:sticky",{bubbles:!0,detail:{element:"tab"}})),this.animateItems(tab)}animateItems(tab,animated=!0){const animatedItems=tab.querySelectorAll(selectors$y.dataAos);animatedItems.length&&animatedItems.forEach(animatedItem=>{animatedItem.classList.remove(classes$l.aosAnimate),animated&&(animatedItem.classList.add(classes$l.aosNoTransition),setTimeout(()=>{animatedItem.classList.remove(classes$l.aosNoTransition),animatedItem.classList.add(classes$l.aosAnimate)}))})}initNativeScrollbar(){this.scrollbarHolder.length&&this.scrollbarHolder.forEach(scrollbar=>{new NativeScrollbar(scrollbar)})}checkVisibleTabLinks(){const tabsNavList=this.container.querySelectorAll(selectors$y.tabsLi),tabsNavListHided=this.container.querySelectorAll(`${selectors$y.tabLink}.${classes$l.hide}`);tabsNavList.length-tabsNavListHided.length<2?this.container.classList.add(classes$l.alt):this.container.classList.remove(classes$l.alt)}checkRecentTab(){const tabLink=this.container.querySelector(selectors$y.tabLinkRecent);if(tabLink){tabLink.classList.remove(classes$l.hide);const tabLinkIdx=parseInt(tabLink.getAttribute(selectors$y.dataTab)),tabContent=this.container.querySelector(`${selectors$y.tabContent}[${selectors$y.dataTabIndex}="${tabLinkIdx}"]`);tabContent&&(tabContent.classList.remove(classes$l.hide),this.animateItems(tabContent,!1)),this.checkVisibleTabLinks(),this.initNativeScrollbar()}}hideRelatedTab(){const relatedSection2=this.container.querySelector(selectors$y.dataRelatedSectionElem);if(!relatedSection2)return;const parentTabContent=relatedSection2.closest(`${selectors$y.tabContent}.${classes$l.current}`);if(!parentTabContent)return;const parentTabContentIdx=parseInt(parentTabContent.getAttribute(selectors$y.dataTabIndex)),tabsNavList=this.container.querySelectorAll(selectors$y.tabsLi);if(tabsNavList.length>parentTabContentIdx){const nextTabsNavLink=tabsNavList[parentTabContentIdx].nextSibling;nextTabsNavLink&&(tabsNavList[parentTabContentIdx].classList.add(classes$l.hide),nextTabsNavLink.dispatchEvent(new Event("click")),this.initNativeScrollbar())}}onBlockSelect(evt){const element=this.container.querySelector(`${selectors$y.tabLink}[${selectors$y.blockId}="${evt.detail.blockId}"]`);element&&(element.dispatchEvent(new Event("click")),element.parentNode.scrollTo({top:0,left:element.offsetLeft-element.clientWidth,behavior:"smooth"}))}}const tabs={onLoad(){sections$h[this.id]=[],this.container.querySelectorAll(selectors$y.dataTabsHolder).forEach(holder=>{sections$h[this.id].push(new GlobalTabs(holder))})},onBlockSelect(e){sections$h[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})}};register("product-grid",[slider,quickAddProduct,swatchGridSection,tabs]);const tokensReducer=(acc,token)=>{const{el,elStyle,elHeight,rowsLimit,rowsWrapped,options}=acc;let oldBuffer=acc.buffer,newBuffer=oldBuffer;if(rowsWrapped===rowsLimit+1)return{...acc};const textBeforeWrap=oldBuffer;let newRowsWrapped=rowsWrapped,newHeight=elHeight;return el.innerHTML=newBuffer=oldBuffer.length?`${oldBuffer}${options.delimiter}${token}${options.replaceStr}`:`${token}${options.replaceStr}`,parseFloat(elStyle.height)>parseFloat(elHeight)&&(newRowsWrapped++,newHeight=elStyle.height,newRowsWrapped===rowsLimit+1)?(el.innerHTML=newBuffer=textBeforeWrap[textBeforeWrap.length-1]==="."&&options.replaceStr==="..."?`${textBeforeWrap}..`:`${textBeforeWrap}${options.replaceStr}`,{...acc,elHeight:newHeight,rowsWrapped:newRowsWrapped}):(el.innerHTML=newBuffer=textBeforeWrap.length?`${textBeforeWrap}${options.delimiter}${token}`:`${token}`,{...acc,buffer:newBuffer,elHeight:newHeight,rowsWrapped:newRowsWrapped})},ellipsis=(selector="",rows=1,options={})=>{const opts={...{replaceStr:"...",debounceDelay:250,delimiter:" "},...options},elements=selector&&(selector instanceof NodeList?selector:selector.nodeType===1?[selector]:document.querySelectorAll(selector));for(let i=0;i<elements.length;i++){const el=elements[i],elementHtml=el.innerHTML,commentRegex=/<!--[\s\S]*?-->/g,splittedText=elementHtml.replace(commentRegex,"").split(opts.delimiter);el.innerHTML="";const elStyle=window.getComputedStyle(el);splittedText.reduce(tokensReducer,{el,buffer:el.innerHTML,elStyle,elHeight:0,rowsLimit:rows,rowsWrapped:0,options:opts})}},fadeOut=(el,callback=null)=>{el.style.opacity=1,(function fade(){(el.style.opacity-=.1)<0?el.style.display="none":requestAnimationFrame(fade),parseFloat(el.style.opacity)===0&&typeof callback=="function"&&callback()})()},selectors$z={productSlideshow:"[data-product-slideshow]",productThumbs:"[data-product-thumbs]",sliderThumb:"[data-thumb-item]",dataTallLayout:"data-tall-layout",mediaType:"data-type",dataMediaId:"data-media-id",dataThumb:"data-thumb",dataThumbIndex:"data-thumb-index",deferredMediaButton:"[data-deferred-media-button]",ariaLabel:"aria-label",dataThumbnail:"[data-thumbnail]",productSlideThumb:".js-product-slide-thumb",classSelected:".is-active",thumbsSlider:"[data-thumbs-slider]",upsellModal:"[data-upsell-modal]",focusedElement:"[data-focus-element]",zoomElement:"[data-zoom-wrapper]"},classes$m={btn:"btn",active:"is-active",focused:"is-focused",dragging:"is-dragging",selected:"is-selected",sliderEnabled:"flickity-enabled",mediaHidden:"media--hidden"},attributes$6={ariaCurrent:"aria-current"},thumbIcons={model:'<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-media-model" viewBox="0 0 26 26"><path class="icon-media-model-outline" d="M.5 25v.5h25V.5H.5z" fill="none"/><path class="icon-media-model-element" d="M19.13 8.28L14 5.32a2 2 0 0 0-2 0l-5.12 3a2 2 0 0 0-1 1.76V16a2 2 0 0 0 1 1.76l5.12 3a2 2 0 0 0 2 0l5.12-3a2 2 0 0 0 1-1.76v-6a2 2 0 0 0-.99-1.72zm-6.4 11.1l-5.12-3a.53.53 0 0 1-.26-.38v-6a.53.53 0 0 1 .27-.46l5.12-3a.53.53 0 0 1 .53 0l5.12 3-4.72 2.68a1.33 1.33 0 0 0-.67 1.2v6a.53.53 0 0 1-.26 0z" opacity=".6" style="isolation:isolate"/></svg>',video:'<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-media-video" viewB
11ox="0 0 26 26"><path fill-rule="evenodd" clip-rule="evenodd" d="M1 25h24V1H1v24z"/><path class="icon-media-video-outline" d="M.5 25v.5h25V.5H.5V25z"/><path class="icon-media-video-element" fill-rule="evenodd" clip-rule="evenodd" d="M9.718 6.72a1 1 0 0 0-1.518.855v10.736a1 1 0 0 0 1.562.827l8.35-5.677a1 1 0 0 0-.044-1.682l-8.35-5.06z" opacity=".6"/></svg>'};class InitSlider{constructor(section){this.container=section.container,this.tallLayout=this.container.getAttribute(selectors$z.dataTallLayout)==="true",this.slideshow=this.container.querySelector(selectors$z.productSlideshow),this.thumbs=this.container.querySelector(selectors$z.productThumbs),this.mobileSliderEnable=this.container.getAttribute(selectors$z.mobileSliderEnable)==="true",this.flkty=null,this.init()}init(){this.tallLayout?(this.initSliderMobile(),document.addEventListener("theme:resize",()=>{this.initSliderMobile()})):this.createSlider()}initSliderMobile(){(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small?this.createSlider():this.destroySlider()}destroySlider(){this.slideshow.classList.contains(classes$m.sliderEnabled)&&this.flkty.destroy(),this.thumbs&&(this.thumbs.innerHTML="")}createSlider(){if(!this.slideshow)return;const instance=this,firstSlide=this.slideshow.querySelectorAll(`[${selectors$z.mediaType}]`)[0];let options={autoPlay:!1,prevNextButtons:!1,contain:!0,pageDots:!1,adaptiveHeight:!0,wrapAround:!0,fade:!0,on:{ready:function(){const slides=this.element;slides.addEventListener("keyup",e=>{if(e.keyCode===window.theme.keyboardKeys.ENTER){const zoomElement=slides.querySelector(`.${classes$m.selected} ${selectors$z.zoomElement}`);zoomElement&&(zoomElement.dispatchEvent(new Event("click",{bubbles:!1})),window.accessibility.lastElement=slides)}}),instance.sliderThumbs(this)}}};if(this.slideshow.closest(selectors$z.upsellModal)&&(options={autoPlay:!1,prevNextButtons:!0,pageDots:!1,wrapAround:!0,fade:!1,cellAlign:"left",adaptiveHeight:!1,on:{ready:function(){this.prevButton.element.classList.add(classes$m.btn),this.nextButton.element.classList.add(classes$m.btn)}}}),this.flkty=new FlickityFade(this.slideshow,options),this.flkty.resize(),firstSlide){const firstType=firstSlide.getAttribute(selectors$z.mediaType);(firstType==="model"||firstType==="video"||firstType==="external_video")&&(this.flkty.options.draggable=!1,this.flkty.updateDraggable())}this.flkty.on("change",function(index){let lastSLideIdx=index;if(instance.thumbs){const selectedElem=instance.thumbs.querySelector(selectors$z.classSelected),currentSlide=instance.thumbs.querySelector(`${selectors$z.sliderThumb} [${selectors$z.dataThumbIndex}="${index}"]`);if(selectedElem){const selectedElemThumb=selectedElem.querySelector(`[${selectors$z.dataThumbIndex}]`);lastSLideIdx=Array.from(selectedElem.parentElement.children).indexOf(selectedElem),selectedElem.classList.remove(classes$m.active),selectedElemThumb&&selectedElemThumb.setAttribute(attributes$6.ariaCurrent,!1)}currentSlide&&(currentSlide.parentElement.classList.add(classes$m.active),currentSlide.setAttribute(attributes$6.ariaCurrent,!0)),instance.scrollToThumb()}const currentMedia=this.cells[lastSLideIdx].element,newMedia=this.selectedElement;currentMedia.dispatchEvent(new CustomEvent("theme:media:hidden")),newMedia.classList.remove(classes$m.mediaHidden)}),this.flkty.on("settle",function(){const currentMedia=this.selectedElement,otherMedia=Array.prototype.filter.call(currentMedia.parentNode.children,function(child){return child!==currentMedia}),mediaType=currentMedia.getAttribute(selectors$z.mediaType),isFocusEnabled=document.body.classList.contains(classes$m.focused);mediaType==="model"||mediaType==="video"||mediaType==="external_video"?(instance.flkty.options.draggable=!1,instance.flkty.updateDraggable()):(instance.flkty.options.draggable=!0,instance.flkty.updateDraggable()),isFocusEnabled&¤tMedia.dispatchEvent(new Event("focus")),otherMedia.length&&otherMedia.forEach(element=>{element.classList.add(classes$m.mediaHidden)}),currentMedia.dispatchEvent(new CustomEvent("theme:media:visible"));const deferredMedia=currentMedia.querySelector("deferred-media");deferredMedia&&deferredMedia.getAttribute("loaded")!==!0&¤tMedia.querySelector(selectors$z.deferredMediaButton).dispatchEvent(new Event("click",{bubbles:!1}))}),this.flkty.on("dragStart",(event,pointer)=>{event.target.classList.add(classes$m.dragging)}),this.flkty.on("dragEnd",(event,pointer)=>{const draggedElem=this.flkty.element.querySelector(`.${classes$m.dragging}`);draggedElem&&draggedElem.classList.remove(classes$m.dragging)}),this.container.addEventListener("click",e=>{const target=e.target;if(target.matches(selectors$z.productSlideThumb)||target.closest(selectors$z.productSlideThumb)){e.preventDefault();const selector=target.matches(selectors$z.productSlideThumb)?target:target.closest(selectors$z.productSlideThumb),slideIdx=selector.hasAttribute(selectors$z.dataThumbIndex)?parseInt(selector.getAttribute(selectors$z.dataThumbIndex)):0;this.flkty.select(slideIdx)}})}scrollToThumb(){const thumbs=this.container.querySelector(selectors$z.thumbsSlider);if(thumbs){const thumb=thumbs.querySelector(selectors$z.classSelected);if(!thumb)return;const thumbsScrollTop=thumbs.scrollTop,thumbsScrollLeft=thumbs.scrollLeft,thumbsWidth=thumbs.offsetWidth,thumbsHeight=thumbs.offsetHeight,thumbsPositionBottom=thumbsScrollTop+thumbsHeight,thumbsPositionRight=thumbsScrollLeft+thumbsWidth,thumbPosTop=thumb.offsetTop,thumbPosLeft=thumb.offsetLeft,thumbWidth=thumb.offsetWidth,thumbHe
11ight=thumb.offsetHeight,thumbRightPos=thumbPosLeft+thumbWidth,thumbBottomPos=thumbPosTop+thumbHeight,topCheck=thumbsScrollTop>thumbPosTop,bottomCheck=thumbBottomPos>thumbsPositionBottom,leftCheck=thumbsScrollLeft>thumbPosLeft,rightCheck=thumbRightPos>thumbsPositionRight;if(bottomCheck||topCheck||(rightCheck||leftCheck)){const isMobile=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small;let scrollTopPosition=thumbPosTop-thumbsHeight+thumbHeight,scrollLeftPosition=thumbPosLeft-thumbsWidth+thumbWidth;topCheck&&(scrollTopPosition=thumbPosTop),rightCheck&&isMobile&&(scrollLeftPosition+=parseInt(window.getComputedStyle(thumbs).paddingRight)),leftCheck&&(scrollLeftPosition=thumbPosLeft,isMobile&&(scrollLeftPosition-=parseInt(window.getComputedStyle(thumbs).paddingLeft))),thumbs.scrollTo({top:scrollTopPosition,left:scrollLeftPosition,behavior:"smooth"})}}}sliderThumbs(thisEl){const slides=thisEl.slides;if(this.thumbs&&slides.length){let slidesHtml="";slides.forEach((element,i)=>{const slide=element.cells[0].element,type=slide.getAttribute(selectors$z.mediaType),mediaId=slide.getAttribute(selectors$z.dataMediaId),thumb=slide.getAttribute(selectors$z.dataThumb),focusedElement=slide.querySelector(`button, ${selectors$z.focusedElement}`);let thumbAlt="";const thumbIcon=thumbIcons[type]?thumbIcons[type]:"";let selected="",ariaCurrent=!1;slide.querySelector(`[${selectors$z.ariaLabel}]`)&&(thumbAlt=slide.querySelector(`[${selectors$z.ariaLabel}]`).getAttribute(selectors$z.ariaLabel)),thumbAlt===""&&slide.hasAttribute(selectors$z.ariaLabel)&&(thumbAlt=slide.getAttribute(selectors$z.ariaLabel)),slide.setAttribute("tabindex","-1"),focusedElement&&focusedElement.setAttribute("tabindex","-1"),(slide.classList.contains(classes$m.active)||i===0)&&(selected=classes$m.active,ariaCurrent=!0),slidesHtml+=`<div class="thumb ${selected}" data-thumb-item><a href="${thumb}" class="thumb__link thumb__link--${type} js-product-slide-thumb" data-thumb-index="${i}" data-thumbnail data-media-id="${mediaId}" aria-label="${thumbAlt}" aria-current="${ariaCurrent}"><img class="thumb__link__image lazyload" alt="${thumbAlt}" data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 2048, 2450, 2700, 3000, 3350, 3750, 4100]" data-sizes="auto" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="${thumb}">${thumbIcon}</a></div>`}),slidesHtml!==""&&(slidesHtml=`<div class="thumbs-holder" data-thumbs-slider>${slidesHtml}</div>`,this.thumbs.innerHTML=slidesHtml)}const productThumbImages=this.container.querySelectorAll(selectors$z.dataThumbnail);productThumbImages.length&&productThumbImages.forEach(element=>{element.addEventListener("click",function(e){e.preventDefault()}),element.addEventListener("keyup",function(e){if(e.keyCode===window.theme.keyboardKeys.ENTER){const mediaId=this.getAttribute(selectors$z.dataMediaId),mediaElem=thisEl.element.querySelector(`[${selectors$z.dataMediaId}="${mediaId}"]`).querySelectorAll('model-viewer, video, iframe, button, [href], input, [tabindex]:not([tabindex="-1"])')[0];mediaElem&&(mediaElem.dispatchEvent(new Event("focus")),mediaElem.dispatchEvent(new Event("select")))}})})}}const selectors$A={dataEnableSound:"data-enable-sound",dataEnableBackground:"data-enable-background",dataEnableAutoplay:"data-enable-autoplay",dataEnableLoop:"data-enable-loop",dataVideoId:"data-video-id",dataVideoType:"data-video-type",videoIframe:"[data-video-id]"},classes$n={loaded:"loaded"};class LoadVideoVimeo{constructor(container){this.container=container,this.player=this.container.querySelector(selectors$A.videoIframe),this.player&&(this.videoID=this.player.getAttribute(selectors$A.dataVideoId),this.videoType=this.player.getAttribute(selectors$A.dataVideoType),this.enableBackground=this.player.getAttribute(selectors$A.dataEnableBackground)==="true",this.disableSound=this.player.getAttribute(selectors$A.dataEnableSound)==="false",this.enableAutoplay=this.player.getAttribute(selectors$A.dataEnableAutoplay)!=="false",this.enableLoop=this.player.getAttribute(selectors$A.dataEnableLoop)!=="false",this.videoType=="vimeo"&&this.init())}init(){this.loadVimeoPlayer()}loadVimeoPlayer(){const oembedUrl="https://vimeo.com/api/oembed.json",vimeoUrl="https://vimeo.com/"+this.videoID;let paramsString="";const state=this.player,params={url:vimeoUrl,background:this.enableBackgroun
11d,muted:this.disableSound,autoplay:this.enableAutoplay,loop:this.enableLoop};for(let key in params)paramsString+=encodeURIComponent(key)+"="+encodeURIComponent(params[key])+"&";fetch(`${oembedUrl}?${paramsString}`).then(response=>response.json()).then(function(data2){state.innerHTML=data2.html,setTimeout(function(){state.parentElement.classList.add(classes$n.loaded)},1e3)}).catch(function(){console.log("error")})}}const selectors$B={dataSectionId:"data-section-id",dataEnableSound:"data-enable-sound",dataHideOptions:"data-hide-options",dataCheckPlayerVisibility:"data-check-player-visibility",dataVideoId:"data-video-id",dataVideoType:"data-video-type",videoIframe:"[data-video-id]",videoWrapper:".video-wrapper",youtubeWrapper:"[data-youtube-wrapper]"},classes$o={loaded:"loaded"},players=[];class LoadVideoYT{constructor(container){this.container=container,this.player=this.container.querySelector(selectors$B.videoIframe),this.player&&(this.videoOptionsVars={},this.videoID=this.player.getAttribute(selectors$B.dataVideoId),this.videoType=this.player.getAttribute(selectors$B.dataVideoType),this.videoType=="youtube"&&(this.checkPlayerVisibilityFlag=this.player.getAttribute(selectors$B.dataCheckPlayerVisibility)==="true",this.playerID=this.player.querySelector(selectors$B.youtubeWrapper)?this.player.querySelector(selectors$B.youtubeWrapper).id:this.player.id,this.player.hasAttribute(selectors$B.dataHideOptions)&&(this.videoOptionsVars={cc_load_policy:0,iv_load_policy:3,modestbranding:1,playsinline:1,autohide:0,controls:0,branding:0,showinfo:0,rel:0,fs:0,wmode:"opaque"}),this.init(),this.container.addEventListener("touchstart",function(e){if(e.target.matches(selectors$B.videoWrapper)||e.target.closest(selectors$B.videoWrapper)){const playerID=e.target.querySelector(selectors$B.videoIframe).id;players[playerID].playVideo()}})))}init(){window.isYoutubeAPILoaded?this.loadYoutubePlayer():loadScript({url:"https://www.youtube.com/iframe_api"}).then(()=>this.loadYoutubePlayer())}loadYoutubePlayer(){const currentYoutubeOptions={...{height:"720",width:"1280",playerVars:this.videoOptionsVars,events:{onReady:event=>{const eventIframe=event.target.getIframe(),id=eventIframe.id,enableSound=document.querySelector(`#${id}`).getAttribute(selectors$B.dataEnableSound)==="true";eventIframe.setAttribute("tabindex","-1"),enableSound?event.target.unMute():event.target.mute(),event.target.playVideo(),this.checkPlayerVisibilityFlag&&(this.checkPlayerVisibility(id),window.addEventListener("scroll",throttle(()=>{this.checkPlayerVisibility(id)},150)))},onStateChange:event=>{event.data==0&&event.target.playVideo(),event.data==1&&event.target.getIframe().parentElement.classList.add(classes$o.loaded)}}}};currentYoutubeOptions.videoId=this.videoID,this.videoID.length&&YT.ready(()=>{players[this.playerID]=new YT.Player(this.playerID,currentYoutubeOptions)}),window.isYoutubeAPILoaded=!0}checkPlayerVisibility(id){let playerID;if(typeof id=="string")playerID=id;else if(id.data!=null)playerID=id.data.id;else return;const playerElement=document.getElementById(playerID+"-container");if(!playerElement)return;const player=players[playerID],box=playerElement.getBoundingClientRect();let isVisible2=visibilityHelper.isElementPartiallyVisible(playerElement)||visibilityHelper.isElementTotallyVisible(playerElement);box.top<0&&playerElement.clientHeight+box.top>=0&&(isVisible2=!0),isVisible2&&player&&typeof player.playVideo=="function"?player.playVideo():!isVisible2&&player&&typeof player.pauseVideo=="function"&&player.pauseVideo()}onUnload(){const playerID="youtube-"+this.container.getAttribute(selectors$B.dataSectionId);players[playerID]&&players[playerID].destroy()}}const selectors$C={popupContainer:".pswp",popupCloseBtn:".pswp__custom-close",popupIframe:"iframe, video",popupCustomIframe:".pswp__custom-iframe",popupThumbs:".pswp__thumbs",popupButtons:".pswp__button, .pswp__caption-close"},classes$p={current:"is-current",customLoader:"pswp--custom-loader",customOpen:"pswp--custom-opening",loader:"pswp__loader",popupCloseButton:"pswp__button--close"},attributes$7={dataOptionClasses:"data-pswp-option-classes",dataVideoType:"data-video-type",ariaCurrent:"aria-current"},loaderHTML=`<div class="${classes$p.loader}"><div class="loader pswp__loader-line"><div class="loader-indeterminate"></div></div></div>`;class LoadPhotoswipe{constructor(items,options=""){this.items=items,this.pswpElement=document.querySelectorAll(selectors$C.popupContainer)[0],this.popup=null,this.popupThumbs=null,this.isVideo=!1,this.popupThumbsContainer=this.pswpElement.querySelector(selectors$C.popupThumbs),this.closeBtn=this.pswpElement.querySelector(selectors$C.popupCloseBtn),this.keyupCloseEvent=e=>this.keyupClose(e),this.a11y=a11y;const defaultOptions={history:!1,focus:!1,mainClass:""};this.options=options!==""?options:defaultOptions,this.init()}init(){this.pswpElement.classList.add(classes$p.customOpen),this.initLoader(),loadScript({url:window.theme.assets.photoswipe}).then(()=>this.loadPopup()).catch(e=>console.error(e))}
11initLoader(){if(this.pswpElement.classList.contains(classes$p.customLoader)&&this.options!==""&&this.options.mainClass){this.pswpElement.setAttribute(attributes$7.dataOptionClasses,this.options.mainClass);let loaderElem=document.createElement("div");loaderElem.innerHTML=loaderHTML,loaderElem=loaderElem.firstChild,this.pswpElement.appendChild(loaderElem)}else this.pswpElement.setAttribute(attributes$7.dataOptionClasses,"")}loadPopup(){const PhotoSwipe=window.themePhotoswipe.PhotoSwipe.default,PhotoSwipeUI=window.themePhotoswipe.PhotoSwipeUI.default;this.pswpElement.classList.contains(classes$p.customLoader)&&this.pswpElement.classList.remove(classes$p.customLoader),this.pswpElement.classList.remove(classes$p.customOpen),this.popup=new PhotoSwipe(this.pswpElement,PhotoSwipeUI,this.items,this.options),this.popup.init(),this.initVideo(),this.thumbsActions(),this.isVideo&&this.hideUnusedButtons(),setTimeout(()=>{this.a11y.trapFocus(this.pswpElement,{elementToFocus:this.closeBtn})},200),this.popup.listen("close",()=>this.onClose()),this.options&&this.options.closeElClasses&&this.options.closeElClasses.length&&this.options.closeElClasses.forEach(closeClass=>{const closeElement=this.pswpElement.querySelector(`.pswp__${closeClass}`);closeElement&&closeElement.addEventListener("keyup",this.keyupCloseEvent)})}initVideo(){const videoContainer=this.pswpElement.querySelector(selectors$C.popupCustomIframe);if(videoContainer){const videoType=videoContainer.getAttribute(attributes$7.dataVideoType);this.isVideo=!0,videoType=="youtube"?new LoadVideoYT(videoContainer.parentElement):videoType=="vimeo"&&new LoadVideoVimeo(videoContainer.parentElement)}}thumbsActions(){this.popupThumbsContainer&&this.popupThumbsContainer.firstChild&&(this.popupThumbsContainer.addEventListener("wheel",e=>this.stopDisabledScroll(e)),this.popupThumbsContainer.addEventListener("mousewheel",e=>this.stopDisabledScroll(e)),this.popupThumbsContainer.addEventListener("DOMMouseScroll",e=>this.stopDisabledScroll(e)),this.popupThumbs=this.pswpElement.querySelectorAll(`${selectors$C.popupThumbs} > *`),this.popupThumbs.forEach((element,i)=>{element.addEventListener("click",e=>{e.preventDefault();const lastCurrentElement=element.parentElement.querySelector(`.${classes$p.current}`);lastCurrentElement.classList.remove(classes$p.current),lastCurrentElement.setAttribute(attributes$7.ariaCurrent,!1),element.classList.add(classes$p.current),element.setAttribute(attributes$7.ariaCurrent,!0),this.popup.goTo(i)})}),this.popup.listen("imageLoadComplete",()=>this.setCurrentThumb()),this.popup.listen("beforeChange",()=>this.setCurrentThumb()))}hideUnusedButtons(){const buttons=this.pswpElement.querySelectorAll(selectors$C.popupButtons);buttons.length&&buttons.forEach(element=>{element.classList.contains(classes$p.popupCloseButton)||(element.style.display="none")})}stopDisabledScroll(e){e.stopPropagation()}keyupClose(e){e.keyCode===window.theme.keyboardKeys.ENTER&&this.popup.close()}onClose(){const popupIframe=this.pswpElement.querySelector(selectors$C.popupIframe);if(popupIframe&&popupIframe.parentNode.removeChild(popupIframe),this.popupThumbsContainer&&this.popupThumbsContainer.firstChild)for(;this.popupThumbsContainer.firstChild;)this.popupThumbsContainer.removeChild(this.popupThumbsContainer.firstChild);this.pswpElement.setAttribute(attributes$7.dataOptionClasses,"");const loaderElem=this.pswpElement.querySelector(`.${classes$p.loader}`);loaderElem&&this.pswpElement.removeChild(loaderElem),this.options&&this.options.closeElClasses&&this.options.closeElClasses.length&&this.options.closeElClasses.forEach(closeClass=>{const closeElement=this.pswpElement.querySelector(`.pswp__${closeClass}`);closeElement&&closeElement.removeEventListener("keyup",this.keyupCloseEvent)}),this.a11y.removeTrapFocus(),window.accessibility.lastElement&&setTimeout(()=>{window.accessibility.lastElement.focus()},200)}setCurrentThumb(){const lastCurrentThumb=this.pswpElement.querySelector(`${selectors$C.popupThumbs} > .${classes$p.current}`);if(lastCurrentThumb&&(lastCurrentThumb.classList.remove(classes$p.current),lastCurrentThumb.setAttribute(attributes$7.ariaCurrent,!1)),!this.popupThumbs)return;const currentThumb=this.popupThumbs[this.popup.getCurrentIndex()];currentThumb.classList.add(classes$p.current),currentThumb.setAttribute(attributes$7.ariaCurrent,!0),this.scrollThumbs(currentThumb)}scrollThumbs(currentThumb){const thumbsContainerLeft=this.popupThumbsContainer.scrollLeft,thumbsContainerWidth=this.popupThumbsContainer.offsetWidth,thumbsContainerPos=thumbsContainerLeft+thumbsContainerWidth,currentThumbLeft=currentThumb.offsetLeft,currentThumbWidth=currentThumb.offsetWidth,currentThumbPos=currentThumbLeft+currentThumbWidth;if(thumbsContainerPos<=currentThumbPos||thumbsContainerPos>
11currentThumbLeft){const currentThumbMarginLeft=parseInt(window.getComputedStyle(currentThumb).marginLeft);this.popupThumbsContainer.scrollTo({top:0,left:currentThumbLeft-currentThumbMarginLeft,behavior:"smooth"})}}}const selectors$D={zoomWrapper:"[data-zoom-wrapper]",dataImageSrc:"data-image-src",dataImageWidth:"data-image-width",dataImageHeight:"data-image-height",dataImageAlt:"data-image-alt",dataImageZoomEnable:"data-image-zoom-enable",thumbs:".pswp__thumbs",caption:"[data-zoom-caption]"},classes$q={variantSoldOut:"variant--soldout",variantUnavailable:"variant--unavailable",popupThumb:"pswp__thumb",popupClass:"pswp-zoom-gallery",popupClassNoThumbs:"pswp-zoom-gallery--single",popupTitle:"product__title",popupTitleNew:"product__title pswp__title"};class Zoom{constructor(section){this.container=section.container,this.zoomWrappers=this.container.querySelectorAll(selectors$D.zoomWrapper),this.thumbsContainer=document.querySelector(selectors$D.thumbs),this.zoomCaptionElem=this.container.querySelector(selectors$D.caption),this.zoomEnable=this.container.getAttribute(selectors$D.dataImageZoomEnable)==="true",this.zoomEnable&&this.init()}init(){this.zoomWrappers.length&&this.zoomWrappers.forEach((element,i)=>{element.addEventListener("click",e=>{e.preventDefault(),this.createZoom(i),window.accessibility.lastElement=element}),element.addEventListener("keyup",e=>{e.keyCode===window.theme.keyboardKeys.ENTER&&(e.preventDefault(),this.createZoom(i),window.accessibility.lastElement=element)})})}createZoom(indexImage){let items=[],counter=0,thumbs="";this.zoomWrappers.forEach(elementImage=>{const imgSrc=elementImage.getAttribute(selectors$D.dataImageSrc),imgAlt=elementImage.hasAttribute(selectors$D.dataImageAlt)?elementImage.getAttribute(selectors$D.dataImageAlt):"";if(counter+=1,items.push({src:imgSrc,w:parseInt(elementImage.getAttribute(selectors$D.dataImageWidth)),h:parseInt(elementImage.getAttribute(selectors$D.dataImageHeight)),msrc:imgSrc}),thumbs+=`<a href="#" class="${classes$q.popupThumb}" style="background-image: url('${imgSrc}')" aria-label="${imgAlt}" aria-current="false"></a>`,this.zoomWrappers.length===counter){const options={history:!1,focus:!1,index:indexImage,mainClass:counter===1?`${classes$q.popupClass} ${classes$q.popupClassNoThumbs}`:`${classes$q.popupClass}`,showHideOpacity:!0,howAnimationDuration:150,hideAnimationDuration:250,closeOnScroll:!1,closeOnVerticalDrag:!1,captionEl:!0,closeEl:!0,closeElClasses:["caption-close","title"],tapToClose:!1,clickToCloseNonZoomable:!1,maxSpreadZoom:2,loop:!0,spacing:0,allowPanToNext:!0,pinchToClose:!1,addCaptionHTMLFn:(item,captionEl,isFake)=>{this.zoomCaption(item,captionEl,isFake)},getThumbBoundsFn:()=>{const imageLocation=this.zoomWrappers[indexImage],pageYScroll=window.pageYOffset||document.documentElement.scrollTop,rect=imageLocation.getBoundingClientRect();return{x:rect.left,y:rect.top+pageYScroll,w:rect.width}}};new LoadPhotoswipe(items,options),this.thumbsContainer&&thumbs!==""&&(this.thumbsContainer.innerHTML=thumbs)}})}zoomCaption(item,captionEl){let captionHtml="";const targetContainer=captionEl.children[0];return this.zoomCaptionElem&&(captionHtml=this.zoomCaptionElem.innerHTML,this.zoomCaptionElem.closest(`.${classes$q.variantSoldOut}`)?targetContainer.classList.add(classes$q.variantSoldOut):targetContainer.classList.remove(classes$q.variantSoldOut),this.zoomCaptionElem.closest(`.${classes$q.variantUnavailable}`)?targetContainer.classList.add(classes$q.variantUnavailable):targetContainer.classList.remove(classes$q.variantUnavailable)),captionHtml=captionHtml.replaceAll(classes$q.popupTitle,classes$q.popupTitleNew),targetContainer.innerHTML=captionHtml,!1}}const hosts={html5:"html5",youtube:"youtube",vimeo:"vimeo"},selectors$E={deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]",productMediaWrapper:"[data-product-single-media-wrapper]",productMediaSlider:"[data-product-single-media-slider]",mediaContainer:"[data-video]",mediaId:"data-media-id",dataTallLayout:"data-tall-layout"},classes$r={mediaHidden:"media--hidden"};theme.mediaInstances={};class Video{constructor(section){this.section=section,this.container=section.container,this.id=section.id,this.tallLayout=this.container.getAttribute(selectors$E.dataTallLayout)==="true",this.players={},this.init()}init(){this.container.querySelectorAll(selectors$E.mediaContainer).forEach(mediaContainer=>{const deferredMediaButton=mediaContainer.querySelector(selectors$E.deferredMediaButton);deferredMediaButton&&deferredMediaButton.addEventListener("click",this.loadContent.bind(this,mediaContainer))})}loadContent(mediaContainer){if(mediaContainer.querySelector(selectors$E.deferredMedia).getAttribute("loaded"))return;const content=document.createElement("div");content.appendChild(mediaContainer.querySelector("template").content.firstElementChild.cloneNode(!0));const mediaId=mediaContainer.dataset.mediaId,element=content.querySelector("video, iframe"),host=this.hostFromVideoElement(element),deferredMedia=mediaContainer.querySelector(selectors$E.deferredMedia);deferredMedia.appendChild(element).focus(),deferredMedia.setAttribute("loaded",!0),this.players[mediaId]={mediaId,sectionId:this.id,c
11ontainer:mediaContainer,element,host,ready:()=>this.createPlayer(mediaId)};const video=this.players[mediaId];switch(video.host){case hosts.html5:this.loadVideo(video,hosts.html5);break;case hosts.vimeo:window.isVimeoAPILoaded?this.loadVideo(video,hosts.vimeo):loadScript({url:"https://player.vimeo.com/api/player.js"}).then(()=>this.loadVideo(video,hosts.vimeo));break;case hosts.youtube:window.isYoutubeAPILoaded?this.loadVideo(video,hosts.youtube):loadScript({url:"https://www.youtube.com/iframe_api"}).then(()=>this.loadVideo(video,hosts.youtube));break}}hostFromVideoElement(video){if(video.tagName==="VIDEO")return hosts.html5;if(video.tagName==="IFRAME"){if(/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(video.src))return hosts.youtube;if(video.src.includes("vimeo.com"))return hosts.vimeo}return null}loadVideo(video,host){video.host===host&&video.ready()}createPlayer(mediaId){const video=this.players[mediaId];switch(video.host){case hosts.html5:video.element.play(),video.element.addEventListener("play",()=>this.pauseOtherMedia(mediaId)),video.element.play(),video.container.addEventListener("theme:media:hidden",event=>this.onHidden(event)),video.container.addEventListener("xrLaunch",event=>this.onHidden(event)),video.container.addEventListener("theme:media:visible",event=>this.onVisible(event)),this.tallLayout&&this.observeVideo(video,mediaId);break;case hosts.vimeo:this.players[mediaId].player=new Vimeo.Player(video.element),this.players[mediaId].player.play(),window.isVimeoAPILoaded=!0,video.container.addEventListener("theme:media:hidden",event=>this.onHidden(event)),video.container.addEventListener("xrLaunch",event=>this.onHidden(event)),video.container.addEventListener("theme:media:visible",event=>this.onVisible(event)),this.tallLayout&&this.observeVideo(video,mediaId);break;case hosts.youtube:if(video.host==hosts.youtube&&video.player)return;YT.ready(()=>{const videoId=video.container.dataset.videoId;this.players[mediaId].player=new YT.Player(video.element,{videoId,events:{onReady:event=>event.target.playVideo()}}),window.isYoutubeAPILoaded=!0,video.container.addEventListener("theme:media:hidden",event=>this.onHidden(event)),video.container.addEventListener("xrLaunch",event=>this.onHidden(event)),video.container.addEventListener("theme:media:visible",event=>this.onVisible(event)),this.tallLayout&&this.observeVideo(video,mediaId)});break}}observeVideo(video,mediaId){new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{entry.intersectionRatio!=1?this.pauseVideo(video):(this.playVideo(video),this.pauseOtherMedia(mediaId))})},{threshold:1}).observe(video.element)}playVideo(video){video.player&&video.player.playVideo?video.player.playVideo():video.element&&video.element.play?video.element.play():video.player&&video.player.play&&video.player.play()}pauseVideo(video){video.player&&video.player.pauseVideo?video.player.pauseVideo():video.element&&video.element.pause?video.element.pause():video.player&&video.player.pause&&video.player.pause()}onHidden(event){typeof event.target.dataset.mediaId<"u"&&this.pauseVideo(this.players[event.target.dataset.mediaId])}onVisible(event){typeof event.target.dataset.mediaId<"u"&&this.playVideo(this.players[event.target.dataset.mediaId])}pauseOtherMedia(mediaId){const mediaIdString=`[${selectors$E.mediaId}="${mediaId}"]`,otherMedia=document.querySelectorAll(`${selectors$E.productMediaWrapper}:not(${mediaIdString})`);document.querySelector(`${selectors$E.productMediaWrapper}${mediaIdString}`).classList.remove(classes$r.mediaHidden),otherMedia.length&&otherMedia.forEach(element=>{element.dispatchEvent(new CustomEvent("theme:media:hidden")),element.classList.add(classes$r.mediaHidden)})}}theme.mediaInstances={};const selectors$F={videoPlayer:"[data-video]",modelViewer:"[data-model]",sliderEnabled:"flickity-enabled"},classes$s={mediaHidden:"media--hidden"};class Media{constructor(section){this.section=section,this.id=section.id,this.container=section.container}init(){this.detect3d(),this.launch3d(),new Video(this.section),new Zoom(this.section),new InitSlider(this.section)}detect3d(){const modelViewerElements=this.container.querySelectorAll(selectors$F.modelViewer);
11modelViewerElements.length&&modelViewerElements.forEach(element=>{theme.ProductModel.init(element,this.id)})}launch3d(){document.addEventListener("shopify_xr_launch",()=>{this.container.querySelector(`${selectors$F.modelViewer}:not(.${classes$s.mediaHidden})`).dispatchEvent(new CustomEvent("xrLaunch"))})}}const selectors$G={pickupContainer:"data-store-availability-container",shopifySection:".shopify-section",drawer:"[data-pickup-drawer]",drawerBody:"[data-pickup-drawer-body]",drawerOpen:"[data-pickup-drawer-open]",drawerClose:"[data-pickup-drawer-close]",body:"body"},classes$t={isOpen:"is-open",isHidden:"hidden"};let sections$i={};class PickupAvailability{constructor(section){this.container=section.container,this.drawer=null,this.drawerBody=null,this.buttonDrawerOpen=null,this.buttonDrawerClose=null,this.body=document.querySelector(selectors$G.body),this.a11y=a11y,this.container.addEventListener("theme:variant:change",event=>this.fetchPickupAvailability(event)),this.closeEvent()}fetchPickupAvailability(event){const container=this.container.querySelector(`[${selectors$G.pickupContainer}]`);if(!container)return;if(event&&!event.detail.variant||event&&event.detail.variant&&!event.detail.variant.available){container.classList.add(classes$t.isHidden);return}const variantID=event&&event.detail.variant?event.detail.variant.id:container.getAttribute(selectors$G.pickupContainer);this.drawer=this.body.querySelector(selectors$G.drawer),this.drawer&&this.body.removeChild(this.drawer),variantID&&fetch(`${window.theme.routes.root}variants/${variantID}/?section_id=api-pickup-availability`).then(this.handleErrors).then(response=>response.text()).then(text=>{const pickupAvailabilityHTML=new DOMParser().parseFromString(text,"text/html").querySelector(selectors$G.shopifySection).innerHTML;if(container.innerHTML=pickupAvailabilityHTML,this.drawer=this.container.querySelector(selectors$G.drawer),!this.drawer){container.classList.add(classes$t.isHidden);return}this.clone=this.drawer.cloneNode(!0),this.body.appendChild(this.clone),container.classList.remove(classes$t.isHidden),container.removeChild(this.drawer),this.drawer=this.body.querySelector(selectors$G.drawer),this.drawerBody=this.body.querySelector(selectors$G.drawerBody),this.buttonDrawerOpen=this.body.querySelector(selectors$G.drawerOpen),this.buttonDrawerClose=this.body.querySelectorAll(selectors$G.drawerClose),this.buttonDrawerOpen&&this.buttonDrawerOpen.addEventListener("click",()=>{this.openDrawer(),window.accessibility.lastElement=this.buttonDrawerOpen}),this.buttonDrawerClose.length&&this.buttonDrawerClose.forEach(element=>{element.addEventListener("click",()=>this.closeDrawer())}),this.drawer.addEventListener("keyup",evt=>{evt.which===window.theme.keyboardKeys.ESCAPE&&this.closeDrawer()})}).catch(e=>{console.error(e)})}openDrawer(){this.drawer&&(this.drawer.classList.add(classes$t.isOpen),this.drawer.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.drawerBody})),setTimeout(()=>{const elementToFocus=this.drawer.querySelector(selectors$G.drawerClose);this.a11y.removeTrapFocus(),this.a11y.trapFocus(this.drawer,{elementToFocus})},200))}closeDrawer(){this.drawer&&(this.drawer.classList.remove(classes$t.isOpen),this.drawer.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:this.drawerBody})),this.a11y.removeTrapFocus(),window.accessibility.lastElement&&setTimeout(()=>{window.accessibility.lastElement.focus()},200))}closeEvent(){document.addEventListener("click",event=>{const clickedElement=event.target;!clickedElement.matches(selectors$G.drawerOpen)&&!clickedElement.closest(selectors$G.drawer)&&this.closeDrawer()})}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}}const pickupAvailability={onLoad(){sections$i[this.id]=new PickupAvailability(this)}},selectors$H={form:"[data-product-form]",optionPosition:"data-option-position",optionInput:'[name^="options"], [data-popout-option]',selectOptionValue:"data-value",popout:"[data-popout]"},classes$u={soldOut:"sold-out",unavailable:"unavailable"};class SelloutVariants{constructor(section,productJSON){this.container=section,this.productJSON=productJSON,this.formSelector=this.container.querySelector(selectors$H.form),this.form=this.formSelector&&this.formSelector.tagName=="FORM"?this.formSelector:this.formSelector.querySelector("form"),this.formData=new FormData(this.form),this.optionElements=this.container.querySelectorAll(selectors$H.optionInput),this.productJSON&&this.form&&this.init()}init(){this.update()}
11update(){this.getCurrentState(),this.optionElements.forEach(el=>{const parent=el.closest(`[${selectors$H.optionPosition}]`);if(!parent)return;const val=el.value||el.getAttribute(selectors$H.selectOptionValue),positionString=parent.getAttribute(selectors$H.optionPosition),position=parseInt(positionString,10)-1,selectPopout=el.closest(selectors$H.popout);let newVals=[...this.selections];newVals[position]=val;const found=this.productJSON.variants.find(element=>{let perfectMatch=!0;for(let index=0;index<newVals.length;index++)element.options[index]!==newVals[index]&&(perfectMatch=!1);return perfectMatch});el.classList.remove(classes$u.soldOut,classes$u.unavailable),selectPopout&&selectPopout.classList.remove(classes$u.soldOut,classes$u.unavailable),typeof found>"u"?(el.classList.add(classes$u.unavailable),selectPopout&&selectPopout.classList.add(classes$u.unavailable)):found&&found.available===!1&&(el.classList.add(classes$u.soldOut),selectPopout&&selectPopout.classList.add(classes$u.soldOut))})}getCurrentState(){this.formData=new FormData(this.form),this.selections=[];for(var value of this.formData.entries())value[0].includes("options[")&&this.selections.push(value[1])}}const selectors$I={product:"[data-product]",productForm:"[data-product-form]",addToCart:"[data-add-to-cart]:not([data-upsell-btn])",addToCartText:"[data-add-to-cart-text]",comparePrice:"[data-compare-price]",comparePriceText:"[data-compare-text]",formWrapper:"[data-form-wrapper]",originalSelectorId:"[data-product-select]",priceWrapper:"[data-price-wrapper]",productSlideshow:"[data-product-slideshow]",productImage:"[data-product-image]",productJson:"[data-product-json]",productPrice:"[data-product-price]",unitPrice:"[data-product-unit-price]",unitBase:"[data-product-base]",unitWrapper:"[data-product-unit]",isPreOrder:"[data-product-preorder]",sliderEnabled:"flickity-enabled",productSlide:".product__slide",dataTallLayout:"data-tall-layout",dataEnableHistoryState:"data-enable-history-state",subPrices:"[data-subscription-watch-price]",subSelectors:"[data-subscription-selectors]",subsToggle:"[data-toggles-group]",subsChild:"data-group-toggle",subDescription:"[data-plan-description]",priceOffWrap:"[data-price-off]",priceOffType:"[data-price-off-type]",priceOffAmount:"[data-price-off-amount]",dataImageId:"data-image-id",idInput:'[name="id"]',remainingCount:"[data-remaining-count]",remainingMax:"[data-remaining-max]",remainingMaxAttr:"data-remaining-max",remainingWrapper:"[data-remaining-wrapper]",remainingJSON:"[data-product-remaining-json]"},classes$v={hide:"hide",variantSoldOut:"variant--soldout",variantUnavailable:"variant--unavailable",productPriceSale:"product__price--sale",remainingLow:"count-is-low",remainingIn:"count-is-in",remainingOut:"count-is-out",remainingUnavailable:"count-is-unavailable"};class ProductAddForm{constructor(section,modalHolder=null){if(this.section=section,this.container=modalHolder||section.container,this.tallLayout=this.container.getAttribute(selectors$I.dataTallLayout)==="true",this.product=this.container.querySelector(selectors$I.product),this.productForm=this.container.querySelector(selectors$I.productForm),this.sellout=null,this.enable=!1,(this.product||modalHolder!==null)&&(this.enable=!0),!this.enable||!this.productForm)return;if(this.priceOffWrap=this.container.querySelector(selectors$I.priceOffWrap),this.priceOffAmount=this.container.querySelector(selectors$I.priceOffAmount),this.priceOffType=this.container.querySelector(selectors$I.priceOffType),this.planDecription=this.container.querySelector(selectors$I.subDescription),this.remainingWrapper=this.container.querySelector(selectors$I.remainingWrapper),this.remainingWrapper){const remainingMaxWrap=this.container.querySelector(selectors$I.remainingMax);if(!remainingMaxWrap)return;this.remainingMaxInt=parseInt(remainingMaxWrap.getAttribute(selectors$I.remainingMaxAttr),10),this.remainingCount=this.container.querySelector(selectors$I.remainingCount),this.remainingJSONWrapper=this.container.querySelector(selectors$I.remainingJSON),this.remainingJSON=null,this.remainingJSONWrapper&&this.remainingJSONWrapper.innerHTML!==""?this.remainingJSON=JSON.parse(this.remainingJSONWrapper.innerHTML):console.warn("Missing product quantity JSON")}this.enableHistoryState=this.container.getAttribute(selectors$I.dataEnableHistoryState)==="true",this.hasUnitPricing=this.container.querySelector(selectors$I.unitWrapper),this.subSelectors=this.container.querySelector(selectors$I.subSelectors),this.subPrices=this.container.querySelector(selectors$I.subPrices),this.isPreOrder=this.container.querySelector(selectors$I.isPreOrder),new QuantityCounter(this.container).init(),this.init()}init(){let productJSON=null;const productElemJSON=this.container.querySelector(selectors$I.productJson);productElemJSON&&(productJSON=productElemJSON.innerHTML),productJSON?(this.productJSON=JSON.parse(productJSON),this.linkForm(),this.sellout=new SelloutVariants(this.container,this.productJSON)):console.error("Missing product JSON")}destroy(){this.productForm.destroy()}linkForm(){this.productForm=new ProductForm(this.productForm,this.productJSON,{onOptionChange:this.onOptionChange.bind(this),onPlanChange:this.onPlanChange.bind(this)}),this.pushState(this.productForm.getFormState()),this.subsToggleListeners()}onOptionChange(evt){this.pushState(evt.dataset),this.updateProductImage(evt)}onPlanChange(evt){this.subPrices&&this.pushState(evt.dataset)}pushState(formState){this.productState=this.setProductState(formState),this.updateAddToCartState(formState),this.updateProductPrices(formState),this.updateSaleText(formState),this.updateSubscriptionText(formState),this.updateRemaining(formState),this.fireHookEvent(formState),this.sellout?.update(formState),this.enableHistoryState&&this.updateHistoryState(formState)}updateAddToCartState(formState){const variant=formState.variant;let addText=theme.strings.addToCart;
11const priceWrapper=this.container.querySelectorAll(selectors$I.priceWrapper),addToCart=this.container.querySelectorAll(selectors$I.addToCart),addToCartText=this.container.querySelectorAll(selectors$I.addToCartText),formWrapper=this.container.querySelectorAll(selectors$I.formWrapper);this.isPreOrder&&(addText=theme.strings.preOrder),priceWrapper.length&&variant&&priceWrapper.forEach(element=>{element.classList.remove(classes$v.hide)}),addToCart.length&&addToCart.forEach(element=>{variant&&variant.available?element.disabled=!1:element.disabled=!0}),addToCartText.length&&addToCartText.forEach(element=>{variant?variant.available?element.innerHTML=addText:element.innerHTML=theme.strings.soldOut:element.innerHTML=theme.strings.unavailable}),formWrapper.length&&formWrapper.forEach(element=>{if(variant){variant.available?element.classList.remove(classes$v.variantSoldOut,classes$v.variantUnavailable):(element.classList.add(classes$v.variantSoldOut),element.classList.remove(classes$v.variantUnavailable));const formSelect=element.querySelector(selectors$I.originalSelectorId);formSelect&&(formSelect.value=variant.id)}else element.classList.add(classes$v.variantUnavailable),element.classList.remove(classes$v.variantSoldOut)})}updateHistoryState(formState){const variant=formState.variant,plan=formState.plan,location2=window.location.href;if(variant&&location2.includes("/product")){const url=new window.URL(location2),params=url.searchParams;params.set("variant",variant.id),plan&&plan.detail&&plan.detail.id&&this.productState.hasPlan?params.set("selling_plan",plan.detail.id):params.delete("selling_plan"),url.search=params.toString();const urlString=url.toString();window.history.replaceState({path:urlString},"",urlString)}}updateRemaining(formState){const variant=formState.variant;if(variant&&this.remainingWrapper&&this.remainingJSON&&this.remainingCount){const newQuantity=this.remainingJSON[variant.id];newQuantity&&newQuantity<=this.remainingMaxInt&&newQuantity>0?(this.remainingWrapper.classList.remove(classes$v.remainingIn,classes$v.remainingOut,classes$v.remainingUnavailable),this.remainingWrapper.classList.add(classes$v.remainingLow),this.remainingCount.innerHTML=newQuantity):this.productState.soldOut?(this.remainingWrapper.classList.remove(classes$v.remainingLow,classes$v.remainingIn,classes$v.remainingUnavailable),this.remainingWrapper.classList.add(classes$v.remainingOut)):this.productState.available&&(this.remainingWrapper.classList.remove(classes$v.remainingLow,classes$v.remainingOut,classes$v.remainingUnavailable),this.remainingWrapper.classList.add(classes$v.remainingIn))}else this.remainingWrapper&&(this.remainingWrapper.classList.remove(classes$v.remainingIn,classes$v.remainingOut,classes$v.remainingLow),this.remainingWrapper.classList.add(classes$v.remainingUnavailable))}getBaseUnit(variant){return variant.unit_price_measurement.reference_value===1?variant.unit_price_measurement.reference_unit:variant.unit_price_measurement.reference_value+variant.unit_price_measurement.reference_unit}subsToggleListeners(){this.container.querySelectorAll(selectors$I.subsToggle).forEach(toggle=>{toggle.addEventListener("change",function(e){const val=e.target.value.toString(),selected=this.container.querySelector(`[${selectors$I.subsChild}="${val}"]`),groups=this.container.querySelectorAll(`[${selectors$I.subsChild}]`);if(selected){selected.classList.remove(classes$v.hide);const first=selected.querySelector('[name="selling_plan"]');first.checked=!0,first.dispatchEvent(new Event("change"))}groups.forEach(group=>{group!==selected&&(group.classList.add(classes$v.hide),group.querySelectorAll('[name="selling_plan"]').forEach(plan=>{plan.checked=!1,plan.dispatchEvent(new Event("change"))}))})}.bind(this))})}updateSaleText(formState){this.productState.planSale?this.updateSaleTextSubscription(formState):this.productState.onSale?this.updateSaleTextStandard(formState):this.priceOffWrap&&this.priceOffWrap.classList.add(classes$v.hide)}updateSaleTextStandard(formState){this.priceOffType&&(this.priceOffType.innerHTML=window.theme.strings.sale||"sale");const variant=formState.variant,discountFloat=(variant.compare_at_price-variant.price)/variant.compare_at_price,discountInt=Math.floor(discountFloat*100);this.priceOffAmount.innerHTML=`${discountInt}%`,this.priceOffWrap.classList.remove(classes$v.hide)}updateSubscriptionText(formState){formState.plan&&this.planDecription?(this.planDecription.innerHTML=formState.plan.detail.description,this.planDecription.classList.remove(classes$v.hide)):this.planDecription&&this.planDecription.classList.add(classes$v.hide)}updateSaleTextSubscription(formState){this.priceOffType&&(this.priceOffType.innerHTML=window.theme.strings.subscription||"subscripton");const adjustment=formState.plan.detail.price_adjustments[0],discount=adjustment.value;
11adjustment&&adjustment.value_type==="percentage"?this.priceOffAmount.innerHTML=`${discount}%`:this.priceOffAmount.innerHTML=themeCurrency.formatMoney(discount,theme.moneyFormat),this.priceOffWrap.classList.remove(classes$v.hide)}updateProductPrices(formState){const variant=formState.variant,plan=formState.plan;this.container.querySelectorAll(selectors$I.priceWrapper).forEach(wrap2=>{const comparePriceEl=wrap2.querySelector(selectors$I.comparePrice),productPriceEl=wrap2.querySelector(selectors$I.productPrice),comparePriceText=wrap2.querySelector(selectors$I.comparePriceText);let comparePrice="",price="";this.productState.available&&(comparePrice=variant.compare_at_price,price=variant.price),this.productState.hasPlan&&(price=plan.allocation.price),this.productState.planSale&&(comparePrice=plan.allocation.compare_at_price,price=plan.allocation.price),comparePriceEl&&(this.productState.onSale||this.productState.planSale?(comparePriceEl.classList.remove(classes$v.hide),comparePriceText.classList.remove(classes$v.hide),productPriceEl.classList.add(classes$v.productPriceSale)):(comparePriceEl.classList.add(classes$v.hide),comparePriceText.classList.add(classes$v.hide),productPriceEl.classList.remove(classes$v.productPriceSale)),comparePriceEl.innerHTML=themeCurrency.formatMoney(comparePrice,theme.moneyFormat)),productPriceEl.innerHTML=price===0?window.theme.strings.free:themeCurrency.formatMoney(price,theme.moneyFormat)}),this.hasUnitPricing&&this.updateProductUnits(formState)}updateProductUnits(formState){const variant=formState.variant,plan=formState.plan;let unitPrice=null;if(variant&&variant.unit_price&&(unitPrice=variant.unit_price),plan&&plan.allocation&&plan.allocation.unit_price&&(unitPrice=plan.allocation.unit_price),unitPrice){const base=this.getBaseUnit(variant),formattedPrice=themeCurrency.formatMoney(unitPrice,theme.moneyFormat);this.container.querySelector(selectors$I.unitPrice).innerHTML=formattedPrice,this.container.querySelector(selectors$I.unitBase).innerHTML=base,showElement(this.container.querySelector(selectors$I.unitWrapper))}else hideElement(this.container.querySelector(selectors$I.unitWrapper))}fireHookEvent(formState){const variant=formState.variant;this.container.dispatchEvent(new CustomEvent("theme:variant:change",{detail:{variant},bubbles:!0}))}setProductState(dataset){const variant=dataset.variant,plan=dataset.plan,productState={available:!0,soldOut:!1,onSale:!1,showUnitPrice:!1,requiresPlan:!1,hasPlan:!1,planPerDelivery:!1,planSale:!1};return!variant||variant.requires_selling_plan&&!plan?productState.available=!1:(variant.available||(productState.soldOut=!0),variant.compare_at_price>variant.price&&(productState.onSale=!0),variant.unit_price&&(productState.showUnitPrice=!0),this.product&&this.product.requires_selling_plan&&(productState.requiresPlan=!0),plan&&this.subPrices&&(productState.hasPlan=!0,plan.allocation.per_delivery_price!==plan.allocation.price&&(productState.planPerDelivery=!0),variant.price>plan.allocation.price&&(productState.planSale=!0))),productState}updateProductImage(evt){const variant=evt.dataset.variant;if(variant&&variant.featured_media){const newImg=this.container.querySelector(`${selectors$I.productImage}[${selectors$I.dataImageId}="${variant.featured_media.id}"]`),newImageParent=newImg?.closest(selectors$I.productSlide);if(newImageParent){const newImagePos=Array.from(newImageParent.parentElement.children).indexOf(newImageParent),slider2=this.container.querySelector(selectors$I.productSlideshow);if(slider2&&slider2.classList.contains(selectors$I.sliderEnabled)&&FlickityFade.data(slider2).select(newImagePos),!theme.variables.bpSmall&&this.tallLayout){const newImgTop=newImg.getBoundingClientRect().top;if(newImagePos===0&&newImgTop+window.scrollY>window.pageYOffset)return;document.dispatchEvent(new CustomEvent("theme:tooltip:close",{bubbles:!1,detail:{hideTransition:!1}})),scrollTo(newImgTop)}}}}}const productFormSection={onLoad(){this.section=new ProductAddForm(this)}},classes$w={open:"is-open"},selectors$J={upsellHolder:"data-upsell-holder",addButtonWrapper:"[data-add-action-wrapper]",upsellModal:"[data-upsell-modal]",modalContainer:"[data-product-upsell-container]",modalContent:"[data-product-upsell-ajax]",upsellModalTemplate:"[data-upsell-modal-template]",apiContent:"[data-api-content]",media:"[data-media-slide]",cartLineItems:"[data-line-items]",focusable:'button, [href], select, textarea, [tabindex]:not
11([tabindex="-1"])',popoutWrapper:"[data-popout]",swatch:"[data-swatch]"};class UpsellProduct extends HTMLElement{constructor(){if(super(),this.container=this,this.upsellHolder=this.container.querySelector(`[${selectors$J.upsellHolder}]`),this.upsellHolder){if(this.html=document.documentElement,this.isCartItem=!!this.upsellHolder.closest(selectors$J.cartLineItems),this.modalTemplate=this.upsellHolder.querySelector(selectors$J.upsellModalTemplate),this.modal=document.querySelector(selectors$J.upsellModal),this.modalID=this.upsellHolder.getAttribute(selectors$J.upsellHolder),this.triggerButton=this.upsellHolder.querySelector(`[data-popup-${this.modalID}]`),this.handle=this.triggerButton?this.triggerButton.getAttribute(`data-popup-${this.modalID}`):null,this.modalContainer=null,this.modalContent=null,this.modalTemplate&&!this.modal){const modalTemplateInner=this.modalTemplate.innerHTML,htmlObject=document.createElement("div");htmlObject.innerHTML=modalTemplateInner;const modalHtml=htmlObject.querySelector(selectors$J.upsellModal);document.body.appendChild(modalHtml),this.modal=document.querySelector(selectors$J.upsellModal)}this.init()}}init(){this.modalTemplate&&this.triggerButton&&this.triggerButton.addEventListener("click",e=>{e.preventDefault(),this.modal&&this.modalID&&(this.modal.id=this.modalID),this.getUpsellHTML()}),document.addEventListener("theme:product:button-update",e=>{e.detail.response.status||!this.modal.classList.contains(classes$w.open)||MicroModal.close(this.modalID)})}getUpsellHTML(){this.modalContent?this.modalCreate():window.fetch(`/products/${this.handle}?section_id=api-product-upsell`).then(this.handleErrors).then(response=>response.text()).then(response=>{const fresh=document.createElement("div");fresh.innerHTML=response,this.modalContent=document.querySelector(selectors$J.modalContent),this.modalContent.innerHTML=fresh.querySelector(selectors$J.apiContent).innerHTML,this.reInitFormFunctionalities(),this.modalCreate()})}reInitFormFunctionalities(){new ProductAddForm(null,this.modal),this.modalContent.querySelectorAll(selectors$J.swatch).forEach(el=>{new Swatch(el)}),this.modalContent.querySelectorAll(selectors$J.popoutWrapper).forEach(wrapper=>{new Popout(wrapper)})}modalCreate(){this.modalContainer=document.querySelector(selectors$J.modalContainer),MicroModal.show(this.modalID,{onShow:(modal,el,event)=>{const mediaObject={container:modal,id:this.modalID};theme.mediaInstances[this.id]=new Media(mediaObject),theme.mediaInstances[this.id].init();const firstFocus=modal.querySelector(selectors$J.focusable);trapFocus(modal,{elementToFocus:firstFocus}),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.modalContainer}))},onClose:(modal,el,event)=>{modal.querySelectorAll(selectors$J.media).forEach(media=>{media.dispatchEvent(new CustomEvent("pause"))}),removeTrapFocus(),el.focus(),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}})}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}}const selectors$K={slideshow:"[data-product-slideshow]",dataStickyEnabled:"data-sticky-enabled",productPage:".product__page",formWrapper:"[data-form-wrapper]",headerSticky:"[data-header-sticky]",headerHeight:"[data-header-height]"},classes$x={sticky:"is-sticky"};window.theme.variables={productPageSticky:!1};const sections$j={};class ProductSticky{constructor(section){this.section=section,this.container=section.container,this.stickyEnabled=this.container.getAttribute(selectors$K.dataStickyEnabled)==="true",this.formWrapper=this.container.querySelector(selectors$K.formWrapper),this.stickyScrollTop=0,this.scrollLastPosition=0,this.stickyDefaultTop=0,this.currentPoint=0,this.defaultTopBottomSpacings=30,this.scrollTop=window.scrollY,this.scrollDirectionDown=!0,this.requestAnimationSticky=null,this.stickyFormLoad=!0,this.stickyFormLastHeight=null,this.onChangeCounter=0,this.scrollEvent=e=>this.scrollEvents(e),this.resizeEvent=e=>this.resizeEvents(e),this.init()}init(){this.stickyEnabled&&(this.stickyScrollCheck(),document.addEventListener("theme:resize",this.resizeEvent)),theme.variables.productPageSticky&&(this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition()),this.formWrapper.addEventListener("theme:form:sticky",e=>{this.removeAnimationFrame(),this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition(e))}),document.addEventListener("theme:scroll",this.scrollEvent))}scrollEvents(e){this.scrollTop=e.detail.position,this.scrollDirectionDown=e.detail.down,this.requestAnimationSticky||(this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition()))}resizeEvents(e){this.stickyScrollCheck()}stickyScrollCheck(){const isDesktop=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>=window.theme.sizes.small,targetFormWrapper=this.container.querySelector(`${selectors$K.productPage} ${selectors$K.formWrapper}`);if(targetFormWrapper)if(isDesktop){const form=this.container.querySelector(selectors$K.formWrapper),slideshow=this.container.querySelector(selectors$K.slideshow);if(!form||!slideshow)return;
11const productCopyHeight=form.offsetHeight,productImagesHeight=slideshow.offsetHeight;productCopyHeight<productImagesHeight?(theme.variables.productPageSticky=!0,targetFormWrapper.classList.add(classes$x.sticky)):(theme.variables.productPageSticky=!1,targetFormWrapper.classList.remove(classes$x.sticky))}else theme.variables.productPageSticky=!1,targetFormWrapper.classList.remove(classes$x.sticky)}calculateStickyPosition(e=null){const isAccordion=!!(!!(e&&e.detail)&&e.detail.element&&e.detail.element==="accordion"),formWrapperHeight=this.formWrapper.offsetHeight,heightDifference=window.innerHeight-formWrapperHeight-this.defaultTopBottomSpacings,scrollDifference=Math.abs(this.scrollTop-this.scrollLastPosition);this.scrollDirectionDown?this.stickyScrollTop-=scrollDifference:this.stickyScrollTop+=scrollDifference,this.stickyFormLoad&&(document.querySelector(selectors$K.headerSticky)&&document.querySelector(selectors$K.headerHeight)?this.stickyDefaultTop=parseInt(document.querySelector(selectors$K.headerHeight).getBoundingClientRect().height):this.stickyDefaultTop=this.defaultTopBottomSpacings,this.stickyScrollTop=this.stickyDefaultTop),this.stickyScrollTop=Math.min(Math.max(this.stickyScrollTop,heightDifference),this.stickyDefaultTop);const differencePoint=this.stickyScrollTop-this.currentPoint;this.currentPoint=this.stickyFormLoad?this.stickyScrollTop:this.currentPoint+differencePoint*.5,this.formWrapper.style.setProperty("--sticky-top",`${this.currentPoint}px`),this.scrollLastPosition=this.scrollTop,this.stickyFormLoad=!1,isAccordion&&this.onChangeCounter<=10||isAccordion&&this.stickyFormLastHeight!==formWrapperHeight||this.stickyScrollTop!==this.currentPoint&&this.requestAnimationSticky?(isAccordion&&(this.onChangeCounter+=1),isAccordion&&this.stickyFormLastHeight!==formWrapperHeight&&(this.onChangeCounter=11),this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition(e))):this.requestAnimationSticky&&this.removeAnimationFrame(),this.stickyFormLastHeight=formWrapperHeight}removeAnimationFrame(){this.requestAnimationSticky&&(cancelAnimationFrame(this.requestAnimationSticky),this.requestAnimationSticky=null,this.onChangeCounter=0)}onUnload(){this.stickyEnabled&&document.removeEventListener("theme:resize",this.resizeEvent),theme.variables.productPageSticky&&document.removeEventListener("theme:scroll",this.scrollEvent)}}const productStickySection={onLoad(){sections$j[this.id]=new ProductSticky(this)},onUnload(){sections$j[this.id].onUnload()}},selectors$L={elements:{accordionHolder:"[data-accordion-holder]",accordion:"[data-accordion]",accordionToggle:"[data-accordion-toggle]",accordionBody:"[data-accordion-body]",accordionExpandValue:"data-accordion-expand",accordionBlockValue:"data-block-id"},classes:{open:"is-open"}},sections$k={};class GlobalAccordions{constructor(el){this.container=el.container,this.accordion=this.container.querySelector(selectors$L.elements.accordion),this.accordionToggles=this.container.querySelectorAll(selectors$L.elements.accordionToggle),this.accordionTogglesLength=this.accordionToggles.length,this.accordionBody=this.container.querySelector(selectors$L.elements.accordionBody),this.accordionTogglesLength&&this.accordionBody&&this.accordionEvents()}accordionEvents(){this.accordionToggles.forEach(element=>{element.addEventListener("click",throttle(event=>{event.preventDefault();const targetAccordionBody=element.parentElement.querySelector(selectors$L.elements.accordionBody);targetAccordionBody&&this.onAccordionToggle(element,targetAccordionBody)},800))}),this.accordion.getAttribute(selectors$L.elements.accordionExpandValue)==="true"&&(this.accordionToggles[0].classList.add(selectors$L.classes.open),showElement(this.accordionToggles[0].parentElement.querySelector(selectors$L.elements.accordionBody)))}closeOtherAccordions(element,slide=!0){let otherElements=[...this.accordionToggles];const holder=this.container.closest(selectors$L.elements.accordionHolder);holder&&(otherElements=[...holder.querySelectorAll(selectors$L.elements.accordionToggle)]),otherElements.filter(otherElement=>{const otherElementAccordionBody=otherElement.parentElement.querySelector(selectors$L.elements.accordionBody);otherElement!==element&&otherElement.classList.contains(selectors$L.classes.open)&&otherElementAccordionBody&&this.onAccordionClose(otherElement,otherElementAccordionBody,slide)})}onAccordionOpen(element,body,slide=!0){element.classList.add(selectors$L.classes.open),slideDown(body),this.closeOtherAccordions(element,slide)}onAccordionClose(element,body,slide=!0){element.classList.remove(selectors$L.classes.open),slide?slideUp(body):hideElement(body)}onAccordionToggle(element,body){element.classList.toggle(selectors$L.classes.open),slideToggle(body),this.closeOtherAccordions(element),element.dispatchEvent(new CustomEvent("theme:form:sticky",{bubbles:!0,detail:{element:"accordion"}}))}onBlockToggle(evt,blockSelect=!0){const targetAccordionToggle=this.container.querySelector(`${selectors$L.elements.accordionToggle}[${selectors$L.elements.accordionBlockValue}="${evt.detail.blockId}"]`);if(!targetAccordionToggle)return;const targetAccordionBody=targetAccordionToggle.parentElement.querySelector(selectors$L.elements.accordionBody);targetAccordionBody&&(blockSelect?this.onAccordionOpen(targetAccordionToggle,targetAccordionBody,!1):this.onAccordionClose(targetAccordionToggle,targetAccordionBody))}onSelectToggle(sectionSelect=!0){this.accordionBody&&this.accordionTogglesLength&&this.accordionTogglesLength<2&&(sectionSelect?this.onAccordionOpen(this.accordionToggles[0],this.accordionBody,!1):this.onAccordionClose(this.accordionToggles[0],this.accordionBody))}onSelect(){this.onSelectToggle(!0)}onDeselect(){this.onSelectToggle(!1)}onBlockSelect(evt){this.onBlockToggle(evt,!0)}onBlockDeselect(evt){this.onBlockToggle(evt,!1)}}const accordions={onLoad(){sections$k[this.id]=new GlobalAccordions(this)},onSelect(){sections$k[this.id].onSelect()},onDeselect(){sections$k[this.id].onDeselect()},onBlockSelect(e){sections$k[this.id].onBlockSelect(e)},onBlockDeselect(e){sections$k[this.id].onBlockDeselect(e)}},selectors$M={headerSticky:"[data-header-sticky]",headerHeight:"[data-header-height]",scrollToElement:"[data-scroll-to]",scrollToElementValue:"data-scroll-to",scrollToLinks:"[data-scroll-to-links]",scrollSpy:"[data-scroll-spy]",accordionHolder:"[data-accordion-holder]",accordionToggle:"[data-accordion-toggle]",tooltip:"[data-tooltip]",tooltipStopMousenterValue:"data-tooltip-stop-mouseenter"},classes$y={open:"is-open",selected:"is-selected"},sections$l={};class ScrollToElement{constructor(section){this.section=section,this.container=section.container,this.scrollToButtons=this.container.querySelectorAll(selectors$M.scrollToElement),this.scrollSpyElement=this.container.querySelector(selectors$M.scrollSpy),this.scrollToButtons.length&&this.init(),this.scrollSpyElement&&this.scrollSpy()}init(){this.scrollToButtons.forEach(element=>{element.addEventListener("click",e=>{e.preventDefault();const target=document.querySelector(element.getAttribute(selectors$M.scrollToElementValue));if(!target)return;const accordionToggle=target.querySelector(selectors$M.accordionToggle);let timeoutFlag=!1;const scrollToLinks=element.closest(selectors$M.scrollToLinks);if(scrollToLinks&&!element.closest(selectors$M.scrollSpy)){const selectedItems=scrollToLinks.querySelectorAll(`.${classes$y.selected}`);
11selectedItems.length&&selectedItems.forEach(selectedItem=>{selectedItem.classList.remove(classes$y.selected)}),element.classList.add(classes$y.selected)}if(accordionToggle){const accordionHolder=accordionToggle.closest(selectors$M.accordionHolder);!accordionToggle.classList.contains(classes$y.open)&&accordionHolder&&accordionHolder.querySelector(`${selectors$M.accordionToggle}.${classes$y.open}`)&&(timeoutFlag=!0),accordionToggle.classList.contains(classes$y.open)||accordionToggle.dispatchEvent(new Event("click"))}timeoutFlag?setTimeout(()=>this.scrollToElement(target),500):this.scrollToElement(target)})})}scrollToElement(element){scrollTo(element.getBoundingClientRect().top);const tooltips=document.querySelectorAll(`${selectors$M.tooltip}:not([${selectors$M.tooltipStopMousenterValue}])`);tooltips.length&&tooltips.forEach(tooltip=>{tooltip.setAttribute(selectors$M.tooltipStopMousenterValue,""),setTimeout(()=>{tooltip.removeAttribute(selectors$M.tooltipStopMousenterValue)},1e3)})}scrollSpy(){const buttons=this.scrollSpyElement.querySelectorAll(selectors$M.scrollToElement);if(!buttons)return;const headerHeight=document.querySelector(selectors$M.headerSticky)&&document.querySelector(selectors$M.headerHeight)?document.querySelector(selectors$M.headerHeight).getBoundingClientRect().height:0;window.addEventListener("scroll",()=>{const scrollPos=Math.ceil(document.documentElement.scrollTop||document.body.scrollTop);buttons.forEach(element=>{const target=document.querySelector(element.getAttribute(selectors$M.scrollToElementValue));target.offsetTop-headerHeight<=scrollPos&&(this.scrollSpyElement.querySelector(`.${classes$y.selected}`).classList.remove(classes$y.selected),this.scrollSpyElement.querySelector(`[${selectors$M.scrollToElementValue}="#${target.id}"]`).classList.add(classes$y.selected))})})}}const scrollToElement={onLoad(){sections$l[this.id]=new ScrollToElement(this)}};window.theme.variables={bpSmall:!1};const selectors$N={addToCart:"[data-add-to-cart]",priceWrapper:"[data-price-wrapper]",productImage:"[data-product-image]",productJson:"[data-product-json]",form:"[data-product-form]",thumbs:"[data-product-thumbs]",dataSectionId:"data-section-id",dataTallLayout:"data-tall-layout",dataCartBar:"data-cart-bar",dataProductShare:"[data-product-share]",dataProductShareValue:"data-product-share",dataProductShareTitleValue:"data-product-share-title",cartBar:"#cart-bar",productSubmitAdd:".product__submit__add",cartBarAdd:"data-add-to-cart-bar",cartBarScroll:"data-cart-bar-scroll",templateProduct:"#template-product",siteFooterWrapper:".site-footer-wrapper",toggleTruncateHolder:"[data-truncated-holder]",toggleTruncateButton:"[data-truncated-button]",toggleTruncateContent:"[data-truncated-content]",toggleTruncateContentAttr:"data-truncated-content",upsellButton:"[data-upsell-btn]",upsellButtonText:"[data-upsell-btn-text]",dataModalButton:"data-product-popup",modalScrollContainer:"[data-tabs-holder]",formWrapper:"[data-form-wrapper]"},classes$z={expanded:"is-expanded",visible:"is-visible",loading:"is-loading",siteFooterPush:"site-footer--push",hasPopup:"has-popup"},sections$m={};class Product{constructor(section){this.section=section,this.container=section.container,this.id=this.container.getAttribute(selectors$N.dataSectionId),this.tallLayout=this.container.getAttribute(selectors$N.dataTallLayout)==="true",this.thumbs=this.container.querySelector(selectors$N.thumbs),this.shareButton=this.container.querySelector(selectors$N.dataProductShare),this.upsellButton=this.container.querySelector(selectors$N.upsellButton),this.truncateElementHolder=this.container.querySelector(selectors$N.toggleTruncateHolder),this.truncateElement=this.container.querySelector(selectors$N.toggleTruncateContent),this.modalButton=this.container.querySelectorAll(`[${selectors$N.dataModalButton}]`),this.formWrapper=this.container.querySelector(selectors$N.formWrapper),this.cartBarExist=this.container.getAttribute(selectors$N.dataCartBar)==="true",this.scrollEvent=e=>this.scrollEvents(e),this.resizeEvent=e=>this.resizeEvents(e),this.unlockTimer=0,this.accessibility=a11y,Shopify.Products.recordRecentlyViewed(),this.shareToggle(),this.truncateElementHolder&&this.truncateElement&&setTimeout(()=>this.truncateText(),50),this.upsellButton&&this.calcUpsellButtonDemensions(),(this.upsellButton||this.truncateElementHolder&&this.truncateElement)&&document.addEventListener("theme:resize",this.resizeEvent);const productJson=this.container.querySelector(selectors$N.productJson);if(productJson&&!productJson.innerHTML||!productJson){new QuantityCounter(this.container).init();return}this.form=this.container.querySelector(selectors$N.form),this.init(),this.cartBarExist&&this.initCartBar(),this.cartBarExist&&document.addEventListener("theme:scroll",this.scrollEvent),this.modalButton.length>0&&this.productPopup()}init(){theme.mediaInstances[this.id]=new Media(this.section),theme.mediaInstances[this.id].init()}scrollEvents(e){this.cartBarExist&&this.cartBarScroll()}resizeEvents(e){this.truncateElementHolder&&this.truncateElement&&this.truncateText(),this.upsellButton&&this.calcUpsellButtonDemensions()}productPopup(){this.modalButton.forEach(button=>{button.addEventListener("click",e=>{e.preventDefault();const modal=document.querySelector(`#${button.getAttribute(selectors$N.dataModalButton)}
11`),modalScrollContainer=modal.querySelector(selectors$N.modalScrollContainer);window.getComputedStyle(modal).display!=="none"&&(fadeOut(modal),this.formWrapper.classList.remove(classes$z.hasPopup),this.accessibility.removeTrapFocus(),this.unlockTimer&&clearTimeout(this.unlockTimer),this.unlockTimer=setTimeout(()=>{document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))},300)),window.getComputedStyle(modal).display==="none"&&(fadeIn(modal),this.formWrapper.classList.add(classes$z.hasPopup),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:modalScrollContainer})),this.accessibility.trapFocus(modal))})})}calcUpsellButtonDemensions(){const upsellButtonText=this.upsellButton.querySelector(selectors$N.upsellButtonText);upsellButtonText&&this.upsellButton.style.setProperty("--btn-text-width",`${upsellButtonText.clientWidth}px`)}truncateText(){if(this.truncateElementHolder.classList.contains(classes$z.visible))return;const styles2=this.truncateElement.querySelectorAll("style");styles2.length&&styles2.forEach(style=>{this.truncateElementHolder.prepend(style)});const truncateElementCloned=this.truncateElement.cloneNode(!0),truncateElementClass=this.truncateElement.getAttribute(selectors$N.toggleTruncateContentAttr),truncateNextElement=this.truncateElement.nextElementSibling;truncateNextElement&&truncateNextElement.remove(),this.truncateElement.parentElement.append(truncateElementCloned);const truncateAppendedElement=this.truncateElement.nextElementSibling;truncateAppendedElement.classList.add(truncateElementClass),truncateAppendedElement.removeAttribute(selectors$N.toggleTruncateContentAttr),showElement(truncateAppendedElement),ellipsis(truncateAppendedElement,5,{replaceStr:"",delimiter:" "}),hideElement(truncateAppendedElement),this.truncateElement.innerHTML!==truncateAppendedElement.innerHTML?this.truncateElementHolder.classList.add(classes$z.expanded):(truncateAppendedElement.remove(),this.truncateElementHolder.classList.remove(classes$z.expanded)),this.toggleTruncatedContent(this.truncateElementHolder)}toggleTruncatedContent(holder){const toggleButton=holder.querySelector(selectors$N.toggleTruncateButton);toggleButton&&toggleButton.addEventListener("click",e=>{e.preventDefault(),holder.classList.remove(classes$z.expanded),holder.classList.add(classes$z.visible)})}shareToggle(){this.shareButton&&this.shareButton.addEventListener("click",function(){const windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;if(navigator.share&&windowWidth<=1024){const shareTitle=this.hasAttribute(selectors$N.dataProductShareTitleValue)?this.getAttribute(selectors$N.dataProductShareTitleValue):window.location.hostname,shareUrl=this.hasAttribute(selectors$N.dataProductShareValue)?this.getAttribute(selectors$N.dataProductShareValue):window.location.href;navigator.share({title:shareTitle,url:shareUrl}).then(()=>{console.log("Thanks for sharing!")}).catch(console.error)}else this.parentElement.classList.toggle(classes$z.expanded)})}initCartBar(){const cartBar=document.querySelector(selectors$N.cartBar),cartBarBtn=cartBar.querySelector(selectors$N.productSubmitAdd);cartBarBtn&&(cartBarBtn.addEventListener("click",e=>{e.preventDefault(),e.target.hasAttribute(selectors$N.cartBarAdd)?(theme.settings.cartDrawerEnabled&&(e.target.classList.add(classes$z.loading),e.target.setAttribute("disabled","disabled")),this.form.querySelector(selectors$N.addToCart).dispatchEvent(new Event("click",{bubbles:!0}))):e.target.hasAttribute(selectors$N.cartBarScroll)&&this.scrollToTop()}),cartBarBtn.hasAttribute(selectors$N.cartBarAdd)&&document.addEventListener("theme:product:button-error",()=>this.scrollToTop()),theme.settings.cartDrawerEnabled&&document.addEventListener("theme:product:button-update",()=>{cartBarBtn&&cartBarBtn.classList.contains(classes$z.loading)&&(cartBarBtn.classList.remove(classes$z.loading),cartBarBtn.removeAttribute("disabled"))})),this.cartBar=cartBar}scrollToTop(){const scrollTarget=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>=window.theme.sizes.small?this.container:this.form;scrollTo(scrollTarget.getBoundingClientRect().top)}cartBarScroll(){const scrolled=window.pageYOffset,element=theme.variables.productPageSticky&&this.formWrapper?this.formWrapper:this.form;if(element&&this.cartBar){const siteFooter=document.querySelector(selectors$N.siteFooterWrapper),formOffset=element.offsetTop,formHeight=element.offsetHeight,checkPosition=scrolled>formOffset+formHeight;this.cartBar.classList.toggle(classes$z.visible,checkPosition),siteFooter&&(siteFooter.classList.toggle(classes$z.siteFooterPush,checkPosition),siteFooter.style.marginBottom=siteFooter.classList.contains(classe
11s$z.siteFooterPush)?`${this.cartBar.offsetHeight}px`:"0")}}onUnload(){(this.upsellButton||this.truncateElementHolder&&this.truncateElement)&&document.removeEventListener("theme:resize",this.resizeEvent),this.cartBarExist&&document.removeEventListener("theme:scroll",this.scrollEvent)}}const productSection={onLoad(){sections$m[this.id]=new Product(this)},onUnload(e){sections$m[this.id].onUnload(e)}};register("product",[productSection,pickupAvailability,productFormSection,swatchSection,tooltipSection,popoutSection,tabs,accordions,copyClipboard,scrollToElement,productStickySection]),customElements.get("upsell-product")||customElements.define("upsell-product",UpsellProduct);const selectors$O={dataRelatedSectionElem:"[data-related-section]",dataRelatedProduct:"[data-product-grid-item]",dataProductId:"data-product-id",dataLimit:"data-limit",dataMinimum:"data-minimum",recentlyViewed:"[data-recent-wrapper]",recentlyViewedWrapper:"[data-recently-viewed-wrapper]",recentlyProduct:"#recently-viewed-products",dataProductItem:".product-item",slider:"[data-slider]"},classes$A={isHidden:"is-hidden"};class Related{constructor(section){this.section=section,this.sectionId=section.id,this.container=section.container,this.init(),this.recent()}init(){const relatedSection2=this.container.querySelector(selectors$O.dataRelatedSectionElem);if(!relatedSection2)return;const self=this,productId=relatedSection2.getAttribute(selectors$O.dataProductId),limit=relatedSection2.getAttribute(selectors$O.dataLimit),requestUrl=`${window.theme.routes.product_recommendations_url}?section_id=related&limit=${limit}&product_id=${productId}`;fetch(requestUrl).then(function(response){return response.text()}).then(function(data2){const createdElement=document.createElement("div");createdElement.innerHTML=data2;const inner=createdElement.querySelector(selectors$O.dataRelatedSectionElem);if(inner.querySelector(selectors$O.dataRelatedProduct)){const innerHtml=inner.innerHTML;hideElement(relatedSection2),relatedSection2.innerHTML=innerHtml,slideDown(relatedSection2);const relatedProducts=relatedSection2.querySelectorAll(selectors$O.dataRelatedProduct);relatedProducts.forEach(item=>{new QuickAddProduct(item)}),makeGridSwatches(self.section),relatedProducts.length>4&&relatedSection2.querySelector(selectors$O.slider)&&new Slider(relatedSection2)}else relatedSection2.dispatchEvent(new CustomEvent("theme:tab:hide",{bubbles:!0}))}).catch(function(){relatedSection2.dispatchEvent(new CustomEvent("theme:tab:hide",{bubbles:!0}))})}recent(){const recentlyViewed=this.container.querySelector(selectors$O.recentlyViewed),howManyToshow=recentlyViewed?parseInt(recentlyViewed.getAttribute(selectors$O.dataLimit)):4;Shopify.Products.showRecentlyViewed({howManyToShow:howManyToshow,wrapperId:`recently-viewed-products-${this.sectionId}`,section:this.section,onComplete:(wrapper,section)=>{const container=section.container,recentlyViewedHolder=container.querySelector(selectors$O.recentlyViewed),recentlyViewedWrapper=container.querySelector(selectors$O.recentlyViewedWrapper),recentProducts=wrapper.querySelectorAll(selectors$O.dataProductItem),minimumNumberProducts=recentlyViewedHolder.hasAttribute(selectors$O.dataMinimum)?parseInt(recentlyViewedHolder.getAttribute(selectors$O.dataMinimum)):4,checkRecentInRelated=!recentlyViewedWrapper&&recentProducts.length>0,checkRecentOutsideRelated=recentlyViewedWrapper&&recentProducts.length>=minimumNumberProducts;(checkRecentInRelated||checkRecentOutsideRelated)&&(checkRecentOutsideRelated&&recentlyViewedWrapper.classList.remove(classes$A.isHidden),fadeIn(recentlyViewedHolder),recentlyViewedHolder.dispatchEvent(new CustomEvent("theme:tab:check",{bubbles:!0})),recentProducts.forEach(item=>{new QuickAddProduct(item)}),makeGridSwatches(section),recentProducts.length>4&&recentlyViewedHolder.querySelector(selectors$O.slider)&&new Slider(recentlyViewedHolder))}})}}const relatedSection={onLoad(){this.section=new Related(this),this.container.querySelectorAll(selectors$O.dataRelatedProduct).forEach(item=>{new QuickAddProduct(item)})}};register("related",[relatedSection,popoutSection,tabs]),register("reviews",[accordions,slider]);const selectors$P={scrollElement:"[data-block-scroll]",flickityEnabled:"flickity-enabled"},sections$n={};class BlockScroll{constructor(el){this.container=el.container}onBlockSelect(evt){const scrollElement=this.container.querySelector(selectors$P.scrollElement);if(scrollElement&&!scrollElement.classList.contains(selectors$P.flickityEnabled)){const currentElement=evt.srcElement;currentElement&&scrollElement.scrollTo({top:0,left:currentElement.offsetLeft,behavior:"smooth"})}}}const blockScroll={onLoad(){sections$n[this.id]=new BlockScroll(this)},onBlockSelect(e){sections$n[this.id].onBlockSelect(e)}},sections$o={}
11,selectors$Q={sliderLogos:"[data-slider-logos]",sliderText:"[data-slider-text]",slide:"[data-slide]",slideIndex:"[data-slide-index]"},classes$B={isSelected:"is-selected",flickityEnabled:"flickity-enabled"},attributes$8={slideData:"data-slide",slideIndex:"data-slide-index"};class LogoList{constructor(section){this.container=section.container,this.slideshowNav=this.container.querySelector(selectors$Q.sliderLogos),this.slideshowText=this.container.querySelector(selectors$Q.sliderText),this.setSlideshowNavStateOnResize=()=>this.setSlideshowNavState(),this.flkty=null,this.flktyNav=null,this.initSlideshowText(),this.initSlideshowNav()}initSlideshowText(){if(!this.slideshowText)return;this.flkty=new FlickityFade(this.slideshowText,{fade:!0,autoPlay:!1,prevNextButtons:!1,cellAlign:"left",contain:!0,pageDots:!1,wrapAround:!1,selectedAttraction:.2,friction:.6,draggable:!1,accessibility:!1,on:{ready:()=>this.sliderAccessibility(),change:()=>this.sliderAccessibility()}});const textSlides=this.slideshowText.querySelectorAll(selectors$Q.slide);if(textSlides.length){let maxHeight=-1;textSlides.forEach(element=>{const elementHeight=parseFloat(getComputedStyle(element,null).height.replace("px",""));elementHeight>maxHeight&&(maxHeight=elementHeight)}),textSlides.forEach(element=>{const elementHeight=parseFloat(getComputedStyle(element,null).height.replace("px",""));if(elementHeight<maxHeight){const calculateMargin=Math.ceil((maxHeight-elementHeight)/2);element.style.margin=`${calculateMargin}px 0`}})}}sliderAccessibility(){const buttons=this.slideshowText.querySelectorAll(`${selectors$Q.slide} a, ${selectors$Q.slide} button`);buttons.length&&buttons.forEach(button=>{const slide=button.closest(selectors$Q.slide);if(slide){const tabIndex=slide.classList.contains(classes$B.isSelected)?0:-1;button.setAttribute("tabindex",tabIndex)}})}initSlideshowNav(){this.slideshowNav&&(this.logoSlides=this.slideshowNav.querySelectorAll(selectors$Q.slideIndex),this.logoSlides.length&&this.logoSlides.forEach(logoItem=>{logoItem.addEventListener("click",e=>{e.preventDefault();const index=parseInt(logoItem.getAttribute(attributes$8.slideIndex)),hasSlider=this.slideshowNav.classList.contains(classes$B.flickityEnabled);if(this.flkty&&this.flkty.select(index),hasSlider)this.flktyNav.select(index),this.slideshowNav.classList.contains(classes$B.isSelected)||this.flktyNav.playPlayer();else{const selectedSlide=this.slideshowNav.querySelector(`.${classes$B.isSelected}`);selectedSlide&&selectedSlide.classList.remove(classes$B.isSelected),logoItem.classList.add(classes$B.isSelected)}})}),this.setSlideshowNavState(),document.addEventListener("theme:resize",this.setSlideshowNavStateOnResize))}setSlideshowNavState(){const slides=this.slideshowNav.querySelectorAll(selectors$Q.slide),slidesCount=slides.length,slideWidth=200,windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,slidesWidth=slidesCount*slideWidth,sliderInitialized=this.slideshowNav.classList.contains(classes$B.flickityEnabled);if(slidesWidth>windowWidth){if(!sliderInitialized){const selectedSlide=this.slideshowNav.querySelector(`.${classes$B.isSelected}`);selectedSlide&&selectedSlide.classList.remove(classes$B.isSelected),slides[0].classList.add(classes$B.isSelected),this.flktyNav=new Flickity(this.slideshowNav,{autoPlay:4e3,prevNextButtons:!1,contain:!0,pageDots:!1,wrapAround:!0,watchCSS:!0,selectedAttraction:.05,friction:.8,initialIndex:0}),this.flkty&&(this.flkty.select(0),this.flktyNav.on("change",index=>this.flkty.select(index)))}}else sliderInitialized&&(this.flktyNav.destroy(),slides[0].classList.add(classes$B.isSelected),this.flkty&&this.flkty.select(0))}onBlockSelect(evt){if(!this.slideshowNav)return;const slide=this.slideshowNav.querySelector(`[${attributes$8.slideData}="${evt.detail.blockId}"]`),slideIndex=parseInt(slide.getAttribute(attributes$8.slideIndex));this.slideshowNav.classList.contains(classes$B.flickityEnabled)?(this.flktyNav.select(slideIndex),this.flktyNav.stopPlayer(),this.slideshowNav.classList.add(classes$B.isSelected)):slide.dispatchEvent(new Event("click"))}onBlockDeselect(){this.slideshowNav&&this.slideshowNav.classList.contains(classe
11s$B.flickityEnabled)&&(this.flktyNav.playPlayer(),this.slideshowNav.classList.remove(classes$B.isSelected))}onUnload(){if(!this.slideshowNav)return;this.slideshowNav.classList.contains(classes$B.flickityEnabled)&&this.flktyNav.destroy(),this.flkty&&this.flkty.destroy(),document.removeEventListener("theme:resize",this.setSlideshowNavStateOnResize)}}const LogoListSection={onLoad(){sections$o[this.id]=new LogoList(this)},onUnload(e){sections$o[this.id].onUnload(e)},onBlockSelect(e){sections$o[this.id].onBlockSelect(e)},onBlockDeselect(e){sections$o[this.id].onBlockDeselect(e)}};register("logos",[LogoListSection,blockScroll]);const selectors$R={videoPlay:"[data-video-play]",videoPlayValue:"data-video-play"};class VideoPlay{constructor(section,selector=selectors$R.videoPlay,selectorValue=selectors$R.videoPlayValue){this.container=section,this.videoPlay=this.container.querySelectorAll(selector),this.videoPlay.length&&this.videoPlay.forEach(element=>{element.addEventListener("click",e=>{const button=e.currentTarget;if(button.hasAttribute(selectorValue)&&button.getAttribute(selectorValue).trim()!==""){e.preventDefault();const items=[{html:button.getAttribute(selectorValue)}];new LoadPhotoswipe(items),window.accessibility.lastElement=button}})})}}const videoPlay={onLoad(){new VideoPlay(this.container)}},selectors$S={video:"[data-video-id]"},sections$p={};class Video$1{constructor(section){this.section=section,this.container=section.container,this.video=this.container.querySelector(selectors$S.video),this.init()}init(){this.video&&this.container.addEventListener("touchstart",()=>{this.video.play()})}}const videoSection={onLoad(){sections$p[this.id]=new Video$1(this)}};register("featured-video",[videoSection,videoPlay,parallaxHero]),register("slideshow",[slider,parallaxHero]);const selectors$T={imagesHolder:"[data-images-holder]",imageHolder:"[data-image-holder]",imageElement:"[data-image-element]",imagesButton:"[data-images-button]",dataStartPosition:"data-start-position"},sections$q={};class CompareImages{constructor(section){this.imagesHolder=section,this.imagesHolder&&(this.imageHolder=this.imagesHolder.querySelector(selectors$T.imageHolder),this.imageElement=this.imagesHolder.querySelector(selectors$T.imageElement),this.imagesButton=this.imagesHolder.querySelector(selectors$T.imagesButton),this.startPosition=this.imagesHolder.hasAttribute(selectors$T.dataStartPosition)?this.imagesHolder.getAttribute(selectors$T.dataStartPosition):0,this.startX=0,this.x=0,this.changeValuesEvent=event=>this.changeValues(event),this.onMoveEvent=event=>this.onMove(event),this.onStopEvent=event=>this.onStop(event),this.onStartEvent=event=>this.onStart(event),this.init(),document.addEventListener("theme:resize",this.changeValuesEvent))}init(){this.changeValues(),this.imagesButton.addEventListener("mousedown",this.onStartEvent),this.imagesButton.addEventListener("touchstart",this.onStartEvent)}changeValues(event){const imagesHolderWidth=this.imagesHolder.offsetWidth,buttonWidth=this.imagesButton.offsetWidth;if((!event||event&&event.type!=="touchmove"&&event.type!=="mousemove")&&(this.imageElement.style.width=`${imagesHolderWidth}px`,this.imageHolder.style.width=`${100-parseInt(this.startPosition)}%`,this.startPosition!==0)){const newButtonPositionPixels=imagesHolderWidth*parseInt(this.startPosition)/100;this.x=newButtonPositionPixels-buttonWidth/2}this.x>imagesHolderWidth-buttonWidth?this.x=imagesHolderWidth-buttonWidth:this.x<0&&(this.x=0),this.imagesButton.style.left=`${this.x/imagesHolderWidth*100}%`,this.imageHolder.style.width=`${100-(this.x+buttonWidth/2)/imagesHolderWidth*100}%`}onStart(event){event.preventDefault();let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),this.x=this.imagesButton.offsetLeft,this.startX=eventTouch.pageX-this.x,this.imagesHolder.addEventListener("mousemove",this.onMoveEvent),this.imagesHolder.addEventListener("mouseup",this.onStopEvent),this.imagesHolder.addEventListener("touchmove",this.onMoveEvent),this.imagesHolder.addEventListener("touchend",this.onStopEvent)}onMove(event){let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),this.x=eventTouch.pageX-this.startX,this.changeValues(event)}onStop(event){this.imagesHolder.removeEventListener("mousemove",this.onMoveEvent),this.imagesHolder.removeEventListener("mouseup",this.onStopEvent),this.imagesHolder.removeEventListener("touchmove",this.onMoveEvent),this.imagesHolder.removeEventListener("touchend",this.onStopEvent)}onUnload(){this.changeValuesEvent&&document.removeEventListener("theme:resize",this.changeValuesEvent)}}const compareImages={onLoad(){sections$q[this.id]=[],this.container.querySelectorAll(selectors$T.
11imagesHolder).forEach(el=>{sections$q[this.id].push(new CompareImages(el))})},onUnload(){sections$q[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload()})}};register("custom-content",[slider,videoPlay,parallaxHero,quickAddProduct,swatchGridSection,compareImages,newsletterCheckForResultSection]);var styles={};styles.basic=[],styles.light=[{featureType:"administrative",elementType:"labels",stylers:[{visibility:"simplified"},{lightness:"64"},{hue:"#ff0000"}]},{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"administrative",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#f0f0f0"},{visibility:"simplified"}]},{featureType:"landscape.natural.landcover",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"landscape.natural.terrain",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"geometry.fill",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"labels",stylers:[{lightness:"100"}]},{featureType:"poi.park",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{saturation:"-41"},{color:"#e8ede7"}]},{featureType:"poi.park",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"all",stylers:[{saturation:"-100"}]},{featureType:"road",elementType:"labels",stylers:[{lightness:"25"},{gamma:"1.06"},{saturation:"-100"}]},{featureType:"road.highway",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{gamma:"10.00"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{weight:"0.01"},{visibility:"simplified"}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{weight:"0.01"}]},{featureType:"road.highway",elementType:"labels.text.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.arterial",elementType:"geometry.fill",stylers:[{weight:"0.8"}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"geometry.fill",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"geometry.stroke",stylers:[{gamma:"10.00"},{lightness:"100"},{weight:"0.4"}]},{featureType:"road.local",elementType:"labels",stylers:[{visibility:"simplified"},{weight:"0.01"},{lightness:"39"}]},{featureType:"road.local",elementType:"labels.text.stroke",stylers:[{weight:"0.50"},{gamma:"10.00"},{lightness:"100"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"all",stylers:[{color:"#cfe5ee"},{visibility:"on"}]}],styles.white_label=[{featureType:"all",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"all",elementType:"labels",stylers:[{visibility:"simplified"}]},{featureType:"administrative",elementType:"labels",stylers:[{gamma:"3.86"},{lightness:"100"}]},{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#cccccc"}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#f2f2f2"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"all",stylers:[{saturation:-100},{lightness:45}]},{featureType:"road.highway",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{weight:"0.8"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{weight:"0.8"}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{weight:"0.8"}]},{featureType:"road.highway",elementType:"labels.text.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{weight:"0"}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"labels.text",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"all",stylers:[{color:"#e4e4e4"},{visibility:"on"}]}],styles.dark_label=[{featureType:"all",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"all",elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#000000"},{lightness:40}]},{featureType:"all",elementType:"labels.text.stroke",stylers:[{visibility:"on"},{color:"#000000"},{lightness:16}]},{featureType:"all",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:17},{weight:1.2}]},{featureType:"administrative",elementType:"labels",stylers:[{visibility:"simplified"},{lightness:"-82"}]},{featureType:"administrative",elementType:"labels.text.stroke",stylers:[{invert_lightness:!0}
11,{weight:"7.15"}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"landscape",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#000000"},{lightness:21}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:17},{weight:"0.8"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:29},{weight:"0.01"}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#000000"},{lightness:18}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#000000"},{lightness:16}]},{featureType:"road.local",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#000000"},{lightness:19}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#000000"},{lightness:17}]}];function mapStyle(key){return styles[key]}window.theme.allMaps=window.theme.allMaps||{};let allMaps=window.theme.allMaps;window.theme.mapAPI=window.theme.mapAPI||null;class Map{constructor(section){this.container=section.container,this.mapContainer=this.container.querySelector("[data-map-container]"),this.key=this.container.getAttribute("data-api-key"),this.styleString=this.container.getAttribute("data-style")||"",this.zoomString=this.container.getAttribute("data-zoom")||14,this.address=this.container.getAttribute("data-address"),this.enableCorrection=this.container.getAttribute("data-latlong-correction"),this.lat=this.container.getAttribute("data-lat"),this.long=this.container.getAttribute("data-long"),this.key&&this.initMaps()}initMaps(){loadAPI(this.key).then(()=>this.enableCorrection==="true"&&this.lat!==""&&this.long!==""?new google.maps.LatLng(this.lat,this.long):geocodeAddressPromise(this.address)).then(center=>{const zoom=parseInt(this.zoomString,10),styles2=mapStyle(this.styleString),mapOptions={zoom,styles:styles2,center,draggable:!0,clickableIcons:!1,scrollwheel:!1,zoomControl:!1,disableDefaultUI:!0};return createMap(this.mapContainer,mapOptions)}).then(map=>{this.map=map,allMaps[this.id]=map}).catch(e=>{console.log("Failed to load Google Map"),console.log(e)})}unload(){typeof window.google<"u"&&google.maps.event.clearListeners(this.map,"resize")}}const mapSection={onLoad(){allMaps[this.id]=new Map(this)},onUnload(){typeof allMaps[this.id].unload=="function"&&allMaps[this.id].unload()}};register("map",mapSection);function loadAPI(key){if(window.theme.mapAPI===null){const urlKey=`https://maps.googleapis.com/maps/api/js?key=${key}`;window.theme.mapAPI=loadScript({url:urlKey})}return window.theme.mapAPI}function createMap(container,options){var map=new google.maps.Map(container,options),center=map.getCenter(),marker=new google.maps.Marker({map,position:center});return google.maps.event.addDomListener(window,"resize",function(){google.maps.event.trigger(map,"resize"),map.setCenter(center)}),map}function geocodeAddressPromise(address){return new Promise((resolve,reject)=>{var geocoder=new google.maps.Geocoder;geocoder.geocode({address},function(results,status){if(status=="OK"){var latLong={lat:results[0].geometry.location.lat(),lng:results[0].geometry.location.lng()};resolve(latLong)}else reject(status)})})}register("search",[quickAddProduct,swatchGridSection]);const selectors$U={largePromo:"[data-large-promo]",largePromoInner:"[data-large-promo-inner]",trackingInner:"[data-tracking-consent-inner]",tracking:"[data-tracking-consent]",trackingAccept:"[data-confirm-cookies]",close:"[data-close-modal]",modalUnderlay:"[data-modal-underlay]",modalBody:"[data-modal-body]",newsletterPopup:"[data-newsletter]",newsletterPopupHolder:"[data-newsletter-holder]",newsletterClose:"[data-newsletter-close]",newsletterHeading:"[data-newsletter-heading]",newsletterField:"[data-newsletter-field]",promoPopup:"[data-promo-text]",newsletterForm:"[data-newsletter-form]",delayAttribite:"data-popup-delay",cookieNameAttribute:"data-cookie-name",dataTargetReferrer:"data-target-referrer"},classes$C={hide:"hide",hasValue:"has-value",success:"has-success",selected:"selected",hasBlockSelected:"has-block-selected",mobile:"mobile",desktop:"desktop"},attributes$9={enable:"data-enable"};let sections$r={};class DelayShow{constructor(holder,element,callback=null){if(this.element=element,this.delay=holder.getAttribute(selectors$U.delayAttribite),this.isSubmitted=window.location.href.indexOf("accepts_marketing")!==-1||window.location.href.indexOf("customer_posted=true")!==-1,this.callback=callback,this.showPopupOnScrollEvent=()=>this.showPopupOnScroll(),(this.delay==="always"||this.isSubmitted)&&this.always(),this.delay&&this.delay.includes("delayed")&&!this.isSubmitted){const seconds=this.delay.includes("_")?parseInt(this.delay.split("_")[1]):10;this.delayed(seconds)}this.delay==="bottom"&&!this.isSubmitted&&this.bottom(),this.delay==="idle"&&!this.isSubmitted&&this.idle()}always(){fadeIn(this.element,null,this.callback)}delayed(seconds=10){setTimeout(()=>{fadeIn(this.element,null,this.callback)},seconds*1e3)}idle(){let timer=0,idleTime=6e4;const documentEvents=["mousemove","mousedown","click","touchmove","touchstart","touchend","keydown","keypress"],windowEvents=["load","resize","scroll"],startTimer=()=>{timer=setTimeout(()=>{timer=0,fadeIn(this.element,null,this.callback)}
11,idleTime),documentEvents.forEach(eventType=>{document.addEventListener(eventType,resetTimer)}),windowEvents.forEach(eventType=>{window.addEventListener(eventType,resetTimer)})},resetTimer=()=>{timer&&clearTimeout(timer),documentEvents.forEach(eventType=>{document.removeEventListener(eventType,resetTimer)}),windowEvents.forEach(eventType=>{window.removeEventListener(eventType,resetTimer)}),startTimer()};startTimer()}bottom(){document.addEventListener("theme:scroll",this.showPopupOnScrollEvent)}showPopupOnScroll(){window.scrollY+window.innerHeight>=document.body.clientHeight&&(fadeIn(this.element,null,this.callback),document.removeEventListener("theme:scroll",this.showPopupOnScrollEvent))}onUnload(){document.removeEventListener("theme:scroll",this.showPopupOnScrollEvent)}}class TargetReferrer{constructor(el){if(this.el=el,this.locationPath=location.href,!this.el.hasAttribute(selectors$U.dataTargetReferrer))return!1;this.init()}init(){this.locationPath.indexOf(this.el.getAttribute(selectors$U.dataTargetReferrer))===-1&&!window.Shopify.designMode&&this.el.parentNode.removeChild(this.el)}}class LargePopup{constructor(el){this.popup=el,this.modal=this.popup.querySelector(selectors$U.largePromoInner),this.modalBody=this.popup.querySelector(selectors$U.modalBody),this.close=this.popup.querySelector(selectors$U.close),this.underlay=this.popup.querySelector(selectors$U.modalUnderlay),this.form=this.popup.querySelector(selectors$U.newsletterForm),this.cookie=new PopupCookie(this.popup.getAttribute(selectors$U.cookieNameAttribute),"user_has_closed"),this.isTargeted=new TargetReferrer(this.popup),this.a11y=a11y,this.init()}init(){const cookieExists=this.cookie.read()!==!1,targetMobile=this.popup.classList.contains(classes$C.mobile),targetDesktop=this.popup.classList.contains(classes$C.desktop);let targetMatches=!0;if((targetMobile&&window.innerWidth>=theme.sizes.small||targetDesktop&&window.innerWidth<theme.sizes.small)&&(targetMatches=!1),!targetMatches){this.scrollUnlock();return}(!cookieExists||window.Shopify.designMode)&&(window.Shopify.designMode||new DelayShow(this.popup,this.modal,()=>this.scrollLock()),this.form&&this.form.classList.contains(classes$C.success)&&this.checkForSuccess(),this.initClosers())}checkForSuccess(){fadeIn(this.modal,null,()=>this.scrollLock()),this.cookie.write()}initClosers(){this.close.addEventListener("click",this.closeModal.bind(this)),this.underlay.addEventListener("click",this.closeModal.bind(this))}closeModal(e){e.preventDefault(),fadeOut(this.modal),this.cookie.write(),this.scrollUnlock()}scrollLock(){window.getComputedStyle(this.popup).display!=="none"&&(this.a11y.trapFocus(this.modal),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.modalBody})))}scrollUnlock(){this.a11y.removeTrapFocus(),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}onBlockSelect(evt){this.popup.contains(evt.target)&&(fadeIn(this.modal,null,()=>this.scrollLock()),this.popup.classList.add(classes$C.selected),this.popup.parentNode.classList.add(classes$C.hasBlockSelected))}onBlockDeselect(evt){this.popup.contains(evt.target)&&(fadeOut(this.modal),this.scrollUnlock(),this.popup.classList.remove(classes$C.selected),this.popup.parentNode.classList.remove(classes$C.hasBlockSelected))}}class Tracking{constructor(el){this.popup=el,this.modal=document.querySelector(selectors$U.tracking),this.acceptButton=this.modal.querySelector(selectors$U.trackingAccept),this.enable=this.modal.getAttribute(attributes$9.enable)==="true",this.showPopup=!1,window.Shopify.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],error=>{if(error)throw error;const userCanBeTracked=window.Shopify.customerPrivacy.userCanBeTracked(),userTrackingConsent=window.Shopify.customerPrivacy.getTrackingConsent();this.showPopup=!userCanBeTracked&&userTrackingConsent==="no_interaction"&&this.enable,window.Shopify.designMode&&(this.showPopup=!0),this.init()})}init(){this.showPopup&&fadeIn(this.modal),this.clickEvents()}clickEvents(){this.acceptButton.addEventListener("click",event=>{event.preventDefault(),window.Shopify.customerPrivacy.setTrackingConsent(!0,()=>fadeOut(this.modal)),document.documentElement.style.setProperty("--cookie-bar-height","0px")}),document.addEventListener("trackingConsentAccepted",()=>{})}onBlockSelect(evt){this.popup.contains(evt.target)&&this.showPopup&&(fadeIn(this.modal),this.popup.classList.add(classes$C.selected),this.popup.parentNode.classList.add(classes$C.hasBlockSelected))}onBlockDeselect(evt){this.popup.contains(evt.target)&&(fadeOut(this.modal),this.popup.classList.remove(classes$C.selected),this.popup.parentNode.classList.remove(classes$C.hasBlockSelected))}}class PromoText{constructor(el){this.popup=el,this.close=this.popup.querySelector(selectors$U.close),this.cookie=new PopupCookie(this.popup.getAttribute(selectors$U.cookieNameAttribute),"user_has_closed"),this.isTargeted=new TargetReferrer(this.popup),this.init()}init(){(!(this.cookie.read()!==!1)||window.Shopify.designMode)&&(window.Shopify.designMode?fadeIn(this.popup):new DelayShow(this.popup,this.popup),this.clickEvents())}clickEvents(){this.close.addEventListener("click",event=>{event.preventDefault(),fadeOut(this.popup),this.cookie.write()})}onBlockSelect(evt){this.popup.contains(evt.target)&&(fadeIn(this.popup),this.popup.classList.add(classes$C.selected),this.popup.parentNode.classList.add(classes$C.hasBlockSelected))}onBlockDeselect(evt){this.popup.contains(evt.target)&&(fadeOut(this.popup),this.popup.classList.remove(classes$C.selected),this.popup.parentNode.classList.remove(classes$C.hasBlockSelected))}}class NewsletterPopup{constructor(el){this.popup=el,this.holder=this.popup.querySelector(selectors$U.newsletterPopupHolder),this.close=this.popup.querySelector(selectors$U.newsletterClose),this.heading=this.popup.querySelector(selectors$U.newsletterHeading),this.newsletterField=this.popup.querySelector(selectors$U.newsletterField),this.cookie=new PopupCookie(this.popup.getAttribute(selectors$U.cookieNameAttribute),"newsletter_is_closed"),this.form=this.popup.querySelector(selectors$U.newsletterForm),this.isTargeted=new TargetReferrer(this.popup),this.resetClassTimer=0,this.init()}init(){const cookieExists=this.cookie.read()!==!1;window.location.search.indexOf("?customer_posted=true")!==-1&&(this.delay=0),(!cookieExists||window.Shopify.designMode)&&(this.show(),this.form.classList.contains(classe
11s$C.success)&&this.checkForSuccess())}show(){window.Shopify.designMode?fadeIn(this.holder):new DelayShow(this.popup,this.holder),this.showForm(),this.inputField(),this.closePopup()}checkForSuccess(){fadeIn(this.holder),this.cookie.write()}showForm(){this.heading.addEventListener("click",event=>{event.preventDefault(),this.heading.classList.add(classes$C.hide),this.form.classList.remove(classes$C.hide),this.newsletterField.focus()}),this.heading.addEventListener("keyup",event=>{event.keyCode===window.theme.keyboardKeys.ENTER&&this.heading.dispatchEvent(new Event("click"))})}closePopup(){this.close.addEventListener("click",event=>{event.preventDefault(),fadeOut(this.holder),this.cookie.write()})}inputField(){const setClass=()=>{this.resetClassTimer&&clearTimeout(this.resetClassTimer),this.newsletterField.value!==""&&this.holder.classList.add(classes$C.hasValue)},unsetClass=()=>{this.resetClassTimer&&clearTimeout(this.resetClassTimer),this.resetClassTimer=setTimeout(()=>{this.holder.classList.remove(classes$C.hasValue)},2e3)};this.newsletterField.addEventListener("input",setClass),this.newsletterField.addEventListener("focus",setClass),this.newsletterField.addEventListener("focusout",unsetClass)}onBlockSelect(evt){this.popup.contains(evt.target)&&(fadeIn(this.holder),this.popup.classList.add(classes$C.selected),this.popup.parentNode.classList.add(classes$C.hasBlockSelected))}onBlockDeselect(evt){this.popup.contains(evt.target)&&(fadeOut(this.holder),this.popup.classList.remove(classes$C.selected),this.popup.parentNode.classList.remove(classes$C.hasBlockSelected))}}const popupSection={onLoad(){sections$r[this.id]=[],this.container.querySelectorAll(selectors$U.largePromo).forEach(el=>{sections$r[this.id].push(new LargePopup(el))}),this.container.querySelectorAll(selectors$U.tracking).forEach(el=>{sections$r[this.id].push(new Tracking(el))}),this.container.querySelectorAll(selectors$U.newsletterPopup).forEach(el=>{sections$r[this.id].push(new NewsletterPopup(el))}),this.container.querySelectorAll(selectors$U.promoPopup).forEach(el=>{sections$r[this.id].push(new PromoText(el))})},onBlockSelect(evt){sections$r[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(evt)})},onBlockDeselect(evt){sections$r[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(evt)})}};register("popups",[popupSection,newsletterCheckForResultSection]);const selectors$V={loginToggle:"#AdminLoginToggle",newsletterToggle:"#NewsletterToggle",login:"#AdminLogin",signup:"#CustomerSignup",errors:".errors",contactErrors:"#contact_form .errors",loginErrors:"#login_form .errors"};class Password{constructor(section){this.container=section.container,this.loginToggle=this.container.querySelector(selectors$V.loginToggle),this.newsletterToggle=this.container.querySelector(selectors$V.newsletterToggle),this.login=this.container.querySelector(selectors$V.login),this.signup=this.container.querySelector(selectors$V.signup),this.errors=this.container.querySelector(selectors$V.errors),this.contactErrors=this.container.querySelector(selectors$V.contactErrors),this.loginErrors=this.container.querySelector(selectors$V.loginErrors),this.init()}init(){this.loginToggle.addEventListener("click",e=>{e.preventDefault(),slideDown(this.login),hideElement(this.signup),this.errors&&hideElement(this.errors)}),this.newsletterToggle.addEventListener("click",e=>{e.preventDefault(),hideElement(this.login),slideDown(this.signup),this.errors&&hideElement(this.errors)}),this.contactErrors&&(hideElement(this.login),slideDown(this.signup)),this.loginErrors&&(slideDown(this.login),hideElement(this.signup))}}const passwordSection={onLoad(){new Password(this)}};register("password-template",passwordSection),register("faq",accordions),register("list-collections",[slider,quickAddProduct,swatchGridSection,blockScroll]),register("columns-with-image",[slider,blockScroll,videoPlay]),register("newsletter",newsletterCheckForResultSection),register("before-after",[compareImages]),register("sidebar",[accordions,scrollToElement]),document.addEventListener("DOMContentLoaded",function(){load("*");const scrollTopButton=document.querySelector("[data-scroll-top-button]");scrollTopButton&&(scrollTopButton.addEventListener("click",()=>{window.scrollTo({top:0,left:0,behavior:"smooth"})}),document.addEventListener("theme:scroll",()=>{scrollTopButton.classList.toggle("is-visible",window.pageYOffset>window.innerHeight)})),window.self!==window.top&&document.querySelector("html").classList.add("iframe"),"scrollBehavior"in document.documentElement.style||loadScript({url:window.theme.assets.smoothscroll})}),window.navigator.cookieEnabled&&(document.documentElement.className=document.documentElement.className.replace("supports-no-cookies","supp
11orts-cookies"))})(themeVendor.AOS,themeVendor.BodyScrollLock,themeVendor.themeAddresses,themeVendor.themeCurrency,themeVendor.Sqrl,themeVendor.themeImages,themeVendor.Flickity,themeVendor.FlickityFade,themeVendor.Rellax,themeVendor.MicroModal); 12//# sourceMappingURL=/cdn/shop/t/62/assets/theme.js.map?v=151167302101822583241790636653
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.