$(()=>{window.utils.enableDisclosure();const oldFlickityCreate=window.Flickity.prototype._create;window.Flickity.prototype._create=function(){const that=this;return this.element.addEventListener&&this.element.addEventListener("load",()=>{that.onresize()},!0),this._create=oldFlickityCreate,oldFlickityCreate.apply(this,arguments)},document.addEventListener("lazyloaded",e2=>{let bg=e2.target.getAttribute("data-bg");const mobileBg=e2.target.getAttribute("data-mobile-bg");bg&&(window.PXUTheme.media_queries.medium.matches&&mobileBg&&(bg=mobileBg),e2.target.style.backgroundImage=`url(${bg})`)}),window.imageFunctions.flickityIosFix(),window.header.init(),window.meganavManager.injectAll(),window.PXUTheme.theme_settings.enable_autocomplete&&window.searchAutocomplete.init(),window.utils.initializeSectionWrapper(),window.slideshow.init(),window.testimonials.init(),window.video.init(),window.gallery.init(),window.videoFeature.setupVideoPlayer(),window.featuredPromotions.init(),window.featuredCollection.init(),window.logoList.init(),window.collectionSidebarFilter.init(),window.cart.init(),window.map.init(),window.shoppableImage.init(),window.productPage.init(),window.productPage.runOptionSelector(),window.productPage.initializeQuantityBox(),window.recentlyViewed.init(),window.sidebarAccordions.init(),(window.PXUTheme.currency.show_multiple_currencies||window.PXUTheme.currency.native_multi_currency)&&window.currencyConverter.init();const{pathname}=location;pathname.startsWith("/challenge")&&$("html, body").animate({scrollTop:0},"slow");let resizeTimeout;const beforeResizeWidth=$(window).width();window.addEventListener("resize",()=>{resizeTimeout||(resizeTimeout=setTimeout(()=>{resizeTimeout=null;const currentScreenWidth=$(window).width();window.PXUTheme.media_queries.medium.matches&¤tScreenWidth!==beforeResizeWidth&&(window.cart.init(),window.is_touch_device()||(window.header.unload(),window.header.init())),window.logoList.init(),document.querySelectorAll("[data-bg]").forEach(image=>{let bg=image.getAttribute("data-bg");const mobileBg=image.getAttribute("data-mobile-bg");bg&&(window.PXUTheme.media_queries.medium.matches&&mobileBg&&(bg=mobileBg),image.style.backgroundImage=`url(${bg})`)})},66))},!1),$.fancybox.defaults.animationEffect="fade",$.fancybox.defaults.transitionEffect="fade",$.fancybox.defaults.hash=!1,$.fancybox.defaults.infobar=!1,$.fancybox.defaults.toolbar=!1,$.fancybox.defaults.arrows=!1,$.fancybox.defaults.loop=!0,$.fancybox.defaults.smallBtn=!0,$.fancybox.defaults.live=!1,$.fancybox.defaults.zoom=!1,$.fancybox.defaults.mobile.preventCaptionOverlap=!1,$.fancybox.defaults.mobile.toolbar=!0,$.fancybox.defaults.mobile.buttons=["close"],$.fancybox.defaults.mobile.clickSlide="close",$.fancybox.defaults.mobile.clickContent="zoom",$.fancybox.defaults.afterLoad=function(instance,slide){instance.current.type==="image"&&slide.$content.wrapInner("
"),instance.group.length>1&&slide.$content.find(".fancybox-image-wrap").append(`${window.svgArrowSizeLeft}${svgArrowSizeRight}`)},$('.lightbox[rel="gallery"]').fancybox();const $videoIframes=$('iframe[src*="youtube.com"], iframe[src*="vimeo.com"], iframe[src*="facebook.com/plugins/video"]');function getAspectRatio(width,height){const ratio=width/height;return Math.abs(ratio-1/1)===0?"1:1":Math.abs(ratio-4/3){const $iframe=$(iframe),source=$iframe.attr("src");!$iframe.parents(".plyr__video-wrapper").length&&!$iframe.parents(".lazyframe").length&&$iframe.wrap(`
`)}),window.lazyframe(".lazyframe"),$(".shopify-policy__container").wrap('
'),$(".shopify-policy__container").addClass("five-eighths offset-by-three columns is-hidden-offset-mobile-only medium-down--one-whole"),$(".shopify-policy__title").append('
');const currentValue=$(".search__form input[name='q']").val();$(".search__form input[name='q']").length>0&&$(".search__form input[name='q']").val(currentValue.replace("*",""));const sortByEl=document.querySelector("[data-sort-by]");sortByEl&&sortByEl.addEventListener("change",e2=>{const{target}=e2,sortValue=target.value;if(target){const queryString=new URLSearchParams(document.location.search);queryString.set("sort_by",sortValue),window.location.search=queryString}}),$("body").on("change","#tag_filter",()=>{$("[data-option-filter] input").prop("checked",!1),window.quickFilter.init()}),$("body").on("change","#blog_filter",function(){const url=$(this).val();window.location=url}),$("input, select, textarea").on("focus blur",event=>{$("meta[name=viewport]").attr("content",`width=device-width,initial-scale=1,maximum-scale=${event.type==="blur"?10:1}`)}),$("body").on("change","[data-option-filter] input",()=>{window.quickFilter.init(),$("html, body").animate({scrollTop:$(".content").offset().top},500)}),$("body").on("click","[data-reset-filters]",()=>{window.collectionSidebarFilter.clearAllFilters()}),$("body").on("click","[data-clear-filter]",e2=>{const selectedOption=$(e2.currentTarget).parents(".filter-active-tag");window.collectionSidebarFilter.clearSelectedFilter(selectedOption)}),$("body").on("change",".currencies",()=>{$("[data-initial-modal-price]").attr("data-initial-modal-price","")}),$("body").on("change",".js-quick-shop select",()=>{const currentVariant=$('.js-quick-shop select[name="id"]').val();currentVariant&&window.globalQuickShopProduct&&window.quickShop.updateVariant(currentVariant)}),window.PXUTheme.theme_settings.quick_shop_enabled&&window.quickShop.init();let touchStartPos=0;if($(document).bind("touchstart",()=>{touchStartPos=$(window).scrollTop()}).bind("touchend",e2=>{const distance=touchStartPos-$(window).scrollTop();(distance>20||distance<-20)&&e2.preventDefault}),$("body").on("click",".sidebar .parent-link--false",function(e2){e2.preventDefault();const $menu=$(this).parent("li");$menu.find(".menu-toggle").toggleClass("active"),$menu.find("ul").slideToggle()}),window.PXUTheme.theme_settings.newsletter_popup&&window.newsletter_popup.init(),window.location.pathname.indexOf("/comments")!==-1&&$("html,body").animate({scrollTop:$("#new-comment").offset().top-140},"slow"),$("body").on("mouseenter",".icon-search",()=>{$(".search-terms").focus()}),$("body").on("click",".icon-search",()=>{$("input.search-terms").focus()}),$("body").on("click",".search-submit",e2=>{$(e2.currentTarget).parent().submit()}),window.PXUTheme.media_queries.large.matches&&($(".animate_right").waypoint(function(){$(this.element).addClass("animated fadeInRight")},{offset:"70%"}),$(".animate_left").waypoint(function(){$(this.element).addClass("animated fadeInLeft")},{offset:"70%"}),$(".animate_up").waypoint(function(){$(this.element).addClass("animated fadeInUp")},{offset:"70%"}),$(".animate_down").waypoint(function(){$(this.element).addClass("animated fadeInDown")},{offset:"70%"})),$(".slider, .flexslider").find("li").unwrap(),$(".slider, .flexslider").flickity({pageDots:window.usePageDots,imagesLoaded:!0,arrowShape:window.arrowSize,lazyLoad:2}),window.utils.createAccordion(".footer_menu","h6","ul"),window.utils.createAccordion(".footer_content","h6","div.toggle_content"),window.utils.createAccordion(".product_section .accordion-tabs",".tabs li > a",".tabs-content li"),window.utils.mobileParentActiveAccordion("#mobile_menu","li.sublink > a.parent-link--true span","li.sublink ul"),window.utils.mobileAccordion("#mobile_menu","li.sublink > a.parent-link--false","li.sublink ul"),window.utils.initializeTabs(),window.accordion.init(),$("body").on("click",".menu-toggle",function(){$(this).next("ul").slideToggle(),$(this).toggleClass("active"),$(this).attr("aria-expanded",$(this).attr("aria-expanded")==="true"?"false":"true")}),window.PXUTheme.theme_settings.collection_swatches&&window.PXUTheme.media_queries.large.matches&&($("body").on("mouseenter",".collection_swatches",function(){$(".swatch span",$(this)).each(function(){$(this).data("image").indexOf("no-image")===-1&&($("")[0].src=$(this).data("image"))})}),$("body").on("mouseenter",".swatch span",function(){$(this).data("image")?.indexOf("no-image")===-1&&($(this).parents(".thumbnail").find(".image__container img:not(.secondary)").attr("src",$(this).data("image")),$(this).parents(".thumbnail").find(".image__container img:not(.secondary)").attr("srcset",$(this).data("image")))})),window.PXUTheme.theme_settings.display_tos_checkbox&&$("body").on("click touchstart",".cart_content .tos_label",function(){$(this).prev("input").prop("checked",!0)}),window.PXUTheme.theme_settings.display_tos_checkbox&&window.PXUTheme.theme_settings.go_to_checkout?$("body").on("click",".tos_warning [data-cart-checkout-button]",function(e2){if($(this).parents("form").find(".tos_agree").is(":checked"))window.PXUTheme.theme_settings.go_to_checkout||$("body").hasClass("cart")?$(this).submit():(e2.preventDefault(),document.location.href=window.PXUTheme.routes.cart_url);else{const warning2=`

${window.PXUTheme.translation.agree_to_terms_warning}

`;return $("p.warning").length===0&&$(this).before(warning2),!1}}):window.PXUTheme.theme_settings.go_to_checkout||$("body").on("click",".cart_content [data-minicart-checkout-button]",e2=>{e2.preventDefault(),document.location.href=window.PXUTheme.routes.cart_url}),window.PXUTheme.theme_settings.collection_secondary_image&&window.imageFunctions.showSecondaryImage(),$("[data-is-required]").length){const $checkboxGroup=$(".custom-contact__checkbox");$checkboxGroup.prop("required",!0),$checkboxGroup.on("change",()=>{$checkboxGroup.prop("required",!0),$checkboxGroup.is(":checked")&&$checkboxGroup.prop("required",!1)})}$(".maps").click(()=>{$(".maps iframe").css("pointer-events","auto")}),window.PXUTheme.theme_settings.pagination_type==="load_more"&&window.enableLoadMoreProducts(),window.PXUTheme.theme_settings.pagination_type,window.PXUTheme.theme_settings.pagination_type==="infinite_scroll"&&window.enableInfiniteScroll(".product-list");function ajaxSubmitCart(cart){const $cart=cart;$.ajax({url:"/cart/update.js",dataType:"json",cache:!1,type:"post",data:$cart.serialize(),success(data){refreshCart(data)}})}function updateCartItemQuantity(cartItem){$.ajax({url:"/cart/change.js",dataType:"json",cache:!1,type:"post",data:{quantity:cartItem.quantity,line:cartItem.lineID},success(data){const cartItemsArray=data.items,lineIDIndex=cartItem.lineID-1,totalCartItems=cartItem.parentCartForm.find("[data-variant-id]").length,$quantityInputs=cartItem.parentCartForm.find(`[data-variant-id="${cartItem.variantID}"] input`);let initialQuantityTotal=0,apiQuantityTotal=0;const apiLineItemQuantity=typeof data.items[lineIDIndex]<"u"?data.items[lineIDIndex].quantity:0;if($quantityInputs.length>1?($.each($quantityInputs,(_i,input)=>{initialQuantityTotal+=parseInt($(input).val())}),cartItemsArray.forEach(item=>{item.variant_id===cartItem.variantID&&(apiQuantityTotal+=item.quantity)})):(initialQuantityTotal=parseInt($quantityInputs.val()),apiQuantityTotal=typeof data.items[lineIDIndex]<"u"?data.items[lineIDIndex].quantity:0),initialQuantityTotal>0&&initialQuantityTotal>apiQuantityTotal)if(apiQuantityTotal===1?itemsLeftText=window.PXUTheme.translation.one_item_left:itemsLeftText=window.PXUTheme.translation.items_left_text,$(".warning--quantity").remove(),totalCartItems${apiQuantityTotal} ${itemsLeftText}

`;cartItem.parentCartForm.find(`[data-line-id='${cartItem.lineID}'] input`).parent().after(warning2),cartItem.parentCartForm.find(`[data-line-id='${cartItem.lineID}'] input`).val(apiLineItemQuantity)}else cartItem.parentCartForm.data("cart-form")==="cart-template"?cartItem.parentCartForm.submit():refreshCart(data)}})}function refreshCartID(){const cartItem=document.querySelectorAll(".cart__item");for(let i=0;i{const itemDiscounts=item.discounts;let discountMessage="";for(let i=0;i${title}

`}const lineID=index+1;let imageUrl=item.image;if(item.properties&&$.each(item.properties,(title,value2)=>{title==="_cart_image"&&value2&&(imageUrl=`https:${value2}`)}),cartItemsHTML+=`
  • `,imageUrl&&(item.properties&&item.properties._cart_image?cartItemsHTML+=`
    ${htmlEncode(item.title)}
    `:cartItemsHTML+=`
    ${htmlEncode(item.title)}
    `),cartItemsHTML+=`
    ${item.title}`,item.selling_plan_allocation&&(cartItemsHTML+=`
    ${item.selling_plan_allocation.selling_plan.name}
    `),item.properties&&$.each(item.properties,(title,value2)=>{value2&&title!="_cart_image"&&(cartItemsHTML+=`
    ${title}: ${value2}
    `)}),cartItemsHTML+='
    ',$.ajax({dataType:"json",async:!1,cache:!1,url:`/products/${item.handle}.js`,success(data){let productData=data;if(productData.variants){const itemVariants=productData.variants;if(itemVariants.length>1)for(let v=0;vproductData.price?(productHasSale=!0,productCompareAtPrice=productData.compare_at_price,productFinalPrice=productData.price):productHasSale=!1}}),productHasSale===!0){const itemPrice=`${window.Shopify.formatMoney(productFinalPrice,$("body").data("money-format"))} ${window.Shopify.formatMoney(productCompareAtPrice,$("body").data("money-format"))}`;cartItemsHTML+=`${itemPrice}`,saving=(productCompareAtPrice-productFinalPrice)*item.quantity,totalSaving=saving+totalSaving}else if(item.price>item.final_price){const itemPrice=`${window.Shopify.formatMoney(item.final_price,$("body").data("money-format"))} ${window.Shopify.formatMoney(item.price,$("body").data("money-format"))}`;cartItemsHTML+=`${itemPrice}`}else{const itemPrice=window.Shopify.formatMoney(item.price,$("body").data("money-format"));item.price>0?cartItemsHTML+=`${itemPrice}`:cartItemsHTML+=`${window.PXUTheme.translation.cart_free_text}`}if(cartItemsHTML+="
    ",item.unit_price_measurement&&item.price>0){let unitPriceMeasurementReferenceValue="";item.unit_price_measurement.reference_value!==1&&(unitPriceMeasurementReferenceValue=item.unit_price_measurement.reference_value),cartItemsHTML+=`

    ${item.unit_price_measurement.quantity_value}${item.unit_price_measurement.quantity_unit} | ${Shopify.formatMoney(item.unit_price,$("body").data("money-format"))} / ${unitPriceMeasurementReferenceValue}${item.unit_price_measurement.reference_unit}

    `}item.price>item.final_price&&(cartItemsHTML+=discountMessage),cartItemsHTML+='
    ',cartItemsHTML+='',cartItemsHTML+=``,cartItemsHTML+='',cartItemsHTML+="
    ",cartItemsHTML+=``});const cartDiscounts=cart.cart_level_discount_applications;for(let i=0;i${title}`,cartDiscountsHTML+='',cartDiscountsHTML+=`-${amount}`}cartActionHTML+=`${window.Shopify.formatMoney(cart.total_price,$("body").data("money-format"))} ${window.PXUTheme.translation.cart_subtotal_text}`,totalSaving+=cart.total_discount,window.PXUTheme.theme_settings.display_savings&&totalSaving>0?cartSavingsHTML=`${window.Shopify.formatMoney(totalSaving,$("body").data("money-format"))}${window.PXUTheme.translation.cart_savings_text}`:cartSavingsHTML=""}$(".js-cart_items").html(cartItemsHTML),$(".js-cart_discounts").html(cartDiscountsHTML),$(".js-cart_subtotal").html(cartActionHTML),$(".js-cart_savings").html(cartSavingsHTML),window.PXUTheme.currency.show_multiple_currencies&&window.currencyConverter.convertCurrencies()}$("body").on("change","[data-cart-quantity-input]",function(){const cartItem={lineID:$(this).parents("[data-cart-item]").data("line-id"),variantID:$(this).parents("[data-cart-item]").data("variant-id"),quantity:$(this).val(),parentCartForm:$(this).parents("[data-cart-form]"),totalDiscount:$(this).parents("[data-cart-form]").data("total-discount"),$element:$(this).parents("[data-cart-item]")};$(this).parents(".product-quantity-box").find(".js-change-quantity").addClass("is-disabled"),updateCartItemQuantity(cartItem)}),$("body").on("click","[data-remove-item]",function(e2){e2.preventDefault();const cartItem={lineID:$(this).parents("[data-cart-item]").data("line-id"),variantID:$(this).parents("[data-cart-item]").data("variant-id"),quantity:0,parentCartForm:$(this).parents("[data-cart-form]"),totalDiscount:$(this).parents("[data-cart-form]").data("total-discount"),$element:$(this).parents("[data-cart-item]")};cartItem.$element.addClass("animated fadeOutLeft"),updateCartItemQuantity(cartItem),cartItem.parentCartForm.data("cart-form")==="cart-template"&&(cartItem.$element.find("input").val("0"),cartItem.parentCartForm.submit()),cartItem.parentCartForm.data("cart-form")==="mini-cart"&&cartItem.$element.find("input").val("0")}),window.PXUTheme.theme_settings.cart_action==="ajax"&&$(document).on("click",".ajax-submit",function(e){e.preventDefault();var selectedVar_id=$(this).closest("form").find(".getSelectedId").val();console.log("HERERE");var $thisObj=$(this);const $addToCartForm=$(this).closest("form"),$addToCartBtn=$addToCartForm.find(".add_to_cart");$("body").hasClass("cart")&&$addToCartForm.submit();var formDataRe=$addToCartForm.serialize();formDataRe="quantity=1&id="+selectedVar_id;var ageContextValue=$addToCartForm.find('input[name="properties[Style]"]').val();ageContextValue&&(formDataRe+="&properties[Style]="+encodeURIComponent(ageContextValue));var firstImgValue=$addToCartForm.find('input[name="properties[_cart_image]"]').val();return firstImgValue&&(formDataRe+="&properties[_cart_image]="+encodeURIComponent(firstImgValue)),$.ajax({url:"/cart/add.js",dataType:"json",cache:!1,type:"post",data:formDataRe,beforeSend(){$addToCartBtn.attr("disabled","disabled").addClass("disabled"),$addToCartBtn.find("span").removeClass("fadeInDown").addClass("animated zoomOut")},success(){$addToCartBtn.find(".checkmark").addClass("checkmark-active"),$thisObj.hasClass("varisize")&&$thisObj.closest(".variandesign").find(".closeflex2").click(),window.setTimeout(()=>{$addToCartBtn.removeAttr("disabled").removeClass("disabled"),$addToCartBtn.find(".checkmark").removeClass("checkmark-active"),$addToCartBtn.find("span").removeClass("zoomOut").addClass("fadeInDown")},1e3),$.ajax({url:"/cart.js",dataType:"json",cache:!1,success(cart){setTimeout(function(){if(refreshCart(cart),$("body").hasClass("fancybox-active")&&$.fancybox.close(),$("#header").is(":visible")?$("#header .cart-container").addClass("active_link"):$(".sticky_nav--stick").length?$(".sticky_nav .cart-container").addClass("active_link"):$(".top-bar .cart-container").addClass("active_link"),window.PXUTheme.media_queries.medium.matches){const $cartContainer=$(this).parent();document.getElementById("header").classList.contains("mobile_nav-fixed--false")&&window.scroll({top:0,left:0,behavior:"smooth"})}},500)}})},error(XMLHttpRequest){let response=eval(`(${XMLHttpRequest.responseText})`);response=response.description,$(".warning").remove();const warning=`

    ${response.replace("All 1 ","All ")}

    `;$addToCartForm.after(warning),$addToCartBtn.removeAttr("disabled").removeClass("disabled"),$addToCartBtn.find("span").text(window.PXUTheme.translation.add_to_cart).removeClass("zoomOut").addClass("zoomIn")}}),!1}),window.productPage.productSwatches()}),window.Shopify.updateOptionsInSelector=function(selectorIndex,parent){switch(selectorIndex){case 0:var key="root";break;case 1:var key=$(`${parent} .single-option-selector:eq(0)`).val();break;case 2:var key=$(`${parent} .single-option-selector:eq(0)`).val();key+=` / ${$(`${parent} .single-option-selector:eq(1)`).val()}`}const availableOptions=Shopify.optionsMap[key];$(`${parent} .swatch[data-option-index="${selectorIndex}"] .swatch-element`).each(function(){$.inArray($(this).attr("data-value"),availableOptions)!==-1?$(this).parents(".match_forms_wrap").length||$(this).parents(".modal-content1").length||$(this).removeClass("soldout").find(":radio").removeAttr("disabled","disabled").removeAttr("checked"):$(this).parents(".match_forms_wrap").length||$(this).parents(".modal-content1").length||document.querySelector("[data-age-context]").dataset.ageContext.length||$(this).addClass("soldout").find(":radio").removeAttr("checked").attr("disabled","disabled")})},window.Shopify.linkOptionSelectors=function(product,parent){window.Shopify.optionsMap={};for(let i=0;i1){const key=variant.option1;window.Shopify.optionsMap[key]=window.Shopify.optionsMap[key]||[],window.Shopify.optionsMap[key].push(variant.option2),window.Shopify.optionsMap[key]=window.Shopify.uniq(window.Shopify.optionsMap[key])}if(product.options.length===3){const key=`${variant.option1} / ${variant.option2}`;window.Shopify.optionsMap[key]=window.Shopify.optionsMap[key]||[],window.Shopify.optionsMap[key].push(variant.option3),window.Shopify.optionsMap[key]=window.Shopify.uniq(window.Shopify.optionsMap[key])}}}window.Shopify.updateOptionsInSelector(0,parent),product.options.length>1&&window.Shopify.updateOptionsInSelector(1,parent),product.options.length===3&&window.Shopify.updateOptionsInSelector(2,parent),$(`${parent} .single-option-selector:eq(0)`).change(()=>(window.Shopify.updateOptionsInSelector(1,parent),product.options.length===3&&window.Shopify.updateOptionsInSelector(2,parent),!0)),$(`${parent} .single-option-selector:eq(1)`).change(()=>(product.options.length===3&&window.Shopify.updateOptionsInSelector(2,parent),!0))},window.htmlEncode=function htmlEncode2(value){return value?$("
    ").text(value).html():""},window.is_touch_device=function is_touch_device(){return"ontouchstart"in window||navigator.maxTouchPoints},window.touch_device=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent);function floatToString(t,e2){const o=t.toFixed(e2).toString();return o.match(/^\.\d+/)?`0${o}`:o}typeof window.Shopify>"u"&&(window.Shopify={}),window.Shopify.each=function(t,e2){for(let o=0;o"u")},window.Shopify.getClass=function(t){return Object.prototype.toString.call(t).slice(8,-1)},window.Shopify.extend=function(t,e2){function o(){}o.prototype=e2.prototype,t.prototype=new o,t.prototype.constructor=t,t.baseConstructor=e2,t.superClass=e2.prototype},window.Shopify.locationSearch=function(){return window.location.search},window.Shopify.locationHash=function(){return window.location.hash},window.Shopify.replaceState=function(t){window.history.replaceState({},document.title,t)},window.Shopify.urlParam=function(t){const e2=RegExp(`[?&]${t}=([^&#]*)`).exec(window.Shopify.locationSearch());return e2&&decodeURIComponent(e2[1].replace(/\+/g," "))},window.Shopify.newState=function(t,e2){let o;return o=window.Shopify.urlParam(t)?window.Shopify.locationSearch().replace(RegExp(`(${t}=)[^&#]+`),`$1${e2}`):window.Shopify.locationSearch()===""?`?${t}=${e2}`:`${window.Shopify.locationSearch()}&${t}=${e2}`,o+window.Shopify.locationHash()},window.Shopify.setParam=function(t,e2){window.Shopify.replaceState(window.Shopify.newState(t,e2))},window.Shopify.Product=function(t){window.Shopify.isDefined(t)&&this.update(t)},window.Shopify.Product.prototype.update=function(t){for(property in t)this[property]=t[property]},window.Shopify.Product.prototype.optionNames=function(){return window.Shopify.getClass(this.options)=="Array"?this.options:[]},window.Shopify.Product.prototype.optionValues=function(t){if(!window.Shopify.isDefined(this.variants))return null;const e2=window.Shopify.map(this.variants,e3=>{const o=`option${t+1}`;return e3[o]==null?null:e3[o]});return e2[0]==null?null:window.Shopify.uniq(e2)},window.Shopify.Product.prototype.getVariant=function(t){let e2=null;return t.length!=this.options.length||window.Shopify.each(this.variants,o=>{for(var i=!0,r=0;r"u"?e3:t2}function i(t2,e3,i2,r2){if(e3=o(e3,2),i2=o(i2,","),r2=o(r2,"."),isNaN(t2)||t2==null)return 0;t2=(t2/100).toFixed(e3);const n2=t2.split("."),a2=n2[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1${i2}`),s=n2[1]?r2+n2[1]:"";return a2+s}typeof t=="string"&&(t=t.replace(".",""));let r="";const n=/\{\{\s*(\w+)\s*\}\}/,a=e2||this.money_format;switch(a.match(n)[1]){case"amount":r=i(t,2);break;case"amount_no_decimals":r=i(t,0);break;case"amount_with_comma_separator":r=i(t,2,".",",");break;case"amount_with_apostrophe_separator":r=i(t,2,"'",".");break;case"amount_no_decimals_with_comma_separator":r=i(t,0,".",",")}return a.replace(n,r)},window.Shopify.OptionSelectors=function(t,e2){return this.selectorDivClass="selector-wrapper",this.selectorClass="single-option-selector",this.variantIdFieldIdSuffix="-variant-id",this.variantIdField=null,this.historyState=null,this.selectors=[],this.domIdPrefix=t,this.product=new window.Shopify.Product(e2.product),this.onVariantSelected=window.Shopify.isDefined(e2.onVariantSelected)?e2.onVariantSelected:function(){},this.replaceSelector(t),this.initDropdown(),e2.enableHistoryState&&(this.historyState=new window.Shopify.OptionSelectors.HistoryState(this)),!0},window.Shopify.OptionSelectors.prototype.initDropdown=function(){const t={initialLoad:!0};if(!this.selectVariantFromDropdown(t)){const o=this;setTimeout(()=>{o.selectVariantFromParams(t)||o.fireOnChangeForFirstDropdown.call(o,t)})}},window.Shopify.OptionSelectors.prototype.fireOnChangeForFirstDropdown=function(t){this.selectors[0].element.onchange(t)},window.Shopify.OptionSelectors.prototype.selectVariantFromParamsOrDropdown=function(t){this.selectVariantFromParams(t)||this.selectVariantFromDropdown(t)},window.Shopify.OptionSelectors.prototype.replaceSelector=function(t){const e2=document.getElementById(t),o=e2.parentNode;window.Shopify.each(this.buildSelectors(),t2=>{o.insertBefore(t2,e2)}),e2.style.display="none",this.variantIdField=e2},window.Shopify.OptionSelectors.prototype.selectVariantFromDropdown=function(t){let e2=document.getElementById(this.domIdPrefix).querySelector("[selected]");if(e2||(e2=document.getElementById(this.domIdPrefix).querySelector('[selected="selected"]')),!e2)return!1;const o=e2.value;return this.selectVariant(o,t)},window.Shopify.OptionSelectors.prototype.selectVariantFromParams=function(t){const e2=window.Shopify.urlParam("variant");return this.selectVariant(e2,t)},window.Shopify.OptionSelectors.prototype.selectVariant=function(t,e2){const o=this.product.getVariantById(t);if(o==null)return!1;for(let i=0;i{o.appendChild(t2)})},window.Shopify.OptionSelectors.prototype.buildSelectors=function(){for(let t=0;t{const e2=document.createElement("div");if(e2.setAttribute("class",o),i.length>1){const r2=document.createElement("label");r2.htmlFor=t.element.id,r2.innerHTML=t.name,e2.appendChild(r2)}return e2.appendChild(t.element),e2})},window.Shopify.OptionSelectors.prototype.selectedValues=function(){for(var t=[],e2=0;e2{if(t2.nodeType==1&&t2.tagName.toLowerCase()=="option"){const n2=t2.innerHTML.split(new RegExp(`\\s*\\${i}\\s*`));e2.length==0&&(a=n2.length-(o?1:0));const p2=n2.slice(0,a),l=o?n2[a]:"",c=(t2.getAttribute("value"),{available:!t2.disabled,id:parseFloat(t2.value),price:l,option1:p2[0],option2:p2[1],option3:p2[2]});s.push(c)}});const p={variants:s};if(e2.length==0){p.options=[];for(let l=0;a>l;l++)p.options[l]=`option ${l+1}`}else p.options=e2;return p},window.Shopify.SingleOptionSelector=function(t,e2,o,i){this.multiSelector=t,this.values=i,this.index=e2,this.name=o,this.element=document.createElement("select");for(let r=0;r{t.selectVariantFromParamsOrDropdown({popStateCall:!0})})},window.Shopify.OptionSelectors.HistoryState.prototype.onVariantChange=function(t,e2,o){this.browserSupports()&&(!t||o.initialLoad||o.popStateCall||window.Shopify.setParam("variant",t.id))},window.Shopify.OptionSelectors.HistoryState.prototype.browserSupports=function(){return window.history&&window.history.replaceState},$(document).on("shopify:block:select",e2=>{const{blockId}=e2.detail,$parentSection=$(`#shopify-section-${e2.detail.sectionId}`);($parentSection.hasClass("shopify-section--slideshow")||$parentSection.hasClass("shopify-section--testimonials")||$parentSection.hasClass("shopify-section--shoppable-image--slider-enabled"))&&sliderBlock.select(blockId,$parentSection)}),$(document).on("shopify:block:deselect",e2=>{const $parentSection=$(`#shopify-section-${e2.detail.sectionId}`);($parentSection.hasClass("shopify-section--slideshow")||$parentSection.hasClass("shopify-section--testimonials"))&&window.sliderBlock.deselect($parentSection)}),$(document).on("shopify:section:reorder",e2=>{window.utils.initializeSectionWrapper()}),$(document).on("shopify:section:load",e2=>{const $parentSection=$(`#shopify-section-${e2.detail.sectionId}`);window.utils.initializeSectionWrapper(),window.utils.enableDisclosure(),window.PXUTheme.theme_settings.enable_autocomplete&&window.searchAutocomplete.init(),window.PXUTheme.theme_settings.newsletter_popup&&window.newsletter_popup.init(),$parentSection.hasClass("shopify-section--article-template")&&window.sidebarAccordions.init(),$parentSection.hasClass("shopify-section--blog-template")&&window.sidebarAccordions.init(),$parentSection.hasClass("shopify-section--product-sidebar")&&window.sidebarAccordions.init(),$parentSection.hasClass("shopify-section--page-gallery-template")&&window.gallery.init($parentSection),$parentSection.hasClass("shopify-section--gallery")&&window.gallery.init(),($parentSection.hasClass("shopify-section--page-faq-template")||$parentSection.hasClass("shopify-section--faq"))&&window.accordion.init(),$parentSection.hasClass("shopify-section--cart-template")&&window.cart.init(),$parentSection.hasClass("shopify-section--featured-promotions")&&window.featuredPromotions.init(),$parentSection.hasClass("shopify-section--slideshow")&&window.slideshow.init(),$parentSection.hasClass("shopify-section--testimonials")&&window.testimonials.init(),$parentSection.hasClass("shopify-section--featured-product")&&(window.productPage.init(),window.productPage.runOptionSelector($parentSection),window.videoFeature.init(),window.productPage.productSwatches()),$parentSection.hasClass("shopify-section--map")&&window.map.init(),$parentSection.hasClass("shopify-section--logo-list")&&window.logoList.init(),$parentSection.hasClass("shopify-section--shoppable-image")&&window.shoppableImage.init(),$parentSection.hasClass("shopify-section--featured-collection")&&(window.featuredCollection.init(),window.productPage.init(),window.productPage.runOptionSelector($parentSection),window.videoFeature.init()),$parentSection.hasClass("shopify-section--video")&&window.video.init(),($parentSection.hasClass("shopify-section--product-template")||$parentSection.hasClass("shopify-section--quick-shop"))&&(window.productPage.init(),window.productPage.runOptionSelector($parentSection),window.videoFeature.init(),window.productPage.productSwatches(),window.recentlyViewed.init()),$parentSection.hasClass("shopify-section--recommended-products")&&window.productPage.init(),$parentSection.hasClass("shopify-section--recently-viewed-products")&&window.recentlyViewed.init(),$parentSection.hasClass("shopify-section--article-template")&&window.location.pathname.indexOf("/comments")!=-1&&$("html,body").animate({scrollTop:$("#new-comment").offset().top-140},"slow"),$parentSection.hasClass("shopify-section--collection-template")&&(window.collectionSidebarFilter.init(),window.productPage.init(),window.productPage.runOptionSelector($parentSection),window.sidebarAccordions.init(),window.recentlyViewed.init()),$parentSection.hasClass("shopify-section--contact-section")&&window.map.init(),$parentSection.hasClass("shopify-section--search-template")&&(window.PXUTheme.theme_settings.enable_autocomplete&&window.searchAutocomplete.init(),window.collectionSidebarFilter.init(),window.sidebarAccordions.init()),$parentSection.hasClass("shopify-section--header")&&(window.meganavManager.injectAll(),window.header.init()),$parentSection.hasClass("shopify-section--mega-menu")&&window.meganavManager.add($parentSection[0])}),$(document).on("shopify:section:unload",e2=>{const $target=$(e2.target),$parentSection=$(`#shopify-section-${e2.detail.sectionId}`);$parentSection.hasClass("shopify-section--header")&&window.header.unload($target),$parentSection.hasClass("shopify-section--slideshow")&&window.slideshow.unload($target),$parentSection.hasClass("shopify-section--logo-list")&&window.logoList.unload($parentSection.find("[data-logo-wrapper]")),$parentSection.hasClass("shopify-section--testimonials")&&window.testimonials.unload($target),$parentSection.hasClass("shopify-section--shoppable-image")&&window.shoppableImage.unload($target),$parentSection.hasClass("shopify-section--search")&&window.searchAutocomplete.unload($target),$parentSection.hasClass("shopify-section--product-template")&&window.productPage.unload($parentSection),$parentSection.hasClass("shopify-section--featured-product")&&window.productPage.unload($parentSection),$parentSection.hasClass("shopify-section--mega-menu")&&window.meganavManager.remove($parentSection[0]),window.requestAnimationFrame(()=>{window.utils.initializeSectionWrapper()})}),$(document).on("shopify:section:select",e2=>{const $parentSection=$(`#shopify-section-${e2.detail.sectionId}`);$parentSection.hasClass("shopify-section--mega-menu")&&window.meganavManager.select($parentSection[0]),$parentSection.hasClass("shopify-section--logo-list")&&window.logoList.init(),$parentSection.hasClass("shopify-section--featured-collection")&&(window.featuredCollection.unload($parentSection),window.featuredCollection.init());const evt=document.createEvent("UIEvents");evt.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(evt)}),$(document).on("shopify:section:deselect",e2=>{$(`#shopify-section-${e2.detail.sectionId}`).hasClass("shopify-section--mega-menu")&&window.meganavManager.deselect()}); //# sourceMappingURL=/cdn/shop/t/320/assets/app.js.map?v=8730910481240409991741130036