PageSourceSearch

https://cabaulifestyle.com/cdn/shop/t/91/assets/theme.js?v=56376930868150233361788784143

js cabaulifestyle.com collected 2026-10-02 04:53:14 UTC 228,696 bytes, 9 lines download raw bytes

1/*
2 * @license
3 * Modular Theme (c) Presidio Creative Themes
4 *
5 * Modified versions of the theme code
6 * are not supported by Presidio Creative.
7 *
8 */(function(bodyScrollLock,themeCurrency,Flickity,FlickityFade,Ajaxinate,FlickityAsNavFor,Rellax){"use strict";window.theme=window.theme||{},window.theme.subscribers={},window.theme.sizes={mobile:480,small:768,large:1024,widescreen:1320},window.theme.keyboardKeys={TAB:9,ENTER:13,ESCAPE:27,SPACE:32,LEFTARROW:37,RIGHTARROW:39},window.theme.dimensions={headerScrolled:60},window.theme.focusable='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',window.theme.a11yTrigger=null;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"))})}function readHeights(){const h={};return h.windowHeight=window.innerHeight,h.footerHeight=getHeight('[data-section-type*="footer"]'),h.headerHeight=getHeight("[data-header-height].header--has-scrolled")||60,h.headerInitialHeight=getHeight("[data-header-height]:not(.header--has-scrolled)"),h}function setVarsOnResize(){document.addEventListener("theme:resize",resizeVars)}function setVars(){const{windowHeight,headerInitialHeight,headerHeight,footerHeight}=readHeights();document.documentElement.style.setProperty("--header-height",`${headerHeight}px`),document.documentElement.style.setProperty("--header-initial-height",`${headerInitialHeight}px`),document.documentElement.style.setProperty("--footer-height",`${footerHeight}px`),document.documentElement.style.setProperty("--content-full",`${windowHeight-headerHeight}px`),document.documentElement.style.setProperty("--content-min",`${windowHeight-headerHeight-footerHeight}px`),document.documentElement.style.setProperty("--scrollbar-width",`${getScrollbarWidth()}px`)}function resizeVars(){const{windowHeight,headerHeight,footerHeight}=readHeights();document.documentElement.style.setProperty("--header-height",`${headerHeight}px`),document.documentElement.style.setProperty("--footer-height",`${footerHeight}px`),document.documentElement.style.setProperty("--content-full",`${windowHeight-headerHeight}px`),document.documentElement.style.setProperty("--content-min",`${windowHeight-headerHeight-footerHeight}px`)}function getHeight(selector){const el=document.querySelector(selector);return el?el.clientHeight: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}const outerHeight=el=>{const style=getComputedStyle(el);let height=el.offsetHeight;return height+=parseInt(style.marginTop)+parseInt(style.marginBottom),height},selectors$R={bannerContainer:"[data-banner-container]",bannerContent:"[data-banner-content]"};function preventOverflow(container){const banners=container.querySelectorAll(selectors$R.bannerContainer);banners&&banners.forEach(banner=>{const content=banner.querySelector(selectors$R.bannerContent);content&&(banner.style.minHeight=`${outerHeight(content)}px`,document.addEventListener("theme:resize",()=>{banner.style.minHeight=`${outerHeight(content)}px`}))})}function debounce(fn,time){let timeout;return function(){if(fn){const functionCall=()=>fn.apply(this,arguments);clearTimeout(timeout),timeout=setTimeout(functionCall,time)}}}window.lastWindowWidth=window.innerWidth;function dispatchResizeEvent(){document.dispatchEvent(new CustomEvent("theme:resize",{bubbles:!0})),window.lastWindowWidth!==window.innerWidth&&(document.dispatchEvent(new CustomEvent("theme:resize:width",{bubbles:!0})),window.lastWindowWidth=window.innerWidth)}function resizeListener(){window.addEventListener("resize",debounce(dispatchResizeEvent,50))}let prev=window.pageYOffset,up=null,down=null,wasUp=null,wasDown=null,scrollLockTimeout=0;function dispatch(){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()})},{passive:!0}),window.addEventListener("theme:scroll:lock",lock),window.addEventListener("theme:scroll:unlock",unlock)}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.touched=!0):window.theme.touched=!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"),setTimeout(function(){document.querySelector(`#${toggleID}`).classList.toggle("expanded")},40)})})}const classes$y={loading:"is-loading"},selectors$Q={img:"img.is-loading"};function loadedImagesEventHook(){document.addEventListener("load",e=>{e.target.tagName=="IMG"&&e.target.classList.contains(classes$y.loading)&&(e.target.classList.remove(classes$y.loading),e.target.parentNode.classList.remove(classes$y.loading))},!0)}function removeLoadingClassFromLoadedImages(container){container.querySelectorAll(selectors$Q.img).forEach(img=>{img.complete&&(img.classList.remove(classes$y.loading),img.parentNode.classList.remove(classes$y.loading))})}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)})}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.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===9&&(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});function getWindowWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function getWindowHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function isDesktop(){return getWindowWidth()>=window.theme.sizes.small}const selectors$P={inputSearch:'input[type="search"]',focusedElements:'[aria-selected="true"] a',resetButton:'button[type="reset"]'},classes$x={hidden:"hidden"};class HeaderSearchForm extends HTMLElement{constructor(){super(),this.input=this.querySelector(selectors$P.inputSearch),this.resetButton=this.querySelector(selectors$P.resetButton),this.input&&(this.input.form.addEventListener("reset",this.onFormReset.bind(this)),this.input.addEventListener("input",debounce(event=>{this.onChange(event)},300).bind(this)))}toggleResetButton(){const resetIsHidden=this.resetButton.classList.contains(classes$x.hidden);this.input.value.length>0&&resetIsHidden?this.resetButton.classList.remove(classes$x.hidden):this.input.value.length===0&&!resetIsHidden&&this.resetButton.classList.add(classes$x.hidden)}onChange(){this.toggleResetButton()}shouldResetForm(){return!document.querySelector(selectors$P.focusedElements)}onFormReset(event){event.preventDefault(),this.shouldResetForm()&&(this.input.value="",this.toggleResetButton(),event.target.querySelector(selectors$P.inputSearch).focus())}}customElements.define("header-search-form",HeaderSearchForm);const selectors$O={allVisibleElements:'[role="option"]',ariaSelected:'[aria-selected="true"]',predictiveSearch:"predictive-search",predictiveSearchResults:"[data-predictive-search-results]",predictiveSearchStatus:"[data-predictive-search-status]",searchInput:'input[type="search"]',searchPopdown:"[data-popdown]",searchResultsLiveRegion:"[data-predictive-search-live-region-count-value]",searchResultsGroupsWrapper:"data-search-results-groups-wrapper",searchForText:"[data-predictive-search-search-for-text]",sectionPredictiveSearch:"#shopify-section-predictive-search",selectedLink:'[aria-selected="true"] a',selectedOption:'[aria-selected="true"] a, button[aria-selected="true"]'};class PredictiveSearch extends HeaderSearchForm{constructor(){super(),this.a11y=a11y,this.abortController=new AbortController,this.allPredictiveSearchInstances=document.querySelectorAll(selectors$O.predictiveSearch),this.cachedResults={},this.input=this.querySelector(selectors$O.searchInput),this.isOpen=!1,this.predictiveSearchResults=this.querySelector(selectors$O.predictiveSearchResults),this.searchPopdown=this.closest(selectors$O.searchPopdown),this.searchTerm=""}connectedCallback(){this.input.addEventListener("focus",this.onFocus.bind(this)),this.input.form.addEventListener("submit",this.onFormSubmit.bind(this)),this.addEventListener("focusout",this.onFocusOut.bind(this)),this.addEventListener("keyup",this.onKeyup.bind(this)),this.addEventListener("keydown",this.onKeydown.bind(this))}getQuery(){return this.input.value.trim()}onChange(){super.onChange();const newSearchTerm=this.getQuery();if((!this.searchTerm||!newSearchTerm.startsWith(this.searchTerm))&&this.querySelector(selectors$O.searchResultsGroupsWrapper)?.remove(),this.updateSearchForTerm(this.searchTerm,newSearchTerm),this.searchTerm=newSearchTerm,!this.searchTerm.length){this.reset();return}this.getSearchResults(this.searchTerm)}onFormSubmit(event){(!this.getQuery().length||this.querySelector(selectors$O.selectedLink))&&event.preventDefault()}onFormReset(event){super.onFormReset(event),super.shouldResetForm()&&(this.searchTerm="",this.abortController.abort(),this.abortController=new AbortController,this.closeResults(!0))}shouldResetForm(){return!document.querySelector(selectors$O.selectedLink)}onFocus(){const currentSearchTerm=this.getQuery();currentSearchTerm.length&&(this.searchTerm!==currentSearchTerm?this.onChange():this.getAttribute("results")==="true"?this.open():this.getSearchResults(this.searchTerm))}onFocusOut(){setTimeout(()=>{this.contains(document.activeElement)||this.close()})}onKeyup(event){switch(this.getQuery().length||this.close(!0),event.preventDefault(),event.code){case"ArrowUp":this.switchOption("up");break;case"ArrowDown":this.switchOption("down");break;case"Enter":this.selectOption();break}}onKeydown(event){(event.code==="ArrowUp"||event.code==="ArrowDown")&&event.preventDefault()}updateSearchForTerm(previousTerm,newTerm){const searchForTextElement=this.querySelector(selectors$O.searchForText),currentButtonText=searchForTextElement?.innerText;if(currentButtonText){if(currentButtonText.match(new RegExp(previousTerm,"g"))?.length>1)return;const newButtonText=currentButtonText.replace(previousTerm,newTerm);searchForTextElement.innerText=newButtonText}}switchOption(direction){if(!this.getAttribute("open"))return;const moveUp=direction==="up",selectedElement=this.querySelector(selectors$O.ariaSelected),allVisibleElements=Array.from(this.querySelectorAll(selectors$O.allVisibleElements)).filter(element=>element.offsetParent!==null);let activeElementIndex=0;if(moveUp&&!selectedElement)return;let selectedElementIndex=-1,i=0;for(;selectedElementIndex===-1&&i<=allVisibleElements.length;)allVisibleElements[i]===selectedElement&&(selectedElementIndex=i),i++;if(this.statusElement.textContent="",!moveUp&&selectedElement?activeElementIndex=selectedElementIndex===allVisibleElements.length-1?0:selectedElementIndex+1:moveUp&&(activeElementIndex=selectedElementIndex===0?allVisibleElements.length-1:selectedElementIndex-1),activeElementIndex===selectedElementIndex)return;const activeElement=allVisibleElements[activeElementIndex];activeElement.setAttribute("aria-selected",!0),selectedElement&&selectedElement.setAttribute("aria-selected",!1),this.input.setAttribute("aria-activedescendant",activeElement.id)}selectOption(){const selectedOption=this.querySelector(selectors$O.selectedOption);selectedOption&&selectedOption.click()}getSearchResults(searchTerm){const queryKey=searchTerm.replace(" ","-").toLowerCase();if(this.setLiveRegionLoadingState(),this.cachedResults[queryKey]){this.renderSearchResults(this.cachedResults[queryKey]);return}fetch(`${theme.routes.predictive_search_url}?q=${encodeURIComponent(searchTerm)}&section_id=predictive-search`,{signal:this.abortController.signal}).then(response=>{if(!response.ok){var error=new Error(response.status);throw this.close(),error}return response.text()}).then(text=>{const resultsMarkup=new DOMParser().parseFromString(text,"text/html").querySelector(selectors$O.sectionPredictiveSearch).innerHTML;
8this.allPredictiveSearchInstances.forEach(predictiveSearchInstance=>{predictiveSearchInstance.cachedResults[queryKey]=resultsMarkup}),this.renderSearchResults(resultsMarkup)}).catch(error=>{if(error?.code!==20)throw this.close(),error})}setLiveRegionLoadingState(){this.statusElement=this.statusElement||this.querySelector(selectors$O.predictiveSearchStatus),this.loadingText=this.loadingText||this.getAttribute("data-loading-text"),this.setLiveRegionText(this.loadingText),this.setAttribute("loading",!0)}setLiveRegionText(statusText){this.statusElement.setAttribute("aria-hidden","false"),this.statusElement.textContent=statusText,setTimeout(()=>{this.statusElement.setAttribute("aria-hidden","true")},1e3)}renderSearchResults(resultsMarkup){this.predictiveSearchResults.innerHTML=resultsMarkup,this.setAttribute("results",!0),this.setLiveRegionResults(),this.open()}setLiveRegionResults(){this.removeAttribute("loading"),this.setLiveRegionText(this.querySelector(selectors$O.searchResultsLiveRegion).textContent)}getResultsMaxHeight(){return this.resultsMaxHeight=getWindowHeight()-document.querySelector(selectors$O.searchPopdown).getBoundingClientRect().bottom,this.resultsMaxHeight}open(){this.predictiveSearchResults.style.maxHeight=this.resultsMaxHeight||`${this.getResultsMaxHeight()}px`,this.setAttribute("open",!0),this.input.setAttribute("aria-expanded",!0),this.isOpen=!0}close(clearSearchTerm=!1){this.closeResults(clearSearchTerm),this.isOpen=!1}closeResults(clearSearchTerm=!1){clearSearchTerm&&(this.input.value="",this.removeAttribute("results"));const selected=this.querySelector(selectors$O.ariaSelected);selected&&selected.setAttribute("aria-selected",!1),this.input.setAttribute("aria-activedescendant",""),this.removeAttribute("loading"),this.removeAttribute("open"),this.input.setAttribute("aria-expanded",!1),this.resultsMaxHeight=!1,this.predictiveSearchResults?.removeAttribute("style")}reset(){this.predictiveSearchResults.innerHTML="",this.input.val="",this.a11y.removeTrapFocus()}}customElements.define("predictive-search",PredictiveSearch);const selectors$N={aos:"[data-aos]:not(.aos-animate)",aosAnchor:"[data-aos-anchor]"},classes$w={aosAnimate:"aos-animate"},observerConfig={attributes:!1,childList:!0,subtree:!0},mutationCallback=mutationList=>{for(const mutation of mutationList)if(mutation.type==="childList"){const element=mutation.target,elementsToAnimate=element.querySelectorAll(selectors$N.aos),anchors=element.querySelectorAll(selectors$N.aosAnchor);elementsToAnimate.length&&elementsToAnimate.forEach(element2=>{aosItemObserver.observe(element2)}),anchors.length&&initAnchorObservers(anchors)}},aosItemObserver=new IntersectionObserver((entries,observer)=>{entries.forEach(entry=>{entry.isIntersecting&&(entry.target.classList.add(classes$w.aosAnimate),observer.unobserve(entry.target))})},{root:null,rootMargin:"0px",threshold:[0,.1,.25,.5,.75,1]}),aosAnchorObserver=new IntersectionObserver((entries,observer)=>{entries.forEach(entry=>{if(entry.intersectionRatio>.1){const elementsToAnimate=entry.target.querySelectorAll(selectors$N.aos);elementsToAnimate.length&&elementsToAnimate.forEach(item=>{item.classList.add(classes$w.aosAnimate)}),observer.unobserve(entry.target)}})},{root:null,rootMargin:"0px",threshold:[.1,.25,.5,.75,1]});function bodyMutationObserver(){new MutationObserver(mutationCallback).observe(document.body,observerConfig)}function elementsIntersectionObserver(){const elementsToAnimate=document.querySelectorAll(selectors$N.aos);elementsToAnimate.length&&elementsToAnimate.forEach(element=>{aosItemObserver.observe(element)})}function anchorsIntersectionObserver(){const anchors=document.querySelectorAll(selectors$N.aosAnchor);anchors.length&&initAnchorObservers(anchors)}function initAnchorObservers(anchors){let anchorContainers=[];anchors.length&&anchors.forEach(anchor=>{const containerId=anchor.dataset.aosAnchor;if(anchorContainers.indexOf(containerId)===-1){const container=document.querySelector(containerId);container&&(aosAnchorObserver.observe(container),anchorContainers.push(containerId))}})}function initAnimations(){elementsIntersectionObserver(),anchorsIntersectionObserver(),bodyMutationObserver()}window.requestIdleCallback=window.requestIdleCallback||function(cb){var start=Date.now();return setTimeout(function(){cb({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-start))}})},1)},window.cancelIdleCallback=window.cancelIdleCallback||function(id){clearTimeout(id)},document.body.getAttribute("data-animations")==="true"&&initAnimations(),resizeListener(),scrollListener(),isTouch(),setVars(),loadedImagesEventHook(),window.addEventListener("DOMContentLoaded",()=>{setVarsOnResize(),floatLabels(document),preventOverflow(document),ariaToggle(document),removeLoadingClassFromLoadedImages(document)}),document.addEventListener("shopify:section:load",e=>{const container=e.target;floatLabels(container),preventOverflow(container),ariaToggle(document),document.dispatchEvent(new CustomEvent("theme:header:update",{bubbles:!0}))}),document.addEventListener("shopify:section:reorder",()=>{document.dispatchEvent(new CustomEvent("theme:header:update",{bubbles:!0}))}),document.addEventListener("shopify:section:unload",()=>{setTimeout(()=>{document.dispatchEvent(new CustomEvent("theme:header:update",{bubbles:!0}))},200)}),(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 settings$1={elements:{html:"html",body:"body",inPageLink:"[data-skip-content]",linksWithOnlyHash:'a[href="#"]',triggerFocusElement:"[data-focus-element]"},classes:{focus:"is-focused"}};class Accessibility{constructor(){this.init()}init(){this.settings=settings$1,this.window=window,this.document=document,this.a11y=a11y,this.inPageLink=this.document.querySelector(this.settings.elements.inPageLink),this.linksWithOnlyHash=this.document.querySelectorAll(this.settings.elements.linksWithOnlyHash),this.html=this.document.querySelector(this.settings.elements.html),this.body=this.document.querySelector(this.settings.elements.body),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()}
8),this.linksWithOnlyHash&&this.linksWithOnlyHash.forEach(item=>{item.addEventListener("click",event=>{event.preventDefault()})})}focusEvents(){this.document.addEventListener("keyup",event=>{event.keyCode===theme.keyboardKeys.TAB&&(this.body.classList.add(this.settings.classes.focus),this.isFocused=!0)}),this.document.addEventListener("keyup",event=>{if(!this.isFocused)return;const target=event.target,pressEnterOrSpace=event.keyCode===theme.keyboardKeys.ENTER||event.keyCode===theme.keyboardKeys.SPACE,targetElement=target.matches(this.settings.elements.triggerFocusElement)||target.closest(this.settings.elements.triggerFocusElement);pressEnterOrSpace&&targetElement&&this.lastFocused===null&&(this.lastFocused=target)}),this.html.addEventListener("theme:cart:add",event=>{this.lastFocused=event.detail.selector})}focusEventsOff(){this.document.addEventListener("mousedown",()=>{this.body.classList.remove(this.settings.classes.focus),this.isFocused=!1})}closeExpandedElements(){document.addEventListener("keyup",event=>{event.keyCode===theme.keyboardKeys.ESCAPE&&(this.a11y.removeTrapFocus(),this.lastFocused!==null&&setTimeout(()=>{this.lastFocused.focus(),this.lastFocused=null},600))})}}window.accessibility=new Accessibility;const selectors$M={accordion:"[data-accordion]",trigger:"[data-accordion-trigger]",body:"[data-accordion-body]",content:"[data-accordion-content]",focusable:"input, button, a"},attributes$8={open:"open",single:"single"};class AccordionElements extends HTMLElement{constructor(){super(),this.accordions=this.querySelectorAll(selectors$M.accordion)}connectedCallback(){this.accordions.forEach(accordion=>{const trigger=accordion.querySelector(selectors$M.trigger),body=accordion.querySelector(selectors$M.body);trigger.addEventListener("click",event=>this.onCollapsibleClick(event)),body.addEventListener("transitionend",event=>{event.target===body&&(accordion.getAttribute(attributes$8.open)=="true"&&(this.setBodyHeight(body,"auto"),accordion.querySelector(selectors$M.focusable)?.focus()),accordion.getAttribute(attributes$8.open)=="false"&&(accordion.removeAttribute(attributes$8.open),this.setBodyHeight(body,"")))})}),this.addEventListener("keyup",event=>this.onKeyUp(event))}open(accordion){if(accordion.getAttribute("open")=="true")return;const body=accordion.querySelector(selectors$M.body),content=accordion.querySelector(selectors$M.content);accordion.setAttribute("open",!0),this.setBodyHeight(body,content.offsetHeight)}close(accordion){if(!accordion.hasAttribute("open"))return;const body=accordion.querySelector(selectors$M.body),content=accordion.querySelector(selectors$M.content);this.setBodyHeight(body,content.offsetHeight),accordion.setAttribute("open",!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.setBodyHeight(body,0)})})}setBodyHeight(body,contentHeight){body.style.height=contentHeight!=="auto"&&contentHeight!==""?`${contentHeight}px`:contentHeight}onCollapsibleClick(event){event.preventDefault();const accordion=event.target.closest(selectors$M.accordion);this.hasAttribute(attributes$8.single)&&this.accordions.forEach(otherCollapsible=>{otherCollapsible.hasAttribute(attributes$8.open)&&otherCollapsible!=accordion&&requestAnimationFrame(()=>{this.close(otherCollapsible)})}),accordion.hasAttribute(attributes$8.open)?this.close(accordion):this.open(accordion)}onKeyUp(event){const accordion=this.querySelector("details[open]");event.code=="Escape"&&accordion&&accordion.querySelector("summary").dispatchEvent(new Event("click"))}}customElements.get("accordion-elements")||customElements.define("accordion-elements",AccordionElements);const slideUp=(target,duration=500)=>{target.style.transitionProperty="all",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)},slideDown=(target,duration=500,checkHidden=!0)=>{let display=window.getComputedStyle(target).display;
8if(checkHidden&&display!=="none")return;target.style.removeProperty("display"),display==="none"&&(display="block"),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="all",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)};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 subscribe(eventName,callback){return window.theme.subscribers[eventName]===void 0&&(window.theme.subscribers[eventName]=[]),window.theme.subscribers[eventName]=[...window.theme.subscribers[eventName],callback],function(){window.theme.subscribers[eventName]=window.theme.subscribers[eventName].filter(cb=>cb!==callback)}}function publish(eventName,data){window.theme.subscribers[eventName]&&window.theme.subscribers[eventName].forEach(callback=>{callback(data)})}const selectors$L={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$L,this.quantity=this.holder.querySelector(this.settings.quantityHolder),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.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(),this.quantityValue=Number(this.field.value||0);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(){this.field.addEventListener("input",()=>{this.quantityValue=this.field.value,this.updateQuantity()})}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.field.dataset.quantityValue=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(){if(this.quantityValue==="")return;const event=new CustomEvent("theme:cart:update",{bubbles:!0,detail:{id:this.cartItemID,quantity:this.quantityValue}});
8this.holder.dispatchEvent(event)}}const events$2={cartUpdate:"cart-update",cartError:"cart-error"},settings={dimensions:{maxSize:100},times:{timeoutAddProduct:1e3,closeDropdownAfter:5e3},classes:{template:"template-cart",hidden:"is-hidden",cartVisible:"cart--is-visible",open:"is-open",focused:"is-focused",visible:"is-visible",loading:"is-loading",disabled:"is-disabled",success:"product__form-submit--success",defaultSuccess:"is-success",cartEmpty:"cartToggle--empty",isAdded:"is-added"},attributes:{expanded:"aria-expanded",disabled:"disabled",dataId:"data-id",cartTotalPrice:"data-cart-total-price",freeMessageLimit:"data-limit",hideErrors:"data-hide-errors"},elements:{apiContent:"[data-api-content]",html:"html",button:"button",buttonAddToCart:"[data-add-to-cart]",buttonAddToCartText:"[data-add-to-cart-text]",buttonHolder:"[data-foot-holder]",buttonUpdateCart:"[data-update-cart]",cart:"[data-cart]",cartScroll:"[data-cart-scroll]",cartContainer:"[data-cart-container]",cartTemplate:"[data-cart-template]",cartToggleElement:"[data-cart-toggle]",cartClose:"[data-cart-close]",cartItemRemove:"[data-item-remove]",cartItemsCount:"[data-cart-items-count]",cartTotal:"[data-cart-total]",cartErrors:"[data-cart-errors]",cartCloseError:"[data-cart-error-close]",cartOriginalTotal:"[data-cart-original-total]",cartOriginaTotalPrice:"[data-cart-original-total-price]",cartDiscountsHolder:"[data-cart-discounts-holder]",cartAcceptanceCheckbox:"[data-cart-acceptance-checkbox]",cartButtons:"[data-cart-buttons]",cartButtonsFieldset:"[data-cart-buttons-fieldset]",cartFormError:"[data-cart-error]",cartMessage:"data-cart-message",cartMessageItem:"[data-cart-message]",cartProgress:"[data-cart-progress]",continueBtn:"[data-continue]",emptyMessage:"[data-empty-message]",errorMessage:"[data-error-message]",input:"input",item:"[data-item]",itemsHolder:"[data-items-holder]",leftToSpend:"[data-left-to-spend]",popover:"[data-popover]",popoverTemplate:"[data-popover-template]",qty:"[data-quantity-field]",quickAddHolder:"[data-quick-add-holder]",cartDiscountTitle:"[data-cart-discount-title]",cartDiscountPrice:"[data-cart-discount-price]"},cartTotalDiscountsTemplate:"[data-cart-total-discount]"};class CartDrawer{constructor(){window.location.pathname!=="/password"&&this.init()}init(){this.html=document.querySelector(settings.elements.html),this.body=document.body,this.defineSelectors(),this.accessibility=a11y,this.ajaxEnabled=theme.settings.enableAjaxCart,this.popoverTimer="",this.scrollLockTimeout=0,this.cartFocusTimeout=0,this.form=null,this.cartItemsCount=document.querySelector(settings.elements.cartItemsCount),this.hideErrors=!1,this.cartDrawerIsOpen=!1,this.cartDiscounts=0,this.cartLimitErrorIsHidden=!0,this.openCartDrawer=this.openCartDrawer.bind(this),this.closeCartDrawer=this.closeCartDrawer.bind(this),this.toggleCartDrawer=this.toggleCartDrawer.bind(this),this.cartKeyUpEvent=this.cartKeyUpEvent.bind(this),this.ajaxEnabled&&this.eventToggleCart(),this.initDefaultCartEvents(),this.addProductEvent()}renderCart(){this.cartContainer.innerHTML=document.querySelector(settings.elements.cartTemplate).innerHTML,this.totalItems=this.items.length,this.defineSelectors(),this.initDefaultCartEvents(),this.getCart()}defineSelectors(){this.cartContainer=document.querySelector(settings.elements.cartContainer),this.cartTemplate=document.querySelector(settings.elements.cartTemplate),this.popover=document.querySelector(settings.elements.popover),this.popoverTemplate=document.querySelector(settings.elements.popoverTemplate).innerHTML,this.cart=document.querySelector(settings.elements.cart),this.cartScroll=document.querySelector(settings.elements.cartScroll),this.emptyMessage=document.querySelector(settings.elements.emptyMessage),this.buttonHolder=document.querySelector(settings.elements.buttonHolder),this.itemsHolder=document.querySelector(settings.elements.itemsHolder),this.items=document.querySelectorAll(settings.elements.item),this.cartToggle=document.querySelector(settings.elements.cartToggleElement),this.continueBtns=document.querySelectorAll(settings.elements.continueBtn),this.cartTotal=document.querySelector(settings.elements.cartTotal),this.cartOriginalTotal=document.querySelector(settings.elements.cartOriginalTotal),this.cartOriginaTotalPrice=document.querySelector(settings.elements.cartOriginaTotalPrice),this.cartDiscountHolder=document.querySelector(settings.elements.cartDiscountsHolder),this.cartTotalDiscountTemplate=document.querySelector(settings.cartTotalDiscountsTemplate).innerHTML,this.cartErrorHolder=document.querySelector(settings.elements.cartErrors),this.cartClose=document.querySelector(settings.elements.cartClose),this.cartCloseErrorMessage=document.querySelector(settings.elements.cartCloseError),this.cartAcceptanceCheckbox=document.querySelector(settings.elements.cartAcceptanceCheckbox),this.cartMessage=document.querySelector(`[${settings.elements.cartMessage}
8]`),this.leftToSpend=document.querySelectorAll(settings.elements.leftToSpend)}initDefaultCartEvents(){this.ajaxEnabled?(this.cartEvents(),this.customEventAddProduct()):this.items.length&&this.noAjaxUpdate(),this.initQuantity(this.ajaxEnabled),this.cartMessage&&(this.cartFreeLimitShipping=Number(this.cartMessage.getAttribute(settings.attributes.freeMessageLimit))*window.Shopify.currency.rate,this.subtotal=Number(this.cartMessage.getAttribute(settings.attributes.cartTotalPrice)),this.cartBarProgress(),this.updateProgress())}initQuantity(ajax){this.items=document.querySelectorAll(settings.elements.item),this.items.forEach(item=>{new QuantityCounter(item,!0).init(),ajax&&this.customEventsHandle(item)})}noAjaxUpdate(){this.buttonHolder.querySelector(settings.elements.buttonUpdateCart).addEventListener("click",e=>{e.preventDefault(),this.items.forEach(item=>{const qty=item.querySelector(`input[${settings.attributes.dataId}]`);this.updateCart({id:qty.getAttribute(settings.attributes.dataId),quantity:qty.value})})})}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(){document.addEventListener("theme:cart:add",debounce(event=>{this.cartToggle.classList.add(settings.classes.isAdded),setTimeout(()=>{this.cartToggle.classList.remove(settings.classes.isAdded)},800)},500))}cartEvents(){const cartItemRemove=document.querySelectorAll(settings.elements.cartItemRemove);cartItemRemove&&cartItemRemove.forEach(item=>{item.addEventListener("click",event=>{event.preventDefault(),event.target.closest(settings.elements.item).classList.add(settings.classes.loading),this.updateCart({id:item.getAttribute(settings.attributes.dataId),quantity:0})})}),this.cartCloseErrorMessage&&this.cartCloseErrorMessage.addEventListener("click",event=>{event.preventDefault(),slideUp(this.cartErrorHolder,400)}),this.continueBtns&&this.continueBtns.forEach(continueBtn=>{continueBtn.addEventListener("click",e=>{const referrer=document.referrer,origin=window.location.origin+"/",isDesktop2=window.innerWidth>=theme.sizes.small;e.preventDefault(),isDesktop2&&!(window.location.href.indexOf("/cart")>-1)?this.closeCartDrawer():referrer===origin?window.location.href=theme.routes.root:history.back(1)})}),this.cartClose&&this.cartClose.addEventListener("click",this.closeCartDrawer),this.cartContainer&&this.cartContainer.addEventListener("keyup",this.cartKeyUpEvent),this.cartAcceptanceCheckbox&&(this.cart.addEventListener("click",event=>{const clickedElement=event.target;(clickedElement.matches(settings.elements.cartButtons)||clickedElement.closest(settings.elements.cartButtons))&&this.termsAcceptance(event)}),this.cartAcceptanceCheckbox.addEventListener("change",event=>this.termsAcceptance(event)),this.cartAcceptanceCheckbox.checked===!1&&this.cart.querySelector(settings.elements.cartButtonsFieldset).setAttribute(settings.attributes.disabled,!0))}cartKeyUpEvent(e){(e.which||e.keyCode)===theme.keyboardKeys.ESCAPE&&this.cartDrawerIsOpen&&(this.closeCartDrawer(),this.popoverHide())}termsAcceptance(event){const termsNotAccepted=this.cartAcceptanceCheckbox.checked===!1,cartFormError=this.cart.querySelector(settings.elements.cartFormError),cartButtonsFieldset=this.cart.querySelector(settings.elements.cartButtonsFieldset);termsNotAccepted?(event.preventDefault(),cartButtonsFieldset.setAttribute(settings.attributes.disabled,!0),slideDown(cartFormError)):(cartButtonsFieldset.removeAttribute(settings.attributes.disabled),slideUp(cartFormError))}renderPopover(product,qty){const stripHtmlRegex=/(<([^>]+)>)/gi,productTitle=product.title.replace(stripHtmlRegex,"");let price=product.final_price===0?window.theme.translations.free:themeCurrency.formatMoney(product.final_price,theme.settings.moneyFormat),prodImg=theme.assets.no_image,unitPrice="";const sellingPlanName=product.selling_plan_allocation?product.selling_plan_allocation.selling_plan.name:null;let properties="";if(product.unit_price_measurement&&(unitPrice=`${themeCurrency.formatMoney(product.unit_price,theme.moneyWithoutCurrencyFormat)} / `,product.unit_price_measurement.reference_value!=1&&(unitPrice+=product.unit_price_measurement.reference_value),unitPrice+=product.unit_price_measurement.reference_unit),product.featured_image!=null&&(prodImg=product.featured_image.url),product.properties){for(const property in product.properties)if({}.hasOwnProperty.call(product.properties,property)){const propValue=product.properties[property],propFirstChar=property.slice(0,1);propValue&&propFirstChar!=="_"&&(properties+="<p>"+property+": "+product.properties[property]+"</p>")}}let popoverReplaced=this.popoverTemplate;return popoverReplaced=popoverReplaced.includes("||itemCount||")?popoverReplaced.replaceAll("||itemCount||",qty):popoverReplaced,popoverReplaced=popoverReplaced.includes("||itemProductTitle||")?popoverReplaced.replaceAll("||itemProductTitle||",productTitle):popoverReplaced,popoverReplaced=popoverReplaced.includes("||itemProductImage||")?popoverReplaced.replaceAll("||itemProductImage||",prodImg):
8popoverReplaced,popoverReplaced=popoverReplaced.includes("||itemProductVariation||")?popoverReplaced.replaceAll("||itemProductVariation||",product.product_has_only_default_variant?"":product.variant_title):popoverReplaced,popoverReplaced=popoverReplaced.includes("||itemProductSellingPlan||")?popoverReplaced.replaceAll("||itemProductSellingPlan||",sellingPlanName||""):popoverReplaced,popoverReplaced=popoverReplaced.includes("||itemProductProperties||")?popoverReplaced.replaceAll("||itemProductProperties||",properties):popoverReplaced,popoverReplaced=popoverReplaced.includes("||itemProductPrice||")?popoverReplaced.replaceAll("||itemProductPrice||",price):popoverReplaced,popoverReplaced=popoverReplaced.includes("||itemProductUnitPrice||")?popoverReplaced.replaceAll("||itemProductUnitPrice||",unitPrice):popoverReplaced,popoverReplaced}popoverShow(product,quantity2){this.popover.innerHTML=this.renderPopover(product,quantity2),this.popover.classList.add(settings.classes.visible),clearTimeout(this.popoverTimer),this.popoverTimer=setTimeout(()=>{this.popoverHide()},settings.times.closeDropdownAfter)}popoverHide(){this.popover.classList.remove(settings.classes.visible),setTimeout(()=>{this.popover.innerHtml=""},300)}addProductEvent(){document.addEventListener("click",event=>{if(event.target.matches(settings.elements.buttonAddToCart)){event.preventDefault();const button=event.target;if(button.hasAttribute(settings.attributes.disabled))return;button.setAttribute(settings.attributes.disabled,!0),this.form=button.closest("form"),this.hideErrors=this.form?.getAttribute(settings.attributes.hideErrors)==="true";const quantity2=this.form.querySelector(settings.elements.qty).value,formData=new FormData(this.form);if(this.form.querySelector('[type="file"]'))return;this.addToCart(formData,null,button,quantity2),document.dispatchEvent(new CustomEvent("theme:cart:add",{bubbles:!0,detail:{selector:button}}))}})}getCart(){fetch(theme.routes.root+"cart.js").then(this.handleErrors).then(response=>response.json()).then(response=>(this.updateCounter(response.item_count),this.cart!==null&&(this.newTotalItems=response.items.length,this.buildTotalPrice(response),this.freeShippingMessageHandle(response.total_price),this.subtotal=response.total_price),fetch(theme.routes.cart_url+"?section_id=api-cart-items"))).then(response=>response.text()).then(response=>{this.build(response),this.cartMessage&&this.updateProgress()}).catch(error=>console.log(error))}addToCart(data,quickAddHolder=null,button=null,quantity2=1){const variantId=data.get("id");fetch(theme.routes.root+"cart/add.js",{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/javascript"},body:data}).then(response=>response.json()).then(response=>{let error=!1;if(response.status){publish(events$2.cartError,{source:"product-form",productVariantId:variantId,errors:response.description,message:response.message}),quickAddHolder!==null?this.addToCartError(response,quickAddHolder.element,button):this.addToCartError(response,null,button),this.hideErrors&&button!==null&&button.removeAttribute(settings.attributes.disabled),error=!0,this.hideErrors=!1;return}error||publish(events$2.cartUpdate,{source:"product-form",productVariantId:variantId}),this.ajaxEnabled?(this.cart!==null?this.getCart():this.renderCart(),button&&(button.classList.remove(settings.classes.loading),button.classList.add(settings.classes.success)),setTimeout(()=>{if(button!==null&&(button.removeAttribute(settings.attributes.disabled),button.classList.remove(settings.classes.success)),AMP_API)return;(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>=theme.sizes.mobile&&this.popoverShow(response,quantity2)},settings.times.timeoutAddProduct)):window.location.href=theme.routes.cart_url}).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(settings.elements.item).classList.add(settings.classes.loading),this.items.forEach(item=>{item.classList.add(settings.classes.disabled),item.querySelector(settings.elements.input).setAttribute(settings.attributes.disabled,!0),item.querySelector(settings.elements.input).blur(),item.querySelectorAll(sett
8ings.elements.button).forEach(button=>{button.setAttribute(settings.attributes.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 data={line:`${index+1}`,quantity:settedQuantity};return fetch(theme.routes.root+"cart/change.js",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(data)})}).then(this.handleErrors).then(response=>response.json()).then(response=>{if(newCount=response.item_count,valueIsEmpty&&(settedQuantity=1),this.ajaxEnabled)settedQuantity!==0?(this.cartLimitErrorIsHidden=newCount!==oldCount,this.toggleLimitError(newItem)):(this.cartLimitErrorIsHidden=!0,this.toggleLimitError()),this.updateCounter(newCount),this.buildTotalPrice(response),this.freeShippingMessageHandle(response.total_price),this.cartDiscounts=response.total_discount,this.cartMessage&&(this.subtotal=response.total_price,this.updateProgress()),this.getCart();else{const form=this.buttonHolder.closest("form");response.items.forEach(item=>{item.key===updateData.id&&(form.querySelector(`[${settings.attributes.dataId}="${item.key}"]`).value=item.quantity)}),form.submit()}}).catch(error=>{console.log(error),this.cartLimitErrorIsHidden=!1,this.toggleLimitError(error.json.message),this.resetItems()})}resetItems(){this.items.forEach(item=>{const input=item.querySelector(settings.elements.input),qty=input.getAttribute("value");input.removeAttribute(settings.attributes.disabled),input.value=qty,item.classList.remove(settings.classes.disabled,settings.classes.loading),item.querySelectorAll(settings.elements.button).forEach(button=>{button.removeAttribute(settings.attributes.disabled)})})}toggleLimitError(itemTitle=""){this.cartErrorHolder.querySelector(settings.elements.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(data,quickAddHolder,button){if(!this.ajaxEnabled||this.hideErrors)return;let errorContainer=this.popover;if(button!==null){const addToCartText=button.querySelector(settings.elements.buttonAddToCartText);addToCartText.textContent=theme.translations.form_submit_error,button.setAttribute(settings.attributes.disabled,settings.attributes.disabled),setTimeout(()=>{button.removeAttribute(settings.attributes.disabled),addToCartText.textContent=theme.translations.form_submit},1e3)}clearTimeout(this.popoverTimer),errorContainer&&(errorContainer.innerHTML=`<div class="popover-error">${data.message}: ${data.description}</div>`,errorContainer.classList.add(settings.classes.visible)),quickAddHolder&&this.html.dispatchEvent(new CustomEvent("theme:cart:add-error",{bubbles:!0,detail:{message:data.message,description:data.description,holder:quickAddHolder}})),this.popoverTimer=setTimeout(()=>{errorContainer.classList.remove(settings.classes.visible)},settings.times.closeDropdownAfter)}openCartDrawer(){this.popoverHide(),this.cart===null&&this.renderCart(),document.dispatchEvent(new CustomEvent("theme:drawer:close",{bubbles:!1})),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.cartScroll})),this.setCartClosePosition(),this.body.classList.add(settings.classes.cartVisible),this.cart.classList.add(settings.classes.open),this.cartToggle.setAttribute(settings.attributes.expanded,!0),this.accessibility.removeTrapFocus(),this.cartDrawerIsOpen=!0,this.cartFocusTimeout&&clearTimeout(this.cartFocusTimeout),this.cartFocusTimeout=setTimeout(()=>{this.accessibility.trapFocus(this.cart,{elementToFocus:this.cart.querySelector("a, button, input")})},500)}closeCartDrawer(){if(this.cartDrawerIsOpen=!1,document.dispatchEvent(new CustomEvent("theme:cart-drawer:close",{bubbles:!0})),this.accessibility.removeTrapFocus(),slideUp(this.cartErrorHolder,400),this.body.classList.contains(settings.classes.focused)){const button=document.querySelector(`${settings.elements.cartToggleElement}`);setTimeout(()=>{button.focus()},200)}this.body.classList.remove(settings.classes.cartVisible),this.cart.classList.remove(settings.classes.open),this.cartToggle.setAttribute(settings.attributes.expanded,!1),this.popoverHide(),this.scrollLockTimeout&&clearTimeout(this.scrollLockTimeout),this.scrollLockTimeout=setTimeout(()=>{document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))},500)}toggleCartDrawer(){this.body.classList.contains(settings.classes.template)||(this.cartDrawerIsOpen?this.closeCartDrawer():this.openCartDrawer())}eventToggleCart(){document.addEventListener("click",event=>{const clickedElement=event.target,isCartToggle=clickedElement.matches(settings.elements.cartToggleElement)||clickedElement.closest(settings.elements.cartToggleElement),isPopover=clickedElement.matches(settings.elements.popover)||clickedElement.closest(settings.elements.popover);(isCartToggle||isPopover)&&(this.toggleCartDrawer(),event.preventDefault())})}toggleClassesOnContainers(){this.emptyMessage.classList.toggle(settings.classes.hidden,this.hasItemsInCart()),this.buttonHolder.classList.toggle(settings.classes.hidden,!this.hasItemsInCart()),this.itemsHolder.classList.toggle(settings.classes.hidden,!this.hasItemsInCart())}build(data){if(this.cart===null){this.renderCart();return}this.totalItems!==this.newTotalItems&&(this.totalItems=this.newTotalItems,this.toggleClassesOnContainers());const fresh=document.createElement("div");fresh.innerHTML=data,this.itemsHolder.innerHTML=fresh.querySelector(settings.elements.apiContent).innerHTML,this.cartEvents(),this.initQuantity(this.ajaxEnabled)}updateCounter(countItems){countItems>0?this.cartToggle.classList.remove(settings.classes.cartEmpty):this.cartToggle.classList.add(settings.classes.cartEmpty),this.cartItemsCount&&(this.cartItemsCount.innerText=countItems<10?countItems:"9+")}hasItemsInCart(){return this.totalItems>0}buildTotalPrice(data){if(this.cart!==null)if(data.original_total_price>data.total_price&&data.cart_level_discount_applications.length>0?(this.cartOriginalTotal.classList.remove(settings.classes.hidden),this.cartOriginaTotalPrice.innerHTML=data.original_total_price===0?window.theme.translations.free:themeCurrency.formatMoney(data.original_total_price,theme.moneyWithoutCurrencyFormat)):this.cartOriginalTotal.classList.add(settings.classes.hidden),this.cartTotal.innerHTML=data.total_price===0?window.theme.translations.free:themeCurrency.formatMoney(data.total_price,theme.moneyWithCurrencyFormat),data.cart_level_discount_applications.length>0){const discountsMarkup=this.buildCartTotalDiscounts(data.cart_level_discount_applications);this.cartDiscountHolder.classList.remove(settings.classes.hidden),this.cartDiscountHolder.innerHTML=discountsMarkup}else this.cartDiscountHolder.classList.add(settings.classes.hidden)}buildCartTotalDiscounts(discounts){let discountMarkup="";const cartTotalDiscountsTemplateHtml=document.querySelector(settings.cartTotalDiscountsTemplate).innerHTML;
8return discounts.forEach(discount=>{const discountTemplate=document.createElement("div");discountTemplate.innerHTML=cartTotalDiscountsTemplateHtml;const title=discountTemplate.querySelector(settings.elements.cartDiscountTitle),price=discountTemplate.querySelector(settings.elements.cartDiscountPrice);title.textContent=discount.title,price.innerHTML=themeCurrency.formatMoney(discount.total_allocated_amount,theme.moneyWithoutCurrencyFormat),discountMarkup+=discountTemplate.innerHTML}),discountMarkup}setCartClosePosition(){if(this.cartToggle){const cartToggleTop=this.cartToggle.getBoundingClientRect().top,containerPadding=40;this.cartClose.style.top=`${cartToggleTop-containerPadding}px`}}freeShippingMessageHandle(total){this.cartMessage&&document.querySelectorAll(settings.elements.cartMessageItem).forEach(message=>{const cartMessageClass=message.hasAttribute(settings.elements.cartMessage)&&message.getAttribute(settings.elements.cartMessage)==="true"&&total!==0?settings.classes.defaultSuccess:settings.classes.hidden;message.classList.remove(settings.classes.hidden),message.classList.toggle(cartMessageClass,total>=this.cartFreeLimitShipping||total===0)})}cartBarProgress(progress=null){document.querySelectorAll(settings.elements.cartProgress).forEach(element=>{const progressPercentage=progress===null?element.getAttribute("data-percent"):progress;element.style.setProperty("--percent",progressPercentage)})}updateProgress(){const newPercentValue=this.subtotal/this.cartFreeLimitShipping*100,leftToSpend=themeCurrency.formatMoney(this.cartFreeLimitShipping-this.subtotal,theme.settings.moneyFormat);document.querySelectorAll(settings.elements.leftToSpend).forEach(element=>{element.innerHTML=leftToSpend.replace(".00","").replace(",00","")}),this.cartBarProgress(newPercentValue>100?100:newPercentValue)}}window.cart=new CartDrawer;const showElement=(elem,removeProp=!1,prop="block")=>{elem&&(removeProp?elem.style.removeProperty("display"):elem.style.display=prop)},selectors$K={saleClass:" is-sale",soldClass:" is-sold-out",apiContent:"[data-api-content]",productTemplate:"[data-product-template]"};Shopify.Products=(function(){const config={howManyToShow:4,howManyToStoreInMemory:10,wrapperId:"RecentlyViewed",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(selectors$K.productTemplate);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=()=>{showElement(wrapper,!0);const cookieItemsLength=cookie.read().length;if(Shopify.recentlyViewed&&howManyToShowItems&&cookieItemsLength&&cookieItemsLength<howManyToShowItems&&wrapper.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<wrapper.children.length;i++){const element=wrapper.children[i];allClassesArr.length&&element.classList.remove(...allClassesArr),addClassesArr.length&&element.classList.add(...addClassesArr)}}if(config.onComplete)try{config.onComplete()}catch(error){console.log("error: ",error)}},moveAlong=shown=>{productHandleQueue.length&&shown<config.howManyToShow?fetch("/products/"+productHandleQueue[0]+"?section_id=api-product-grid-item").then(response=>response.text()).then(product=>{const fresh=document.createElement("div");fresh.innerHTML=product,wrapper.innerHTML+=fresh.querySelector(selectors$K.apiContent).innerHTML,productHandleQueue.shift(),shown++,moveAlong(shown)}).catch(()=>{cookie.remove(productHandleQueue[0]),productHandleQueue.shift(),moveAlong(shown)}):finalize()};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)},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 selectors$J={inputSearch:'input[type="search"]'};class MainSearch extends HeaderSearchForm{constructor(){super(),this.allSearchInputs=document.querySelectorAll(selectors$J.inputSearch),this.setupEventListeners()}setupEventListeners(){let allSearchForms=[];
8this.allSearchInputs.forEach(input=>allSearchForms.push(input.form)),this.input.addEventListener("focus",this.onInputFocus.bind(this)),!(allSearchForms.length<2)&&(allSearchForms.forEach(form=>form.addEventListener("reset",this.onFormReset.bind(this))),this.allSearchInputs.forEach(input=>input.addEventListener("input",this.onInput.bind(this))))}onFormReset(event){super.onFormReset(event),super.shouldResetForm()&&this.keepInSync("",this.input)}onInput(event){const target=event.target;this.keepInSync(target.value,target)}onInputFocus(){isDesktop()||this.scrollIntoView({behavior:"smooth"})}keepInSync(value,target){this.allSearchInputs.forEach(input=>{input!==target&&(input.value=value)})}}customElements.define("main-search",MainSearch);const selectors$I={details:"details",input:'input:not([type="hidden"])',popdown:"[data-popdown]",popdownClose:"[data-popdown-close]",popdownToggle:"[data-popdown-toggle]",predictiveSearch:"predictive-search"},attributes$7={popdownUnderlay:"data-popdown-underlay"},classes$v={searchPopdownVisible:"has-search-popdown-visible"};class SearchPopdown extends HTMLElement{constructor(){super(),this.popdown=this.querySelector(selectors$I.popdown),this.popdownContainer=this.querySelector(selectors$I.details),this.popdownToggle=this.querySelector(selectors$I.popdownToggle),this.popdownClose=this.querySelector(selectors$I.popdownClose),this.a11y=a11y}connectedCallback(){this.popdownContainer.addEventListener("keyup",event=>event.code.toUpperCase()==="ESCAPE"&&this.close()),this.popdownClose.addEventListener("click",this.close.bind(this)),this.popdownToggle.addEventListener("click",this.onPopdownToggleClick.bind(this)),this.popdownToggle.setAttribute("role","button"),this.popdown.addEventListener("transitionend",event=>{event.propertyName=="visibility"&&this.popdownContainer.hasAttribute("open")&&this.popdownContainer.getAttribute("open")=="false"&&this.closeCallback()})}onPopdownToggleClick(event){event.preventDefault(),event.target.closest(selectors$I.details).hasAttribute("open")?this.close():this.open(event)}onBodyClick(event){(!this.contains(event.target)||event.target.hasAttribute(attributes$7.popdownUnderlay))&&this.close()}open(event){this.onBodyClickEvent=this.onBodyClickEvent||this.onBodyClick.bind(this),event.target.closest(selectors$I.details).setAttribute("open",""),document.body.addEventListener("click",this.onBodyClickEvent),document.body.classList.add(classes$v.searchPopdownVisible),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.popdown})),requestAnimationFrame(()=>{event.target.closest(selectors$I.details).setAttribute("open","true"),this.popdown.addEventListener("transitionend",e=>{e.target==this.popdown&&(this.a11y.trapFocus(this.popdown,{elementToFocus:this.popdown.querySelector(selectors$I.input)}),theme.a11yTrigger=event.target)},{once:!0})})}close(){this.popdownContainer.setAttribute("open","false"),document.body.removeEventListener("click",this.onBodyClickEvent),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}closeCallback(){this.popdownContainer.removeAttribute("open"),this.a11y.removeTrapFocus(),theme.a11yTrigger!==null&&theme.a11yTrigger.focus(),document.body.classList.remove(classes$v.searchPopdownVisible)}}customElements.define("header-search-popdown",SearchPopdown),window.isYoutubeAPILoaded=!1;function loadYoutubeAPI(){if(!window.isYoutubeAPILoaded){var tag=document.createElement("script");tag.src="https://www.youtube.com/iframe_api";var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}}function onYouTubeIframeAPIReady(){window.isYoutubeAPILoaded=!0,document.body.dispatchEvent(new CustomEvent("theme:youtube:api-ready"))}window.onYouTubeIframeAPIReady=onYouTubeIframeAPIReady,window.loadYoutubeAPI=loadYoutubeAPI,theme.ProductModel=(function(){let modelJsonSections={},models={},xrButtons={};const selectors2={productMediaWrapper:"[data-product-single-media-wrapper]",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.productMediaWrapper).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&&xrButton.element.setAttribute(selectors2.dataModel3d,model.modelId),pauseOtherMedia(model.mediaId),!window.theme.touched&&model.modelViewerUi.play()}),model.container.addEventListener("theme:media:hidden",function(){model.modelViewerUi.pause()}),model.container.addEventListener("theme:xr-launch",function(){model.modelViewerUi.pause()}),model.element.addEventListener("load",()=>{model.container.classList.remove(classes2.isLoading)}),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$H={templateAddresses:".template-customers-addresses",accountForm:"[data-form]",addressNewForm:"[data-form-new]",btnNew:"[data-button-new]",btnEdit:"[data-button-edit]",btnDelete:"[data-button-delete]",btnCancel:"[data-button-cancel]",dataFormId:"data-form-id",editAddress:"data-form-edit",addressCountryNew:"AddressCountryNew",addressProvinceNew:"AddressProvinceNew",addressProvinceContainerNew:"AddressProvinceContainerNew",addressCountryOption:"[data-country-option]",addressCountry:"AddressCountry",addressProvince:"AddressProvince",addressProvinceContainer:"AddressProvinceContainer",notOptionalInputs:'input[type="text"]:not(.optional)'},classes$u={hidden:"is-hidden",validation:"validation--showup"};class Addresses{constructor(section){this.section=section,this.addressNewForm=this.section.querySelector(selectors$H.addressNewForm),this.accountForms=this.section.querySelectorAll(selectors$H.accountForm),this.init(),this.validate()}init(){if(this.addressNewForm){const section=this.section,newAddressForm=this.addressNewForm;this.customerAddresses();const newButtons=section.querySelectorAll(selectors$H.btnNew);newButtons.length&&newButtons.forEach(button=>{button.addEventListener("click",function(e){e.preventDefault(),button.classList.add(classes$u.hidden),newAddressForm.classList.remove(classes$u.hidden)})});const editButtons=section.querySelectorAll(selectors$H.btnEdit);editButtons.length&&editButtons.forEach(button=>{button.addEventListener("click",function(e){e.preventDefault();const formId=this.getAttribute(selectors$H.dataFormId);section.querySelector(`[${selectors$H.editAddress}="${formId}"]`).classList.toggle(classes$u.hidden)})});const deleteButtons=section.querySelectorAll(selectors$H.btnDelete);deleteButtons.length&&deleteButtons.forEach(button=>{button.addEventListener("click",function(e){e.preventDefault();const formId=this.getAttribute(selectors$H.dataFormId);confirm(theme.translations.delete_confirm)&&Shopify.postLink("/account/addresses/"+formId,{parameters:{_method:"delete"}})})});const cancelButtons=section.querySelectorAll(selectors$H.btnCancel);cancelButtons.length&&cancelButtons.forEach(button=>{button.addEventListener("click",function(e){e.preventDefault(),this.closest(selectors$H.accountForm).classList.add(classes$u.hidden),document.querySelector(selectors$H.btnNew).classList.remove(classes$u.hidden)})})}}customerAddresses(){Shopify.CountryProvinceSelector&&new Shopify.CountryProvinceSelector(selectors$H.addressCountryNew,selectors$H.addressProvinceNew,{hideElement:selectors$H.addressProvinceContainerNew}),this.section.querySelectorAll(selectors$H.addressCountryOption).forEac
8h(element=>{const formId=element.getAttribute(selectors$H.dataFormId),countrySelector=`${selectors$H.addressCountry}_${formId}`,provinceSelector=`${selectors$H.addressProvince}_${formId}`,containerSelector=`${selectors$H.addressProvinceContainer}_${formId}`;new Shopify.CountryProvinceSelector(countrySelector,provinceSelector,{hideElement:containerSelector})})}validate(){this.accountForms.forEach(accountForm=>{const form=accountForm.querySelector("form"),inputs=form.querySelectorAll(selectors$H.notOptionalInputs);form.addEventListener("submit",event=>{let isEmpty=!1;inputs.forEach(input=>{input.value?input.nextElementSibling.classList.remove(classes$u.validation):(input.nextElementSibling.classList.add(classes$u.validation),isEmpty=!0)}),isEmpty&&event.preventDefault()})})}}const template=document.querySelector(selectors$H.templateAddresses);template&&new Addresses(template);const selectors$G={form:"[data-account-form]",showReset:"[data-show-reset]",hideReset:"[data-hide-reset]",recover:"[data-recover-password]",login:"[data-login-form]",recoverHash:"#recover"},classes$t={hidden:"is-hidden"};class Login{constructor(form){this.form=form,this.showButton=form.querySelector(selectors$G.showReset),this.hideButton=form.querySelector(selectors$G.hideReset),this.recover=form.querySelector(selectors$G.recover),this.login=form.querySelector(selectors$G.login),this.init()}init(){window.location.hash==selectors$G.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.recover.classList.remove(classes$t.hidden),this.login.classList.add(classes$t.hidden),window.location.hash=selectors$G.recoverHash,!1}hideRecoverPasswordForm(){return this.login.classList.remove(classes$t.hidden),this.recover.classList.add(classes$t.hidden),window.location.hash="",!1}}const loginForm=document.querySelector(selectors$G.form);loginForm&&new Login(loginForm);const selectors$F={frame:"[data-ticker-frame]",scale:"[data-ticker-scale]",text:"[data-ticker-text]",clone:"data-clone",moveTime:1.63,space:100},classes$s={tickerAnimated:"ticker--animated",tickerUnloaded:"ticker--unloaded",tickerComparator:"ticker__comparator"};class Ticker{constructor(el,stopClone=!1){this.frame=el,this.stopClone=stopClone,this.scale=this.frame.querySelector(selectors$F.scale),this.text=this.frame.querySelector(selectors$F.text),this.comparator=this.text.cloneNode(!0),this.comparator.classList.add(classes$s.tickerComparator),this.frame.appendChild(this.comparator),this.scale.classList.remove(classes$s.tickerUnloaded),this.checkWidthOnResize=debounce(()=>this.checkWidth(),100),this.listen()}listen(){document.addEventListener("theme:resize",this.checkWidthOnResize),this.checkWidth()}checkWidth(){const padding=window.getComputedStyle(this.frame).paddingLeft.replace("px","")*2;if(this.frame.clientWidth-padding<this.text.clientWidth||this.stopClone){if(this.text.classList.add(classes$s.tickerAnimated),this.scale.childElementCount===1){if(this.clone=this.text.cloneNode(!0),this.clone.setAttribute(selectors$F.clone,""),this.scale.appendChild(this.clone),this.stopClone)for(let index=0;index<10;index++){const cloneSecond=this.text.cloneNode(!0);cloneSecond.setAttribute(selectors$F.clone,""),this.scale.appendChild(cloneSecond)}const animationTimeFrame=this.text.clientWidth/selectors$F.space*selectors$F.moveTime;this.scale.style.setProperty("--animation-time",`${animationTimeFrame}s`)}}else{this.text.classList.add(classes$s.tickerAnimated);let clone=this.scale.querySelector(`[${selectors$F.clone}]`);clone&&this.scale.removeChild(clone),this.text.classList.remove(classes$s.tickerAnimated)}}unload(){document.removeEventListener("theme:resize",this.checkWidthOnResize)}}const selectors$E={slider:"[data-slider]",slide:"[data-slide]",slideValue:"data-slide",dataAutoplay:"data-autoplay",dataAutoplaySpeed:"data-speed",dataWatchCss:"data-watch-css",dataDraggable:"data-draggable",dataSlideIndex:"data-sli
8de-index",dataSliderStartIndex:"data-slider-start-index",dataArrowPositionMiddle:"data-arrow-position-middle",dataFade:"data-fade"},classes$r={classIsSelected:"is-selected",classSliderInitialized:"js-slider--initialized",classSliderArrowsHidden:"flickity-button-hide"};class Slider{constructor(container,slideshow=null,slideSelector=""){this.container=container,this.slideshow=slideshow||this.container.querySelector(selectors$E.slider),this.slideshow&&(this.slideshowSlides=this.slideshow.querySelectorAll(selectors$E.slide),this.autoPlay=this.slideshow.getAttribute(selectors$E.dataAutoplay)==="true",this.autoPlaySpeed=this.slideshow.getAttribute(selectors$E.dataAutoplaySpeed),this.infinite=this.slideshow.getAttribute(selectors$E.dataInfinite)!=="false",this.watchCss=this.slideshow.getAttribute(selectors$E.dataWatchCss)==="true",this.draggable=this.slideshow.getAttribute(selectors$E.dataDraggable)!=="false",this.sliderStartIndex=this.slideshow.hasAttribute(selectors$E.dataSliderStartIndex),this.fade=this.slideshow.getAttribute(selectors$E.dataFade)==="true",this.slideSelector=slideSelector,this.flkty=null,this.init())}init(){const sliderOptions={initialIndex:this.sliderStartIndex?parseInt(this.slideshow.getAttribute(selectors$E.dataSliderStartIndex)):0,autoPlay:this.autoPlay&&this.autoPlaySpeed?parseInt(this.autoPlaySpeed):!1,contain:!0,pageDots:!1,wrapAround:this.infinite,percentPosition:this.percentPosition,watchCSS:this.watchCss,draggable:this.draggable?">1":!1,cellSelector:this.slideSelector,on:{ready:()=>{requestAnimationFrame(()=>{this.slideshow.parentNode.dispatchEvent(new CustomEvent("theme:slider:loaded",{bubbles:!0,detail:{slider:this}}))}),this.slideshow.classList.contains(classes$r.classIsSelected)&&this.slideshow.classList.remove(classes$r.classIsSelected)}}};this.fade&&(sliderOptions.fade=!0,this.flkty=new FlickityFade(this.slideshow,sliderOptions)),this.fade||(this.flkty=new Flickity(this.slideshow,sliderOptions))}onUnload(){this.slideshow&&this.flkty&&(this.flkty.options.watchCSS=!1,this.flkty.destroy())}onBlockSelect(evt){if(!this.slideshow)return;const slide=this.slideshow.querySelector(`[${selectors$E.slideValue}="${evt.detail.blockId}"]`);if(!slide)return;let slideIndex=parseInt(slide.getAttribute(selectors$E.dataSlideIndex));this.multipleSlides&&!this.slideshow.classList.contains(classes$r.classSliderInitialized)&&(slideIndex=0),this.slideshow.classList.add(classes$r.classIsSelected),this.flkty.selectCell(slideIndex),this.flkty.stopPlayer()}onBlockDeselect(){this.slideshow&&(this.slideshow.classList.remove(classes$r.classIsSelected),this.autoPlay&&this.flkty.playPlayer())}}const selectors$D={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]"},attributes$6={dataStop:"data-stop",style:"style",dataTargetReferrer:"data-target-referrer"},classes$q={tickerAnimated:"ticker--animated",mobile:"mobile",desktop:"desktop"};class AnnouncementBar extends HTMLElement{constructor(){super(),this.locationPath=location.href,this.slides=this.querySelectorAll(selectors$D.barSlide),this.slider=this.querySelector(selectors$D.slider),this.initSliderFlag=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>=theme.sizes.small,this.initSliderEvent=event=>this.initSlider(event)}connectedCallback(){this.removeAnnouncement(),this.slider&&this.initSliders(),this.slider||this.initTickers(!0),this.addEventListener("theme:block:select",e=>{this.onBlockSelect(e)}),this.addEventListener("theme:block:deselect",e=>{this.onBlockDeselect(e)})}removeAnnouncement(){for(let index=0;index<this.slides.length;index++){const element=this.slides[index];element.hasAttribute(attributes$6.dataTargetReferrer)&&this.locationPath.indexOf(element.getAttribute(attributes$6.dataTargetReferrer))===-1&&!window.Shopify.designMode&&element.parentNode.removeChild(element)}}initSliders(){this.initSlider(),document.addEventListener("theme:resize:width",this.initSliderEvent),this.addEventListener("theme:slider:loaded",()=>this.initTickers())}initSlider(event){const windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;if(windowWidth>=theme.sizes.small&&this.initSliderFlag||windowWidth<theme.sizes.small&&!this.initSliderFlag){let slidesSelector="";this.slider.flkty&&this.slider.flkty.destroy(),windowWidth>=theme.sizes.small&&this.initSliderFlag?(this.initSliderFlag=!1,slidesSelector=`${selectors$D.barSlide}:not(.${classes$q.mobile})`):windowWidth<theme.sizes.small&&!this.initSliderFlag&&(this.initSliderFlag=!0,slidesSelector=`${selectors$D.barSlide}:not(.${classes$q.desktop})`),this.querySelector(slidesSelector)&&(this.slider=new Slider(this,this.querySelector(selectors$D.slider),slidesSelector),this.slider.flkty.reposition())}}initTickers(stopClone=!1){this.querySelectorAll(selectors$D.frame).forEach(element=>{new Ticker(element,stopClone)})}toggleTicker(e,isStoped=!1){const tickerScale=document.querySelector(selectors$D.tickerScale),element=document.querySelector(`[${selectors$D.slideValue}="${e.detail.blockId}"]`);isStoped&&element&&(tickerScale.setAttribute(attributes$6.dataStop,""),tickerScale.querySelectorAll(selectors$D.tickerText).forEach(textHolder=>{textHolder.classList.remove(classes$q.tickerAnimated),textHolder.style.transform=`translate3d(${-(element.offsetLeft-element.clientWidth)}px, 0, 0)`})),!isStoped&&element&&(tickerScale.querySelectorAll(selectors$D.tickerText).forEach(textHolder=>{textHolder.classList.add(classes$q.tickerAnimated),textHolder.removeAttribute(attributes$6.style)}),tickerScale.removeAttribute(attributes$6.dataStop))}onBlockSelect(e){this.slider?this.slider.onBlockSelect(e):this.toggleTicker(e,!0)}onBlockDeselect(e){this.slider?this.slider.onBlockDeselect(e):this.toggleTicker(e,!1)}disconnectedCallback(){document.removeEventListener("theme:resize:width",this.initSliderEvent)}}customElements.get("announcement-bar")||customElements.define("announcement-bar",AnnouncementBar),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$C={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:[]}
8,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$C.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=>{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$C.id)===null)throw new Error("Theme Sections: The section container provided does not have an id assigned to the "+selectors$C.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$C.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$C.type)===null?!1:container.getAttribute(selectors$C.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].c
8onstructor===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>0?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$C.id+'="'+id+'"]');container!==null&&load(container.getAttribute(selectors$C.type),container)}),document.addEventListener("shopify:section:reorder",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+selectors$C.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$C.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$B={aos:"data-aos"},removeAnimations=container=>{container.querySelectorAll(`[${selectors$B.aos}]`).forEach(element=>{element.removeAttribute(selectors$B.aos)})};function fetchProduct(handle2){const requestRoute=`${theme.routes.root}products/${handle2}.js`;return window.fetch(requestRoute).then(response=>response.json()).catch(e=>{console.error(e)})}const handle=str=>{str=str.toLowerCase();for(var toReplace=['"',"'","\\","(",")","[","]"],i=0;i<toReplace.length;++i)str=str.replace(toReplace[i],"");return str=str.replace(/\W+/g,"-"),str.charAt(str.length-1)=="-"&&(str=str.replace(/-+\z/,"")),str.charAt(0)=="-"&&(str=str.replace(/\A-+/,"")),str};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;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(data=>{resolve(data)}).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 defaults$1={color:"ash"},selectors$A={swatch:"data-swatch",swatchColor:"[data-swatch-color]",wrapper:"[data-grid-swatches]",template:"[data-swatch-template]",button:"[data-swatch-button]",link:"[data-swatch-link]",handle:"data-swatch-handle",label:"data-swatch-label"};class ColorMatch{constructor(options={}){this.settings={...defaults$1,...options},this.match=this.init()}getColor(){return this.match}
8init(){return loadScript({json: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=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.swatchColor=this.element.querySelector(selectors$A.swatchColor),this.colorString=element.getAttribute(selectors$A.swatch),new ColorMatch({color:this.colorString}).getColor().then(result=>{this.colorMatch=result,this.init()})}init(){this.colorMatch&&this.colorMatch.hex&&this.swatchColor.style.setProperty("--swatch",`${this.colorMatch.hex}`),this.colorMatch&&this.colorMatch.path&&this.swatchColor.style.setProperty("background-image",`url(${this.colorMatch.path})`)}}class GridSwatch{constructor(wrap2,container){this.template=document.querySelector(selectors$A.template).innerHTML,this.wrap=wrap2,this.container=container,this.handle=wrap2.getAttribute(selectors$A.handle);const label=wrap2.getAttribute(selectors$A.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.swatches.forEach(swatch=>{let variant=this.product.variants.find(variant2=>variant2.options.includes(swatch));if(variant){const swatchTemplate=document.createElement("div");swatchTemplate.innerHTML=this.template;const button=swatchTemplate.querySelector(selectors$A.button),swatchElement=swatchTemplate.querySelector(`[${selectors$A.swatch}]`),link=swatchTemplate.querySelector(selectors$A.link),swatchColor=swatchTemplate.querySelector(selectors$A.swatchColor);button.dataset.value=swatch,swatchElement.dataset.swatch=swatch,swatchElement.dataset.swatchVariant=variant.id,link.href=`${this.product.url}?variant=${variant.id}`,link.textContent=swatch,swatchColor.classList.add(`${swatchColor.classList[0]}--${handle(swatch)}`),this.wrap.innerHTML+=swatchTemplate.innerHTML}}),this.swatchElements=this.wrap.querySelectorAll(`[${selectors$A.swatch}]`),this.swatchElements.forEach(el=>{new Swatch(el)})}}const makeGridSwatches=container=>{container.querySelectorAll(selectors$A.wrapper).forEach(wrap2=>{new GridSwatch(wrap2,void 0)})},swatchSection={onLoad(){this.swatches=[],this.container.querySelectorAll(`[${selectors$A.swatch}]`).forEach(el=>{this.swatches.push(new Swatch(el))})}},swatchGridSection={onLoad(){makeGridSwatches(this.container)}},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$z={itemsParent:"[data-custom-scrollbar-items]",scrollbar:"[data-custom-scrollbar]",scrollbarTrack:"[data-custom-scrollbar-track]"};class CustomScrollbar{constructor(container){this.itemsParent=container.querySelector(selectors$z.itemsParent),this.scrollbar=container.querySelector(selectors$z.scrollbar),this.scrollbarTrack=container.querySelector(selectors$z.scrollbarTrack),this.trackWidth=0,this.calcPositionEvent=throttle(()=>this.calculatePosition(),50),this.calcTrackEvent=()=>this.calculateTrackWidth(),this.scrollbar&&this.itemsParent&&(this.events(),this.calculateTrackWidth())}events(){this.itemsParent.addEventListener("scroll",this.calcPositionEvent),document.addEventListener("theme:resize:width",this.calcTrackEvent)}calculateTrackWidth(){this.trackWidth=100/this.itemsParent.children.length,this.trackWidth=this.trackWidth<5?5:this.trackWidth,this.scrollbar.style.setProperty("--track-width",`${this.trackWidth}%`)}calculatePosition(){const reducedScrollbarWidth=this.scrollbar.clientWidth*((100-this.trackWidth)/100);let position=this.itemsParent.scrollLeft/(this.itemsParent.scrollWidth-this.itemsParent.clientWidth);position*=reducedScrollbarWidth,this.scrollbar.style.setProperty("--position",`${Math.round(position)}px`)}destroy(){this.itemsParent.removeEventListener("scroll",this.calcPositionEvent),document.removeEventListener("theme:resize:width",this.calcTrackEvent)}}
8const selectors$y={productContainer:"[data-product-container]",productSlideshow:"[data-product-slideshow]",productImage:"[data-product-single-media-wrapper]",productThumbs:"[data-product-single-media-thumbs]",productThumb:"[data-thumbnail]",productThumbLink:"[data-thumbnail-id]",deferredMediaButton:"[data-deferred-media-button]",mediaType:"data-type",id:"data-id",tabIndex:"tabindex",arrows:"data-arrows",dots:"data-dots"},classes$p={active:"active",sliderEnabled:"flickity-enabled",scrollable:"product--layout-scrollable",mediaHidden:"media--hidden",focusEnabled:"is-focused",thumbsArrows:"product__images__slider-nav--arrows",isMoving:"is-moving"};class InitSlider{constructor(section,slide){this.slide=slide,this.container=section.container,this.productContainer=this.container.querySelector(selectors$y.productContainer),this.scrollable=this.productContainer.classList.contains(classes$p.scrollable),this.slideshow=this.container.querySelector(selectors$y.productSlideshow),this.productImages=this.container.querySelectorAll(selectors$y.productImage),this.thumbs=this.container.querySelector(selectors$y.productThumbs),this.flkty=null,this.flktyNav=null,this.checkThumbsWidthResizeEvent=()=>this.checkThumbsWidth(),this.scrollableResizeEvent=()=>this.toggleCustomScrollbar(),this.productImages.length>1&&this.init()}init(){this.createSlider(),this.createSliderNav(),this.createScrollable(),document.addEventListener("theme:resize",this.checkThumbsWidthResizeEvent)}createSlider(){if(!this.slideshow)return;const instance=this,firstSlide=this.slideshow.querySelectorAll(`[${selectors$y.mediaType}]`)[0],arrows=this.slideshow.getAttribute(selectors$y.arrows)==="true",dots=this.slideshow.getAttribute(selectors$y.dots)==="true",flickityOptions={autoPlay:!1,arrowShape:theme.icons.arrowNavSlider,prevNextButtons:arrows,contain:!0,pageDots:dots,adaptiveHeight:!0,wrapAround:!0};if(this.flkty=new Flickity(this.slideshow,flickityOptions),firstSlide){const firstType=firstSlide.getAttribute(selectors$y.mediaType);(firstType==="model"||firstType==="video"||firstType==="external_video")&&(this.flkty.options.draggable=!1,this.flkty.updateDraggable())}this.flkty.on("dragStart",function(){instance.slideshow.classList.add(classes$p.isMoving)}),this.flkty.on("change",function(index){const currentMedia=this.cells[index].element,newMedia=this.selectedElement;currentMedia.dispatchEvent(new CustomEvent("theme:media:hidden")),newMedia.classList.remove(classes$p.mediaHidden)}),this.flkty.on("settle",function(){const currentMedia=this.selectedElement,mediaType=currentMedia.getAttribute(selectors$y.mediaType);mediaType==="model"||mediaType==="video"||mediaType==="external_video"?(instance.flkty.options.draggable=!1,instance.flkty.updateDraggable()):(instance.flkty.options.draggable=!0,instance.flkty.updateDraggable()),instance.switchMedia(currentMedia),instance.slideshow.classList.remove(classes$p.isMoving)}),this.slide&&theme.settings.slideToSecondImage&&setTimeout(()=>{const slider=this.container.querySelector("#spice-flickity");this.flktyNew=Flickity.data(slider),this.flktyNew&&this.flktyNew.select(1)},300)}createSliderNav(){if(!this.thumbs||!this.slideshow)return;const flickityOptionsNav={asNavFor:this.slideshow,pageDots:!1,prevNextButtons:!0,arrowShape:theme.icons.arrowNavSlider,groupCells:!0,contain:!0};this.flktyNav=new Flickity(this.thumbs,flickityOptionsNav),this.checkThumbsWidth(),this.thumbs.querySelectorAll(selectors$y.productThumbLink).forEach(thumbLink=>{thumbLink.addEventListener("click",e=>{e.preventDefault()})})}checkThumbsWidth(){if(!this.thumbs)return;const thumbs=this.thumbs.querySelectorAll(selectors$y.productThumb),thumbsContainerPadding=parseInt(window.getComputedStyle(this.thumbs).paddingLeft.replace("px",""))*2,thumbsContainerWidth=this.thumbs.offsetWidth-thumbsContainerPadding;let thumbsWidth=0;thumbs.forEach(thumb=>{thumbsWidth+=thumb.offsetWidth}),thumbsContainerWidth<thumbsWidth?this.thumbs.classList.add(classes$p.thumbsArrows):this.thumbs.classList.remove(classes$p.thumbsArrows),typeof this.flktyNav=="object"&&this.flktyNav.resize()}createScrollable(){this.scrollable&&(this.toggleCustomScrollbar(),document.addEventListener("theme:resize",this.scrollableResizeEvent))}toggleCustomScrollbar(){window.innerWidth<theme.sizes.small?this.customScrollbar=new CustomScrollbar(this.container):this.customScrollbar&&this.customScrollbar.destroy()}switchMedia(currentMedia){const otherMedia=Array.prototype.filter.call(currentMedia.parentNode.children,function(child){return child!==currentMedia});
8document.body.classList.contains(classes$p.focusEnabled)&&currentMedia.dispatchEvent(new Event("focus")),otherMedia.length&&otherMedia.forEach(element=>{element.classList.add(classes$p.mediaHidden),element.dispatchEvent(new CustomEvent("theme:media:hidden"))}),currentMedia.classList.remove(classes$p.mediaHidden),currentMedia.dispatchEvent(new CustomEvent("theme:media:visible"));const deferredMedia=currentMedia.querySelector("deferred-media");deferredMedia&&deferredMedia.getAttribute("loaded")!==!0&&currentMedia.querySelector(selectors$y.deferredMediaButton).dispatchEvent(new Event("click",{bubbles:!1}))}unload(){document.removeEventListener("theme:resize",this.checkThumbsWidthResizeEvent)}}const selectors$x={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$o={loaded:"loaded"};class LoadVideoVimeo{constructor(container){this.container=container,this.player=this.container.querySelector(selectors$x.videoIframe),this.player&&(this.videoID=this.player.getAttribute(selectors$x.dataVideoId),this.videoType=this.player.getAttribute(selectors$x.dataVideoType),this.enableBackground=this.player.getAttribute(selectors$x.dataEnableBackground)==="true",this.disableSound=this.player.getAttribute(selectors$x.dataEnableSound)==="false",this.enableAutoplay=this.player.getAttribute(selectors$x.dataEnableAutoplay)!=="false",this.enableLoop=this.player.getAttribute(selectors$x.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.enableBackground,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(data){state.innerHTML=data.html,setTimeout(function(){state.parentElement.classList.add(classes$o.loaded)},1e3)}).catch(function(error){console.log("error",error)})}}const selectors$w={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$n={loaded:"loaded"},players=[];class LoadVideoYT{constructor(container){this.container=container,this.player=this.container.querySelector(selectors$w.videoIframe),this.player&&(this.videoOptionsVars={},this.videoID=this.player.getAttribute(selectors$w.dataVideoId),this.videoType=this.player.getAttribute(selectors$w.dataVideoType),this.videoType=="youtube"&&(this.checkPlayerVisibilityFlag=this.player.getAttribute(selectors$w.dataCheckPlayerVisibility)==="true",this.playerID=this.player.querySelector(selectors$w.youtubeWrapper)?this.player.querySelector(selectors$w.youtubeWrapper).id:this.player.id,this.player.hasAttribute(selectors$w.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$w.videoWrapper)||e.target.closest(selectors$w.videoWrapper)){const playerID=e.target.querySelector(selectors$w.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$w.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$n.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 isVisible=visibilityHelper.isElementPartiallyVisible(playerElement)||visibilityHelper.isElementTotallyVisible(playerElement);box.top<0&&playerElement.clientHeight+box.top>=0&&(isVisible=!0),isVisible&&player&&typeof player.playVideo=="function"?player.playVideo():!isVisible&&player&&typeof player.pauseVideo=="function"&&player.pauseVideo()}onUnload(){const playerID="youtube-"+this.container.getAttribute(selectors$w.dataSectionId);players[playerID]&&players[playerID].destroy()}}const selectors$v={popupContainer:".pswp",popupCloseBtn:".pswp__custom-close",popupIframe:"iframe, video",popupCu
8stomIframe:".pswp__custom-iframe",popupThumbs:".pswp__thumbs",dataOptionClasses:"data-pswp-option-classes",dataVideoType:"data-video-type"},classes$m={classCurrent:"is-current",classCustomLoader:"pswp--custom-loader",classCustomOpen:"pswp--custom-opening",classLoader:"pswp__loader"},loaderHTML=`<div class="${classes$m.classLoader}"><div class="loader pswp__loader-line"><div class="loader-indeterminate"></div></div></div>`;class LoadPhotoswipe{constructor(items,options=""){this.accessibility=a11y,this.items=items,this.pswpElement=document.querySelectorAll(selectors$v.popupContainer)[0],this.popup=null,this.popupThumbs=null,this.popupThumbsContainer=this.pswpElement.querySelector(selectors$v.popupThumbs),this.closeBtn=this.pswpElement.querySelector(selectors$v.popupCloseBtn),this.closeButtonClick=()=>this.closeButtonClickEvent();const defaultOptions={history:!1,focus:!1,mainClass:""};this.options=options!==""?options:defaultOptions,this.init()}init(){this.pswpElement.classList.add(classes$m.classCustomOpen),this.initLoader(),loadScript({url:window.theme.assets.photoswipe}).then(()=>this.loadPopup()).catch(e=>console.error(e))}initLoader(){if(this.pswpElement.classList.contains(classes$m.classCustomLoader)&&this.options!==""&&this.options.mainClass){this.pswpElement.setAttribute(selectors$v.dataOptionClasses,this.options.mainClass);let loaderElem=document.createElement("div");loaderElem.innerHTML=loaderHTML,loaderElem=loaderElem.firstChild,this.pswpElement.appendChild(loaderElem)}else this.pswpElement.setAttribute(selectors$v.dataOptionClasses,"")}loadPopup(){const PhotoSwipe=window.themePhotoswipe.PhotoSwipe.default,PhotoSwipeUI=window.themePhotoswipe.PhotoSwipeUI.default;this.pswpElement.classList.contains(classes$m.classCustomLoader)&&this.pswpElement.classList.remove(classes$m.classCustomLoader),this.pswpElement.classList.remove(classes$m.classCustomOpen),this.popup=new PhotoSwipe(this.pswpElement,PhotoSwipeUI,this.items,this.options),this.popup.init(),this.accessibility.trapFocus(this.pswpElement),this.initVideo(),this.thumbsActions(),this.closeBtn&&this.closeBtn.addEventListener("click",this.closeButtonClick),this.popup.listen("close",()=>this.onClose())}closeButtonClickEvent(){this.popup.close(),this.accessibility.removeTrapFocus(),theme.a11yTrigger!==null&&theme.a11yTrigger.focus()}initVideo(){const videoContainer=this.pswpElement.querySelector(selectors$v.popupCustomIframe);if(videoContainer){const videoType=videoContainer.getAttribute(selectors$v.dataVideoType);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$v.popupThumbs} > *`),this.popupThumbs.forEach((element,i)=>{element.addEventListener("click",e=>{e.preventDefault(),element.parentElement.querySelector(`.${classes$m.classCurrent}`).classList.remove(classes$m.classCurrent),element.classList.add(classes$m.classCurrent),this.popup.goTo(i)})}),this.popup.listen("imageLoadComplete",()=>this.setCurrentThumb()),this.popup.listen("beforeChange",()=>this.setCurrentThumb()))}stopDisabledScroll(e){e.stopPropagation()}onClose(){const popupIframe=this.pswpElement.querySelector(selectors$v.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(selectors$v.dataOptionClasses,"");const loaderElem=this.pswpElement.querySelector(`.${classes$m.classLoader}`);loaderElem&&this.pswpElement.removeChild(loaderElem),this.accessibility.removeTrapFocus(),theme.a11yTrigger!==null&&theme.a11yTrigger.focus(),this.closeBtn.removeEventListener("click",this.closeButtonClick)}setCurrentThumb(){const lastCurrentThumb=this.pswpElement.querySelector(`${selectors$v.popupThumbs} > .${classes$m.classCurrent}`);if(lastCurrentThumb&&lastCurrentThumb.classList.remove(classes$m.classCurrent),!this.popupThumbs)return;const currentThumb=this.popupThumbs[this.popup.getCurrentIndex()];currentThumb.classList.add(classes$m.classCurrent),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>
8currentThumbLeft){const currentThumbMarginLeft=parseInt(window.getComputedStyle(currentThumb).marginLeft);this.popupThumbsContainer.scrollTo({top:0,left:currentThumbLeft-currentThumbMarginLeft,behavior:"smooth"})}}}const selectors$u={productContainer:"[data-product-container]",productSlideshow:"[data-product-slideshow]",zoomWrapper:"[data-zoom-wrapper]",dataImageSrc:"data-image-src",dataImageWidth:"data-image-width",dataImageHeight:"data-image-height",dataImageZoomEnable:"data-lightbox"},classes$l={popupClass:"pswp-zoom-gallery",popupClassNoThumbs:"pswp-zoom-gallery--single",isMoving:"is-moving"};class Zoom{constructor(section){this.container=section.container,this.productContainer=this.container.querySelector(selectors$u.productContainer),this.slideshow=this.container.querySelector(selectors$u.productSlideshow),this.zoomWrappers=this.container.querySelectorAll(selectors$u.zoomWrapper),this.zoomEnable=this.productContainer.getAttribute(selectors$u.dataImageZoomEnable)==="true",this.zoomEnable&&this.init()}init(){this.zoomWrappers.length&&this.zoomWrappers.forEach((element,i)=>{element.addEventListener("click",e=>{e.preventDefault();const isMoving=this.slideshow&&this.slideshow.classList.contains(classes$l.isMoving);theme.a11yTrigger=element,isMoving||this.createZoom(i)}),element.addEventListener("keyup",e=>{e.keyCode===theme.keyboardKeys.ENTER&&(e.preventDefault(),element.dispatchEvent(new Event("click")))})})}createZoom(indexImage){const instance=this;let items=[],counter=0;this.zoomWrappers.forEach(elementImage=>{const imgSrc=elementImage.getAttribute("href"),imgWidth=parseInt(elementImage.getAttribute(selectors$u.dataImageWidth)),imgHeight=parseInt(elementImage.getAttribute(selectors$u.dataImageHeight));if(items.push({src:imgSrc,w:imgWidth,h:imgHeight,msrc:imgSrc}),counter+=1,instance.zoomWrappers.length===counter){let popupClass=`${classes$l.popupClass}`;counter===1&&(popupClass=`${classes$l.popupClass} ${classes$l.popupClassNoThumbs}`);const options={barsSize:{top:0,bottom:"auto"},history:!1,focus:!1,index:indexImage,mainClass:popupClass,showHideOpacity:!0,showAnimationDuration:250,hideAnimationDuration:250,closeOnScroll:!1,closeOnVerticalDrag:!1,captionEl:!1,closeEl:!0,closeElClasses:["caption-close"],tapToClose:!1,clickToCloseNonZoomable:!1,maxSpreadZoom:2,loop:!0,spacing:0,allowPanToNext:!0,pinchToClose:!1};new LoadPhotoswipe(items,options)}})}}const hosts={html5:"html5",youtube:"youtube"},selectors$t={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"},classes$k={mediaHidden:"media--hidden"};theme.mediaInstances={};class Video{constructor(section){this.section=section,this.container=section.container,this.id=section.id,this.players={},this.init()}init(){this.container.querySelectorAll(selectors$t.mediaContainer).forEach(mediaContainer=>{const deferredMediaButton=mediaContainer.querySelector(selectors$t.deferredMediaButton);deferredMediaButton&&deferredMediaButton.addEventListener("click",this.loadContent.bind(this,mediaContainer))})}loadContent(mediaContainer){if(mediaContainer.querySelector(selectors$t.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$t.deferredMedia);deferredMedia.appendChild(element).focus(),deferredMedia.setAttribute("loaded",!0),this.players[mediaId]={mediaId,sectionId:this.id,c
8ontainer: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.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){return video.tagName==="VIDEO"?hosts.html5:video.tagName==="IFRAME"&&/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(video.src)?hosts.youtube:null}loadVideo(video,host){video.host===host&&video.ready()}createPlayer(mediaId){const video=this.players[mediaId],enableLooping=video.container.dataset.enableVideoLooping;switch(video.host){case hosts.html5:video.element.play(),video.element.addEventListener("play",()=>{this.pauseOtherMedia(mediaId)}),video.container.addEventListener("theme:media:hidden",event=>this.onHidden(event)),video.container.addEventListener("theme:xr-launch",event=>this.onHidden(event)),video.container.addEventListener("theme:media:visible",event=>this.onVisible(event)),this.observeVideo(video);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()},onStateChange:event=>{event.data===0&&enableLooping&&event.target.seekTo(0),event.data===1&&this.pauseOtherMedia(mediaId),event.data}}}),window.isYoutubeAPILoaded=!0,video.container.addEventListener("theme:media:hidden",event=>this.onHidden(event)),video.container.addEventListener("theme:xr-launch",event=>this.onHidden(event)),video.container.addEventListener("theme:media:visible",event=>this.onVisible(event)),this.observeVideo(video)});break}}observeVideo(video){new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{entry.intersectionRatio!=1?this.pauseVideo(video):this.playVideo(video)})},{threshold:1}).observe(video.element)}playVideo(video){video.player&&video.player.playVideo?video.player.playVideo():video.element&&video.element.play&&video.element.play()}pauseVideo(video){video.player&&video.player.pauseVideo?video.player.pauseVideo():video.element&&video.element.pause&&video.element.pause()}onHidden(event){if(typeof event.target.dataset.mediaId<"u"){const mediaId=event.target.dataset.mediaId,video=this.players[mediaId];this.pauseVideo(video)}}onVisible(event){if(typeof event.target.dataset.mediaId<"u"){const mediaId=event.target.dataset.mediaId,video=this.players[mediaId];this.playVideo(video)}}pauseOtherMedia(mediaId){const mediaIdString=`[${selectors$t.mediaId}="${mediaId}"]`,currentMedia=document.querySelector(`${selectors$t.productMediaWrapper}${mediaIdString}`),otherMedia=document.querySelectorAll(`${selectors$t.productMediaWrapper}:not(${mediaIdString})`);currentMedia.classList.remove(classes$k.mediaHidden),otherMedia.length&&otherMedia.forEach(element=>{element.dispatchEvent(new CustomEvent("theme:media:hidden")),element.classList.add(classes$k.mediaHidden)})}}theme.mediaInstances={};const selectors$s={videoPlayer:"[data-video]",modelViewer:"[data-model]",sliderEnabled:"flickity-enabled",classMediaHidden:"media--hidden"};class Media{constructor(section,slide=!1){this.section=section,this.id=section.id,this.container=section.container,this.slide=slide}init(){this.detect3d(),this.launch3d(),new Video(this.section),new Zoom(this.section),new InitSlider(this.section,this.slide)}detect3d(){const modelViewerElements=this.container.querySelectorAll(selectors$s.modelViewer);modelViewerElements.length&&modelViewerElements.forEach(element=>{theme.ProductModel.init(element,this.id)})}launch3d(){const instance=this;document.addEventListener("shopify_xr_launch",function(){instance.container.querySelector(`${selectors$s.modelViewer}:not(.${selectors$s.classMediaHidden})`).dispatchEvent(new CustomEvent("theme:xr-launch"))})}}const selectors$r={list:"[data-store-availability-list]"},defaults={close:".js-modal-close",open:".js-modal-open-store-availability-modal",openClass:"modal--is-active",openBodyClass:"modal--is-visible",closeModalOnClick:!1};class Modals{constructor(id,options){if(this.modal=document.getElementById(id),this.accessibility=a11y,!this.modal)return!1;this.nodes={parents:[document.querySelector("html"),document.body]},this.config=Object.assign(defaults,options),this.modalIsOpen=!1,this.focusOnOpen=this.config.focusOnOpen?document.getElementById(this.config.focusOnOpen):this.modal,this.openElement=document.querySelector(this.config.open),this.init()}init(){this.openElement.addEventListener("click",this.open.bind(this)),this.modal.querySelector(this.config.close).addEventListener("click",this.closeModal.bind(this))}open(evt){var self=this,externalCall=!1;this.modalIsOpen||(evt?evt.preventDefault():externalCall=!0,evt&&evt.stopPropagation&&evt.stopPropagation(),this.modalIsOpen&&!externalCall&&this.closeModal(),this.modal.classList.add(this.config.openClass),this.nodes.parents.forEac
8h(function(node){node.classList.add(self.config.openBodyClass)}),this.modalIsOpen=!0,this.scrollableElement=document.querySelector(selectors$r.list),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.scrollableElement})),this.accessibility.trapFocus(this.modal),this.bindEvents())}closeModal(){if(this.modalIsOpen){document.activeElement.blur(),this.modal.classList.remove(this.config.openClass);var self=this;document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})),this.nodes.parents.forEach(function(node){node.classList.remove(self.config.openBodyClass)}),this.modalIsOpen=!1,this.accessibility.removeTrapFocus(),this.openElement.focus(),this.unbindEvents()}}bindEvents(){this.keyupHandler=this.keyupHandler.bind(this),this.clickHandler=this.clickHandler.bind(this),document.body.addEventListener("keyup",this.keyupHandler),document.body.addEventListener("click",this.clickHandler)}unbindEvents(){document.body.removeEventListener("keyup",this.keyupHandler),document.body.removeEventListener("click",this.clickHandler)}keyupHandler(event){event.keyCode===27&&this.closeModal()}clickHandler(event){this.config.closeModalOnClick&&!this.modal.contains(event.target)&&this.closeModal()}}const selectors$q={body:"body",storeAvailabilityModal:"[data-store-availability-modal]",storeAvailabilityModalOpen:"[data-store-availability-modal-open]",storeAvailabilityModalClose:"[data-store-availability-modal-close]",storeAvailabilityModalProductTitle:"[data-store-availability-modal-product-title]"},classes$j={openClass:"store-availabilities-modal--active",hidden:"visually-hidden"};class StoreAvailability{constructor(container){this.container=container}updateContent(variantId,productTitle){this._fetchStoreAvailabilities(variantId,productTitle)}clearContent(){this.container.innerHTML=""}_initModal(){return new Modals("StoreAvailabilityModal",{close:selectors$q.storeAvailabilityModalClose,open:selectors$q.storeAvailabilityModalOpen,closeModalOnClick:!0,openClass:classes$j.openClass})}_fetchStoreAvailabilities(variantId,productTitle){const variantSectionUrl=`/variants/${variantId}/?section_id=store-availability`;this.clearContent();const self=this;fetch(variantSectionUrl).then(function(response){return response.text()}).then(function(storeAvailabilityHTML){if(storeAvailabilityHTML.trim()==="")return;const body=document.querySelector(selectors$q.body);let storeAvailabilityModal=body.querySelector(selectors$q.storeAvailabilityModal);storeAvailabilityModal&&storeAvailabilityModal.remove(),self.container.innerHTML=storeAvailabilityHTML,self.container.innerHTML=self.container.firstElementChild.innerHTML,self.container.querySelector(selectors$q.storeAvailabilityModalOpen)&&(self.modal=self._initModal(),self._updateProductTitle(productTitle),storeAvailabilityModal=self.container.querySelector(selectors$q.storeAvailabilityModal),storeAvailabilityModal&&body.appendChild(storeAvailabilityModal))})}_updateProductTitle(productTitle){const stripHtmlRegex=/(<([^>]+)>)/gi,storeAvailabilityModalProductTitle=this.container.querySelector(selectors$q.storeAvailabilityModalProductTitle);storeAvailabilityModalProductTitle.textContent=productTitle.replace(stripHtmlRegex,"")}}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),_val
8idateSerializedArray(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$p={idInput:'[name="id"]',optionInput:'[name^="options"]',quantityInput:'[name="quantity"]',propertyInput:'[name^="properties"]'};function ProductForm(element,product,options){this.element=element,this.product=_validateProductObject(product),options=options||{},this._listeners=new Listeners,this._listeners.add(this.element,"submit",this._onSubmit.bind(this,options)),this.optionInputs=this._initInputs(selectors$p.optionInput,options.onOptionChange),this.propertyInputs=this._initInputs(selectors$p.propertyInput,options.onPropertyChange)}ProductForm.prototype.destroy=function(){this._listeners.removeAll()},ProductForm.prototype.options=function(){return _serializeInputValues(this.optionInputs,function(item){var regex=/(?:^(options\[))(.*?)(?:\])/;return item.name=regex.exec(item.name)[2],item})},ProductForm.prototype.variant=function(){return getVariantFromSerializedArray(this.product,this.options())},ProductForm.prototype.properties=function(){return _serializeInputValues(this.propertyInputs,function(item){var regex=/(?:^(properties\[))(.*?)(?:\])/;return item.name=regex.exec(item.name)[2],item})},ProductForm.prototype.quantity=function(){return this.quantityInputs[0]?Number.parseInt(this.quantityInputs[0].value,10):1},ProductForm.prototype._setIdInputValue=function(value){var idInputElement=this.element.querySelector(selectors$p.idInput);idInputElement||(idInputElement=document.createElement("input"),idInputElement.type="hidden",idInputElement.name="id",this.element.appendChild(idInputElement)),idInputElement.value=value.toString()},ProductForm.prototype._onSubmit=function(options,event){event.dataset=this._getProductFormEventData(),this._setIdInputValue(event.dataset.variant.id),options.onFormSubmit&&options.onFormSubmit(event),event.preventDefault();const formData=new FormData(event.target);let data={items:[{id:event.dataset.variant.id,selling_plan:formData.get("selling_plan"),quantity:1}]};fetch(theme.routes.root+"cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(data)}).then(response=>response.json()).then(parsedState=>{if(parsedState.status==422){console.error(parsedState.status);return}document.body.classList.contains("quickView-is-visible")&&(document.querySelector(".quickView.is-visible").classList.remove("is-visible"),document.body.classList.remove("quickView-is-visible")),document.body.classList.add("rebuy-cart-visible")}).catch(error=>{debug()&&console.error(error)})},ProductForm.prototype._onFormEvent=function(cb){return typeof cb>"u"?Function.prototype:function(event){event.dataset=this._getProductFormEventData(),cb(event)}.bind(this)},ProductForm.prototype._initInputs=function(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))},ProductForm.prototype._getProductFormEventData=function(){return{options:this.options(),variant:this.variant(),properties:this.properties()}};
8function _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},[])}function _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}const events$1={variantChange:"variant-change"},selectors$o={addToCart:"[data-add-to-cart]",addToCartText:"[data-add-to-cart-text]",colorLabel:"[data-color-label]",comparePrice:"[data-compare-price]",dataImageId:"data-id",dataOption:"[data-option]",idInput:'[name="id"]',notificationForm:"[data-notification-form]",originalSelectorId:"[data-product-select]",preOrderTag:"_preorder",priceWrapper:"[data-price-wrapper]",product:"[data-product-container]",productForm:"[data-product-form-container]",productImage:"[data-product-single-media-wrapper]",productImagesScroller:"[data-custom-scrollbar-items]",productJson:"[data-product-json]",productPrice:"[data-product-price]",productSlideshow:"[data-product-slideshow]",remainingCount:"[data-remaining-count]",remainingMax:"[data-remaining-max]",remainingWrapper:"[data-remaining-wrapper]",remainingJSON:"[data-product-remaining-json]",shopBarImageActive:"[data-shop-bar-image-active]",showQuantity:"[data-show-quantity]",storeAvailabilityContainer:"[data-store-availability-container]",unitBase:"[data-product-base]",unitPrice:"[data-product-unit-price]",unitWrapper:"[data-product-unit]",variantId:"[data-variant-id]",variantIdAttr:"data-variant-id",dataSectionId:"data-section-id"},classes$i={hidden:"hidden",hiddenPrice:"product__price--hidden",onboarding:"onboarding-product",productPriceSale:"product__price--sale",remainingIn:"count-is-in",remainingLow:"count-is-low",remainingOut:"count-is-out",remainingUnavailable:"count-is-unavailable",scrollable:"product--layout-scrollable",shopBarImageShown:"shop-bar__image--shown",sliderEnabled:"flickity-enabled",visuallyHidden:"visually-hidden"},attributes$5={remainingMax:"data-remaining-max",shopBarImageActive:"data-shop-bar-image-active",variantId:"data-variant-id"};class ProductAddForm{constructor(section){if(this.section=section,this.container=section.container,this.sectionId=this.container.getAttribute(selectors$o.dataSectionId),this.product=this.container.querySelector(selectors$o.product),this.onboarding=this.product.classList.contains(classes$i.onboarding),this.scrollable=this.product.classList.contains(classes$i.scrollable),this.storeAvailabilityContainer=this.container.querySelector(selectors$o.storeAvailabilityContainer),!(!this.product||this.onboarding)){if(this.productForm=this.container.querySelector(selectors$o.productForm),this.remainingWrapper=this.container.querySelector(selectors$o.remainingWrapper),this.remainingWrapper){const remainingMaxWrap=this.container.querySelector(selectors$o.remainingMax);remainingMaxWrap&&(this.remainingMaxInt=parseInt(remainingMaxWrap.getAttribute(attributes$5.remainingMax),10),this.remainingCount=this.container.querySelector(selectors$o.remainingCount),this.remainingJSONWrapper=this.container.querySelector(selectors$o.remainingJSON),this.remainingJSON=null,this.remainingJSONWrapper&&this.remainingJSONWrapper.innerHTML!==""?this.remainingJSON=JSON.parse(this.remainingJSONWrapper.innerHTML):console.warn("Missing product quantity JSON"))}this.product.querySelector(selectors$o.showQuantity)&&new QuantityCounter(this.container).init(),this.init(),this.hasUnitPricing=this.container.querySelector(selectors$o.unitWrapper)}}init(){let productJSON=null;const productElemJSON=this.container.querySelector(selectors$o.productJson);if(productElemJSON&&(productJSON=productElemJSON.innerHTML),productJSON?(this.productJSON=JSON.parse(productJSON),this.linkForm()):console.error("Missing product JSON"),this.storeAvailabilityContainer){this.storeAvailability=new StoreAvailability(this.storeAvailabilityContainer);let variantId=this.productForm.product.variants[0].id;this.productForm.product.variants.length>1&&(variantId=this.productForm.variant().id),this.storeAvailability.updateContent(variantId,this.productForm.product.title)}}destroy(){this.productForm.destroy()}linkForm(){this.productForm=new ProductForm(this.productForm,this.productJSON,{onOptionChange:this.onOptionChange.bind(this)});const variants=this.productForm.product.variants,variant=variants.length>1?this.productForm._getProductFormEventData().variant:variants[0];this.fireHookEvent(variant),variants.length>1&&this.updateRemaining(this.productForm._getProductFormEventData())}onOptionChange(evt){evt.dataset||(evt.dataset=this._getProductFormEventData()),this.updateAddToCartState(evt),this.updateProductPrices(evt),this.updateColorName(evt),this.updateHiddenSelect(evt),this.updateShopBarImage(evt),this.updateRemaining(evt),this.updateFormElements(evt),this.fireHookEvent(evt.dataset.variant),this.storeAvailability&&this.updateStoreAvailability(evt),window.stikky||this.updateProductImage(evt)}updateFormElements(evt){const form=evt.target.closest("form"),elementsToHide=[form.querySelector(".selling_plan_app_container")],qtyAdjust=form.querySelector(".qty__adjust");evt.dataset.variant.available?(elementsToHide.length>0&&elementsToHide.forEach(element=>{element&&element.classList.remove("hidden")}),qtyAdjust&&(qtyAdjust.querySelectorAll(".qty__adjust-btn").forEach(button=>button.removeAttribute("disabled")),qtyAdjust.querySelector(".qty__adjust-input")?.removeAttribute("disabled"))):(elementsToHide.length>0&&elementsToHide.forEach(element=>{element&&element.classList.add("hidden")}),qtyAdjust&&(qtyAdjust.querySelectorAll(".qty__adjust-btn").forEach(button=>button.setAttribute("disabled","disabled")),qtyAdjust.querySelector(".qty__adjust-input")?.setAttribute("disabled","disabled")))}updateHiddenSelect(evt){let variant=evt?.dataset?.variant;if(!variant&&evt?.target&&this.productForm&&typeof this.productForm.variant=="function"&&(variant=this.productForm.variant()),variant){let idInputElement=this.container.querySelector(selectors$o.idInput);idInputElement||(idInputElement=document.createElement("input"),idInputElement.type="hidden",idInputElement.name="id",this.element.appendChild(id
8InputElement)),idInputElement.value=variant.id.toString(),idInputElement.dispatchEvent(new Event("change",{bubbles:!0}))}}updateAddToCartState(evt){const variant=evt.dataset.variant,notificationForm=this.container.querySelectorAll(selectors$o.notificationForm),addToCart=this.container.querySelectorAll(selectors$o.addToCart),addToCartText=this.container.querySelectorAll(selectors$o.addToCartText),formSelects=this.container.querySelectorAll(selectors$o.originalSelectorId);let addText=theme.translations.add_to_cart;this.productJSON.tags.includes(selectors$o.preOrderTag)&&(addText=theme.translations.pre_order),notificationForm.length&&notificationForm.forEach(element=>{variant&&variant.available?element.classList.add(classes$i.hidden):element.classList.remove(classes$i.hidden)}),addToCart.length&&addToCart.forEach(element=>{variant&&variant.available?element.disabled=!1:element.disabled=!0}),addToCartText.length&&addToCartText.forEach(element=>{const button=element.closest("button");variant?variant.available?(element.innerHTML=addText,button.removeAttribute("disabled")):(element.innerHTML=theme.translations.sold_out,button.setAttribute("disabled",!0)):(element.innerHTML=theme.translations.unavailable,button.setAttribute("disabled",!0))}),formSelects&&variant&&formSelects.forEach(formSelect=>{formSelect.value=variant.id})}updateStoreAvailability(evt){evt.dataset.variant?this.storeAvailability.updateContent(evt.dataset.variant.id,evt.dataset.variant.title):this.storeAvailability.clearContent()}updateRemaining(evt){const variant=evt?.variant||evt.dataset.variant;if(this.remainingWrapper?.classList.remove(classes$i.remainingIn,classes$i.remainingOut,classes$i.remainingUnavailable,classes$i.remainingLow),variant&&this.remainingWrapper&&this.remainingJSON){const remaining=this.remainingJSON[variant.id];(remaining==="out"||remaining<1)&&this.remainingWrapper.classList.add(classes$i.remainingOut),(remaining==="in"||remaining>=this.remainingMaxInt)&&this.remainingWrapper.classList.add(classes$i.remainingIn),(remaining==="low"||remaining>0&&remaining<this.remainingMaxInt)&&(this.remainingWrapper.classList.add(classes$i.remainingLow),this.remainingCount&&(this.remainingCount.innerHTML=remaining))}else!variant&&this.remainingWrapper&&this.remainingWrapper.classList.add(classes$i.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}updateProductPrices(evt){const variant=evt.dataset.variant;this.container.querySelectorAll(selectors$o.priceWrapper).forEach(wrap2=>{const comparePrice=wrap2.querySelector(selectors$o.comparePrice)||wrap2,productPrice=wrap2.querySelector(selectors$o.productPrice)||wrap2;variant?(wrap2.classList.remove(classes$i.hiddenPrice),productPrice.innerHTML=variant.price===0?window.theme.translations.free:themeCurrency.formatMoney(variant.price,theme.settings.moneyFormat)):wrap2.classList.add(classes$i.hiddenPrice),variant&&variant.compare_at_price>variant.price?(comparePrice.innerHTML=themeCurrency.formatMoney(variant.compare_at_price,theme.settings.moneyFormat),comparePrice.classList.remove(classes$i.visuallyHidden),productPrice.classList.add(classes$i.productPriceSale)):comparePrice&&(comparePrice.innerHTML="",comparePrice.classList.add(classes$i.visuallyHidden),productPrice.classList.remove(classes$i.productPriceSale))}),this.hasUnitPricing&&this.updateProductUnits(evt)}updateProductUnits(evt){const variant=evt.dataset.variant;let unitPrice=null;if(variant&&variant.unit_price&&(unitPrice=variant.unit_price),unitPrice){const base=this.getBaseUnit(variant),price=themeCurrency.formatMoney(variant.unit_price,theme.moneyWithoutCurrencyFormat);this.container.querySelector(selectors$o.unitPrice).innerHTML=price,this.container.querySelector(selectors$o.unitBase).innerHTML=base,this.container.querySelector(selectors$o.unitWrapper).classList.remove(classes$i.hidden)}else this.container.querySelector(selectors$o.unitWrapper).classList.add(classes$i.hidden)}updateColorName(evt){const target=evt.target,optionLabel=target.closest(selectors$o.dataOption).querySelector(selectors$o.colorLabel);
8target.tagName==="INPUT"&&optionLabel!==null&&(optionLabel.innerText=target.value)}updateProductImage(evt){evt.dataset.variant&&theme.settings.slideToSecondImage&&setTimeout(()=>{const slider=this.container.querySelectorAll(selectors$o.productSlideshow)[1];this.flkty=Flickity.data(slider.previousElementSibling),this.flkty.select(1)},200)}updateShopBarImage(evt){const variant=evt.dataset.variant,shopBarImages=this.container.querySelectorAll(selectors$o.variantId),activeImage=this.container.querySelector(selectors$o.shopBarImageActive);!variant||variant.featured_image===null||(activeImage&&(activeImage.classList.remove(classes$i.shopBarImageShown),activeImage.removeAttribute(attributes$5.shopBarImageActive)),shopBarImages.forEach(element=>{Number(variant.id)===Number(element.getAttribute(attributes$5.variantId))&&(element.classList.add(classes$i.shopBarImageShown),element.setAttribute(attributes$5.shopBarImageActive,""))}))}fireHookEvent(variant){publish(events$1.variantChange,{data:{sectionId:this.sectionId,variant}})}}const productFormSection={onLoad(){this.section=new ProductAddForm(this)}},selectors$n={id:"id",apiContent:"[data-api-content]",container:"[data-section-id]",collectionSlider:"[data-collection-slider]",collectionSliderWrapper:"[data-collection-slider-wrapper]",quickviewWrap:"[data-quickview-wrap]",quickviewId:"data-quickview-id",quickviewClose:"[data-quickview-close]",featuredBlock:"[data-collection-featured-block]",productBlock:"[data-product-block]",productContainer:"[data-product-container]",productImage:"[data-product-single-media-wrapper]",addToCart:"[data-add-to-cart]",handle:"data-trigger-quickview",productSlider:"[data-product-slideshow]",swatch:"[data-swatch]",videoLoop:"data-video-looping"},classes$h={isLoading:"is-loading",isLoaded:"is-loaded",isSelected:"is-selected",isVisible:"is-visible",isQuickviewOpen:"is-quickview-open",focusEnabled:"is-focused",sliderEnabled:"flickity-enabled",mediaHidden:"media--hidden",buttonAlt:"button--alt"};class QuickviewButton{constructor(button,id){this.button=button,this.id=id,this.container=this.button.closest(selectors$n.container),this.collectionSliderWrapper=this.container.querySelector(selectors$n.collectionSliderWrapper),this.layoutCarousel=this.container.querySelector(selectors$n.collectionSlider),this.handle=this.button.getAttribute(selectors$n.handle),this.productBlock=this.button.closest(selectors$n.productBlock),this.quickview=null,this.quickviewWrap=null,this.quickviewClose=null,this.quickviewWrapHeight=0,this.isQuickViewLoading=!1,this.accessibility=a11y,this.swatches=[],this.form={},this.init(),document.querySelector(".quickView__background").addEventListener("click",this.hide.bind(this))}init(){this.initButton(),this.initFetch()}initFetch(){this.productBlock.addEventListener("theme:quickview:open",()=>{this.renderProduct()},!1)}renderProduct(){fetch(`${theme.routes.root}products/${this.handle}?section_id=api-quickview`).then(response=>response.text()).then(data=>{const fresh=document.createElement("div");fresh.innerHTML=data.replaceAll("||product-handle||",this.handle);const uniq=fresh.querySelector(selectors$n.quickviewWrap).dataset.quickviewId;this.layoutCarousel&&this.collectionSliderWrapper?this.collectionSliderWrapper.insertAdjacentHTML("beforeend",fresh.querySelector(selectors$n.apiContent).innerHTML):this.productBlock.insertAdjacentHTML("beforeend",fresh.querySelector(selectors$n.apiContent).innerHTML),this.productBlock.classList.add(classes$h.isLoaded),this.quickviewWrap=this.container.querySelector(`[${selectors$n.quickviewId}="${uniq}"]`),this.quickviewClose=this.quickviewWrap.querySelector(selectors$n.quickviewClose),this.quickviewWrapHeight=this.quickviewWrap.querySelector(selectors$n.productC
8ontainer).offsetHeight,this.quickview=this.quickviewWrap.parentNode,window.dispatchEvent(new CustomEvent("theme:quickview:open")),this.onLoaded(),this.show()}).catch(function(error){console.log("error: ",error)})}initButton(){const initButtons=this.productBlock.querySelectorAll(`[${selectors$n.handle}='${this.handle}']`);initButtons.length&&initButtons.forEach(element=>{element.addEventListener("click",e=>{e.preventDefault();const productBlockLoaded=this.productBlock.classList.contains(classes$h.isLoaded),productBlockVisible=this.productBlock.classList.contains(classes$h.isQuickviewOpen),siblingsVisible=this.productBlock.parentNode.querySelector(`.${classes$h.isQuickviewOpen}`)!==null,eventQuickview=new CustomEvent("theme:quickview:open",{handle:this.handle});this.isQuickViewLoading||(this.isQuickViewLoading=!0,productBlockLoaded&&productBlockVisible?this.hide():productBlockLoaded&&!productBlockVisible&&!siblingsVisible?this.show():productBlockLoaded&&!productBlockVisible&&siblingsVisible?(this.hide(),setTimeout(()=>{this.show()},200)):siblingsVisible?(this.hide(),setTimeout(()=>{this.productBlock.dispatchEvent(eventQuickview)},200)):this.productBlock.dispatchEvent(eventQuickview))})})}show(){bodyScrollLock.disableBodyScroll(document.body);const sub=(window.innerHeight-this.quickviewWrapHeight)/2,scrollPosition=this.quickviewWrap.getBoundingClientRect().top+window.scrollY-sub-theme.dimensions.headerScrolled,featuredBlockHeight=getHeight(selectors$n.featuredBlock),isFocusEnabled=document.body.classList.contains(classes$h.focusEnabled),quickViewPattern="api-quickview",quickViewIds=this.productBlock.querySelectorAll(`[id*="${quickViewPattern}"]`),quickViewFors=this.productBlock.querySelectorAll(`[for*="${quickViewPattern}"]`);document.documentElement.style.setProperty("--collection-featured-block-height",`${featuredBlockHeight}px`),quickViewIds.forEach(element=>{if(!element.classList.contains("quickView")){const uniqueId=element.i
8d.replace(quickViewPattern,this.id);element.id=uniqueId}}),quickViewFors.forEach(element=>{const uniqueFor=element.getAttribute("for").replace(quickViewPattern,this.id);element.setAttribute("for",uniqueFor)}),this.quickview.classList.remove(classes$h.isLoading),trapFocus(this.quickview),window.scrollTo({top:scrollPosition,left:0,behavior:"smooth"}),this.productBlock.classList.add(classes$h.isQuickviewOpen),this.quickview.classList.add(classes$h.isVisible),this.isQuickViewLoading=!1,isFocusEnabled&&this.accessibility.trapFocus(this.quickviewWrap,{elementToFocus:this.quickviewClose}),document.body.classList.add("quickView-is-visible")}hide(){document.body.classList.remove("quickView-is-visible");const productBlocks=this.productBlock.parentNode.querySelectorAll(selectors$n.productBlock),isFocusEnabled=document.body.classList.contains(classes$h.focusEnabled);if(productBlocks.forEach(productBlock=>{if(productBlock.classList.contains(classes$h.isQuickviewOpen)){const visibleImage=productBlock.querySelector(`${selectors$n.productImage}.${classes$h.isSelected}`),uniq=productBlock.dataset.quickviewElement,quickview=this.container.querySelector(`[${selectors$n.quickviewId}="${uniq}"]`).parentNode;visibleImage!==null&&(visibleImage.dispatchEvent(new CustomEvent("theme:media:hidden")),visibleImage.classList.remove(classes$h.mediaHidden)),quickview&&quickview.classList.remove(classes$h.isVisible,classes$h.isLoading),productBlock.classList.remove(classes$h.isQuickviewOpen)}}),this.isQuickViewLoading=!1,this.accessibility.removeTrapFocus(),isFocusEnabled){const button=document.querySelector(`[${selectors$n.handle}="${this.handle}"]`);setTimeout(()=>{document.documentElement.style.setProperty("--collection-featured-block-height","none"),button.focus()},300)}bodyScrollLock.clearAllBodyScrollLocks()}onLoaded(){const sectionId=`${this.id}-${this.quickviewWrap.getAttribute(selectors$n.quickviewId)}`,hasSlider=this.quickviewWrap.querySelector(selectors$n.productSlider).classList.contains(classes$h.sliderEnabled),section={id:sectionId,container:this.quickviewWrap,type:"quickview"};theme.settings.enableVideoLooping&&this.quickviewWrap.setAttribute(selectors$n.videoLoop,!0),hasSlider?window.dispatchEvent(new Event("resize")):typeof theme.mediaInstances[this.id]>"u"?(theme.mediaInstances[sectionId]=new Media(section),theme.mediaInstances[sectionId].init()):theme.mediaInstances[sectionId].initSlider(),this.form=new ProductAddForm(section),theme.settings.showQuantity&&new QuantityCounter(section.container).init(),section.container.querySelectorAll(selectors$n.swatch).forEach(swatch=>{this.swatches.push(new Swatch(swatch))}),this.quickviewClose.addEventListener("click",e=>{e.preventDefault(),this.hide()}),document.addEventListener("keyup",event2=>{event2.keyCode===theme.keyboardKeys.ESCAPE&&document.querySelectorAll(`${selectors$n.productBlock}.${classes$h.isVisible}`).length&&this.hide()});const event=new CustomEvent("theme:quickview:loaded",{bubbles:!0});this.productBlock.dispatchEvent(event),this.initPaymentButton(),this.quickviewWrap.querySelector(".selling_plan_app_container")&&new SellingPlansWidget(this.quickview.querySelector(".selling_plan_app_container"))}initPaymentButton(){const enablePaymentButton=theme.settings.enablePaymentButton,enableAcceptTerms=theme.settings.enableAcceptTerms,addToCart=this.quickviewWrap.querySelector(selectors$n.addToCart);enablePaymentButton&&!enableAcceptTerms?(addToCart.classList.add(classes$h.buttonAlt),typeof Shopify<"u"&&typeof Shopify.PaymentButton<"u"&&typeof Shopify.PaymentButton.init<"u"&&Shopify.PaymentButton.init()):addToCart.classList.remove(classes$h.buttonAlt)}}const selectors$m={trigger:"[data-trigger-quickview]",dataSectionId:"data-section-id"},classes$g={init:"is-init"};let sections$i={};class Quickview{constructor(container){this.container=container,this.id=this.container.dataset.sectionId,theme.settings.showQuickView&&this.init()}init(){sections$i[this.id]=[];const buttons=this.container.querySelectorAll(selectors$m.trigger);buttons.length&&buttons.forEach(element=>
8{element.classList.contains(classes$g.init)||(sections$i[this.id].push(new QuickviewButton(element,this.id)),element.classList.add(classes$g.init))})}}const quickviewSection={onLoad(){this.section=new Quickview(this.container)}},selectors$l={infinityContainer:"[data-infinity]",pagination:"[data-pagination]",collectionBlockImage:"[data-product-image]",dataId:"data-section-id"};let sections$h={};class Ajaxify{constructor(container){this.container=container,this.infinityContainer=this.container.querySelector(selectors$l.infinityContainer),this.endlessScroll=null,this.infinityContainer&&this.init()}init(){const id=this.container.getAttribute(selectors$l.dataId);this.fix(),this.endlessScroll=new Ajaxinate({container:`section[${selectors$l.dataId}="${id}"] ${selectors$l.infinityContainer}`,pagination:`section[${selectors$l.dataId}="${id}"] ${selectors$l.pagination}`,callback:()=>{makeGridSwatches(this.container),new Quickview(this.container)}})}fix(){Ajaxinate.prototype.loadMore=function(){this.request=new XMLHttpRequest,this.request.onreadystatechange=function(){if(!this.request.responseXML||!this.request.readyState===4||!this.request.status===200)return;const newContainer=this.request.responseXML.querySelector(this.settings.container),newPagination=this.request.responseXML.querySelector(this.settings.pagination);this.containerElement.insertAdjacentHTML("beforeend",newContainer.innerHTML),typeof newPagination>"u"||newPagination===null?this.removePaginationElement():(this.paginationElement.innerHTML=newPagination.innerHTML,this.settings.callback&&typeof this.settings.callback=="function"&&this.settings.callback(this.request.responseXML),this.initialize())}.bind(this),this.request.open("GET",this.nextPageUrl,!0),this.request.responseType="document",this.request.send()}}unload(){this.endlessScroll&&this.endlessScroll.destroy()}}const ajaxify={onLoad(){sections$h=new Ajaxify(this.container)},onUnload:function(){typeof sections$h.unload=="function"&&sections$h.unload()}},sections$g={};class Blog{constructor(section){this.container=section.container,this.checkWidthOnResize=this.checkWindowWidth(),this.init()}init(){this.checkWindowWidth(),document.addEventListener("theme:resize",this.checkWidthOnResize)}checkWindowWidth(){window.innerWidth<theme.sizes.small&&removeAnimations(this.container)}onUnload(){document.removeEventListener("theme:resize",this.checkWidthOnResize)}}const BlogSection={onLoad(){sections$g[this.id]=new Blog(this)},onUnload(e){sections$g[this.id].onUnload(e)}};register("blog",[BlogSection,ajaxify]),register("featured-blog",BlogSection);const selectors$k={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",dataName:"data-name",ariaExpanded:"aria-expanded",ariaCurrent:"aria-current"},classes$f={listVisible:"popout-list--visible",currentSuffix:"--current",classPopoutAlternative:"popout-container--alt"};let sections$f={};class Popout{constructor(popout){this.container=popout,this.popoutList=this.container.querySelector(selectors$k.popoutList),this.popoutToggle=this.container.querySelector(selectors$k.popoutToggle),this.popoutInput=this.container.querySelector(selectors$k.popoutInput),this.popoutOptions=this.container.querySelectorAll(selectors$k.popoutOptions),this.popoutPrevent=this.container.getAttribute(selectors$k.popoutPrevent)==="true",this._connectOptions(),this._connectToggle(),this._onFocusOut(),this.popoutInput&&this.popoutInput.hasAttribute(selectors$k.popoutQuantity)&&document.addEventListener("theme:popout:update",this.updatePopout.bind(this))}unload(){this.popoutOptions.length&&this.popoutOptions.forEach(element=>{element.removeEventListener("theme:popout:click",this.popupOptionsClick.bind(this)),element.removeEventListener("click",this._connectOptionsDispatch.bind(this))}),this.popoutToggle.removeEventListener("click",this.popupToggleClick.bind(this)),this.popoutToggle.removeEventListener("focusout",this.popupToggleFocusout.bind(this)),this.popout
8List.removeEventListener("focusout",this.popupListFocusout.bind(this)),this.container.removeEventListener("keyup",this.containerKeyup.bind(this))}popupToggleClick(evt){const ariaExpanded=evt.currentTarget.getAttribute(selectors$k.ariaExpanded)==="true";evt.currentTarget.setAttribute(selectors$k.ariaExpanded,!ariaExpanded),this.popoutList.classList.toggle(classes$f.listVisible)}popupToggleFocusout(evt){this.container.contains(evt.relatedTarget)||this._hideList()}popupListFocusout(evt){const childInFocus=evt.currentTarget.contains(evt.relatedTarget);this.popoutList.classList.contains(classes$f.listVisible)&&!childInFocus&&this._hideList()}popupOptionsClick(evt){evt.preventDefault();let attrValue="";if(evt.currentTarget.getAttribute(selectors$k.dataValue)&&(attrValue=evt.currentTarget.getAttribute(selectors$k.dataValue)),this.popoutInput.value=attrValue,this.popoutPrevent){attrValue=evt.currentTarget.getAttribute(selectors$k.dataName),this.popoutInput.dispatchEvent(new Event("change")),!evt.detail.preventTrigger&&this.popoutInput.hasAttribute(selectors$k.popoutQuantity)&&this.popoutInput.dispatchEvent(new Event("input"));
8const currentElement=this.popoutList.querySelector(`[class*="${classes$f.currentSuffix}"]`);let targetClass=classes$f.currentSuffix;if(currentElement&&currentElement.classList.length){for(const currentElementClass of currentElement.classList)if(currentElementClass.includes(classes$f.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$k.ariaCurrent}]`);targetAttribute&&targetAttribute.hasAttribute(`${selectors$k.ariaCurrent}`)&&(targetAttribute.removeAttribute(`${selectors$k.ariaCurrent}`),evt.currentTarget.setAttribute(`${selectors$k.ariaCurrent}`,"true")),attrValue!==""&&(this.popoutToggle.textContent=attrValue),this.popupToggleFocusout(evt),this.popupListFocusout(evt)}else this._submitForm(attrValue)}updatePopout(evt){const targetElement=this.popout
8List.querySelector(`[${selectors$k.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$f.classPopoutAlternative)):this.container.classList.add(classes$f.classPopoutAlternative)}containerKeyup(evt){evt.which===theme.keyboardKeys.ESCAPE&&(this._hideList(),this.popoutToggle.focus())}bodyClick(evt){const isOption=this.container.contains(evt.target);this.popoutList.classList.contains(classes$f.listVisible)&&!isOption&&this._hideList()}_connectToggle(){this.popoutToggle.addEventListener("click",this.popupToggleClick.bind(this))}_connectOptions(){this.popoutOptions.length&&this.popoutOptions.forEach(element=>{element.addEventListener("theme:popout:click",this.popupOptionsClick.bind(this)),element.addEventListener("click",this._connectOptionsDispatch.bind(this))})}_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.popupToggleFocusout.bind(this)),this.popoutList.addEventListener("focusout",this.popupListFocusout.bind(this)),this.container.addEventListener("keyup",this.containerKeyup.bind(this)),document.body.addEventListener("click",this.bodyClick.bind(this))}_submitForm(value){const form=this.container.closest("form");form&&form.submit()}_hideList(){this.popoutList.classList.remove(classes$f.listVisible),this.popoutToggle.setAttribute(selectors$k.ariaExpanded,!1)}}const popoutSection={onLoad(){sections$f[this.id]=[],this.container.querySelectorAll(selectors$k.popoutWrapper).forEach(wrapper=>{sections$f[this.id].push(new Popout(wrapper))})},onUnload(){sections$f[this.id].forEach(popout=>{typeof popout.unload=="function"&&popout.unload()})}},getSiblings=el=>Array.prototype.filter.call(el.parentNode.children,function(child){return child!==el}),selectors$j={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$e={classInitialized:"is-initialized"};class RangeSlider{constructor(section){this.container=section.container,this.slider=section.querySelector(selectors$j.rangeSlider),this.resizeFilters=debounce(()=>this.init(),250),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$j.rangeDotLeft),this.touchRight=this.slider.querySelector(selectors$j.rangeDotRight),this.lineSpan=this.slider.querySelector(selectors$j.rangeLine),this.min=parseFloat(this.slider.getAttribute(selectors$j.dataMin)),this.max=parseFloat(this.slider.getAttribute(selectors$j.dataMax)),this.step=0,this.normalizeFact=26,this.init())}init(){let defaultMinValue=this.min;this.slider.hasAttribute(selectors$j.dataMinValue)&&(defaultMinValue=parseFloat(this.slider.getAttribute(selectors$j.dataMinValue)));let defaultMaxValue=this.max;this.slider.hasAttribute(selectors$j.dataMaxValue)&&(defaultMaxValue=parseFloat(this.slider.getAttribute(selectors$j.dataMaxValue))),defaultMinValue<this.min&&(defaultMinValue=this.min),defaultMaxValue>this.max&&(defaultMaxValue=this.max),defaultMinValue>defaultMaxValue&&(defaultMinValue=defaultMaxValue),this.slider.getAttribute(selectors$j.dataStep)&&(this.step=Math.abs(parseFloat(this.slider.getAttribute(selectors$j.dataStep)))),this.reset(),window.addEventListener("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$e.classInitialized)}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$j.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$j.dataMaxValue,maxValue)}onStart(event){event.preventDefault();let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),event.currentTarget===this.touchLeft?this.x=this.touchLeft.offsetLeft:this.x=this.touchRight.offsetLeft,this.startX=eventTouch.pageX-this.x,this.selectedTouch=event.currentTarget,this.slider.addEventListener("mousemove",this.onMoveEvent),this.slider.addEventListener("mouseup",this.onStopEvent),this.slider.addEventListener("touchmove",this.onMoveEvent),this.slider.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$j.dataMinValue),this.slider.getAttribute(selectors$j.dataMaxValue)),this.onChange(this.slider.getAttribute(selectors$j.dataMinValue),this.slider.getAttribute(selectors$j.dataMaxValue))}onStop(event){this.slider.removeEventListener("mousemove",this.onMoveEvent),this.slider.removeEventListener("mouseup",this.onStopEvent),this.slider.removeEventListener("touchmove",this.onMoveEvent),this.slider.removeEventListener("touchend",this.onStopEvent),this.selectedTouch=null,this.calculateValue(),this.onChanged(this.slider.getAttribute(selectors$j.dataMinValue),this.slider.getAttribute(selectors$j.dataMaxValue))}onChange(min,max){const rangeHolder=this.slider.closest(selectors$j.rangeHolder);if(rangeHolder){const priceMin=rangeHolder.querySelector(selectors$j.priceMin),priceMax=rangeHolder.querySelector(selectors$j.priceMax);priceMin&&priceMax&&(priceMin.value=min,priceMax.value=max)}}onChanged(min,max){this.slider.hasAttribute(selectors$j.dataFilterUpdate)&&this.slider.dispatchEvent(new CustomEvent("theme:filter: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$j.dataMinValue,minValue),this.selectedTouch===this.touchRight&&this.slider.setAttribute(selectors$j.dataMaxValue,maxValue)}onUnload(){this.resizeFilters&&window.removeEventListener("resize",this.resizeFilters)}}const sections$e={},selectors$i={accordionElements:"accordion-elements",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",collectionBlockImage:"[data-product-image]",collectionGridWrapper:"[data-collection-grid-wrapper]",collectionProducts:"[data-collection-
8products]",collectionSort:"[data-collection-sort]",collectionWrapper:"[data-collection-wrapper]",dataCollection:"data-collection",dataCount:"data-count",dataFilterMode:"data-filter-mode",dataSort:"data-sort",dataTag:"data-tag",dataTags:"data-tags",filterContainer:"[data-filter-container]",filterCount:"[data-filter-count]",filterTag:"[data-filter-tag]",filterTagButton:"[data-filter-tag-button]",filterTitle:"[data-accordion-trigger]",filters:"[data-filters]",filtersAvailable:"data-filters-available",filtersResets:"[data-filters-reset]",filtersResetButton:"[data-filters-reset-button]",filtersEnable:"data-filters-enable",filtersForm:"[data-filters-form]",filtersResetButtons:"[data-filter-reset-button]",inputs:"input, select, label, textarea",pagination:"[data-pagination]",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",swatch:"data-swatch"},classes$d={filtersTop:"collection__filters--top",filtersHasTagsSelected:"collection__filters--has-tags-selected",isActive:"is-active",isExpanded:"is-expanded",isLoading:"is-loading"};class Collection{constructor(section){this.container=section.container,this.collectionGridWrapper=this.container.querySelector(selectors$i.collectionGridWrapper),this.collectionSort=this.container.querySelector(selectors$i.collectionSort),this.collectionProducts=this.container.querySelector(selectors$i.collectionProducts),this.collectionWrapper=this.container.querySelector(selectors$i.collectionWrapper),this.pagination=this.container.querySelector(selectors$i.pagination),this.filterMode=this.container.getAttribute(selectors$i.dataFilterMode),this.accordionElements=this.container.querySelector(selectors$i.accordionElements),this.filters=this.container.querySelector(selectors$i.filters),this.filtersEnable=this.container.getAttribute(selectors$i.filtersEnable)==="true",this.filtersForm=this.container.querySelector(selectors$i.filtersForm),this.filtersResets=this.container.querySelector(selectors$i.filtersResets),this.filtersInputs=[],this.sort=null,this.tags=null,this.collection=null,this.reset=null,this.resizeFiltersEvent=()=>this.checkFiltersPosition(),this.documentClick=e=>this.closeOnOutsideClick(e),this.init()}init(){this.collectionSort&&this.initSort(),this.collectionProducts&&(this.collection=this.collectionProducts.getAttribute(selectors$i.dataCollection)),this.filtersEnable&&((this.filterMode==="tag"||this.filterMode==="group")&&(this.tags=JSON.parse(this.collectionProducts.getAttribute(selectors$i.dataTags)),this.initFilters()),this.filterMode==="default"&&this.initFacetedFilters()),this.initFilterToggleButtons(),this.checkFiltersPosition(),document.addEventListener("theme:resize",this.resizeFiltersEvent)}initSort(){this.collectionSort.addEventListener("change",evt=>{const url=new window.URL(window.location.href),value=evt.currentTarget.value,params=url.searchParams;params.set("sort_by",value),url.search=params.toString(),this.collectionProducts.setAttribute(selectors$i.dataSort,value),this.requestFilteredProducts(url.toString())})}initFilterToggleButtons(){this.filters&&document.addEventListener("click",this.documentClick)}initFacetedFilters(){this.filters.hasAttribute(selectors$i.filtersAvailable)&&(new RangeSlider(this.filtersForm),this.filtersInputs=this.filtersForm.querySelectorAll(selectors$i.inputs),this.filtersInputs.length&&this.filtersInputs.forEach(el=>{el.addEventListener("input",debounce(()=>{this.filtersForm&&typeof this.filtersForm.submit=="function"&&this.submitForm()},500))}),this.filtersForm.addEventListener("theme:filter:range-update",()=>this.updateRange()),this.initResets())}submitForm(){const formData=new FormData(this.filtersForm),search=new URLSearchParams(formData);this.requestFilteredProducts(`${this.collection}${search.toString()}`)}initFilters(){this.filters.querySelectorAll(selectors$i.filterTagButton).forEach(button=>{button.addEventListener("click",e=>{this.toggleFilter(button),e.preventDefault()})}),this.initResets()}initResets(){const resets=this.container.querySelectorAll(selectors$i.filtersResetButtons);this.resetAlt=this.collectionProducts.querySelector(selectors$i.filtersResetButton),resets.length&&resets.forEac
8h(button=>{button.addEventListener("click",e=>this.bindResetButton(e))}),this.resetAlt&&this.resetAlt.addEventListener("click",e=>this.bindResetButton(e))}toggleFilter(button){const filterTag=button.parentNode,selectedTag=button.getAttribute(selectors$i.dataTag),isTagActive=filterTag.classList.contains(classes$d.isActive),title=filterTag.parentNode.parentNode.previousElementSibling;this.sort=this.collectionProducts.getAttribute(selectors$i.dataSort);let sortParam="";if(isTagActive){const tagIndex=this.tags.indexOf(selectedTag);filterTag.classList.remove(classes$d.isActive),tagIndex>-1&&this.tags.splice(tagIndex,1)}else filterTag.classList.add(classes$d.isActive),this.tags.push(selectedTag);this.collectionProducts.setAttribute(selectors$i.dataTags,this.tags);const groupFiltersCount=filterTag.parentNode.querySelectorAll(`.${classes$d.isActive}`).length;title.querySelector(selectors$i.filterCount).setAttribute(selectors$i.dataCount,groupFiltersCount),(this.isTopPosition()||isTagActive)&&title.dispatchEvent(new Event("click")),this.sort&&(sortParam=`?sort_by=${this.sort}`);const requestedURL=`${this.collection}/${this.tags.join("+")}${sortParam}`;this.requestFilteredProducts(requestedURL)}updateRange(){if(this.filtersForm&&typeof this.filtersForm.submit=="function"){const rangeMin=this.filtersForm.querySelector(selectors$i.rangeMin),rangeMax=this.filtersForm.querySelector(selectors$i.rangeMax),priceMin=this.filtersForm.querySelector(selectors$i.priceMin),priceMax=this.filtersForm.querySelector(selectors$i.priceMax);if(rangeMin&&rangeMax&&priceMin&&priceMax&&rangeMin.hasAttribute(selectors$i.rangeMinValue)&&rangeMax.hasAttribute(selectors$i.rangeMaxValue)){const priceMinValue=parseInt(priceMin.placeholder),priceMaxValue=parseInt(priceMax.placeholder),rangeMinValue=parseInt(rangeMin.getAttribute(selectors$i.rangeMinValue)),rangeMaxValue=parseInt(rangeMax.getAttribute(selectors$i.rangeMaxValue));(priceMinValue!==rangeMinValue||priceMaxValue!==rangeMaxValue)&&(priceMin.value=rangeMinValue,priceMax.value=rangeMaxValue,this.submitForm())}}}closeOnOutsideClick(e){const isFiltersContainer=this.filters.contains(e.target),isFilterExpanded=this.filters.querySelector("details[open]");!isFiltersContainer&&isFilterExpanded&&this.isTopPosition()&&this.filters.querySelector("details[open]").querySelector(selectors$i.filterTitle).dispatchEvent(new Event("click"))}requestFilteredProducts(url){const collectionWrapperTop=parseInt(Math.ceil(this.collectionWrapper.offsetTop)-theme.dimensions.headerScrolled);this.collectionWrapper.classList.add(classes$d.isLoading),window.scrollTo({top:collectionWrapperTop,left:0,behavior:"smooth"}),history.replaceState&&window.history.pushState({path:url},"",url),fetch(url).then(response=>response.text()).then(data=>{const createdElement=document.createElement("div");createdElement.innerHTML=data;const collectionProducts=createdElement.querySelector(selectors$i.collectionProducts).innerHTML,pagination=createdElement.querySelector(selectors$i.pagination),filters=createdElement.querySelector(selectors$i.filters);if(this.collectionProducts.innerHTML=collectionProducts,this.pagination&&(this.pagination.innerHTML=pagination!==null?pagination.innerHTML:""),!this.pagination&&pagination!==null&&(this.collectionGridWrapper.appendChild(pagination),this.pagination=this.collectionGridWrapper.querySelector(selectors$i.pagination)),filters){const filtersHTML=filters.innerHTML;this.filters.innerHTML=filtersHTML,this.filtersForm=this.filters.querySelector(selectors$i.filtersForm),(this.filterMode==="tag"||this.filterMode==="group")&&(this.initFilters(),this.tags.length>0?this.filters.classList.add(classes$d.filtersHasTagsSelected):this.filters.classList.remove(classes$d.filtersHasTagsSelected)),this.filterMode==="default"&&this.initFacetedFilters(),this.checkFiltersPosition(),this.initFilterToggleButtons(),this.bindSwatchFilters(),new Collapsible(this.container)}ajaxify.onUnload(),new Ajaxify(this.container),makeGridSwatches(this.container),new Quickview(this.container)}).catch(e=>{this.collectionWrapper.classList.remove(classes$d.isLoading)}).finally(()=>{setTimeout(()=>{this.collectionWrapper.classList.remove(classes$d.isLoading)},450)})}checkFiltersPosition(){if(!this.filters)return;const filters=this.filters.querySelectorAll("details");this.isTopPosition()?(this.accordionElements.setAttribute("single",!0),filters.forEac
8h(filter=>{filter.hasAttribute("open")&&(filter.removeAttribute("open"),filter.querySelector(selectors$i.filterContainer).style.height=0)})):this.accordionElements.removeAttribute("single")}isTopPosition(){return window.innerWidth<theme.sizes.widescreen||this.filters.classList.contains(classes$d.filtersTop)}bindSwatchFilters(){this.swatches=[],this.container.querySelectorAll(`[${selectors$i.swatch}]`).forEach(el=>{this.swatches.push(new Swatch(el))})}bindResetButton(e){if(e.preventDefault(),this.filterMode==="tag"||this.filterMode==="group"){const button=e.currentTarget;if(button.getAttribute(selectors$i.dataTag)){const selectedTag=button.dataset.tag,tagIndex=this.tags.indexOf(selectedTag);tagIndex>-1&&this.tags.splice(tagIndex,1)}else this.tags=[];this.collectionProducts.setAttribute(selectors$i.dataTags,this.tags)}this.requestFilteredProducts(e.currentTarget.href)}onUnload(){document.removeEventListener("click",this.documentClick),document.removeEventListener("theme:resize",this.resizeFiltersEvent)}}const CollectionSection={onLoad(){sections$e[this.id]=new Collection(this)},onUnload(e){sections$e[this.id].onUnload(e)}};register("collection",[CollectionSection,quickviewSection,ajaxify,swatchGridSection,swatchSection,popoutSection]),register("search-template",[CollectionSection,quickviewSection,ajaxify,swatchGridSection,swatchSection,popoutSection]);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$h={newsletterForm:"[data-newsletter-form]",popup:"[data-popup]"},classes$c={success:"sign-up-posted",fail:"sign-up-failed"},attributes$4={testmode:"data-testmode",checkTrueString:"true"},sections$d={};class NewsletterCheckForResult{constructor(newsletter){this.sessionStorage=window.sessionStorage,this.newsletter=newsletter,this.popup=this.newsletter.closest(selectors$h.popup),this.cookie=new PopupCookie("newsletter","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),submissionSuccess=window.location.search.indexOf("?customer_posted=true")!==-1,submissionFailure=window.location.search.indexOf("accepts_marketing")!==-1;submissionSuccess?(newsletter.classList.remove(classes$c.error),newsletter.classList.add(classes$c.success),this.scrollToForm(newsletter),this.popup&&this.popup.getAttribute(attributes$4.testmode)!==attributes$4.checkTrueString&&this.cookie.write()):submissionFailure&&(newsletter.classList.remove(classes$c.success),newsletter.classList.add(classes$c.fail),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(()=>
8{window.scroll({top:rect.top,left:0,behavior:"smooth"})},400)}}const newsletterCheckForResultSection={onLoad(){sections$d[this.id]=[],this.container.querySelectorAll(selectors$h.newsletterForm).forEach(form=>{sections$d[this.id].push(new NewsletterCheckForResult(form))})},onUnload(){sections$d[this.id].forEach(form=>{typeof form.unload=="function"&&form.unload()})}};register("footer",[popoutSection,{onLoad(){var shopifyLink=document.querySelector("[data-powered-link] a");shopifyLink&&shopifyLink.setAttribute("rel","noopener")}},newsletterCheckForResultSection]);const selectors$g={faqTrigger:"[data-faq-trigger]",accordionTrigger:"[data-accordion-trigger]"},attributes$3={faqTrigger:"data-faq-trigger",index:"data-index"},classes$b={isActive:"is-active"};class FaqList extends AccordionElements{constructor(){super()}connectedCallback(){this.triggers=this.querySelectorAll(selectors$g.faqTrigger),this.triggers.forEach(button=>{button.addEventListener("click",event=>{if(button.classList.contains(classes$b.isActive))return;const activeButton=this.querySelector(`${selectors$g.faqTrigger}.${classes$b.isActive}`),accordionButton=this.querySelector(`${selectors$g.accordionTrigger}[${attributes$3.index}="${button.dataset.index}"]`);activeButton?.classList.remove(classes$b.isActive),accordionButton?.click(),button.classList.add(classes$b.isActive)})})}}customElements.get("faq-list")||customElements.define("faq-list",FaqList);const sections$c={},selectors$f={slider:"[data-collection-slider]",prevArrow:"[data-prev-arrow]",nextArrow:"[data-next-arrow]",productBlock:"[data-product-block]",productImage:"[data-product-image]",quickviewId:"data-quickview-id",quickviewWrap:"[data-quickview-wrap]",quickviewButton:"[data-trigger-quickview]"},classes$a={isVisible:"is-visible",flickityEnabled:"flickity-enabled",isQuickviewOpen:"is-quickview-open"};class CollectionSlider{constructor(section){this.container=section.container,this.slideshow=this.container.querySelector(selectors$f.slider),this.productBlocks=this.container.querySelectorAll(selectors$f.productBlock),this.productImages=this.container.querySelectorAll(selectors$f.productImage),this.slideshowPrev=this.container.querySelector(selectors$f.prevArrow),this.slideshowNext=this.container.querySelector(selectors$f.nextArrow),this.flkty=null,this.resizeEvents=()=>{this.sliderInit(),this.setArrowPosition(),this.setQuickViewPosition()},this.slideshow&&this.productBlocks.length&&this.init()}init(){this.slideshowPrev.addEventListener("click",this.goToPrevSlide.bind(this)),this.slideshowNext.addEventListener("click",this.goToNextSlide.bind(this)),removeAnimations(this.container),this.sliderInit(),this.productBlocks.forEach(productBlock=>{productBlock.addEventListener("theme:quickview:loaded",()=>{productBlock.classList.add(classes$a.isQuickviewOpen),this.setQuickViewPosition()})}),document.addEventListener("theme:resize",this.resizeEvents)}sliderInit(){const sliderInitialized=this.slideshow.classList.contains(classes$a.flickityEnabled);window.innerWidth>=theme.sizes.small?sliderInitialized||(this.flkty=new Flickity(this.slideshow,{groupCells:"100%",autoPlay:!1,prevNextButtons:!1,pageDots:!1,wrapAround:!1,cellAlign:"left",contain:!0,on:{ready:()=>{this.setArrowPosition()},change:function(){const visibleQuickView=this.element.querySelector(`${selectors$f.productBlock}.${classes$a.isVisible}`);visibleQuickView!==null&&visibleQuickView.querySelector(selectors$f.quickviewButton).dispatchEvent(new Event("click"))}}})):sliderInitialized&&this.flkty.destroy()}goToPrevSlide(e){e.preventDefault(),this.flkty.previous(!0)}goToNextSlide(e){e.preventDefault(),this.flkty.next(!0)}setArrowPosition(){const productBlock=this.slideshow.querySelector(selectors$f.productImage);if(!productBlock)return;let arrowTop=productBlock.offsetHeight/2;const arrowHeight=this.slideshowPrev.offsetHeight/2;arrowTop-=arrowHeight,this.slideshowPrev.style.top=`${arrowTop}px`,this.slideshowNext.style.top=`${arrowTop}px`}setQuickViewPosition(){const productBlock=this.slideshow.querySelector(`.${classes$a.isQuickviewOpen}`);if(productBlock===null)return;const uniq=productBlock.dataset.quickviewElement,quickviewWrap=this.container.querySelector(`[${selectors$f.quickviewId}="${uniq}"]`),sliderPadding=parseInt(window.getComputedStyle(this.slideshow).paddingLeft.replace("px","")),sliderInnerWidth=this.slideshow.offsetWidth-sliderPadding*2;if(quickviewWrap){let offsetLeft=productBlock.offsetLeft;offsetLeft>=sliderInnerWidth&&(offsetLeft%=sliderInnerWidth),quickviewWrap.style.left=`calc(${productBlock.style.left} - ${offsetLeft}px)`,quickviewWrap.style.width="100%"}}onUnload(){this.slideshow&&this.slideshow.classList.contains(classe
8s$a.flickityEnabled)&&this.flkty.destroy(),document.removeEventListener("theme:resize",this.resizeEvents)}}register("featured-collection",[{onLoad(){sections$c[this.id]=new CollectionSlider(this)},onUnload(e){sections$c[this.id].onUnload(e)}},quickviewSection,swatchGridSection]);const outerWidth=el=>{const style=getComputedStyle(el);let width=el.offsetWidth;return width+=parseInt(style.marginLeft)+parseInt(style.marginRight),width},selectors$e={menuToggle:"[data-menu-toggle]",hamburgerIcon:"[data-hamburger-icon]",hamburgerMenuScrollable:"[data-hamburger-scrollable]",headerIcons:"[data-header-icons]",navMain:"[data-nav-main]",menuDropdownParent:"[data-dropdown-parent]",dropdownTrigger:"data-collapsible-trigger",menuItemLink:"data-menu-item-link",visibleLink:"data-visible-link",ariaExpanded:"aria-expanded",href:"href",tabIndex:"tabindex"},classes$9={navVisible:"nav--is-visible",navHiding:"nav--is-hiding",megamenuVisible:"header--megamenu-visible",headerHamburger:"header--is-hamburger",menuItemDropdown:"menu-item--dropdown",isExpanded:"is-expanded",isActive:"is-active",open:"open"};let sections$b={};class Navigation{constructor(el){this.header=el,this.body=document.body,this.menuToggles=document.querySelectorAll(selectors$e.menuToggle),this.headerIcons=this.header.querySelector(selectors$e.headerIcons),this.navStandard=this.header.querySelector(selectors$e.navMain),this.hamburger=this.header.querySelector(selectors$e.hamburgerIcon),this.scrollableElement=document.querySelector(selectors$e.hamburgerMenuScrollable),this.hamburgerNavLinks=this.scrollableElement.parentNode.querySelectorAll("button, a"),this.documentClick=e=>this.hideOnOutsideClick(e),this.documentKeyup=e=>this.hideOnKeyUp(e),this.scrollLockTimeout=0,this.resetHeight=0,this.accessibility=a11y,this.init()}init(){this.hide(),this.bindings(),this.activeLinks()}bindings(){const dropdownParents=this.navStandard.querySelectorAll(selectors$e.menuDropdownParent),emptyLinks=document.querySelectorAll(`${selectors$e.navMain} a[href^="#"]`),triggers=[...document.querySelectorAll(`${selectors$e.navMain} [${selectors$e.dropdownTrigger}]`),...emptyLinks];this.menuToggles.forEach(menuToggle=>{menuToggle.addEventListener("click",e=>{e.preventDefault(),this.body.classList.contains(classes$9.navVisible)?this.hide():this.show()})}),dropdownParents.forEach(dropdownParent=>{const visibleNavLinks=dropdownParent.querySelectorAll(`[${selectors$e.visibleLink}]`);dropdownParent.addEventListener("mouseenter",()=>{theme.touched||(dropdownParent.classList.contains(classes$9.menuItemDropdown)||this.header.classList.add(classes$9.megamenuVisible),dropdownParent.classList.add(classes$9.isExpanded),visibleNavLinks.forEach(link=>{link.removeAttribute(selectors$e.tabIndex),link.hasAttribute(selectors$e.ariaExpanded)&&link.setAttribute(selectors$e.ariaExpanded,!0)}))}),dropdownParent.addEventListener("mouseleave",()=>{dropdownParent.classList.contains(classes$9.menuItemDropdown)||this.header.classList.remove(classes$9.megamenuVisible),dropdownParent.classList.remove(classes$9.isExpanded),visibleNavLinks.forEach(link=>{link.setAttribute(selectors$e.tabIndex,"-1"),link.hasAttribute(selectors$e.ariaExpanded)&&link.setAttribute(selectors$e.ariaExpanded,!1)})})}),triggers.forEach(trigger=>{trigger.addEventListener("click",()=>{trigger.parentNode.classList.contains(classes$9.isExpanded)?this.submenuClose(trigger.parentNode):this.submenuOpen(trigger.parentNode)}),trigger.addEventListener("keyup",e=>{e.keyCode===theme.keyboardKeys.SPACE?trigger.parentNode.classList.contains(classes$9.isExpanded)?this.submenuClose(trigger.parentNode):this.submenuOpen(trigger.parentNode):e.keyCode===theme.keyboardKeys.ESCAPE&&this.submenuClose(trigger.parentNode)})}),document.addEventListener("click",this.documentClick),document.addEventListener("keyup",this.documentKeyup)}hideOnOutsideClick(e){const isMenuToggle=this.headerIcons.querySelector(selectors$e.menuToggle).contains(e.target),isMenuContainer=document.querySelector(selectors$e.hamburgerMenuScrollable).parentNode.contains(e.target),isHeaderHamburger=this.header.classList.contains(classe
8s$9.headerHamburger);!isMenuToggle&&!isMenuContainer&&isHeaderHamburger&&this.hide()}hideOnKeyUp(e){const key=e.which||e.keyCode,focusedElement=e.target,hamburgerMenu=document.querySelectorAll(selectors$e.navMain)[1],isHamburgerOpen=this.hamburger.classList.contains(classes$9.open),expandedItem=document.querySelector(`${selectors$e.menuDropdownParent}.${classes$9.isExpanded}`);key!==theme.keyboardKeys.TAB&&key!==theme.keyboardKeys.ESCAPE||(key===theme.keyboardKeys.TAB?(focusedElement.hasAttribute(selectors$e.menuItemLink)&&expandedItem!==null&&expandedItem.querySelector(`[${selectors$e.dropdownTrigger}]`).dispatchEvent(new Event("click")),!hamburgerMenu.contains(focusedElement)&&isHamburgerOpen&&this.hide()):key===theme.keyboardKeys.ESCAPE&&(expandedItem!==null&&expandedItem.querySelector(`[${selectors$e.dropdownTrigger}]`).dispatchEvent(new Event("click")),isHamburgerOpen&&this.hide()))}show(){const headerIconsLinks=this.headerIcons.querySelectorAll(`a:not(${selectors$e.menuToggle})`);document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.scrollableElement})),this.hamburger.classList.add(classes$9.open),this.body.classList.add(classes$9.navVisible),headerIconsLinks.forEach(iconLink=>iconLink.setAttribute(selectors$e.tabIndex,"-1")),this.hamburgerNavLinks.forEach(hamburgerNavLink=>hamburgerNavLink.removeAttribute(selectors$e.tabIndex)),this.menuToggles.forEach(menuToggle=>menuToggle.setAttribute(selectors$e.ariaExpanded,!0))}hide(){const headerIconsLinks=this.headerIcons.querySelectorAll("a");this.body.classList.contains(classes$9.navVisible)&&(this.hamburger.classList.remove(classes$9.open),this.body.classList.add(classes$9.navHiding),this.body.classList.remove(classes$9.navVisible),this.scrollLockTimeout&&clearTimeout(this.scrollLockTimeout),this.scrollLockTimeout=setTimeout(()=>{document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})),this.body.classList.remove(classes$9.navHiding)},500),headerIconsLinks.forEach(iconLink=>iconLink.removeAttribute(selectors$e.tabIndex)),this.hamburgerNavLinks.forEach(hamburgerNavLink=>hamburgerNavLink.setAttribute(selectors$e.tabIndex,"-1")),this.menuToggles.forEach(menuToggle=>menuToggle.setAttribute(selectors$e.ariaExpanded,!1)))}activeLinks(){const menuItemLinks=this.navStandard.querySelectorAll(`[${selectors$e.menuItemLink}]`),visibleNavLinks=this.navStandard.querySelectorAll(`[${selectors$e.visibleLink}]`);let isTopLevel=!1;menuItemLinks.forEach(link=>{link.getAttribute(selectors$e.href)===window.location.pathname&&(link.parentNode.classList.add(classes$9.isActive),isTopLevel=!0)}),isTopLevel||visibleNavLinks.forEach(link=>{link.getAttribute(selectors$e.href)===window.location.pathname&&(link.parentNode.classList.add(classes$9.isActive),link.closest(selectors$e.menuDropdownParent).classList.add(classes$9.isActive))})}submenuClose(el){el.querySelectorAll(`[${selectors$e.visibleLink}]`).forEach(link=>{link.setAttribute(selectors$e.tabIndex,"-1"),link.hasAttribute(selectors$e.ariaExpanded)&&link.setAttribute(selectors$e.ariaExpanded,!1)}),el.classList.contains(classes$9.menuItemDropdown)||this.header.classList.remove(classes$9.megamenuVisible)}submenuOpen(el){el.querySelectorAll(`[${selectors$e.visibleLink}]`).forEach(link=>{link.removeAttribute(selectors$e.tabIndex),link.hasAttribute(selectors$e.ariaExpanded)&&link.setAttribute(selectors$e.ariaExpanded,!0)}),el.classList.contains(classes$9.menuItemDropdown)||this.header.classList.add(classes$9.megamenuVisible)}unload(){document.removeEventListener("click",this.documentClick),document.removeEventListener("keyup",this.documentKeyup)}}const navigation={onLoad(){sections$b=new Navigation(this.container)},onUnload:function(){typeof sections$b.unload=="function"&&sections$b.unload()},onSelect(){typeof sections$b.hide=="function"&&sections$b.hide()},onDeselect(){typeof sections$b.hide=="function"&&sections$b.hide()}},selectors$d={collapsibleTrigger:"[data-collapsible-trigger]",collapsibleContent:"[data-collapsible-content]",navHamburger:"[data-hamburger-scrollable]",header:"data-header"},attributes$2={expanded:"aria-expanded",controls:"aria-controls",hidden:"aria-hidden",accordion:"data-accordion"},classes$8={isExpanded:"is-expanded"},sections$a={};class Collapsible$1{constructor(el){this.section=el,this.triggers=this.section.querySelectorAll(selectors$d.collapsibleTrigger),this.resetHeight=0,this.init()}init(){const navHamburger=document.querySelector(selectors$d.navHamburger);this.section.hasAttribute(selectors$d.header)&&(this.triggers=[...this.triggers,...n
8avHamburger.querySelectorAll(selectors$d.collapsibleTrigger)]),this.triggers.forEach(trigger=>{trigger.addEventListener("click",event=>this.collapsibleToggleEvent(event,trigger)),trigger.addEventListener("keyup",event=>this.collapsibleToggleEvent(event,trigger))})}collapsibleToggleEvent(e,trigger){e.preventDefault();const dropdownId=trigger.getAttribute(attributes$2.controls),isAccordion=trigger.hasAttribute(attributes$2.accordion),dropdown=document.getElementById(dropdownId),parent=trigger.parentNode,isExpanded=parent.classList.contains(classes$8.isExpanded),isSpace=e.keyCode===theme.keyboardKeys.SPACE,isEscape=e.keyCode===theme.keyboardKeys.ESCAPE;let dropdownHeight=dropdown.querySelector(selectors$d.collapsibleContent).offsetHeight;e.keyCode&&!isSpace&&!isEscape||!isExpanded&&isEscape||(isExpanded?setTimeout(()=>{dropdownHeight=0,this.setDropdownHeight(dropdown,dropdownHeight,isExpanded)},0):isAccordion&&getSiblings(parent).forEach(sibling=>{sibling.classList.contains(classes$8.isExpanded)&&sibling.querySelector(selectors$d.collapsibleTrigger).dispatchEvent(new Event("click"))}),trigger.setAttribute(attributes$2.expanded,!isExpanded),parent.classList.toggle(classes$8.isExpanded,!isExpanded),this.setDropdownHeight(dropdown,dropdownHeight,isExpanded))}setDropdownHeight(dropdown,dropdownHeight,isExpanded){dropdown.style.maxHeight=`${dropdownHeight}px`,dropdown.setAttribute(attributes$2.hidden,isExpanded);let maxHeight="none";this.resetHeight&&clearTimeout(this.resetHeight),dropdownHeight===0&&(maxHeight=null),this.resetHeight=setTimeout(()=>{dropdown.style.maxHeight=maxHeight},500)}}const collapsible={onLoad(){sections$a[this.id]=new Collapsible$1(this.container)}},selectors$c={bodyWrap:"[data-body-wrap]",mainContent:".main-content",navMain:"[data-nav-main]",navItem:".menu > .menu-item",headerRow:".container > .row",headerIcons:"[data-header-icons]",dataHeaderStyle:'[data-header-style="transparent"]',logoImage:"[data-logo-image]",logoImageWidth:"data-width",logoText:"[data-logo-text]",hamburgerIcon:"[data-hamburger-icon]",hamburgerMenuScrollable:"[data-hamburger-scrollable]",cartClose:"[data-cart-close]",dataTransparent:"data-transparent"},classes$7={headerFull:"header--full",headerScrolled:"header--has-scrolled",headerSticky:"header--sticky",headerStandard:"header--is-standard",headerHamburger:"header--is-hamburger",headerTransparent:"header--transparent",headerLogoCenterCenter:"header--logo_center_links_center",headerLogoLeftCenter:"header--logo_left_links_center",headerLogoCenterLeft:"header--logo_center_links_left",headerLogoLeftLeft:"header--logo_left_links_left",headerHiding:"header--is-hiding",hasTransparentHeader:"has-transparent-header",navVisible:"nav--is-visible",cartVisible:"cart--is-visible",open:"open"};let sections$9={};class Header{constructor(el){this.header=el,this.headerContainer=this.header.parentNode,this.html=document.documentElement,this.body=document.body,this.bodyWrap=document.querySelector(selectors$c.bodyWrap),this.headerStateEvent=event=>this.stickyHeaderState(event),this.checkMobileNavEvent=()=>this.checkMobileNav(),this.checkNavOverlapEvent=()=>this.checkNavigationOverlapping(),this.checkTransparentHeaderEvent=e=>this.checkTransparentHeader(e),this.init()}init(){this.resetHeader(),this.checkTransparentHeader(),this.checkNavigationOverlapping(),window.addEventListener("load",this.checkNavOverlapEvent),document.addEventListener("theme:resize:width",this.checkNavOverlapEvent),document.addEventListener("theme:resize:width",this.checkMobileNavEvent),document.addEventListener("theme:header:update",this.checkTransparentHeaderEvent),this.header.classList.contains(classes$7.headerSticky)&&(this.stickyHeaderState(),document.addEventListener("theme:scroll",this.headerStateEvent))}stickyHeaderState(event){const scrolled=window.scrollY,scrollUp=event&&event.detail&&event.detail.up,{headerInitialHeight}=readHeights();this.headerHeight=this.headerHeight||headerInitialHeight,scrollUp&&scrolled<this.headerHeight*2?this.header.classList.add(classes$7.headerHiding):this.header.classList.remove(classes$7.headerHiding),scrolled>this.headerHeight?(this.header.classList.add(classes$7.headerScrolled),this.header.classList.remove(classes$7.headerTransparent)):(this.header.classList.remove(classes$7.headerScrolled),this.isHeaderTransparent
8()&&this.header.classList.add(classes$7.headerTransparent))}checkNavigationOverlapping(){const isDesktop2=window.innerWidth>=theme.sizes.large;this.header.classList.remove(classes$7.headerHamburger),this.header.classList.add(classes$7.headerStandard),(this.getNavigationOverlapping()||!isDesktop2)&&(this.header.classList.remove(classes$7.headerStandard),this.header.classList.add(classes$7.headerHamburger))}checkMobileNav(){const isDesktop2=window.innerWidth>=theme.sizes.large;this.body.classList.contains(classes$7.navVisible)&&isDesktop2&&this.resetHeader()}checkTransparentHeader(){this.isHeaderTransparent()?(this.body.classList.add(classes$7.hasTransparentHeader),this.header.classList.add(classes$7.headerTransparent)):(this.body.classList.remove(classes$7.hasTransparentHeader),this.header.classList.remove(classes$7.headerTransparent))}getNavigationOverlapping(){const headerRowWidth=this.header.querySelector(selectors$c.headerRow).offsetWidth,navMenuWidth=this.getMenuItemsWidth(),headerClasses=this.header.classList,isNavCentered=headerClasses.contains(classes$7.headerLogoCenterCenter)||headerClasses.contains(classes$7.headerLogoLeftCenter),isNavLeftLogoCentered=headerClasses.contains(classes$7.headerLogoCenterLeft)||headerClasses.contains(classes$7.headerLogoLeftLeft),additionalSpace=40;let isNavigationOverlapping=!1,headerIconsWidth=this.header.querySelector(selectors$c.headerIcons).offsetWidth,logoWidth=this.getLogoWidth();return isNavCentered&&(logoWidth=logoWidth<headerIconsWidth?headerIconsWidth:logoWidth,logoWidth*=2,headerIconsWidth=0),isNavigationOverlapping=parseInt(headerRowWidth)<parseInt(navMenuWidth+logoWidth+headerIconsWidth+additionalSpace),isNavLeftLogoCentered&&logoWidth&&(isNavigationOverlapping=parseInt((headerRowWidth-logoWidth)/2)<parseInt(navMenuWidth)),isNavigationOverlapping}getLogoWidth(){const logoImage=this.header.querySelector(selectors$c.logoImage),logoText=this.header.querySelector(selectors$c.logoText);let logoWidth=0;return logoImage!==null&&(logoWidth=parseInt(logoImage.getAttribute(selectors$c.logoImageWidth))),logoText!==null&&(logoWidth+=logoText.offsetWidth),logoWidth}getMenuItemsWidth(){let itemsWidth=0;return this.header.querySelector(selectors$c.navMain).querySelectorAll(selectors$c.navItem).forEach(menuItem=>{itemsWidth+=outerWidth(menuItem)}),itemsWidth}
8isHeaderTransparent(){const firstSection=document.querySelector(selectors$c.mainContent).firstElementChild;if(!firstSection)return!1;const firstSectionClass=firstSection?.classList.contains(classes$7.headerFull),firstSectionStyle=firstSection?.querySelector(selectors$c.dataHeaderStyle)!==null;return this.header.getAttribute(selectors$c.dataTransparent)==="true"&&(firstSectionClass||firstSectionStyle)}resetHeader(){const hamburger=this.header.querySelector(selectors$c.hamburgerIcon);this.body.classList.remove(classes$7.navVisible),hamburger.classList.remove(classes$7.open),this.body.classList.contains(classes$7.cartVisible)&&document.querySelector(selectors$c.cartClose).click(),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}unload(){document.removeEventListener("theme:scroll",this.headerStateEvent),document.removeEventListener("theme:resize:width",this.checkNavOverlapEvent),document.removeEventListener("theme:resize:width",this.checkMobileNavEvent),document.removeEventListener("theme:header:update",this.checkTransparentHeaderEvent)}onselect(){this.resetHeader(),this.init()}}register("header",[{onLoad(){sections$9=new Header(this.container)},onUnload(){typeof sections$9.unload=="function"&&sections$9.unload()},onSelect(){typeof sections$9.onselect=="function"&&sections$9.onselect()}},navigation,collapsible]);var sections$8={};const parallaxHero={onLoad(){sections$8[this.id]=[],this.container.querySelectorAll("[data-parallax-wrapper]").forEach(frame=>{const inner=frame.querySelector("[data-parallax-img]");sections$8[this.id].push(new Rellax(inner,{center:!0,round:!0,frame}))})},onUnload:function(){sections$8[this.id].forEach(image=>{typeof image.destroy=="function"&&image.destroy()})}},sections$7={},selectors$b={slider:"[data-gallery-slider]",slideshow:"[data-slider]",slideshowPrev:"[data-prev-arrow]",slideshowNext:"[data-next-arrow]",dataOptions:"data-options",dataSlide:"data-slide",dataSlideIndex:"data-slide-index"},classes$6={slideshowLoading:"gallery-slider--is-loading",classIsSelected:"is-selected",flickityEnabled:"flickity-enabled"};class Gallery{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$b.slider),this.slideshow=this.container.querySelector(selectors$b.slideshow),this.options=this.slideshow.getAttribute(selectors$b.dataOptions),this.slideshowPrev=this.container.querySelector(selectors$b.slideshowPrev),this.slideshowNext=this.container.querySelector(selectors$b.slideshowNext),this.checkSliderVisibilityOnScrollEvent=this.checkSliderVisibility(),this.flkty=null,this.init()}init(){let options=JSON.parse(this.options.replace(/'/g,'"'));options={...options,on:{ready:()=>this.slider.classList.remove(classes$6.slideshowLoading)}},this.flkty=new FlickityFade(this.slideshow,options),this.slideshowPrev&&this.slideshowPrev.addEventListener("click",()=>this.flkty.previous(!0)),this.slideshowNext&&this.slideshowNext.addEventListener("click",()=>this.flkty.next(!0)),document.addEventListener("theme:scroll",this.checkSliderVisibilityOnScrollEvent)}isAutoplay(){return this.flkty.options.autoPlay!==!1}checkSliderVisibility(){if(!this.flkty)return;const isInitialized=this.slideshow.classList.contains(classes$6.flickityEnabled);(visibilityHelper.isElementPartiallyVisible(this.slideshow)||visibilityHelper.isElementTotallyVisible(this.slideshow))&&isInitialized&&this.isAutoplay()?this.flkty.playPlayer():this.flkty.stopPlayer()}onUnload(){this.flkty.destroy(),document.removeEventListener("theme:scroll",this.checkSliderVisibilityOnScrollEvent)}onBlockSelect(evt){const slide=this.slideshow.querySelector(`[${selectors$b.dataSlide}="${evt.detail.blockId}"]`),slideIndex=parseInt(slide.getAttribute(selectors$b.dataSlideIndex));this.flkty.select(slideIndex),this.flkty.stopPlayer()}onBlockDeselect(){this.isAutoplay()&&this.flkty.playPlayer()}}register("gallery",[{onLoad(){sections$7[this.id]=new Gallery(this)},onUnload(e){sections$7[this.id].onUnload(e)},onBlockSelect(e){sections$7[this.id].onBlockSelect(e)},onBlockDeselect(e){sections$7[this.id].onBlockDeselect(e)}},parallaxHero]),register("collection-grid",[ajaxify]);const sections$6={},selectors$a={logoListSlider:"[data-logo-list-slider]",logoListSlide:"[data-logo-list-slide]",logoListSlideData:"data-logo-list-slide",logoListSlideIndex:"data-sli
8de-index"},classes$5={flickityEnabled:"flickity-enabled"};class LogoList{constructor(section){this.container=section.container,this.slideshow=this.container.querySelector(selectors$a.logoListSlider),this.sliderInitEvent=()=>this.sliderInit(),this.init()}init(){this.sliderInit(),document.addEventListener("theme:resize",this.sliderInitEvent)}sliderInit(){const slidesCount=this.slideshow.querySelectorAll(selectors$a.logoListSlide).length,slideWidth=220,windowWidth=document.documentElement.clientWidth||document.body.clientWidth,slidesWidth=slidesCount*slideWidth,sliderInitialized=this.slideshow.classList.contains(classes$5.flickityEnabled);windowWidth<slidesWidth?sliderInitialized||(this.flkty=new Flickity(this.slideshow,{autoPlay:4e3,prevNextButtons:!1,pageDots:!1,wrapAround:!0})):sliderInitialized&&this.flkty.destroy()}onUnload(){this.slideshow.classList.contains(classes$5.flickityEnabled)&&this.flkty.destroy(),document.removeEventListener("theme:resize",this.sliderInitEvent)}onBlockSelect(evt){const slide=this.slideshow.querySelector(`[${selectors$a.logoListSlideData}="${evt.detail.blockId}"]`),slideIndex=parseInt(slide.getAttribute(selectors$a.logoListSlideIndex));this.slideshow.classList.contains(classes$5.flickityEnabled)&&(this.flkty.select(slideIndex),this.flkty.pausePlayer())}onBlockDeselect(){this.slideshow.classList.contains(classes$5.flickityEnabled)&&this.flkty.unpausePlayer()}}register("logo-list",{onLoad(){sections$6[this.id]=new LogoList(this)},onUnload(e){sections$6[this.id].onUnload(e)},onBlockSelect(e){sections$6[this.id].onBlockSelect(e)},onBlockDeselect(){sections$6[this.id].onBlockDeselect()}});const selectors$9={videoPlay:"[data-video-play]",videoPlayValue:"data-video-play"};class VideoPlay{constructor(section,selector=selectors$9.videoPlay,selectorValue=selectors$9.videoPlayValue){this.container=section.container,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(),theme.a11yTrigger=button;const items=[{html:button.getAttribute(selectorValue)}];new LoadPhotoswipe(items)}})})}}const videoPlay={onLoad(){new VideoPlay(this.container)}},sections$5={},selectors$8={slideshow:"[data-mosaic-blocks]",slideshowPrev:"[data-prev-arrow]",slideshowNext:"[data-next-arrow]",dataSlide:"data-slide",dataSlideIndex:"data-slide-index"},classes$4={flickityEnabled:"flickity-enabled"};class Mosaic{constructor(section){this.container=section.container,this.slideshow=this.container.querySelector(selectors$8.slideshow),this.slideshowPrev=this.container.querySelector(selectors$8.slideshowPrev),this.slideshowNext=this.container.querySelector(selectors$8.slideshowNext),this.flkty=null,this._listeners=new Listeners,this.sliderInitEvent=()=>this.initMobileSlider(),this.init()}init(){this.initMobileSlider(),document.addEventListener("theme:resize",this.sliderInitEvent)}initMobileSlider(){const isMobile=window.innerWidth<theme.sizes.small,options={wrapAround:!0,prevNextButtons:!1,pageDots:!1};isMobile&&!this.isInit()?(this.flkty=new Flickity(this.slideshow,options),this.slideshowPrev&&this.slideshowNext&&(this._listeners.add(this.slideshowPrev,"click",()=>this.flkty.previous(!0)),this._listeners.add(this.slideshowNext,"click",()=>this.flkty.next(!0)))):!isMobile&&this.isInit()&&(this.flkty.destroy(),this._listeners.removeAll())}isInit(){return this.slideshow?.classList.contains(classes$4.flickityEnabled)}onUnload(){this.isInit()&&this.flkty.destroy(),document.removeEventListener("theme:resize",this.sliderInitEvent)}onBlockSelect(evt){const slide=this.container.querySelector(`[${selectors$8.dataSlide}="${evt.detail.blockId}"]`);this.isInit()&&slide!==null&&this.flkty.select(parseInt(slide.getAttribute(selectors$8.dataSlideIndex)))}}register("mosaic",[{onLoad(){sections$5[this.id]=new Mosaic(this)},onUnload(e){sections$5[this.id].onUnload(e)},onBlockSelect(e){sections$5[this.id].onBlockSelect(e)}},videoPlay]),register("newsletter",newsletterCheckForResultSection);const selectors$7={inputGroups:".input-group--error",inputs:"input.password, input.email"};class Password{constructor(section){this.container=section.container,this.inputGroups=this.container.querySelectorAll(selectors$7.inputGroups),this.init()}init(){this.inputGroups.forEach(inputGroup=>{inputGroup.querySelector(selectors$7.inputs).focus()})}}register("password",{onLoad(){new Password(this)}});const selectors$6={popup:"[data-popup]",close:"[data-popup-close]"},classes$3={popupVisible:"popup--visible"},attributes$1={delay:"data-delay",reappearTime:"data-reappear_time",testmode:"data-testmode",checkTrueString:"true"};let sections$4={};class Popup{constructor(el){this.popup=el,this.close=this.popup.querySelector(selectors$6.close),this.timeout=0,this.testmode=this.popup.getAttribute(attributes$1.testmode)===attributes$1.checkTrueString,this.delay=parseInt(this.popup.getAttribute(attributes$1.delay))*1e3,this.cookie=new PopupCookie("newsletter","user_has_closed",this.expireDate()),this.init()}expireDate(){const todayDate=new Date,expireDate=new Date;let date=parseInt(this.popup.getAttribute(attributes$1.reappearTime));return date!==0?expireDate.setTime(todayDate.getTime()+36e5*24*date):expireDate.setTime(todayDate.getTime()+36e5*24*365*100),date=expireDate.toGMTString(),date}init(){const cookieExists=this.cookie.read()!==!1,isChallengePage=window.location.pathname==="/challenge";window.location.search.indexOf("?customer_posted=true")!==-1&&(this.delay=0),(!cookieExists&&!isChallengePage||this.testmode)&&(this.timeout=setTimeout(()=>{this.popup.classList.add(classes$3.popupVisible),this.initClosers(),this.close.focus()},this.delay))}initClosers(){this.close.addEventListener("click",this.closeModal.bind(this))}closeModal(e){e.preventDefault(),this.popup.classList.remove(classes$3.popupVisible),clearTimeout(this.timeout),this.testmode||this.cookie.write()}}register("popup",[{onLoad(){const popup=this.container.querySelector(selectors$6.popup);popup!==null&&(sections$4[this.id]=new Popup(popup))}},newsletterCheckForResultSection]);const selectors$5={quantityAdjust:"[data-qty-adjust]",quantityAdjustPlus:"data-qty-adjust-plus",quantityAdjustMinus:"data-qty-adjust-minus",quantityNum:"[data-qty]"},quantity=(e,element)=>
8{if(e.type==="keyup"&&e.keyCode!==13)return;const el=element,qtySelector=el.parentElement.querySelector(selectors$5.quantityNum);let qty=parseInt(qtySelector.value.replace(/\D/g,""));parseFloat(qty)==parseInt(qty)&&!isNaN(qty)||(qty=1),el.hasAttribute(selectors$5.quantityAdjustPlus)?qty+=1:(qty-=1,qty<=1&&(qty=1)),qtySelector.value=qty,qtySelector.dispatchEvent(new Event("click"))};function quantitySelectors(){document.querySelectorAll(selectors$5.quantityAdjust).forEach(element=>{element.addEventListener("click",function(e){quantity(e,element)}),element.addEventListener("keyup",function(e){quantity(e,element)})}),document.querySelectorAll(selectors$5.quantityNum).forEach(element=>{element.addEventListener("keyup",function(e){e.keyCode==38,e.keyCode==40})})}const selectors$4={complementaryProducts:"complementary-products",complementaryProduct:"[data-product-block]"},classes$2={loaded:"is-loaded"},attributes={url:"data-url"};class ComplementaryProducts extends HTMLElement{constructor(){super()}connectedCallback(){const handleIntersection=(entries,observer)=>{entries[0].isIntersecting&&(observer.unobserve(this),this.hasAttribute(attributes.url)&&this.getAttribute(attributes.url)!==""&&fetch(this.getAttribute(attributes.url)).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recommendations=html.querySelector(selectors$4.complementaryProducts);recommendations&&recommendations.innerHTML.trim().length&&(this.innerHTML=recommendations.innerHTML),html.querySelector(`${selectors$4.complementaryProducts} ${selectors$4.complementaryProduct}`)&&this.classList.add(classes$2.loaded)}).catch(e=>{console.error(e)}))};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}}const events={cartUpdate:"cart-update",variantChange:"variant-change",cartError:"cart-error"};class RecipientForm extends HTMLElement{cartUpdateUnsubscriber=void 0;variantChangeUnsubscriber=void 0;cartErrorUnsubscriber=void 0;constructor(){super(),this.checkboxInput=this.querySelector(`#Recipient-Checkbox-${this.dataset.sectionIdForm}`),this.checkboxInput.disabled=!1,this.hiddenControlField=this.querySelector(`#Recipient-Control-${this.dataset.sectionIdForm}`),this.hiddenControlField.disabled=!0,this.emailInput=this.querySelector(`#Recipient-email-${this.dataset.sectionIdForm}`),this.nameInput=this.querySelector(`#Recipient-name-${this.dataset.sectionIdForm}`),this.messageInput=this.querySelector(`#Recipient-message-${this.dataset.sectionIdForm}`),this.sendonInput=this.querySelector(`#Recipient-send_on-${this.dataset.sectionIdForm}`),this.offsetProperty=this.querySelector(`#Recipient-Offset-${this.dataset.sectionIdForm}`),this.offsetProperty&&(this.offsetProperty.value=new Date().getTimezoneOffset()),this.errorMessageWrapper=this.querySelector(".product-form__recipient-error-message-wrapper"),this.errorMessageList=this.errorMessageWrapper?.querySelector("ul"),this.errorMessage=this.errorMessageWrapper?.querySelector("span.error-message"),this.defaultErrorHeader=this.errorMessage?.textContent,this.currentProductVariantId=this.dataset.productVariantId,this.addEventListener("change",this.onChange.bind(this)),this.onChange()}connectedCallback(){this.cartUpdateUnsubscriber=subscribe(events.cartUpdate,event=>{event.source==="product-form"&&event.productVariantId&&event.productVariantId.toString()===this.currentProductVariantId&&this.resetRecipientForm()}),this.variantChangeUnsubscriber=subscribe(events.variantChange,event=>{event.data.sectionId===this.dataset.sectionIdForm&&(this.currentProductVariantId=event.data.variant.id.toString())}),this.cartUpdateUnsubscriber=subscribe(events.cartError,event=>{event.source==="product-form"&&event.productVariantId&&event.productVariantId.toString()===this.currentProductVariantId&&this.displayErrorMessage(event.message,event.errors)})}disconnectedCallback(){this.cartUpdateUnsubscriber&&this.cartUpdateUnsubscriber(),this.variantChangeUnsubscriber&&this.variantChangeUnsubscriber(),this.cartErrorUnsubscriber&&this.cartErrorUnsubscriber()}onChange(){this.checkboxInput.checked?this.enableInputFields():(this.clearInputFields(),this.disableInputFields(),this.clearErrorMessage())}inputFields(){return[this.emailInput,this.nameInput,this.messageInput,this.sendonInput]}disableableFields(){return[...this.inputFields(),this.offsetProperty]}
8clearInputFields(){this.inputFields().forEach(field=>field.value="")}enableInputFields(){this.disableableFields().forEach(field=>field.disabled=!1)}disableInputFields(){this.disableableFields().forEach(field=>field.disabled=!0)}displayErrorMessage(title,body){if(this.clearErrorMessage(),this.errorMessageWrapper.classList.add("is-visible"),typeof body=="object")return this.errorMessage.innerText=this.defaultErrorHeader,Object.entries(body).forEach(([key,value])=>{const errorMessageId=`RecipientForm-${key}-error-${this.dataset.sectionIdForm}`,fieldSelector=`#Recipient-${key}-${this.dataset.sectionIdForm}`,message=`${value.join(", ")}`,errorMessageElement=this.querySelector(`#${errorMessageId}`),errorTextElement=errorMessageElement?.querySelector(".error-message");if(!errorTextElement)return;this.errorMessageList&&this.errorMessageList.appendChild(this.createErrorListItem(fieldSelector,message)),errorTextElement.innerText=`${message}.`,errorMessageElement.classList.remove("hidden");const inputElement=this[`${key}Input`];inputElement&&(inputElement.setAttribute("aria-invalid",!0),inputElement.setAttribute("aria-describedby",errorMessageId))});this.errorMessage.innerText=body}createErrorListItem(target,message){const li=document.createElement("li"),a=document.createElement("a");return a.setAttribute("href",target),a.innerText=message,li.appendChild(a),li.className="error-message",li}clearErrorMessage(){this.errorMessageWrapper.classList.remove("is-visible"),this.errorMessageList&&(this.errorMessageList.innerHTML=""),this.querySelectorAll(".recipient-fields .form__message").forEach(field=>{field.classList.add("hidden");const textField=field.querySelector(".error-message");textField&&(textField.innerText="")}),[this.emailInput,this.messageInput,this.nameInput].forEach(inputElement=>{inputElement.setAttribute("aria-invalid",!1),inputElement.removeAttribute("aria-describedby")})}resetRecipientForm(){this.checkboxInput.checked&&(this.checkboxInput.checked=!1,this.clearInputFields(),this.clearErrorMessage())}}const selectors$3={productContainer:"[data-product-container]",addToCart:"[data-add-to-cart]",shopBar:"[data-shop-bar]",productJson:"[data-product-json]",form:"[data-product-form-container]",dropdown:"[data-single-option-selector]",footer:"[data-footer]",colorLabel:"[data-color-label]",colorSwatch:"[data-color-swatch]",dataOption:"[data-option]",dataSectionId:"data-section-id",selectTag:"select",dataPosition:"data-position",dataIndex:"data-index"},classes$1={onboarding:"onboarding-product",shopBarVisible:"shop-bar--is-visible",footerPush:"site-footer--push"};let sections$3={};class Product{constructor(section){if(this.section=section,this.container=section.container,this.id=this.container.getAttribute(selectors$3.dataSectionId),this.productContainer=this.container.querySelector(selectors$3.productContainer),this.footer=document.querySelector(selectors$3.footer),this.onboarding=this.productContainer.classList.contains(classes$1.onboarding),this.shopBar=document.querySelector(selectors$3.shopBar),this.scrollEvent=throttle(()=>this.shopBarShow(),100),this.onboarding)quantitySelectors(),this.productContainer.querySelectorAll(selectors$3.colorSwatch).forEach(swatch=>{swatch.addEventListener("change",e=>{this.updateColorName(e)})});else{const productJson=this.container.querySelector(selectors$3.productJson);if(productJson&&!productJson.innerHTML||!productJson)return;Shopify.Products.recordRecentlyViewed(),this.form=this.container.querySelector(selectors$3.form),this.init(),this.shopBar&&this.initShopBar()}}init(){theme.mediaInstances[this.id]=new Media(this.section,!0),theme.mediaInstances[this.id].init()}initShopBar(){const cartBarSelectors=this.shopBar.querySelectorAll(selectors$3.selectTag),formSelectors=this.form.querySelectorAll(selectors$3.dropdown);this.shopBar.querySelector(selectors$3.addToCart).addEventListener("click",e=>{e.preventDefault()}),cartBarSelectors.length&&cartBarSelectors.forEach(element=>{element.addEventListener("change",()=>{const index=element.getAttribute(selectors$3.dataIndex),optionSelected=element.value,targets=this.form.querySelectorAll(`${selectors$3.dropdown}[${selectors$3.dataIndex}="${index}"]`);if(targets[0].tagName==="INPUT")for(const target of targets){const targetIndex=target.getAttribute(selectors$3.dataIndex),targetValue=target.value;if(targetIndex===index&&targetValue===optionSelected){target.checked=!0,target.dispatchEvent(new Event("change"));break}}else{const select=targets[0];select.value=optionSelected,select.dispatchEvent(new Event("change"))}})}
8),formSelectors.length&&formSelectors.forEach(element=>{element.addEventListener("change",()=>{const index=element.getAttribute(selectors$3.dataIndex),optionSelected=element.value;this.shopBar.querySelector(`[${selectors$3.dataIndex}="${index}"]`).value=optionSelected})}),this.shopBarShow(),window.addEventListener("scroll",this.scrollEvent)}shopBarShow(){const scrolled=window.scrollY,productContainerTop=this.productContainer.getBoundingClientRect().top+scrolled;scrolled>productContainerTop?(this.shopBar.classList.add(classes$1.shopBarVisible),this.footer.classList.add(classes$1.footerPush)):scrolled<productContainerTop-theme.dimensions.headerScrolled&&(this.shopBar.classList.remove(classes$1.shopBarVisible),this.footer.classList.remove(classes$1.footerPush))}updateColorName(evt){const target=evt.target,optionLabel=target.closest(selectors$3.dataOption).querySelector(selectors$3.colorLabel);target.tagName==="INPUT"&&optionLabel!==null&&(optionLabel.innerText=target.value)}unload(){window.removeEventListener("scroll",this.scrollEvent)}}register("product",[productFormSection,{onLoad(){sections$3=new Product(this)},onUnload:function(){typeof sections$3.unload=="function"&&sections$3.unload()}},swatchSection]),customElements.get("complementary-products")||customElements.define("complementary-products",ComplementaryProducts),customElements.get("recipient-form")||customElements.define("recipient-form",RecipientForm);const sections$2={},selectors$2={recentlyViewed:"#RecentlyViewed",dataLimit:"data-limit",productBlock:"[data-product-block]",productImage:"[data-product-image]"};class RecentlyViewedProducts{constructor(section){this.section=section,this.container=section.container,this.limit=parseInt(this.container.getAttribute(selectors$2.dataLimit)),this.recentlyViewed=this.container.querySelector(selectors$2.recentlyViewed),this.recentlyViewed&&this.init()}init(){Shopify.Products.showRecentlyViewed({howManyToShow:this.limit,onComplete:()=>{this.container.querySelectorAll(selectors$2.productBlock).length>0&&(makeGridSwatches(this.container),new Quickview(this.container))}})}}register("recently-viewed-products",{onLoad(){sections$2[this.id]=new RecentlyViewedProducts(this)}});const sections$1={},selectors$1={section:'[data-section-type="related-products"]',product:"[data-product-block]",productImage:"[data-product-image]",sectionId:"data-section-id",productId:"data-product-id",limit:"data-limit"};class RelatedProducts{constructor(section){this.container=section.container,this.init()}init(){const relatedSection=this.container,sectionId=relatedSection.getAttribute(selectors$1.sectionId),productId=relatedSection.getAttribute(selectors$1.productId),limit=relatedSection.getAttribute(selectors$1.limit),requestUrl=`${theme.routes.product_recommendations_url}?section_id=${sectionId}&limit=${limit}&product_id=${productId}`;fetch(requestUrl).then(response=>response.text()).then(data=>{const createdElement=document.createElement("div");createdElement.innerHTML=data;const inner=createdElement.querySelector(selectors$1.section);inner.querySelector(selectors$1.product)&&(relatedSection.innerHTML=inner.innerHTML,makeGridSwatches(relatedSection),new Quickview(relatedSection))})}}register("related-products",{onLoad(){sections$1[this.id]=new RelatedProducts(this)}});const sections={},selectors={lazyImage:'[loading="lazy"]',shopifySection:".shopify-section",slideshowPrev:"[data-prev-arrow]",slideshowNext:"[data-next-arrow]",header:"[data-header]",dataOptions:"data-options",dataColor:"data-style",dataCurrentColor:"data-current-style",dataSlide:"data-slide",dataSlideIndex:"data-slide-index",scrollBtn:"[data-button-scroll]"},classes={slideshowLoading:"hero--is-loading",classIsSelected:"is-selected",flickityEnabled:"flickity-enabled"};class Slideshow{constructor(section){this.container=section.container,this.options=this.container.getAttribute(selectors.dataOptions),this.parentContainer=this.container.closest(selectors.shopifySection),this.slideshowPrev=this.parentContainer.querySelector(selectors.slideshowPrev),this.slideshowNext=this.parentContainer.querySelector(selectors.slideshowNext),this.scrollBtn=this.parentContainer.querySelector(selectors.scrollBtn),this.checkVisibilityOnScroll=this.checkSliderVisibility(),this.flkty=null,this.init()}init(){let options=JSON.parse(this.options.replace(/'/g,'"'));options={...options,cellSelector:`[${selectors.dataSlide}]`,on:{ready:()=>{requestAnimationFrame(()=>{this.container.classList.remove(classes.slideshowLoading)}),this.slideActions()}}},this.flkty=new FlickityFade(this.container,options),this.flkty.on("change",()=>{this.slideActions()}),this.slideshowPrev&&this.slideshowPrev.addEventListener("click",()=>this.flkty.previous(!0)),this.slideshowNext&&this.slideshowNext.addEventListener("click",()=>this.flkty.next(!0)),this.scrollBtn&&this.scrollBtn.addEventListener("click",e=>{e.preventDefault();const headerHeight=59,containerTop=this.parentContainer.offsetTop,containerHeight=this.parentContainer.offsetHeight,scrollPosition=containerTop+containerHeight-headerHeight;scroll({top:scrollPosition,behavior:"smooth"})}),document.addEventListener("theme:scroll",this.checkVisibilityOnScroll)}isAutoplay(){return this.flkty.options.autoPlay!==!1}checkSliderVisibility(){if(!this.flkty)return;
8const isInitialized=this.container.classList.contains(classes.flickityEnabled);(window.visibilityHelper.isElementPartiallyVisible(this.container)||window.visibilityHelper.isElementTotallyVisible(this.container))&&isInitialized&&this.isAutoplay()?this.flkty.playPlayer():this.flkty.stopPlayer()}slideActions(){const currentSlideColor=this.container.querySelector(`.${classes.classIsSelected}`).getAttribute(selectors.dataColor);this.container.setAttribute(selectors.dataCurrentColor,currentSlideColor)}onUnload(){this.flkty.destroy(),document.removeEventListener("theme:scroll",this.checkVisibilityOnScroll)}onBlockSelect(evt){const slide=this.container.querySelector(`[${selectors.dataSlide}="${evt.detail.blockId}"]`),slideIndex=parseInt(slide.getAttribute(selectors.dataSlideIndex));this.flkty.select(slideIndex),this.flkty.stopPlayer()}onBlockDeselect(){this.isAutoplay()&&this.flkty.playPlayer()}}register("slideshow",[{onLoad(){sections[this.id]=new Slideshow(this)},onUnload(e){sections[this.id].onUnload(e)},onBlockSelect(e){sections[this.id].onBlockSelect(e)},onBlockDeselect(e){sections[this.id].onBlockDeselect(e)}},parallaxHero]),register("featured-video",[videoPlay,parallaxHero]);const wrap=(toWrap,wrapperClass="",wrapper)=>(wrapper=wrapper||document.createElement("div"),wrapper.classList.add(wrapperClass),toWrap.parentNode.insertBefore(wrapper,toWrap),wrapper.appendChild(toWrap));document.addEventListener("DOMContentLoaded",function(){load("*"),document.querySelectorAll("[data-anchor-link]").forEach(anchorLink=>{anchorLink.addEventListener("click",e=>{e.preventDefault();const position=document.getElementById(anchorLink.getAttribute("href").split("#")[1]).getBoundingClientRect().top+window.scrollY-theme.dimensions.headerScrolled;window.scrollTo({top:position,left:0,behavior:"smooth"})})}),document.querySelectorAll(".rte table").forEach(table=>{wrap(table,"rte__table-wrapper")}),document.querySelectorAll('.rte iframe[src*="youtube.com/embed"], .rte iframe[src*="player.vimeo"], .rte iframe#admin_bar_iframe').forEach(frame=>{wrap(frame,"rte__video-wrapper")}),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","supports-cookies"))})(themeVendor.BodyScrollLock,themeVendor.themeCurrency,themeVendor.Flickity,themeVendor.FlickityFade,themeVendor.ajaxinate,themeVendor.FlickityAsNavFor,themeVendor.Rellax),(function(){function appendButtonToJuoWidget(){const juoWidget=document.getElementById("juo-subscription-widget");if(!juoWidget||juoWidget.querySelector(".juo-custom-button"))return;const link=document.createElement("a");link.href="#subscription_trigger",link.className="juo-custom-button",link.textContent=window.theme.translations.more_info,juoWidget.querySelector(".j-subscription-details").append(link),link.addEventListener("click",function(e){e.preventDefault(),window._klOnsite=window._klOnsite||[],window._klOnsite.push(["openForm","WcMm22"])})}function checkAndHandleJuoWidget(){return document.getElementById("juo-subscription-widget")?(appendButtonToJuoWidget(),!0):!1}if(checkAndHandleJuoWidget())return;const observer=new MutationObserver(function(mutations){mutations.forEach(function(mutation){mutation.type==="childList"&&mutation.addedNodes.forEach(function(node){if(node.nodeType===1&&node.id==="juo-subscription-widget"){appendButtonToJuoWidget(),observer.disconnect();return}if(node.nodeType===1&&node.querySelector&&node.querySelector("#juo-subscription-widget")){appendButtonToJuoWidget(),observer.disconnect();return}})})});observer.observe(document.body,{childList:!0,subtree:!0});const checkInterval=setInterval(function(){checkAndHandleJuoWidget()&&(clearInterval(checkInterval),observer.disconnect())},1e3);setTimeout(function(){clearInterval(checkInterval),observer.disconnect()},3e4)})();
9//# sourceMappingURL=/cdn/shop/t/91/assets/theme.js.map?v=56376930868150233361788784143

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.