var p=(c,l,r)=>new Promise((u,o)=>{var n=e=>{try{s(r.next(e))}catch(a){o(a)}},t=e=>{try{s(r.throw(e))}catch(a){o(a)}},s=e=>e.done?u(e.value):Promise.resolve(e.value).then(n,t);s((r=r.apply(c,l)).next())});import{aT as x,r as m,j as i,aA as h}from"./react-vendor-xYZnmIII.js";import{d as b}from"./debounce-CWHP_ANh.js";import{g as y}from"./route-D0xh7FtZ.js";import{c as f}from"./ui-components-CQM92IK3.js";const E=c=>{var a;const{className:l,iconPosition:r="left",placeholder:u="Search",onChangeValue:o}=c,n=x(),t=m.useRef(null),s=y(n.url),e=b(d=>p(null,null,function*(){const g=d.target.value;o(g)}),300);return m.useEffect(()=>{s.search&&t.current&&t.current.focus()},[n,s]),i.jsxs("div",{className:f("relative w-full md:max-w-[260px]",l),children:[i.jsx("input",{type:"text",ref:t,onChange:e,placeholder:u,className:f("focus:border-input border-input focus-visible:border-ring focus-visible:ring-ring/50 h-9 w-full rounded-md border py-[15px] text-sm font-normal text-gray-500 focus:ring-0 focus:outline-0 focus-visible:ring-[3px]",r==="left"?"pr-4 pl-12":"pr-12 pl-4"),defaultValue:(a=s.search)!=null?a:""}),i.jsx(h,{className:f("absolute top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-gray-700",r==="left"?"left-4":"right-4")})]})};export{E as S};
