1const DESKTOP_BREAKPOINT="(width >= 1024px)";class LyleMenuShelf extends HTMLElement{#currentKey=null;#panelHideTimers=new WeakMap;#isDesktop(){return window.matchMedia(DESKTOP_BREAKPOINT).matches}#findTier2(menuKey){return menuKey?[...this.querySelectorAll("[data-menu-tier2]")].find(panel=>panel.dataset.menuKey===menuKey):null}#setNavBlocks(menuKey){this.querySelectorAll("[data-menu-nav-blocks]").forEach(blocks=>{const isActive=blocks.dataset.menuKey===menuKey&&blocks.querySelector(".menu-shelf__nav-block");blocks.classList.remove("is-visible"),blocks.hidden=!isActive,isActive&&requestAnimationFrame(()=>{blocks.classList.add("is-visible")})})}#hideNavBlocks(){this.querySelectorAll("[data-menu-nav-blocks]").forEach(blocks=>{blocks.classList.remove("is-visible"),blocks.hidden=!0})}#getTier1Height(){return[...this.querySelectorAll("[data-menu-tier1]")].reduce((height,item)=>height+item.offsetHeight,0)}#setTier1Utilities(hidden){const lower=this.querySelector("[data-menu-shelf-lower]"),marketSwitcher=this.querySelector("[data-menu-shelf-market-switcher]");lower&&(lower.hidden=hidden),marketSwitcher&&(marketSwitcher.hidden=hidden)}#showTier2Panel(panel){const hideTimer=this.#panelHideTimers.get(panel);hideTimer&&(clearTimeout(hideTimer),this.#panelHideTimers.delete(panel)),panel.hidden=!1,requestAnimationFrame(()=>{panel.classList.add("is-active")})}#hideTier2Panel(panel,immediate=!1){const hideTimer=this.#panelHideTimers.get(panel);if(hideTimer&&(clearTimeout(hideTimer),this.#panelHideTimers.delete(panel)),panel.classList.remove("is-active"),immediate){panel.hidden=!0;return}const timer=setTimeout(()=>{panel.hidden=!0,this.#panelHideTimers.delete(panel)},300);this.#panelHideTimers.set(panel,timer)}#updateSizes=()=>{this.#isDesktop()||requestAnimationFrame(()=>{let height=0;if(this.classList.contains("show-tier2")&&this.#currentKey){const activePanel=this.#findTier2(this.#currentKey);activePanel&&(activePanel.classList.contains("menu-shelf__tier2--multiple")?height=activePanel.offsetHeight:activePanel.querySelectorAll(":scope > .menu-shelf__menu-item").forEach(item=>{height+=item.offsetHeight}))}else height=this.#getTier1Height();height>0&&document.documentElement.style.setProperty("--menu-shelf-links-height",`${height}px`)})};#openTier2=(menuKey,trigger)=>{if(this.#isDesktop())return;this.#currentKey=menuKey,this.classList.remove("show-tier1"),this.classList.add("show-tier2"),this.querySelectorAll("[data-menu-tier2]").forEach(panel=>{panel.dataset.menuKey===menuKey?this.#showTier2Panel(panel):this.#hideTier2Panel(panel)}),this.#setNavBlocks(menuKey);const back=this.querySelector("[data-menu-shelf-back]"),backLabel=this.querySelector("[data-menu-shelf-back-label]");back&&back.classList.remove("is-hidden"),backLabel&&trigger&&(backLabel.textContent=trigger.querySelector("span")?.textContent?.trim()||""),this.#setTier1Utilities(!0),trigger?.setAttribute("aria-expanded","true"),this.#updateSizes()};#resetMobile=()=>{this.#currentKey=null,this.classList.remove("show-tier2"),this.classList.add("show-tier1"),this.querySelector("[data-menu-shelf-back]")?.classList.add("is-hidden"),this.#setTier1Utilities(!1),this.querySelectorAll("[data-menu-shelf-open]").forEach(button=>{button.setAttribute("aria-expanded","false")}),this.querySelectorAll("[data-menu-tier2]").forEach(panel=>{this.#hideTier2Panel(panel)}),this.#hideNavBlocks(),this.#updateSizes()};connectedCallback(){this.addEventListener("click",this.#handleClick),this.querySelector("[data-menu-shelf-back]")?.addEventListener("click",this.#handleBack),this.#updateSizes()}disconnectedCallback(){this.removeEventListener("click",this.#handleClick),this.querySelector("[data-menu-shelf-back]")?.removeEventListener("click",this.#handleBack),this.querySelectorAll("[data-menu-tier2]").forEach(panel=>{const hideTimer=this.#panelHideTimers.get(panel);hideTimer&&clearTimeout(hideTimer)})}#handleBack=event=>{event.preventDefault(),this.goBack()};#handleClick=event=>{const openButton=event.target.closest("[data-menu-shelf-open]");openButton&&(event.preventDefault(),this.#openTier2(openButton.dataset.menuKey,openButton))};
1activateDesktopPanel(menuKey){this.#isDesktop()&&(this.querySelectorAll("[data-menu-desktop-panel]").forEach(panel=>{const isActive=panel.dataset.menuKey===menuKey;panel.hidden=!isActive}),this.#setNavBlocks(menuKey),this.classList.add("is-active","show-tier2"),this.classList.remove("show-tier1"))}clearDesktopPanels(){this.querySelectorAll("[data-menu-desktop-panel]").forEach(panel=>{panel.hidden=!0}),this.#hideNavBlocks(),this.classList.remove("is-active","show-tier2"),this.classList.add("show-tier1")}reset(){this.clearDesktopPanels(),this.#resetMobile()}goBack(){this.#resetMobile()}}customElements.get("lyle-menu-shelf")||customElements.define("lyle-menu-shelf",LyleMenuShelf); 2//# sourceMappingURL=/cdn/shop/t/458/assets/lyle-menu-shelf.js.map?v=56154511080142828471788364388
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.