import{r as j,f as $,j as e,am as k,B as A}from"./index-dc933734.js";import{C as E}from"./index.esm-288e984c.js";import{T,I as v,a as w}from"./TextField-a8016ff3.js";function y({control:x,id:c,label:p,name:t,minRows:m=3,maxRows:b=3,placeholder:h,helperText:n,containerSx:g,onChange:a,required:F,disabled:f,readOnly:B,...I}){const s={50:"#F3F6F9",100:"#E5EAF2",200:"#DAE2ED",300:"#C7D0DD",400:"#B0B8C4",500:"#9DA8B7",600:"#6B7A90",700:"#434D5B",800:"#303740",900:"#1C2025"},l={200:"#FFCDD2",600:"#fc0000"},D=$(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"?s[300]:s[900]};
    background: ${r.palette.background.paper};
    //border: 0.5px solid ${o?l[600]:r.palette.mode==="dark"?s[700]:s[200]};

	& > div {
	border : ${o&&"none"}
	}
    
    &:hover {
      border-color: ${o?l[600]:"#5B3959"};
    }

    & textarea {
      font-weight: normal !important;
    }



    &:focus {
      border-color: ${o?l[600]:"#5B3959"};
      border-width: 1px;
    }

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