function y(){document.querySelectorAll("[data-filter]").forEach(e=>e.addEventListener("click",()=>{document.querySelectorAll("[data-filter]").forEach(t=>delete t.dataset.active),e.dataset.active="true"})),document.querySelectorAll("[data-mode-tabs]").forEach(e=>{e.addEventListener("click",t=>{const s=t.target.closest("[data-mode]");s&&(e.querySelectorAll("[data-mode]").forEach(i=>delete i.dataset.active),s.dataset.active="true")})});const o=document.querySelector("[data-chat-drawer]"),n=document.querySelector("[data-chat-overlay]"),c=document.querySelector("[data-chat-id]");function r(e){c&&(c.textContent=e),o.style.display="flex",n.style.display="block",document.body.style.overflow="hidden"}function d(){o.style.display="none",n.style.display="none",document.body.style.overflow=""}document.querySelectorAll("[data-open-chat]").forEach(e=>{e.addEventListener("click",t=>{t.stopPropagation(),r(e.dataset.openChat)})}),n.addEventListener("click",d),document.querySelectorAll("[data-close-chat]").forEach(e=>e.addEventListener("click",d)),document.addEventListener("keydown",e=>{e.key==="Escape"&&o.style.display!=="none"&&d()});const l=document.querySelector("[data-assign-toggle]"),a=document.querySelector("[data-assign-menu]");l&&a&&(l.addEventListener("click",e=>{e.stopPropagation(),a.style.display=a.style.display==="none"?"block":"none"}),document.addEventListener("click",e=>{e.target.closest("[data-assign-host]")||(a.style.display="none")}))}export{y as default};
