1"use strict";const isTouchDevice=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;if(isTouchDevice()){const subMenuNavs=document.querySelectorAll(".has-sub-menu > a");subMenuNavs.forEach(mainMenuNav=>{mainMenuNav.addEventListener("click",event=>{isTouchDevice()&&(subMenuNavs.forEach(item=>{item!==mainMenuNav&&item.classList.remove("is-dropdown-open")}),!mainMenuNav.classList.contains("is-dropdown-open")&&(event.preventDefault(),mainMenuNav.classList.add("is-dropdown-open")))})})}const navigations=document.querySelectorAll(".navigation-menu");navigations.forEach(navigation=>{const navigationMenusTopNavs=navigation.querySelectorAll(":scope > .has-sub-menu"),getMenuWidth=(element,initialWidth=0)=>{const submenu=element&&element.querySelector(".navigation-sub-menu");return submenu?getMenuWidth(submenu,initialWidth+submenu.clientWidth):initialWidth},setMenuClasses=()=>{const windowWidth=window.innerWidth;navigationMenusTopNavs.forEach(navigationMenusTopNav=>{if(navigationMenusTopNav.classList.contains("navigation-item-static"))return;navigationMenusTopNav.classList.remove("nav-open-left");const width=getMenuWidth(navigationMenusTopNav);navigationMenusTopNav.offsetLeft+width>windowWidth&&navigationMenusTopNav.classList.add("nav-open-left")})};setMenuClasses();let resizeTimer;window.addEventListener("resize",()=>{clearTimeout(resizeTimer),resizeTimer=setTimeout(()=>{setMenuClasses()},350)})});const mobileMenuWrap=document.querySelector(".head-slot-nav-mobile-link-wrapper"),mobileNavWrap=document.querySelector(".navigation-mobile-wrap"),mobileMenuToggle=document.querySelector(".head-slot-nav-mobile-link"),mobileMenu=document.querySelector(".mobile-menu"),expandOnButton=mobileMenu?.dataset.buttonExpand!=null,setMobileMenuMaxheight=(offset=0)=>{mobileMenu.style.maxHeight=`${window.innerHeight-document.querySelector(".header").getBoundingClientRect().bottom+offset}px`},handleMobileMenuOpen=()=>{const stickyHeader=document.querySelector("sticky-header");stickyHeader&&stickyHeader.reveal(),document.body.classList.add("mobile-menu-open"),mobileMenuToggle.ariaExpanded="true",mobileMenu.ariaHidden="false",trapFocus(mobileMenuWrap,mobileNavWrap);const offset=mobileMenu.closest(".header-alt")?60:0;setMobileMenuMaxheight(offset),publish(PUB_SUB_EVENTS.mobileMenuOpen)},handleMobileMenuDismiss=()=>{document.body.classList.remove("mobile-menu-open"),mobileMenuToggle.ariaExpanded="false",mobileMenu.ariaHidden="true",removeTrapFocus(mobileMenuToggle),mobileMenu.style.maxHeight="",publish(PUB_SUB_EVENTS.mobileMenuClose)},isMobileMenuOpen=()=>document.body.classList.contains("mobile-menu-open");document.body.addEventListener("click",event=>{const{target}=event,mobileNav=target.closest(".navigation-mobile-item"),isMobileNavButton=target.classList.contains("head-slot-nav-mobile-link")||!!target.closest(".head-slot-nav-mobile-link"),isMainNav=!!target.closest(".navigation-main"),isAnchorLink=target.tagName==="A"&&/^#[\w-]+/.test(target.getAttribute("href"));if(mobileNav&&mobileNav.querySelector("ul")){expandOnButton?target.closest(".navigation-mobile-item-link-expand")&&mobileNav.classList.toggle("menu-item-expanded"):(event.preventDefault(),mobileNav.classList.toggle("menu-item-expanded"));const isNowExpanded=mobileNav.classList.contains("menu-item-expanded"),button=mobileNav.querySelector(".navigation-mobile-item-link-expand");button&&(button.setAttribute("aria-expanded",isNowExpanded?"true":"false"),button.querySelector("span.visually-hidden").innerHTML=isNowExpanded?button.dataset.collapseText:button.dataset.expandText)}if(isMobileNavButton&&document.body.classList.contains("mobile-menu-open")){handleMobileMenuDismiss();return}if(isMobileNavButton){handleMobileMenuOpen();return}isAnchorLink&&handleMobileMenuDismiss(),isMobileMenuOpen()&&!target.closest(".mobile-menu")&&(event.preventDefault(),handleMobileMenuDismiss()),isMainNav&&isAnchorLink&&(target.closest(".navigation-main").classList.add("menus-closed"),setTimeout(()=>{target.closest(".navigation-main").classList.remove("menus-closed")},100))}),mobileMenuWrap&&mobileMenuWrap.addEventListener("keyup",event=>{event.code.toUpperCase()==="ESCAPE"&&handleMobileMenuDismiss()});class MegaMenuMain extends HTMLElement{constructor(){super(),this.toggle=this.querySelector(".button-mega-menu-toggle"),this.menu=this.querySelector(".mega-menu-main-wrapper"),this.tabNavs=this.querySelectorAll(".mega-menu-main-nav-item"),this.contentContainers=this.querySelectorAll(".mega-menu-main-content-tab"),this.toggle.addEventListener("click",this.onToggleClick),this.addEventListener("click",this.checkOnClickOutside),this.addEventListener("keyup",event=>{event.code.toUpperCase()==="ESCAPE"&&this.hide()}
1),this.tabNavs.forEach(tabNavs=>{tabNavs.addEventListener("click",this.handleTabNavChange)})}handleTabNavChange=event=>{event.preventDefault();const targetId=event.target.getAttribute("href");this.contentContainers.forEach(container=>{container.setAttribute("aria-hidden","true")}),this.tabNavs.forEach(tabNav=>{tabNav.classList.remove("current")}),this.querySelector(targetId)?.setAttribute("aria-hidden","false"),event.target.classList.add("current")};checkOnClickOutside=event=>{event.target.closest(".button-mega-menu-toggle")||event.target===this.toggle||!this.isHidden()&&!event.target?.closest(".mega-menu-main-container")&&this.hide()};onToggleClick=()=>{this.isHidden()?this.show():this.hide()};isHidden(){return this.getAttribute("aria-expanded")==="false"}isExpanded(){return this.getAttribute("aria-expanded")==="true"}hide(){this.setAttribute("aria-expanded","false"),this.menu.setAttribute("aria-hidden","true"),removeTrapFocus(this.toggle)}show(){this.setAttribute("aria-expanded","true"),this.menu.setAttribute("aria-hidden","false"),trapFocus(this.querySelector(".mega-menu-main-container"))}}customElements.define("mega-menu-main",MegaMenuMain);class DropdownModal extends HTMLElement{constructor(){super(),this.eventPrefix=this.dataset.eventPrefix,this.toggles=this.querySelectorAll(".dropdown-modal-toggle"),this.content=this.querySelector(".dropdown-modal-toggle + div"),this.preventOpen=this.getAttribute("prevent-open")==="true",!this.preventOpen&&(this.addEventListener("keyup",event=>{event.code.toUpperCase()==="ESCAPE"&&this.close()}),this.toggles.forEach(toggle=>{toggle.addEventListener("click",this.handleToggle.bind(this))}))}isOpen(){return this.getAttribute("open")==="true"}handleToggle(event){event?.preventDefault?.(),this.isOpen()?this.close():this.open()}open(opener){this.openedBy=opener,this.setAttribute("open",!0),this.toggles.forEach(toggle=>{toggle.setAttribute("aria-expanded",!0)}),trapFocus(this),this.eventPrefix&&publish(`${this.eventPrefix}:open`),document.querySelectorAll("localization-form")?.forEach?.(localizationForm=>{localizationForm?.hidePanel?.()})}close(){this.toggles.forEach(toggle=>{toggle.setAttribute("aria-expanded",!1)}),this.removeAttribute("open"),this.openedBy&&removeTrapFocus(this.openedBy),this.eventPrefix&&publish(`${this.eventPrefix}:close`)}}customElements.define("dropdown-modal",DropdownModal);class DropdownModalToggle extends HTMLElement{constructor(){super(),this.button=this.querySelector("button")||this.querySelector("a"),this.preventOpen=this.getAttribute("prevent-open"),this.target=this.getAttribute("for"),this.button&&this.button.addEventListener("click",this.handleToggle.bind(this))}handleToggle(event){const{target}=event,dropdownModal=document.getElementById(this.target);if(!dropdownModal||this.preventOpen)return;event.preventDefault(),dropdownModal.isOpen()?dropdownModal.close():(dropdownModal.open(target),target.closest("#mobile-dock")&&document.querySelector("sticky-header").reveal())}}customElements.define("dropdown-modal-toggle",DropdownModalToggle);class HeaderMiniCartDropdownModal extends DropdownModal{constructor(){super()}setMaxHeight(){const offset=this.closest(".header-alt")?60:0;this.content.style.maxHeight=`${window.innerHeight-document.querySelector(".header").getBoundingClientRect().bottom+offset}px`}open(opener){super.open(opener),this.setMaxHeight(),setTimeout(()=>{trapFocus(this,this.querySelector(".dropdown-modal-toggle"))},250)}close(){super.close(),this.content.style.maxHeight=""}}customElements.define("header-mini-cart-dropdown-modal",HeaderMiniCartDropdownModal);class HeaderSearchDropdownModal extends DropdownModal{constructor(){super(),this.searchInput=this.querySelector('input[type="search"]')}open(opener){super.open(opener),trapFocus(this,this.searchInput)}}customElements.define("header-search-dropdown-modal",HeaderSearchDropdownModal);const sidebarDrawerButton=document.querySelector(".button-sidebar-drawer-open"),sidebarDrawer=document.querySelector(".page-layout-sidebar"),handleSidebarOpen=()=>{document.body.classList.add("page-layout-sidebar-drawer-open"),document.body.classList.add("overflow-hidden-tablet"),trapFocus(sidebarDrawer,sidebarDrawer.querySelector(".page-layout-sidebar-drawer-header"))},handleSidebarDismiss=()=>{document.body.classList.remove("page-layout-sidebar-drawer-open"),document.body.classList.remove("overflow-hidden-tablet"),removeTrapFocus(sidebarDrawerButton)},isSidebarOpen=()=>document.body.classList.contains("page-layout-sidebar-drawer-open");sidebarDrawerButton&&sidebarDrawer&&(document.body.addEventListener("click",event=>{const{target}=event;if(target.classList.contains("js-button-sidebar-drawer-dismiss")){handleSidebarDismiss();return}if(target.classList.contains("button-sidebar-drawer-open")){handleSidebarOpen();return}isSidebarOpen()&&!target.closest(".page-layout-sidebar")&&(handleSidebarDismiss(),event.preventDefault())}),sidebarDrawer.addEventListener("keyup",event=>{event.code.toUpperCase()==="ESCAPE"&&handleSidebarDismiss()})),document.addEventListener("change",event=>{if(event.target.parentNode?.classList.contains("select-custom")){const select=event.target,label=select.parentNode.querySelector("label");label.textContent=select.options[select.selectedIndex].text}}),(()=>{const reviewsLink=document.querySelectorAll('a[href*="#product-reviews"]'),reviews=document.getElementById("product-reviews"),tabsNavigation=document.querySelector("tabs-navigation");reviewsLink&&reviews&&tabsNavigation&&reviewsLink.forEach(link=>{link.addEventListener("click",()=>{tabsNavigation.setActiveTab(reviews)})}),window.location.hash==="#product-reviews"&&reviews&&tabsNavigation&&(setTimeout(()=>{tabsNavigation.setActiveTab(reviews)},0),setTimeout(()=>{reviews.scrollIntoView()},200))})(),(()=>{const appReviewLinks=document.querySelectorAll(".star-rating-badge"),reviews=document.getElementById("product-reviews"),tabsNavigation=document.querySelector("tabs-navigation");appReviewLinks.length>0&&reviews&&appReviewLinks.forEach(link=>{link.classList.contains("star-rating-link")||link.addEventListener("click",()=>{tabsNavigation.setActiveTab(reviews)})}),appReviewLinks.length>0&&!reviews&&appReviewLinks.forEach(link=>{if(link.classList.contains("star-rating-link"))return;const parentCard=link.closest(".card-product");
1if(parentCard){const href=parentCard.querySelector(".card-heading > a")?.getAttribute("href");link.addEventListener("click",()=>{window.location=`${href}#product-reviews`})}})})();class CollapsibleExpandable extends HTMLElement{constructor(){super()}connectedCallback(){this.collapsed=this.getAttribute("expanded")==="false",this.toggleElement=this.querySelector(".facet-toggle"),this.onToggle=this.onToggle.bind(this),this.toggleElement.addEventListener("click",this.onToggle),this.list=this.querySelector(".facet-options-list"),this.listCollapsed=this.list&&this.list.getAttribute("aria-expanded")==="false",this.expandListToggle=this.querySelector(".facet-button-more"),this.onListToggle=this.onListToggle.bind(this),this.expandListToggle&&this.expandListToggle.addEventListener("click",this.onListToggle)}disconnectedCallback(){this.toggleElement.removeEventListener("click",this.onToggle),this.expandListToggle&&this.expandListToggle.removeEventListener("click",this.onListToggle())}onToggle(event){event.preventDefault(),this.handleToggle()}collapse(){this.setAttribute("expanded","false"),this.toggleElement.setAttribute("aria-expanded","false"),this.collapsed=!0}expand(){this.setAttribute("expanded","true"),this.toggleElement.setAttribute("aria-expanded","true"),this.collapsed=!1}handleToggle(){this.collapsed?this.expand():this.collapse()}onListToggle(event){event&&event.preventDefault(),this.handleToggleList()}collapseList(){this.list&&this.list.setAttribute("aria-expanded","false"),this.expandListToggle&&(this.expandListToggle.innerHTML="+ "+window.productsStrings.facetsShowMore),this.listCollapsed=!0}expandList(){this.list&&this.list.setAttribute("aria-expanded","true"),this.expandListToggle&&(this.expandListToggle.innerHTML="− "+window.productsStrings.facetsShowLess),this.listCollapsed=!1}handleToggleList(){this.listCollapsed?this.expandList():this.collapseList()}}customElements.define("collapsible-expandable",CollapsibleExpandable);class ModalDialog extends HTMLElement{constructor(){super(),this.querySelector('[id^="ModalClose-"]')?.addEventListener("click",this.hide.bind(this)),this.addEventListener("keyup",event=>{event.code.toUpperCase()==="ESCAPE"&&this.hide()}),this.classList.contains("media-modal")?this.addEventListener("pointerup",event=>{event.pointerType==="mouse"&&!event.target.closest("deferred-media, product-model")&&this.hide()}):this.addEventListener("click",event=>{event.target.nodeName==="MODAL-DIALOG"&&this.hide()})}connectedCallback(){this.moved||Shopify.designMode||(this.moved=!0,document.body.appendChild(this))}show(opener){this.openedBy=opener,document.body.classList.add("overflow-hidden"),this.setAttribute("open",""),trapFocus(this,this.querySelector('[role="dialog"]')),window.pauseAllMedia()}hide(){document.body.classList.remove("overflow-hidden"),this.removeAttribute("open"),this.openedBy&&removeTrapFocus(this.openedBy),window.pauseAllMedia()}}customElements.define("modal-dialog",ModalDialog);class ModalOpener extends HTMLElement{constructor(){super();const button=this.querySelector("button");button&&button.addEventListener("click",()=>{const modal=document.querySelector(this.getAttribute("data-modal"));modal&&modal.show(button)})}}customElements.define("modal-opener",ModalOpener);class HTMLUpdateUtility{#preProcessCallbacks=[];#postProcessCallbacks=[];constructor(){}addPreProcessCallback(callback){this.#preProcessCallbacks.push(callback)}addPostProcessCallback(callback){this.#postProcessCallbacks.push(callback)}viewTransition(oldNode,newContent){this.#preProcessCallbacks.forEach(callback=>callback(newContent));const newNodeWrapper=document.createElement("div");HTMLUpdateUtility.setInnerHTML(newNodeWrapper,newContent.outerHTML);const newNode=newNodeWrapper.firstChild;oldNode.parentNode.insertBefore(newNode,oldNode),oldNode.style.display="none";const uniqueKey=Date.now();oldNode.querySelectorAll("[id], [form]").forEach(element=>{element.id&&(element.id=`${element.id}-${uniqueKey}`),element.form&&element.setAttribute("form",`${element.form.getAttribute("id")}-${uniqueKey}`)}),this.#postProcessCallbacks.forEach(callback=>callback(newNode)),setTimeout(()=>
1oldNode.remove(),500)}static setInnerHTML(element,html){element.innerHTML=html,element.querySelectorAll("script").forEach(oldScriptTag=>{const newScriptTag=document.createElement("script");Array.from(oldScriptTag.attributes).forEach(attribute=>{newScriptTag.setAttribute(attribute.name,attribute.value)}),newScriptTag.appendChild(document.createTextNode(oldScriptTag.innerHTML)),oldScriptTag.parentNode.replaceChild(newScriptTag,oldScriptTag)})}}class VariantSelects extends HTMLElement{constructor(){super(),this.initializeProductSwapUtility(),this.addEventListener("change",this.handleProductUpdate),this.sectionId=this.dataset.section,this.hideOutOfStock=this.dataset.variantsVisibility==="hide",this.hideSingle=this.dataset.hideSingle==="true",this.preselectVariant=this.dataset.preselectVariant==="true",this.optionsWithValues=JSON.parse(this.querySelector('[type="application/json"][data-id="product-options-with-values"]').textContent),this.variants=JSON.parse(this.querySelector('[type="application/json"][data-id="product-variants"]')?.textContent??null),this.updateVisibility()}initializeProductSwapUtility(){this.swapProductUtility=new HTMLUpdateUtility,this.swapProductUtility.addPostProcessCallback(newNode=>{window?.Shopify?.PaymentButton?.init(),window?.ProductModel?.loadShopifyXR(),publish(PUB_SUB_EVENTS.sectionRefreshed,{data:{sectionId:this.sectionId,resource:{type:"product",id:newNode.querySelector("variant-selects, variant-radios").dataset.productId}}})})}handleProductUpdate(event){const input=this.getInputForEventTarget(event.target),targetId=input.id,targetUrl=input.dataset.productUrl||this.dataset.url,sectionId=this.sectionId;this.currentVariant=this.getVariantData(targetId),this.currentVariant=this.maybeGetFirstAvailableVariant(this.currentVariant,input),this.hideVariants=this.dataset.hideVariants==="true";let productUrl=this.getProductInfoUrl(targetUrl,this.currentVariant?.id);if(this.closest("quick-view-drawer")){this.handleQuickviewUpdate(productUrl,targetId);return}this.toggleAddButton(!0,"");let callback=()=>{};if(this.dataset.url!==targetUrl||this.hideVariants&&this.currentVariant){this.updateURL(targetUrl),this.updateShareUrl(targetUrl),callback=this.handleSwapProduct(sectionId);const shouldFetchFullPage=this.dataset.updateUrl==="true";productUrl=this.getProductInfoUrl(targetUrl,this.currentVariant?.id,shouldFetchFullPage)}else this.currentVariant?(this.updateMedia(),this.updateURL(targetUrl),this.updateShareUrl(targetUrl),this.updateVariantInput(),callback=this.handleUpdateProductInfo(sectionId).bind(this)):(this.setUnavailable(),callback=html=>{this.updatePickupAvailability(),this.updateOptionValues(html)});this.renderProductInfo(productUrl,targetId,callback)}maybeGetFirstAvailableVariant(currentVariant,inputClicked){let newVariant=currentVariant;if(this.variants&&this.hideOutOfStock&&(!currentVariant||!currentVariant.available)){const selectedOptionPosition=inputClicked.closest("fieldset, select").dataset.optionPosition,selectedOptions=Array.from(this.querySelectorAll("fieldset input:checked, select option:checked")).reduce((acc,element)=>(acc.push(element.value),acc),[]),firstAvailableVariant=this.variants.find((variant,index)=>{const variantSlice=variant.options.slice(0,selectedOptionPosition).toString(),selectedSlice=selectedOptions.slice(0,selectedOptionPosition).toString();return variant.available&&variantSlice===selectedSlice});firstAvailableVariant&&(newVariant=firstAvailableVariant)}return newVariant}getInputForEventTarget(target){return target.tagName==="SELECT"?target.selectedOptions[0]:target}getWrappingSection(sectionId){return this.closest(`#shopify-section-${sectionId}`)||null}handleSwapProduct(sectionId){return html=>{const oldContent=this.getWrappingSection(sectionId);if(!oldContent)return;document.getElementById(`ProductModal-${sectionId}`)?.remove();const response=html.getElementById(`shopify-section-${sectionId}`);this.dataset.updateUrl==="true"?(this.swapProductUtility.viewTransition(document.querySelector("main"),html.querySelector("main")),document.querySelector("head title").innerHTML=html.querySelector("head title").innerHTML):this.swapProductUtility.viewTransition(oldContent,response)}}handleQuickviewUpdate(productUrl,targetId){const quickViewDrawer=this.closest("quick-view-drawer"),productForm=quickViewDrawer.querySelector("product-form form");productForm&&(productForm.style.opacity="0.7"),this.renderProductInfo(productUrl,targetId,html=>{quickViewDrawer.renderProduct(html,this.currentVariant)})}updateMedia(){const mediaGallery=document.getElementById(`MediaGallery-${this.dataset.section}`);!this.currentVariant||!this.currentVariant.featured_media||mediaGallery?.setActiveMedia&&mediaGallery.setActiveMedia(this.currentVariant.featured_media.id,mediaGallery.getAttribute("hide-variants")==="true")}updateURL(url){!this.currentVariant||this.dataset.updateUrl==="false"||window.history.replaceState({},"",`${url}${this.currentVariant?.id?`?variant=${this.currentVariant.id}`:""}`)}updateShareUrl(url){const shareButtons=document.querySelectorAll(`Product-${this.dataset.section} .list-social-item a`);shareButtons&&shareButtons.forEach(button=>{const fullUrl=`${window.shopUrl}${url}${this.currentVariant?.id?`?variant=${this.currentVariant.id}`:""}`;button.href=`${button.dataset.shareUrl}${encodeURIComponent(fullUrl)}`})}updateVariantInput(){document.querySelectorAll(`#product-form-${this.dataset.section}, #product-form-installment`).forEach(productForm=>{const input=productForm.querySelector('input[name="id"]');input.value=this.currentVariant.id,input.dispatchEvent(new Event("change",{bubbles:!0}))})}updatePickupAvailability(){const pickUpAvailability=document.querySelector("pickup-availability");!pickUpAvailability||!pickUpAvailability.fetchAvailability||(this.currentVariant&&this.currentVariant.available?pickUpAvailability.fetchAvailability(this.currentVariant.id):(pickUpAvailability.removeAttribute("available"),pickUpAvailability.innerHTML=""))}updateVisibility(){const hasSingleVariant=Array.from(this.querySelectorAll("variant-radios fieldset, variant-selects select")).reduce((acc,fieldset)=>acc&&fieldset.querySelectorAll("input, option").length===1,!0),parent=this.closest(".product-variants");this.hideSingle&&hasSingleVariant&&this.preselectVariant?parent?.classList.add("hidden"):(parent?.classList.add("variants-visible"),parent?.classList.remove("variants-hidden"))}updateOptionValues(html){const variantSelects=html.querySelector("variant-selects, variant-radios");variantSelects&&(this.innerHTML=variantSelects.innerHTML)}getProductInfoUrl(url,variantId,shouldFetchFullPage=!1){const params=[];if(shouldFetchFullPage||params.push(`section_id=${this.sectionId}`),variantId)params.push(`variant=${variantId}`);else{const optionValues=this.getSelectedOptionValues();optionValues.length&¶ms.push(`option_values=${optionValues.join(",")}`)}return`${url}?${params.join("&")}`}renderProductInfo(productUrl,targetId,callback){this.abortController?.abort(),this.abortController=new AbortController,fetch(productUrl,{signal:this.abortController.signal}).then(response=>response.text()).then(responseText=>{const html=new DOMParser().parseFromString(responseText,"text/html");callback(html)}).then(()=>{const target=document.getElementById(targetId);target?.focus(),target?.tagName==="OPTION"&&(target.selected=!0)})}handleUpdateProductInfo(sectionId){return html=>{const productFormSource=html.getElementById(`product-form-${sectionId}`)?.closest("product-form"),productFormDestination=document.getElementById(`product-form-${sectionId}`)?.closest("product-form");productFormSource&&productFormDestination&&(productFormDestination.outerHTML=productFormSource.outerHTML);const blockDestinations=document.querySelectorAll(`.product-block-content-${sectionId}.variant-changed-update`),blockSources=html.querySelectorAll(`.product-block-content-${sectionId}.variant-changed-update`);blockDestinations.forEach((blockDestination,index)=>{const blockSource=blockSources[index];blockSource&&(blockDestination.outerHTML=blockSource.outerHTML)});const tabs=document.querySelector(`#shopify-section-${sectionId} tabs-navigation`);tabs&&tabs.init(),this.toggleAddButton(!this.currentVariant.available),this.setProductInfo(html),this.setProductInfoMeta(html),this.updatePickupAvailability(),this.updateOptionValues(html),publish(PUB_SUB_EVENTS.productVariantChange,{sectionId:this.dataset.section,html,variant:this.currentVariant})}}setProductInfo(html){const className=`#ProductPage-${this.sectionId}
1 .product-info-details-list`,destinations=document.querySelectorAll(className),sources=html.querySelectorAll(className);destinations.length>0&&destinations.forEach((destination,index)=>{sources[index]&&(destination.innerHTML=sources[index]?.innerHTML)})}setProductInfoMeta(html){const destinations=document.querySelectorAll(`.product-info-meta-${this.dataset.section}`);destinations.length>0&&destinations.forEach(destination=>{const source=html?.querySelector(`.product-info-meta-${this.dataset.section}[data-block-id="${destination.dataset.blockId}"]`);source?(destination.classList.remove("visibility-hidden"),destination.innerHTML=source.innerHTML):destination.classList.add("visibility-hidden")})}toggleAddButton(disable=!0){const productForm=document.getElementById(`product-form-${this.dataset.section}`);if(!productForm)return;const addButton=productForm.querySelector('[name="add"]');addButton&&(disable?addButton.setAttribute("disabled","disabled"):addButton.removeAttribute("disabled"))}setUnavailable(){const form=document.getElementById(`product-form-${this.dataset.section}`),addButton=form?.querySelector('[name="add"]'),addButtonText=form?.querySelector('[name="add"] > span'),price=document.getElementById(`price-${this.dataset.section}`),product=document.getElementById(`ProductPage-${this.dataset.section}`),stockBarBlock=document.getElementById(`ProductStockBar-${this.dataset.section}`);this.preselectVariant||form.closest(".product-form")?.classList.remove("visually-hidden"),addButton&&(addButtonText.textContent=window.variantStrings.unavailable),price&&price.classList.add("visibility-hidden"),stockBarBlock&&stockBarBlock.classList.add("hidden");const unavailableDetails=product.querySelectorAll(".product-info-details-variant-field .product-info-details-item-value");unavailableDetails&&unavailableDetails.forEach(detail=>detail.innerHTML="-"),this.setProductInfoMeta(null)}getVariantData(inputId){return JSON.parse(this.querySelector(`script[type="application/json"][data-resource="${inputId}"]`).textContent)}getSelectedOptionValues(){return Array.from(this.querySelectorAll("select option:checked, fieldset input:checked")).map(element=>element.dataset.optionValueId)}}customElements.get("variant-selects")||customElements.define("variant-selects",VariantSelects);class VariantRadios extends VariantSelects{constructor(){super()}}customElements.define("variant-radios",VariantRadios);class ProductCard extends HTMLElement{constructor(){super(),this.colorSwatches=this.querySelectorAll(".card-product-color-swatch"),this.productLinks=this.querySelectorAll("a.js-product-link"),this.colorSwatches.forEach(colorSwatch=>{colorSwatch.addEventListener("click",event=>{event.preventDefault(),this.handleColorSwatchClick(colorSwatch)}),colorSwatch.addEventListener("mouseover",()=>{this.handleColorSwatchMouseOver(colorSwatch)})})}handleColorSwatchClick(colorSwatch){this.colorSwatches.forEach(x=>x.classList.remove("is-active")),colorSwatch.classList.add("is-active"),this.productLinks.forEach(productLink=>{productLink.setAttribute("href",colorSwatch.getAttribute("href"))});const variantImageTemplate=colorSwatch.querySelector(".card-media-image"),mainImage=this.querySelector(".card-media img:first-child");if(variantImageTemplate&&mainImage){const variantImage=variantImageTemplate.cloneNode(!0);variantImage.classList.remove("card-variant-image"),mainImage.replaceWith(variantImage)}const variantSku=colorSwatch.getAttribute("data-variant-sku"),skuElement=this.querySelector("[data-card-sku]");skuElement&&(skuElement.textContent=variantSku||"",skuElement.hidden=!variantSku)}handleColorSwatchMouseOver(colorSwatch){const image=colorSwatch.querySelector(".card-media-image");image&&(image.style.display="inline-block",image.setAttribute("loading",""))}}customElements.define("product-card",ProductCard);class ExpandableList extends HTMLElement{constructor(){super(),this.elements={root:this.querySelector("ul"),expandableNavs:this.querySelectorAll(".has-sub-menu"),expandableToggles:this.querySelectorAll(".navigation-side-toggle")},this.elements.expandableNavs.length&&(this.expandOnArrowsOnly=this.getAttribute("expand-on-arrows")==="true",this.expandOnArrowsOnly||this.elements.expandableNavs.forEac
1h(nav=>{nav.querySelector("a").addEventListener("click",this.onToggle.bind(this,nav))}),this.elements.expandableToggles.forEach(toggle=>{const nav=toggle.closest(".navigation-side-item");toggle.addEventListener("click",this.onToggle.bind(this,nav))}))}onToggle(navElement,event){event.preventDefault(),event.stopImmediatePropagation();const submenu=navElement.querySelector("ul"),closeOthers=this.getAttribute("close-others");submenu.getAttribute("aria-expanded")==="true"?this.onContract(navElement):(this.onExpand(navElement),closeOthers&&[...navElement.closest("ul").querySelectorAll(":scope > .has-sub-menu")].filter(item=>item!==navElement).forEach(this.onContract))}onExpand(element){const submenu=element.querySelector("ul"),toggle=element.querySelector(".navigation-side-toggle");element.classList.add("is-expanded"),submenu.setAttribute("aria-expanded","true"),toggle&&(toggle.setAttribute("aria-expanded","true"),toggle.querySelector("span.visually-hidden").innerHTML=toggle.dataset.collapseText)}onContract(element){const submenu=element.querySelector("ul"),toggle=element.querySelector(".navigation-side-toggle");element.classList.remove("is-expanded"),submenu.setAttribute("aria-expanded","false"),toggle&&(toggle.setAttribute("aria-expanded","false"),toggle.querySelector("span.visually-hidden").innerHTML=toggle.dataset.expandText)}}customElements.define("expandable-list",ExpandableList);class QuantityInput extends HTMLElement{constructor(){super(),this.input=this.querySelector("input"),this.changeEvent=ne
1w Event("change",{bubbles:!0}),this.input.addEventListener("change",this.onInputChange.bind(this)),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this)))}quantityUpdateUnsubscriber=void 0;connectedCallback(){this.validateQtyRules(),this.quantityUpdateUnsubscriber=subscribe(PUB_SUB_EVENTS.productQuantityUpdate,this.validateQtyRules.bind(this))}disconnectedCallback(){this.quantityUpdateUnsubscriber&&this.quantityUpdateUnsubscriber()}onInputChange(event){this.validateQtyRules()}onButtonClick(event){event.preventDefault();const previousValue=this.input.value;event.target.name==="plus"?parseInt(this.input.dataset.min)>parseInt(this.input.step)&&this.input.value==0?this.input.value=this.input.dataset.min:this.input.stepUp():this.input.stepDown(),previousValue!==this.input.value&&(this.input.dispatchEvent(this.changeEvent),publish(PUB_SUB_EVENTS.productQuantityUpdate,{quantity:Number(this.input.value)})),this.input.dataset.min===previousValue&&event.target.name==="minus"&&(this.input.value=parseInt(this.input.min))}validateQtyRules(){const value=parseInt(this.input.value);if(this.input.min&&this.querySelector("button[name='minus']").classList.toggle("disabled",parseInt(value)<=parseInt(this.input.min)),this.input.max){const max=parseInt(this.input.max);this.querySelector("button[name='plus']").classList.toggle("disabled",value>=max)}}}customElements.define("quantity-input",QuantityInput);class CartRemoveButton extends HTMLElement{constructor(){super(),this.addEventListener("click",event=>{event.preventDefault();const cartItems=this.closest("cart-items"),miniCart=this.closest("mini-cart");cartItems&&cartItems.updateQuantity(this.dataset.index,0),miniCart&&miniCart.updateQuantity(this.dataset.index,0)})}}customElements.define("cart-remove-button",CartRemoveButton);class CartItems extends HTMLElement{constructor(){super(),this.eventContext=this.dataset.eventContext,this.lineItemStatusElement=document.getElementById("shopping-cart-line-item-status"),this.currentItemCount=Array.from(this.querySelectorAll('[name="updates[]"]')).reduce((total,quantityInput)=>total+parseInt(quantityInput.value),0),this.debouncedOnChange=debounce(event=>{this.onChange(event)},500),this.querySelector(".main-cart-items")?.addEventListener("change",this.debouncedOnChange.bind(this))}onChange(event){event.target.getAttribute("id")?.includes?.("cart-policy")||event.target.closest("cart-coupon")||this.updateQuantity(event.target.dataset.index,event.target.value,document.activeElement.getAttribute("name"))}getSectionsToRender(){return[{id:"cart-page-title-wrap",section:document.getElementById("cart-page-title-wrap").dataset.id,selector:".page-title-wrap"},{id:"main-cart-items",section:document.getElementById("main-cart-items").dataset.id,selector:".js-contents"},{id:"header",section:document.getElementById("header").dataset.id,selector:".head-slot-cart-link"},{id:"cart-live-region-text",section:"cart-live-region-text",selector:".shopify-section"},{id:"main-cart-footer",section:document.getElementById("main-cart-footer").dataset.id,selector:".js-contents"},{id:"mobile-dock",section:document.getElementById("mobile-dock")?.dataset.id,selector:".head-slot-cart-link"}].filter(section=>{const element=document.getElementById(section.id);return element&&(section.selector?element.querySelector(section.selector):!0)})}updateQuantity(line,quantity,name){this.enableLoading(line);const body=JSON.stringify({line,quantity,sections:this.getSectionsToRender().map(section=>section.section),sections_url:window.location.pathname});fetch(`${routes.cart_change_url}`,{...fetchConfig(),body}).then(response=>response.text()).then(async state=>{const parsedState=JSON.parse(state),quantityElement=document.getElementById(`quantity-input-${line}`)||document.getElementById(`Mini-Cart-Quantity-${line}`),items=document.querySelectorAll(".js-cart-item");if(parsedState.errors){await this.updateSectionContents(),this.updateLiveRegions(line,parsedState.errors);return}this.classList.toggle("is-empty",parsedState.item_count===0);const cartFooter=document.getElementById("main-cart-footer");cartFooter&&cartFooter.classList.toggle("is-empty",parsedState.item_count===0),this.get
1SectionsToRender().forEach(section=>{const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id);elementToReplace.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.section],section.selector)});const updatedValue=parsedState.items[line-1]?parsedState.items[line-1].quantity:void 0;let message="";items.length===parsedState.items.length&&updatedValue!==parseInt(quantityElement.value)&&(typeof updatedValue>"u"?message=window.cartStrings.error:message=window.cartStrings.quantityError.replace("[quantity]",updatedValue)),this.updateLiveRegions(line,message);const lineItem=document.getElementById(`CartItem-${line}`)||document.getElementById(`MiniCartItem-${line}`);lineItem&&lineItem.querySelector(`[name="${name}"]`)&&lineItem.querySelector(`[name="${name}"]`).focus(),parseInt(quantity,10)===0?publish(PUB_SUB_EVENTS.cartItemRemove,{source:this.eventContext,cart:parsedState}):publish(PUB_SUB_EVENTS.cartItemQuantityUpdate,{source:this.eventContext,cart:parsedState}),publish(PUB_SUB_EVENTS.cartUpdate,{source:"cart-items",cartData:parsedState,variantId:parsedState.items[line-1]?.id})}).catch(()=>{this.setError(window.cartStrings.error)}).finally(()=>{this.disableLoading()})}setError(error){document.getElementById("cart-errors").textContent=error}updateLiveRegions(line,message){const lineItemError=document.getElementById(`Line-item-error-${line}`);lineItemError&&(lineItemError.querySelector(".cart-item-error-text").innerHTML=message),this.lineItemStatusElement.setAttribute("aria-hidden",!0);const cartStatus=document.getElementById("cart-live-region-text");cartStatus.setAttribute("aria-hidden",!1),setTimeout(()=>{cartStatus.setAttribute("aria-hidden",!0)},1e3)}updateSectionContents(){return fetch(`${window.location.pathname}?sections=${this.getSectionsToRender().map(section=>section.section).join(",")}&v=${Date.now()}`).then(response=>response.json()).then(response=>{this.getSectionsToRender().forEach(section=>{const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id);elementToReplace.innerHTML=this.getSectionInnerHTML(response[section.section],section.selector)})})}getSectionInnerHTML(html,selector){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}enableLoading(line){document.getElementById("main-cart-items").classList.add("cart-items-disabled"),this.querySelectorAll(`#CartItem-${line} .cart-item-loading-overlay`).forEach(overlay=>overlay.classList.remove("hidden")),document.activeElement.blur(),this.lineItemStatusElement.setAttribute("aria-hidden",!1)}disableLoading(){document.getElementById("main-cart-items").classList.remove("cart-items-disabled"),this.querySelectorAll(".cart-item-loading-overlay").forEach(overlay=>overlay.classList.add("hidden"))}}customElements.define("cart-items",CartItems);class MiniCart extends CartItems{constructor(){super(),this.modal=this.querySelector(".dropdown-modal"),this.stickyHeader=document.querySelector("sticky-header"),this.querySelector(".mini-cart-inner")?.addEventListener("change",this.debouncedOnChange.bind(this))}connectedCallback(){this.updateSectionContents(),window.miniCart=this,document.addEventListener("open-mini-cart",e=>{this.open(e.detail?.opener||null)}),document.addEventListener("close-mini-cart",()=>{this.close()}),document.addEventListener("toggle-mini-cart",e=>{const opener=e.detail?.opener||null;this.modal?.hasAttribute("open")?this.close():this.open(opener)})}open(opener){this.stickyHeader&&this.stickyHeader.reveal(),this.modal.open(opener),this.dispatchEvent(new CustomEvent("mini-cart:opened",{bubbles:!0}))}close(){this.modal.close(),this.dispatchEvent(new CustomEvent("mini-cart:closed",{bubbles:!0}))}getSectionsToRender(){return[{id:"header",section:document.getElementById("header").dataset.id,selector:".head-mast .head-slot-cart-link"},{id:"header-mini-cart-content",section:"header-mini-cart-content"},{id:"header-mini-cart-footer",section:"header-mini-cart-footer"},{id:"mobile-dock",section:document.getElementById("mobile-dock")?.dataset.id,selector:".head-slot-cart-link"}].filter(section=>{const element=document.getElementById(section.id);return element&&(section.selector?element.querySelector(section.selector):!0)})}getSectionInnerHTML(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}
1renderContents(parsedState){this.getSectionsToRender().forEach(section=>{const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id);elementToReplace.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.section],section.selector)}),this.currentItemCount=Array.from(this.querySelectorAll('[name="updates[]"]')).reduce((total,quantityInput)=>total+parseInt(quantityInput.value),0)}setError(error){document.getElementById("mini-cart-error").textContent=error}enableLoading(){this.querySelector(".mini-cart-wrap").classList.add("loading")}disableLoading(){this.querySelector(".mini-cart-wrap").classList.remove("loading")}updateLiveRegions(line,message){const lineItemError=document.getElementById(`MiniCart-Line-item-error-${line}`);lineItemError&&(lineItemError.querySelector(".cart-item-error-text").innerHTML=message)}}customElements.define("mini-cart",MiniCart);class LocalizationForm extends HTMLElement{constructor(){super(),this.elements={input:this.querySelector('input[name="locale_code"], input[name="country_code"]'),button:this.querySelector("button"),dropdown:this.querySelector(".dropdown"),panel:this.querySelector(".dropdown-list-wrap")},this.elements.button.addEventListener("click",this.openSelector.bind(this)),this.elements.button.addEventListener("focusout",this.closeSelector.bind(this)),this.addEventListener("keyup",this.onContainerKeyUp.bind(this)),this.querySelectorAll("a").forEach(item=>item.addEventListener("click",this.onItemClick.bind(this)))}hidePanel(){this.elements.button.blur(),this.elements.button.setAttribute("aria-expanded","false"),this.elements.panel.setAttribute("aria-hidden","true")}onContainerKeyUp(event){event.code.toUpperCase()==="ESCAPE"&&(this.hidePanel(),this.elements.button.focus())}onItemClick(event){event.preventDefault();const form=this.querySelector("form");this.elements.input.value=event.currentTarget.dataset.value,form&&form.submit()}toggleSelector(){if(this.isOpen()){this.hidePanel();return}this.elements.button.focus(),this.elements.panel.setAttribute("aria-hidden","false"),this.elements.button.setAttribute("aria-expanded","true")}isOpen(){return this.elements.panel.getAttribute("aria-hidden")==="false"}openSelector(){this.elements.button.focus(),this.elements.panel.setAttribute("aria-hidden",this.elements.button.getAttribute("aria-hidden")==="true"),this.elements.button.setAttribute("aria-expanded",(this.elements.button.getAttribute("aria-expanded")==="false").toString())}closeSelector(event){const shouldClose=event.relatedTarget&&(event.relatedTarget.nodeName==="BUTTON"||event.relatedTarget.nodeName==="MAIN");(event.relatedTarget===null||shouldClose)&&this.hidePanel()}}customElements.define("localization-form",LocalizationForm);class TabsComponent extends HTMLElement{constructor(){super()}setActiveTab(handle){this.querySelectorAll("[data-handle]").forEach(tab=>{if(tab.setAttribute("aria-hidden","true"),tab.getAttribute("data-handle")===handle){const carouselComponent=tab.querySelector("carousel-slider");tab.setAttribute("aria-hidden","false"),carouselComponent&&carouselComponent.flickity?.resize()}})}}customElements.define("tabs-component",TabsComponent);class TabsNavigation extends HTMLElement{constructor(){super(),this.init()}init(){this.tabsId=this.getAttribute("for"),this.navs=this.querySelectorAll("a:not(.hidden), button"),this.navs.forEach((nav,key)=>{nav.addEventListener("click",this.onNavigationClick.bind(this,nav)),key==0&&this.setActiveTab(nav)})}onNavigationClick(element,event){event.preventDefault(),this.setActiveTab(element)}setActiveTab(nav){const target=nav.getAttribute("data-handle"),tabsComponent=document.querySelector(`#${this.tabsId}`);tabsComponent&&(tabsComponent.setActiveTab(target),this.navs.forEach(element=>{element===nav?element.classList.add("is-active"):element.classList.remove("is-active")}))}}customElements.define("tabs-navigation",TabsNavigation);class DeferredMedia extends HTMLElement{constructor(){super();const poster=this.querySelector('[id^="Deferred-Poster-"]');poster&&poster.addEventListener("click",this.loadContent.bind(this))}loadContent(focus=!0){if(window.pauseAllMedia(),!this.getAttribute("loaded")){const content=document.createElement("div");content.appendChild(this.querySelector("template").content.firstElementChild.cloneNode(!0)),this.setAttribute("loaded",!0);const deferredElement=this.appendChild(content.querySelector("video, model-viewer, iframe"));focus&&deferredElement.focus()}}}customElements.define("deferred-media",DeferredMedia);class DrawerModal extends HTMLElement{constructor(){super(),this.bodyClass=this.getAttribute("body-class"),this.isOpen=!1,this.eventPrefix=this.dataset.eventPrefix,this.addEventListener("keyup",event=>{event.code.toUpperCase()==="ESCAPE"&&this.close()})}open(opener){this.isOpen=!0,this.openedBy=opener,document.body.classList.add(this.bodyClass),document.body.classList.add("drawer
1-open"),this.eventPrefix&&publish(`${this.eventPrefix}:open`)}close(){this.isOpen=!1,document.body.classList.remove(this.bodyClass),document.body.classList.remove("drawer-open"),this.openedBy&&removeTrapFocus(this.openedBy),this.eventPrefix&&publish(`${this.eventPrefix}:close`)}}customElements.define("drawer-modal",DrawerModal);class DrawerToggle extends HTMLElement{constructor(){super(),this.toggleElement=this.querySelector("a")||this.querySelector("button"),this.bodyClass=this.getAttribute("body-class"),this.preventOpen=this.getAttribute("prevent-open")==="true",!this.preventOpen&&this.toggleElement.addEventListener("click",event=>{event.preventDefault(),this.handleToggle()})}handleToggle(opener){document.querySelector(`#${this.getAttribute("for")}`).isOpen?this.close():this.open(opener)}open(opener){const drawer=document.querySelector(`#${this.getAttribute("for")}`);if(drawer){drawer.open(opener||this.toggleElement);const drawerHeader=drawer.querySelector(".drawer-header");trapFocus(drawer,drawerHeader)}}close(){const drawer=document.querySelector(`#${this.getAttribute("for")}`);drawer&&drawer.close&&drawer.close()}}customElements.define("drawer-toggle",DrawerToggle);class CartConsentCheckbox extends HTMLElement{constructor(){super()}connectedCallback(){const CART_CONSENT_CHECKBOX_VALUE="_CART_CONSENT_CHECKBOX_",checkbox=this.querySelector('[type="checkbox"]');localStorage.getItem(CART_CONSENT_CHECKBOX_VALUE)==="checked"&&checkbox.setAttribute("checked",!0),checkbox.addEventListener("change",function(){this.checked?localStorage.setItem(CART_CONSENT_CHECKBOX_VALUE,"checked"):localStorage.removeItem(CART_CONSENT_CHECKBOX_VALUE)})}}customElements.define("cart-consent-checkbox",CartConsentCheckbox);class BulkAdd extends HTMLElement{static ASYNC_REQUEST_DELAY=250;constructor(){super(),this.queue=[],this.setRequestStarted(!1),this.ids=[]}startQueue(id,quantity){this.queue.push({id,quantity});const interval=setInterval(()=>{this.queue.length>0?this.requestStarted||this.sendRequest(this.queue):clearInterval(interval)},BulkAdd.ASYNC_REQUEST_DELAY)}sendRequest(queue){this.setRequestStarted(!0);const items={};queue.forEach(queueItem=>{items[parseInt(queueItem.id)]=queueItem.quantity}),this.queue=this.queue.filter(queueElement=>!queue.includes(queueElement)),this.updateMultipleQty(items)}updateMultipleQty(items){}setRequestStarted(requestStarted){this._requestStarted=requestStarted}get requestStarted(){return this._requestStarted}resetQuantityInput(id){const input=this.querySelector(`#Quantity-${id}`);input.value=input.getAttribute("value"),this.isEnterPressed=!1}setValidity(event,index,message){event.target.setCustomValidity(message),event.target.reportValidity(),this.resetQuantityInput(index),event.target.select()}validateQuantity(event){const inputValue=parseInt(event.target.value),index=event.target.dataset.index;inputValue<event.target.dataset.min?this.setValidity(event,index,window.quickOrderListStrings.min_error.replace("[min]",event.target.dataset.min)):inputValue>parseInt(event.target.max)?this.setValidity(event,index,window.quickOrderListStrings.max_error.replace("[max]",event.target.max)):inputValue%parseInt(event.target.step)!=0?this.setValidity(event,index,window.quickOrderListStrings.step_error.replace("[step]",event.target.step)):(event.target.setCustomValidity(""),event.target.reportValidity(),event.target.setAttribute("value",inputValue),this.startQueue(index,inputValue))}getSectionInnerHTML(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}}customElements.get("bulk-add")||customElements.define("bulk-add",BulkAdd),customElements.get("quick-add-bulk")||customElements.define("quick-add-bulk",class extends BulkAdd{constructor(){super(),this.quantity=this.querySelector("quantity-input"),this.revealHeader=this.dataset.revealHeader==="true",this.triggerCart=this.dataset.triggerCart==="true";const debouncedOnChange=debounce(event=>{parseInt(event.target.value)===0?this.startQueue(event.target.dataset.index,parseInt(event.target.value)):this.validateQuantity(event)},300);this.addEventListener("change",debouncedOnChange.bind(this)),this.listenForActiveInput(),this.listenForKeydown(),this.lastActiveInputId=null}connectedCallback(){this.cartUpdateUnsubscriber=subscribe(PUB_SUB_EVENTS.cartUpdate,event=>{const quantity=parseInt(this.input.value,10);event.source==="quick-add"||quantity===0&&event.cartData.items&&!event.cartData.items.some(item=>item.id===parseInt(this.dataset.index))||quantity===0&&event.cartData.variant_id&&event.cartData.variant_id!==parseInt(this.dataset.index)||this.onCartUpdate().then(()=>{this.listenForActiveInput(),this.listenForKeydown()})})}disconnectedCallback(){this.cartUpdateUnsubscriber&&this.cartUpdateUnsubscriber()}get input(){return this.querySelector("quantity-input input")}listenForActiveInput(){this.classList.contains("hidden")||this.input?.addEventListener("focusin",event=>event.target.select()),this.isEnterPressed=!1}listenForKeydown(){this.input?.addEventListener("keydown",event=>{event.key==="Enter"&&(this.input?.blur(),this.isEnterPressed=!0)})}cleanErrorMessageOnType(event){event.target.addEventListener("keypress",()=>{event.target.setCustomValidity("")},{once:!0})}get sectionId(){return this._sectionId||(this._sectionId=this.dataset.sectionId),this._sectionId}onCartUpdate(){return new Promise((resolve,reject)=>{fetch(this.getSectionsUrl()).then(response=>response.text()).then(responseText=>{const sourceQty=new DOMParser().parseFromString(responseText,"text/html").querySelector(`#quick-add-bul
1k-${this.dataset.index}-${this.sectionId}`);sourceQty&&(this.innerHTML=sourceQty.innerHTML),resolve()}).catch(e=>{console.error(e),reject(e)})})}getSectionsUrl(){const pageParams=new URLSearchParams(window.location.search);return pageParams.set("section_id",this.sectionId),`${window.location.pathname}${pageParams.toString()?"?"+pageParams.toString():""}`}updateMultipleQty(items){this.setLoading(!0);const ids=Object.keys(items),body=JSON.stringify({updates:items,sections:this.getSectionsToRender().map(section=>section.section),sections_url:this.getSectionsUrl()});fetch(`${routes.cart_update_url}`,{...fetchConfig(),body}).then(response=>response.text()).then(state=>{const parsedState=JSON.parse(state);this.renderSections(parsedState,ids),this.revealHeader&&document.querySelector("sticky-header")?.reveal?.(),this.triggerCart&&document.querySelector("mini-cart")?.open?.(),publish(PUB_SUB_EVENTS.cartUpdate,{source:"quick-add",cartData:parsedState})}).catch(error=>{}).finally(()=>{this.setLoading(!1),this.setRequestStarted(!1)})}setLoading(loading=!1){const progressBar=this.querySelector(".qty-progress-bar-container"),spinner=this.querySelector(".spinner"),checkmark=this.querySelector(".quantity-success-check");loading?(progressBar.classList.add("visible"),spinner.classList.add("visible"),checkmark.classList.remove("visible")):(progressBar.classList.remove("visible"),spinner.classList.remove("visible"),checkmark.classList.add("visible"),setTimeout(()=>checkmark.classList.remove("visible"),1250))}getSectionsToRender(){return[{id:`quick-add-bulk-${this.dataset.index}-${this.sectionId}`,section:this.sectionId,selector:`#quick-add-bulk-${this.dataset.index}-${this.sectionId}`},{id:"header",section:document.getElementById("header").dataset.id,selector:".head-mast .head-slot-cart-link"},{id:"header-mini-cart-content",section:"header-mini-cart-content"},{id:"header-mini-cart-footer",section:"header-mini-cart-footer"},{id:"mobile-dock",section:document.getElementById("mobile-dock")?.dataset.id,selector:".head-slot-cart-link"}].filter(section=>{const element=document.getElementById(section.id);return element&&(section.selector?element.querySelector(section.selector):!0)})}renderSections(parsedState,ids){this.queue.filter(element=>ids.includes(element.id)).length===0&&(this.getSectionsToRender().forEach(section=>{const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id);elementToReplace.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.section],section.selector)}),this.isEnterPressed&&this.querySelector(`#Quantity-${this.lastActiveInputId}`).select(),this.listenForActiveInput(),this.listenForKeydown())}}),document.body.addEventListener("click",event=>{document.body.classList.contains("drawer-open")&&(event.target.closest(".drawer")||event.target.closest("drawer-toggle")||[...document.querySelectorAll(".drawer")].forEach(drawer=>{const dismiss=drawer.querySelector("drawer-toggle");dismiss&&dismiss.close()}))});function getFocusableElements(container){return Array.from(container.querySelectorAll("summary, a[href], button:enabled, [tabindex]:not([tabindex^='-']), [draggable], area, input:not([type=hidden]):enabled, select:enabled, textarea:enabled, object, iframe"))}const trapFocusHandlers={};function trapFocus(container,elementToFocus=container){var elements=getFocusableElements(container),first=elements[0],last=elements[elements.length-1];removeTrapFocus(),trapFocusHandlers.focusin=event=>{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.code.toUpperCase()==="TAB"&&(event.target===last&&!event.shiftKey&&(event.preventDefault(),first.focus()),(event.target===container||event.target===first)&&event.shiftKey&&(event.preventDefault(),last.focus()))},document.addEventListener("focusout",trapFocusHandlers.focusout),document.addEventListener("focusin",trapFocusHandlers.focusin),elementToFocus.focus()}try{document.querySelector(":focus-visible")}catch{focusVisiblePolyfill()}function focusVisiblePolyfill(){const navKeys=["ARROWUP","ARROWDOWN","ARROWLEFT","ARROWRIGHT","TAB","ENTER","SPACE","ESCAPE","HOME","END","PAGEUP","PAGEDOWN"];let currentFocusedElement=null,mouseClick=null;window.addEventListener("keydown",event=>{navKeys.includes(event.code.toUpperCase())&&(mouseClick=!1)}),window.addEventListener("mousedown",event=>{mouseClick=!0}),window.addEventListener("focus",()=>{currentFocusedElement&¤tFocusedElement.classList.remove("focused"),!mouseClick&&(currentFocusedElement=document.activeElement,currentFocusedElement.classList.add("focused"))},!0)}function removeTrapFocus(elementToFocus=null){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown),elementToFocus&&elementToFocus.focus()}function debounce(func,wait,immediate){let timeout;return function(){const context=this,args=arguments,later=function(){timeout=null,immediate||func.apply(context,args)},callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout(later,wait),callNow&&func.apply(context,args)}}function fetchConfig(type="json"){return{method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${type}`}}}function pauseAllMedia(){document.querySelectorAll(".js-youtube").forEach(video=>{video.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),document.querySelectorAll(".js-vimeo").forEach(video=>{video.contentWindow.postMessage('{"method":"pause"}',"*")}),document.querySelectorAll("video").forEach(video=>video.pause()),document.querySelectorAll("product-model").forEach(model=>{model.modelViewerUI&&model.modelViewerUI.pause()})}(function(){document.querySelectorAll(".rte table").forEach(function(table){table.outerHTML='<div class="table-wrapper">'+table.outerHTML+"</div>"}),document.querySelectorAll(".rte iframe").forEach(function(iframe){(iframe.src.indexOf("youtube")!==-1||iframe.src.indexOf("youtu.be")!==-1||iframe.src.indexOf("vimeo")!==-1)&&(iframe.outerHTML='<div class="video-wrapper">'+iframe.outerHTML+"</div>
1",iframe.src=iframe.src)})})(),typeof window.Shopify>"u"&&(window.Shopify={}),Shopify.bind=function(fn,scope){return function(){return fn.apply(scope,arguments)}},Shopify.setSelectorByValue=function(selector,value){for(var i=0,count=selector.options.length;i<count;i++){var option=selector.options[i];if(value==option.value||value==option.innerHTML)return selector.selectedIndex=i,i}},Shopify.addListener=function(target,eventName,callback){target.addEventListener?target.addEventListener(eventName,callback,!1):target.attachEvent("on"+eventName,callback)},Shopify.postLink=function(path,options){options=options||{};var method=options.method||"post",params=options.parameters||{},form=document.createElement("form");form.setAttribute("method",method),form.setAttribute("action",path);for(var key in params){var hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden"),hiddenField.setAttribute("name",key),hiddenField.setAttribute("value",params[key]),form.appendChild(hiddenField)}document.body.appendChild(form),form.submit(),document.body.removeChild(form)},Shopify.CountryProvinceSelector=function(country_domid,province_domid,options){this.countryEl=document.getElementById(country_domid),this.provinceEl=document.getElementById(province_domid),this.provinceContainer=document.getElementById(options.hideElement||province_domid),Shopify.addListener(this.countryEl,"change",Shopify.bind(this.countryHandler,this)),this.initCountry(),this.initProvince()},Shopify.CountryProvinceSelector.prototype={initCountry:function(){var value=this.countryEl.getAttribute("data-default");Shopify.setSelectorByValue(this.countryEl,value),this.countryHandler()},initProvince:function(){var value=this.provinceEl.getAttribute("data-default");value&&this.provinceEl.options.length>0&&Shopify.setSelectorByValue(this.provinceEl,value)},countryHandler:function(e){var opt=this.countryEl.options[this.countryEl.selectedIndex],raw=opt.getAttribute("data-provinces"),provinces=JSON.parse(raw);if(this.clearOptions(this.provinceEl),provinces&&provinces.length==0)this.provinceContainer.style.display="none";else{for(var i=0;i<provinces.length;i++){var opt=document.createElement("option");opt.value=provinces[i][0],opt.innerHTML=provinces[i][1],this.provinceEl.appendChild(opt)}this.provinceContainer.style.display=""}},clearOptions:function(selector){for(;selector.firstChild;)selector.removeChild(selector.firstChild)},setOptions:function(selector,values){for(var i=0,count=values.length;i<values.length;i++){var opt=document.createElement("option");opt.value=values[i],opt.innerHTML=values[i],selector.appendChild(opt)}}};class CopyToClipboard extends HTMLElement{constructor(){super(),this.button=this.querySelector("button"),this.originalText=this.button?this.button.textContent.trim():"",this.tooltipText=this.dataset.tooltipText,this.copiedText=this.dataset.copiedText,this.copiedTimeout=null,this.tooltipElement=null}connectedCallback(){this.button&&(this.button.addEventListener("click",this.handleCopy.bind(this)),this.button.addEventListener("mouseenter",this.showTooltip.bind(this)),this.button.addEventListener("mouseleave",this.hideTooltip.bind(this)),this.button.addEventListener("focus",this.showTooltip.bind(this)),this.button.addEventListener("blur",this.hideTooltip.bind(this)),this.tooltipElement||this.createTooltip())}disconnectedCallback(){this.button&&(this.button.removeEventListener("click",this.handleCopy.bind(this)),this.button.removeEventListener("mouseenter",this.showTooltip.bind(this)),this.button.removeEventListener("mouseleave",this.hideTooltip.bind(this)),this.button.removeEventListener("focus",this.showTooltip.bind(this)),this.button.removeEventListener("blur",this.hideTooltip.bind(this)),this.copiedTimeout&&clearTimeout(this.copiedTimeout),this.tooltipElement&&this.tooltipElement.remove())}async handleCopy(event){event.preventDefault();try{await navigator.clipboard.writeText(this.originalText),this.showCopiedState()}catch(err){console.error("Failed to copy text: ",err);const textArea=document.createElement("textarea");textArea.value=this.originalText,document.body.appendChild(textArea),textArea.select();try{document.execCommand("copy"),this.showCopiedState()}catch(err2){console.error("Fallback: Oops, unable to copy",err2)}document.body.removeChild(textArea)}}showCopiedState(){this.button&&(this.updateTooltipText(this.copiedText),this.button.classList.add("is-copied"),this.copiedTimeout&&clearTimeout(this.copiedTimeout),this.copiedTimeout=setTimeout(()=>{this.button.classList.remove("is-copied"),this.updateTooltipText(this.tooltipText)},2e3))}createTooltip(){this.tooltipElement=document.createElement("div"),this.tooltipElement.className="
1copy-tooltip",this.tooltipElement.textContent=this.tooltipText,this.appendChild(this.tooltipElement)}showTooltip(){if(!this.button)return;this.tooltipElement||this.createTooltip();const tooltipText=this.button.classList.contains("is-copied")?this.copiedText:this.tooltipText;this.tooltipElement.textContent=tooltipText,setTimeout(()=>{this.tooltipElement?.classList.add("is-visible")},10)}hideTooltip(){this.tooltipElement&&this.tooltipElement.classList.remove("is-visible")}updateTooltipText(text){this.tooltipElement&&(this.tooltipElement.textContent=text)}}customElements.define("copy-to-clipboard",CopyToClipboard); 2//# sourceMappingURL=/cdn/shop/t/18/assets/scripts.js.map?v=170742559360987334161789589656
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.