1EventTarget.prototype.delegateListener=function(b,c,d){let a=a2=>{let b2;[].slice.call(this.querySelectorAll(c)).reverse().filter(b3=>b3.contains(a2.target)).forEach(c2=>{(b2===void 0||b2!==!1)&&(b2=d.call(c2,a2))})};return this.addEventListener(b,a),a};function closest(a,b){do if(b(a))return a;while(a=a&&a.parentNode)}window.Custom=window.Custom||{},(function($){"use strict";Custom={container:document.querySelector("body"),mobileBreakpoint:"868px",init:function(){this.setElementHeight(),this.fontSize(),this.setScrollAttributes(),this.localizationPopup(),this.initImageSizeLogging(),this.initHeightEqualizer(),document.querySelector(".sticky--button .button")&&document.querySelector(".sticky--button .button").addEventListener("click",function(){const targetElement=document.querySelector('[type="submit"].product-form__submit');console.log(targetElement),targetElement&&targetElement.scrollIntoView({behavior:"smooth",block:"center"})}),this.container.delegateListener("click",".cart__checkout-button",function(e){const termsCheckbox=document.getElementById("terms"),termsCheckboxWrapper=document.querySelector(".terms");termsCheckbox&&termsCheckboxWrapper&&(termsCheckbox.checked||(e.preventDefault(),termsCheckboxWrapper.classList.add("style--error"),termsCheckboxWrapper.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})))}),this.container.delegateListener("click","[data-scroll]",function(e){e.preventDefault();const targetElement=document.querySelector(e.target.closest("[data-scroll]").getAttribute("data-scroll"));targetElement&&targetElement.scrollIntoView({behavior:"smooth",block:"start"})}),document.querySelectorAll('[data-trigger], [href="#add"]').forEach(button=>{button.addEventListener("click",function(e){e.preventDefault();let targetSelector=this.getAttribute("data-trigger");this.getAttribute("href")=="#add"&&(targetSelector="button[name='add']");const targetElement=document.querySelector(targetSelector);targetElement&&targetElement.click()})}),window.off=Element.prototype.off=function(event2){if(this.namespaces)return this.removeEventListener(event2.split(".")[0],this.namespaces[event2]),delete this.namespaces[event2],this},window.on=Element.prototype.on=function(event2,callback,options){return this.namespaces||(this.namespaces={}),this.namespaces[event2]=callback,options=options||!1,this.addEventListener(event2.split(".")[0],callback,options),this},this.iniDropdown()},initHeightEqualizer:function(){this.applyHeightEqualization(),setTimeout(()=>{this.applyHeightEqualization()},1500),window.addEventListener("resize",()=>this.applyHeightEqualization())},applyHeightEqualization:function(){document.querySelectorAll("section").forEach(section=>{section.querySelector(".slider--wrapper")?section.querySelectorAll(".slider--wrapper").forEach(wrapper=>{this.equalizeHeight(wrapper),this.setHeightVariable(wrapper)}):(this.equalizeHeight(section),this.setHeightVariable(section))})},equalizeHeight:function(section){const equalHeightElements=section.querySelectorAll('[data-height="equal"]');if(equalHeightElements.length>0){let maxHeight=0;equalHeightElements.forEach(element=>{element.style.height="auto",maxHeight=Math.max(maxHeight,element.offsetHeight)}),maxHeight>20&§ion.style.setProperty("--element-heights",`${maxHeight}px`)}const equalHeightElements2=section.querySelectorAll('[data-height="equal2"]');if(equalHeightElements2.length>0){let maxHeight0=0;equalHeightElements2.forEach(element=>{element.style.height="auto",maxHeight0=Math.max(maxHeight0,element.offsetHeight)}),maxHeight0>20&§ion.style.setProperty("--element-heights2",`${maxHeight0}px`)}},setHeightVariable:function(section){const setHeightElement=section.querySelector('[data-height="set"]');if(setHeightElement){const height=setHeightElement.offsetHeight;height>20&§ion.style.setProperty("--element-height",`${height}px`)}},closeAllPopups:function(current){document.querySelectorAll(".popup--wrapper").forEach(el=>{el!==current&&el.setAttribute("data-active","false")})},localizationPopup:function(){this.container.delegateListener("click",".custom-localization button",function(e){e.preventDefault();let popup=event.target.closest(".custom-localization").querySelector(".popup--wrapper");this.closeAllPopups(popup),popup.setAttribute("data-active",popup.getAttribute("data-active")=="false")}.bind(this)),this.container.delegateListener("click",".custom-localization .popup--wrapper",function(e){let _this=event.target,popup=_this.closest(".custom-localization").querySelector(".popup--wrapper");_this.closest(".popup--inner")||popup.setAttribute("data-active",popup.getAttribute("data-active")=="false")}.bind(this))},iniDropdown(){var selectors={trigger:'[data-dropwdown="trigger"]',module:'[data-dropwdown="body"]',moduleInner:".dropdown--inner",tabs:".collapsible-trigger--tab"},classes={hide:"hide",open:"is-open",autoHeight:"collapsible--auto-height",tabs:"collapsible-trigger--tab"},namespace=".list--unset",isTransitioning=!1,el=document;el.querySelectorAll(selectors.trigger).forEach(trigger=>
1{var state=trigger.classList.contains(classes.open);trigger.setAttribute("aria-expanded",state),trigger.off("click"+namespace),trigger.on("click"+namespace,toggle)}),document.addEventListener("reload_dropdowns",function(event2){document.querySelectorAll(selectors.trigger).forEach(trigger=>{var state=trigger.classList.contains(classes.open);trigger.setAttribute("aria-expanded",state),trigger.removeEventListener("click",toggle),trigger.addEventListener("click",toggle)})});function toggle(evt){if(!isTransitioning){isTransitioning=!0;var el2=evt.currentTarget,isOpen=el2.classList.contains(classes.open),isTab=el2.classList.contains(classes.tabs),moduleId=el2.getAttribute("aria-controls"),container=document.getElementById(moduleId);if(moduleId||(moduleId=el2.dataset.controls),!!moduleId){if(!container){var multipleMatches=document.querySelectorAll('[data-id="'+moduleId+'"]');multipleMatches.length>0&&(container=el2.parentNode.querySelector('[data-id="'+moduleId+'"]'))}if(!container){isTransitioning=!1;return}var height=container.querySelector(selectors.moduleInner).offsetHeight,isAutoHeight=container.classList.contains(classes.autoHeight),parentCollapsibleEl=container.parentNode.closest(selectors.module),childHeight=height;if(isTab){if(isOpen){isTransitioning=!1;return}var newModule;document.querySelectorAll(selectors.tabs+'[data-id="'+el2.dataset.id+'"]').forEach(el3=>{el3.classList.remove(classes.open),newModule=document.querySelector("#"+el3.getAttribute("aria-controls")),setTransitionHeight(newModule,0,!0)})}if(isOpen&&isAutoHeight&&setTimeout(function(){height=0,setTransitionHeight(container,height,isOpen,isAutoHeight)},0),isOpen&&!isAutoHeight&&(height=0),el2.setAttribute("aria-expanded",!isOpen),isOpen?el2.classList.remove(classes.open):el2.classList.add(classes.open),setTransitionHeight(container,height,isOpen,isAutoHeight),parentCollapsibleEl){var parentHeight=parentCollapsibleEl.style.height;isOpen&&parentHeight==="auto"&&(childHeight=0);var totalHeight=isOpen?parentCollapsibleEl.offsetHeight-childHeight:height+parentCollapsibleEl.offsetHeight;setTransitionHeight(parentCollapsibleEl,totalHeight,!1,!1)}}}}function setTransitionHeight(container,height,isOpen,isAutoHeight){if(container.classList.remove(classes.hide),prepareTransition(container,function(){container.style.height=height+"px",isOpen?container.classList.remove(classes.open):container.classList.add(classes.open)}),!isOpen&&isAutoHeight){var o=container;window.setTimeout(function(){o.css("height","auto"),isTransitioning=!1},500)}else isTransitioning=!1}function prepareTransition(el2,callback){el2.addEventListener("transitionend",removeClass);function removeClass(evt){el2.classList.remove("is-transitioning"),el2.removeEventListener("transitionend",removeClass)}el2.classList.add("is-transitioning"),el2.offsetWidth,typeof callback=="function"&&callback()}},getDistanceToParentBottom:function(element){let elementRect=element.getBoundingClientRect();return element.parentElement.getBoundingClientRect().bottom-elementRect.bottom},setElementHeight:function(){const elementHeight=event2=>{document.querySelectorAll("[data-height^='target']").forEach(el=>{let container=el.closest("[data-height='container']"),name=el.getAttribute("data-height").split("/")[1];name?document.documentElement.style.setProperty(`--${name}`,el.clientHeight+"px"):(container.style.setProperty("--element_height",el.clientHeight+"px"),container.classList.contains("height-set")||container.classList.add("height-set"))})};window.addEventListener("resize",elementHeight),window.addEventListener("load",elementHeight)},setScrollAttributes:function(){let lastScrollTop=0;const handleScroll=event2=>{let currentScroll=window.pageYOffset||document.documentElement.scrollTop;this.container.setAttribute("data-scrollDirection",currentScroll>lastScrollTop?"down":"up"),lastScrollTop=currentScroll<=0?0:currentScroll,this.container.setAttribute("data-scrolled",window.scrollY>0)};window.addEventListener("scroll",handleScroll),window.addEventListener("load",handleScroll)},setStickyElement:function(selector){const elements=document.querySelectorAll(selector);let distance;this.checkScrollPosition(elements,this.header.clientHeight),window.addEventListener("scroll",()=>{this.checkScrollPosition(elements,this.header.clientHeight)})},checkScrollPosition:(elements,header)=>{let distance,elementHeight;
1elements.forEach(function(element){distance=window.pageYOffset+element.getBoundingClientRect().top,distance=element.getBoundingClientRect().top-header,elementHeight=element.clientHeight,element.style.paddingTop=distance<=0?`${elementHeight}px`:0,element.setAttribute("data-sticky",distance<=0)})},setInputValue:function(event2,callback){let self=event2.target,input=self.parentElement.querySelector("input"),min=parseInt(input.getAttribute("min")),current=parseInt(input.value),max=parseInt(input.getAttribute("max"));input.value=self.classList.contains("plus")?current<max?current+1:max:current>min?current-1:min,self.classList.contains("minus"),callback(input.value),input.dispatchEvent(new Event("input",{bubbles:!0}))},handlelize:function(str){return str=str.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/([^\w]+|\s+)/g,"-").replace(/\-\-+/g,"-").replace(/(^-+|-+$)/g,"").toLowerCase(),str},fontSize:function(){function adjustFontSize(){document.querySelectorAll("[data-font]").forEach(element=>{const elementWidth=element.offsetWidth,fontData=element.getAttribute("data-font").split("/"),baseFontSize=parseFloat(fontData[0])||10,baseContainerWidth=parseFloat(fontData[1])||1280;let newFontSize=elementWidth/baseContainerWidth*baseFontSize;newFontSize>=16&&(newFontSize=16),element.style.fontSize=newFontSize+"px"})}window.addEventListener("load",()=>{adjustFontSize(),setTimeout(adjustFontSize,1500),setTimeout(adjustFontSize,3e3)}),window.addEventListener("resize",adjustFontSize)},initImageSizeLogging:function(){const breakpoints=[362,557,748,994,1203,1542],widthsCollected=new Map;let lastLoggedWidth=null;console.log(breakpoints);const tryLogAll=()=>{if(widthsCollected.size===breakpoints.length){const widths=breakpoints.map(bp=>widthsCollected.get(bp)),min=Math.min(...widths),max=Math.max(...widths),widthsStr=widths.map(w=>w.toFixed(2)).join(", ");console.log(`${widthsStr}, ${min.toFixed(0)}:${max.toFixed(0)}`)}};window.addEventListener("resize",()=>{const width=Math.floor(window.innerWidth);if(breakpoints.includes(width)&&width!==lastLoggedWidth)if(lastLoggedWidth=width,window.temp1 instanceof HTMLElement){const renderedWidth=window.temp1.clientWidth;widthsCollected.set(width,renderedWidth),console.log(` 2[Viewport ${width}px] temp1 rendered size: ${renderedWidth.toFixed(2)}`),tryLogAll()}else console.log(` 3[Viewport ${width}px] temp1 is not set or not an element.`)});const initWidth=Math.floor(window.innerWidth);if(breakpoints.includes(initWidth)&&window.temp1 instanceof HTMLElement){const renderedWidth=window.temp1.clientWidth;widthsCollected.set(initWidth,renderedWidth),console.log(` 4[Viewport ${initWidth}px] temp1 rendered size: ${renderedWidth.toFixed(2)}`),tryLogAll()}}},Custom.init()})();class SliderElement extends HTMLElement{async connectedCallback(){const isRecentlyViewed=this.dataset.content==="recently_viewed",swiperEl=this.querySelector(".swiper"),wrapper=swiperEl.querySelector(".swiper-wrapper"),settings=this.getAttribute("data-settings"),parsedSettings=settings?JSON.parse(settings):{};let parentSection=this.closest(".swiper--wrapper")||this.closest("section");(this.closest("media-gallery")||this.closest(".media-gallery"))&&(parentSection=this);const paginationEl=parentSection?.querySelector(".swiper-pagination")||null,scrollbarEl=parentSection?.querySelector(".swiper-scrollbar")||null,nextButtons=[],prevButtons=[],next1=parentSection?.querySelector(".swiper-button-next"),prev1=parentSection?.querySelector(".swiper-button-prev"),next2=parentSection?.querySelector(".swiper-button-next2"),prev2=parentSection?.querySelector(".swiper-button-prev2");next1&&prev1&&(nextButtons.push(next1),prevButtons.push(prev1)),next2&&prev2&&(nextButtons.push(next2),prevButtons.push(prev2));const defaultSettings={loop:!1,spaceBetween:10,navigation:{nextEl:nextButtons,prevEl:prevButtons}};paginationEl&&(defaultSettings.pagination={el:paginationEl,clickable:!0}),parsedSettings.thumbs&&(parsedSettings.thumbs.swiper=this.closest("section").querySelector(".slider-thumbs .swiper")),scrollbarEl&&(defaultSettings.scrollbar={el:scrollbarEl,draggable:!0});const swiperSettings={...defaultSettings,...parsedSettings};if(isRecentlyViewed){this.querySelector(".swiper-wrapper").classList.add("style--sectionLoading");const stored=localStorage.getItem("recently_viewed_products"),skus=stored?JSON.parse(stored):[];if(skus.length){const url=`/search?type=product&q=${skus.map(sku=>encodeURIComponent(sku)).join("+OR+")}&options%5Bprefix%5D=last&view=dynamic_slides`;console.log(url);try{const html=await(await fetch(url)).text(),temp=document.createElement("div");temp.innerHTML=html;const slides=temp.querySelectorAll(".swiper-slide");
4wrapper.innerHTML="",slides.forEach((slide,index)=>{wrapper.appendChild(slide)}),this.swiper=new Swiper(swiperEl,swiperSettings)}catch(error){console.error("Recently viewed fetch error:",error)}}}else this.swiper=new Swiper(swiperEl,swiperSettings),this.getAttribute("data-filters")==="true"&&this.initFilters()}initFilters(){const swiper=this.swiper,section=this.closest("section"),mainButton=section?.querySelector("[data-button] a"),filterButtons=section?.querySelectorAll("[data-filter]"),source=section?.querySelector(".swiper-source");if(!swiper||!source||!filterButtons?.length)return;const allSlides=Array.from(source.children),applyFilter=(type,url,title)=>{swiper.loopDestroy(),swiper.removeAllSlides(),allSlides.filter(slide=>type==="all"||slide.dataset.type===type).forEach(slide=>{swiper.appendSlide(slide.cloneNode(!0))}),swiper.update(),swiper.loopCreate(),swiper.slideToLoop(0,0),swiper.update(),mainButton&&(mainButton.href=url,mainButton.textContent=title)};filterButtons.forEach(btn=>{btn.addEventListener("click",()=>
4{const type=btn.dataset.filter,url=btn.dataset.url,title=btn.dataset.title;filterButtons.forEach(b=>b.classList.remove("active")),btn.classList.add("active"),applyFilter(type,url,title)})});const initial=section.querySelector("[data-filter].active")||filterButtons[0];initial&&initial.click()}}customElements.define("slider-element",SliderElement),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-snippet='tooltip']").forEach(tooltipWrapper=>{tooltipWrapper.addEventListener("mouseenter",()=>tooltipWrapper.setAttribute("data-active","true")),tooltipWrapper.addEventListener("mouseleave",()=>tooltipWrapper.removeAttribute("data-active"))})});class BGGIntegration extends HTMLElement{static cache={};static requestQueue=[];static isRequesting=!1;connectedCallback(){const id=this.getAttribute("data-id");this.ratingElement=this.querySelector("span"),!(!id||!this.ratingElement)&&this.loadGameRating(id)}async loadGameRating(gameId){let ratings=this.getStoredRatings();if(ratings[gameId]){this.ratingElement.textContent=ratings[gameId],this.ratingElement.classList.add("visible");return}if(BGGIntegration.cache[gameId]){this.ratingElement.textContent=BGGIntegration.cache[gameId],this.ratingElement.classList.add("visible");return}BGGIntegration.requestQueue.push({gameId,element:this}),BGGIntegration.isRequesting||this.processQueue()}async processQueue(){if(BGGIntegration.requestQueue.length===0){BGGIntegration.isRequesting=!1;return}BGGIntegration.isRequesting=!0;const{gameId,element}=BGGIntegration.requestQueue.shift(),rating=await element.fetchGameRating(gameId);if(console.log(rating),rating){element.ratingElement.textContent=rating,this.ratingElement.classList.add("visible");let ratings=element.getStoredRatings();ratings[gameId]=rating,element.saveRatings(ratings),BGGIntegration.cache[gameId]=rating}else element.parentElement.classList.add("hide"),document.querySelector(".element-icons > div:not(.hide)")||document.querySelector(".element-icons").classList.add("hide");setTimeout(()=>{element.processQueue()},5e3)}async fetchGameRating(gameId){const proxyUrl=`https://api.allorigins.win/get?url=${encodeURIComponent(`https://boardgamegeek.com/xmlapi/boardgame/${gameId}&stats=1`)}`;try{const data=await(await fetch(proxyUrl)).json(),averageRating=new DOMParser().parseFromString(data.contents,"text/xml").querySelector("statistics ratings average")?.textContent;return averageRating?parseFloat(averageRating).toFixed(1):null}catch(error){return console.error("Error fetching game data:",error),null}}getStoredRatings(){try{return JSON.parse(localStorage.getItem("bgg_ratings"))||{}}catch{return{}}}saveRatings(ratings){localStorage.setItem("bgg_ratings",JSON.stringify(ratings))}}customElements.define("bgg-integration",BGGIntegration);class CartButton extends HTMLElement{constructor(){super(),this.handleClick=this.handleClick.bind(this)}connectedCallback(){this.addEventListener("click",this.handleClick)}disconnectedCallback(){this.removeEventListener("click",this.handleClick)}getSectionsToRender(){return[{id:"cart-notification-product",selector:'[id="cart-notification-product-all"]'},{id:"cart-notification-button"},{id:"cart-icon-bubble"}]}handleClick(event2){const btn=event2.target;if(!btn)return;const id=this.dataset.id,formData={items:[{id,quantity:1}],sections:"cart-data"};formData.sections=this.getSectionsToRender().map(section=>section.id),btn.classList.add("button--loading"),this.cartAdd(formData,btn,id)}cartAdd(formData,btn,id){fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(formData)}).then(res=>res.json()).then(response=>{document.querySelector("cart-notification").renderContents(response)}).finally(()=>btn.classList.remove("button--loading"))}}customElements.define("cart-button",CartButton);class UpsellButton extends HTMLElement{constructor(){super(),this.handleClick=this.handleClick.bind(this),this.cartPage=!!document.querySelector('[data-template="cart"]')}connectedCallback(){this.addEventListener("click",this.handleClick)}disconnectedCallback(){this.removeEventListener("click",this.handleClick)}getSectionsToRender(){return this.cartPage?[{id:"alternate-cart-items",section:document.getElementById("main-cart-items")?.dataset.id,selector:".js-contents-items"},{id:"cart-icon-bubble",selector:".shopify-section",section:"cart-icon-bubble"}]:[{id:"cart-notification-product",selector:'[id="cart-notification-product-all"]'},{id:"cart-notification-button"},{id:"cart-icon-bubble"}]}handleClick(event2){const btn=event2.currentTarget;if(!btn)return;const id=this.dataset.id;if(!id)return;const sections=this.getSectionsToRender(),formData={items:[{id,quantity:1}],sections:sections.map(s=>s.id)};btn.classList.add("button--loading"),this.cartAdd(formData,btn,sections)}parseHTML(html){return new DOMParser().parseFromString(html,"text/html")}cartAdd(formData,btn,sections){fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(formData)}).then(res=>res.json()).then(response=>{if(!this.cartPage){document.querySelector("cart-notification")?.renderContents(response);return}sections.forEach(section=>{const html=response.sections?.[section.id];if(!html)return;const parsedDoc=this.parseHTML(html),targetId=section.id==="alternate-cart-items"?"main-cart-items":section.id,container=document.getElementById(targetId);if(!container)return;const sourceEl=section.selector?parsedDoc.querySelector(section.selector):parsedDoc.body;if(!sourceEl)return;const newContent=sourceEl.innerHTML;if(targetId==="main-cart-items"&&newContent.trim().length<50&&document.querySelector(".cart-container")?.classList.add("is-empty"),section.multiple&§ion.selector)document.querySelectorAll(section.selector).forEach(el=>{el.innerHTML=newContent});else{const targetEl=section.selector?container.querySelector(section.selector):container;targetEl&&(targetEl.innerHTML=newContent)}targetId==="main-cart-items"&&document.querySelectorAll("[data-update]").forEach(el=>{const key=el.dataset.update,updatedEl=parsedDoc.querySelector(`[data-update="${key}"]`);updatedEl&&(el.innerHTML=updatedEl.innerHTML)})})}).catch(err=>{console.error("Cart update failed:",err)}).finally(()=>{btn.classList.remove("button--loading")})}}customElements.define("upsell-button",UpsellButton);class DynamicProducts extends HTMLElement{constructor(){super(),this.debounceTimer=null,this.cache=new Map,this.type="sku",this.debouncedLoadContent=debounce(this.loadContent.bind(this),200)}connectedCallback(){this.ids=this.getAttribute("data-content"),this.container=this.querySelector(".container"),this.loadContent()}async loadContent(){if(!this.container||!this.ids){console.error("Missing Data");return}if(this.cache.has(this.ids)){this.container.innerHTML=this.cache.get(this.ids);return}const fetchUrl=`/search?q=${this.ids.split(",").map(item=>encodeURIComponent(`"${item.trim()}"`)).join("+OR+")}&view=dynamic`;try{const response=await fetch(fetchUrl);if(response.ok){const html=await response.text();this.cache.set(this.ids,html),this.container.innerHTML=html}else console.error("Failed to fetch slider content:",response.status)}catch(error){console.error("Error fetching slider content:",error)}}static get observedAttributes(){return["data-content"]}attributeChangedCallback(name,oldValue,newValue){name==="data-content"&&oldValue!==newValue&&(this.ids=newValue,this.debouncedLoadContent())}refresh(){this.debouncedLoadContent()}disconnectedCallback(){clearTimeout(this.debounceTimer)}}customElements.define("dynamic-products",DynamicProducts);class DropdownElement extends HTMLElement{connectedCallback(){this.init()}init(){Element.prototype.on=function(event2,callback,options=!1){return this._eventNamespaces||(this._eventNamespaces={}),this._eventNamespaces[event2]=callback,this.addEventListener(event2.split(".")[0],callback,options),this},Element.prototype.off=function(event2){if(!this._eventNamespaces)return;const callback=this._eventNamespaces[event2];return callback&&(this.removeEventListener(event2.split(".")[0],callback),delete this._eventNamespaces[event2]),this},this.cleanupText(),this.initializeDropdown()}cleanupText(){this.querySelectorAll(".dropdown--inner p").forEach(paragraph=>{paragraph.textContent===""&¶graph.remove()})}initializeDropdown(){const selectors={trigger:'[data-dropwdown="trigger0"]',body:'[data-dropwdown="body0"]',inner:".dropdown--inner"},classes={open:"is-open",transitioning:"is-transitioning"};let isTransitioning=!1;this.querySelectorAll(selectors.trigger).forEach(trigger=>
4{const state=trigger.classList.contains(classes.open);trigger.setAttribute("aria-expanded",state),trigger.off("click.dropdown"),trigger.on("click.dropdown",evt=>this.toggleDropdown(evt,selectors,classes,isTransitioning))})}toggleDropdown(evt,selectors,classes,isTransitioning){if(isTransitioning)return;isTransitioning=!0;const trigger=evt.currentTarget,isOpen=trigger.classList.contains(classes.open),bodyId=trigger.getAttribute("aria-controls"),body=this.querySelector(`#${bodyId}`);if(console.log("toggleDropdown"),!body){isTransitioning=!1;return}const contentHeight=body.querySelector(selectors.inner).offsetHeight;isOpen?(body.style.height=`${contentHeight}px`,requestAnimationFrame(()=>{body.style.height="0"})):(body.style.height="0",requestAnimationFrame(()=>{body.style.height=`${contentHeight}px`})),body.addEventListener("transitionend",()=>{body.style.height=isOpen?"0":"auto",body.classList.toggle(classes.open,!isOpen),isTransitioning=!1},{once:!0});const labelContainer=trigger.querySelector("[data-labels]");if(labelContainer){const labels=labelContainer.dataset.labels.split("/");labelContainer.textContent=labels[0]===labelContainer.textContent.trim()?labels[1]:labels[0]}trigger.setAttribute("aria-expanded",!isOpen),trigger.classList.toggle(classes.open,!isOpen)}}customElements.define("dropdown-element",DropdownElement);class DualRange extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=` 5 <style> 6 :host{display:block;--track-height:6px;--thumb-size:20px;--range-color:#5D798E;--track-color:#B8C6D0} 7 .wrap{position:relative;height:var(--thumb-size);margin:0} 8 input[type=range]{margin:0;position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);height:var(--thumb-size);background:transparent;pointer-events:none;-webkit-appearance:none} 9 input[type=range]::-webkit-slider-thumb{pointer-events:auto;-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:50%;background:var(--range-color);border:2px solid var(--range-color)} 10 .track{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);height:var(--track-height);background:var(--track-color);border-radius:999px} 11 .fill{position:absolute;height:var(--track-height);background:var(--range-color);top:50%;transform:translateY(-50%);border-radius:999px} 12 </style> 13 <div class="wrap"> 14 <div class="track"></div> 15 <div class="fill"></div> 16 <input id="min" type="range" /> 17 <input id="max" type="range" /> 18 </div> 19 `}connectedCallback(){this.minR=this.shadowRoot.querySelector("#min"),this.maxR=this.shadowRoot.querySelector("#max"),this.fill=this.shadowRoot.querySelector(".fill"),this.minR.min=0,this.minR.max=100,this.maxR.min=0,this.maxR.max=100,this.domainMin=Number(this.getAttribute("value-min")||0),this.domainMax=Number(this.getAttribute("value-max")||100),this.currentMin=Number(this.dataset.currentMin??this.domainMin),this.currentMax=Number(this.dataset.currentMax??this.domainMax),this.minR.value=Math.round((this.currentMin-this.domainMin)/(this.domainMax-this.domainMin)*100),this.maxR.value=Math.round((this.currentMax-this.domainMin)/(this.domainMax-this.domainMin)*100);const update=()=>{let a=Number(this.minR.value),b=Number(this.maxR.value);a>b&&([a,b]=[b,a]),this.minR.value=a,this.maxR.value=b,this.fill.style.left=a+"%",this.fill.style.width=b-a+"%";const realMin=Math.round(this.domainMin+(this.domainMax-this.domainMin)*(a/100)),realMax=Math.round(this.domainMin+(this.domainMax-this.domainMin)*(b/100));this.vmin=realMin,this.vmax=realMax,this.dispatchEvent(new CustomEvent("change",{detail:{min:realMin,max:realMax},bubbles:!0,composed:!0}))};this.minR.addEventListener("input",update),this.maxR.addEventListener("input",update),update()}get values(){return{min:this.vmin,max:this.vmax}}}customElements.define("dual-range",DualRange);class CustomInstagramSection extends HTMLElement{constructor(){super(),this.observer=null}connectedCallback(){this.init()}init(){if(!this.querySelector(".swiper-wrapper"))return;const feed=document.querySelector("#insta-feed");feed&&(feed.style.display="none");const imgs=document.querySelectorAll("#insta-feed .instafeed-new-layout-item > .instafeed-lazy-image");this.observer=new MutationObserver(mutations=>{mutations.forEach(mutation=>
19{mutation.addedNodes.forEach(node=>{node instanceof HTMLElement&&node.classList.contains("instafeed-new-layout-container")&&(this.buildSlider(document.querySelectorAll("#insta-feed .instafeed-new-layout-item > .instafeed-lazy-image")),this.observer.disconnect())})})}),feed&&this.observer.observe(feed,{childList:!0,subtree:!0})}buildSlider(appImages){const wrapper=this.querySelector(".swiper-wrapper");wrapper&&(appImages.forEach(img=>{const slide=document.createElement("div");slide.classList.add("swiper-slide");const clone=img.nextElementSibling?img.nextElementSibling.cloneNode(!0):null;slide.innerHTML=` 20 <div class="slide--inner select--none"> 21 <div class="image--wrapper" data-height="equal"> 22 <img src="${img.dataset.instafeedSrc}" alt="${img.alt||""}"> 23 </div> 24 </div> 25 `;const wrapperEl=slide.querySelector(".image--wrapper");clone&&wrapperEl.appendChild(clone),wrapper.appendChild(slide)}),setTimeout(()=>{window.Custom.applyHeightEqualization()},1500),setTimeout(()=>{window.Custom.applyHeightEqualization()},3e3))}disconnectedCallback(){this.observer&&this.observer.disconnect()}}customElements.define("custom-instagram-section",CustomInstagramSection);class ShoppableImage extends HTMLElement{connectedCallback(){this.imageWrapper=this.querySelector("[data-shoppable-image-wrapper]"),this.image=this.querySelector("[data-shoppable-image-img]"),this.points=Array.from(this.querySelectorAll("[data-hotspot]")),this.tooltips=Array.from(this.querySelectorAll("[data-tooltip-wrapper]")),this.activeClass="shoppable-image__hotspot--active",this.tooltipDelay=300,this._listeners=[],this.hoverTimer=null,this.windowScrollTimer=null,this.windowScrollEvent=null,this._bindEvents()}disconnectedCallback(){this.onSectionUnload()}_bindEvents(){this._positionElements(),this.image&&this._on(this.image,"load",()=>this._positionElements()),this._on(this,"touchend",()=>this._clearAllActive()),this.points.forEach((point,i)=>{const tooltip=this.tooltips[i];this._on(point,"click",e=>this._setActivePoint(e)),this._on(point,"touchend",e=>this._setActivePoint(e)),this._on(point,"mouseover",e=>this._setActivePoint(e)),this._on(point,"mouseout",e=>this._closeActivePoint(e)),this._on(point,"focus",e=>this._setActivePoint(e)),this._on(point,"animationend",e=>{e.animationName==="slide-fade-y"&&e.elapsedTime>0&&(point.classList.add("shoppable-image__hotspot--pulse"),point.classList.remove("pxu-lia-element"),point.style.animationPlayState="")}),tooltip&&(this._on(tooltip,"touchend",e=>e.stopPropagation()),this._on(tooltip,"mouseover",e=>this._setActivePoint(e)),this._on(tooltip,"mouseout",e=>this._closeActivePoint(e)),this._on(tooltip,"focus",e=>e.stopPropagation()))})}_positionElements(){this.positionHotspots(),this.positionTooltips()}_setActivePoint(e){e.stopPropagation();const point=e.currentTarget.closest("[data-hotspot]");if(!point)return;this.hoverTimer!==null&&(clearTimeout(this.hoverTimer),this.hoverTimer=null);const isActive=point.classList.contains(this.activeClass);if(e.type==="touchend"&&isActive){point.classList.remove(this.activeClass);return}if(!(e.type==="click"&&isActive)&&!isActive){const activeTooltip=this.querySelector(`.${this.activeClass}`);activeTooltip&&activeTooltip.classList.remove(this.activeClass),this.positionTooltips(),point.classList.add(this.activeClass)}}_closeActivePoint(e){const point=e.currentTarget.closest("[data-hotspot]");point&&(this.hoverTimer!==null&&clearTimeout(this.hoverTimer),this.hoverTimer=setTimeout(()=>{point.classList.remove(this.activeClass)},this.tooltipDelay))}_clearAllActive(){const activeTooltip=this.querySelector(`.${this.activeClass}`);activeTooltip&&activeTooltip.classList.remove(this.activeClass)}_resetTooltips(){this.tooltips.forEach(tooltip=>{tooltip.classList.remove("tooltip--overflow-top","tooltip--overflow-right","tooltip--overflow-bottom","tooltip--overflow-left"),tooltip.style.top="",tooltip.style.right="",tooltip.style.bottom="",tooltip.style.left=""})}positionHotspots(){if(!this.imageWrapper)return;const imageBounds=this.imageWrapper.getBoundingClientRect();
25this.points.forEach(point=>{const ySetting=parseInt(point.dataset.hotspotYAxis,10)||0,xSetting=parseInt(point.dataset.hotspotXAxis,10)||0,pointBounds=point.getBoundingClientRect(),yPercentage=(imageBounds.height-pointBounds.height)/imageBounds.height*ySetting;point.style.bottom=`${yPercentage}%`;const xPercentage=(imageBounds.width-pointBounds.width)/imageBounds.width*xSetting;point.style.left=`${xPercentage}%`,point.style.visibility="visible"})}positionTooltips(){if(!this.imageWrapper)return;this._resetTooltips();const imageWrapperRightBound=this.imageWrapper.getBoundingClientRect().right;this.tooltips.forEach(tooltip=>{const bounds=tooltip.getBoundingClientRect(),style=getComputedStyle(tooltip),marginTop=parseInt(style.marginTop,10)||0,marginRight=parseInt(style.marginRight,10)||0,marginBottom=parseInt(style.marginBottom,10)||0,marginLeft=parseInt(style.marginLeft,10)||0,topBounds=bounds.top-marginTop,rightBounds=bounds.right+marginRight,bottomBounds=bounds.bottom+marginBottom,leftBounds=bounds.left-marginLeft;rightBounds>=imageWrapperRightBound&&(tooltip.classList.add("tooltip--overflow-right"),tooltip.style.left=`${imageWrapperRightBound-rightBounds}px`),leftBounds<=0&&(tooltip.classList.add("tooltip--overflow-left"),tooltip.style.left=`${Math.abs(leftBounds)}px`),topBounds<=0&&tooltip.classList.add("tooltip--overflow-top"),bottomBounds>=window.innerHeight&&(tooltip.classList.add("tooltip--overflow-bottom"),tooltip.style.top="unset",tooltip.style.bottom="calc(100% + 12px)")})}_on(el,event2,listener){return!el||!event2||!listener?null:(this._listeners.push({el,event:event2,listener}),el.addEventListener(event2,listener),{el,event:event2,listener})}_off({el,event:event2,listener}={}){return!el||!event2||!listener?null:(this._listeners=this._listeners.filter(l=>el!==l.el||event2!==l.event||listener!==l.listener),el.removeEventListener(event2,listener),{el,event:event2,listener})}_offAll(){this._listeners.forEach(({el,event:event2,listener})=>el.removeEventListener(event2,listener)),this._listeners=[]}onSectionUnload(){this._offAll()}}customElements.define("shoppable-image-element",ShoppableImage); 26//# sourceMappingURL=/cdn/shop/t/48/assets/custom.main_scripts.js.map?v=143999379516161161361789048690
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.