import{r as u,K as m,ac as L}from"./app-bWy6VYs1.js";function E(){const o=u({}),t=u(null),l=u(null),a=u({});let s=null;const v=(e,r)=>{a.value[e]=r??null},i=e=>{const r=a.value[e];if(!r)return;const c=r.getBoundingClientRect();l.value={top:`${c.bottom+4}px`,left:`${c.left}px`,width:`${c.width}px`},t.value=e},d=e=>{o.value[e]=!0,i(e)},p=e=>{o.value[e]=!0,i(e)},w=e=>{setTimeout(()=>{o.value[e]=!1,t.value===e&&(t.value=null,l.value=null)},200)},f=e=>{o.value[e]=!1,t.value===e&&(t.value=null,l.value=null)},n=()=>{t.value!==null&&i(t.value)},g=e=>{s?.removeEventListener("scroll",n),s=e,s?.addEventListener("scroll",n,{passive:!0})};return m(()=>{window.addEventListener("scroll",n,!0),window.addEventListener("resize",n)}),L(()=>{window.removeEventListener("scroll",n,!0),window.removeEventListener("resize",n),s?.removeEventListener("scroll",n)}),{activeSuggestionIndex:t,closeProductSuggestions:f,dropdownStyle:l,handleDescriptionBlur:w,handleDescriptionFocus:d,handleDescriptionInput:p,registerLineItemsScrollParent:g,setDescriptionInputRef:v,showProductSuggestions:o}}export{E as u};
