if(!customElements.get("collection-tabs")){class CollectionTabs extends HTMLElement{constructor(){super()}connectedCallback(){setTimeout(()=>{const buttons=Array.from(this.querySelectorAll("button")),sectionHeader=this.closest(".section-header");if(!sectionHeader)return;const links=sectionHeader.querySelectorAll(".linked-to-tab");this.target=this.dataset.target,buttons.forEach((button,i)=>{button.addEventListener("click",event=>{this.toggleButtons(buttons,i),this.toggleLinks(links,i),button.dataset.collection&&this.toggleCollection(button.dataset.collection),event.preventDefault()})}),Shopify.designMode&&this.addEventListener("shopify:block:select",event=>{const index=buttons.indexOf(event.target);index!==-1&&buttons[index].dispatchEvent(new Event("click"))})},10)}toggleButtons(buttons,index){buttons.forEach(button=>button.classList.remove("active")),buttons[index].classList.add("active")}toggleLinks(links,index){links.length&&(links.forEach(link=>link.classList.remove("active")),links[index].classList.add("active"))}toggleCollection(handle){const slider=document.getElementById(this.target);if(!slider)return;const products=slider.querySelectorAll(`.columns:not([data-collection="${handle}"])`),activeProducts=slider.querySelectorAll(`[data-collection="${handle}"]`),flkty=Flickity.data(slider);products.forEach(product=>{product.classList.remove("carousel__slide"),slider.append(product)}),activeProducts.forEach(product=>product.classList.add("carousel__slide")),flkty.insert(activeProducts),flkty.reloadCells(),flkty.select(0,0,1)}}customElements.define("collection-tabs",CollectionTabs)} //# sourceMappingURL=/cdn/shop/t/41/assets/collection-tabs.js.map?v=112998072638708317311739221808