import{r as e}from"./index-NdkWRN8K.js";import{M as G}from"./Field-DH3L8v09.js";import{g as J,u as K}from"./inputUtils-Dbi8XkA6.js";import{j as a}from"./jsx-runtime-CnH95YSl.js";import{I as Q}from"./InputBase-DeB4_faH.js";import{I as T}from"./InputAdornment-CdR3XT6f.js";const P=["email","number","tel","text","url"],U=e.forwardRef(({ariaDescribedBy:k,autoCompleteType:n,defaultValue:u,hasInitialFocus:m,endAdornment:l,errorMessage:L,errorMessageList:S,hint:h,HintLinkComponent:z,id:B,inputRef:D,inputMode:d,isDisabled:E=!1,isFullWidth:H=!1,isMultiline:c=!1,isOptional:o=!1,isReadOnly:f,label:q,name:p,onBlur:x,onChange:s,onFocus:b,placeholder:F,startAdornment:i,testId:j,translate:r,type:R="text",value:y},I)=>{const w=e.useRef(J({controlledValue:y,uncontrolledValue:u})),V=K({defaultValue:u,value:y,controlState:w.current}),g=e.useRef(null);e.useImperativeHandle(D,()=>({focus:()=>{var t;(t=g.current)==null||t.focus()}}),[]);const C=e.useCallback(t=>{s==null||s(t)},[s]),N=e.useCallback(({ariaDescribedBy:t,errorMessageElementId:W,id:M,labelElementId:v})=>a.jsx(Q,{...V,"aria-describedby":t,autoComplete:n,autoFocus:m,endAdornment:l&&a.jsx(T,{position:"end",translate:r,children:l}),id:M,inputProps:{"aria-errormessage":W,"aria-labelledby":v,"data-se":j,inputMode:d},inputRef:g,multiline:c,name:p??M,onBlur:x,onChange:C,onFocus:b,placeholder:F,readOnly:f,ref:I,required:!o,startAdornment:i&&a.jsx(T,{position:"start",translate:r,children:i}),translate:r,type:R}),[n,V,m,l,d,c,p,x,C,b,F,o,f,I,i,j,r,R]);return a.jsx(G,{ariaDescribedBy:k,errorMessage:L,errorMessageList:S,fieldType:"single",hasVisibleLabel:!0,hint:h,HintLinkComponent:z,id:B,isDisabled:E,isFullWidth:H,isOptional:o,label:q,renderFieldComponent:N})}),X=e.memo(U);X.displayName="TextField";export{X as M,P as t};
