"use client";
import{a as g,e as h,f as P,g as v,h as T,i as L,j as C,k as O}from"./chunk-2QTVE2XY.js";import{b as y}from"./chunk-SUBVXXYD.js";import{i as b}from"./chunk-CLTGASR6.js";import{s as u}from"./chunk-KEPQUAOX.js";import{forwardRef as Q,useRef as X}from"react";import o from"clsx";import{cloneElement as J,isValidElement as K}from"react";function V({endAdornment:n,ref:l,startAdornment:s}){let a=e=>e&&K(e)?J(e,{...e.props,onClick:e.props.onClick||(()=>l.current?.focus())}):e;return{endAdornment:a(n),startAdornment:a(s)}}import{jsx as r,jsxs as f}from"react/jsx-runtime";var W=Q((n,l)=>{let{autoFocus:s=!1,className:a,endAdornment:e,fullWidth:k,id:p,infoText:A,label:d,loading:m,loadingColorType:w,loadingWidthOverride:E,placeholder:I,rtl:F,startAdornment:B,variant:H,warning:M,...i}=n,N=H||"body1",U=E||"100%",c=X(null),{disabled:j,error:$,focused:q,getInputProps:z,getRootProps:D}=y({...n,inputRef:c}),R=z(),G=b(l,R.ref),t=g({disabled:j,error:$,focused:q||s,fullWidth:k,loading:m,noLabel:!d,placeholder:I,rtl:F,shrinkLabel:!!m,value:c.current?.value||i.defaultValue||i.value,warning:M}),{endAdornment:S,startAdornment:x}=V({endAdornment:e,ref:c,startAdornment:B});return f(h,{className:o(a,t.root),children:[f(P,{...D(),className:o(t.wrapper),children:[x&&r(u,{className:o(t.startAdornment),children:x}),f(v,{className:o(t.inner),children:[d&&r(T,{className:o(t.label),htmlFor:p,id:p&&`${p}-label`,children:d}),m?r(O,{colorType:w,fontVariant:N,widthOverride:U}):r(L,{...i,...R,autoFocus:s,className:o(t.input),id:p,placeholder:I,ref:G,variant:N})]}),S&&r(u,{className:o(t.endAdornment),children:S})]}),A&&r(C,{className:o(t.infoText),children:A})]})});W.displayName="Input";var Y=W;export{Y as a};
