1MinimogTheme.pubSubEvents={cartError:"cart-error",cartUpdate:"cart-update",openCartDrawer:"open-cart-drawer",openSearchPopup:"open-search-popup",closeSearchPopup:"close-search-popup",optionValueSelectionChange:"option-value-selection-change",variantChange:"variant-change",quantityUpdate:"quantity-update",quantityRules:"quantity-rules",quantityBoundries:"quantity-boundries"};const requestDefaultConfigs={mode:"same-origin",credentials:"same-origin",headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/json"}};MinimogTheme.config={mqlMobile:!1,mqlTablet:!1,mediaQueryMobile:"screen and (max-width: 767px)",mediaQueryTablet:"screen and (max-width: 1023px)"},MinimogTheme.initWhenVisible=function(options){const threshold=options.threshold?options.threshold:0;new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{entry.isIntersecting&&typeof options.callback=="function"&&(options.callback(),observer2.unobserve(entry.target))})},{rootMargin:`0px 0px ${threshold}px 0px`}).observe(options.element)},(function(){const mql=window.matchMedia(MinimogTheme.config.mediaQueryMobile);MinimogTheme.config.mqlMobile=mql.matches,mql.onchange=e=>{e.matches?(MinimogTheme.config.mqlMobile=!0,document.dispatchEvent(new CustomEvent("matchMobile"))):(MinimogTheme.config.mqlMobile=!1,document.dispatchEvent(new CustomEvent("unmatchMobile")))};const mqltl=window.matchMedia(MinimogTheme.config.mediaQueryTablet);MinimogTheme.config.mqlTablet=mqltl.matches,mqltl.onchange=e=>{e.matches?(MinimogTheme.config.mqlTablet=!0,document.dispatchEvent(new CustomEvent("matchTablet"))):(MinimogTheme.config.mqlTablet=!1,document.dispatchEvent(new CustomEvent("unmatchTablet")))};var fader=document.querySelector(".m-page-transition");function __fadeInPage(){if(!window.AnimationEvent||!fader)return;let ignore_beforeunload=!1;const loadingDesignMode=fader.dataset.designMode==="true";document.querySelectorAll("a[href^=mailto], a[href^=tel]").forEach(link=>{link.addEventListener("click",()=>{ignore_beforeunload=!0})}),loadingDesignMode&&Shopify.designMode?fader.classList.add("m-page-transition--design-mode"):(window.addEventListener("beforeunload",()=>{ignore_beforeunload||fader.classList.add("fade-in")}),window.addEventListener("DOMContentLoaded",()=>{document.documentElement.classList.remove("m:overflow-hidden"),document.body.classList.remove("m:overflow-hidden"),setScrollbarWidth(),setTimeout(()=>{fader.classList.add("fade-out")},300),document.dispatchEvent(new CustomEvent("page:loaded"))}),window.addEventListener("pageshow",event=>{event.persisted&&fader.classList.remove("fade-in")}))}__fadeInPage()})();class HTMLUpdateUtility{static viewTransition(oldNode,newContent,preProcessCallbacks=[],postProcessCallbacks=[]){if(!oldNode||!newContent)return;preProcessCallbacks?.forEach(callback=>callback(newContent));const newNodeWrapper=document.createElement("div");HTMLUpdateUtility.setInnerHTML(newNodeWrapper,newContent.outerHTML);const newNode=newNodeWrapper.firstChild,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}`)}),oldNode.parentNode.insertBefore(newNode,oldNode),oldNode.style.display="none",postProcessCallbacks?.forEach(callback=>callback(newNode)),setTimeout(()=>oldNode.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 CountdownTimer{constructor(container,startTime,endTime,options={}){this.times=["day","hour","min","sec"],this.selectors={day:".countdown-timer-day",hour:".countdown-timer-hour",min:".countdown-timer-minute",sec:".countdown-timer-sec"},this.DAY_IN_MS=1440*60*1e3,this.HOUR_IN_MS=3600*1e3,this.MIN_IN_MS=60*1e3,this.container=container,this.startTime=startTime,this.savedStartTime=startTime,this.endTime=endTime,this.options=Object.assign({},{addZeroPrefix:!0,loop:!1,callback:()=>{}},options),this.intervalTime=1e3,this.timer=null,this.domNodes=queryDomNodes(this.selectors,container),this.start()}start(){this.timer=setInterval(()=>{this.startTime>this.endTime?this.stop():this.update()},this.intervalTime),this.container.style.removeProperty("opacity")}update(){const timeData=this.format(this.endTime-this.startTime);
1this.times.forEach(time=>{this.domNodes[time]&&(this.domNodes[time].textContent=this.addZeroPrefix(timeData[time]))}),this.startTime+=this.intervalTime}stop(){clearInterval(this.timer),this.options.loop?(this.startTime=this.savedStartTime,this.start()):(this.timer=null,this.options.callback())}clear(){clearInterval(this.timer),this.timer=null,this.startTime=this.savedStartTime,this.times.forEach(time=>{this.domNodes[time]&&(this.domNodes[time].textContent="00")})}addZeroPrefix(num){return this.options.addZeroPrefix&&num<10?`0${num}`:num.toString()}format(ms){return{day:Math.floor(ms/this.DAY_IN_MS),hour:Math.floor(ms/this.HOUR_IN_MS)%24,min:Math.floor(ms/this.MIN_IN_MS)%60,sec:Math.floor(ms/1e3)%60}}}window.MinimogTheme.CountdownTimer=CountdownTimer;class Tabs{constructor(container,cb=()=>{}){this.selectors={tabHeaders:[".m-tab-header"],tabContents:[".m-tab-content"]},this.activeClass="active",this.currentActiveIndex=-1,this.currentTab=null,this.container=container,this.cb=cb,this.domNodes=queryDomNodes(this.selectors,container),this.customSelect=this.container.querySelector("m-select-component"),this.init(),this.setActiveTab(0)}init(){addEventDelegate({context:this.container,selector:this.selectors.tabHeaders[0],handler:(e,tabHeader)=>{e.preventDefault();let index;tabHeader&&(index=Number(tabHeader.dataset.index)),this.setActiveTab(index),this.cb(tabHeader)}})}setActiveTab(tabIndex){const{tabHeaders,tabContents}=this.domNodes;if(tabContents.length&&tabIndex!==-1&&this.currentActiveIndex!==tabIndex){let currHeader,newHeader,newTab;currHeader=tabHeaders&&tabHeaders[this.currentActiveIndex],newHeader=tabHeaders&&tabHeaders[tabIndex],this.customSelect&&newHeader&&(this.customSelect.dataset.tabHeader==="select"&&this.customSelect.updateCustomSelectChecked(tabIndex,newHeader.innerHTML),MinimogTheme.config.mqlMobile&&this.customSelect.updateCustomSelectChecked(tabIndex,newHeader.innerHTML),document.addEventListener("matchMobile",()=>this.customSelect.updateCustomSelectChecked(tabIndex,newHeader.innerHTML))),newTab=tabContents&&tabContents[tabIndex],currHeader&&currHeader.classList.remove(this.activeClass),this.currentTab&&this.currentTab.classList.remove(this.activeClass),newHeader&&newHeader.classList.add(this.activeClass),newTab&&newTab.classList.add(this.activeClass),setTimeout(()=>newTab.style.opacity=1),this.currentActiveIndex=tabIndex,this.currentTab=newTab}}}window.MinimogTheme.Tabs=Tabs,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.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)}}};function setScrollbarWidth(){document.documentElement.style.setProperty("--m-scrollbar-width",`${window.innerWidth-document.documentElement.clientWidth}px`)}setScrollbarWidth();function isStorageSupported(type){if(window.self!==window.top)return!1;const testKey="minimog:check";let storage;type==="session"&&(storage=window.sessionStorage),type==="local"&&(storage=window.localStorage);try{return storage.setItem(testKey,"1"),storage.removeItem(testKey),!0}catch{return!1}}function getFocusableElements(container){return Array.from(container.querySelectorAll("summary, a[href], button:enabled, [tabindex]:not
1([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(),elementToFocus.tagName==="INPUT"&&["search","text","email","url"].includes(elementToFocus.type)&&elementToFocus.value&&elementToFocus.setSelectionRange(0,elementToFocus.value.length)}function removeTrapFocus(elementToFocus=null){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown),elementToFocus&&elementToFocus.focus()}function getRequestDefaultConfigs(){return JSON.parse(JSON.stringify(requestDefaultConfigs))}function fetchJSON(url,config=getRequestDefaultConfigs()){return fetch(url,config).then(function(response){if(!response.ok)throw response;return response.json()})}const cache=new Map;function fetchCache(url,config=getRequestDefaultConfigs()){return new Promise((resolve,reject)=>{let cached=cache.get(url);if(cached)return resolve(cached);fetch(url,config).then(res=>{cached=res.text(),cache.set(url,cached),resolve(cached)}).catch(reject)})}const sectionCache=new Map;function fetchSection(sectionId,options={}){const{url:_url,fromCache=!1,params={}}=options;return new Promise((resolve,reject)=>{const url=new URL(_url||window.location.href);if(url.searchParams.set("section_id",sectionId),Object.entries(params).forEach(([k,v])=>url.searchParams.set(k,v)),fromCache){const cached=sectionCache.get(url);if(cached)return resolve(cached)}fetch(url,getRequestDefaultConfigs()).then(res=>{if(res.ok)return res.text();reject(`Failed to load section: ${sectionId}`)}).then(html=>{const div=generateDomFromString(html);sectionCache.set(url,div),resolve(div)}).catch(reject)})}const cache2=new Map;function fetchJsonCache(url,config=requestDefaultConfigs){return new Promise((resolve,reject)=>{if(cache2.get(url))return resolve(cache2.get(url));fetch(url,config).then(res=>{if(res.ok){const json=res.json();return resolve(json),cache2.set(url,json),json}else reject(res)}).catch(reject)})}function formatMoney(cents,format){const moneyFormat="${{amount}}";typeof cents=="string"&&(cents=cents.replace(".",""));let value="";const placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format||moneyFormat;function formatWithDelimiters(number,precision=2,thousands=",",decimal="."){if(isNaN(number)||number==null)return 0;number=(number/100).toFixed(precision);const parts=number.split("."),dollarsAmount=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1${thousands}`),centsAmount=parts[1]?decimal+parts[1]:"";return dollarsAmount+centsAmount}switch(formatString.match(placeholderRegex)[1]){case"amount":value=formatWithDelimiters(cents,2);break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,".",",");break}return formatString.replace(placeholderRegex,value)}function validateForm(form){const missingFields=[];return form&&form.querySelectorAll('[data-product-custom-field] [name][required]:not([hidden]):not([type="hidden"])').forEach(field=>{if(field.classList.remove("form-control--warning"),field.type==="radio"){const buttons=form.querySelectorAll(`input[name="${field.name}"]`);Array.from(buttons).some(btn=>btn.checked)||(missingFields.push(field),field.classList.add("form-control--warning"))}else field.value||(missingFields.push(field),field.classList.add("form-control--warning"))}),missingFields}function generateDomFromString(value,tagName="div"){const d=document.createElement(tagName);return d.innerHTML=value,d}function generateDomeFromStringNew(value,selector="div"){return new DOMParser().parseFromString(value,"text/html").querySelector(selector)}function fetchCountDown(collectionID){const appURL=MinimogSettings.foxKitBaseUrl?`https://${MinimogSettings.foxKitBaseUrl}`:"";return new Promise((resolve,reject)=>{let requestUrl=`${appURL}/api/public/countdown?shop=${window.Shopify.shop}&collectionIds=${collectionID}`;fetch(requestUrl).then(response=>
1response.json()).then(resolve).catch(reject)})}function loadAssetsNew(files=[],id,callback=()=>{},options={}){const unique=id||Math.random().toString(36).slice(2);window.MinimogLibs.loadjs.isDefined(id)||window.MinimogLibs.loadjs(files,unique),window.MinimogLibs.loadjs.ready(unique,callback)}function pauseAllMedia(container=document){container.querySelectorAll(".js-youtube").forEach(video=>{video.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),container.querySelectorAll(".js-vimeo").forEach(video=>{video.contentWindow.postMessage('{"method":"pause"}',"*")}),container.querySelectorAll("video").forEach(video=>video.pause()),container.querySelectorAll("product-model").forEach(model=>{model.modelViewerUI&&model.modelViewerUI.pause()})}function loadJS(src,target=document.body,async=!1,defer=!0){return new Promise((resolve,reject)=>{const doc=target.ownerDocument,currScript=doc.querySelector(`script[src="${src}"]`);if(currScript){if(currScript.dataset.loaded)return resolve(!0);currScript.addEventListener("load",()=>{currScript.dataset.loaded=!0,resolve(!0)});return}const script=doc.createElement("script");script.src=src,script.async=async,script.defer=defer,script.addEventListener("load",()=>{script.dataset.loaded=!0,resolve(!0)}),script.onerror=reject,target.appendChild(script)})}function loadCSS(href,target=document.head){return new Promise((resolve,reject)=>{const doc=target.ownerDocument,currLink=doc.querySelector(`link[href="${href}"]`);if(currLink){if(currLink.dataset.loaded)return resolve(!0);currLink.addEventListener("load",()=>{currLink.dataset.loaded=!0,resolve(!0)});return}const link=doc.createElement("link");link.rel="stylesheet",link.href=href,link.addEventListener("load",()=>{link.dataset.loaded=!0,resolve(!0)}),link.onerror=reject,target.appendChild(link)})}function addEventDelegate({context=document.documentElement,event="click",
1selector,handler,capture=!1}){const listener=function(e){for(let target=e.target;target&&target!==this;target=target.parentNode)if(target.matches(selector)){handler.call(target,e,target);break}};return context.addEventListener(event,listener,capture),()=>{context.removeEventListener(event,listener,capture)}}function debounce(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}function _validateOptionsArray(options){if(Array.isArray(options)&&typeof options[0]=="object")throw new Error(options+"is not a valid array of options.")}function _validateProductStructure(product){if(typeof product!="object")throw new TypeError(product+" is not an object.");if(Object.keys(product).length===0&&product.constructor===Object)throw new Error(product+" is empty.")}function getVariantFromOptionArray(product,options){_validateProductStructure(product),_validateOptionsArray(options);var result=product.variants.filter(function(variant){return options.every(function(option,index){return variant.options[index]===option})});return result[0]||null}function getSizedImageUrl(src,size){if(size===null)return src;if(size==="master")return removeProtocol(src);var match=src.match(/\.(jpg|jpeg|gif|png|webp|bmp|bitmap|tiff|tif)(\?v=\d+)?$/i);if(match){var prefix=src.split(match[0]),suffix=match[0];return removeProtocol(prefix[0]+"_"+size+suffix)}else return null}function removeProtocol(path){return path.replace(/http(s)?:/,"")}function updateParam(key,value){var{location}=window,baseUrl=[location.protocol,"//",location.host,location.pathname].join("");const queryString=window.location.search,urlParams=new URLSearchParams(queryString);return urlParams.has(key)?(value!==""&&value!=="undefined"&&urlParams.set(key,value),(value===""||value==="undefined")&&urlParams.delete(key)):value&&urlParams.append(key,value),window.history.replaceState({},"",baseUrl+"?"+urlParams.toString()),!1}function createSearchLink(query){const searchParams=new URLSearchParams({type:"product","options[unavailable_products]":"last","options[prefix]":"last",q:query});return`${window.MinimogSettings.routes.search_url}?${searchParams.toString()}`}function refreshProductReview(){typeof SMARTIFYAPPS<"u"&&SMARTIFYAPPS.rv.installed&&SMARTIFYAPPS.rv.scmReviewsRate.actionCreateReviews(),typeof Yotpo<"u"&&typeof Yotpo.API=="function"&&new Yotpo.API(yotpo)?.refreshWidgets()}(function(){const popularSearchItems=document.querySelectorAll("[data-ps-item]");popularSearchItems&&popularSearchItems.forEach(itm=>itm.href=createSearchLink(itm.dataset.psQuery))})();function queryDomNodes(selectors={},context=document){return Object.entries(selectors).reduce((acc,[name,selector])=>{const findOne=typeof selector=="string",queryMethod=findOne?"querySelector":"querySelectorAll",sl=findOne?selector:selector[0];return context&&(acc[name]=context[queryMethod](sl)),!findOne&&acc[name]&&(acc[name]=[...acc[name]]),acc},{})}function saleProgress(settings,productId,soldNumber){const{total_quantity,sold_to,sold_from}=settings;let soldNumb;if(soldNumber)soldNumb=parseInt(soldNumber);else{const range=sold_to-sold_from,timeRatio=4/24,randomRatioById=(Number(productId.split("").pop())+1)/10;let combinedRatio=timeRatio+randomRatioById;combinedRatio>1&&(combinedRatio-=1);const delta=Math.ceil(combinedRatio*range);soldNumb=sold_from+delta}const availableNumb=total_quantity-soldNumb;return` 2 <div class="m-product-sale-progress"> 3 <div class="m-product-sale-progress__bar" data-flash-sale> 4 <span data-sale-progress style="width: ${soldNumb*100/total_quantity}%;" /> 5 </div> 6 <div class="m-product-sale-progress__text"> 7 <div> 8 <span>${MinimogStrings.sold}: </span> 9 <strong data-sale-number>${soldNumb||0}</strong> 10 </div> 11 <div> 12 <span>${MinimogStrings.available}: </span> 13 <strong data-available-number>${availableNumb||0}</strong> 14 </div> 15 </div> 16 </div> 17 `}function spinner(className=""){return`<svg class="animate-spin m:hidden m-svg-icon--medium ${className}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"> 18 <circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
19 <path fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> 20 </svg>`}function fetchConfig(type="json"){return{method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${type}`}}}function setCookie(cname,cvalue,exdays){var d=new Date;d.setTime(d.getTime()+exdays*24*60*60*1e3);var expires="expires="+d.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";path=/"}function getCookie(cname){for(var name=cname+"=",decodedCookie=decodeURIComponent(document.cookie),ca=decodedCookie.split(";"),i=0;i<ca.length;i++){for(var c=ca[i];c.charAt(0)===" ";)c=c.substring(1);if(c.indexOf(name)===0)return c.substring(name.length,c.length)}return""}function formatUrl(pageType,handle,query){let url;const{routes}=MinimogSettings;return url=`${routes.root.endsWith("/")?"":routes.root}/${pageType}/${handle}`,query&&(url+=`?${query}`),url}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(!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"));this.deferredElement=deferredElement,focus&&deferredElement.focus(),this.playVideo(deferredElement)}}playVideo(videoElm){if(!this.autoPlay)if(videoElm.classList.contains("js-youtube")){const symbol=videoElm.src.indexOf("?")>-1?"&":"?";videoElm.src+=symbol+"autoplay=1&mute=1"}else if(videoElm.classList.contains("js-vimeo")){const symbol=videoElm.src.indexOf("?")>-1?"&":"?";videoElm.src+=symbol+"autoplay=1&muted=1"}else videoElm&&videoElm.setAttribute("autoplay","autoplay"),videoElm&&videoElm.play()}}customElements.define("deferred-media",DeferredMedia);class ResponsiveImage extends HTMLElement{get intersecting(){return this.hasAttribute("intersecting")}constructor(){super(),this.img=this.querySelector("img"),this.src=this.img.src,this.observerCallback=this.observerCallback.bind(this),this.img&&(this.loadImage=this.loadImage.bind(this),this.img.onload=this.onLoad.bind(this)),this.img.complete&&this.onLoad()}connectedCallback(){"IntersectionObserver"in window?this.initIntersectionObserver():this.loadImage()}disconnectedCallback(){this.disconnectObserver()}loadImage(){this.setAttribute("intersecting","true"),this.img&&(this.img.src=this.src,this.img.width=this.clientWidth,this.img.height=this.clientHeight,this.img.sizes=this.clientWidth+"px"),window.MinimogEvents.emit("m:image-loaded",this.imageLoaded,this)}onLoad(){this.removeAttribute(""),this.classList.add("m-image-loaded")}observerCallback(entries,observer){entries[0].isIntersecting&&(observer.unobserve(this),this.loadImage())}initIntersectionObserver(){if(this.observer)return;const rootMargin="10px";this.observer=new IntersectionObserver(this.observerCallback,{rootMargin}),this.observer.observe(this)}disconnectObserver(){this.observer&&(this.observer.disconnect(),this.observer=null,delete this.observer)}}customElements.define("responsive-image",ResponsiveImage);class ProductRecommendations extends HTMLElement{constructor(){super(),this.selectors={gridContainer:".m-product-list",swiperWrapper:".swiper-wrapper",slideControls:".m-slider-controls"},this.enableSlider=this.dataset.enableSlider==="true",this.useScrollMobile=this.dataset.useScrollMobile==="true",this.itemsPerPage=this.dataset.itemsPerPage,this.paginationType=this.dataset.paginationType}connectedCallback(){const handleIntersection=(entries,observer)=>{entries[0].isIntersecting&&(observer.unobserve(this),fetch(this.dataset.url).then(response=>response.text()).then(text=>{const recommendations=generateDomFromString(text).querySelector("product-recommendations");recommendations&&recommendations.innerHTML.trim().length&&(this.innerHTML=recommendations.innerHTML,this.totalProducts=recommendations.querySelectorAll(".m-product-card").length,this.initByScreenSize(),document.addEventListener("matchMobile",()=>{this.initByScreenSize()}),document.addEventListener("unmatchMobile",()=>{this.initByScreenSize()}))}).catch(e=>{console.error(e)}))};"IntersectionObserver"in window&&new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}initByScreenSize(){const{gridContainer,slideControls}=queryDomNodes(this.selectors,this);if(MinimogTheme.config.mqlMobile){if(this.initSlider(),!this.useScrollMobile)return;gridContainer&&gridContainer.classList.remove("swiper-container"),slideControls&&slideControls.classList.add("m:hidden"),this.swiper&&this.swiper.destroy(!1,!0),gridContainer&&gridContainer.parentNode.classList.add("m-mixed-layout--mobile-scroll")}else gridContainer&&gridContainer.classList.add("swiper-container"),gridContainer&&gridContainer.parentNode.classList.remove("m-mixed-layout--mobile-scroll"),slideControls&&slideControls.classList.remove("m:hidden"),this.initSlider()}initSlider(){let __this=this;const{gridContainer,slideControls}=queryDomNodes(this.selectors,this);if(this.enableSlider&&this.totalProducts>this.itemsPerPage){if(this.slider=new MinimogLibs.Swiper(gridContainer,{slidesPerView:this.itemsPerPage>=2?2:1,loop:!0,autoplay:!1,pagination:{el:this.querySelector(".swiper-pagination"),clickable:!0,type:this.paginationType},threshold:2,breakpoints:{1280:{slidesPerView:this.itemsPerPage}},on:{init:function(){this.slideToLoop(this.lastActive),setTimeout(()=>{const firstItem=__this.querySelector(".m-image")||__this.querySelector(".m-placeholder-svg"),prevButton=sli
20deControls&&slideControls.querySelector(".m-slider-controls__button-prev"),nextButton=slideControls&&slideControls.querySelector(".m-slider-controls__button-next");if(firstItem&&slideControls){const itemHeight=firstItem.clientHeight;slideControls.style.setProperty("--offset-top",parseInt(itemHeight)/2+"px"),prevButton.classList.remove("m:hidden"),nextButton.classList.remove("m:hidden")}},200)}}}),this.slider){slideControls&&slideControls.classList.remove("m:hidden");const prevBtn=this.querySelector(".m-slider-controls__button-prev"),nextBtn=this.querySelector(".m-slider-controls__button-next");prevBtn&&prevBtn.addEventListener("click",()=>this.slider.slidePrev()),nextBtn&&nextBtn.addEventListener("click",()=>this.slider.slideNext())}this.swiper=gridContainer?.swiper}else{const innerContainer=gridContainer.querySelector(".m-mixed-layout__inner");innerContainer&&innerContainer.classList.remove("swiper-wrapper"),slideControls&&slideControls.classList.add("m:hidden"),gridContainer&&gridContainer.classList.remove("swiper-container")}}}if(customElements.define("product-recommendations",ProductRecommendations),customElements.get("video-component")||customElements.define("video-component",class extends HTMLElement{constructor(){super(),MinimogTheme.initWhenVisible({element:this,callback:this.init.bind(this),threshold:0})}init(){this.autoPlay=this.dataset.autoPlay==="true",this.muted=this.dataset.muted==="true";const poster=this.querySelector('[id^="Video-Deferred-Poster-"]');this.autoPlay?this.loadContent():poster&&poster.addEventListener("click",this.loadContent.bind(this))}loadContent(){if(!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"));if(this.deferredElement=deferredElement,this.autoPlay)return;if(this.deferredElement.classList.contains("js-youtube")){const symbol=this.deferredElement.src.indexOf("?")>-1?"&":"?";this.deferredElement.src+=symbol+`autoplay=1${this.muted?"&mute=1":""}`}else if(this.deferredElement.classList.contains("js-vimeo")){const symbol=this.deferredElement.src.indexOf("?")>-1?"&":"?";this.deferredElement.src+=symbol+`autoplay=1${this.muted?"&mute=1":""}`}else this.deferredElement.play()}}}),!customElements.get("collapsible-tab")){class CollapsibleTab extends HTMLElement{constructor(){super()}connectedCallback(){this.parentEl=this.closest("[data-section-id]"),this.init()}disconnectedCallback(){this.destroy()}init(){this.dataset.destroy!=="true"&&(this.setDefaultData(),this.attachEvents(),this.getAttribute("open")==="true"?(this.selected=!0,this.classList.add(this.expandedClass),this.setExpandedAria(),this.fire("tabOpened"),window.MinimogEvents.emit("ON_COLLAPSIBLE_TAB_OPENED",this)):(this.content.style.height=this.collapsedHeight,this.classList.add(this.collapsedClass),this.setCollapsedAria()),this.content.removeAttribute("hidden"))}transitionendEventName(){let i,el=document.createElement("div"),transitions={transition:"transitionend",OTransition:"otransitionend",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(i in transitions)if(transitions.hasOwnProperty(i)&&el.style[i]!==void 0)return transitions[i]}expand(){const bindEvent=(ev=>{ev.target===this.content&&(this.content.removeEventListener(this.transitionendevent,bindEvent),this.isOpen&&requestAnimationFrame(()=>{this.content.style.transition="0",this.content.style.height="auto",requestAnimationFrame(()=>{this.content.style.height=null,this.content.style.transition=null,this.setExpandedAria(),this.classList.add(this.expandedClass),this.trySetTabIndex(this.content,0),this.fire("tabOpened"),window.MinimogEvents.emit("ON_COLLAPSIBLE_TAB_OPENED",this)})}))}).bind(this);this.content.addEventListener(this.transitionendevent,bindEvent),this.isOpen=!0,this.classList.remove(this.collapsedClass),this.content.style.height=this.content.scrollHeight+"px"}collapse(){const bindEvent=(ev=>{ev.target===this.content&&(this.content.removeEventListener(this.transitionendevent,bindEvent),!this.isOpen&&(this.fire("elementClosed"),window.MinimogEvents.emit("ON_COLLAPSIBLE_TAB_CLOSED",this),this.setCollapsedAria(),this.classList.add(this.collapsedClass),this.trySetTabIndex(this.content,-1)))}).bind(this);this.content.addEventListener(this.transitionendevent,bindEvent),this.isOpen=!1,this.classList.remove(this.expandedClass),requestAnimationFrame(()=>{this.content.style.transition="0",this.content.style.height=this.content.scrollHeight+"px",requestAnimationFrame(()=>{this.content.style.transition=null,this.content.style.height=this.collapsedHeight})})}open(){this.selected=!0,this.fire("elementSelected"),window.MinimogEvents.emit("ON_COLLAPSIBLE_TAB_SELECTED",this),this.expand(),this.setAttribute("open",!0)}close(){this.selected=!1,this.fire("elementUnselected"),window.MinimogEvents.emit("ON_COLLAPSIBLE_TAB_UNSELECTED",this),this.collapse(),this.removeAttribute("open")}toggle(event){if(event&&event.preventDefault(),this.selected)this.close();else if(this.open(),this.oneAtATime){const allItems=this.parentEl.querySelectorAll("collapsible-tab"),parent=this.closest("[data-first-level]");
20allItems.length&&allItems.forEach(item=>{item!==this&&item.selected&&parent!==item&&item.close()})}}trySetTabIndex(el,index){const tappableElements=el.querySelectorAll(this.defaultElements);tappableElements&&tappableElements.forEach(e=>{e.setAttribute("tabindex",index)})}setExpandedAria(){this.trigger.setAttribute("aria-expanded","true"),this.content.setAttribute("aria-hidden","false")}setCollapsedAria(el){this.trigger.setAttribute("aria-expanded","false"),this.content.setAttribute("aria-hidden","true")}attachEvents(){this.trigger.addEventListener("click",event=>this.toggle(event))}setDefaultData(){this.events={elementSelected:[],tabOpened:[],elementUnselected:[],elementClosed:[]},this.transitionendevent=this.transitionendEventName(),this.expandedClass="is-expanded",this.collapsedClass="is-collapsed",this.trigger=this.querySelector("[data-trigger]"),this.content=this.querySelector("[data-content]"),this.collapsedHeight="0px",this.defaultElements=["a","button","input:not(.focus-none)","[data-trigger]"],this.oneAtATime=!0,this.dataset.oneOpen&&(this.oneAtATime=this.dataset.oneOpen==="true")}fire(eventName){let callbacks=this.events[eventName];if(callbacks)for(let i=0;i<callbacks.length;i++)callbacks[i](this)}on(eventName,cb){this.events[eventName]&&this.events[eventName].push(cb)}destroy(){this.trigger.removeEventListener("click",event=>this.toggle(event)),this.content.removeAttribute("aria-hidden"),this.content.style.height="auto",this.classList.remove(this.expandedClass,this.collapsedClass),this.removeAttribute("open")}}customElements.define("collapsible-tab",CollapsibleTab)}if(customElements.get("product-form")||customElements.define("product-form",class extends HTMLElement{constructor(){super(),this.selectors={form:"form",inputId:"[name=id]",submitButton:'[name="add"]',errorWrapper:".m-product-form-message",customFields:["[data-product-custom-field]"],dynamicCheckout:".m-product-dynamic-checkout"}}connectedCallback(){this.domNodes=queryDomNodes(this.selectors,this),this.form=this.domNodes.form,this.productInfo=this.closest(".m-main-product--info"),this.submitButton=this.domNodes.submitButton,this.domNodes.inputId.disabled=!1,this.cart=document.querySelector("m-cart-drawer"),this.cartPage=document.querySelector("m-cart"),this.customFields=document.querySelectorAll(this.selectors.customFields),this.domNodes.dynamicCheckout&&(this.enable_dynamic_checkout=!0),this.form.addEventListener("submit",this.onSubmitHandler.bind(this)),this.domNodes.dynamicCheckout&&this.customFields&&this.domNodes.dynamicCheckout.addEventListener("click",e=>{const missing=validateForm(this.form.closest(".m-main-product--info"));missing&&missing.length>0&&(e.stopPropagation(),window.MinimogTheme.Notification.show({target:this.domNodes.errorWrapper,method:"appendChild",type:"warning",message:window.MinimogStrings.requiredField,delay:100}),console.warn("Missing field(s): ",missing))},!0)}toggleSpinner(show){const method=show?"add":"remove";this.classList[method]("m-spinner-loading")}getFormData(){const formData=new FormData(this.form);if(this.closest("sticky-atc")){const form=document.querySelector(".m-main-product--info .m-product-form--main form"),extraFormData=new FormData(form);for(const[key,value]of extraFormData.entries())formData.has(key)||formData.set(key,value)}return formData}onSubmitHandler(evt){evt.preventDefault(),this.toggleSpinner(!0);const missing=validateForm(this.form.closest(".m-main-product--info"));if(missing&&missing.length>0)return console.warn("Missing field(s): ",missing),this.toggleSpinner(!1),window.MinimogTheme.Notification.show({target:this.domNodes.errorWrapper,method:"appendChild",type:"warning",message:window.MinimogStrings.requiredField});let sectionsToBundle=[];document.documentElement.dispatchEvent(new CustomEvent("cart:grouped-sections",{bubbles:!0,detail:{sections:sectionsToBundle}}));const config=fetchConfig("javascript");config.headers["X-Requested-With"]="XMLHttpRequest",delete config.headers["Content-Type"];const formData=this.getFormData();formData.append("sections",sectionsToBundle),formData.append("sections_url",window.location.pathname),config.body=formData;const{MinimogSettings:MinimogSettings2,MinimogStrings:MinimogStrings2}=window;fetch(`${MinimogSettings2.routes.cart_add_url}`,config).then(response=>response.json()).then(response=>{if(response.status){window.MinimogEvents.emit(MinimogTheme.pubSubEvents.cartError,{source:"product-form",productVariantId:formData.get("id"),errors:response.error||response.description,message:response.message}),document.dispatchEvent(new CustomEvent("product-ajax:error",{detail:{errorMessage:response.error||response.description}})),this.error=!0;const variantId=formData.get("id");return variantId===""||variantId===null?(this.handleErrorMessageVariantPicker(),window.MinimogTheme.Notification.show({target:this.domNodes.errorWrapper?this.domNodes.errorWrapper:document.body,method:"appendChild",type:"error",message:MinimogStrings2.selectVariant,last:3e3,sticky:!this.domNodes.errorWrapper})):window.MinimogTheme.Notification.show({target:this.domNodes.errorWrapper?this.domNodes.errorWrapper:document.body,method:"appendChild",type:"error",message:response.message,last:3e3,sticky:!this.domNodes.errorWrapper})}MinimogSettings2.use_ajax_atc?(this.cart&&MinimogSettings2.enable_cart_drawer?(MinimogTheme.Notification.show({target:this.cart.querySelector("m-cart-items"),method:"prepend",type:"success",message:MinimogStrings2.itemAdded,delay:400}),this.cart.open()):window.MinimogTheme.Notification.show({target:this.domNodes.errorWrapper?this.domNodes.errorWrapper:document.body,method:"appendChild",type:"success",message:MinimogStrings2.itemAdded,last:3e3,sticky:!this.domNodes.errorWrapper}),window.MinimogEvents.emit(MinimogTheme.pubSubEvents.cartUpdate,{cart:response,productVariantId:formData.get("id")}),document.dispatchEvent(new CustomEvent("product-ajax:added",{detail:{product:response}})),this.error=!1):window.location=MinimogSettings2.routes.cart}).catch(e=>{console.error(e)}).finally(()=>{this.toggleSpinner(!1)})}handleErrorMessageVariantPicker(){const variantPicker=this.productInfo&&this.productInfo.querySelector("variant-picker"),options=variantPicker&&variantPicker.querySelectorAll("[data-selected-value]");options&&options.forEach(option=>{option.dataset.selectedValue===""&&(option.classList.add("m-product-option--unselect"),setTimeout(()=>{option.classList.remove("m-product-option--unselect")},3e3))})}get variantIdInput(){return this.form.querySelector("[name=id]")}}),!customElements.get("m-video-component")){class VideoComponent extends HTMLElement{constructor(){super(),this.background=this.dataset.initMode!=="template",this.background?MinimogTheme.initWhenVisible({element:this,callback:this.init.bind(this),threshold:0}):this.init()}init(){switch(this.parentSelector=this.dataset.parent||".m-hero__bg",this.parent=this.closest(this.parentSelector),this.dataset.type){case"youtube":this.initYoutubeVideo();break;case"vimeo":this.initVimeoVideo();break;case"mp4":this.initMp4Video();break}}initYoutubeVideo(){this.setAsLoading(),this.loadScript("youtube").then(this.setupYoutubePlayer.bind(this))}initVimeoVideo(){this.setAsLoading(),this.loadScript("vimeo").then(this.setupVimeoPlayer.bind(this))}initMp4Video(){const player=this.querySelector("video");if(player){const promise=player.play();typeof promise<"u"&&promise.then(function(){}).catch(function(){player.setAttribute("controls","")})}}loadScript(videoType){return new Promise((resolve,reject)=>{const script=document.createElement("script");document.body.appendChild(script),script.onload=resolve,script.onerror=reject,script.async=!0,script.src=videoType==="youtube"?"//www.youtube.com/iframe_api":"//player.vimeo.com/api/player.js"})}setAsLoading(){this.parent.setAttribute("loading",!0)}setAsLoaded(){this.parent.removeAttribute("loading"),this.parent.setAttribute("loaded",!0)}setupYoutubePlayer(){const videoId=this.dataset.videoId,playerInterval=setInterval(()=>{window.YT&&window.YT.ready(()=>{const element=document.createElement("div");this.appendChild(element),this.player=new YT.Player(element,{videoId,playerVars:{showinfo:0,controls:!1,fs:0,rel:0,height:"100%",width:"100%",iv_load_policy:3,html5:1,loop:1,playsinline:1,modestbranding:1,disablekb:1},events:{onReady:this.onYoutubeReady.bind(this),onStateChange:this.onYoutubeStateChange.bind(this)}}),clearInterval(playerInterval)})},50)}onYoutubeReady(){this.iframe=this.querySelector("iframe"),this.iframe.setAttribute("tabindex","-1"),typeof this.player.mute=="function"&&this.player.mute(),typeof this.player.playVideo=="function"&&this.player.playVideo(),this.setAsLoaded(),"IntersectionObserver"in window&&new IntersectionObserver((entries,_observer)=>
20{entries.forEach(entry=>{entry.isIntersecting?this.youtubePlay():this.youtubePause()})},{rootMargin:"0px 0px 50px 0px"}).observe(this.iframe)}onYoutubeStateChange(event){switch(event.data){case-1:this.attemptedToPlay&&this.setAsLoaded();break;case 0:this.youtubePlay();break;case 1:this.setAsLoaded();break;case 3:this.attemptedToPlay=!0;break}}youtubePlay(){this.player&&typeof this.player.playVideo=="function"&&this.player.playVideo()}youtubePause(){this.player&&typeof this.player.pauseVideo=="function"&&this.player.pauseVideo()}setupVimeoPlayer(){const videoId=this.dataset.videoId,playerInterval=setInterval(()=>{window.Vimeo&&(this.player=new Vimeo.Player(this,{id:videoId,autoplay:!0,autopause:!1,background:!1,controls:!1,loop:!0,height:"100%",width:"100%"}),this.player.ready().then(this.onVimeoReady.bind(this)),clearInterval(playerInterval))},50)}onVimeoReady(){this.iframe=this.querySelector("iframe"),this.iframe.setAttribute("tabindex","-1"),this.player.setMuted(!0),this.setAsLoaded(),new IntersectionObserver((entries,_observer)=>{entries.forEach(entry=>{entry.isIntersecting?this.vimeoPlay():this.vimeoPause()})},{rootMargin:"0px 0px 50px 0px"}).observe(this.iframe)}vimeoPlay(){this.player&&typeof this.player.play=="function"&&this.player.play()}vimeoPause(){this.player&&typeof this.player.pause=="function"&&this.player.pause()}}customElements.define("m-video-component",VideoComponent)}if(!customElements.get("m-search-popup")){class MSearchPopup extends HTMLElement{constructor(){super(),this.selectors={container:"[data-search-container]",form:"form",input:"[data-search-input]",submit:'button[type="submit"]',loading:"[data-spinner]",close:"[data-close-search]"};const searchPopup=document.querySelector("[data-search-popup]");if(!searchPopup)return;this.domNodes=queryDomNodes(this.selectors,searchPopup),this.domNodes.searchPopup=searchPopup,document.body.appendChild(searchPopup),addEventDelegate({selector:"[data-open-search-popup]",handler:()=>this.openSearchPopup()});const{input,submit,close,form}=this.domNodes;input&&input.addEventListener("keydown",e=>{e.keyCode===27&&this.closeSearchPopup()}),submit.addEventListener("click",e=>{e.preventDefault(),input.value&&form.submit()}),close.addEventListener("click",e=>{this.closeSearchPopup(),MinimogEvents.emit(MinimogTheme.pubSubEvents.closeSearchPopup)}),searchPopup.addEventListener("click",e=>{e.target===searchPopup&&this.closeSearchPopup()}),MinimogEvents.subscribe(MinimogTheme.pubSubEvents.openCartDrawer,()=>{this.hasAttribute("open")&&this.closeSearchPopup()})}openSearchPopup(){const{searchPopup,input,container}=this.domNodes;searchPopup.style.removeProperty("visibility"),searchPopup.style.setProperty("opacity","1"),container.classList.add("m-show-search"),this.setAttribute("open",!0),setTimeout(()=>{container.style.removeProperty("--m-durations"),input.focus()},350),document.documentElement.classList.add("prevent-scroll"),MinimogEvents.emit(MinimogTheme.pubSubEvents.openSearchPopup,this)}closeSearchPopup(){const{searchPopup,container}=this.domNodes;container.classList.remove("m-show-search"),searchPopup.style.setProperty("opacity","0"),setTimeout(()=>{searchPopup.style.setProperty("visibility","hidden"),container.style.setProperty("--m-durations",".3s"),document.documentElement.classList.remove("prevent-scroll"),this.removeAttribute("open")},350)}}customElements.define("m-search-popup",MSearchPopup)}if(!customElements.get("m-select-component")){class MSelectComponent extends HTMLElement{constructor(){super(),this.selectors={elSelectNative:".js-selectNative",elSelectCustom:".js-selectCustom",elSelectCustomBox:".m-select-custom--trigger",elSelectCustomOpts:".m-select-custom--options",elSelectCustomTriggerText:".m-select-custom--trigger-text",customOptionList:[".m-select-custom--option"]},this.domNodes=queryDomNodes(this.selectors,this),this.optionChecked="",window.addEventListener("DOMContentLoaded",()=>{this.classList.remove("m:hidden")}),this.setDefaultValue(),this.initSelect()}setDefaultValue(){const{elSelectNative}=this.domNodes,value=elSelectNative.options[elSelectNative.selectedIndex].value,text=elSelectNative.options[elSelectNative.selectedIndex].text;this.updateCustomSelectChecked(value,text)}initSelect(){this.classList.remove("m:hidden");const{elSelectNative,elSelectCustom,elSelectCustomBox}=this.domNodes;elSelectCustomBox.addEventListener("click",()=>{!elSelectCustom.classList.contains("isActive")?this.openSelect():this.closeSelect()}),this.domNodes.customOptionList.forEach(option=>{option.addEventListener("click",e=>{const value=e.target.getAttribute("data-value");elSelectNative.value=value,this.closeSelect(),this.updateCustomSelectChecked(value,e.target.textContent),elSelectNative.dispatchEvent(new Event("change")),elSelectNative.dispatchEvent(new Event("click"))})})}openSelect(){const allCustomSelect=document.querySelectorAll("m-select-component");document.addEventListener("click",e=>this.handleClickOutside(e)),allCustomSelect.length>0&&allCustomSelect.forEach(select=>{select.closeSelect()}),this.domNodes.elSelectCustom.classList.add("isActive")}closeSelect(){this.domNodes.elSelectCustom.classList.remove("isActive")}updateCustomSelectChecked(value,text){const{elSelectCustomOpts,elSelectCustomTriggerText}=this.domNodes,prevValue=this.optionChecked,elPrevOption=elSelectCustomOpts.querySelector(`[data-value="${prevValue}"`),elOption=elSelectCustomOpts.querySelector(`[data-value="${value}"`);elPrevOption&&elPrevOption.classList.remove("isActive"),elOption&&elOption.classList.add("isActive"),elSelectCustomTriggerText.textContent=text,this.optionChecked=value}handleClickOutside(e){const{elSelectCustom}=this.domNodes;!elSelectCustom.contains(e.target)&&this.closeSelect()}}customElements.define("m-select-component",MSelectComponent)}class MQuantityInput extends HTMLElement{quantityUpdateUnsubscriber=void 0;constructor(){super()}get sectionId(){return this.getAttribute("data-section-id")}get productId(){return this.getAttribute("data-product-id")}get input(){return this.querySelector("input")}get value(){return this.input.value}
20connectedCallback(){this.changeEvent=new Event("change",{bubbles:!0}),this.input.addEventListener("change",this.onInputChange.bind(this)),this.input.addEventListener("focus",()=>setTimeout(()=>this.input.select())),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this))),this.validateQtyRules(),this.quantityUpdateUnsubscriber=MinimogEvents.subscribe(MinimogTheme.pubSubEvents.quantityUpdate,this.validateQtyRules.bind(this)),this.shouldSync=this.closest(".m-main-product--info")||this.closest("sticky-atc"),this.shouldSync&&window.addEventListener("syncProductQuantity",event=>{event.detail!==this.input.value&&(this.input.value=event.detail,this.validateQtyRules())})}onInputChange(){this.shouldSync&&window.dispatchEvent(new CustomEvent("syncProductQuantity",{detail:this.input.value})),this.validateQtyRules()}onButtonClick(event){event.preventDefault();const previousValue=this.input.value;event.currentTarget.name==="plus"?parseInt(this.input.getAttribute("data-min"))>parseInt(this.input.step)&&this.input.value==0?this.input.value=this.input.getAttribute("data-min"):this.input.stepUp():this.input.stepDown(),previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent),this.input.getAttribute("data-min")===previousValue&&event.currentTarget.name==="minus"&&(this.input.value=parseInt(this.input.min))}validateQtyRules(){const value=parseInt(this.input.value),buttonMinus=this.querySelector(".m-quantity__button[name='minus']"),buttonPlus=this.querySelector(".m-quantity__button[name='plus']");if(this.input.min){const min=parseInt(this.input.min);buttonMinus.classList.toggle("m:disabled",value<=min)}else buttonMinus.classList.remove("m:disabled");if(this.input.max){const max=parseInt(this.input.max);buttonPlus.classList.toggle("m:disabled",value>=max)}else buttonPlus.classList.remove("m:disabled")}updateQuantityRules(sectionId,productId,parsedHTML){if(sectionId!==this.sectionId||productId!==this.productId)return;const selectors=[".m-quantity__input",".quantity__rules",".m-product-option--label"],quantityFormUpdated=parsedHTML.getElementById(`QuantityForm-${sectionId}`),quantityForm=this.closest(`#QuantityForm-${sectionId}`);for(let selector of selectors){const current=quantityForm.querySelector(selector),updated=quantityFormUpdated.querySelector(selector);if(!(!current||!updated))if(selector===".m-quantity__input"){const attributes=["data-cart-quantity","data-min","data-max","step"];for(let attribute of attributes){const valueUpdated=updated.getAttribute(attribute);valueUpdated!==null?current.setAttribute(attribute,valueUpdated):current.removeAttribute(attribute)}}else current.innerHTML=updated.innerHTML}}setQuantityBoundries(sectionId,productId){if(sectionId!==this.sectionId||productId!==this.productId)return;const data={cartQuantity:this.input.hasAttribute("data-cart-quantity")?parseInt(this.input.getAttribute("data-cart-quantity")):0,min:this.input.hasAttribute("data-min")&&this.input.getAttribute("data-min")?parseInt(this.input.getAttribute("data-min")):1,max:this.input.hasAttribute("data-max")&&this.input.getAttribute("data-max")?parseInt(this.input.getAttribute("data-max")):null,step:this.input.hasAttribute("step")&&this.input.getAttribute("step")?parseInt(this.input.getAttribute("step")):1};let min=data.min;const max=data.max===null?data.max:data.max-data.cartQuantity;max!==null&&(min=Math.min(min,max)),data.cartQuantity>=data.min&&(min=Math.min(min,data.step)),this.input.min=min,max?this.input.max=max:this.input.removeAttribute("max"),this.input.value=min,MinimogEvents.emit(MinimogTheme.pubSubEvents.quantityUpdate,void 0)}reset(){this.input.value=this.input.defaultValue}setValidity(message){this.input.setCustomValidity(message),this.input.reportValidity(),this.input.value=this.input.defaultValue,this.input.select(),this.validateQtyRules()}}customElements.define("m-quantity-input",MQuantityInput);class ProductRecentlyViewed extends HTMLElement{constructor(){if(super(),isStorageSupported("local")){const productId=parseInt(this.dataset.productId),cookieName="minimog-recently-viewed",items=JSON.parse(window.localStorage.getItem(cookieName)||"[]");items.includes(productId)||items.unshift(productId),window.localStorage.setItem(cookieName,JSON.stringify(items.slice(0,20)))}}}customElements.define("product-recently-viewed",ProductRecentlyViewed);class ProgressBar extends HTMLElement{constructor(){super(),!this.hasAttribute("style")&&(this.dataset.from&&this.initProgress(),MinimogTheme.initWhenVisible({element:this,callback:this.init.bind(this),threshold:0}))}init(){this.setPercentage(this.dataset.value,this.dataset.max)}initProgress(){this.setPercentage(this.dataset.from,this.dataset.max)}setPercentage(val1,val2){this.style.setProperty("--percent",`${parseInt(val1)/parseInt(val2)*100}%`)}}if(customElements.define("progress-bar",ProgressBar),!customElements.get("m-cart-count")){class MCartCount extends HTMLElement{constructor(){super(),this.get
20SectionToRenderListener=this.getSectionToRender.bind(this)}cartUpdateUnsubscriber=void 0;get sectionName(){return"cart-count"}getSectionToRender(event){event.detail.sections.push(this.sectionName)}connectedCallback(){document.addEventListener("cart:grouped-sections",this.getSectionToRenderListener),this.cartUpdateUnsubscriber=MinimogEvents.subscribe(MinimogTheme.pubSubEvents.cartUpdate,this.onCartUpdate.bind(this))}disconnectedCallback(){this.cartUpdateUnsubscriber&&this.cartUpdateUnsubscriber()}get itemCount(){return parseInt(this.innerText)}onCartUpdate(event){if(event.cart.errors)return;const sectionToRender=new DOMParser().parseFromString(event.cart.sections[this.sectionName],"text/html");this.onUpdate(sectionToRender)}onUpdate(section){this.innerText=section.querySelector(".m-cart-count").innerText;const method=this.itemCount===0?"add":"remove";this.classList[method]("m:hidden")}}customElements.define("m-cart-count",MCartCount)} 21//# sourceMappingURL=/cdn/shop/t/10/assets/theme-global.js.map?v=89657562916315813401760921003
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.