Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
84 kB
2
Indexable
Never
MinimogTheme.pubSubEvents={cartError:"cart-error",cartUpdate:"cart-update",openCartDrawer:"open-cart-drawer",openSearchPopup:"open-search-popup"};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(e){const t=e.threshold?e.threshold:0;new IntersectionObserver(((t,i)=>{t.forEach((t=>{t.isIntersecting&&"function"==typeof e.callback&&(e.callback(),i.unobserve(t.target))}))}),{rootMargin:`0px 0px ${t}px 0px`}).observe(e.element)},function(){const e=window.matchMedia(MinimogTheme.config.mediaQueryMobile);MinimogTheme.config.mqlMobile=e.matches,e.onchange=e=>{e.matches?(MinimogTheme.config.mqlMobile=!0,document.dispatchEvent(new CustomEvent("matchMobile"))):(MinimogTheme.config.mqlMobile=!1,document.dispatchEvent(new CustomEvent("unmatchMobile")))};const t=window.matchMedia(MinimogTheme.config.mediaQueryTablet);MinimogTheme.config.mqlTablet=t.matches,t.onchange=e=>{e.matches?(MinimogTheme.config.mqlTablet=!0,document.dispatchEvent(new CustomEvent("matchTablet"))):(MinimogTheme.config.mqlTablet=!1,document.dispatchEvent(new CustomEvent("unmatchTablet")))};var i=document.querySelector(".m-page-transition");!function(){if(!window.AnimationEvent||!i)return;let e=!1;const t="true"===i.dataset.designMode;document.querySelectorAll("a[href^=mailto], a[href^=tel]").forEach((t=>{t.addEventListener("click",(()=>{e=!0}))})),t&&Shopify.designMode?i.classList.add("m-page-transition--design-mode"):(window.addEventListener("beforeunload",(()=>{e||i.classList.add("fade-in")})),window.addEventListener("DOMContentLoaded",(()=>{document.documentElement.classList.remove("m:overflow-hidden"),document.body.classList.remove("m:overflow-hidden"),setTimeout((()=>{i.classList.add("fade-out")}),300),document.dispatchEvent(new CustomEvent("page:loaded"))})),window.addEventListener("pageshow",(e=>{e.persisted&&i.classList.remove("fade-in")})))}()}();class CountdownTimer{constructor(e,t,i,s={}){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=864e5,this.HOUR_IN_MS=36e5,this.MIN_IN_MS=6e4,this.container=e,this.startTime=t,this.savedStartTime=t,this.endTime=i,this.options=Object.assign({},{addZeroPrefix:!0,loop:!1,callback:()=>{}},s),this.intervalTime=1e3,this.timer=null,this.domNodes=queryDomNodes(this.selectors,e),this.start()}start(){this.timer=setInterval((()=>{this.startTime>this.endTime?this.stop():this.update()}),this.intervalTime),this.container.style.removeProperty("opacity")}update(){const e=this.format(this.endTime-this.startTime);this.times.forEach((t=>{this.domNodes[t]&&(this.domNodes[t].textContent=this.addZeroPrefix(e[t]))})),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((e=>{this.domNodes[e]&&(this.domNodes[e].textContent="00")}))}addZeroPrefix(e){return this.options.addZeroPrefix&&e<10?`0${e}`:e.toString()}format(e){return{day:Math.floor(e/this.DAY_IN_MS),hour:Math.floor(e/this.HOUR_IN_MS)%24,min:Math.floor(e/this.MIN_IN_MS)%60,sec:Math.floor(e/1e3)%60}}}window.MinimogTheme.CountdownTimer=CountdownTimer;class Tabs{constructor(e,t=(()=>{})){this.selectors={tabHeaders:[".m-tab-header"],tabContents:[".m-tab-content"]},this.activeClass="active",this.currentActiveIndex=-1,this.currentTab=null,this.container=e,this.cb=t,this.domNodes=queryDomNodes(this.selectors,e),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,t)=>{let i;e.preventDefault(),t&&(i=Number(t.dataset.index)),this.setActiveTab(i),this.cb(t)}})}setActiveTab(e){const{tabHeaders:t,tabContents:i}=this.domNodes;if(i.length&&-1!==e&&this.currentActiveIndex!==e){let s,o,n;if(s=t&&t[this.currentActiveIndex],o=t&&t[e],this.customSelect&&o){"select"===this.customSelect.dataset.tabHeader&&this.customSelect.updateCustomSelectChecked(e,o.innerHTML),MinimogTheme.config.mqlMobile&&this.customSelect.updateCustomSelectChecked(e,o.innerHTML),document.addEventListener("matchMobile",(()=>this.customSelect.updateCustomSelectChecked(e,o.innerHTML)))}n=i&&i[e],s&&s.classList.remove(this.activeClass),this.currentTab&&this.currentTab.classList.remove(this.activeClass),o&&o.classList.add(this.activeClass),n&&n.classList.add(this.activeClass),setTimeout((()=>n.style.opacity=1)),this.currentActiveIndex=e,this.currentTab=n}}}function getFocusableElements(e){return Array.from(e.querySelectorAll("summary, a[href], button:enabled, [tabindex]:not([tabindex^='-']), [draggable], area, input:not([type=hidden]):enabled, select:enabled, textarea:enabled, object, iframe"))}window.MinimogTheme.Tabs=Tabs,void 0===window.Shopify&&(window.Shopify={}),Shopify.bind=function(e,t){return function(){return e.apply(t,arguments)}},Shopify.setSelectorByValue=function(e,t){for(var i=0,s=e.options.length;i<s;i++){var o=e.options[i];if(t==o.value||t==o.innerHTML)return e.selectedIndex=i,i}},Shopify.addListener=function(e,t,i){e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent("on"+t,i)},Shopify.CountryProvinceSelector=function(e,t,i){this.countryEl=document.getElementById(e),this.provinceEl=document.getElementById(t),this.provinceContainer=document.getElementById(i.hideElement||t),Shopify.addListener(this.countryEl,"change",Shopify.bind(this.countryHandler,this)),this.initCountry(),this.initProvince()},Shopify.CountryProvinceSelector.prototype={initCountry:function(){var e=this.countryEl.getAttribute("data-default");Shopify.setSelectorByValue(this.countryEl,e),this.countryHandler()},initProvince:function(){var e=this.provinceEl.getAttribute("data-default");e&&this.provinceEl.options.length>0&&Shopify.setSelectorByValue(this.provinceEl,e)},countryHandler:function(e){var t=(o=this.countryEl.options[this.countryEl.selectedIndex]).getAttribute("data-provinces"),i=JSON.parse(t);if(this.clearOptions(this.provinceEl),i&&0==i.length)this.provinceContainer.style.display="none";else{for(var s=0;s<i.length;s++){var o;(o=document.createElement("option")).value=i[s][0],o.innerHTML=i[s][1],this.provinceEl.appendChild(o)}this.provinceContainer.style.display=""}},clearOptions:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},setOptions:function(e,t){var i=0;for(t.length;i<t.length;i++){var s=document.createElement("option");s.value=t[i],s.innerHTML=t[i],e.appendChild(s)}}};const trapFocusHandlers={};function trapFocus(e,t=e){var i=getFocusableElements(e),s=i[0],o=i[i.length-1];removeTrapFocus(),trapFocusHandlers.focusin=t=>{t.target!==e&&t.target!==o&&t.target!==s||document.addEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.focusout=function(){document.removeEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.keydown=function(t){"TAB"===t.code.toUpperCase()&&(t.target!==o||t.shiftKey||(t.preventDefault(),s.focus()),t.target!==e&&t.target!==s||!t.shiftKey||(t.preventDefault(),o.focus()))},document.addEventListener("focusout",trapFocusHandlers.focusout),document.addEventListener("focusin",trapFocusHandlers.focusin),t.focus(),"INPUT"===t.tagName&&["search","text","email","url"].includes(t.type)&&t.value&&t.setSelectionRange(0,t.value.length)}function removeTrapFocus(e=null){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown),e&&e.focus()}function getRequestDefaultConfigs(){return JSON.parse(JSON.stringify(requestDefaultConfigs))}function fetchJSON(e,t=getRequestDefaultConfigs()){return fetch(e,t).then((function(e){if(!e.ok)throw e;return e.json()}))}const cache=new Map;function fetchCache(e,t=getRequestDefaultConfigs()){return new Promise(((i,s)=>{let o=cache.get(e);if(o)return i(o);fetch(e,t).then((t=>{o=t.text(),cache.set(e,o),i(o)})).catch(s)}))}const sectionCache=new Map;function fetchSection(e,t={}){const{url:i,fromCache:s=!1,params:o={}}=t;return new Promise(((t,n)=>{const r=new URL(i||window.location.href);if(r.searchParams.set("section_id",e),Object.entries(o).forEach((([e,t])=>r.searchParams.set(e,t))),s){const e=sectionCache.get(r);if(e)return t(e)}fetch(r,getRequestDefaultConfigs()).then((t=>{if(t.ok)return t.text();n(`Failed to load section: ${e}`)})).then((e=>{const i=generateDomFromString(e);sectionCache.set(r,i),t(i)})).catch(n)}))}const cache2=new Map;function fetchJsonCache(e,t=requestDefaultConfigs){return new Promise(((i,s)=>{if(cache2.get(e))return i(cache2.get(e));fetch(e,t).then((t=>{if(t.ok){const s=t.json();return i(s),cache2.set(e,s),s}s(t)})).catch(s)}))}function formatMoney(e,t){"string"==typeof e&&(e=e.replace(".",""));let i="";const s=/\{\{\s*(\w+)\s*\}\}/,o=t||"${{amount}}";function n(e,t=2,i=",",s="."){if(isNaN(e)||null==e)return 0;const o=(e=(e/100).toFixed(t)).split(".");return o[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1${i}`)+(o[1]?s+o[1]:"")}switch(o.match(s)[1]){case"amount":i=n(e,2);break;case"amount_no_decimals":i=n(e,0);break;case"amount_with_comma_separator":i=n(e,2,".",",");break;case"amount_no_decimals_with_comma_separator":i=n(e,0,".",",")}return o.replace(s,i)}function validateForm(e){const t=[];if(!e)return t;return e.querySelectorAll('[data-product-custom-field] [name][required]:not([hidden]):not([type="hidden"])').forEach((i=>{if(i.classList.remove("form-control--warning"),"radio"===i.type){const s=e.querySelectorAll(`input[name="${i.name}"]`);Array.from(s).some((e=>e.checked))||(t.push(i),i.classList.add("form-control--warning"))}else i.value||(t.push(i),i.classList.add("form-control--warning"))})),t}function generateDomFromString(e,t="div"){const i=document.createElement(t);return i.innerHTML=e,i}function generateDomeFromStringNew(e,t="div"){return(new DOMParser).parseFromString(e,"text/html").querySelector(t)}function fetchCountDown(e){const t=MinimogSettings.foxKitBaseUrl?`https://${MinimogSettings.foxKitBaseUrl}`:"";return new Promise(((i,s)=>{let o=`${t}/api/public/countdown?shop=${window.Shopify.shop}&collectionIds=${e}`;fetch(o).then((e=>e.json())).then(i).catch(s)}))}function loadAssetsNew(e=[],t,i=(()=>{}),s={}){const o=t||Math.random().toString(36).slice(2);window.MinimogLibs.loadjs.isDefined(t)||window.MinimogLibs.loadjs(e,o),window.MinimogLibs.loadjs.ready(o,i)}function pauseAllMedia(e=document){e.querySelectorAll(".js-youtube").forEach((e=>{e.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")})),e.querySelectorAll(".js-vimeo").forEach((e=>{e.contentWindow.postMessage('{"method":"pause"}',"*")})),e.querySelectorAll("video").forEach((e=>e.pause())),e.querySelectorAll("product-model").forEach((e=>{e.modelViewerUI&&e.modelViewerUI.pause()}))}function loadJS(e,t=document.body,i=!1,s=!0){return new Promise(((o,n)=>{const r=t.ownerDocument,a=r.querySelector(`script[src="${e}"]`);if(a)return a.dataset.loaded?o(!0):void a.addEventListener("load",(()=>{a.dataset.loaded=!0,o(!0)}));const l=r.createElement("script");l.src=e,l.async=i,l.defer=s,l.addEventListener("load",(()=>{l.dataset.loaded=!0,o(!0)})),l.onerror=n,t.appendChild(l)}))}function loadCSS(e,t=document.head){return new Promise(((i,s)=>{const o=t.ownerDocument,n=o.querySelector(`link[href="${e}"]`);if(n)return n.dataset.loaded?i(!0):void n.addEventListener("load",(()=>{n.dataset.loaded=!0,i(!0)}));const r=o.createElement("link");r.rel="stylesheet",r.href=e,r.addEventListener("load",(()=>{r.dataset.loaded=!0,i(!0)})),r.onerror=s,t.appendChild(r)}))}function addEventDelegate({context:e=document.documentElement,event:t="click",selector:i,handler:s,capture:o=!1}){const n=function(e){for(let t=e.target;t&&t!==this;t=t.parentNode)if(t.matches(i)){s.call(t,e,t);break}};return e.addEventListener(t,n,o),()=>{e.removeEventListener(t,n,o)}}function debounce(e,t){let i;return(...s)=>{clearTimeout(i),i=setTimeout((()=>e.apply(this,s)),t)}}function _validateOptionsArray(e){if(Array.isArray(e)&&"object"==typeof e[0])throw new Error(e+"is not a valid array of options.")}function _validateProductStructure(e){if("object"!=typeof e)throw new TypeError(e+" is not an object.");if(0===Object.keys(e).length&&e.constructor===Object)throw new Error(e+" is empty.")}function getVariantFromOptionArray(e,t){return _validateProductStructure(e),_validateOptionsArray(t),e.variants.filter((function(e){return t.every((function(t,i){return e.options[i]===t}))}))[0]||null}function getSizedImageUrl(e,t){if(null===t)return e;if("master"===t)return removeProtocol(e);var i=e.match(/\.(jpg|jpeg|gif|png|webp|bmp|bitmap|tiff|tif)(\?v=\d+)?$/i);if(i){var s=e.split(i[0]),o=i[0];return removeProtocol(s[0]+"_"+t+o)}return null}function removeProtocol(e){return e.replace(/http(s)?:/,"")}function updateParam(e,t){var{location:i}=window,s=[i.protocol,"//",i.host,i.pathname].join("");const o=window.location.search,n=new URLSearchParams(o);return n.has(e)?(""!==t&&"undefined"!==t&&n.set(e,t),""!==t&&"undefined"!==t||n.delete(e)):t&&n.append(e,t),window.history.replaceState({},"",s+"?"+n.toString()),!1}function createSearchLink(e){const t=new URLSearchParams({type:"product","options[unavailable_products]":"last","options[prefix]":"last",q:e});return`${window.MinimogSettings.routes.search_url}?${t.toString()}`}function refreshProductReview(){if("undefined"!=typeof SMARTIFYAPPS&&SMARTIFYAPPS.rv.installed&&SMARTIFYAPPS.rv.scmReviewsRate.actionCreateReviews(),"undefined"!=typeof Yotpo&&"function"==typeof Yotpo.API){const e=new Yotpo.API(yotpo);e?.refreshWidgets()}}function queryDomNodes(e={},t=document){return Object.entries(e).reduce(((e,[i,s])=>{const o="string"==typeof s,n=o?"querySelector":"querySelectorAll",r=o?s:s[0];return t&&(e[i]=t[n](r)),!o&&e[i]&&(e[i]=[...e[i]]),e}),{})}function saleProgress(e,t,i){const{total_quantity:s,sold_to:o,sold_from:n}=e;let r;if(i)r=parseInt(i);else{const e=o-n;let i=4/24+(Number(t.split("").pop())+1)/10;i>1&&(i-=1);r=n+Math.ceil(i*e)}const a=s-r;return`\n    <div class="m-product-sale-progress">\n      <div class="m-product-sale-progress__bar" data-flash-sale>\n        <span data-sale-progress style="width: ${100*r/s}%;" />\n      </div>\n      <div class="m-product-sale-progress__text">\n        <div>\n          <span>${MinimogStrings.sold}: </span>\n          <strong data-sale-number>${r||0}</strong>\n        </div>\n        <div>\n          <span>${MinimogStrings.available}: </span>\n          <strong data-available-number>${a||0}</strong>\n        </div>\n      </div>\n    </div>\n  `}function spinner(e=""){return`<svg class="animate-spin m:hidden m-svg-icon--medium ${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">\n    <circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>\n    <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>\n  </svg>`}function fetchConfig(e="json"){return{method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${e}`}}}function setCookie(e,t,i){var s=new Date;s.setTime(s.getTime()+24*i*60*60*1e3);var o="expires="+s.toUTCString();document.cookie=e+"="+t+";"+o+";path=/"}function getCookie(e){for(var t=e+"=",i=decodeURIComponent(document.cookie).split(";"),s=0;s<i.length;s++){for(var o=i[s];" "===o.charAt(0);)o=o.substring(1);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return""}function formatUrl(e,t,i){let s;const{routes:o}=MinimogSettings;return s=`${o.root.endsWith("/")?"":o.root}/${e}/${t}`,i&&(s+=`?${i}`),s}!function(){const e=document.querySelectorAll("[data-ps-item]");e&&e.forEach((e=>e.href=createSearchLink(e.dataset.psQuery)))}();class DeferredMedia extends HTMLElement{constructor(){super();const e=this.querySelector('[id^="Deferred-Poster-"]');e&&e.addEventListener("click",this.loadContent.bind(this))}loadContent(e=!0){if(!this.getAttribute("loaded")){const t=document.createElement("div");t.appendChild(this.querySelector("template").content.firstElementChild.cloneNode(!0)),this.setAttribute("loaded",!0);const i=this.appendChild(t.querySelector("video, model-viewer, iframe"));this.deferredElement=i,e&&i.focus(),this.playVideo(i)}}playVideo(e){if(!this.autoPlay)if(e.classList.contains("js-youtube")){const t=e.src.indexOf("?")>-1?"&":"?";e.src+=t+"autoplay=1&mute=1"}else if(e.classList.contains("js-vimeo")){const t=e.src.indexOf("?")>-1?"&":"?";e.src+=t+"autoplay=1&muted=1"}else e.setAttribute("autoplay","autoplay"),e.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.removeAttribute(""),this.classList.add("m-image-loaded"))}connectedCallback(){this.img.src="","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")}onLoad(){this.removeAttribute(""),this.classList.add("m-image-loaded")}observerCallback(e,t){e[0].isIntersecting&&(t.unobserve(this),this.loadImage())}initIntersectionObserver(){if(this.observer)return;this.observer=new IntersectionObserver(this.observerCallback,{rootMargin:"10px"}),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="true"===this.dataset.enableSlider,this.useScrollMobile="true"===this.dataset.useScrollMobile,this.itemsPerPage=this.dataset.itemsPerPage}connectedCallback(){"IntersectionObserver"in window&&new IntersectionObserver(((e,t)=>{e[0].isIntersecting&&(t.unobserve(this),fetch(this.dataset.url).then((e=>e.text())).then((e=>{const t=generateDomFromString(e).querySelector("product-recommendations");t&&t.innerHTML.trim().length&&(this.innerHTML=t.innerHTML,this.totalProducts=t.querySelectorAll(".m-product-card").length,this.initByScreenSize(),document.addEventListener("matchMobile",(()=>{this.initByScreenSize()})),document.addEventListener("unmatchMobile",(()=>{this.initByScreenSize()})))})).catch((e=>{})))}).bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}initByScreenSize(){const{gridContainer:e,slideControls:t}=queryDomNodes(this.selectors,this);if(MinimogTheme.config.mqlMobile){if(this.initSlider(),!this.useScrollMobile)return;e&&e.classList.remove("swiper-container"),t&&t.classList.add("m:hidden"),this.swiper&&this.swiper.destroy(!1,!0),e&&e.parentNode.classList.add("m-mixed-layout--mobile-scroll")}else e&&e.classList.add("swiper-container"),e&&e.parentNode.classList.remove("m-mixed-layout--mobile-scroll"),t&&t.classList.remove("m:hidden"),this.initSlider()}initSlider(){let e=this;const{gridContainer:t,slideControls:i}=queryDomNodes(this.selectors,this);if(this.enableSlider&&this.totalProducts>this.itemsPerPage){if(this.slider=new MinimogLibs.Swiper(t,{slidesPerView:2,loop:!0,autoplay:!1,threshold:2,breakpoints:{1280:{slidesPerView:this.itemsPerPage}},on:{init:function(){this.slideToLoop(this.lastActive),setTimeout((()=>{const t=e.querySelector(".m-image")||e.querySelector(".m-placeholder-svg"),s=i&&i.querySelector(".m-slider-controls__button-prev"),o=i&&i.querySelector(".m-slider-controls__button-next");if(t&&i){const e=t.clientHeight;i.style.setProperty("--offset-top",parseInt(e)/2+"px"),s.classList.remove("m:hidden"),o.classList.remove("m:hidden")}}),200)}}}),this.slider){i&&i.classList.remove("m:hidden");const e=this.querySelector(".m-slider-controls__button-prev"),t=this.querySelector(".m-slider-controls__button-next");e&&e.addEventListener("click",(()=>this.slider.slidePrev())),t&&t.addEventListener("click",(()=>this.slider.slideNext()))}this.swiper=t?.swiper}else{const e=t.querySelector(".m-mixed-layout__inner");e&&e.classList.remove("swiper-wrapper"),i&&i.classList.add("m:hidden"),t&&t.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="true"===this.dataset.autoPlay,this.muted="true"===this.dataset.muted;const e=this.querySelector('[id^="Deferred-Poster-"]');this.autoPlay?this.loadContent():e.addEventListener("click",this.loadContent.bind(this))}loadContent(){if(!this.getAttribute("loaded")){const e=document.createElement("div");e.appendChild(this.querySelector("template").content.firstElementChild.cloneNode(!0)),this.setAttribute("loaded",!0);const t=this.appendChild(e.querySelector("video, model-viewer, iframe"));if(this.deferredElement=t,this.autoPlay)return;if(this.deferredElement.classList.contains("js-youtube")){const e=this.deferredElement.src.indexOf("?")>-1?"&":"?";this.deferredElement.src+=e+"autoplay=1"+(this.muted?"&mute=1":"")}else if(this.deferredElement.classList.contains("js-vimeo")){const e=this.deferredElement.src.indexOf("?")>-1?"&":"?";this.deferredElement.src+=e+"autoplay=1"+(this.muted?"&mute=1":"")}else this.deferredElement.play()}}}),!customElements.get("collapsible-tab")){class e extends HTMLElement{constructor(){super()}connectedCallback(){this.init()}disconnectedCallback(){this.destroy()}init(){"true"===this.dataset.destroy||(this.setDefaultData(),this.attachEvents(),"true"===this.getAttribute("open")?(this.selected=!0,this.classList.add(this.expandedClass),this.setExpandedAria()):(this.content.style.height=this.collapsedHeight,this.classList.add(this.collapsedClass),this.setCollapsedAria()),this.content.removeAttribute("hidden"))}transitionendEventName(){let e,t=document.createElement("div"),i={transition:"transitionend",OTransition:"otransitionend",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in i)if(i.hasOwnProperty(e)&&void 0!==t.style[e])return i[e]}expand(){const e=(t=>{t.target===this.content&&(this.content.removeEventListener(this.transitionendevent,e),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")}))})))}).bind(this);this.content.addEventListener(this.transitionendevent,e),this.isOpen=!0,this.classList.remove(this.collapsedClass),this.content.style.height=this.content.scrollHeight+"px"}collapse(){const e=(t=>{t.target===this.content&&(this.content.removeEventListener(this.transitionendevent,e),this.isOpen||(this.fire("elementClosed"),this.setCollapsedAria(),this.classList.add(this.collapsedClass),this.trySetTabIndex(this.content,-1)))}).bind(this);this.content.addEventListener(this.transitionendevent,e),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"),this.expand(),this.setAttribute("open",!0)}close(){this.selected=!1,this.fire("elementUnselected"),this.collapse(),this.removeAttribute("open")}toggle(e){if(e.preventDefault(),this.selected)this.close();else if(this.open(),this.oneAtATime){const e=document.querySelectorAll("collapsible-tab"),t=this.closest("[data-first-level]");e.length&&e.forEach((e=>{e!==this&&e.selected&&t!==e&&e.close()}))}}trySetTabIndex(e,t){const i=e.querySelectorAll(this.defaultElements);i&&i.forEach((e=>{e.setAttribute("tabindex",t)}))}setExpandedAria(){this.trigger.setAttribute("aria-expanded","true"),this.content.setAttribute("aria-hidden","false")}setCollapsedAria(e){this.trigger.setAttribute("aria-expanded","false"),this.content.setAttribute("aria-hidden","true")}attachEvents(){this.trigger.addEventListener("click",(e=>this.toggle(e)))}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="true"===this.dataset.oneOpen)}fire(e){let t=this.events[e];if(t)for(let e=0;e<t.length;e++)t[e](this)}on(e,t){this.events[e]&&this.events[e].push(t)}destroy(){this.trigger.removeEventListener("click",(e=>this.toggle(e))),this.content.removeAttribute("aria-hidden"),this.content.style.height="auto",this.classList.remove(this.expandedClass,this.collapsedClass),this.removeAttribute("open")}}customElements.define("collapsible-tab",e)}if(!customElements.get("m-slideshow")){class e extends HTMLElement{constructor(){super()}connectedCallback(){this.autoplay="true"===this.dataset.autoplay,this.autoplaySpeed=parseInt(this.dataset.autoplaySpeed),this.showArrows="true"===this.dataset.enableArrows,this.showDots="true"===this.dataset.enableDots,this.adaptHeight="adapt"===this.dataset.slideHeight,this.id=this.dataset.id,this.sliderContainer=this.querySelector(".swiper-container"),this.lastVideo=null,this.lastActive=null,this.timeout=null,this.initSlider()}initSlider(){this.slider=new MinimogLibs.Swiper(this.sliderContainer,{init:!1,autoplay:!!this.autoplay&&{delay:1e3*this.autoplaySpeed,disableOnInteraction:!0},slidesPerView:1,slidesPerGroup:1,loop:!0,effect:"fade",fadeEffect:{crossFade:!0},speed:1e3,navigation:!!this.showArrows&&{nextEl:this.querySelector(".m-slider-controls__button-next"),prevEl:this.querySelector(".m-slider-controls__button-prev")},pagination:!!this.showDots&&{el:this.querySelector(".swiper-pagination"),clickable:!0,bulletClass:"m-dot",bulletActiveClass:"m-dot--active"},breakpoints:{992:{threshold:2}}}),this.lastSlide=null,this.currentSlide=null,this.slider&&this.slider.on("init",this.handleChange.bind(this)),this.slider&&this.slider.on("slideChange",this.handleChange.bind(this)),this.slider.init(),document.addEventListener("shopify:block:select",(e=>this.onBlockSelect(e)))}handleChange(e){const{activeIndex:t,slides:i}=e,s=i[t]&&i[t].dataset.slideType;if(this.lastActive&&this.slider.slideToLoop(this.lastActive),"video_slide"===s){const e=i[t]&&i[t].querySelector("video");if(e){let t=e.play();this.lastVideo&&this.lastVideo.pause(),void 0!==t&&t.then((()=>{this.lastVideo=e}))}}else this.lastVideo&&this.lastVideo.pause(),this.lastVideo=null}onBlockSelect(e){const t=e.target,i=Number(t.dataset.slide);this.lastActive=i,this.slider&&this.slider.slideToLoop(i)}}customElements.define("m-slideshow",e)}if(!customElements.get("m-testimonials")){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e,t;if(this.dataset.design&&(this.design=this.dataset.design),this.dataset.container&&(e=this.dataset.container),this.dataset.autoplay&&(t="true"===this.dataset.autoplay),this.container=this.closest(".m-testimonials"),!this.design)return;if(this.sliderContainer=this.querySelector(".swiper-container"),!this.sliderContainer)return void this.classList.add("opacity-100");this.defaultSettings={pagination:{el:this.container.querySelector(".swiper-pagination"),clickable:!0},navigation:{nextEl:this.container.querySelector(".m-slider-controls__button-next"),prevEl:this.container.querySelector(".m-slider-controls__button-prev")},autoplay:!!t&&{delay:5e3,pauseOnMouseEnter:!1},loop:!0,slidesPerView:1},this.settings={};let i=400;switch(this.design){case"testimonials-1":this.settings={centeredSlides:!0,slidesPerView:1,slidesPerGroup:1,spaceBetween:20,speed:300,slideToClickedSlide:!0,loop:!0,breakpoints:{768:{slidesPerView:3,slidesPerGroup:3,spaceBetween:20,speed:1e3},1280:{slidesPerView:5,slidesPerGroup:3,spaceBetween:30},2560:{slidesPerView:7,slidesPerGroup:3}}};break;case"testimonials-2":this.settings={slidesPerView:1,spaceBetween:30,breakpoints:{768:{slidesPerView:3,slidesPerGroup:3}}};break;case"testimonials-3":this.settings={slidesPerView:1,spaceBetween:30,breakpoints:{768:{slidesPerView:"w-full"===e?3:2}}};break;case"testimonials-4":"container-fluid"===e&&(i=200),"container"===e&&(i=150),this.settings={slidesPerView:1,centeredSlides:!0,slideToClickedSlide:!0,breakpoints:{768:{spaceBetween:parseInt(i/4),slidesPerView:3},992:{spaceBetween:i/2,slidesPerView:3},1920:{spaceBetween:i,slidesPerView:3}}};break;case"testimonials-6":this.settings={slidesPerView:1,loop:!0,pagination:"fraction"==this.dataset.paginationType?{el:this.container.querySelector(".swiper-pagination"),clickable:!0,type:"fraction"}:{el:this.container.querySelector(".swiper-pagination"),clickable:!0},breakpoints:{768:{slidesPerView:2},1366:{slidesPerView:"container"===e?2:3},1600:{slidesPerView:"container"===e?2:4}}};break;case"testimonials-5":this.settings={fade:{crossFade:!0}}}const s=this.querySelector(".m-tabs");if(s){const e=setInterval((()=>{MinimogTheme.Tabs&&(clearInterval(e),this.imagesTab=new MinimogTheme.Tabs(s))}),50)}this.initSlider()}initSlider(){this.slider=new MinimogLibs.Swiper(this.sliderContainer,{...this.defaultSettings,...this.settings,on:{init(){setTimeout((()=>{window.dispatchEvent(new Event("resize"))}),100)}}}),"testimonials-4"===this.design&&this.slider.on("activeIndexChange",(e=>{const{realIndex:t}=e;this.querySelector(".m-testimonial-index").innerHTML=parseInt(t)+1})),"testimonials-5"===this.design&&this.slider.on("slideChange",(e=>{const{realIndex:t}=e;this.imagesTab.setActiveTab(t)})),document.addEventListener("shopify:block:select",(e=>this.onBlockSelect(e)))}onBlockSelect(e){const t=e.target,i=Number(t.dataset.index);this.slider&&this.slider.slideToLoop(i)}}customElements.define("m-testimonials",e)}if(!customElements.get("m-collection-list")){class e extends HTMLElement{constructor(){super()}connectedCallback(){this.selectors={slideControls:".m-slider-controls",slideContainer:".m-mixed-layout__wrapper"},this.domNodes=queryDomNodes(this.selectors,this),this.enableSlider="true"===this.dataset.enableSlider,this.items=this.dataset.items,this.total=this.dataset.total,this.autoplay="true"===this.dataset.autoplay,this.autoplaySpeed=this.dataset.autoplaySpeed,this.paginationType=this.dataset.paginationType,this.expanded="true"===this.dataset.expanded,this.mobileDisableSlider="true"===this.dataset.mobileDisableSlider,this.initByScreenSize(),document.addEventListener("matchMobile",(()=>{this.initByScreenSize()})),document.addEventListener("unmatchMobile",(()=>{this.initByScreenSize()}))}initByScreenSize(){if(!this.enableSlider)return;const{slideContainer:e,slideControls:t}=queryDomNodes(this.selectors,this);MinimogTheme.config.mqlMobile&&this.mobileDisableSlider?(t?.classList.add("m:hidden"),e.classList.remove("swiper-container"),this.swiper&&this.swiper.destroy(!1,!0)):(t?.classList.remove("m:hidden"),this.initSlider())}initSlider(){const{slideContainer:e}=queryDomNodes(this.selectors,this);e?.classList.add("swiper-container");this.slider=new MinimogLibs.Swiper(e,{slidesPerView:2,loop:!0,slidesPerGroup:1,showNavigation:!0,showPagination:!0,parallax:!0,autoplay:!!this.autoplay&&{delay:1e3*parseInt(this.autoplaySpeed)},pagination:"fraction"==this.paginationType?{el:this.querySelector(".swiper-pagination"),clickable:!0,type:"fraction"}:{el:this.querySelector(".swiper-pagination"),clickable:!0,bulletClass:"m-dot",bulletActiveClass:"m-dot--active",renderBullet:function(e,t){return'<span class="'+t+'"><svg width="65px" height="65px" viewBox="0 0 72 72" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><circle class="time" stroke-width="5" fill="none" stroke-linecap="round" cx="33" cy="33" r="28"></circle></svg></span>'}},autoHeight:!0,breakpoints:{480:{slidesPerView:3},768:{slidesPerView:4},1280:{slidesPerView:this.expanded&&this.total>this.items?parseInt(this.items)+1:parseInt(this.items)}},on:{init(){setTimeout((()=>{window.dispatchEvent(new Event("resize"))}),100)}}});const t=this.querySelector(".m-slider-controls"),i=t&&t.querySelector(".m-slider-controls__button-prev"),s=t&&t.querySelector(".m-slider-controls__button-next");this.slider&&i&&s&&(i&&i.addEventListener("click",(()=>this.slider.slidePrev())),s&&s.addEventListener("click",(()=>this.slider.slideNext()))),this.swiper=e?.swiper}}customElements.define("m-collection-list",e)}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.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 t=validateForm(this.form.closest(".m-main-product--info"));t&&t.length>0&&(e.stopPropagation(),window.MinimogTheme.Notification.show({target:this.domNodes.errorWrapper,method:"appendChild",type:"warning",message:window.MinimogStrings.requiredField,delay:100}))}),!0)}toggleSpinner(e){const t=e?"add":"remove";this.classList[t]("m-spinner-loading")}onSubmitHandler(e){e.preventDefault(),this.toggleSpinner(!0);const t=validateForm(this.form.closest(".m-main-product--info"));if(t&&t.length>0)return this.toggleSpinner(!1),window.MinimogTheme.Notification.show({target:this.domNodes.errorWrapper,method:"appendChild",type:"warning",message:window.MinimogStrings.requiredField});const i=fetchConfig("javascript");i.headers["X-Requested-With"]="XMLHttpRequest",delete i.headers["Content-Type"];const s=new FormData(this.form);this.cart&&(s.append("sections",this.cart.getSectionsToRender().map((e=>e.id))),s.append("sections_url",window.location.pathname)),i.body=s;const{MinimogSettings:o,MinimogStrings:n}=window;fetch(`${o.routes.cart_add_url}`,i).then((e=>e.json())).then((e=>{if(e.status)return window.MinimogEvents.emit(MinimogTheme.pubSubEvents.cartError,{source:"product-form",productVariantId:s.get("id"),errors:e.description,message:e.message}),this.error=!0,window.MinimogTheme.Notification.show({target:this.domNodes.errorWrapper?this.domNodes.errorWrapper:document.body,method:"appendChild",type:"warning",message:e.message,last:3e3,sticky:!this.domNodes.errorWrapper});o.use_ajax_atc?this.cart&&o.enable_cart_drawer?(this.cart.renderContents(e),MinimogTheme.Notification.show({target:this.cart.querySelector("m-cart-drawer-items"),method:"prepend",type:"success",message:n.itemAdded,delay:400}),window.MinimogEvents.emit(MinimogTheme.pubSubEvents.openCartDrawer)):(window.MinimogTheme.Notification.show({target:this.domNodes.errorWrapper?this.domNodes.errorWrapper:document.body,method:"appendChild",type:"success",message:n.itemAdded,last:3e3,sticky:!this.domNodes.errorWrapper}),fetchJSON(window.Shopify.routes.root+"cart.json").then((e=>{if(e){const t=e.item_count;document.querySelectorAll(".m-cart-count-bubble").forEach((e=>{t>0?(e.textContent=t,e.classList.remove("m:hidden")):e.classList.add("m:hidden")}))}}))):window.location=o.routes.cart,this.error=!1,window.MinimogEvents.emit(MinimogTheme.pubSubEvents.cartUpdate,e)})).catch((e=>{})).finally((()=>{if(this.toggleSpinner(!1),this.cart){const e=this.cart.querySelector("m-cart-drawer-items");this.cart.classList.contains("m-cart--empty")&&this.cart.classList.remove("m-cart--empty"),e&&e.classList.contains("m-cart--empty")&&e.classList.remove("m-cart--empty")}this.cartPage&&this.cartPage.classList.contains("m-cart--empty")&&this.cartPage.classList.remove("m-cart--empty")}))}}),!customElements.get("m-press")){class e extends HTMLElement{constructor(){super(),this.prevSlideIndex=0}connectedCallback(){this.initSlider()}initSlider(){const e=this.querySelector(".m-press__content"),t=this.querySelector(".m-press__list .swiper-container"),i="true"===this.dataset.autoplay;this.items=parseInt(this.dataset.items),this.canLoop=window.innerWidth<1300?this.items>3:this.items>5,this.contentSlider=new MinimogLibs.Swiper(e,{slidesPerView:1,allowTouchMove:!1,fadeEffect:{crossFade:!0}}),this.navSlider=new MinimogLibs.Swiper(t,{autoplay:!!i&&{delay:5e3},items:1,loop:this.canLoop,centeredSlides:this.canLoop,threshold:2,pagination:{el:this.querySelector(".swiper-pagination"),clickable:!0},slideToClickedSlide:!0,breakpoints:{768:{slidesPerView:3,navigation:!1},1280:{slidesPerView:5,navigation:!1}},on:{init:function(e){const t=e.slides[e.activeIndex];t&&t.classList.add("m-press__logo--is-active")}}}),!this.canLoop&&this.navSlider.on("click",this._handleClick.bind(this)),this.navSlider.on("slideChange",this._handleChange.bind(this)),document.addEventListener("shopify:block:select",(e=>this.onBlockSelect(e)))}_handleChange(e){const{realIndex:t,activeIndex:i,slides:s}=e||{},o=this.querySelector('.m-press__logo--is-active[data-index="'+this.prevSlideIndex+'"]'),n=s[i];n&&n.classList.add("m-press__logo--is-active"),o&&o.classList.remove("m-press__logo--is-active"),this.contentSlider.slideTo(t),this.prevSlideIndex=t}_handleClick(e){const{clickedIndex:t,clickedSlide:i}=e||{},s=this.querySelector('.m-press__logo--is-active[data-index="'+this.prevSlideIndex+'"]');i&&i.classList.add("m-press__logo--is-active"),s&&s.classList.remove("m-press__logo--is-active"),this.contentSlider.slideTo(t),this.prevSlideIndex=t}onBlockSelect(e){const t=e.target,i=Number(t.dataset.index);this.contentSlider&&this.contentSlider.slideTo(i),this.navSlider&&this.navSlider.slideTo(i)}}customElements.define("m-press",e)}if(!customElements.get("m-featured-slider")){class e extends HTMLElement{constructor(){super(),this.selectors={sliderContainer:".m-featured-slider__products",slideImages:["m-featured-slider__img"],slideImagesContainer:".m-featured-slider__images",sliderControls:".m-slider-controls",prevBtn:".m-slider-controls__button-prev",nextBtn:".m-slider-controls__button-next"},this.domNodes=queryDomNodes(this.selectors,this)}connectedCallback(){this.initSlider()}initSlider(){const e="true"===this.dataset.showNavigation,t="true"===this.dataset.showPagination,i="true"===this.dataset.autoplay,s=this.dataset.timeout;this.slider=new MinimogLibs.Swiper(this.domNodes.sliderContainer,{speed:400,loop:!1,autoplay:!!i&&{delay:parseInt(s),disableOnInteraction:!1},pagination:!!t&&{el:this.querySelector(".swiper-pagination"),type:"bullets",clickable:!0},on:{init:()=>{e&&(this.domNodes.prevBtn&&this.domNodes.prevBtn.addEventListener("click",(()=>this.slider.slidePrev())),this.domNodes.nextBtn&&this.domNodes.nextBtn.addEventListener("click",(()=>this.slider.slideNext())))}}}),this.imageSlider=new MinimogLibs.Swiper(this.domNodes.slideImagesContainer,{speed:500,loop:!1,effect:"fade",fadeEffect:{crossFade:!0}}),this.slider.on("activeIndexChange",(e=>{const{realIndex:t,activeIndex:i}=e;this.imageSlider.slideTo(i)})),this.imageSlider.on("activeIndexChange",(e=>{const{realIndex:t,activeIndex:i}=e;this.slider.slideTo(i)})),Shopify.designMode&&document.addEventListener("shopify:block:select",(e=>this.onBlockSelect(e)))}onBlockSelect(e){const t=e.target,i=Number(t.dataset.index);this.slider&&this.slider.slideToLoop(i),this.imageSlider&&this.imageSlider.slideToLoop(i)}}customElements.define("m-featured-slider",e)}if(!customElements.get("m-scrolling-promotion")){class e extends HTMLElement{constructor(){super()}connectedCallback(){this.promotion=this.querySelector(".m-promotion"),this.init()}init(){if(1===this.childElementCount){this.promotion.classList.add("m-promotion--animated");for(let e=0;e<10;e++)this.clone=this.promotion.cloneNode(!0),this.clone.setAttribute("aria-hidden",!0),this.appendChild(this.clone);new IntersectionObserver(((e,t)=>{e.forEach((e=>{e.isIntersecting?this.scrollingPlay():this.scrollingPause()}))}),{rootMargin:"0px 0px 50px 0px"}).observe(this)}}scrollingPlay(){this.classList.remove("m-scrolling-promotion--paused")}scrollingPause(){this.classList.add("m-scrolling-promotion--paused")}}customElements.define("m-scrolling-promotion",e)}if(!customElements.get("m-featured-collection")){class e extends HTMLElement{constructor(){super()}connectedCallback(){this.selectors={loadMoreBtn:"[data-load-more]",loadMoreBtnWrapper:".m-featured-collection__button",productsContainer:"[data-products-container]",products:[".m-product-card"],soldNumber:["[data-sold-number]"],availableNumber:["[data-available-number]"],countDown:"[data-flashsale-countdown]",slideControls:".m-slider-controls",slideContainer:".m-mixed-layout__wrapper"},this.domNodes=queryDomNodes(this.selectors,this),this.buttonType=this.dataset.buttonType,this.infiniteLoad=this.dataset.infiniteLoad,this.enableSlider="true"===this.dataset.enableSlider,this.showPagination="true"===this.dataset.showPagination,this.showNavigation="true"===this.dataset.showNavigation,this.enableFlashsale="true"===this.dataset.enableFlashsale,this.enableCountdown="true"===this.dataset.enableCountdown,this.id=this.dataset.id,this.items=this.dataset.items,this.mobileDisableSlider="true"===this.dataset.mobileDisableSlider,this.initByScreenSize(),document.addEventListener("matchMobile",(()=>{this.initByScreenSize()})),document.addEventListener("unmatchMobile",(()=>{this.initByScreenSize()})),this.enableFlashsale&&this.initFlashSale(),this.canLoad=!0,this.currentPage=1,this.spinner=spinner(),this.enableSlider||"load"!==this.buttonType||"true"!==this.infiniteLoad||this.initInfiniteLoad(),this.enableSlider||"load"!==this.buttonType||this.initLoadMore(),MinimogTheme.config.mqlMobile&&this.mobileDisableSlider&&"load"===this.buttonType&&"true"===this.infiniteLoad&&this.initInfiniteLoad(),MinimogTheme.config.mqlMobile&&this.mobileDisableSlider&&"load"===this.buttonType&&this.initLoadMore(),document.addEventListener("matchMobile",(()=>{MinimogTheme.config.mqlMobile&&this.mobileDisableSlider&&"load"===this.buttonType&&this.initLoadMore(),MinimogTheme.config.mqlMobile&&this.mobileDisableSlider&&"load"===this.buttonType&&"true"===this.infiniteLoad&&this.initInfiniteLoad()}))}initByScreenSize(){if(!this.enableSlider)return;const{slideContainer:e,slideControls:t}=queryDomNodes(this.selectors,this);MinimogTheme.config.mqlMobile&&this.mobileDisableSlider?(t&&t.classList.add("m:hidden"),e&&e.classList.remove("swiper-container"),this.swiper&&this.swiper.destroy(!1,!0)):(t&&t.classList.remove("m:hidden"),this.initSlider())}initSlider(){const{slideContainer:e}=queryDomNodes(this.selectors,this),t=this.querySelector(".m-slider-controls"),i=t&&t.querySelector(".m-slider-controls__button-prev"),s=t&&t.querySelector(".m-slider-controls__button-next"),o=e.querySelector(".swiper-wrapper").childElementCount;e&&e.classList.add("swiper-container"),this.slider=new MinimogLibs.Swiper(e,{slidesPerView:2,showPagination:this.showPagination,showNavigation:this.showNavigation,loop:!this.enableFlashsale,pagination:!!this.showPagination&&{el:this.querySelector(".swiper-pagination"),clickable:!0},breakpoints:{768:{slidesPerView:parseInt(this.items)>=3?3:parseInt(this.items)},1024:{slidesPerView:parseInt(this.items)>=4?4:parseInt(this.items)},1280:{slidesPerView:parseInt(this.items)}},threshold:2,on:{init:()=>{setTimeout((()=>{const e=this.querySelector(".m-image")||this.querySelector(".m-placeholder-svg");if(e&&t){const o=e.clientHeight;t.style.setProperty("--offset-top",parseInt(o)/2+"px"),i.classList.remove("m:hidden"),s.classList.remove("m:hidden")}}),200)},breakpoint:(e,i)=>{if(t){const{slidesPerView:s}=i;o>s?(t.classList.remove("m:hidden"),e.allowTouchMove=!0):(t.classList.add("m:hidden"),e.allowTouchMove=!1)}}}}),this.slider&&this.showNavigation&&(i&&i.addEventListener("click",(()=>this.slider.slidePrev())),s&&s.addEventListener("click",(()=>this.slider.slideNext()))),this.swiper=e&&e.swiper}initLoadMore(){this.triggerLoad=!1,this.totalPages=parseInt(this.dataset.totalPages),addEventDelegate({context:this.container,selector:this.selectors.loadMoreBtn,handler:e=>{e.preventDefault(),this.handleLoadMore()}})}initInfiniteLoad(){const e=this.dataset.maxPages;window.addEventListener("scroll",(t=>{this.canLoad=this.currentPage<parseInt(e),this.canLoad&&this.offsetTop+this.clientHeight-window.innerHeight<window.scrollY&&!this.triggerLoad&&(this.triggerLoad=!0,this.handleLoadMore())}))}async handleLoadMore(){this.currentPage++,this.canLoad=this.currentPage<this.totalPages,this.toggleLoading(!0);const e=this.dataset.collectionId,t=await fetchCountDown(e);fetchCache(`${this.dataset.url}?page=${this.currentPage}&section_id=${this.id}`).then((e=>{this.toggleLoading(!1);const i=generateDomFromString(e).querySelector(this.selectors.productsContainer),s=this.domNodes.productsContainer.childElementCount;let o=!1;if(i&&Array.from(i.childNodes).forEach((e=>{this.domNodes.productsContainer.appendChild(e);const t=setInterval((()=>{this.domNodes.productsContainer.childElementCount>s&&(clearInterval(t),o=!0)}),50)})),this.enableFlashsale&&t.ok&&t.payload&&t.payload.length){const{expires_date:e}=t.payload[0];this.expires_date=e;const i=setInterval((()=>{if(o){clearInterval(i);this.domNodes.productsContainer.querySelectorAll(".m-product-card").forEach((e=>{const i=e.querySelector(".m-product-card__content");if(!e.querySelector(".m-product-sale-progress")){let s;e.dataset.soldNumber&&(s=e.dataset.soldNumber);const o=generateDomFromString(saleProgress(t.payload[0],e.dataset.productId,s));i.appendChild(o)}}))}}),50)}this.triggerLoad=!1,this.canLoad||this.domNodes.loadMoreBtn&&this.domNodes.loadMoreBtn.classList.add("m:hidden")}))}toggleLoading(e){this.domNodes.loadMoreBtn&&(e?this.domNodes.loadMoreBtn.classList.add("m-spinner-loading"):this.domNodes.loadMoreBtn.classList.remove("m-spinner-loading"))}async initFlashSale(){const e=this.dataset.collectionId,t=await fetchCountDown(e);if(t.ok&&t.payload&&t.payload.length){const{expires_date:e}=t.payload[0];this.expires_date=e,this.domNodes.products.forEach((e=>{const i=e.querySelector(".m-product-card__content"),s=e.querySelector(".m-product-sale-progress");let o;e.dataset.soldNumber&&(o=e.dataset.soldNumber);const n=generateDomFromString(saleProgress(t.payload[0],e.dataset.productId,o));s||i.appendChild(n)})),this.initCountDown()}}initCountDown(){const e=new Date(this.expires_date).getTime();this.countDownTimer=new CountdownTimer(this.domNodes.countDown,Date.now(),e,{loop:!0})}}customElements.define("m-featured-collection",e)}if(!customElements.get("m-banner-with-slide")){class e extends HTMLElement{constructor(){super()}connectedCallback(){this.lastActive=null,this.initSlider()}initSlider(){this.slider=new MinimogLibs.Swiper(`.m-slider-${this.dataset.id}`,{autoplay:"true"===this.dataset.autoplay&&{delay:this.dataset.timeout,disableOnInteraction:!0},slidesPerView:1,loop:!0,fadeEffect:{crossFade:!0},pagination:{el:this.querySelector(".swiper-pagination"),clickable:!0,bulletClass:"m-dot",bulletActiveClass:"m-dot--active"},on:{init:function(){this.slideToLoop(this.lastActive)}}}),document.addEventListener("shopify:block:select",(e=>this.onBlockSelect(e)))}onBlockSelect(e){const t=e.target,i=Number(t.dataset.slide);this.lastActive=i,this.slider&&this.slider.slideToLoop(i)}}customElements.define("m-banner-with-slide",e)}if(!customElements.get("m-brand-list")){class e extends HTMLElement{constructor(){super()}connectedCallback(){if(!("true"===this.dataset.enableSlider))return;const e=this.querySelector("[data-wrapper]");MinimogTheme.config.mqlMobile?(e.classList.add("swiper-wrapper"),this.initSlider()):(e.classList.remove("swiper-wrapper"),this.slider&&this.slider.destroy(!0,!0)),document.addEventListener("matchMobile",(()=>{e.classList.add("swiper-wrapper"),this.initSlider()})),document.addEventListener("unmatchMobile",(()=>{e.classList.remove("swiper-wrapper"),this.slider&&this.slider.destroy(!0,!0)}))}initSlider(){const e="true"===this.dataset.enableAutoplay,t=this.dataset.autoplaySpeed,i=parseInt(this.dataset.items),s=this.querySelector(".swiper-container");s&&(this.slider=new MinimogLibs.Swiper(s,{slidesPerView:i,slidesPerGroup:i,autoplay:!!e&&{delay:1e3*parseInt(t)},loop:!0,navigation:{nextEl:this.querySelector(".swiper-button-next"),prevEl:this.querySelector(".swiper-button-prev")},pagination:{el:this.querySelector(".swiper-pagination"),clickable:!0}}))}}customElements.define("m-brand-list",e)}if(!customElements.get("m-custom-content")){class e extends HTMLElement{constructor(){super(),this.selectors={cdtContainer:[".m-countdown-timer"],bundleError:".product-bundles__error",productBundles:[".product-bundles"],productVariantSelects:".m-product-option--dropdown-select",totalPrice:"[data-total-price]",submitBundle:"[data-add-bundle]",errorWrapper:".product-bundles__error",cartDrawer:"m-cart-drawer"},this.domNodes=queryDomNodes(this.selectors,this)}connectedCallback(){this.domNodes.productBundles&&this.initProductBundles()}initProductBundles(){this.domNodes.productBundles.length&&this.domNodes.productBundles.map((e=>{let t=[],i=[];const s=e.querySelectorAll(".product-bundles__item");for(let e of s){let s=e.nextElementSibling.innerHTML;s=JSON.parse(s),i.push(s),t.push(e),addEventDelegate({context:e,event:"change",selector:this.selectors.productVariantSelects,handler:i=>this._handleChangePrice(i,e,s,t)})}addEventDelegate({context:e,selector:this.selectors.submitBundle,handler:t=>this._handleAddItems(t,e)})}))}_handleChangePrice(e,t,i,s){const o=t.querySelector("[data-regular-price]");let n=t.querySelector("[data-compare-price]"),r=t.querySelector("[data-saved-price]"),a=t.querySelector(".product-bundles__save-price");const l=e.target.value,d=i.find((e=>e.id===parseInt(l)));o.innerHTML=formatMoney(d.price,MinimogSettings.money_format),o.dataset.price=d.price,d.compare_at_price&&d.compare_at_price>d.price?(n&&(n.classList.remove("m:hidden"),n.innerHTML=formatMoney(d.compare_at_price,MinimogSettings.money_format)),a&&a.classList.remove("m:hidden"),r&&(r.classList.remove("m:hidden"),r.innerHTML=formatMoney(d.compare_at_price-d.price,MinimogSettings.money_format))):(n&&n.classList.add("m:hidden"),a&&a.classList.add("m:hidden"),r&&r.classList.add("m:hidden"));const c=s.map((e=>{let t=e.nextElementSibling.innerHTML;t=JSON.parse(t);let i=e.querySelector('[name="id"]');if(t&&i)return t.find((e=>e.id===Number(i.value)))})).filter(Boolean),h=c.reduce(((e,t)=>e+t.price),0);t.closest(".product-bundles").querySelector(this.selectors.totalPrice).innerHTML=formatMoney(h,MinimogSettings.money_format)}_handleAddItems(e,t){e.preventDefault();const i=t.querySelectorAll('[name="id"]'),s=t.querySelector(this.selectors.errorWrapper),o=t.querySelector(this.selectors.submitBundle),n=document.querySelector(this.selectors.cartDrawer);let r={items:[...i].map((e=>e.value)).map((e=>({id:e,quantity:1})))};n&&(r={...r,sections:n.getSectionsToRender().map((e=>e.id)),sections_url:window.location.pathname});const a=fetchConfig("javascript");a.method="POST",a.body=JSON.stringify(r),this._toggleLoading(!0,o);const{MinimogSettings:l,MinimogStrings:d}=window;fetch(`${l.routes.cart_add_url}`,a).then((e=>e.json())).then((e=>{e.status?this._showError(e.description||"Failed to add all items to cart!",s):l.use_ajax_atc?(l.enable_cart_drawer?(n&&n.renderContents(e),MinimogTheme.Notification.show({target:n.querySelector("m-cart-drawer-items"),method:"prepend",type:"success",message:d.itemAdded,delay:400})):window.MinimogTheme.Notification.show({target:s||document.body,method:"appendChild",type:"success",message:d.itemAdded,last:3e3,sticky:!this.domNodes.errorWrapper}),window.MinimogEvents.emit(MinimogTheme.pubSubEvents.cartUpdate,e)):window.location=l.routes.cart})).catch((e=>{})).finally((()=>{if(this._toggleLoading(!1,o),n){const e=n.querySelector("m-cart-drawer-items");n.classList.contains("m-cart--empty")&&n.classList.remove("m-cart--empty"),e&&e.classList.contains("m-cart--empty")&&e.classList.remove("m-cart--empty")}}))}_showError(e,t){MinimogTheme.Notification.show({target:t,method:"appendChild",type:"warning",message:e})}_toggleLoading(e,t){e?t.classList.add("m-spinner-loading"):t.classList.remove("m-spinner-loading")}}customElements.define("m-custom-content",e)}if(!customElements.get("m-hero")){class e extends HTMLElement{constructor(){super()}connectedCallback(){const e=this.querySelector(".m-hero__bg");e&&("IntersectionObserver"in window?this._initIntersectionObserver(e):this._initBackground(e))}_initIntersectionObserver(e){const t=this;new IntersectionObserver(((e,i)=>{e[0].isIntersecting&&t._initBackground(e[0].target)}),{rootMargin:"10px"}).observe(e)}_initBackground(e){const t=e.dataset.src;t&&(e.style.backgroundImage="url("+t+")");"true"===this.dataset.parallax&&window.innerWidth>767&&this._initParallax(e)}_initParallax(e){const{MinimogThemeScripts:t}=window;loadAssetsNew([t.parallax],"parallax-module-hero",(()=>{new MinimogLibs.simpleParallax(e,{scale:1.3,delay:.6,transition:"cubic-bezier(0,0,0,1)"})}))}}customElements.define("m-hero",e)}if(!customElements.get("m-gmaps")){class e extends HTMLElement{constructor(){super(),this.mapElm=this.querySelector("#m-gmaps-inner"),this.mapAddress=this.mapElm.dataset.mapTitle,this.mapZoom=this.mapElm.dataset.mapZoom,this.mapX=this.mapElm.dataset.mapX,this.mapY=this.mapElm.dataset.mapY,this.key=this.mapElm.dataset.key,this.mapElm.dataset.key}connectedCallback(){this.prepMapApi()}prepMapApi(){this.loadScript().then(this.initMap.bind(this))}loadScript(){return new Promise(((e,t)=>{const i=document.createElement("script");document.body.appendChild(i),i.onload=e,i.onerror=t,i.async=!0,i.src="https://maps.googleapis.com/maps/api/js?key="+this.mapElm.dataset.key}))}initMap(){(new google.maps.Geocoder).geocode({address:this.mapAddress},((e,t)=>{if(t!==google.maps.GeocoderStatus.OK)Shopify.designMode;else{const e={zoom:parseInt(this.mapZoom),center:new google.maps.LatLng(this.mapX,this.mapY),draggable:!0,clickableIcons:!1,scrollwheel:!1,disableDoubleClickZoom:!0,disableDefaultUI:!0,styles:[{featureType:"water",elementType:"geometry",stylers:[{color:"#e9e9e9"},{lightness:17}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#f5f5f5"},{lightness:20}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#ffffff"},{lightness:17}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#ffffff"},{lightness:29},{weight:.2}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#ffffff"},{lightness:18}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#ffffff"},{lightness:16}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#f5f5f5"},{lightness:21}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#dedede"},{lightness:21}]},{elementType:"labels.text.stroke",stylers:[{visibility:"on"},{color:"#ffffff"},{lightness:16}]},{elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#333333"},{lightness:40}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#f2f2f2"},{lightness:19}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#fefefe"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#fefefe"},{lightness:17},{weight:1.2}]}]},t=new google.maps.Map(this.mapElm,e);new google.maps.Marker({map:t,position:new google.maps.LatLng(this.mapX,this.mapY),title:this.mapAddress}),google.maps.event.addDomListener(window,"resize",(function(){google.maps.event.trigger(t,"resize")}))}}))}}customElements.define("m-gmaps",e)}if(!customElements.get("m-countdown-timer")&&!customElements.get("m-countdown-timer")){class e extends HTMLElement{constructor(){super()}connectedCallback(){const e=this.dataset.time,t=Date.parse(e.split(" ").join("T"));t&&(new CountdownTimer(this,Date.now(),t),t>Date.now()&&(this.classList.remove("hidden"),this.classList.remove("m:hidden")))}}customElements.define("m-countdown-timer",e)}if(!customElements.get("m-image-comparison")){class e extends HTMLElement{constructor(){super(),this.active=!1,this.button=this.querySelector("button"),this.horizontal="horizontal"===this.dataset.layout,this.init(),this.hasAttribute("data-animation")&&MinimogTheme.initWhenVisible({element:this.querySelector(".m-image-comparison__slider-animation"),callback:this.animation.bind(this),threshold:0})}init(){this.button.addEventListener("touchstart",this.start.bind(this)),document.body.addEventListener("touchend",this.end.bind(this)),document.body.addEventListener("touchmove",this.onStart.bind(this)),this.button.addEventListener("mousedown",this.start.bind(this)),document.body.addEventListener("mouseup",this.end.bind(this)),document.body.addEventListener("mousemove",this.onStart.bind(this))}animation(){this.setAttribute("is-visible",""),this.classList.add("m-animating"),setTimeout((()=>{this.classList.remove("m-animating")}),1e3)}start(){document.documentElement.style.setProperty("overflow","hidden"),this.active=!0,this.classList.add("image-comparing")}end(){document.documentElement.style.removeProperty("overflow"),this.active=!1,this.classList.remove("image-comparing")}onStart(e){const t=document.querySelector(".m-topbar"),i=document.querySelector(".m-announcement-bar");let s=0,o=0;if(t&&(s=t.offsetHeight),i&&(o=i.offsetHeight),!this.active)return;const n=e.touches&&e.touches[0]||e,r=this.horizontal?n.pageX-this.offsetLeft:n.pageY-this.offsetTop-s-o;this.scroll(r)}scroll(e){const t=this.horizontal?this.clientWidth:this.clientHeight,i=t-20,s=100*Math.max(20,Math.min(e,i))/t;this.style.setProperty("--percent",s+"%")}}customElements.define("m-image-comparison",e)}if(!customElements.get("m-video-component")){class e extends HTMLElement{constructor(){super()}connectedCallback(){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()}}initYoutubeVideo(){this.setAsLoading(),this.loadScript("youtube").then(this.setupYoutubePlayer.bind(this))}initVimeoVideo(){this.setAsLoading(),this.loadScript("vimeo").then(this.setupVimeoPlayer.bind(this))}initMp4Video(){const e=this.querySelector("video");if(e){const t=e.play();void 0!==t&&t.then((function(){})).catch((function(){e.setAttribute("controls","")}))}}loadScript(e){return new Promise(((t,i)=>{const s=document.createElement("script");document.body.appendChild(s),s.onload=t,s.onerror=i,s.async=!0,s.src="youtube"===e?"//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 e=this.dataset.videoId,t=setInterval((()=>{window.YT&&window.YT.ready((()=>{const i=document.createElement("div");this.appendChild(i),this.player=new YT.Player(i,{videoId:e,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(t)}))}),50)}onYoutubeReady(){if(this.iframe=this.querySelector("iframe"),this.iframe.setAttribute("tabindex","-1"),this.player&&this.player.mute(),"function"==typeof this.player.playVideo&&this.player.playVideo(),this.setAsLoaded(),"IntersectionObserver"in window){new IntersectionObserver(((e,t)=>{e.forEach((e=>{e.isIntersecting?this.youtubePlay():this.youtubePause()}))}),{rootMargin:"0px 0px 50px 0px"}).observe(this.iframe)}}onYoutubeStateChange(e){switch(e.data){case-1:this.attemptedToPlay&&this.setAsLoaded();break;case 0:this.youtubePlay();break;case 1:this.setAsLoaded();break;case 3:this.attemptedToPlay=!0}}youtubePlay(){this.player&&"function"==typeof this.player.playVideo&&this.player.playVideo()}youtubePause(){this.player&&"function"==typeof this.player.pauseVideo&&this.player.pauseVideo()}setupVimeoPlayer(){const e=this.dataset.videoId,t=setInterval((()=>{window.Vimeo&&(this.player=new Vimeo.Player(this,{id:e,autoplay:!0,autopause:!1,background:!1,controls:!1,loop:!0,height:"100%",width:"100%"}),this.player.ready().then(this.onVimeoReady.bind(this)),clearInterval(t))}),50)}onVimeoReady(){this.iframe=this.querySelector("iframe"),this.iframe.setAttribute("tabindex","-1"),this.player.setMuted(!0),this.setAsLoaded();new IntersectionObserver(((e,t)=>{e.forEach((e=>{e.isIntersecting?this.vimeoPlay():this.vimeoPause()}))}),{rootMargin:"0px 0px 50px 0px"}).observe(this.iframe)}vimeoPlay(){this.player&&"function"==typeof this.player.play&&this.player.play()}vimeoPause(){this.player&&"function"==typeof this.player.pause&&this.player.pause()}}customElements.define("m-video-component",e)}if(!customElements.get("m-search-popup")){class e 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 e=document.querySelector("[data-search-popup]");if(!e)return;this.domNodes=queryDomNodes(this.selectors,e),this.domNodes.searchPopup=e,document.body.appendChild(e),addEventDelegate({selector:"[data-open-search-popup]",handler:()=>this.openSearchPopup()});const{input:t,submit:i,close:s,form:o}=this.domNodes;t&&t.addEventListener("keydown",(e=>{27===e.keyCode&&this.closeSearchPopup()})),i.addEventListener("click",(e=>{e.preventDefault(),t.value&&o.submit()})),s.addEventListener("click",(e=>{this.closeSearchPopup()})),e.addEventListener("click",(t=>{t.target===e&&this.closeSearchPopup()})),MinimogEvents.subscribe(MinimogTheme.pubSubEvents.openCartDrawer,(()=>{this.closeSearchPopup()}))}openSearchPopup(){const{searchPopup:e,input:t,container:i}=this.domNodes;e.style.removeProperty("visibility"),e.style.setProperty("opacity","1"),i.classList.add("m-show-search"),setTimeout((()=>{i.style.removeProperty("--m-durations"),t.focus()}),350),MinimogEvents.emit(MinimogTheme.pubSubEvents.openSearchPopup,this)}closeSearchPopup(){const{searchPopup:e,container:t}=this.domNodes;t.classList.remove("m-show-search"),e.style.setProperty("opacity","0"),setTimeout((()=>{e.style.setProperty("visibility","hidden"),t.style.setProperty("--m-durations",".3s")}),350)}}customElements.define("m-search-popup",e)}if(!customElements.get("m-icon-box")){class e extends HTMLElement{constructor(){super(),this.enableSlider="true"===this.dataset.enableSlider,this.items=this.dataset.items,this.showPagination="true"===this.dataset.showPagination,this.showNavigation="true"===this.dataset.showNavigation,this.slideContainer=this.querySelector(".swiper-container")}connectedCallback(){this.lastActive=null,this.enableSlider&&this.initSlider()}initSlider(){const e=this.querySelector(".m-slider-controls"),t=e&&e.querySelector(".m-slider-controls__button-prev"),i=e&&e.querySelector(".m-slider-controls__button-next"),s=this.querySelector(".swiper-wrapper").childElementCount;let o=this;this.slider=new MinimogLibs.Swiper(this.slideContainer,{slidesPerView:1,navigation:this.showNavigation,loop:!0,pagination:!!this.showPagination&&{el:this.querySelector(".swiper-pagination"),clickable:!0},breakpoints:{480:{slidesPerView:2},768:{slidesPerView:parseInt(this.items)-1},1280:{slidesPerView:parseInt(this.items)}},on:{init:function(){this.slideToLoop(this.lastActive),setTimeout((()=>{const s=o.querySelector(".m-image")||o.querySelector(".m-placeholder-svg");if(s&&e){const o=s.clientHeight;e.style.setProperty("--offset-top",parseInt(o)/2+"px"),t.classList.remove("m:hidden"),i.classList.remove("m:hidden")}}),200)},breakpoint:(t,i)=>{if(e){const{slidesPerView:o}=i;s>o?(e.classList.remove("m:hidden"),t.allowTouchMove=!0):(e.classList.add("m:hidden"),t.allowTouchMove=!1)}}}}),this.slider&&this.showNavigation&&(t&&t.addEventListener("click",(()=>this.slider.slidePrev())),i&&i.addEventListener("click",(()=>this.slider.slideNext()))),document.addEventListener("shopify:block:select",(e=>this.onBlockSelect(e)))}onBlockSelect(e){const t=e.target,i=Number(t.dataset.slide);this.lastActive=i,this.slider&&this.slider.slideToLoop(i)}}customElements.define("m-icon-box",e)}if(!customElements.get("m-handpicked-products")){class e extends HTMLElement{constructor(){super()}connectedCallback(){this.selectors={products:[".m-product-card"],slideContainer:"[data-products-container]",sliderControls:".m-slider-controls"},this.domNodes=queryDomNodes(this.selectors,this),this.enableSlider="true"===this.dataset.enableSlider,this.showPagination="true"===this.dataset.showPagination,this.showNavigation="true"===this.dataset.showNavigation,this.paginationType=this.dataset.paginationType||"bullets",this.useScrollMobile="true"===this.dataset.useScrollMobile,this.items=this.dataset.items,this.enableSlider&&(this.useScrollMobile?(MinimogTheme.config.mqlMobile?(this.slider&&this.slider.destroy(!0,!0),this.domNodes.slideContainer.classList.remove("swiper-container"),this.domNodes.sliderControls.classList.add("m:hidden")):(this.domNodes.slideContainer.classList.add("swiper-container"),this.domNodes.sliderControls.classList.remove("m:hidden"),this.initSlider()),document.addEventListener("matchMobile",(()=>{this.slider&&this.slider.destroy(!0,!0),this.domNodes.slideContainer.classList.remove("swiper-container"),this.domNodes.sliderControls.classList.add("m:hidden")})),document.addEventListener("unmatchMobile",(()=>{this.domNodes.slideContainer.classList.add("swiper-container"),this.domNodes.sliderControls.classList.remove("m:hidden"),this.initSlider()}))):this.initSlider())}initSlider(){const e=this.querySelector(".m-slider-controls"),t=e&&e.querySelector(".m-slider-controls__button-prev"),i=e&&e.querySelector(".m-slider-controls__button-next"),s=this.domNodes.slideContainer.querySelector(".swiper-wrapper").childElementCount;this.slider=new MinimogLibs.Swiper(this.domNodes.slideContainer,{slidesPerView:2,showPagination:this.showPagination,showNavigation:this.showNavigation,loop:!1,pagination:!!this.showPagination&&{el:this.querySelector(".swiper-pagination"),clickable:!0,type:this.paginationType},navigation:{nextEl:i&&i,prevEl:t&&t},breakpoints:{480:{slidesPerView:parseInt(this.items)>=3?3:parseInt(this.items)},768:{slidesPerView:parseInt(this.items)>=4?4:parseInt(this.items)},1280:{slidesPerView:parseInt(this.items)}},threshold:2,on:{breakpoint:(t,i)=>{if(e){const{slidesPerView:o}=i;s>o?(e.classList.remove("m:hidden"),t.allowTouchMove=!0):(e.classList.add("m:hidden"),t.allowTouchMove=!1)}}}})}}customElements.define("m-handpicked-products",e)}if(!customElements.get("m-lookbook-slider")){class e extends HTMLElement{constructor(){super()}connectedCallback(){this.selectors={lookbookSlider:".m-lookbook-slider__inner",lookbookIcons:[".m-lookbook-icon"]},this.domNodes=queryDomNodes(this.selectors,this),this.enableSlider="true"===this.domNodes.lookbookSlider.dataset.enableSlider,this.showPagination="true"===this.domNodes.lookbookSlider.dataset.showPagination,this.showNavigation="true"===this.domNodes.lookbookSlider.dataset.showNavigation,this.paginationType=this.domNodes.lookbookSlider.dataset.paginationType||"bullets",this.items=this.domNodes.lookbookSlider.dataset.items,this.slideContainer=this.domNodes.lookbookSlider.querySelector(".swiper-container"),this.enableSlider&&this.initSlider(),Array.from(this.domNodes.lookbookIcons).forEach((e=>{e.addEventListener("mouseover",this.onMouseOver.bind(this)),e.addEventListener("mouseleave",this.onMouseLeave.bind(this))}))}disconnectedCallback(){Array.from(this.domNodes.lookbookIcons).forEach((e=>{e.removeEventListener("mouseover",this.onMouseOver.bind(this)),e.removeEventListener("mouseleave",this.onMouseLeave.bind(this))}))}initSlider(){const e=this.domNodes.lookbookSlider.querySelector(".m-slider-controls"),t=e&&e.querySelector(".m-slider-controls__button-prev"),i=e&&e.querySelector(".m-slider-controls__button-next"),s=this.slideContainer.querySelector(".swiper-wrapper").childElementCount;let o={slidesPerView:1,showPagination:this.showPagination,showNavigation:this.showNavigation,loop:!0,pagination:!!this.showPagination&&{el:this.domNodes.lookbookSlider.querySelector(".swiper-pagination"),clickable:!0,type:this.paginationType},breakpoints:{1280:{slidesPerView:s<this.items?s:parseInt(this.items)}},threshold:2,on:{slideChange:e=>{const t=e.realIndex;Array.from(this.domNodes.lookbookIcons).forEach((e=>e.classList.remove("is-active"))),this.domNodes.lookbookIcons[t]&&this.domNodes.lookbookIcons[t].classList.add("is-active")}}};s<this.items&&(o.simulateTouch=!1,o.allowTouchMove=!1),this.slider=new MinimogLibs.Swiper(this.slideContainer,o),this.slider&&this.showNavigation&&(t&&t.addEventListener("click",(()=>this.slider.slidePrev())),i&&i.addEventListener("click",(()=>this.slider.slideNext())))}onMouseOver(e){const t=Number(e.target.closest(".m-lookbook-icon").dataset.index);e.target.dataset.index&&this.slider&&this.slider.slideToLoop(t);const i=this.domNodes.lookbookSlider.querySelectorAll(`[data-swiper-slide-index="${t}"]`);Array.from(i).forEach((e=>e.querySelector(".m-product-card").classList.add("is-active"))),this.domNodes.lookbookIcons[t].classList.add("is-active"),this.classList.add("is-hovering")}onMouseLeave(e){Array.from(this.slider.slides).forEach((e=>e.querySelector(".m-product-card").classList.remove("is-active"))),Array.from(this.domNodes.lookbookIcons).forEach((e=>e.classList.remove("is-active"))),this.classList.remove("is-hovering")}}customElements.define("m-lookbook-slider",e)}if(!customElements.get("favorite-product-slider")){class e extends HTMLElement{constructor(){super()}connectedCallback(){this.selectors={mainImages:".m-favorite-product-slider__images",thumbs:".m-favorite-product-slider__thumbs"},this.domNodes=queryDomNodes(this.selectors,this),this.mediaSize=parseInt(this.dataset.mediaSize),this.mainImagesContainer=this.domNodes.mainImages.querySelector(".swiper-container"),this.thumbsContainer=this.domNodes.thumbs.querySelector(".swiper-container"),this.initSlider()}initSlider(){this.initMainImagesSlider(),this.initThumbsSlider(),this.thumbsSlider.on("slideChange",(e=>{const{realIndex:t}=e;let i=t-1;i<0&&(i=this.mediaSize-1),this.mainImagesSlider.slideToLoop(i)})),this.mainImagesSlider.on("slideChange",(e=>{const{slides:t,realIndex:i}=e;let s=i+1;s>this.mediaSize&&(s=0),this.playActiveMedia(t[s])}))}initMainImagesSlider(){const e=this.domNodes.mainImages.querySelector(".m-slider-controls"),t=e&&e.querySelector(".m-slider-controls__button-prev"),i=e&&e.querySelector(".m-slider-controls__button-next");this.mainImagesSlider=new MinimogLibs.Swiper(this.mainImagesContainer,{slidesPerView:1,showPagination:!0,showNavigation:!0,loop:!0,pagination:{el:this.domNodes.mainImages.querySelector(".swiper-pagination"),clickable:!0,type:"fraction"},autoplay:!1,threshold:2,effect:"fade",fadeEffect:{crossFade:!0},breakpoints:{768:{simulateTouch:!1,allowTouchMove:!1,showPagination:!1,showNavigation:!1}},simulateTouch:!0,allowTouchMove:!0}),this.mainImagesSlider&&(t&&t.addEventListener("click",(()=>this.mainImagesSlider.slidePrev())),i&&i.addEventListener("click",(()=>this.mainImagesSlider.slideNext())))}initThumbsSlider(){const e=this.domNodes.thumbs.querySelector(".m-slider-controls"),t=e&&e.querySelector(".m-slider-controls__button-prev"),i=e&&e.querySelector(".m-slider-controls__button-next"),s=this.domNodes.thumbs.querySelector(".swiper-wrapper").childElementCount;this.thumbsSlider=new MinimogLibs.Swiper(this.thumbsContainer,{initialSlide:s>1?1:0,slidesPerView:2==s?1:2,showPagination:!0,showNavigation:!0,loop:!0,autoplay:!1,pagination:{el:this.domNodes.thumbs.querySelector(".swiper-pagination"),clickable:!0,type:"fraction"},spaceBetween:15,breakpoints:{1024:{spaceBetween:30}},threshold:2,on:{init(){setTimeout((()=>{window.dispatchEvent(new Event("resize"))}),100)}}}),this.thumbsSlider&&(t&&t.addEventListener("click",(()=>this.thumbsSlider.slidePrev())),i&&i.addEventListener("click",(()=>this.thumbsSlider.slideNext())))}playActiveMedia(e){const t=e.querySelector(".deferred-media");if(t){"true"===t.dataset.autoPlay&&t.loadContent(!1)}}}customElements.define("favorite-product-slider",e)}if(!customElements.get("m-select-component")){class e 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:e}=this.domNodes,t=e.options[e.selectedIndex].value,i=e.options[e.selectedIndex].text;this.updateCustomSelectChecked(t,i)}initSelect(){this.classList.remove("m:hidden");const{elSelectNative:e,elSelectCustom:t,elSelectCustomBox:i}=this.domNodes;i.addEventListener("click",(()=>{!t.classList.contains("isActive")?this.openSelect():this.closeSelect()})),this.domNodes.customOptionList.forEach((t=>{t.addEventListener("click",(t=>{const i=t.target.getAttribute("data-value");e.value=i,this.closeSelect(),this.updateCustomSelectChecked(i,t.target.textContent),e.dispatchEvent(new Event("change")),e.dispatchEvent(new Event("click"))}))}))}openSelect(){const e=document.querySelectorAll("m-select-component");document.addEventListener("click",(e=>this.handleClickOutside(e))),e.length>0&&e.forEach((e=>{e.closeSelect()})),this.domNodes.elSelectCustom.classList.add("isActive")}closeSelect(){this.domNodes.elSelectCustom.classList.remove("isActive")}updateCustomSelectChecked(e,t){const{elSelectCustomOpts:i,elSelectCustomTriggerText:s}=this.domNodes,o=this.optionChecked,n=i.querySelector(`[data-value="${o}"`),r=i.querySelector(`[data-value="${e}"`);n&&n.classList.remove("isActive"),r&&r.classList.add("isActive"),s.textContent=t,this.optionChecked=e}handleClickOutside(e){const{elSelectCustom:t}=this.domNodes;!t.contains(e.target)&&this.closeSelect()}}customElements.define("m-select-component",e)}if(!customElements.get("m-product-tabs")){class e extends HTMLElement{constructor(){super(),this.selectors={loadMoreBtn:"[data-load-more-product]",productsContainer:"[data-products-container]",tabContent:[".m-tab-content"]},this.tabSliders=[],this.sliderEnabled="true"===this.dataset.enableSlider,this.mobileSliderDisable="true"===this.dataset.mobileDisableSlider,this.buttonType=this.dataset.buttonType,this.domNodes=queryDomNodes(this.selectors,this),this.showPagination="true"===this.dataset.showPagination,this.showNavigation="true"===this.dataset.showNavigation,this.items=this.dataset.items}connectedCallback(){this.init()}init(){if(this.sliderEnabled)for(let e of this.domNodes.tabContent)this.initSliderByScreenSize(e),document.addEventListener("matchMobile",(()=>{this.initSliderByScreenSize(e)})),document.addEventListener("unmatchMobile",(()=>{this.initSliderByScreenSize(e)}));if(!this.sliderEnabled&&"load"===this.buttonType){this.canLoad=!0,this.currentPage=1;for(let e of this.domNodes.tabContent)this.initLoadMore(e)}if(MinimogTheme.config.mqlMobile&&this.mobileSliderDisable&&"load"===this.buttonType){this.canLoad=!0,this.currentPage=1;for(let e of this.domNodes.tabContent)this.initLoadMore(e)}document.addEventListener("matchMobile",(()=>{if(MinimogTheme.config.mqlMobile&&this.mobileSliderDisable&&"load"===this.buttonType){this.canLoad=!0,this.currentPage=1;for(let e of this.domNodes.tabContent)this.initLoadMore(e)}})),this.initTabs(),this.initMobileSelect(),Shopify.designMode&&document.addEventListener("shopify:block:select",(e=>{if(!e.target.classList.contains("m-tab-content"))return;const t=e.target&&e.target.dataset.index;this.tabs.setActiveTab(t)}))}initTabs(){this.tabs=new MinimogTheme.Tabs(this,(e=>{const t=e.getAttribute("href"),i=this.querySelector(t+" .swiper-container"),s=this.querySelector(t+" .m-slider-controls");i&&i.swiper.update();const o=i&&(i.querySelector(".m-image")||i.querySelector(".m-placeholder-svg"));if(o&&s){const e=o.clientHeight;s.style.setProperty("--offset-top",parseInt(e)/2+"px")}}))}initSliderByScreenSize(e){const t="true"===this.dataset.mobileDisableSlider,i=e.querySelector(".m-mixed-layout__wrapper"),s=e.querySelector(".m-slider-controls");MinimogTheme.config.mqlMobile&&t?(s&&s.classList.add("m:hidden"),i.classList.remove("swiper-container"),i.swiper&&i.swiper.destroy(!1,!0)):(s&&s.classList.remove("m:hidden"),setTimeout((()=>{this.initSlider(e)})))}initSlider(e){const t=e&&e.querySelector(".m-mixed-layout__wrapper"),i=e.querySelector(".m-slider-controls"),s=i&&i.querySelector(".m-slider-controls__button-prev"),o=i&&i.querySelector(".m-slider-controls__button-next"),n=e&&e.querySelector(".swiper-wrapper")&&e.querySelector(".swiper-wrapper").childElementCount;if(parseInt(this.items)>=n)return;t&&t.classList.add("swiper-container");let r=new MinimogLibs.Swiper(t,{slidesPerView:2,showPagination:this.showPagination,showNavigation:this.showNavigation,loop:!this.enableFlashsale,pagination:!!this.showPagination&&{el:e.querySelector(".swiper-pagination"),clickable:!0},breakpoints:{768:{slidesPerView:parseInt(this.items)>=3?3:parseInt(this.items)},992:{slidesPerView:parseInt(this.items)>=4?4:parseInt(this.items)},1280:{slidesPerView:parseInt(this.items)}},threshold:2,on:{init:function(){setTimeout((()=>{const t=e.querySelector(".m-image")||e.querySelector(".m-placeholder-svg");if(t&&i){const e=t.clientHeight;i.style.setProperty("--offset-top",parseInt(e)/2+"px"),s.classList.remove("m:hidden"),o.classList.remove("m:hidden")}}),200)},breakpoint:(e,t)=>{if(i){const{slidesPerView:s}=t;n>s?(i.classList.remove("m:hidden"),e.allowTouchMove=!0):(i.classList.add("m:hidden"),e.allowTouchMove=!1)}}}});r&&this.showNavigation&&(s&&s.addEventListener("click",(()=>r.slidePrev())),o&&o.addEventListener("click",(()=>r.slideNext())))}initMobileSelect(){this.select=this.querySelector("[data-tab-select]"),this.select.addEventListener("change",(()=>{this.tabs.setActiveTab(parseInt(this.select.value));const e=this.tabs&&this.tabs.currentTab&&this.tabs.currentTab.querySelector(".swiper-container"),t=this.tabs&&this.tabs.currentTab&&this.tabs.currentTab.querySelector(".m-slider-controls");e&&e.swiper.update();const i=e&&e.querySelector(".m-image");if(i){const e=i.clientHeight;t.style.setProperty("--offset-top",parseInt(e)/2+"px"),prevButton.classList.remove("m:hidden"),nextButton.classList.remove("m:hidden")}}))}initLoadMore(e){addEventDelegate({context:e,selector:this.selectors.loadMoreBtn,handler:t=>{t.preventDefault(),this.handleLoadMore(e)}})}handleLoadMore(e){const t=e.querySelector(this.selectors.loadMoreBtn),i=e.querySelector(this.selectors.productsContainer);let s=e.dataset.page;s=parseInt(s);const o=e.dataset.totalPages;this.toggleLoading(t,!0);fetchCache(`${e.dataset.url}?page=${s+1}&section_id=${this.id}`).then((n=>{s++,e.dataset.page=s,this.toggleLoading(t,!1);const r=generateDomFromString(n),a=e.getAttribute("id"),l=r.querySelector(`#${a} ${this.selectors.productsContainer}`);l&&Array.from(l.childNodes).forEach((e=>i.appendChild(e))),s>=parseInt(o)&&t&&t.remove()})),t.blur()}toggleLoading(e,t){e&&(t?e.classList.add("m-spinner-loading"):e.classList.remove("m-spinner-loading"))}}customElements.define("m-product-tabs",e)}if(!customElements.get("m-product-details-tabs")){class e extends HTMLElement{constructor(){super(),this.tabs=new MinimogTheme.Tabs(this),Shopify.designMode&&document.addEventListener("shopify:block:select",(e=>{const t=e&&e.target,i=t&&Number(t.dataset.index)||0;this.tabs&&this.tabs.setActiveTab(i)}))}}customElements.define("m-product-details-tabs",e)}if(!customElements.get("m-instagram")){class e extends HTMLElement{constructor(){super(),this.init()}init(){const{MinimogThemeScripts:e}=window,{accessToken:t,imagesCount:i}=this.dataset;t&&loadAssetsNew([e.instagram],"instagram-module",(()=>{new MinimogTheme.Instagram(this,t,i)}))}}customElements.define("m-instagram",e)}if(!customElements.get("m-aside-instagram")){class e extends HTMLElement{constructor(){super()}connectedCallback(){const e=this.querySelector(".m-aside-instagram");if(e){const{accessToken:t,imagesCount:i}=e.dataset;if(t){const{MinimogThemeScripts:s}=window;loadAssetsNew([s.instagram],"instagram-module-blog",(()=>{new MinimogTheme.Instagram(e,t,i)}))}}}}customElements.define("m-aside-instagram",e)}class MQuantityInput extends HTMLElement{constructor(){super(),this.init()}init(){this.input=this.querySelector("input"),this.changeEvent=new Event("change",{bubbles:!0}),this.input.addEventListener("change",this.onInputChange.bind(this)),this.querySelectorAll("button").forEach((e=>e.addEventListener("click",this.onButtonClick.bind(this)))),this.quantityUpdateUnsubscriber=void 0}onInputChange(e){this.validateQtyRules()}onButtonClick(e){e.preventDefault();const t=this.input.value;"plus"===e.target.closest("button").name?this.input.stepUp():this.input.stepDown(),t!==this.input.value&&this.input.dispatchEvent(this.changeEvent)}validateQtyRules(){const e=parseInt(this.input.value);if(this.input.min){const t=parseInt(this.input.min);this.querySelector(".m-quantity__button[name='minus']").classList.toggle("m:disabled",e<=t)}if(this.input.max){const t=parseInt(this.input.max);this.querySelector(".m-quantity__button[name='plus']").classList.toggle("m:disabled",e>=t)}}}customElements.define("m-quantity-input",MQuantityInput);var fader=document.querySelector(".m-page-transition");function __fadeInPage(){if(!window.AnimationEvent||!fader)return;let e=!1;document.querySelectorAll("a[href^=mailto], a[href^=tel]").forEach((t=>{t.addEventListener("click",(()=>{e=!0}))})),window.addEventListener("beforeunload",(()=>{e||fader.classList.add("fade-in")})),window.addEventListener("DOMContentLoaded",(()=>{document.documentElement.classList.remove("m:overflow-hidden"),document.body.classList.remove("m:overflow-hidden"),setTimeout((()=>{fader.classList.add("fade-out")}),300),document.dispatchEvent(new CustomEvent("page:loaded"))})),window.addEventListener("pageshow",(e=>{e.persisted&&fader.classList.remove("fade-in")}))}__fadeInPage();
Leave a Comment