window.theme=window.theme||{},theme.Currency=function(){var n="${{amount}}";function t(e,a){typeof e=="string"&&(e=e.replace(".",""));var r="",u=/\{\{\s*(\w+)\s*\}\}/,h=a||n;function i(o,l,c,s){if(c=c||",",s=s||".",isNaN(o)||o===null)return 0;o=(o/100).toFixed(l);var d=o.split("."),p=d[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+c),_=d[1]?s+d[1]:"";return p+_}switch(h.match(u)[1]){case"amount":r=i(e,2);break;case"amount_no_decimals":r=i(e,0);break;case"amount_with_comma_separator":r=i(e,2,".",",");break;case"amount_no_decimals_with_comma_separator":r=i(e,0,".",",");break;case"amount_no_decimals_with_space_separator":r=i(e,0," ");break;case"amount_with_apostrophe_separator":r=i(e,2,"'");break}return h.replace(u,r)}return{formatMoney:t}}(),window.dT_slate=window.dT_slate||{},dT_slate.Variants=function(){function n(t){this.container=t.container,this.product=t.product,this.originalSelectorId=t.originalSelectorId,this.enableHistoryState=t.enableHistoryState,this.singleOptions=this.container.querySelectorAll(t.singleOptionSelector),this.currentVariant=this._getVariantFromOptions(),this.singleOptions.forEach(function(e){e.addEventListener("change",this._onSelectChange.bind(this))}.bind(this))}return n.prototype=Object.assign({},n.prototype,{_getCurrentOptions:function(){var t=[];return this.singleOptions.forEach(function(e){var a=e.getAttribute("type"),r=a==="radio"||a==="checkbox";(!r||e.checked)&&t.push({value:e.value,index:e.getAttribute("data-index")})}),t},_getVariantFromOptions:function(){var t=this._getCurrentOptions(),e=this.product.variants,a=e.find(function(r){return t.every(function(u){return r[u.index]===u.value})});return a},_onSelectChange:function(){var t=this._getVariantFromOptions(),e=this.product;this.container.dispatchEvent(new CustomEvent("variantChange",{detail:{variant:t,product:e},bubbles:!0,cancelable:!0})),t&&(this._updateMasterSelect(t,e),this._updateImages(t,e),this._updatePrice(t,e),this._updateSKU(t,e),this.currentVariant=t,this.enableHistoryState&&this._updateHistoryState(t,e))},_updateImages:function(t,e){var a=t.featured_image||{},r=this.currentVariant.featured_image||{};!t.featured_image||a.src===r.src||this.container.dispatchEvent(new CustomEvent("variantImageChange",{detail:{variant:t,product:e},bubbles:!0,cancelable:!0}))},_updatePrice:function(t,e){t.price===this.currentVariant.price&&t.compare_at_price===this.currentVariant.compare_at_price&&t.unit_price===this.currentVariant.unit_price||this.container.dispatchEvent(new CustomEvent("variantPriceChange",{detail:{variant:t,product:e},bubbles:!0,cancelable:!0}))},_updateSKU:function(t,e){t.sku!==this.currentVariant.sku&&this.container.dispatchEvent(new CustomEvent("variantSKUChange",{detail:{variant:t,product:e},bubbles:!0,cancelable:!0}))},_updateHistoryState:function(t,e){history.replaceState},_updateMasterSelect:function(t,e){var a=this.container.querySelector(this.originalSelectorId);a&&(a.value=t.id)}}),n}(); //# sourceMappingURL=/s/files/1/0646/8901/2974/t/2/assets/dT_bundle_base.js.map?v=178559308254279089191654145475