PageSourceSearch

https://www.craneandcanopy.com/cdn/shop/t/629/assets/global.js?v=69830634087744574961781111435

js craneandcanopy.com collected 2026-09-26 00:38:40 UTC 35,022 bytes, 23 lines download raw bytes

1function getFocusableElements(container){return Array.from(container.querySelectorAll("summary, a[href], button:enabled, [tabindex]:not([tabindex^='-']), [draggable], area, input:not([type=hidden]):enabled, select:enabled, textarea:enabled, object, iframe"))}document.querySelectorAll('[id^="Details-"] summary').forEach(summary=>{summary.setAttribute("role","button"),summary.setAttribute("aria-expanded",summary.parentNode.hasAttribute("open")),summary.nextElementSibling.getAttribute("id")&&summary.setAttribute("aria-controls",summary.nextElementSibling.id),summary.addEventListener("click",event2=>{event2.currentTarget.setAttribute("aria-expanded",!event2.currentTarget.closest("details").hasAttribute("open"))}),!summary.closest("header-drawer")&&summary.parentElement.addEventListener("keyup",onKeyUpEscape)});const trapFocusHandlers={};function trapFocus(container,elementToFocus=container){var elements=getFocusableElements(container),first=elements[0],last=elements[elements.length-1];removeTrapFocus(),trapFocusHandlers.focusin=event2=>{event2.target!==container&&event2.target!==last&&event2.target!==first||document.addEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.focusout=function(){document.removeEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.keydown=function(event2){event2.code.toUpperCase()==="TAB"&&(event2.target===last&&!event2.shiftKey&&(event2.preventDefault(),first.focus()),(event2.target===container||event2.target===first)&&event2.shiftKey&&(event2.preventDefault(),last.focus()))},document.addEventListener("focusout",trapFocusHandlers.focusout),document.addEventListener("focusin",trapFocusHandlers.focusin),elementToFocus.focus()}try{document.querySelector(":focus-visible")}catch{focusVisiblePolyfill()}function focusVisiblePolyfill(){const navKeys=["ARROWUP","ARROWDOWN","ARROWLEFT","ARROWRIGHT","TAB","ENTER","SPACE","ESCAPE","HOME","END","PAGEUP","PAGEDOWN"];let currentFocusedElement=null,mouseClick=null;window.addEventListener("keydown",event2=>{navKeys.includes(event2.code.toUpperCase())&&(mouseClick=!1)}),window.addEventListener("mousedown",event2=>{mouseClick=!0}),window.addEventListener("focus",()=>{currentFocusedElement&&currentFocusedElement.classList.remove("focused"),!mouseClick&&(currentFocusedElement=document.activeElement,currentFocusedElement.classList.add("focused"))},!0)}function pauseAllMedia(){document.querySelectorAll(".js-youtube").forEach(video=>{video.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),document.querySelectorAll(".js-vimeo").forEach(video=>{video.contentWindow.postMessage('{"method":"pause"}',"*")}),document.querySelectorAll("video").forEach(video=>video.pause()),document.querySelectorAll("product-model").forEach(model=>{model.modelViewerUI&&model.modelViewerUI.pause()})}function removeTrapFocus(elementToFocus=null){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown),elementToFocus&&elementToFocus.focus()}function onKeyUpEscape(event2){if(event2.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event2.target.closest("details[open]");if(!openDetailsElement)return;const summaryElement=openDetailsElement.querySelector("summary");openDetailsElement.removeAttribute("open"),summaryElement.setAttribute("aria-expanded",!1),summaryElement.focus()}class QuantityInput extends HTMLElement{constructor(){super(),this.input=this.querySelector("input"),this.changeEvent=ne
1w Event("change",{bubbles:!0}),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this)))}onButtonClick(event2){event2.preventDefault();const previousValue=this.input.value;event2.target.name==="plus"?this.input.stepUp(parseInt($(event2.target).attr("step"))):this.input.stepDown(parseInt($(event2.target).attr("step"))),previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent)}}customElements.define("quantity-input",QuantityInput);function debounce(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}function fetchConfig(type="json"){return{method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${type}`}}}typeof window.Shopify>"u"&&(window.Shopify={}),Shopify.bind=function(fn,scope){return function(){return fn.apply(scope,arguments)}},Shopify.setSelectorByValue=function(selector,value){for(var i2=0,count=selector.options.length;i2<count;i2++){var option=selector.options[i2];if(value==option.value||value==option.innerHTML)return selector.selectedIndex=i2,i2}},Shopify.addListener=function(target,eventName,callback){target.addEventListener?target.addEventListener(eventName,callback,!1):target.attachEvent("on"+eventName,callback)},Shopify.postLink=function(path,options){options=options||{};var method=options.method||"post",params=options.parameters||{},form=document.createElement("form");form.setAttribute("method",method),form.setAttribute("action",path);for(var key in params){var hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden"),hiddenField.setAttribute("name",key),hiddenField.setAttribute("value",params[key]),form.appendChild(hiddenField)}document.body.appendChild(form),form.submit(),document.body.removeChild(form)},Shopify.CountryProvinceSelector=function(country_domid,province_domid,options){this.countryEl=document.getElementById(country_domid),this.provinceEl=document.getElementById(province_domid),this.provinceContainer=document.getElementById(options.hideElement||province_domid),Shopify.addListener(this.countryEl,"change",Shopify.bind(this.countryHandler,this)),this.initCountry(),this.initProvince()},Shopify.CountryProvinceSelector.prototype={initCountry:function(){var value=this.countryEl.getAttribute("data-default");Shopify.setSelectorByValue(this.countryEl,value),this.countryHandler()},initProvince:function(){var value=this.provinceEl.getAttribute("data-default");value&&this.provinceEl.options.length>0&&Shopify.setSelectorByValue(this.provinceEl,value)},countryHandler:function(e){var opt=this.countryEl.options[this.countryEl.selectedIndex],raw=opt.getAttribute("data-provinces"),provinces=JSON.parse(raw);if(this.clearOptions(this.provinceEl),provinces&&provinces.length==0)this.provinceContainer.style.display="none";else{for(var i2=0;i2<provinces.length;i2++){var opt=document.createElement("option");opt.value=provinces[i2][0],opt.innerHTML=provinces[i2][1],this.provinceEl.appendChild(opt)}this.provinceContainer.style.display=""}},clearOptions:function(selector){for(;selector.firstChild;)selector.removeChild(selector.firstChild)},setOptions:function(selector,values){for(var i2=0,count=values.length;i2<values.length;i2++){var opt=document.createElement("option");opt.value=values[i2],opt.innerHTML=values[i2],selector.appendChild(opt)}}};class MenuDrawer extends HTMLElement{constructor(){super(),this.mainDetailsToggle=this.querySelector("details"),this.addEventListener("keyup",this.onKeyUp.bind(this)),this.addEventListener("focusout",this.onFocusOut.bind(this)),this.bindEvents()}bindEvents(){this.querySelectorAll("summary").forEach(summary=>summary.addEventListener("click",this.onSummaryClick.bind(this))),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onCloseButtonClick.bind(this)))}onKeyUp(event2){if(event2.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event2.target.closest("details[open]");openDetailsElement&&(openDetailsElement===this.mainDetailsToggle?this.closeMenuDrawer(event2,this.mainDetailsToggle.querySelector("summary")):this.closeSubmenu(openDetailsElement))}onSummaryClick(event2){const summaryElement=event2.currentTarget,detailsElement=summaryElement.parentNode,parentMenuElement=detailsElement.closest(".has-submenu"),isOpen=detailsElement.hasAttribute("open"),reducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)");function addTrapFocus(){trapFocus(summaryElement.nextElementSibling,detailsElement.querySelector("button")),summaryElement.nextElementSibling.removeEventListener("transitionend",addTrapFocus)}detailsElement===this.mainDetailsToggle?(isOpen&&event2.preventDefault(),isOpen?this.closeMenuDrawer(event2,summaryElement):this.openMenuDrawer(summaryElement),window.matchMedia("(max-width: 990px)")&&document.documentElement.style.setProperty("--viewport-height",`${window.innerHeight}px`)):setTimeout(()=>{detailsElement.classList.add("menu-opening"),summaryElement.setAttribute("aria-expanded",!0),parentMenuElement&&parentMenuElement.classList.add("submenu-open"),!reducedMotion||reducedMotion.matches?addTrapFocus():summaryElement.nextElementSibling.addEventListener("transitionend",addTrapFocus)},100)}openMenuDrawer(summaryElement){setTimeout(()=>{this.mainDetailsToggle.classList.add("menu-opening")}),summaryElement.setAttribute("aria-expanded",!0),trapFocus(this.mainDetailsToggle,summaryElement),document.body.classList.add(`overflow-hidden-${this.dataset.breakpoint}`)}closeMenuDrawer(event2,elementToFocus=!1){event2!==void 0&&(this.mainDetailsToggle.classList.remove("menu-opening"),this.mainDetailsToggle.querySelectorAll("details").forEach(detail
1s=>{details.removeAttribute("open"),details.classList.remove("menu-opening")}),this.mainDetailsToggle.querySelectorAll(".submenu-open").forEach(submenu=>{submenu.classList.remove("submenu-open")}),document.body.classList.remove(`overflow-hidden-${this.dataset.breakpoint}`),removeTrapFocus(elementToFocus),this.closeAnimation(this.mainDetailsToggle))}onFocusOut(event2){setTimeout(()=>{this.mainDetailsToggle.hasAttribute("open")&&!this.mainDetailsToggle.contains(document.activeElement)&&this.closeMenuDrawer()})}onCloseButtonClick(event2){const detailsElement=event2.currentTarget.closest("details");this.closeSubmenu(detailsElement)}closeSubmenu(detailsElement){const parentMenuElement=detailsElement.closest(".submenu-open");parentMenuElement&&parentMenuElement.classList.remove("submenu-open"),detailsElement.classList.remove("menu-opening"),detailsElement.querySelector("summary").setAttribute("aria-expanded",!1),removeTrapFocus(detailsElement.querySelector("summary")),this.closeAnimation(detailsElement)}closeAnimation(detailsElement){let animationStart;const handleAnimation=time=>{animationStart===void 0&&(animationStart=time),time-animationStart<400?window.requestAnimationFrame(handleAnimation):(detailsElement.removeAttribute("open"),detailsElement.closest("details[open]")&&trapFocus(detail
1sElement.closest("details[open]"),detailsElement.querySelector("summary")))};window.requestAnimationFrame(handleAnimation)}}customElements.define("menu-drawer",MenuDrawer);class HeaderDrawer extends MenuDrawer{constructor(){super()}openMenuDrawer(summaryElement){this.header=this.header||document.getElementById("shopify-section-header"),this.borderOffset=this.borderOffset||this.closest(".header-wrapper").classList.contains("header-wrapper--border-bottom")?1:0,document.documentElement.style.setProperty("--header-bottom-position",`${parseInt(this.header.getBoundingClientRect().bottom-this.borderOffset)}px`),this.header.classList.add("menu-open"),setTimeout(()=>{this.mainDetailsToggle.classList.add("menu-opening")}),summaryElement.setAttribute("aria-expanded",!0),trapFocus(this.mainDetailsToggle,summaryElement),document.body.classList.add(`overflow-hidden-${this.dataset.breakpoint}`)}closeMenuDrawer(event2,elementToFocus){super.closeMenuDrawer(event2,elementToFocus),this.header.classList.remove("menu-open")}}customElements.define("header-drawer",HeaderDrawer);class ModalDialog extends HTMLElement{constructor(){super(),this.querySelector('[id^="ModalClose-"]').addEventListener("click",this.hide.bind(this,!1)),this.addEventListener("keyup",event2=>{event2.code.toUpperCase()==="ESCAPE"&&this.hide()}),this.classList.contains("media-modal")?this.addEventListener("pointerup",event2=>{event2.pointerType==="mouse"&&!event2.target.closest("deferred-media, product-model")&&this.hide()}):this.addEventListener("click",event2=>{event2.target===this&&this.hide()})}connectedCallback(){this.moved||(this.moved=!0,document.body.appendChild(this))}show(opener){this.openedBy=opener;const popup=this.querySelector(".template-popup");document.body.classList.add("overflow-hidden"),this.setAttribute("open",""),popup&&popup.loadContent(),trapFocus(this,this.querySelector('[role="dialog"]')),window.pauseAllMedia()}hide(){document.body.classList.remove("overflow-hidden"),document.body.dispatchEvent(new CustomEvent("modalClosed")),this.removeAttribute("open"),removeTrapFocus(this.openedBy),window.pauseAllMedia()}}customElements.define("modal-dialog",ModalDialog);class ModalOpener extends HTMLElement{constructor(){super();const button=this.querySelector("button");button&&button.addEventListener("click",()=>{const modal=document.querySelector(this.getAttribute("data-modal"));modal&&modal.show(button)})}}customElements.define("modal-opener",ModalOpener);class DeferredMedia extends HTMLElement{constructor(){super();const poster=this.querySelector('[id^="Deferred-Poster-"]');poster&&poster.addEventListener("click",this.loadContent.bind(this))}loadContent(focus=!0){if(window.pauseAllMedia(),!this.getAttribute("loaded")){const content=document.createElement("div");content.appendChild(this.querySelector("template").content.firstElementChild.cloneNode(!0)),this.setAttribute("loaded",!0);const deferredElement=this.appendChild(content.querySelector("video, model-viewer, iframe"));focus&&deferredElement.focus()}}}customElements.define("deferred-media",DeferredMedia);class SliderComponent extends HTMLElement{constructor(){if(super(),this.slider=this.querySelector('[id^="Slider-"]'),this.sliderItems=this.querySelectorAll('[id^="Slide-"]'),this.enableSliderLooping=!1,this.currentPageElement=this.querySelector(".slider-counter--current"),this.pageTotalElement=this.querySelector(".slider-counter--total"),this.prevButton=this.querySelector('button[name="previous"]'),this.nextButton=this.querySelector('button[name="next"]'),!this.slider||!this.nextButton)return;this.initPages(),new ResizeObserver(entries=>this.initPages()).observe(this.slider),this.slider.addEventListener("scroll",this.update.bind(this)),this.prevButton.addEventListener("click",this.onButtonClick.bind(this)),this.nextButton.addEventListener("click",this.onButtonClick.bind(this))}initPages(){this.sliderItemsToShow=Array.from(this.sliderItems).filter(element=>element.clientWidth>0),!(this.sliderItemsToShow.length<2)&&(this.sliderItemOffset=this.sliderItemsToShow[1].offsetLeft-this.sliderItemsToShow[0].offsetLeft,this.slidesPerPage=Math.floor((this.slider.clientWidth-this.sliderItemsToShow[0].offsetLeft)/this.sliderItemOffset),this.totalPages=this.sliderItemsToShow.length-this.slidesPerPage+1,this.update())}resetPages(){this.sliderItems=this.querySelectorAll('[id^="Slide-"]'),this.initPages()}update(){const previousPage=this.currentPage;this.currentPage=Math.round(this.slider.scrollLeft/this.sliderItemOffset)+1,this.currentPageElement&&this.pageTotalElement&&(this.currentPageElement.textContent=this.currentPage,this.pageTotalElement.textContent=this.totalPages),this.currentPage!=previousPage&&this.dispatchEvent(new CustomEvent("slideChanged",{detail:{currentPage:this.currentPage,currentElement:this.sliderItemsToShow[this.currentPage-1]}})),!this.enableSliderLooping&&(this.isSlideVisible(this.sliderItemsToShow[0])&&this.slider.scrollLeft===0?this.prevButton.setAttribute("disabled","disabled"):this.prevButton.removeAttribute("disabled"),this.isSlideVisible(this.sliderItemsToShow[this.sliderItemsToShow.length-1])?this.nextButton.setAttribute("disabled","disabled"):this.nextButton.removeAttribute("disabled"))}isSlideVisible(element,offset=0){const lastVisibleSlide=this.slider.clientWidth+this.slider.scrollLeft-offset;return element.offsetLeft+element.clientWidth<=lastVisibleSlide&&element.offsetLeft>=this.slider.scrollLeft}onButtonClick(event2){event2.preventDefault();const step=event2.currentTarget.dataset.step||1;this.slideScrollPosition=event2.currentTarget.name==="next"?this.slider.scrollLeft+step*this.sliderItemOffset:this.slider.scrollLeft-step*this.sliderItemOffset,this.slider.scrollTo({left:this.slideScrollPosition})}}customElements.define("slider-component",SliderComponent);class SlideshowComponent extends SliderComponent{constructor(){super(),this.sliderControlWrapper=this.querySelector(".slider-buttons"),this.enableSliderLooping=!0,this.sliderControlWrapper&&(this.sliderFirstItemNode=this.slider.querySelector(".slideshow__slide"),this.sliderItemsToShow.length>0&&(this.currentPage=1),this.sliderControlLinksArray=Array.from(this.sliderControlWrapper.querySelectorAll(".slider-counter__link")),this.sliderControlLinksArray.forEach(link=>link.addEventListener("click",this.linkToSlide.bind(this))),this.slider.addEventListener("scroll",this.setSlideVisibility.bind(this)),this.setSlideVisibility(),this.slider.getAttribute("data-autoplay")==="true"&&this.setAutoPlay())}setAutoPlay(){this.sliderAutoplayButton=this.querySelector(".slideshow__autoplay"),this.autoplaySpeed=this.slider.dataset.speed*1e3,this.sliderAutoplayButton.addEventListener("click",this.autoPlayToggle.bind(this)),this.addEventListener("mouseover",this.focusInHandling.bind(this)),this.addEventListener("mouseleave",this.focusOutHandling.bind(this)),this.addEventListener("focusin",this.focusInHandling.bind(this)),this.addEventListener("focusout",this.focusOutHandling.bind(this)),this.play(),this.autoplayButtonIsSetToPlay=!0}onButtonClick(event2){super.onButtonClick(event2);const isFirstSlide=this.currentPage===1,isLastSlide=this.currentPage===this.sliderItemsToShow.length;!isFirstSlide&&!isLastSlide||(isFirstSlide&&event2.currentTarget.name==="previous"?this.slideScrollPosition=this.slider.scrollLeft+this.sliderFirstItemNode.clientWidth*this.sliderItemsToShow.length:isLastSlide&&event2.currentTarget.name==="next"&&(this.slideScrollPosition=0),this.slider.scrollTo({left:this.slideScrollPosition}))}
1update(){super.update(),this.sliderControlButtons=this.querySelectorAll(".slider-counter__link"),this.prevButton.removeAttribute("disabled"),this.sliderControlButtons.length&&(this.sliderControlButtons.forEach(link=>{link.classList.remove("slider-counter__link--active"),link.removeAttribute("aria-current")}),this.sliderControlButtons[this.currentPage-1].classList.add("slider-counter__link--active"),this.sliderControlButtons[this.currentPage-1].setAttribute("aria-current",!0))}autoPlayToggle(){this.togglePlayButtonState(this.autoplayButtonIsSetToPlay),this.autoplayButtonIsSetToPlay?this.pause():this.play(),this.autoplayButtonIsSetToPlay=!this.autoplayButtonIsSetToPlay}focusOutHandling(event2){const focusedOnAutoplayButton=event2.target===this.sliderAutoplayButton||this.sliderAutoplayButton.contains(event2.target);!this.autoplayButtonIsSetToPlay||focusedOnAutoplayButton||this.play()}focusInHandling(event2){(event2.target===this.sliderAutoplayButton||this.sliderAutoplayButton.contains(event2.target))&&this.autoplayButtonIsSetToPlay?this.play():this.autoplayButtonIsSetToPlay&&this.pause()}play(){this.slider.setAttribute("aria-live","off"),clearInterval(this.autoplay),this.autoplay=setInterval(this.autoRotateSlides.bind(this),this.autoplaySpeed)}pause(){this.slider.setAttribute("aria-live","polite"),clearInterval(this.autoplay)}togglePlayButtonState(pauseAutoplay){pauseAutoplay?(this.sliderAutoplayButton.classList.add("slideshow__autoplay--paused"),this.sliderAutoplayButton.setAttribute("aria-label",window.accessibilityStrings.playSlideshow)):(this.sliderAutoplayButton.classList.remove("slideshow__autoplay--paused"),this.sliderAutoplayButton.setAttribute("aria-label",window.accessibilityStrings.pauseSlideshow))}autoRotateSlides(){const slideScrollPosition=this.currentPage===this.sliderItems.length?0:this.slider.scrollLeft+this.slider.querySelector(".slideshow__slide").clientWidth;this.slider.scrollTo({left:slideScrollPosition})}setSlideVisibility(){this.sliderItemsToShow.forEach((item,index)=>{const linkElements=item.querySelectorAll("a");index===this.currentPage-1?(linkElements.length&&linkElements.forEach(button=>{button.removeAttribute("tabindex")}),item.setAttribute("aria-hidden","false"),item.removeAttribute("tabindex")):(linkElements.length&&linkElements.forEach(button=>{button.setAttribute("tabindex","-1")}),item.setAttribute("aria-hidden","true"),item.setAttribute("tabindex","-1"))})}linkToSlide(event2){event2.preventDefault();const slideScrollPosition=this.slider.scrollLeft+this.sliderFirstItemNode.clientWidth*(this.sliderControlLinksArray.indexOf(event2.currentTarget)+1-this.currentPage);this.slider.scrollTo({left:slideScrollPosition})}}customElements.define("slideshow-component",SlideshowComponent);class VariantSelects extends HTMLElement{constructor(){super(),this.addEventListener("change",this.onVariantChange),this.getAttribute("product-sets")!=null&&this.onVariantChange()}onVariantChange(){this.updateOptions(),this.updateMasterId();var monoData=$(this).closest(".product__info-container").find(".monogram-temp-data");monoData.attr("varID",this.currentVariant.id),monoData.attr("sku",this.currentVariant.sku),monoData.attr("prodHandle",$(this).attr("data-url")),this.getAttribute("product-sets")==null?(this.updatePickupAvailability(),this.removeErrorMessage(),this.currentVariant?(this.updateMedia(),this.updateURL(),this.updateVariantInput(),this.renderProductInfo(),this.updateShareUrl()):(this.toggleAddButton(!0,"",!0),this.setUnavailable())):(this.toggleAddButtonSet(!0,"",!1),this.currentVariant?(this.renderProductInfoSets(),this.currentVariant.available?this.toggleAddButtonSet(!1,"Add to cart",!0):this.toggleAddButtonSet(!0,"Sold out",!0),this.updateVariantInputSets()):(this.toggleAddButtonSet(!0,"",!0),this.setUnavailable()))}updateOptions(){this.options=Array.from(this.querySelectorAll("select"),select=>select.value)}updateMasterId(){this.currentVariant=this.getVariantData().find(variant=>!variant.options.map((option,index)=>this.options[index]===option).includes(!1))}updateMedia(){if(!this.currentVariant||!this.currentVariant.featured_media)return;document.querySelectorAll(`[id^="MediaGallery-${this.dataset.section}"]`).forEach(mediaGallery=>mediaGallery.setActiveMedia(`${this.dataset.section}-${this.currentVariant.featured_media.id}`,!0));const modalContent=document.querySelector(`#ProductModal-${this.dataset.section} .product-media-modal__content`);if(!modalContent)return;const newMediaModal=modalContent.querySelector(`[data-media-id="${this.currentVariant.featured_media.id}"]`);
1modalContent.prepend(newMediaModal)}updateURL(){!this.currentVariant||this.dataset.updateUrl==="false"||window.history.replaceState({},"",`${this.dataset.url}?variant=${this.currentVariant.id}`)}updateShareUrl(){const shareButton=document.getElementById(`Share-${this.dataset.section}`);!shareButton||!shareButton.updateUrl||shareButton.updateUrl(`${window.shopUrl}${this.dataset.url}?variant=${this.currentVariant.id}`)}updateVariantInput(){document.querySelectorAll(`#product-form-${this.dataset.section}, #product-form-installment-${this.dataset.section}`).forEach(productForm=>{const input=productForm.querySelector('input[name="id"]');input.value=this.currentVariant.id,input.dispatchEvent(new Event("change",{bubbles:!0}))})}updateVariantInputSets(){$(this).closest(".product__info-container").find('input[name="id"]').val(this.currentVariant.id)}updatePickupAvailability(){const pickUpAvailability=document.querySelector("pickup-availability");pickUpAvailability&&(this.currentVariant&&this.currentVariant.available?pickUpAvailability.fetchAvailability(this.currentVariant.id):(pickUpAvailability.removeAttribute("available"),pickUpAvailability.innerHTML=""))}removeErrorMessage(){const section=this.closest("section");if(!section)return;const productForm=section.querySelector("product-form");productForm&&productForm.handleErrorMessage()}renderProductInfo(){fetch(`${this.dataset.url}?variant=${this.currentVariant.id}&section_id=${this.dataset.originalSection?this.dataset.originalSection:this.dataset.section}`).then(response=>response.text()).then(responseText=>{const html=new DOMParser().parseFromString(responseText,"text/html"),destination=document.getElementById(`price-${this.dataset.section}`),source=html.getElementById(`price-${this.dataset.originalSection?this.dataset.originalSection:this.dataset.section}`);source&&destination&&(destination.innerHTML=source.innerHTML);const price=document.getElementById(`price-${this.dataset.section}`);price&&price.classList.remove("visibility-hidden"),this.toggleAddButton(!this.currentVariant.available,window.variantStrings.soldOut)})}renderProductInfoSets(){var currentPrice=(this.currentVariant.price/100).toLocaleString("en-US",{style:"currency",currency:"USD"}),currentComparePrice=(this.currentVariant.compare_at_price/100).toLocaleString("en-US",{style:"currency",currency:"USD"}),currentCents=currentPrice.slice(-2),currentCompareCents=currentComparePrice.slice(-2);parseInt(currentCents)==0&&(currentPrice=currentPrice.slice(0,-3)),parseInt(currentCompareCents)==0&&(currentComparePrice=currentComparePrice.slice(0,-3));var priceObj=$("#price-"+this.dataset.section);priceObj.find(".price__regular").find(".price-item--regular").html(currentPrice),priceObj.find(".price__sale").find(".price-item--regular").html(currentComparePrice),priceObj.find(".price__sale").find(".price-item--sale").html(currentPrice),currentPrice==currentComparePrice||parseInt(currentComparePrice.replace("$",""))==0?(priceObj.find(".price__regular").show(),priceObj.find(".price__sale").hide(),priceObj.find(".price__badge-sale").hide()):(priceObj.find(".price__regular").hide(),priceObj.find(".price__sale").show(),priceObj.find(".price__badge-sale").css("display","inline-block")),this.currentVariant.featured_image!=null&&$(this).closest(".pset-item").find(".pset-item__image-container").find("img").attr("src",this.currentVariant.featured_image.src)}toggleAddButton(disable=!0,text,modifyClass=!0){const productForm=document.getElementById(`product-form-${this.dataset.section}`);if(!productForm)return;const addButton=productForm.querySelector('[name="add"]'),addButtonText=productForm.querySelector('[name="add"] > span');var discontinuedFlag=$(this).find(".product-tags").html().indexOf("discontinued")!=-1;const bisButton=productForm.querySelector(".BIS_trigger");addButton&&(disable?(addButton.setAttribute("disabled","disabled"),discontinuedFlag==!1?($(bisButton).show(),$(bisButton).attr("data-variant-id",this.currentVariant.id),text&&(addButtonText.textContent=text)):addButtonText.textContent="Discontinued"):($(bisButton).hide(),addButton.removeAttribute("disabled"),addButtonText.textContent=window.variantStrings.addToCart))}toggleAddButtonSet(disable=!0,text,modifyClass=!0){var formID="#"+$(this).find("input").first().attr("form");const productForm=$(this).closest(".product__info-container").find(formID)[0];if(!productForm)return;const addButton=productForm.querySelector('[name="add"]'),addButtonText=productForm.querySelector('[name="add"] > span'),bisButton=productForm.querySelector(".BIS_trigger");
1if(addButton){var discontinuedFlag=$(this).find(".product-tags").html().indexOf("discontinued")!=-1;disable?(addButton.setAttribute("disabled","disabled"),discontinuedFlag==!1?($(bisButton).show(),$(bisButton).attr("data-variant-id",this.currentVariant.id),text&&(addButtonText.textContent=text)):addButtonText.textContent="Discontinued"):($(bisButton).hide(),addButton.removeAttribute("disabled"),addButtonText.textContent=window.variantStrings.addToCart)}}setUnavailable(){const button=document.getElementById(`product-form-${this.dataset.section}`),addButton=button.querySelector('[name="add"]'),addButtonText=button.querySelector('[name="add"] > span'),price=document.getElementById(`price-${this.dataset.section}`);addButton&&(addButtonText.textContent=window.variantStrings.unavailable,price&&price.classList.add("visibility-hidden"))}getVariantData(){return this.variantData=this.variantData||JSON.parse(this.querySelector('[type="application/json"]').textContent),this.variantData}}customElements.define("variant-selects",VariantSelects);class VariantRadios extends VariantSelects{constructor(){super()}updateOptions(){const fieldsets=Array.from(this.querySelectorAll("fieldset"));this.options=fieldsets.map(fieldset=>Array.from(fieldset.querySelectorAll("input")).find(radio=>radio.checked).value);const possibleVariants=this.getVariantData().filter(variant=>variant.option1===this.options[0]);for(let index=0;index<possibleVariants.length;index++){const variant=possibleVariants[index],input=document.querySelector(`[value="${variant.option2}"]`);input!=null&&(variant.available?input.classList.remove("unavailable"):input.classList.add("unavailable"))}}}customElements.define("variant-radios",VariantRadios);class ProductRecommendations extends HTMLElement{constructor(){super()}connectedCallback(){const handleIntersection=(entries,observer)=>{entries[0].isIntersecting&&(observer.unobserve(this),fetch(this.dataset.url).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recommendations=html.querySelector("product-recommendations");recommendations&&recommendations.innerHTML.trim().length&&(this.innerHTML=recommendations.innerHTML),!this.querySelector("slideshow-component")&&this.classList.contains("complementary-products")&&this.remove(),html.querySelector(".grid__item")&&this.classList.add("product-recommendations--loaded")}).catch(e=>{console.error(e)}))};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}}customElements.define("product-recommendations",ProductRecommendations);function isEvenKey(evt){var charCode=evt.which?evt.which:event.keyCode;return charCode%2==0}function insertSwatchImage(swatch_entry){var swatchOverlay=swatch_entry.closest(".swatch_holder").siblings(".card-wrapper").find(".swatch_overlay"),swatchURLTemp=$(swatch_entry).parent().attr("href"),swatchURL=swatchURLTemp.split("/")[2],swatchHandle=swatchURL.split("?")[0],swatchVarID=swatchURL.split("variant=")[1],productHandle=swatchHandle;fetchSwatchImg(productHandle,swatchVarID,swatchOverlay)}async function fetchSwatchImg(productHandle,swatchVarID,swatchOverlay){const query=`query ($productHandle: String!) {
2    productByHandle(handle: $productHandle) {
3      title
4      id
5      variants(first: 15) {
6        edges {
7          node {
8            id
9            sku
10            selectedOptions {
11              name
12              value
13            }
14            image {
15              url
16            }
17          }
18        }
19      }
20    }
21  }
22  `,STOREFRONT_ACCESS_TOKEN=document.getElementById("graphUrlInfo").getAttribute("token"),GRAPHQL_URL=document.getElementById("graphUrlInfo").getAttribute("graphurl"),GRAPHQL_BODY=()=>({async:!0,crossDomain:!0,method:"POST",headers:{"X-Shopify-Storefront-Access-Token":STOREFRONT_ACCESS_TOKEN,"Content-Type":"application/graphql"},body:productQuery()});let products=await(await fetch(GRAPHQL_URL,{async:!0,crossDomain:!0,method:"POST",headers:{"X-Shopify-Storefront-Access-Token":STOREFRONT_ACCESS_TOKEN,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({query,variables:{productHandle}})})).json();var swatchImageURL="",variantEdges=products.data.productByHandle.variants.edges;for(i=0;i<variantEdges.length;i++){var edgeID=variantEdges[i].node.id.split("/")[4];if(swatchVarID==edgeID){swatchImageURL=variantEdges[i].node.image.url;break}}var tempsrc=swatchImageURL;swatchOverlay.attr("src",tempsrc),swatchOverlay.parent("div").show()}$(document).ready(function(){var swatchEnts=$(".swatch_entry"),curURL=window.location.href.toUpperCase();for(let i2=0;i2<swatchEnts.length;i2++){var colorEntry=$(swatchEnts[i2]).attr("color").toUpperCase();curURL.includes(colorEntry)&&insertSwatchImage($(swatchEnts[i2]))}"ontouchstart"in window&&$(".swatch_entry").click(function(e){e.preventDefault()}),$(".swatch_entry").hover(function(){insertSwatchImage($(this)),$(this).css("border","1p
22x solid black")},function(){var overlay=$(this).closest(".swatch_holder").siblings(".card-wrapper").find(".swatch_overlay");overlay.parent("div").hide(),$(this).css("border","2px solid grey")})}),$(function(){$(window).scroll(function(){$(this).scrollTop()!=0?$("#toTop").fadeIn():$("#toTop").fadeOut()}),$("#toTop").click(function(){$("body,html").animate({scrollTop:0},800)})});function setCookie(cname,cvalue,exdays){const d=new Date;d.setTime(d.getTime()+exdays*24*60*60*1e3);let expires="expires="+d.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";path=/"}function getCookie(cname){let name=cname+"=",ca=decodeURIComponent(document.cookie).split(";");for(let i2=0;i2<ca.length;i2++){let c=ca[i2];for(;c.charAt(0)==" ";)c=c.substring(1);if(c.indexOf(name)==0)return c.substring(name.length,c.length)}return""}function inDateRange(start,end,inclusive){var today=new Date,dd=String(today.getDate()).padStart(2,"0"),mm=String(today.getMonth()+1).padStart(2,"0"),yyyy=today.getFullYear();today=mm+"/"+dd+"/"+yyyy;var dateFrom=start,dateTo=end,dateCheck=today,d1=dateFrom.split("/"),d2=dateTo.split("/"),c=dateCheck.split("/"),from=new Date(d1[2],d1[0]-1,parseInt(d1[1])),to=new Date(d2[2],d2[0]-1,parseInt(d2[1])),check=new Date(c[2],c[0]-1,parseInt(c[1]));return inclusive?check>=from&&check<=to:check>from&&check<to}const custom__modal=document.getElementById("customModal"),custom__close=document.getElementById("customModal__close");custom__close?.addEventListener("click",()=>{custom__modal.style.display="none"});const RED=.2126,GREEN=.7152,BLUE=.0722,GAMMA=2.4;function luminance(r,g,b){var a=[r,g,b].map(v=>(v/=255,v<=.03928?v/12.92:Math.pow((v+.055)/1.055,GAMMA)));return a[0]*RED+a[1]*GREEN+a[2]*BLUE}function contrastChecker(rgb1,rgb2){var lum1=luminance(...rgb1),lum2=luminance(...rgb2),brightest=Math.max(lum1,lum2),darkest=Math.min(lum1,lum2);return(brightest+.05)/(darkest+.05)}function componentToHex(c){var hex=c.toString(16);return hex.length==1?"0"+hex:hex}function rgbToHex(r,g,b){return"#"+componentToHex(r)+componentToHex(g)+componentToHex(b)}function getImageLightness(imageSrc,callback){var img=document.createElement("img");img.src=imageSrc,img.style.display="none",document.body.appendChild(img);var colorSum=0;img.onload=function(){var canvas=document.createElement("canvas");canvas.width=this.width,canvas.height=this.height;var ctx=canvas.getContext("2d");ctx.drawImage(this,0,0);for(var imageData=ctx.getImageData(0,0,canvas.width,canvas.height),data=imageData.data,r,g,b,avg,x=0,len=data.length;x<len;x+=4)r=data[x],g=data[x+1],b=data[x+2],avg=Math.floor((r+g+b)/3),colorSum+=avg;var brightness=Math.floor(colorSum/(this.width*this.height));callback(brightness)}}
23//# sourceMappingURL=/cdn/shop/t/629/assets/global.js.map?v=69830634087744574961781111435

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.