1import L from"./Drawer-Cc5lsFrD.js";import"./focus-trap-BuxM9FA5.js";import"./salt-shared-state-Bx8zs5ZS.js";import"./vendor-zustand-Dy6UiuHe.js";import"./vendor-react-CtiMv8uc.js";function H(p){const c=L(p);let r=null,u=null;function v(){const t=p.querySelector("[data-mobile-menu]");if(!t)return null;try{return JSON.parse(t.textContent)}catch{return null}}function y(){if(u=p.querySelector("[data-mobile-nav-root]"),!u||!(r!=null&&r.links))return;const t=b(r.links,1);u.appendChild(t)}function g(t){return(t??"").trim().toLowerCase()==="shop by room"?"Shop All Rooms":"View all"}function b(t,n){const l=document.createElement("ul");l.className=n===1?"mobile-nav__list":"mobile-nav__sublist",n>1&&(l.style.height="0",l.style.opacity="0",l.style.overflow="hidden");for(const e of t){const h=e.links&&e.links.length>0&&n<3,s=document.createElement("li");if(s.className="mobile-nav__item",h){const i=document.createElement("button");i.className="mobile-nav__link mobile-nav__link--has-children",i.setAttribute("aria-expanded","false"),i.type="button";const a=document.createElement("span");a.textContent=e.title,i.appendChild(a);const m=k();i.appendChild(m),i.addEventListener("click",()=>w(s,i)),s.appendChild(i);const o=document.createElement("a");o.className="mobile-nav__sublink",o.href=e.url,o.textContent=`View all ${e.title}`,o.style.display="none";const f=b(e.links,n+1),_=document.createElement("li"),d=document.createElement("a");d.className="mobile-nav__sublink",d.href=e.url,d.textContent=g(e.title),d.style.fontWeight="500",_.appendChild(d),f.prepend(_),s.appendChild(f)}else{const i=document.createElement("a");i.className=n===1?"mobile-nav__link":"mobile-nav__sublink",i.href=e.url,i.textContent=e.title,s.appendChild(i)}l.appendChild(s)}return l}function k(){const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 20 20"),t.setAttribute("width","16"),t.setAttribute("height","16"),t.setAttribute("aria-hidden","true"),t.setAttribute("class","mobile-nav__chevron");const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d","M5 7.5L10 12.5L15 7.5"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","1.5"),n.setAttribute("fill","none"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke-linejoin","round"),t.appendChild(n),t}function w(t,n){const l=t.classList.contains("mobile-nav__item--open"),e=t.querySelector(".mobile-nav__sublist");if(e)if(l)t.classList.remove("mobile-nav__item--open"),n.setAttribute("aria-expanded","false"),e.style.height=`${e.scrollHeight}px`,e.offsetHeight,e.style.height="0",e.style.opacity="0";else{const h=t.parentElement.querySelectorAll(".mobile-nav__item--open");for(const a of h){const m=a.querySelector(".mobile-nav__link--has-children"),o=a.querySelector(".mobile-nav__sublist");o&&(a.classList.remove("mobile-nav__item--open"),m==null||m.setAttribute("aria-expanded","false"),o.style.height=`${o.scrollHeight}px`,o.offsetHeight,o.style.height="0",o.style.opacity="0")}t.classList.add("mobile-nav__item--open"),n.setAttribute("aria-expanded","true");const s=e.scrollHeight;e.style.height=`${s}px`,e.style.opacity="1";const i=()=>{e.style.height="auto",e.removeEventListener("transitionend",i)};e.addEventListener("transitionend",i)}}function A(){c.init(),r=v(),r&&y()}function C(){c.destroy(),u&&(u.innerHTML="")}return{init:A,destroy:C,open:c.open,close:c.close,toggle:c.toggle}}export{H as default};
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.