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

	& > div {
	border : ${o&&"none"}
	}
    
    &:hover {
      border-color: ${o?n[600]:f[400]};
    }



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