PageSourceSearch

https://www.lyleandscott.com/cdn/shop/t/458/compiled_assets/scripts.js?v=106088276378740411851788773168

js lyleandscott.com collected 2026-09-24 23:00:00 UTC 11,122 bytes, 2 lines download raw bytes

1(function(){var __sections__={};(function(){for(var i=0,s=document.getElementById("sections-script").getAttribute("data-sections").split(",");i<s.length;i++)__sections__[s[i]]=!0})(),(function(){if(!(!__sections__["doorway-blocks"]&&!Shopify.designMode))try{class LyleDoorwayBlocks extends HTMLElement{connectedCallback(){this.track=this.querySelector("[data-doorway-blocks-track]"),this.list=this.querySelector("[data-doorway-blocks-list]"),this.previous=this.querySelector("[data-doorway-blocks-previous]"),this.next=this.querySelector("[data-doorway-blocks-next]"),this.previous?.addEventListener("click",this.handlePrevious),this.next?.addEventListener("click",this.handleNext),this.track?.addEventListener("scroll",this.updateControls,{passive:!0}),this.track&&"ResizeObserver"in window&&(this.resizeObserver=new ResizeObserver(this.updateControls),this.resizeObserver.observe(this.track)),this.initReveal(),requestAnimationFrame(this.updateControls)}disconnectedCallback(){this.previous?.removeEventListener("click",this.handlePrevious),this.next?.removeEventListener("click",this.handleNext),this.track?.removeEventListener("scroll",this.updateControls),this.resizeObserver?.disconnect(),this.revealObserver?.disconnect()}handlePrevious=()=>this.move(-1);handleNext=()=>this.move(1);move(direction){const card=this.list?.querySelector(".doorway-blocks__slide");if(!card||!this.track)return;const gap=parseFloat(getComputedStyle(this.list).columnGap)||0,distance=card.getBoundingClientRect().width+gap,behavior=matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth";this.track.scrollBy({left:distance*direction,behavior})}updateControls=()=>{if(!this.track)return;const position=Math.abs(this.track.scrollLeft),maximum=Math.max(0,this.track.scrollWidth-this.track.clientWidth);this.previous&&(this.previous.disabled=position<=1),this.next&&(this.next.disabled=position>=maximum-1)};initReveal(){if(matchMedia("(prefers-reduced-motion: reduce)").matches||!("IntersectionObserver"in window)){this.classList.add("is-active");return}this.classList.add("is-observed"),this.revealObserver=new IntersectionObserver(([entry])=>{entry?.isIntersecting&&(this.classList.add("is-active"),this.revealObserver.disconnect())},{threshold:.2}),this.revealObserver.observe(this)}}customElements.get("lyle-doorway-blocks")||customElements.define("lyle-doorway-blocks",LyleDoorwayBlocks)}catch(e){console.error(e)}})(),(function(){if(!(!__sections__["main-faq"]&&!Shopify.designMode))try{const openGorgiasChat=()=>{const gorgias=window.GorgiasChat;if(gorgias&&typeof gorgias.open=="function"){gorgias.open();return}(gorgias&&typeof gorgias.init=="function"?gorgias.init():new Promise(resolve=>{window.addEventListener("gorgias-widget-loaded",resolve,{once:!0})})).then(()=>{typeof window.GorgiasChat?.open=="function"&&window.GorgiasChat.open()})},setupFaqChat=()=>{const faqSections=document.querySelectorAll("[data-main-faq]");for(const faqSection of faqSections){const chatButtons=faqSection.querySelectorAll("[data-main-faq-chat]");for(const chatButton of chatButtons)chatButton.addEventListener("click",openGorgiasChat)}};(()=>{const faqSections=document.querySelectorAll("[data-main-faq]");for(const faqSection of faqSections){const links=Array.from(faqSection.querySelectorAll("[data-main-faq-link]")),categories=Array.from(faqSection.querySelectorAll("[data-main-faq-category]"));if(!links.length||!categories.length)continue;const categoryIds=categories.map(category=>category.dataset.mainFaqCategory),initialHash=window.location.hash.replace("#",""),initialId=categoryIds.includes(initialHash)?initialHash:categoryIds[0],setActiveCategory=(id,shouldUpdateUrl=!0)=>{for(const link of links){const isActive=link.dataset.mainFaqLink===id;link.classList.toggle("is-active",isActive),isActive?link.setAttribute("aria-current","true"):link.removeAttribute("aria-current")}for(const category of categories)category.hidden=category.dataset.mainFaqCategory!==id;if(shouldUpdateUrl){const updatedUrl=new URL(window.location.href);updatedUrl.hash=id,history.replaceState({},"",updatedUrl.href)}};setActiveCategory(initialId,!1);for(const link of links)link.addEventListener("click",event=>{event.preventDefault();const id=link.dataset.mainFaqLink,activeLink=links.find(item=>item.classList.contains("is-active"));if(setActiveCategory(id),activeLink?.dataset.mainFaqLink!==id){const activeCategory=categories.find(category=>category.dataset.mainFaqCategory===id),behavior=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth";activeCategory?.scrollIntoView({behavior,block:"start"})}})}})(),setupFaqChat()}catch(e){console.error(e)}})(),(function(){if(__sections__["product-recommendations"])try{class LyleProductRecommendations extends HTMLElement{#controller;#observer;#carousel;#resizeObserver;connectedCallback(){this.#controller=new AbortController,this.#observer=new IntersectionObserver(entries=>{entries.some(entry=>entry.isIntersecting)&&(this.#observer.disconnect(),this.#load(this.#controller.signal))},{rootMargin:"400px 0px"}),this.#observer.observe(this.closest(".shopify-section"))}disconnectedCallback(){this.#controller.abort(),this.#observer.disconnect(),this.#resizeObserver?.disconnect(),this.#carousel?.destroy(),this.#carousel=null}async#load(signal){const config=JSON.parse(this.querySelector("[data-product-cards-config]").textContent),recommendations=JSON.parse(this.querySelector("[data-recommendations-config]").textContent),list=this.querySelector(".splide__list");try{const{fetchProductRecommendations}=await import("@lyle/algolia-recommendations"),hits=await fetchProductRecommendations(config.algolia,recommendations,signal);if(signal.aborted)return;if(hits.length){const[{formatAlgoliaProductHit},{AlgoliaProductCardRenderer}]=await Promise.all([import("@lyle/algolia-product-fetcher"),import("@lyle/algolia-product-card")]);if(signal.aborted)return;const renderer=new AlgoliaProductCardRenderer({config,icons:window.icons||{},isMobile:()=>window.matchMedia("(width < 1024px)").matches});list.innerHTML=hits.map((hit,index)=>`<li class="splide__slide">${renderer.render(formatAlgoliaProductHit(hit,config),index)}</li>`).join("")}}catch(error){if(signal.aborted)return;console.warn("Product recommendations could not load.",error)}if(signal.aborted||(this.closest(".product-recommendations").hidden=!list.children.length,!list.children.length))return;const{default:Splide}=await import("@splidejs/splide");if(signal.aborted)return;const speed=Number(this.dataset.carouselSpeed)||0;this.#carousel=new Splide(this.querySelector(".splide"),{arrows:!0,autoplay:speed>0&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches,interval:speed*1e3,gap:"var(--spacing-5xs)",mediaQuery:"min",pagination:!1,perMove:1,perPage:2,rewind:!0,i18n:{prev:this.querySelector(".splide__arrow--prev").getAttribute("aria-label"),next:this.querySelector(".splide__arrow--next").getAttribute("aria-label"),play:this.querySelector(".splide__toggle__play")?.textContent,pause:this.querySelector(".splide__toggle__pause")?.textContent},breakpoints:{768:{perPage:4}}});const updateControls=()=>{const image=this.querySelector(".product-card__image-frame");image&&this.style.setProperty("--recommendations-arrow-top",`${image.offsetHeight/2}px`),this.querySelector(".splide__arrow--prev").disabled=this.#carousel.index===0,this.querySelector(".splide__arrow--next").disabled=this.#carousel.index>=this.#carousel.Components.Controller.getEnd()};this.#carousel.on("mounted arrows:updated resized",updateControls),this.#carousel.mount(),this.#resizeObserver=new ResizeObserver(updateControls),this.#resizeObserver.observe(this),await customElements.whenDefined("lyle-product-cards"),signal.aborted||await this.closest("lyle-product-cards").hydrate(list)}}customElements.get("lyle-product-recommendations")||customElements.define("lyle-product-recommendations",LyleProductRecommendations)}catch(e){console.error(e)}})(),(function(){if(!(!__sections__["secondary-header-settings"]&&!Shopify.designMode))try{class LyleSecondaryHeader extends HTMLElement{connectedCallback(){const header=document.querySelector("lyle-site-header");if(!header){this.hidden=!0;return}if(!this.closest("lyle-site-header")){header.append(this);return}this.dataset.initialized||(this.dataset.initialized="true",this.abortController=new AbortController,this.nav=this.querySelector(".secondary-header__nav"),this.links=[...this.querySelectorAll("[data-section-reference]")],this.sections=this.links.map(link=>
1document.getElementById(link.dataset.sectionReference)).filter(Boolean),this.links.forEach(link=>{link.addEventListener("click",this.handleClick,{signal:this.abortController.signal})}),this.observer=new IntersectionObserver(this.handleIntersection,{rootMargin:"-49% 0px -49%"}),this.sections.forEach(section=>this.observer.observe(section)))}disconnectedCallback(){this.abortController?.abort(),this.observer?.disconnect(),delete this.dataset.initialized}handleClick=event=>{const section=document.getElementById(event.currentTarget.dataset.sectionReference),header=this.closest("lyle-site-header");if(!section||!header)return;event.preventDefault();const top=section.getBoundingClientRect().top+window.scrollY-header.offsetHeight*2;window.scrollTo({top,behavior:"smooth"})};handleIntersection=entries=>{const activeSection=entries.find(entry=>entry.isIntersecting)?.target;activeSection&&this.links.forEach(link=>{const isActive=link.dataset.sectionReference===activeSection.id;link.classList.toggle("is-active",isActive),isActive?link.setAttribute("aria-current","true"):link.removeAttribute("aria-current"),isActive&&this.nav.scrollWidth>this.nav.clientWidth&&this.nav.scrollTo({left:link.offsetLeft,behavior:"smooth"})})}}customElements.get("lyle-secondary-header")||customElements.define("lyle-secondary-header",LyleSecondaryHeader)}catch(e){console.error(e)}})(),(function(){if(!(!__sections__.styleguide&&!Shopify.designMode))try{document.querySelectorAll("[data-styleguide]").forEach(root=>{const toHex=color=>{const parts=color.match(/\d+(\.\d+)?/g);return!parts||parts.length<3?color:`#${parts.slice(0,3).map(part=>Number(part).toString(16).padStart(2,"0")).join("").toUpperCase()}`},update=()=>{root.querySelectorAll("[data-swatch]").forEach(swatch=>{const chip=swatch.querySelector("[data-swatch-chip]"),value=swatch.querySelector("[data-swatch-value]");value.textContent=toHex(getComputedStyle(chip).backgroundColor)}),root.querySelectorAll("[data-type-row]").forEach(row=>{const sample=row.querySelector("[data-type-sample]"),size=row.querySelector("[data-type-size]"),styles=getComputedStyle(sample);size.textContent=`${parseFloat(styles.fontSize)}px / ${styles.fontWeight}`}),root.querySelectorAll("[data-spacing-item]").forEach(item=>{const bar=item.querySelector("[data-spacing-bar]"),value=item.querySelector("[data-spacing-value]");value.textContent=`${parseFloat(getComputedStyle(bar).width)}px`})};
1update(),window.addEventListener("resize",update)})}catch(e){console.error(e)}})()})();
2//# sourceMappingURL=/cdn/shop/t/458/compiled_assets/scripts.js.map?v=106088276378740411851788773168

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.