(function(){try{var g=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};g["__faroBundleId_hub-ui"]="1776167467284-ccee406086"}catch(l){}})();import{r as a,j as e}from"./c2heove9.js";import{C as k}from"./hiq1m2e4.js";import{S as T}from"./ok4ixd5a.js";import{o as n,j as z,p as V,h as $}from"./lej86w1k.js";const J=a.forwardRef(function({placeholder:f,helperText:x,label:h,value:i,defaultValue:l,name:j,loading:p,disabled:m,error:C,color:S,id:g,inputRef:r,InputProps:w,onChange:c,onClear:b,...v},y){const[A,d]=a.useState(!!i||!!l),o=a.useRef(null),B=()=>{b?.(),c?.(""),d(!1),o.current&&(o.current.value="")},I=e.jsx(n,{position:"start",children:e.jsx(T,{sx:{color:"secondary.main"}})});let s=e.jsx(n,{position:"end"});p?s=e.jsx(n,{position:"end",children:e.jsx(z,{size:20})}):A&&(s=e.jsx(n,{position:"end",children:e.jsx(V,{edge:"end",onClick:B,"aria-label":"Clear searched text",color:"secondary",children:e.jsx(k,{})})}));const R=t=>{o.current=t,r&&(typeof r=="function"?r(t):r&&(r.current=t))};return e.jsx($,{ref:y,inputRef:R,id:g,placeholder:f,label:h,value:i,defaultValue:l,disabled:m,error:C,color:S,name:j,onChange:t=>{const u=t.target.value||"";c?.(u),d(!!u)},slotProps:{input:{endAdornment:s,startAdornment:I,...w}},helperText:x,variant:"outlined",...v})});export{J as S};