PageSourceSearch

https://www.lussostone.com/cdn/shop/t/318/assets/global-components.js?v=6326749566674374971790859038

js lussostone.com collected 2026-10-02 07:40:52 UTC 30,826 bytes, 2 lines download raw bytes

1class 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(),this.header=document.querySelector(".section-header"),this.annoucementBar=document.querySelector(".announcement-bar-section")}bindEvents(){this.querySelectorAll("summary").forEach(summary=>summary.addEventListener("click",this.onSummaryClick.bind(this))),this.querySelectorAll("button:not(.localization-selector)").forEach(button=>button.addEventListener("click",this.onCloseButtonClick.bind(this)))}onKeyUp(event){if(event.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event.target.closest("details[open]");openDetailsElement&&(openDetailsElement===this.mainDetailsToggle?this.closeMenuDrawer(event,this.mainDetailsToggle.querySelector("summary")):this.closeSubmenu(openDetailsElement))}onSummaryClick(event){const summaryElement=event.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&&event.preventDefault(),isOpen?this.closeMenuDrawer(event,summaryElement):this.openMenuDrawer(summaryElement),window.matchMedia("(max-width: 989px)")&&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")},25),summaryElement.setAttribute("aria-expanded",!0),trapFocus(this.mainDetailsToggle,summaryElement),document.body.classList.add(`overflow-hidden-${this.dataset.breakpoint}`),this.header.classList.add("reset-z-index")}closeMenuDrawer(event,elementToFocus=!1){event!==void 0&&(this.mainDetailsToggle.classList.remove("menu-opening"),this.mainDetailsToggle.querySelectorAll("details").forEach(details=>{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}`),document.body.classList.remove("overflow-hidden-undefined"),removeTrapFocus(elementToFocus),this.closeAnimation(this.mainDetailsToggle),this.header.classList.remove("reset-z-index"))}onFocusOut(){setTimeout(()=>{this.mainDetailsToggle.hasAttribute("open")&&!this.mainDetailsToggle.contains(document.activeElement)&&this.closeMenuDrawer()})}onCloseButtonClick(event){const detailsElement=event.currentTarget.closest("details");this.closeSubmenu(detailsElement)}
1closeSubmenu(detailsElement){if(!detailsElement)return;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(detailsElement.closest("details[open]"),detailsElement.querySelector("summary")))};window.requestAnimationFrame(handleAnimation)}}customElements.define("menu-drawer",MenuDrawer);class HeaderDrawer extends MenuDrawer{constructor(){super()}onResize=()=>{this.header&&document.documentElement.style.setProperty("--header-bottom-position",`${parseInt(this.header.getBoundingClientRect().bottom-this.borderOffset)}px`),document.documentElement.style.setProperty("--viewport-height",`${window.innerHeight}px`)}}customElements.define("mobile-menu-nav",HeaderDrawer);class SliderComponent extends HTMLElement{constructor(){if(super(),this.slider=this.classList.contains("slideshow")?this:this.querySelector('[id^="Slider-"]'),!!this.slider){if(this.enableSliderLooping=!1,this.currentPageElement=this.querySelector(".slider-counter--current"),this.pageTotalElement=this.querySelector(".slider-counter--total"),this.dots=this.querySelectorAll(".slider-dot"),this.prevButton=this.querySelector('button[name="previous"]'),this.nextButton=this.querySelector('button[name="next"]'),this.isInfinite=this.dataset.infinite==="true",this.isDraggable=this.dataset.draggable==="true",this.optimizeResize=this.dataset.optimizeResize==="true",this.isAdjustingInfiniteScroll=!1,this.mouseDown=!1,this.noMovement=!0,this.dragDirection=null,this.currentPosition=1,this.dragDeltaX=0,this.isInfinite){const renderedClones=this.querySelectorAll(".slide--clone").length;renderedClones?this.cloneCount=renderedClones-1:this.cloneSlides()}if(this.initPages(),this.isInfinite&&this.scrollToInitialPosition(),this.isDraggable&&this.addDragListeners(),!(this.optimizeResize&&this.getRealSlides().length<=1)){let skipNextResize=this.optimizeResize;new ResizeObserver(()=>{if(skipNextResize){skipNextResize=!1;return}this.rebuildSlider()}).observe(this.slider)}this.slider.addEventListener("scroll",this.onScroll.bind(this)),this.slider.addEventListener("scrollend",this.onScrollEnd.bind(this)),this.prevButton?.addEventListener("click",this.onButtonClick.bind(this)),this.nextButton?.addEventListener("click",this.onButtonClick.bind(this)),this.dots.forEach(dot=>dot.addEventListener("click",this.onDotClick.bind(this)))}}getAllSlides(){return Array.from(this.slider.querySelectorAll('[id^="Slide-"]'))}getRealSlides(){return this.getAllSlides().filter(slide=>!slide.classList.contains("slide--clone"))}getCloneSlides(){return this.getAllSlides().filter(slide=>slide.classList.contains("slide--clone"))}rebuildSlider(){const previousPosition=this.currentPosition;
1this.isInfinite&&(this.getCloneSlides().forEach(slide=>slide.remove()),this.cloneSlides()),this.initPages(),this.checkCarouselViability(),this.isInfinite&&this.scrollToPosition(previousPosition)}cloneSlides(){const realSlides=this.getRealSlides();if(realSlides.length<=1)return;const visibleSlides=this.getVisibleSlidesCount(realSlides);this.cloneCount=Math.min(realSlides.length,Math.max(visibleSlides,1));const prependClones=realSlides.slice(-this.cloneCount).map(slide=>this.createClone(slide)),appendClones=realSlides.slice(0,this.cloneCount).map(slide=>this.createClone(slide));prependClones.reverse().forEach(clone=>{this.slider.insertBefore(clone,this.slider.firstChild)}),appendClones.forEach(clone=>{this.slider.appendChild(clone)})}createClone(slide){const clone=slide.cloneNode(!0);return clone.classList.add("slide--clone"),clone.classList.remove("slide--edge-first","slide--edge-last"),clone.setAttribute("aria-hidden","true"),clone.removeAttribute("data-media-id"),clone.querySelectorAll("[id]").forEach(el=>el.removeAttribute("id")),clone.querySelectorAll("a, button, input, select, textarea").forEach(el=>{el.setAttribute("tabindex","-1")}),clone}markEdgeSlides(){const realSlides=this.getRealSlides();realSlides.forEach((slide,index)=>{slide.classList.toggle("slide--edge-first",index===0),slide.classList.toggle("slide--edge-last",index===realSlides.length-1)})}getVisibleSlidesCount(slides=this.getRealSlides()){if(slides.length<2)return 1;const first=slides[0],offset=slides[1].offsetLeft-first.offsetLeft;return offset?Math.max(1,Math.ceil(this.slider.clientWidth/offset)):1}getMaxPosition(){return!this.realSlides?.length||!this.slidesPerPage?1:Math.max(1,this.realSlides.length-this.slidesPerPage+1)}resetPages(){this.sliderItems=this.querySelectorAll('[id^="Slide-"]'),this.isInfinite&&this.cloneSlides()}scrollToInitialPosition(){this.scrollToPosition(1)}scrollToPosition(position){const realSlides=this.getRealSlides();if(realSlides.length===0)return;const targetIndex=Math.max(0,Math.min(position-1,realSlides.length-1));this.slider.scrollTo({left:realSlides[targetIndex].offsetLeft,behavior:"instant"}),this.updateCurrentPosition()}updateCurrentPosition(){if(!this.sliderItemOffset||!this.realSlides)return;const scrollLeft=this.slider.scrollLeft,realSlides=this.getRealSlides();let closestSlide=realSlides[0],closestDistance=Math.abs(closestSlide.offsetLeft-scrollLeft);for(let slide of realSlides){const distance=Math.abs(slide.offsetLeft-scrollLeft);distance<closestDistance&&(closestDistance=distance,closestSlide=slide)}this.currentPosition=realSlides.indexOf(closestSlide)+1,this.renderUI()}initPages(){if(this.sliderItems=this.getAllSlides(),this.realSlides=this.getRealSlides(),this.markEdgeSlides(),this.sliderItemsToShow=this.realSlides.filter(element=>element.clientWidth>0),this.sliderItemsToShow.length!==0){if(this.sliderItemsToShow.length===1){this.sliderItemOffset=this.sliderItemsToShow[0].clientWidth,this.slidesPerPage=1,this.maxPosition=1,this.totalPages=1,this.currentPosition=1,this.renderUI();return}this.sliderItemOffset=this.sliderItemsToShow[1].offsetLeft-this.sliderItemsToShow[0].offsetLeft,this.slidesPerPage=Math.max(1,Math.round(this.slider.clientWidth/this.sliderItemOffset)),this.maxPosition=this.getMaxPosition(),this.totalPages=this.maxPosition,this.isInfinite||(this.currentPosition=Math.max(1,Math.min(this.currentPosition||1,this.maxPosition))),this.renderUI()}}checkCarouselViability(){const isViable=this.getRealSlides().length>this.slidesPerPage;this.prevButton?.classList.toggle("disabled",!isViable),this.nextButton?.classList.toggle("disabled",!isViable)}onScroll(){this.isAdjustingInfiniteScroll||!this.isInfinite||this.isDragging||this.checkInfiniteBoundary()||this.updateCurrentPosition()}onScrollEnd(){this.isAdjustingInfiniteScroll||!this.isInfinite||this.isDragging||this.checkInfiniteBoundary()}checkInfiniteBoundary(){const realSlides=this.getRealSlides();if(realSlides.length===0||!this.sliderItemOffset)return!1;const scrollLeft=this.slider.scrollLeft,firstRealSlide=realSlides[0],lastRealSlide=realSlides[realSlides.length-1],boundaryTolerance=2;return scrollLeft>=lastRealSlide.offsetLeft+this.sliderItemOffset-boundaryTolerance?(this.isAdjustingInfiniteScroll=!0,this.slider.scrollTo({left:firstRealSlide.offsetLeft,behavior:"instant"}),this.isAdjustingInfiniteScroll=!1,this.currentPosition=1,!0):scrollLeft<=firstRealSlide.offsetLeft-this.sliderItemOffset+boundaryTolerance?(this.isAdjustingInfiniteScroll=!0,this.slider.scrollTo({left:lastRealSlide.offsetLeft,behavior:"instant"}),this.isAdjustingInfiniteScroll=!1,this.currentPosition=realSlides.length,!0):!1}renderUI(){this.currentPageElement&&(this.currentPageElement.textContent=this.currentPosition),this.pageTotalElement&&(this.pageTotalElement.textContent=this.maxPosition),this.updateDots(),this.isInfinite||(this.currentPosition<=1?this.prevButton?.setAttribute("disabled","disabled"):this.prevButton?.removeAttribute("disabled"),this.currentPosition>=this.maxPosition?this.nextButton?.setAttribute("disabled","disabled"):this.nextButton?.removeAttribute("disabled"))}
1updateDots(){this.dots.forEach((dot,index)=>{dot.classList.toggle("slider-dot--active",index===this.currentPosition-1)})}onButtonClick(event){event.preventDefault&&event.preventDefault(),!(this.maxPosition<=1)&&this.goToSlide(event.currentTarget.name)}goToSlide(direction){const realSlides=this.getRealSlides();if(!realSlides||realSlides.length===0||!this.sliderItemOffset)return;const currentIndex=this.currentPosition-1;let targetIndex=currentIndex;if(direction==="next"?targetIndex=(currentIndex+1)%realSlides.length:direction==="previous"&&(targetIndex=(currentIndex-1+realSlides.length)%realSlides.length),this.isInfinite){const isWrappingForward=direction==="next"&&currentIndex===realSlides.length-1,isWrappingBackward=direction==="previous"&&currentIndex===0;if(isWrappingForward){const clonedFirstSlidePosition=realSlides[realSlides.length-1].offsetLeft+this.sliderItemOffset;this.slider.scrollTo({left:clonedFirstSlidePosition,behavior:"smooth"}),this.currentPosition=1,this.renderUI();return}if(isWrappingBackward){const clonedLastSlidePosition=realSlides[0].offsetLeft-this.sliderItemOffset;this.slider.scrollTo({left:clonedLastSlidePosition,behavior:"smooth"}),this.currentPosition=realSlides.length,this.renderUI();return}}const targetSlide=realSlides[targetIndex];this.currentPosition=targetIndex+1,this.slider.scrollTo({left:targetSlide.offsetLeft,behavior:"smooth"}),this.renderUI()}onDotClick(event){const dotIndex=parseInt(event.currentTarget.dataset.index,10);if(!dotIndex||dotIndex<1)return;const realSlides=this.getRealSlides();if(dotIndex>realSlides.length)return;const targetSlide=realSlides[dotIndex-1];this.slider.scrollTo({left:targetSlide.offsetLeft,behavior:"smooth"})}connectedCallback(){this.dataset.reset_scroll==="true"&&requestAnimationFrame(()=>{if(this.isInfinite)this.scrollToInitialPosition();else{const firstSlide=this.realSlides?.[0];firstSlide&&this.slider.scrollTo({left:firstSlide.offsetLeft,behavior:"instant"})}}),this.dataset.reset_scroll==="true"&&!this.closest(".product-grid")&&(this.isInfinite?this.slider.scrollLeft=this.sliderItems[1].offsetLeft:this.slider.scrollLeft=0)}addDragListeners(){this.getRealSlides().length<=1||(this.slider.addEventListener("mousedown",event=>this.initDrag(event)),this.slider.addEventListener("mousemove",event=>this.onDrag(event)),this.slider.addEventListener("mouseup",()=>this.endDrag()),this.slider.addEventListener("mouseleave",()=>this.endDrag()),this.slider.addEventListener("touchstart",event=>this.initDrag(event),{passive:!0}),this.slider.addEventListener("touchmove",event=>this.onDrag(event),{passive:!1}),this.slider.addEventListener("touchend",()=>this.endDrag()),this.slider.addEventListener("touchcancel",()=>this.endDrag()),this.slider.addEventListener("click",event=>{this.wasDragging&&event.target.closest("a, button")&&(event.preventDefault(),event.stopPropagation())},!0))}initDrag(event){event.type!=="touchstart"&&event.preventDefault();const pageX=event.pageX!==void 0?event.pageX:event.targetTouches[0].pageX,pageY=event.pageY!==void 0?event.pageY:event.targetTouches[0].pageY;this.modalTrigger=event.target,this.slider.style.cursor="grabbing",this.slider.classList.add("is-dragging"),this.mouseDown=!0,this.isDragging=!0,this.startX=pageX,this.startY=pageY,this.scrollStart=this.slider.scrollLeft,this.dragDirection=null,this.noMovement=!0,this.hasDragged=!1}onDrag(event){if(!this.mouseDown)return;const threshold=50,isTouch=event.type.startsWith("touch"),pageX=event.pageX!==void 0?event.pageX:event.touches[0].pageX,pageY=event.pageY!==void 0?event.pageY:event.touches[0].pageY,walk=pageX-this.startX;let noMovement=Math.abs(walk)<threshold;if(this.dragDeltaX=walk,this.slider.scrollLeft=this.scrollStart-walk,this.dragDirection===null&&isTouch){const dx=Math.abs(pageX-this.startX),dy=Math.abs(pageY-this.startY);this.dragDirection=dx>dy?"horizontal":"vertical"}this.dragDirection==="vertical"&&isTouch&&(noMovement=!0),(this.dragDirection==="horizontal"||!isTouch)&&event.preventDefault(),!noMovement&&!this.hasDragged&&(this.setLinkAction("none"),this.hasDragged=!0),noMovement||(this.noMovement=!1)}endDrag(){if(!this.mouseDown)return;const hadMovement=this.noMovement===!1;if(this.noMovement!==!1&&this.mouseDown&&this.dragDirection===null&&this.modalTrigger.classList.contains("product__media-toggle")&&this.modalTrigger?.click(),this.mouseDown=!1,this.isDragging=!1,this.slider.style.cursor="auto",this.slider.classList.remove("is-dragging"),this.setLinkAction("auto"),this.noMovement=!0,this.dragDirection=null,this.hasDragged=!1,hadMovement&&(this.wasDragging=!0,clearTimeout(this.wasDraggingTimeout),this.wasDraggingTimeout=setTimeout(()=>{this.wasDragging=!1},100)),!this.sliderItemOffset)return;const dragWasLeft=this.dragDeltaX<0;if(this.dragDeltaX=0,!hadMovement){const realSlides=this.getRealSlides();if(realSlides.length===0)return;const currentIndex=Math.max(0,Math.min(this.currentPosition-1,realSlides.length-1));this.slider.scrollTo({left:realSlides[currentIndex].offsetLeft,behavior:"smooth"});return}this.isInfinite&&this.checkInfiniteBoundary()||this.goToSlide(dragWasLeft?"next":"previous")}
1setLinkAction(pointer){this.getAllSlides().forEach(slide=>{slide.querySelectorAll("button, a").forEach(action=>{action.style.pointerEvents=pointer})})}}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.querySelector(".slideshow__slide"),this.sliderItemsToShow.length>0&&(this.currentPosition=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.getAttribute("data-autoplay")==="true"&&this.setAutoPlay())}setAutoPlay(){this.sliderAutoplayButton=this.querySelector(".slideshow__autoplay"),this.autoplaySpeed=this.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}update(){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.currentPosition-1]?.classList.add("slider-counter__link--active"),this.sliderControlButtons[this.currentPosition-1]?.setAttribute("aria-current",!0))}autoPlayToggle(){this.togglePlayButtonState(this.autoplayButtonIsSetToPlay),this.autoplayButtonIsSetToPlay?this.pause():this.play(),this.autoplayButtonIsSetToPlay=!this.autoplayButtonIsSetToPlay}focusOutHandling(event){const focusedOnAutoplayButton=event.target===this.sliderAutoplayButton||this.sliderAutoplayButton?.contains(event.target);!this.autoplayButtonIsSetToPlay||focusedOnAutoplayButton||this.play()}focusInHandling(event){(event.target===this.sliderAutoplayButton||this.sliderAutoplayButton?.contains(event.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 realSlides=this.getRealSlides();if(realSlides.length===0)return;const nextIndex=(this.currentPosition-1+1)%realSlides.length,targetSlide=realSlides[nextIndex];this.slider.scrollTo({left:targetSlide.offsetLeft,behavior:"smooth"})}setSlideVisibility(){this.sliderItemsToShow.forEach((item,index)=>{const linkElements=item.querySelectorAll("a");index===this.currentPosition-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(event){event.preventDefault();const slideScrollPosition=this.slider.scrollLeft+this.sliderFirstItemNode.clientWidth*(this.sliderControlLinksArray.indexOf(event.currentTarget)+1-this.currentPage);this.slider.scrollTo({left:slideScrollPosition})}}customElements.define("slideshow-component",SlideshowComponent);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");
1html.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();const cards=html.querySelectorAll(".grid__item");if(this.dataset.feature_card_enabled==="true"){const columns_desktop=parseInt(this.dataset.columns_desktop),cards_fit_desktop=cards.length<=columns_desktop,feature_wrap_el=document.querySelector(`#shopify-section-${this.dataset.section_id} .carousel__feature-wrap`);cards_fit_desktop&&feature_wrap_el.classList.add("carousel__feature-wrap--cards-fit-desktop")}const parent_section=document.getElementById(this.dataset.section_id),hide_recently_tab=this.dataset.hide_recently_tab==="true",product_handle=this.dataset.product_handle,product_handles_list=localStorage.getItem("shopify_recently_viewed"),no_recently_viewed=!product_handles_list||product_handles_list==""||product_handles_list==product_handle;if(cards)this.classList.add("product-recommendations--loaded");else if(hide_recently_tab||no_recently_viewed)parent_section&&parent_section.classList.add("hidden");else{const recommendations2=parent_section.querySelector("product-recommendations"),recently=parent_section.querySelector("recently-viewed"),recommendations_tab=parent_section.querySelector(".product-recommendations-tab"),recently_tab=parent_section.querySelector(".recently-viewed-tab");recommendations_tab.classList.add("hidden"),recently_tab.classList.add("hidden"),recommendations2.classList.remove("active"),recently.classList.add("active")}}).catch(e=>{console.error(e)}))};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}}customElements.define("product-recommendations",ProductRecommendations);class UpsellProductRecommendations extends HTMLElement{constructor(){super()}connectedCallback(){fetch(this.dataset.url).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recommendations=html.querySelector(`#${this.id}`);recommendations&&(recommendations.innerHTML.trim().length==0?fetch(this.dataset.fallbackurl).then(response=>response.text()).then(text2=>{html.innerHTML=text2;const recommendations2=html.querySelector(`#${this.id}`);this.innerHTML=recommendations2.innerHTML,!this.querySelector("slideshow-component")&&this.classList.contains("complementary-products")&&this.remove(),html.querySelector(".grid__item")&&this.classList.add("product-recommendations--loaded")}):(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)})}}customElements.define("upsell-product-recommendations",UpsellProductRecommendations);class CrossellProductRecommendations extends HTMLElement{constructor(){super()}connectedCallback(){fetch(this.dataset.url).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recommendations=html.querySelector("crossell-product-recommendations");recommendations&&(recommendations.innerHTML.trim().length===0?fetch(this.dataset.fallbackurl).then(response=>response.text()).then(text2=>{html.innerHTML=text2;const recommendations2=html.querySelector("crossell-product-recommendations");this.innerHTML=recommendations2.innerHTML,!this.querySelector("slideshow-component")&&this.classList.contains("complementary-products")&&this.remove(),html.querySelector(".grid__item")&&this.classList.add("product-recommendations--loaded")}):(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)})}}customElements.define("crossell-product-recommendations",CrossellProductRecommendations);class RecentlyViewed extends HTMLElement{constructor(){super()}config={maxToShow:parseInt(this.dataset.max_cards_to_output),minToShow:1,howManyToStoreInMemory:parseInt(this.dataset.max_cards_to_output),numberProducts:0,onComplete:null};productHandleQueue=[];cookie={name:"shopify_recently_viewed",write:function(recentlyViewed){localStorage.setItem(this.name,recentlyViewed.join(","))},read:function(){let recentlyViewed=[],cookieValue=localStorage.getItem(this.name);return cookieValue&&(recentlyViewed=cookieValue.split(",")),recentlyViewed},destroy:function(){localStorage.removeItem(this.name)},remove:function(productHandle){let recentlyViewed=this.read(),position=recentlyViewed.indexOf(productHandle);position!==-1&&(recentlyViewed.splice(position,1),this.write(recentlyViewed))}};finalize=()=>{const sliderComponent=this.querySelector("slider-component"),sliderUL=this.querySelector("slider-component ul.slider"),featureWrap=document.querySelector(`#shopify-section-${this.dataset.section_id}.carousel__feature-wrap`),max_cards_to_output=this.config.maxToShow,columns_desktop=parseInt(this.dataset.columns_desktop),columns_mobile=parseInt(this.dataset.columns_mobile);let cards_fit_desktop=sliderUL.children.length<=columns_desktop;const cards_fit_mobile=sliderUL.children.length<=columns_mobile;this.dataset.feature_card_enabled==="true"?cards_fit_desktop=sliderUL.children.length<columns_desktop:cards_fit_desktop=sliderUL.children.length<=columns_desktop,cards_fit_desktop?sliderComponent.classList.add("slider-component--cards-fit-desktop"):sliderComponent.classList.remove("slider-component--cards-fit-desktop"),cards_fit_mobile?sliderComponent.classList.add("slider-component--cards-fit-mobile"):sliderComponent.classList.remove("slider-component--cards-fit-mobile"),featureWrap&&(cards_fit_desktop?featureWrap.classList.add("carousel__feature-wrap--cards-fit-desktop"):featureWrap.classList.remove("carousel__feature-wrap--cards-fit-desktop")),this.dataset.full_width==="true"?(sliderComponent.classList.add("slider-component-full-width"),sliderComponent.classList.remove("page-width"),sliderUL.prepend(li),sliderUL.appendChild(li_2)):(sliderComponent.classList.remove("slider-component-full-width"),sliderComponent.classList.add("page-width")),sliderUL.scrollLeft=0,this.classList.add("recently-viewed--loaded")};getRecentProducts=async()=>{let searchRecentlyUrl,productHandle;window.location.pathname.indexOf("/products/")!==-1&&(productHandle=window.location.pathname.match(/\/products\/([a-z0-9\-]+)/)[1],this.productHandleQueue=this.productHandleQueue.filter(handle=>productHandle!==handle)),!(this.productHandleQueue.length<this.config.minToShow)&&(this.config.numberProducts=this.productHandleQueue.length,this.productHandleQueue.length=this.config.maxToShow,searchRecentlyUrl="/search?view=ua_recently-viewed&q="+this.productHandleQueue.toString(),await fetch(searchRecentlyUrl).then(response=>response.text()).then(html=>{document.querySelector(`#shopify-section-${this.dataset.sectionid} recently-viewed`).innerHTML=html,this.finalize();const title=document.querySelector("recently-viewed .carousel__title");title.innerHTML=this.dataset.title}).catch(err=>{console.warn("Something went wrong.",err)}))};recordRecentlyViewed=values=>{let vals=values||{},recentlyViewed=this.cookie.read(),productHandle,position;this.config={...this.config,...vals},window.location.pathname.indexOf("/products/")!==-1&&(productHandle=window.location.pathname.match(/\/products\/([a-z0-9\-]+)/)[1],position=recentlyViewed.indexOf(productHandle),position===-1?(recentlyViewed.unshift(productHandle),recentlyViewed=recentlyViewed.splice(0,this.config.howManyToStoreInMemory)):(recentlyViewed.splice(position,1),recentlyViewed.unshift(productHandle)),this.cookie.write(recentlyViewed))};showRecentlyViewed=parameters=>{const recently_is_only_tab=this.dataset.recently_is_only_tab==="true",sectionid=this.dataset.section_id,carousel=document.querySelector(".carousel.section-"+sectionid),product_handles_list=localStorage.getItem("shopify_recently_viewed");if(this.dataset.on_product_page==="true"){const product_handle=this.dataset.product_handle,no_recently_viewed=!product_handles_list||product_handles_list==""||product_handles_list==product_handle;if(recently_is_only_tab&&no_recently_viewed&&carousel)carousel.classList.add("hidden");else{const no_recently_viewed2=!product_handles_list||product_handles_list=="";recently_is_only_tab&&no_recently_viewed2&&carousel&&carousel.classList.add("hidden")}}let params=parameters||{};if(this.config={...this.config,...params},this.productHandleQueue=this.cookie.read(),this.productHandleQueue===null||this.productHandleQueue===void 0)return!1;this.config.maxToShow=Math.min(this.productHandleQueue.length,this.config.maxToShow),this.config.maxToShow&&this.getRecentProducts().then()};connectedCallback(){this.showRecentlyViewed(),this.recordRecentlyViewed()}}customElements.define("recently-viewed",RecentlyViewed);class CopyToClipboard extends HTMLElement{constructor(){super(),this.textContainer=this.querySelector("span"),this.clipboadText=this.dataset.clipboardText,this.copiedMessage=this.dataset.copiedMessage,this.addEventListener("click",()=>{navigator.clipboard.writeText(this.clipboadText).then(()=>{this.textContainer.innerHTML=this.copiedMessage})})}}
1customElements.define("copy-to-clipboard",CopyToClipboard);
2//# sourceMappingURL=/cdn/shop/t/318/assets/global-components.js.map?v=6326749566674374971790859038

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.