const carouselMain=document.querySelector("#ftl_product_gallery .flickity-slider"),carouselNav=document.querySelector("#ftl_product-gallery__thumbnails .flickity-slider");window.logoList={init(){$("[data-logo-slider]").flickity({cellAlign:"center",pageDots:!1,prevNextButtons:!0,contain:!0,groupCells:!0,initialIndex:0})},unload(target){$(target).hasClass("flickity-enabled")&&$(target).flickity("destroy")}},window.featuredCollection={init(){$(".js-product-slider .products-slider").each((index,value)=>{console.log("js-product-slider->>>",value);const productsPerSlide=$(value).data("products-per-slide"),productsLimit=$(value).data("products-limit"),productsAvailable=$(value).data("products-available");let cellAlign="left",draggable=!1,prevNext=!1,wrapAround=!1,initialIndex=0;window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0"},{name:"model-viewer-ui",version:"1.0"}],window.productMedia.setupMedia),productsPerSlide==="2"&&productsAvailable>productsPerSlide&&productsLimit>productsPerSlide||productsPerSlide==="4"&&productsAvailable>productsPerSlide&&productsLimit>productsPerSlide||productsPerSlide==="6"&&productsAvailable>productsPerSlide&&productsLimit>productsPerSlide?cellAlign="left":cellAlign="center",productsAvailable>productsPerSlide&&productsLimit>productsPerSlide?(draggable=!0,prevNext=!0,wrapAround=!0):(draggable=!1,prevNext=!1,wrapAround=!1),productsPerSlide==="2"&&productsAvailable>productsPerSlide||productsPerSlide==="4"&&productsAvailable>productsPerSlide||productsPerSlide==="6"&&productsAvailable>productsPerSlide?initialIndex=0:productsPerSlide==="3"&&productsAvailable?initialIndex=1:productsPerSlide==="5"&&productsAvailable?initialIndex=2:productsPerSlide==="7"&&productsAvailable&&(initialIndex=3),window.PXUTheme.media_queries.medium.matches&&(cellAlign="center",draggable=!0,prevNext=!0,wrapAround=!0,initialIndex=1,$(value).parents(".even-num-slides").removeClass("even-num-slides")),$(value).flickity({lazyLoad:2,imagesLoaded:!0,draggable,prevNextButtons:prevNext,wrapAround,pageDots:window.usePageDots,contain:!0,freeScroll:!0,arrowShape:window.arrowSize,initialIndex,cellAlign:"left"}),$(value).addClass("slider-initialized")})},unload($target){const $slider=$target.find(".js-product-slider");$slider.hasClass("flickity-enabled")&&$slider.flickity("destroy")}},window.featuredPromotions={init(){$(".feature-overlay").hover(function(){$(this).find(".feature-details").slideDown("100",function(){$(this).addClass("reveal-details")})},function(){$(this).find(".feature-details").removeClass("reveal-details"),$(this).find(".feature-details").slideUp("100")}),$(".js-featured-promotions").each(function(){const $promos=$(this),animationStyle=$(this).data("promo-animation");$promos.waypoint(function(){$(this.element).find(".feature-section").addClass(`animated ${animationStyle}`)},{offset:"80%"})})}},window.slideshow={init(){$(".js-homepage-slideshow").each(function(){const $homepageSlider=$(this),settings={slideshowSpeed:$homepageSlider.data("slideshow-speed")*1e3,slideshowTextAnimation:$homepageSlider.data("slideshow-text-animation"),adaptiveHeight:$homepageSlider.data("adaptive-height")};if(!$homepageSlider.hasClass("flickity-enabled")){const arrowShow=$homepageSlider.find(".gallery-cell").length!==1;if($homepageSlider.flickity({adaptiveHeight:settings.adaptiveHeight,wrapAround:!0,cellAlign:"left",imagesLoaded:!0,prevNextButtons:arrowShow,draggable:arrowShow,autoPlay:settings.slideshowSpeed}),settings.slideshowTextAnimation!==""){const flkty=$homepageSlider.data("flickity");setTimeout(()=>{$homepageSlider.find(".gallery-cell:nth-child(1) .caption-content").addClass(`animated ${settings.slideshowTextAnimation}`)},400),$homepageSlider.on("select.flickity",()=>{if($homepageSlider.is(":visible")){const currentSlide=flkty.selectedIndex+1;setTimeout(()=>{$homepageSlider.find(".caption-content").removeClass(`animated ${settings.slideshowTextAnimation}`),$homepageSlider.find(`.gallery-cell:nth-child(${currentSlide}) .caption-content`).addClass(`animated ${settings.slideshowTextAnimation}`)},400)}})}}$homepageSlider.find(".gallery-cell").length>1?$homepageSlider.addClass("multi-image"):$homepageSlider.addClass("single-image")})},unload($target){$target.find(".js-homepage-slideshow").flickity("destroy")}},window.testimonials={init(){$(".js-testimonial").each(function(){const $testimonialSlider=$(this),settings={slideshowSpeed:$testimonialSlider.data("slideshow-speed")*1e3,slideshowTextAnimation:$testimonialSlider.data("slideshow-text-animation"),adaptiveHeight:$testimonialSlider.data("adaptive-height")};if($(".testimonial-image").length>0&&$(".testimonial-block").each(function(){if($(this).find(".testimonial-image").length===0){const theBlock=$(this).closest(".testimonial-block");$(theBlock).addClass("set-testimonial-height")}}),!$testimonialSlider.hasClass("flickity-enabled")){const arrowShow=$testimonialSlider.find(".gallery-cell").length!==1;if($testimonialSlider.flickity({adaptiveHeight:settings.adaptiveHeight,wrapAround:!0,cellAlign:"left",imagesLoaded:!0,prevNextButtons:arrowShow,draggable:arrowShow,autoPlay:settings.slideshowSpeed}),settings.slideshowTextAnimation!==""){const flkty=$testimonialSlider.data("flickity");setTimeout(()=>{$testimonialSlider.find(".gallery-cell:nth-child(1) .caption-content").addClass(`animated ${settings.slideshowTextAnimation}`)},400),$testimonialSlider.on("select.flickity",()=>{if($testimonialSlider.is(":visible")){const currentSlide=flkty.selectedIndex+1;setTimeout(()=>{$testimonialSlider.find(".caption-content").removeClass(`animated ${settings.slideshowTextAnimation}`),$testimonialSlider.find(`.gallery-cell:nth-child(${currentSlide}) .caption-content`).addClass(`animated ${settings.slideshowTextAnimation}`)},400)}})}}$testimonialSlider.find(".gallery-cell").length>1?$testimonialSlider.addClass("multi-image"):$testimonialSlider.addClass("single-image")})},unload($target){$target.find(".js-testimonial").flickity("destroy")}},window.gallery={init(){$(".gallery-horizontal").find(".gallery-image-wrapper").each(function(){const wrapper=$(this),images=$(this).find("img");let imgWidth,imgHeight;$("").attr("src",$(images).attr("src")).on("load",function(){imgWidth=this.width,imgHeight=this.height,$(wrapper).css("flex-basis",imgWidth*200/imgHeight),$(wrapper).css("flex-grow",imgWidth*200/imgHeight),$(wrapper).find("i").css("padding-bottom",`${imgHeight/imgWidth*100}%`)})}),$("[rel=gallery]").length&&$("[rel=gallery]").fancybox({baseClass:"gallery-section__lightbox",clickContent:"nextOrClose",afterShow(){const fancyImages=$(".fancybox-image");$(".gallery__image").each((index,image)=>{const alt=$(image).attr("alt");fancyImages.eq(index).attr("alt",alt)})}})}},window.video={init(){var featuredVideos=$("[data-video-element]").get(),featuredVideoPlayers=Plyr.setup(featuredVideos,{controls:window.videoControls,fullscreen:{enabled:!0,fallback:!0,iosNative:!0},storage:{enabled:!1}});$.each(featuredVideoPlayers,function(index,player){var id=player.id,$video;player.isHTML5&&($video=$(player.elements.wrapper).find("video"),$video.attr("data-plyr-video-id",id)),player.on("play",function(event){var instance=event.detail.plyr;$.each(featuredVideoPlayers,function(index2,player2){instance.id!=player2.id&&player2.pause()})}),window.globalVideoPlayers&&window.globalVideoPlayers.push(player)}),$("[data-video-element]").each(function(index,video){var $video=$(video),$section=$video.parents(".shopify-section").attr("id",id),$videoElement=$section.find($video),$videoWrapper=$videoElement.parents(".video-wrapper"),$playButton=$videoWrapper.find("[data-play-button]"),$secondaryButton=$videoWrapper.find("[data-secondary-button]"),$videoText=$videoWrapper.find("[data-video-text]"),$videoTextContainer=$videoWrapper.find("[data-video-text-container]"),$image=$videoWrapper.find(".video-wrapper__image"),$posterImage=$videoWrapper.data("poster-image-uploaded"),aspectRatio=$videoWrapper.data("aspect-ratio"),id=$videoWrapper.data("video-src"),isAutoplay=$videoWrapper.data("autoplay"),isLoopingEnabled=$videoWrapper.data("autoloop"),isMuted=$videoWrapper.data("mute-video");$.each(featuredVideoPlayers,function(index2,player){var videoID,playerID;if(player.isYouTube||player.isVimeo)var videoID=$videoWrapper.attr("id"),playerID=$(player.elements.original).attr("id");else if(player.isHTML5){var videoID=$videoWrapper.find("[data-plyr-video-id]").data("plyr-video-id"),playerID=player.id;$videoElement=$section.find(".plyr--video")}if(playerID==videoID)return $videoWrapper.removeClass("play-button-icon--visible"),isAutoplay?window.PXUTheme.media_queries.large.matches||player.isYouTube||player.isVimeo?(player.autoplay=!0,$image.hide(),$videoElement.show(),$videoTextContainer.hasClass("display-text-over-video--false")?$videoText.hide():$videoText.show(),$playButton.hide()):window.PXUTheme.media_queries.medium.matches&&player.isHTML5&&($image.hide(),$videoElement.show(),$playButton.show(),player.on("play",function(){$videoElement.show(),$playButton.hide()})):$posterImage?($image.show(),$videoElement.hide()):$videoElement.show(),$image.on("click",function(){$(this).hide(),$videoElement.show(),player.play()}),isMuted&&(player.muted=!0),aspectRatio&&(player.ratio=aspectRatio),isLoopingEnabled&&(player.loop=!0),$playButton&&$playButton.on("click",function(){player.play()}),player.on("statechange",event=>{event.detail.code=="-1"&&player.play()}),player.on("play",function(){$image.hide(),$videoWrapper.removeClass("play-button-icon--visible"),$videoElement.show(),$videoTextContainer.hasClass("display-text-over-video--false")?$videoTextContainer.hide():$videoTextContainer.show(),$playButton&&$playButton.hide(),$secondaryButton&&$secondaryButton.hide()}),player.on("pause",function(){($playButton.is(":hidden")||$playButton.length==0)&&$videoWrapper.addClass("play-button-icon--visible")}),(!player.playing&&$playButton.is(":hidden")||$playButton.length==0)&&$videoWrapper.addClass("play-button-icon--visible"),!1})})}},window.cart={init(){$("#cart_form .tos_agree").length&&$("body").on("click","#cart_form input[type='submit']",function(){if($(this).parents("form").find(".tos_agree").is(":checked"))$(this).submit();else{const warning=`

${window.PXUTheme.translation.agree_to_terms_warning}

`;return $("p.warning").length===0&&$(this).before(warning),!1}})}},window.selectCallback=function(variant,selector,$element){const evt=document.createEvent("HTMLEvents");let $product;$element?$product=$element.find(`.product-${selector.product.id}`):$product=$(`.product-${selector.product.id}`);const $productForm=$(".product_form, .shopify-product-form",$product),variantInventory=$productForm.data("variant-inventory");evt.initEvent("change",!1,!0),selector.variantIdField.dispatchEvent(evt);const $notifyForm=$(`.notify-form-${selector.product.id}`),productTitle=$notifyForm.data("product-title"),$notifyFormInputs=$(".notify_form__inputs",$product),notifySend=window.PXUTheme.translation.notify_email_send,notifyUrl=$notifyFormInputs.data("url");variant&&(variant.title!=="Default Title"?(window.variantTitle=variant.title.replace(/"/g,"""),window.notifyMessage=window.PXUTheme.translation.notify_message_first+productTitle+" - "+window.variantTitle+window.PXUTheme.translation.notify_message_last+notifyUrl):window.notifyMessage=window.PXUTheme.translation.notify_message_first+productTitle+window.PXUTheme.translation.notify_message_last+notifyUrl);let notifyFormEmail,notifyFormPlaceholder;if($notifyForm.hasClass("notify-form--customer")?(notifyFormEmail=$notifyForm.data("customer-email"),notifyFormPlaceholder=""):(notifyFormEmail="",notifyFormPlaceholder=window.PXUTheme.translation.notify_email),window.notifyFormHTML=` `,variant&&variant.featured_image&&$product.is(":visible")&&$(".js-product-gallery",$product).each((_,slider)=>{const $slider=$(slider),$sliderInstance=window.Flickity.data($slider[0]);if($slider&&$sliderInstance!==void 0){const index=$(`[data-image-id="${variant.featured_media.id}"]`).data("index");$sliderInstance.select(index,!1,!0)}}),variant&&variant.featured_image&&$product.is(":visible")&&window.PXUTheme.theme_settings.product_form_style==="select"&&window.PXUTheme.theme_settings.quick_shop_style==="inline"&&$(".products-slider").find("select option:not(.selector-wrapper select option)").filter(":selected").each(function(){if($(this).data("featured-image")){const swatchImage=$(this).data("image"),$quickShopElement=$(this).parents(".thumbnail").find(".image__container img");$quickShopElement.attr("src",swatchImage),$quickShopElement.attr("srcset",swatchImage)}}),variant)if(variantInventory&&variantInventory.forEach(v=>{if(v.id===variant.id){const currentVariant=variant;currentVariant.inventory_quantity=v.inventory_quantity,currentVariant.inventory_management=v.inventory_management,currentVariant.inventory_policy=v.inventory_policy}}),$(".sku span",$product).text(variant.sku),window.PXUTheme.theme_settings.product_form_style==="radio"){const{length}=variant.options;for(let i=0;i0){if(window.PXUTheme.theme_settings.display_inventory_left){variant.inventory_quantity===1?window.itemsLeftText=window.PXUTheme.translation.one_item_left:window.itemsLeftText=window.PXUTheme.translation.items_left_text;const inventoryThreshold=parseInt(window.PXUTheme.theme_settings.inventory_threshold,10);variant.inventory_quantity<=inventoryThreshold?$(".items_left",$product).html(`${variant.inventory_quantity} ${window.itemsLeftText}`):$(".items_left",$product).html("")}window.PXUTheme.theme_settings.limit_quantity&&variant.inventory_policy==="deny"&&$(".quantity",$product).attr("max",variant.inventory_quantity)}else $(".items_left",$product).text(""),$(".quantity",$product).removeAttr("max");$(".sold_out",$product).text(""),$(".add_to_cart",$product).removeClass("disabled").removeAttr("disabled").find("span").text($(".add_to_cart",$product).data("label")),$(".shopify-payment-button",$product).removeClass("disabled"),$(".purchase-details__buttons",$product).removeClass("product-is-unavailable"),$(".modal_price",$product).removeClass("variant-unavailable"),$product.find($notifyForm).hide(),$product.find($notifyFormInputs).empty()}else{const message=variant?window.PXUTheme.translation.sold_out_text:window.PXUTheme.translation.unavailable_text;variant?$(".modal_price",$product).removeClass("variant-unavailable"):$(".modal_price",$product).addClass("variant-unavailable"),$(".items_left",$product).text(""),$(".quantity",$product).removeAttr("max"),$(".shopify-payment-button",$product).addClass("disabled"),$notifyForm.hide(),$notifyFormInputs.empty(),variant&&!variant.available&&($notifyForm.fadeIn(),$notifyFormInputs.empty(),$notifyFormInputs.append(window.notifyFormHTML))}window.PXUTheme.currency.show_multiple_currencies&&window.currencyConverter.convertCurrencies()},window.productPage={loadQuickshop(url){return window.shopifyAsyncview.load(url,{view:"quickshop"})},init(){window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0"},{name:"model-viewer-ui",version:"1.0"}],window.productMedia.setupMedia),$("[data-product-gallery]:not(.product-recommendations [data-product-gallery])").each(function(){const $productGallery=$(this);window.productPage.enableGallery($productGallery)}),window.location.search==="?contact_posted=true"&&($(".notify-form .contact-form").hide(),$(".notify-form .contact-form").prev(".message").html(window.PXUTheme.translation.notify_success_text)),window.PXUTheme.theme_settings.product_form_style==="radio"&&$("body").on("change",".swatch :radio",function(){const optionIndex=$(this).closest(".swatch").attr("data-option-index"),optionValue=$(this).val(),parentForm=$(this).closest(".product_form form");let notifyForm;parentForm.siblings(".notify-form").length?window.notifyForm=parentForm.siblings(".notify-form"):window.notifyForm=$(".js-notify-form");const option1=parentForm.find(".swatch_options input:checked").eq(0).val(),option2=parentForm.find(".swatch_options input:checked").eq(1).val()||"",option3=parentForm.find(".swatch_options input:checked").eq(2).val()||"";let notifyMessage;option1&&option2&&option3?window.notifyMessage=`${option1} / ${option2} / ${option3}`:option1&&option2?window.notifyMessage=`${option1} / ${option2}`:window.notifyMessage=option1,window.notifyForm.find(".notify_form_message").attr("value",`${window.notifyForm.find(".notify_form_message").data("body")} - ${window.notifyMessage}`),$(this).closest("form").find(".single-option-selector").eq(optionIndex).val(optionValue).trigger("change")}),$(".js-product-gallery a").fancybox({width:800,height:800,baseClass:"product-section__lightbox",clickContent:!1,afterShow(instance){const fancyImages=$(".fancybox-image");$(".product-gallery__image").each((index,image)=>{const alt=$(image).attr("alt");fancyImages.eq(index).attr("alt",alt)}),instance.$trigger.first().parents(".js-product-gallery").data("zoom")&&$(".fancybox-image").last().wrap('').css("display","block").parent().zoom({touch:!1,magnify:1})},afterClose(instance){const $instanceGallery=instance.$trigger.first().parents(".js-product-gallery");$instanceGallery.hide(),setTimeout(()=>{$instanceGallery.fadeIn(100),$(".js-product-gallery").find(".is-selected a").focus()},1)}});const complementaryProductsEl=document.querySelector("[data-complementary-products]");if(complementaryProductsEl){const sectionEl=complementaryProductsEl.closest(".product_section"),{sectionId,productId,productRecommendationLimit}=JSON.parse(document.querySelector("[data-complementary-products-data]").textContent);this.complementaryProductRecommendations=new ComplementaryProducts({sectionEl,sectionId,productId,productRecommendationsRoute:window.PXUTheme.routes.product_recommendations_url,includeIndicatorDots:!0,limit:productRecommendationLimit,arrowShape:"M 10,50 L 60,100 L 70,90 L 30,50 L 70,10 L 60,0 Z"})}$(".shopify-section--recommended-products").length&&window.productPage.loadProductRecommendations()},runOptionSelector($element){let $defaultSelector=$(".js-product-section [data-product-form]:not(.product-recommendations .js-product-section [data-product-form])");$element&&($defaultSelector=$element.find("[data-product-form]")),$defaultSelector.each((_,options)=>{const $options=$(options),$productDetails=$options.closest(".product__details");let priceUIEl;const paymentTerms=new window.PaymentTerms($productDetails[0]);window.PXUTheme.media_queries.medium.matches&&window.PXUTheme.theme_settings.hover_enabled&&window.PXUTheme.theme_settings.quick_shop_enabled&&window.PXUTheme.theme_settings.quick_shop_style==="inline"?priceUIEl=$productDetails.find(".modal_price [data-price-ui], .product-info__caption [data-price-ui]")[0]:priceUIEl=$productDetails.find("[data-price-ui]")[0];const priceUIBadgeEl=$productDetails.find("[data-price-ui-badge]")[0],surfacePickUpEl=$productDetails.find("[data-surface-pick-up]")[0],JSONData=$options.data("product"),isPriceSavingsEnabled=priceUIEl&&priceUIEl.closest(['[data-display-savings="true"]']),productTitle=$options.data("product-title");let priceUI,priceUIBadge,surfacePickUp,currentVariant;priceUIEl&&(priceUI=new window.ShopifyPriceUI.PriceUI(priceUIEl)),priceUIBadgeEl&&(priceUIBadge=new window.ShopifyPriceUI.PriceUIBadge(priceUIBadgeEl)),surfacePickUpEl&&(surfacePickUp=new window.ShopifySurfacePickUp(surfacePickUpEl),surfacePickUp.onModalRequest(contents=>{const surfacePickUpModal=document.querySelector("[data-surface-pick-up-modal]");let fragment;if(currentVariant.title&&productTitle){fragment=document.createDocumentFragment();const header=document.createElement("div"),title=document.createElement("h2");if(header.classList.add("surface-pick-up__modal-header"),title.classList.add("surface-pick-up__modal-title"),title.innerHTML=productTitle,header.appendChild(title),currentVariant.title!=="Default Title"){const subtitle=document.createElement("span");subtitle.classList.add("surface-pick-up__modal-subtitle"),subtitle.innerHTML=currentVariant.title,header.appendChild(subtitle)}fragment.appendChild(header)}surfacePickUpModal.innerHTML=contents,surfacePickUpModal.insertBefore(fragment,surfacePickUpModal.firstChild),$.fancybox.open(surfacePickUpModal,{hash:!1,infobar:!1,toolbar:!1,loop:!0,smallBtn:!0,touch:!1,video:{autoStart:!1},mobile:{preventCaptionOverlap:!1,toolbar:!0}})})),new window.Shopify.OptionSelectors($options.data("select-id"),{product:$options.data("product"),onVariantSelected:(variant,selector)=>{if(selector.variantIdField.form.classList.contains("product_form_main")!=!1){if(currentVariant=variant,console.log(selector.variantIdField.form.classList.contains("product_form_main")),paymentTerms.update(variant?variant.id:null),priceUI&&(priceUI.load(JSONData,{variant,formatter:price=>window.Shopify.formatMoney(price,$("body").data("money-format")),handler:(priceUIFragment,_product,{variant:v})=>{if(isPriceSavingsEnabled&&v&&v.compare_at_price>v.price){const span=document.createElement("span");span.classList.add("sale","savings");const savings=v.compare_at_price-v.price,percentage=Math.round(savings/v.compare_at_price*100);span.innerHTML=`${window.PXUTheme.translation.savings_text} ${percentage}% (${window.Shopify.formatMoney(v.compare_at_price-v.price,$("body").data("money-format"))})`,priceUIFragment.appendChild(span)}if(v&&v.available){if(v.price===0){const fragment=document.createDocumentFragment(),span=document.createElement("span");return span.classList.add("free-price-text"),window.PXUTheme.theme_settings.free_text!==""?span.innerHTML=window.PXUTheme.theme_settings.free_text:span.innerHTML=`${window.Shopify.formatMoney(v.price,$("body").data("money-format"))}`,fragment.appendChild(span),fragment}return priceUIFragment}if(!window.PXUTheme.theme_settings.display_sold_out_price){const fragment=document.createDocumentFragment(),soldOutText=document.createElement("span");return soldOutText.classList.add("sold_out"),soldOutText.innerHTML=v?window.PXUTheme.translation.sold_out_text:window.PXUTheme.translation.unavailable_text,fragment.appendChild(soldOutText),fragment}if(window.PXUTheme.theme_settings.display_sold_out_price){const span=document.createElement("span");span.classList.add("sold_out"),span.innerHTML=v?window.PXUTheme.translation.sold_out_text:window.PXUTheme.translation.unavailable_text,priceUIFragment.appendChild(span)}return priceUIFragment}}),window.PXUTheme.theme_settings.display_sold_out_price&&variant&&variant.price===0&&!variant.available)){const priceElement=priceUIEl.querySelector("[data-price]");if(!priceElement)return;if(window.PXUTheme.theme_settings.free_text!==""){const span=document.createElement("span");span.classList.add("free-price-text"),span.innerHTML=window.PXUTheme.theme_settings.free_text,priceElement.innerHTML="",priceElement.appendChild(span)}else if(window.PXUTheme.theme_settings.free_text===""){priceElement.classList.add("price--sale");return}}priceUIBadge&&priceUIBadge.load(JSONData,{variant,style:"default",formatter:price=>window.Shopify.formatMoney(price,$("body").data("money-format")),handler:(priceUIFragment,_product,{variant:v})=>{if(v&&v.available)return!v.compare_at_price||v.compare_at_price<=v.price?document.createDocumentFragment():priceUIFragment;if(v&&!v.available||!v){const fragment=document.createDocumentFragment();let text;const sticker=document.createElement("div");sticker.classList.add("price-ui-badge__sticker");const stickerText=document.createElement("span");return stickerText.classList.add("price-ui-badge__sticker-text"),stickerText.setAttribute("data-badge",""),v&&!v.available&&(sticker.classList.add("price-ui-badge__sticker--sold-out"),text=window.PXUTheme.translation.sold_out_text),v||(sticker.classList.add("price-ui-badge__sticker--unavailable"),text=window.PXUTheme.translation.unavailable_text),stickerText.innerHTML=text,sticker.appendChild(stickerText),fragment.appendChild(sticker),fragment}return priceUIFragment}}),setTimeout(()=>{var current_currency=$("[data-disclosure-currency] span.currency-code").text();$('#currency-list .disclosure__button[value="'+current_currency+'"]').click()},100),surfacePickUp&&!$options.closest(".js-product-section").hasClass("inline-quickshop")&&surfacePickUp.load(variant?variant.id:null),window.selectCallback(variant,selector,$element)}},enableHistoryState:$options.data("enable-state")})})},enableGallery(selector){const $productGallery=$(selector),$slides=$productGallery.find(".gallery-cell"),$thumbnailProductGallery=$productGallery.closest(".js-product-section").find(".product_gallery_nav"),$thumbnails=$thumbnailProductGallery.find(".gallery-cell"),zoom=$productGallery.data("zoom"),productLightbox=$productGallery.data("product-lightbox"),thumbnailsEnabled=$productGallery.data("thumbnails-enabled"),thumbnailsSliderEnabled=$productGallery.data("thumbnails-slider-enabled"),thumbnailsPosition=$productGallery.data("thumbnails-position"),thumbnailsArrows=$productGallery.data("gallery-arrows-enabled"),slideshowSpeed=$productGallery.data("slideshow-speed");zoom===!0&&(window.is_touch_device()&&window.PXUTheme.media_queries.medium.matches?productLightbox==="false"&&document.addEventListener("lazybeforeunveil",window.imageFunctions.zoom):document.addEventListener("lazybeforeunveil",window.imageFunctions.zoom)),$productGallery.on("ready.flickity",()=>{$slides.each((index,slide)=>{const mediaType=$(slide).data("media-type")||$(slide).find("[data-media-type]").data("media-type");let videoID;switch(mediaType){case"external_video":videoID=$(slide).find("[data-plyr-video-id]").data("plyr-video-id"),window.videoPlayers&&window.videoPlayers.forEach(player=>{const currentPlayer=player;(player.id===videoID||player.media.id===videoID)&&($(slide).hasClass("is-selected")||(currentPlayer.keyboard={focused:!1,global:!1}))});break;case"video":videoID=$(slide).find("[data-plyr-video-id]").data("plyr-video-id"),window.videoPlayers&&window.videoPlayers.forEach(player=>{const currentPlayer=player;(player.id===videoID||player.media.id===videoID)&&($(slide).hasClass("is-selected")||(currentPlayer.keyboard={focused:!1,global:!1}))});break;case"model":$(slide).hasClass("is-selected")&&mediaType==="model"&&window.isScreenSizeLarge()&&($(slide).on("mouseenter",()=>{$productGallery.flickity("unbindDrag")}),$(slide).on("mouseleave",()=>{$productGallery.flickity("bindDrag")}));break;default:break}});const loopingEnabled=$productGallery.data("video-loop");$.each(window.videoPlayers,(index,player)=>{const videoPlayer=player;videoPlayer.loop=loopingEnabled})}),$productGallery.on("change.flickity",()=>{$slides.each((index,slide)=>{const mediaType=$(slide).data("media-type")||$(slide).find("[data-media-type]").data("media-type");if($(slide).hasClass("is-selected"))switch(mediaType){case"model":window.isScreenSizeLarge()&&($(slide).on("mouseenter",()=>{$productGallery.flickity("unbindDrag")}),$(slide).on("mouseleave",()=>{$productGallery.flickity("bindDrag")})),$(slide).find("model-viewer").on("shopify_model_viewer_ui_toggle_play",()=>{$productGallery.flickity("unbindDrag")}),$(slide).find("model-viewer").on("shopify_model_viewer_ui_toggle_pause",()=>{$productGallery.flickity("bindDrag")});break;default:$productGallery.flickity("bindDrag");break}else switch(mediaType){case"external_video":$.each(window.videoPlayers,(_index,player)=>{player.pause()});break;case"video":$.each(window.videoPlayers,(_index,player)=>{player.pause()});break;default:break}}),window.productMedia.showModelIcon($productGallery)}),$productGallery.flickity({wrapAround:!0,adaptiveHeight:!0,dragThreshold:10,imagesLoaded:!0,pageDots:!1,prevNextButtons:$productGallery.data("media-count")>1||$slides.length>1,autoPlay:slideshowSpeed*1e3,watchCSS:!1}),$.each(window.videoPlayers,(index,player)=>{player.on("controlshidden",()=>{$productGallery.find(".flickity-prev-next-button").css("height","auto")}),player.on("controlsshown",()=>{$productGallery.find(".flickity-prev-next-button").css("height","calc(100% - 64px)")})});function autoplayVideo(videoID,$slide){$.each(window.videoPlayers,(index,player)=>{parseInt(player.media.dataset.plyrVideoId,10)===videoID&&(player.play(),player.on("exitfullscreen",()=>{$slide.closest(".product-gallery").find(".product-gallery__thumbnails").focus()}))})}function autoplayYoutubeVideo(iframeID,$slide){$.each(window.videoPlayers,(index,player)=>{player.playing&&player.pause(),player.media.id===iframeID&&(player.play(),player.on("exitfullscreen",()=>{$slide.closest(".product-gallery").find(".product-gallery__thumbnails").focus()}))})}function checkForVideos(){$slides.each((index,slide)=>{const $slide=$(slide),mediaType=$slide.data("media-type")||$slide.find("[data-media-type]").data("media-type");let videoID=$slide.find("video").data("plyr-video-id");const iframeID=$slide.find("iframe").attr("id");$slide.hasClass("is-selected")&&(mediaType==="video"?(videoID=$slide.find("video").data("plyr-video-id"),videoID&&autoplayVideo(videoID,$slide)):mediaType==="external_video"&&iframeID&&autoplayYoutubeVideo(iframeID,$slide))})}const $sliderArrows=$productGallery.find(".flickity-prev-next-button");if(($sliderArrows||$thumbnails)&&window.isScreenSizeLarge()&&($sliderArrows.on("click",()=>{const pId=$productGallery.data("product-id");return $productGallery.on("settle.flickity",()=>{const $selectedSlide=$productGallery.find(".gallery-cell.is-selected"),mediaType=$selectedSlide.data("media-type")||$selectedSlide.find("[data-media-type]").data("media-type");if((mediaType==="video"||mediaType==="external_video")&&checkForVideos(),mediaType==="model"){const sortedModels=[];$.each(window.productMedia.models,model=>{$(model.container).closest(".gallery-cell").data("product-id")===pId&&sortedModels.push(model)}),$.each(sortedModels,model=>{$(model.container).closest(".gallery-cell").hasClass("is-selected")&&model.play()})}$productGallery.off("settle.flickity")}),!1}),$thumbnails.on("click",event=>{const index=$(event.currentTarget).index(),pId=$productGallery.data("product-id");return $productGallery.flickity("select",index),$productGallery.on("settle.flickity",()=>{const $selectedSlide=$productGallery.find(".gallery-cell.is-selected"),mediaType=$selectedSlide.data("media-type")||$selectedSlide.find("[data-media-type]").data("media-type");if((mediaType==="video"||mediaType==="external_video")&&checkForVideos(),mediaType==="model"){const sortedModels=[];$.each(window.productMedia.models,(_index,model)=>{$(model.container).closest(".gallery-cell").data("product-id")===pId&&sortedModels.push(model)}),$.each(sortedModels,(_index,model)=>{$(model.container).closest(".gallery-cell").hasClass("is-selected")&&model.play()})}$productGallery.off("settle.flickity")}),!1}),$thumbnails.keypress(event=>{const index=$(event.currentTarget).index(),pId=$productGallery.data("product-id");if(event.which===13){$productGallery.flickity("select",index);const $selectedSlide=$productGallery.find(".gallery-cell.is-selected");$productGallery.on("settle.flickity",()=>{$selectedSlide.find("[data-youtube-video]").attr("tabindex","0"),$selectedSlide.find("model-viewer, .plyr, a").focus(),$productGallery.off("settle.flickity")});const mediaType=$selectedSlide.data("media-type")||$selectedSlide.find("[data-media-type]").data("media-type");if((mediaType==="video"||mediaType==="external_video")&&checkForVideos(),mediaType==="model"){const sortedModels=[];$.each(window.productMedia.models,model=>{$(model.container).closest(".gallery-cell").data("product-id")===pId&&sortedModels.push(model)}),$.each(sortedModels,model=>{$(model.container).closest(".gallery-cell").hasClass("is-selected")&&model.play()})}return!1}})),thumbnailsEnabled===!0&&thumbnailsSliderEnabled===!0&&$slides.length>1)if(window.PXUTheme.media_queries.large.matches)if(thumbnailsPosition==="left"||thumbnailsPosition==="right"){$thumbnailProductGallery.css("max-height",$productGallery.closest(".product-gallery").outerHeight()),$thumbnailProductGallery.addClass("vertical-slider-enabled"),$thumbnails.on("click",event=>{const index=$(event.currentTarget).index();$productGallery.flickity("select",index)});const navCellHeight=$thumbnails.height(),navHeight=$thumbnailProductGallery.height();$productGallery.on("select.flickity",()=>{const flkty=$productGallery.data("flickity");$thumbnailProductGallery.find(".is-nav-selected").removeClass("is-nav-selected");const scrollY=$thumbnails.eq(flkty.selectedIndex).addClass("is-nav-selected").position().top+$thumbnailProductGallery.scrollTop()-(navHeight+navCellHeight)/2;$thumbnailProductGallery.animate({scrollTop:scrollY})})}else $thumbnails.on("click",event=>{console.log("event thumbnails",$thumbnails,event);const index=$(event.currentTarget).index();$productGallery.flickity("select",index)}),$thumbnailProductGallery.flickity({cellAlign:"center",contain:!0,groupCells:"80%",imagesLoaded:!0,pageDots:!1,prevNextButtons:$thumbnails.length>5?thumbnailsArrows:!1,asNavFor:$productGallery[0]}),$thumbnailProductGallery.on("settle.flickity",()=>{$thumbnailProductGallery.flickity("resize")}),$(window).on("load",()=>{$thumbnailProductGallery.flickity("resize")}),$.each($thumbnails,(index,thumbnail)=>{const $thumbnail=$(thumbnail);$thumbnail.hasClass("is-selected")&&$thumbnail.on("focus",()=>{$thumbnailProductGallery.flickity("selectCell",index)})});else $thumbnailProductGallery.flickity({cellAlign:"center",contain:!0,groupCells:"80%",imagesLoaded:!0,pageDots:!1,prevNextButtons:$thumbnails.length>5?thumbnailsArrows:!1,asNavFor:$productGallery[0]});else thumbnailsEnabled===!0&&$thumbnailProductGallery.find(".product-gallery__thumbnail").on("click",function(){const index=$(this).index();$productGallery.flickity("selectCell",index)});$(window).on("load",()=>{$productGallery.flickity().flickity("resize")}),$productGallery.on("settle.flickity",()=>{$productGallery.flickity().flickity("resize")})},loadProductRecommendations(){const $productRecommendations=$("[data-product-recommendations]"),$productRecommendationsSection=$(".shopify-section--recommended-products"),sectionID=$productRecommendations.data("section-id"),productID=$productRecommendations.data("product-id"),limit=$productRecommendations.data("limit"),recommendationsURL=$productRecommendations.data("recommendations-url"),sectionEnabled=$productRecommendationsSection.find($productRecommendations).data("enabled"),$recommendedProductSlider=$(".js-recommended-products-slider");function loadDynamicProducts(){const requestUrl=`${recommendationsURL}?section_id=${sectionID}&limit=${limit}&product_id=${productID}`;$.ajax({type:"GET",url:requestUrl,success(data){if(!sectionEnabled)return;const $recommendedProductsElement=$(data).find(".product-recommendations").html();$productRecommendations.html($recommendedProductsElement),$recommendedProductSlider.length?window.productPage.recommendedProductsSlider():$("[data-product-recommendations] [data-product-gallery]").each((_,gallery)=>{const $productGallery=$(gallery);window.productPage.enableGallery($productGallery)}),window.PXUTheme.currency.show_multiple_currencies&&window.currencyConverter.convertCurrencies(),window.productPage.runOptionSelector($productRecommendationsSection),window.Shopify.PaymentButton&&window.Shopify.PaymentButton.init(),window.hideNoScript(),window.videoFeature.setupRecommendedVideoPlayer(),$(".swatch_options label").on("click",function(){window.quickShop.toggleSwatchImages($(this))}),window.PXUTheme.theme_settings.collection_secondary_image&&window.imageFunctions.showSecondaryImage()}})}if(!sectionEnabled)return;$productRecommendations.hasClass("meta-related-recommended-collection")?($recommendedProductSlider.length?window.productPage.recommendedProductsSlider():$(".product-recommendations [data-product-gallery]").each(function(){const $productGallery=$(this);window.productPage.enableGallery($productGallery)}),window.productPage.runOptionSelector($productRecommendationsSection)):loadDynamicProducts()},productSwatches(){if(window.PXUTheme.theme_settings.product_form_style==="radio"){if($(".js-product-section").length){const $productForms=$(".js-product-section").find(".product_form");$productForms.addClass("is-visible"),$productForms.each((_,productForm)=>{const $productForm=$(productForm),JSONData=$productForm.data("product"),productSection=`.product-${$productForm.data("product-id")} .js-product-section`;$productForm.find(".swatch_options .swatch").length>1&&window.Shopify.linkOptionSelectors(JSONData,productSection)})}$(".js-product-section").length>1&&$("body").on("click",".swatch-element",swatchElement=>{const $swatchElement=$(swatchElement.currentTarget),swatchValue=$swatchElement.data("value").toString();$swatchElement.siblings(`input[value="${swatchValue.replace(/"/g,'\\"')}"]`).prop("checked",!0).trigger("change");const JSONData=$swatchElement.parents(".product_form").data("product"),productSection=`.product-${$swatchElement.parents(".product_form").data("product-id")} .js-product-section`;$swatchElement.parents(".product_form").find(".swatch_options .swatch").length>1&&window.Shopify.linkOptionSelectors(JSONData,productSection)})}},recommendedProductsSlider(){$(".product-recommendations .products-slider").each((_,productSlider)=>{const $productSlider=$(productSlider),productsPerSlide=$productSlider.data("products-per-slide"),productsLimit=$productSlider.data("products-limit"),productsAvailable=$productSlider.data("products-available");let cellAlign,draggable,prevNext,wrapAround,initialIndex;const lessSlidesThanProducts=productsAvailable>productsPerSlide,limitGreaterThanSlide=productsLimit>productsPerSlide,evenSlide=productsPerSlide%2===0;evenSlide&&lessSlidesThanProducts&&limitGreaterThanSlide?cellAlign="left":cellAlign="center",lessSlidesThanProducts&&limitGreaterThanSlide?(draggable=!0,prevNext=!0,wrapAround=!0):(draggable=!1,prevNext=!1,wrapAround=!1),evenSlide&&lessSlidesThanProducts&&limitGreaterThanSlide?initialIndex=0:productsPerSlide==="3"&&productsAvailable?initialIndex=1:productsPerSlide==="5"&&productsAvailable?initialIndex=2:productsPerSlide==="7"&&productsAvailable&&(initialIndex=3),window.PXUTheme.media_queries.medium.matches&&(cellAlign="center",draggable=!0,prevNext=!0,wrapAround=!0,initialIndex=1,$productSlider.parents(".even-num-slides").removeClass("even-num-slides")),$productSlider.flickity({lazyLoad:2,imagesLoaded:!0,draggable,cellAlign,prevNextButtons:prevNext,wrapAround,contain:!0,freeScroll:!0,initialIndex})})},initializeQuantityBox(){$("body").on("click",".js-change-quantity",e=>{const $this=$(e.currentTarget),$input=$this.siblings("input"),val=parseInt($input.val(),10);let valMax=1e29;const valMin=$input.attr("min")||0;$input.attr("max")!=null&&(valMax=$input.attr("max")),(isNaN(val)||valvalMax&&$input.val(valMax),$this.data("func")==="plus"?valvalMin&&$input.val(val-1),$this.parents(".cart_item").length&&val-1===0&&$this.closest(".cart_item").addClass("animated fadeOutUp")),$input.trigger("change")})},unload($target){$target.find(".products-slider").flickity("destroy"),$("body").off("click",".js-change-quantity")}};class HeaderFader{constructor(){this.el=document.querySelector("[data-desktop-header]"),this.el&&(this.openers=new Set,this.fadeClass="feature_image",this.el.classList.contains("feature_image")&&(this.shouldFade=this.el.classList.contains("feature_image")))}updateShouldFade(shouldFade){if(this.el){if(!this.openers.size){this.shouldFade=shouldFade;return}shouldFade?(this._fade(),this.shouldFade=shouldFade):(this.shouldFade&&(this.openers.clear(),this._clear()),this.shouldFade=shouldFade)}}fade(requestor){this.el&&this.shouldFade&&(this.openers.has(requestor)||(this.openers.add(requestor),this._fade()))}clear(requestor){this.el&&this.shouldFade&&(this.openers.delete(requestor),!this.openers.size&&this._clear())}_fade(){this.el.classList.remove(this.fadeClass)}_clear(){this.el.classList.add(this.fadeClass)}}class NavigationDesktopParent{constructor(options){this.menuItem=options.menuItem,this.detailsItem=options.menuItem.querySelector("[data-nav-desktop-details]"),this.parentMenu=options.parentMenu,this._locked=options.locked||(()=>!1),this.menuLink=this.detailsItem.querySelector("[data-nav-desktop-link]"),this.submenuEl=this.menuItem.querySelector("[data-nav-desktop-submenu]"),this.isWideNav="navDesktopFullWidthMenu"in this.submenuEl.dataset,this.openOnClick=this.menuItem.closest("[data-show-dropdown-on-click]"),this._isOpen=!1,this.submenu=null,this.events=new window.EventHandler,this._open=this._open.bind(this),this._close=this._close.bind(this),this.close=this.close.bind(this),this.closeEsc=e=>{e.key==="Escape"&&(this.menuLink.focus(),this._close())},this.closeTimer=null,this.mouseover=()=>{clearTimeout(this.closeTimer),this._open()},this.mouseout=()=>{this.closeTimer=setTimeout(this.close,50)},this.click=e=>{e.stopPropagation();const clickedParent=e.target.closest("[data-nav-desktop-link]");if(clickedParent&&"href"in clickedParent.dataset&&(e.preventDefault(),this._isOpen)){window.location=clickedParent.dataset.href;return}this._open()},this.focusin=e=>{e.stopPropagation(),this.parentMenu.closeSiblings(this)},this.animation=window.animations.transition({el:this.submenuEl,state:"closed"}),this.openOnClick||(this.events.register(this.menuItem,"mouseover",()=>this.mouseover()),this.events.register(this.menuItem,"mouseout",()=>this.mouseout())),this.events.register(this.menuItem,"click",e=>this.click(e)),this.events.register(this.menuItem,"touchend",e=>this.click(e)),this.events.register(this.menuItem,"focusin",e=>this.focusin(e)),this.events.register(document.body,"click",()=>this._close()),this.events.register(document.body,"focusin",()=>this._close())}forceClose(){this._close()}close(){this._close()}forceOpen(){this._open(!0)}open(){this._open()}_setAlternateDrop(){if(this.isWideNav)return;const menuBounds=this.submenuEl.getBoundingClientRect();menuBounds.right>document.documentElement.clientWidth&&this.submenuEl.classList.add("alternate-drop"),menuBounds.left<0&&this.submenuEl.classList.add("alternate-drop-left")}_removeAlternateDrop(){this.submenuEl.classList.remove("alternate-drop")}_open(force=!1){this._isOpen||this._locked()||(this._isOpen=!0,this.parentMenu.closeSiblings(this),this.closeEscEvent=this.events.register(window,"keyup",e=>this.closeEsc(e)),this.submenu||(this.submenu=new NavigationDesktopMenu({navList:this.submenuEl})),this._removeAlternateDrop(),this.isWideNav&&window.headerFader.fade(this),this.detailsItem.setAttribute("open","open"),this.animation.animateTo("open",{onStart:({el})=>{this._setAlternateDrop()},force}).then(state=>{state=="open"&&this.menuLink.setAttribute("aria-expanded",!0)}))}_close(){!this._isOpen||this._locked()||(this.submenu&&(this.submenu.unload(),this.submenu=null),this._isOpen=!1,this.events.unregister(this.closeEscEvent),this.isWideNav&&window.headerFader.clear(this),this.animation.animateTo("closed").then(state=>{state=="closed"&&(this._removeAlternateDrop(),this.menuLink.setAttribute("aria-expanded",!1),this.detailsItem.removeAttribute("open"))}))}unload(){this.forceClose(),this.events.unregisterAll(),this.closeEscEvent&&this.events.unregister(this.closeEscEvent)}}class NavigationDesktopMenu{constructor(options){this.navList=options.navList,this.menuItems=this.navList.children,this._selectedBlock=null,this.parents=[],this.events=new window.EventHandler;for(let i=0;ithis._selectedBlock!==null})):this.events.register(menuItem,"focusin",()=>this.closeAllMenus())}}onMeganavSelect(block){const meganavParent=this.parents.find(parent=>parent.menuItem===block);meganavParent&&(meganavParent.forceOpen(),this._selectedBlock=meganavParent)}onMeganavDeselect(){this._selectedBlock=null,this.closeAllMenus()}closeSiblings(current){this.parents.forEach(parent=>{parent!==current&&parent.close()})}closeAllMenus(){this.parents.forEach(parent=>parent.close())}unload(){this.closeAllMenus(),this.parents.forEach(parent=>{parent.unload()}),this.events.unregisterAll()}}class NavigationDesktop{constructor(el){this.navTier1=el.querySelector("[data-nav-desktop-tier-1]"),this.navTier1&&(this.headerNavMenu=new NavigationDesktopMenu({navList:this.navTier1}))}onMeganavSelect(block){this.headerNavMenu&&this.headerNavMenu.onMeganavSelect(block)}onMeganavDeselect(){this.headerNavMenu&&this.headerNavMenu.onMeganavDeselect()}unload(){this.headerNavMenu&&this.headerNavMenu.unload()}}class NavigationDesktopManager{constructor(){this.desktopNavs=[]}onMeganavSelect(block){this.desktopNavs.forEach(nav=>nav.onMeganavSelect(block))}onMeganavDeselect(){this.desktopNavs.forEach(nav=>nav.onMeganavDeselect())}initAll(){this.unload(),this.desktopNavs=Array.prototype.map.call(document.querySelectorAll("[data-nav-desktop]"),navEl=>new NavigationDesktop(navEl))}unload(){this.desktopNavs.forEach(nav=>nav.unload())}}window.navigationDesktopManager=new NavigationDesktopManager;class MobileMenuDrawer{constructor(el){this.el=el,this.el&&(this.trigger=this.el.querySelector("[data-mobile-menu-trigger]"),this.icon=this.el.querySelector("[data-mobile-menu-icon]"),this.animation=window.animations.transition({el:this.el.querySelector(["[data-nav]"]),state:"closed"}),this.events=new window.EventHandler,this.events.register(this.trigger,"click",e=>{e.preventDefault(),this._toggle()}))}_toggle(){if(this.animation.state==="open"){this.close();return}this.open()}open(){this.el&&this.animation.state!=="open"&&(this.el.open=!0,this.icon.classList.add("open"),document.body.classList.add("is-active"),document.getElementsByTagName("html")[0].classList.add("lock-scroll"),this.animation.animateTo("open"))}close(){this.el&&this.animation.state!=="closed"&&(this.icon.classList.remove("open"),this.animation.animateTo("closed"),document.body.classList.remove("is-active"),document.getElementsByTagName("html")[0].classList.remove("lock-scroll"))}unload(){this.events&&this.events.unregisterAll()}}window.header={init(){window.headerFader=new HeaderFader,window.navigationDesktopManager.initAll(),window.mobileMenuDrawer=new MobileMenuDrawer(document.querySelector("[data-mobile-menu]")),console.log("Mobile drawer init");var closeMiniCart=function(){$("body").removeClass("is-active").removeClass("blocked-scroll"),$(".dropdown_link").toggleClass("active_link"),$(".cart-container").removeClass("active_link")},openMiniCart=function($cart_container){window.mobileMenuDrawer.close(),$(".dropdown_link").removeClass("active_link"),$cart_container.addClass("active_link")};if($(".promo-banner").length&&window.Cookies.get("promo-banner")!=="dismiss"&&($("body").addClass("promo-banner--show"),$(".promo-banner").on("click",".promo-banner__close",()=>{$("body").removeClass("promo-banner--show"),window.Cookies.set("promo-banner","dismiss",{expires:30,path:"",domain:"",sameSite:"None",secure:!0})})),$("html").on("click",event=>{!$(event.target).closest(".cart-container").length&&$(".cart_content").is(":visible")&&closeMiniCart()}),$(document).click(function(e){$(e.target).closest(".mobile-menu-container").length==0&&window.mobileMenuDrawer.close()}),$(".mobile_nav").on("click",event=>{!$(event.target).closest(".cart-container").length&&$(".cart_content").is(":visible")&&closeMiniCart()}),window.PXUTheme.media_queries.large.matches){if($(".header").hasClass("header-fixed--true")){if($("body").on("click",'.banner a[href^="#"]',function(e){e.preventDefault();var anchorLink=$(this).attr("href"),headerHeight=$(".main-nav__wrapper.sticky_nav").outerHeight();$("html, body").animate({scrollTop:$(anchorLink).offset().top-headerHeight},2e3)}),!$(".main-nav__wrapper").hasClass("sticky_nav")){let stickyNavAnimation;window.sticky_nav=new Headhesive(".main-nav__wrapper",{offset:700,throttle:300,classes:{clone:"sticky_nav",stick:"--stick",unstick:"sticky_nav--unstick"},onInit:function(){$(".sticky_nav .secondary_logo").css("display","none"),$(".sticky_nav .primary_logo").css("display","block"),$(".sticky_nav .icon-search").css("display","block"),$(".sticky_nav .search__form").css("display","none"),$(".sticky_nav .search-link").css("display","block"),window.navigationDesktopManager.initAll(),stickyNavAnimation=new window.animations.transition({el:document.querySelector(".sticky_nav"),state:"closed"})},onStick:function(){stickyNavAnimation.animateTo("open",{onStart:()=>{var maxHeight=0,$targetHeightElement=$(".sticky_nav .main-nav");$targetHeightElement.each(function(){maxHeight=maxHeight>$(this).outerHeight()?maxHeight:$(this).outerHeight()}),$(".sticky_nav .mini_cart").css("height",maxHeight),$(".sticky_nav .cart_content").css("top",maxHeight),document.querySelector(".sticky_nav").style.setProperty("--sticky-header-height",`${maxHeight}px`)}})},onUnstick:function(){$(".cart-container").removeClass("active_link"),stickyNavAnimation.animateTo("closed",{force:!0})},onDestroy:()=>{stickyNavAnimation&&stickyNavAnimation.unload()}})}}else $(".header-fixed--true").removeClass("header-fixed--true"),$(".main-nav__wrapper").length>1&&$(".main-nav__wrapper").first().remove();$("img.primary_logo:visible")?$(".logo img",$(".feature_image .header")).attr("src",$(".logo img").data("src-home")):$(".logo img").attr("src",$(".logo img").data("src"))}else $("#header").hasClass("mobile_nav-fixed--true")?($("body").addClass("mobile_nav-fixed--true"),$("body").removeClass("mobile_nav-fixed--false"),$("body").on("click",'.banner a[href^="#"]',function(e){e.preventDefault();var anchorLink=$(this).attr("href"),headerHeight=$("#header").outerHeight();$("html, body").animate({scrollTop:$(anchorLink).offset().top-headerHeight},2e3)})):($("body").removeClass("mobile_nav-fixed--true"),$("body").addClass("mobile_nav-fixed--false"));$("#header .cart_content").length<1&&$("#header .cart-container").append($(".header .cart_content").clone());let closeTimer=null;window.PXUTheme.theme_settings.cart_action!=="redirect_cart"&&($(".mini_cart").on("click ",function(){const $cartContainer=$(this).parent();$cartContainer.hasClass("active_link")?closeMiniCart():openMiniCart($cartContainer)}),$(".cart-container").on("mouseenter",function(){const $cartContainer=$(this);clearTimeout(closeTimer),openMiniCart($cartContainer)}),$(".cart-container").on("mouseleave",()=>{closeTimer=setTimeout(()=>closeMiniCart(),400)})),$(".cart_content__continue-shopping").on("click",()=>{closeMiniCart()})},unload(){window.sticky_nav&&window.sticky_nav.destroy(),window.navigationDesktopManager.unload(),window.mobileMenuDrawer.unload(),$("body").off("click",".mobile_nav"),$("html").off("click"),$(".cart-container").off("mouseenter"),$(".cart-container").off("mouseleave"),$(".mini_cart").off("click"),$(".cart_content__continue-shopping").off("click"),$("body").off("click",'.banner a[href^="#"]'),$(".main-nav__wrapper.sticky_nav").remove()}};class Meganav{constructor(el,options={}){this.options={getTargets:()=>[],afterChange:()=>{},...options},this.content=el,this.targetHandle=this.content.dataset.meganavHandle,this.targets=this.options.getTargets({handle:this.targetHandle}),this.newMenuItems=[],this.targets.length&&(this.refTarget=this.targets[0],this.title=this.refTarget.querySelector("[data-nav-title]").innerHTML,this.url=this._getUrl(this.refTarget),this.nav=this.refTarget.closest("[data-nav]"),this.menuItemTemplate=this.nav.querySelector("[data-nav-parent-template]"),this.inject())}inject(){if(!this.targets.length)return;this._removeInjectedContent();const newMenuItem=this.menuItemTemplate.content.firstElementChild.cloneNode(!0);newMenuItem.querySelector("[data-meganav-target-container]").appendChild(this.content.cloneNode(!0)),newMenuItem.querySelector("[data-nav-title]").innerHTML=this.title,this._updateHref(newMenuItem,this.url),this.newMenuItems=Array.prototype.map.call(this.targets,target=>{const newItem=newMenuItem.cloneNode(!0);return target.replaceWith(newItem),newItem}),this.options.afterChange()}unload(){this._removeInjectedContent(),this.options.afterChange()}_updateHref(target,url){const dataHrefEl=target.querySelector("[data-href]");if(dataHrefEl){dataHrefEl.dataset.href=url;return}const a=target.querySelector("a");if(a){a.href=url;return}}_getUrl(target){const dataHrefEl=target.querySelector("[data-href]");if(dataHrefEl)return dataHrefEl.dataset.href;const a=target.querySelector("a");return a?a.href:""}_removeInjectedContent(){this.newMenuItems.forEach((menuItem,i)=>{menuItem.replaceWith(this.targets[i])}),this.newMenuItems=[]}}class MeganavManager{constructor(){this.meganavs=new Map}select(el){if(!this.meganavs.get(el))return;const{desktop}=this.meganavs.get(el);desktop.newMenuItems.forEach(menuItem=>{window.navigationDesktopManager.onMeganavSelect(menuItem)})}deselect(){window.navigationDesktopManager.onMeganavDeselect()}add(el){!el.querySelector("[data-meganav-mobile]")||!el.querySelector("[data-meganav-desktop]")||this.meganavs.set(el,{mobile:new Meganav(el.querySelector("[data-meganav-mobile]"),{getTargets:({handle})=>document.querySelectorAll(`[data-meganav-mobile-target="${handle}"]`)}),desktop:new Meganav(el.querySelector("[data-meganav-desktop]"),{getTargets:({handle})=>document.querySelectorAll(`[data-meganav-desktop-target="${handle}"]`),afterChange:()=>window.navigationDesktopManager.initAll()})})}remove(el){const meganav=this.meganavs.get(el);meganav&&(meganav.mobile.unload(),meganav.desktop.unload(),this.meganavs.delete(el))}injectAll(){this.unload(),this._addAll();for(const[el,meganav]of this.meganavs)meganav.mobile.inject(),meganav.desktop.inject()}unload(){for(const[el,meganav]of this.meganavs)meganav.mobile.unload(),meganav.desktop.unload();this.meganavs.clear()}_addAll(){document.querySelectorAll(".shopify-section--mega-menu").forEach(meganavEl=>{this.meganavs.has(meganavEl)||this.add(meganavEl)})}}window.meganavManager=new MeganavManager,window.map={init(){if($(".lazymap").length>0&&lazyframe(".lazymap"),$(".maps").hasClass("js-api-map")){const mapsToLoad=[];$(".map").each(function(i){mapsToLoad.push(this),mapsToLoad[i].sectionid=$(this).data("id"),mapsToLoad[i].address=$(this).data("address"),mapsToLoad[i].directions=$(this).data("directions-address"),mapsToLoad[i].zoom=$(this).data("zoom"),mapsToLoad[i].mapstyle=$(this).data("style"),mapsToLoad[i].showpin=$(this).data("pin"),mapsToLoad[i].apikey=$(this).data("api-key")}),$.each(mapsToLoad,i=>{$.ajaxSetup({cache:!0}),$.getScript(`https://maps.googleapis.com/maps/api/js?key=${mapsToLoad[i].apikey}`).then(()=>{window.map.findLocation(mapsToLoad[i]),$.ajaxSetup({cache:!1})})})}},findLocation(mapArray){let geoLat,geoLng;new google.maps.Geocoder().geocode({address:mapArray.dataset.address},(results,status)=>{status===google.maps.GeocoderStatus.OK?(geoLat=results[0].geometry.location.lat(),geoLng=results[0].geometry.location.lng(),window.map.initMap(geoLat,geoLng,mapArray)):console.log(`Error:${status}`)})},initMap(lat,lng,mapArray){const location={lat,lng};let styleJson=[];mapArray.mapstyle==="aubergine"?styleJson=[{elementType:"geometry",stylers:[{color:"#1d2c4d"}]},{elementType:"labels.text.fill",stylers:[{color:"#8ec3b9"}]},{elementType:"labels.text.stroke",stylers:[{color:"#1a3646"}]},{featureType:"administrative.country",elementType:"geometry.stroke",stylers:[{color:"#4b6878"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#64779e"}]},{featureType:"administrative.province",elementType:"geometry.stroke",stylers:[{color:"#4b6878"}]},{featureType:"landscape.man_made",elementType:"geometry.stroke",stylers:[{color:"#334e87"}]},{featureType:"landscape.natural",elementType:"geometry",stylers:[{color:"#023e58"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#283d6a"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#6f9ba5"}]},{featureType:"poi",elementType:"labels.text.stroke",stylers:[{color:"#1d2c4d"}]},{featureType:"poi.park",elementType:"geometry.fill",stylers:[{color:"#023e58"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#3C7680"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#304a7d"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#98a5be"}]},{featureType:"road",elementType:"labels.text.stroke",stylers:[{color:"#1d2c4d"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#2c6675"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#255763"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#b0d5ce"}]},{featureType:"road.highway",elementType:"labels.text.stroke",stylers:[{color:"#023e58"}]},{featureType:"transit",elementType:"labels.text.fill",stylers:[{color:"#98a5be"}]},{featureType:"transit",elementType:"labels.text.stroke",stylers:[{color:"#1d2c4d"}]},{featureType:"transit.line",elementType:"geometry.fill",stylers:[{color:"#283d6a"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#3a4762"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#0e1626"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#4e6d70"}]}]:mapArray.mapstyle==="retro"?styleJson=[{elementType:"geometry",stylers:[{color:"#ebe3cd"}]},{elementType:"labels.text.fill",stylers:[{color:"#523735"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f1e6"}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#c9b2a6"}]},{featureType:"administrative.land_parcel",elementType:"geometry.stroke",stylers:[{color:"#dcd2be"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#ae9e90"}]},{featureType:"landscape.natural",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#93817c"}]},{featureType:"poi.park",elementType:"geometry.fill",stylers:[{color:"#a5b076"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#447530"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#f5f1e6"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#fdfcf8"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#f8c967"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#e9bc62"}]},{featureType:"road.highway.controlled_access",elementType:"geometry",stylers:[{color:"#e98d58"}]},{featureType:"road.highway.controlled_access",elementType:"geometry.stroke",stylers:[{color:"#db8555"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#806b63"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"transit.line",elementType:"labels.text.fill",stylers:[{color:"#8f7d77"}]},{featureType:"transit.line",elementType:"labels.text.stroke",stylers:[{color:"#ebe3cd"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"water",elementType:"geometry.fill",stylers:[{color:"#b9d3c2"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#92998d"}]}]:mapArray.mapstyle==="silver"?styleJson=[{elementType:"geometry",stylers:[{color:"#f5f5f5"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f5f5"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#ffffff"}]},{featureType:"road.arterial",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#dadada"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#c9c9c9"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]}]:mapArray.mapstyle==="night"?styleJson=[{elementType:"geometry",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.fill",stylers:[{color:"#746855"}]},{elementType:"labels.text.stroke",stylers:[{color:"#242f3e"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#263c3f"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#6b9a76"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#38414e"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#212a37"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca5b3"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#746855"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1f2835"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#f3d19c"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#2f3948"}]},{featureType:"transit.station",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#17263c"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#515c6d"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{color:"#17263c"}]}]:styleJson=[],$(".js-map-link").attr("href",`https://www.google.com/maps/place/${mapArray.directions}/@${lat},${lng}`);const mapOptions={zoom:mapArray.zoom,center:location,styles:styleJson,disableDefaultUI:!1},map=new google.maps.Map(document.getElementById(mapArray.sectionid),mapOptions);if(mapArray.showpin===!0){const marker=new google.maps.Marker({position:location,map})}}},window.shoppableImage={init(){$("[data-shoppable-image-wrapper]").each((_,wrapper)=>{const blocks=wrapper.querySelectorAll("[data-shoppable-image-block]");let currentImage=wrapper.querySelector("[data-shoppable-image]");if(blocks.length>1){const $wrapper=$(wrapper),settings={slideshowSpeed:$wrapper.data("slideshow-speed")*1e3,slideshowTextAnimation:$wrapper.data("slideshow-text-animation"),slideshowTransition:$wrapper.data("slideshow-transition")};if(!$wrapper.hasClass("flickity-enabled")){if($wrapper.flickity({wrapAround:!0,cellAlign:"left",imagesLoaded:!0,prevNextButtons:!0,draggable:!0,arrowShape:window.arrowSize,pageDots:!0,autoPlay:settings.slideshowSpeed,adaptiveHeight:!0}),wrapper.querySelector(".shoppable-image__bottom-bar")){const prevNextBtns=wrapper.querySelectorAll(".flickity-prev-next-button"),currentShoppableImage=window.Flickity.data($wrapper[0]).selectedElement.querySelector("[data-shoppable-image]");prevNextBtns.forEach(btn=>$(btn).appendTo(currentShoppableImage)),$wrapper.on("change.flickity",()=>{const currentShoppableImage2=window.Flickity.data($wrapper[0]).selectedElement.querySelector("[data-shoppable-image]");prevNextBtns.forEach(btn=>$(btn).appendTo(currentShoppableImage2))})}if(settings.slideshowTextAnimation!==""){const flkty=$wrapper.data("flickity");setTimeout(()=>{$wrapper.find(".gallery-cell:nth-child(1) [data-slideshow-caption-text]").addClass(`animated ${settings.slideshowTextAnimation}`)},400),$wrapper.on("select.flickity",()=>{if($wrapper.is(":visible")){const currentSlide=flkty.selectedIndex+1;setTimeout(()=>{$wrapper.find("[data-slideshow-caption-text]").removeClass(`animated ${settings.slideshowTextAnimation}`),$wrapper.find(`.gallery-cell:nth-child(${currentSlide}) [data-slideshow-caption-text]`).addClass(`animated ${settings.slideshowTextAnimation}`)},400)}})}if(window.PXUTheme.media_queries.medium.matches&&settings.slideshowTransition!=="fade"){const flkty=$wrapper.data("flickity"),currentSlide=flkty.selectedIndex+1;$wrapper.find(`.gallery-cell:nth-child(${currentSlide}) [data-hotspot]`).each((_2,hotspot)=>{this.repositionHotspotContent(hotspot)}),$wrapper.on("settle.flickity",()=>{const currentSlide2=flkty.selectedIndex+1;$wrapper.find(`.gallery-cell:nth-child(${currentSlide2}) [data-hotspot]`).each((_2,hotspot)=>{this.repositionHotspotContent(hotspot)})})}else this.repositionHotspotContentEls(currentImage);$wrapper.on("settle.flickity",()=>{currentImage=window.Flickity.data(wrapper).selectedElement,this.repositionHotspotContentEls(currentImage)}),wrapper.closest(".shopify-section--shoppable-image").classList.add("shopify-section--shoppable-image--slider-enabled")}}else this.repositionHotspotContentEls(currentImage);const interactiveEls=wrapper.querySelectorAll("[data-interactive-element]");document.body.addEventListener("click",e=>{const clickedInteractiveEl=e.target.closest("[data-interactive-element]");interactiveEls.forEach((el,index)=>{const block=el.closest("[data-shoppable-image-block]");clickedInteractiveEl&&el.dataset.hotspotId===clickedInteractiveEl.dataset.hotspotId?(block.classList.add(el.dataset.hotspotId,`hotspot--${index+1}`),el.classList.add("has-active-state")):(block.classList.remove(el.dataset.hotspotId,`hotspot--${index+1}`),el.classList.remove("has-active-state"))})}),window.addEventListener("resize",this.debounce(()=>{this.repositionHotspotContentEls(currentImage)}))})},repositionHotspotContent(hotspot){const contentWrapperEl=hotspot.querySelector("[data-content-wrapper]"),contentEl=contentWrapperEl.querySelector("[data-content]"),shoppableImage=hotspot.closest("[data-shoppable-image]");contentWrapperEl.style.transform="",contentWrapperEl.style.top="",contentWrapperEl.style.bottom="";const contentBounds=contentEl.getBoundingClientRect(),shoppableImageBounds=shoppableImage.getBoundingClientRect(),cssTop=window.getComputedStyle(contentWrapperEl).getPropertyValue("padding");contentBounds.topshoppableImageBounds.bottom&&!window.PXUTheme.media_queries.mobile_and_tablet.matches&&(contentWrapperEl.style.bottom=`-${cssTop}`),contentBounds.right>shoppableImageBounds.width&&(contentWrapperEl.style.transform="translateX(-100%)"),contentBounds.left<0&&(contentWrapperEl.style.transform="translateX(0)")},repositionHotspotContentEls(currentSlide){currentSlide.querySelectorAll("[data-hotspot]").forEach(hotspot=>this.repositionHotspotContent(hotspot))},debounce(callback,timeout=500){let timeoutId=null;return(...args)=>{clearTimeout(timeoutId),timeoutId=setTimeout(()=>{callback.apply(null,args)},timeout)}},unload($target){const $slider=$target.find("[data-shoppable-image-wrapper]");$slider.hasClass("flickity-enabled")&&$slider.flickity("destroy")}},window.accordion={init(){let flg=0;const $vanillaAccordion=$(".accordion"),$faqHeading=$(".faqAccordion > dt > button, .accordion > dt > a");$(".faqAccordion > dd, .accordion > dd").attr("aria-hidden",!0),$faqHeading.attr("aria-expanded",!1),$faqHeading.on("click activate",function(){if(flg)return!1;flg=1;const state=$(this).attr("aria-expanded")==="false";return $(this).attr("aria-expanded",state),$(this).parent().next().slideToggle(()=>{flg=0}),$(this).parent().next().attr("aria-hidden",!state),!1}),$faqHeading.on("keydown",function(event){(event.keyCode||event.which)===13&&$(this).trigger("activate")}),$vanillaAccordion.each((_,accordion)=>{const $accordion=$(accordion);$accordion.data("state")==="open"&&($accordion.find($faqHeading[0]).parent().next().slideToggle(),$accordion.find($faqHeading[0]).attr("aria-expanded",!0))})}};class ProductCTA extends HTMLElement{static get shortcode(){return"product-cta"}constructor(){super(),this.attachShadow({mode:"open"}),this.events=[];const forAttr=this.getAttribute("for"),variants=forAttr?document.querySelector(`#${forAttr} [data-variants]`):null,variantId=this.getAttribute("variantid"),appendto=document.querySelector(this.getAttribute("appendto"));if(!variants||!variantId){this._setVisible(!1);return}appendto&&appendto.appendChild(this),this._registerEvent({el:variants,event:"change",listener:e=>this._onVariantChange(e,variantId)}),this._setVisible(variants.value===this.variantId)}connectedCallback(){const href=this.getAttribute("href")||"#",target=this.getAttribute("target"),style=document.createElement("style"),a=document.createElement("a"),slot=document.createElement("slot");if(style.innerHTML=` a { color: inherit; cursor; inherit; text-decoration: inherit; } `,a.href=href,a.target=target,a.appendChild(slot),target==="_blank"){const icon=document.createElement("span");icon.classList.add("button-icon"),icon.setAttribute("aria-label","(New window)"),icon.innerHTML='',a.appendChild(icon)}this.shadowRoot.append(style,a)}disconnectedCallback(){this.events.forEach(({el,event,listener})=>el.removeEventListener(event,listener)),this.shadowRoot.innerHTML="",this._setVisible(!0)}_registerEvent({el,event,listener}){return this.events.push({el,event,listener}),el.addEventListener(event,listener),{el,event,listener}}_setVisible(visible){this.toggleAttribute("hidden",!visible)}_onVariantChange(e,variantId){this._setVisible(e.currentTarget.value===variantId)}}customElements.define(ProductCTA.shortcode,ProductCTA); //# sourceMappingURL=/cdn/shop/t/320/assets/sections.js.map?v=119617176748048498041741130036