import{r as c,f as B,j as s,B as A}from"./index-5768b108.js";import{C as E}from"./index.esm-4803c918.js";import{T as j}from"./TextField-265270c2.js";import{I as k,F as T}from"./InputLabel-bfa922b7.js";function $({control:F,id:m,label:b,name:t,minRows:l=3,maxRows:i=3,placeholder:u,helperText:x,containerSx:f,onChange:d,required:g,...v}){const h={100:"#DAECFF",200:"#b6daff",400:"#3399FF",500:"#007FFF",600:"#0072E5",900:"#003A75"},a={50:"#F3F6F9",100:"#E5EAF2",200:"#DAE2ED",300:"#C7D0DD",400:"#B0B8C4",500:"#9DA8B7",600:"#6B7A90",700:"#434D5B",800:"#303740",900:"#1C2025"},p={200:"#FFCDD2",600:"#fc0000"},C=B(j,{shouldForwardProp:r=>r!=="error"})(({theme:r,error:e})=>`
    box-sizing: border-box;
    width: 100%;
    font-family: "initial";
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    text-transform: uppercase;
    border-radius: 8px;
    color: ${r.palette.mode==="dark"?a[300]:a[900]};
    background: ${r.palette.background.paper};
    border: 1px solid ${e?p[600]:r.palette.mode==="dark"?a[700]:a[200]};

	& > div {
	border : ${e&&"none"}
	}
    
    &:hover {
      border-color: ${e?p[600]:h[400]};
    }



    // firefox
    &:focus-visible {
      outline: 0;
    }
  `),D=c.useCallback((r,e)=>{const n=o=>{o.target.value=o.target.value.toUpperCase(),r.onChange(o),d&&d(o)};return s.jsx(C,{id:t,multiline:!0,"aria-label":t,minRows:l,maxRows:i,placeholder:u,error:!!e.error,onChange:n,value:r.value??"",name:r.name,onBlur:r.onBlur,inputRef:r.ref})},[t,l,i,u]);return s.jsx(E,{control:F,name:t,render:({field:r,fieldState:e})=>{var n,o;return s.jsxs(A,{sx:f,children:[s.jsx(k,{sx:{".MuiInputLabel-asterisk":{color:"red"}},required:g,htmlFor:m??t,style:{fontWeight:"medium"},error:e.error!=null,children:b}),D(r,e),(x||((n=e.error)==null?void 0:n.message))&&s.jsx(T,{error:e.error!=null,children:((o=e.error)==null?void 0:o.message)??x})]})}})}const w=c.memo($);export{w as T};
