@react-solutions/inputs 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -9
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var tl=Object.defineProperty,ol=Object.defineProperties;var nl=Object.getOwnPropertyDescriptors;var we=Object.getOwnPropertySymbols;var Jt=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable;var Zt=(t,r,s)=>r in t?tl(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s,l=(t,r)=>{for(var s in r||(r={}))Jt.call(r,s)&&Zt(t,s,r[s]);if(we)for(var s of we(r))Qt.call(r,s)&&Zt(t,s,r[s]);return t},F=(t,r)=>ol(t,nl(r));var x=(t,r)=>{var s={};for(var e in t)Jt.call(t,e)&&r.indexOf(e)<0&&(s[e]=t[e]);if(t!=null&&we)for(var e of we(t))r.indexOf(e)<0&&Qt.call(t,e)&&(s[e]=t[e]);return s};import{FormControl as ll,InputAdornment as jt,TextField as rl}from"@mui/material";import{forwardRef as il,memo as al,useCallback as sl,useMemo as ge}from"react";import{jsx as Me}from"react/jsx-runtime";var eo=al(il((_,Y)=>{var G=_,{name:t,label:r,value:s,onChange:e,onFocus:g,onBlur:y,onEnterPress:p,error:n,helperText:o,disabled:u=!1,placeholder:b,variant:i="outlined",size:f,color:d="primary",fullWidth:m=!0,required:c,multiline:a=!1,rows:v,minRows:P,maxRows:E,resize:S="both",maxLength:M,minLength:H,type:B="text",autoComplete:A="off",startAdornment:w,endAdornment:k,inputStyles:O,formControlStyles:K,slotProps:V,slots:N}=G,W=x(G,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","multiline","rows","minRows","maxRows","resize","maxLength","minLength","type","autoComplete","startAdornment","endAdornment","inputStyles","formControlStyles","slotProps","slots"]);let Z=sl(J=>{J.key==="Enter"&&!a&&p&&p(s),W.onKeyDown&&W.onKeyDown(J)},[a,p,s,W.onKeyDown]),T=ge(()=>l({maxLength:M,minLength:H},W.inputProps||{}),[M,H,W]),h=ge(()=>w?Me(jt,{position:"start",children:w}):void 0,[w]),R=ge(()=>k?Me(jt,{position:"end",children:k}):void 0,[k]),L=ge(()=>F(l({},V),{input:l(l(F(l({},V==null?void 0:V.input),{inputProps:T}),h&&{startAdornment:h}),R&&{endAdornment:R})}),[V,T,h,R]),q=ge(()=>a?F(l({},O),{"& textarea":{resize:S}}):O,[a,O,S]),$=ge(()=>o!=null?o:n!=null&&n.message?n.message:void 0,[o,n==null?void 0:n.message]);return Me(ll,{error:!!n,disabled:u,required:c,fullWidth:m,sx:K,children:Me(rl,F(l({},W),{name:t,label:r,value:s,onChange:e,onFocus:g,onBlur:y,onKeyDown:Z,placeholder:b,variant:i,size:f,color:d,fullWidth:m,required:c,error:!!n,disabled:u,multiline:a,rows:v,minRows:P,maxRows:E,type:a?void 0:B,autoComplete:A,slotProps:L,slots:N,sx:q,ref:Y,helperText:$}))})}));eo.displayName="TextInputField";var be=eo;import{Controller as ul}from"react-hook-form";import{memo as ml,useMemo as to}from"react";import{jsx as oo}from"react/jsx-runtime";var no=ml(n=>{var o=n,{name:t,label:r,control:s,errors:e,defaultValue:g="",onChange:y}=o,p=x(o,["name","label","control","errors","defaultValue","onChange"]);let u=to(()=>{var i;return e!=null&&e[t]?{message:String(((i=e[t])==null?void 0:i.message)||"")}:null},[e,t]),b=to(()=>{var i,f;return(i=e==null?void 0:e[t])!=null&&i.message?String((f=e[t])==null?void 0:f.message):void 0},[e,t]);return oo(ul,{name:t,control:s,defaultValue:g,render:({field:i})=>{var c;let m=p,{size:f}=m,d=x(m,["size"]);return oo(be,F(l({},d),{name:t,label:r,value:(c=i.value)!=null?c:"",onChange:a=>{i.onChange(a),y==null||y(a.target.value)},onBlur:i.onBlur,size:f,error:u,helperText:b}))}})});no.displayName="FormInputTextField";var pt=no;import{Controller as pl}from"react-hook-form";import{memo as dl,useMemo as lo}from"react";import{jsx as ro}from"react/jsx-runtime";var io=dl(i=>{var f=i,{name:t,label:r,control:s,errors:e,rows:g,minRows:y,maxRows:p,resize:n,defaultValue:o="",onChange:u}=f,b=x(f,["name","label","control","errors","rows","minRows","maxRows","resize","defaultValue","onChange"]);let d=lo(()=>{var c;return e!=null&&e[t]?{message:String(((c=e[t])==null?void 0:c.message)||"")}:null},[e,t]),m=lo(()=>{var c,a;return(c=e==null?void 0:e[t])!=null&&c.message?String((a=e[t])==null?void 0:a.message):void 0},[e,t]);return ro(pl,{name:t,control:s,defaultValue:o,render:({field:c})=>{var E;let P=b,{size:a}=P,v=x(P,["size"]);return ro(be,F(l({},v),{name:t,label:r,value:(E=c.value)!=null?E:"",onChange:S=>{c.onChange(S),u==null||u(S.target.value)},onBlur:c.onBlur,multiline:!0,rows:g,minRows:y,maxRows:p,resize:n,size:a,error:d,helperText:m}))}})});io.displayName="FormInputTextArea";var dt=io;import{Visibility as cl,VisibilityOff as fl}from"@mui/icons-material";import{FormControl as Fl,FormHelperText as ao,IconButton as gl,InputAdornment as bl,TextField as yl}from"@mui/material";import{forwardRef as xl,useState as vl,memo as Il,useCallback as so,useMemo as ke}from"react";import{jsx as me,jsxs as uo}from"react/jsx-runtime";var Cl=t=>{if(!t)return"weak";let r=0;return t.length>=8&&r++,t.length>=12&&r++,/[a-z]/.test(t)&&r++,/[A-Z]/.test(t)&&r++,/[0-9]/.test(t)&&r++,/[^a-zA-Z0-9]/.test(t)&&r++,r<=2?"weak":r<=4?"medium":r<=5?"strong":"very-strong"},Pl=t=>{switch(t){case"weak":return"#f44336";case"medium":return"#ff9800";case"strong":return"#4caf50";case"very-strong":return"#2196f3";default:return"#9e9e9e"}},mo=Il(xl((N,V)=>{var W=N,{name:t,label:r,value:s,onChange:e,onFocus:g,onBlur:y,onVisibilityToggle:p,error:n,helperText:o,disabled:u=!1,placeholder:b,variant:i="outlined",size:f,color:d,fullWidth:m=!0,required:c,showPasswordStrength:a=!1,minLength:v,maxLength:P,defaultShowPassword:E=!1,visibilityIcon:S=me(cl,{}),visibilityOffIcon:M=me(fl,{}),iconButtonProps:H,getPasswordStrength:B=Cl,inputStyles:A,formControlStyles:w,slotProps:k,slots:O}=W,K=x(W,["name","label","value","onChange","onFocus","onBlur","onVisibilityToggle","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","showPasswordStrength","minLength","maxLength","defaultShowPassword","visibilityIcon","visibilityOffIcon","iconButtonProps","getPasswordStrength","inputStyles","formControlStyles","slotProps","slots"]);let[Y,_]=vl(E),G=so(()=>{_($=>{let J=!$;return p&&p(J),J})},[p]),Z=ke(()=>a?B(s):null,[a,s]),T=()=>{if(!Z||!s)return null;let $=Pl(Z),J=Z.charAt(0).toUpperCase()+Z.slice(1).replace("-"," ");return me("div",{style:{marginTop:"4px",fontSize:"0.75rem"},children:uo("span",{style:{color:$,fontWeight:500},children:["Strength: ",J]})})},h=so($=>{let J=$.target.value;P&&J.length>P||e&&e($)},[P,e]),R=ke(()=>me(bl,{position:"end",children:me(gl,F(l({onClick:G,onMouseDown:$=>$.preventDefault(),edge:"end",disabled:u},H),{children:Y?M:S}))}),[G,u,H,Y,M,S]),L=ke(()=>{var $;return F(l({},k),{input:F(l(l({},k==null?void 0:k.input),v||P?{inputProps:l(l({minLength:v,maxLength:P},(($=k==null?void 0:k.input)==null?void 0:$.inputProps)||{}),K.inputProps||{})}:{}),{endAdornment:R})})},[k,v,P,K,R]),q=ke(()=>o!=null?o:n!=null&&n.message?n.message:void 0,[o,n==null?void 0:n.message]);return uo(Fl,{fullWidth:m,error:!!n,disabled:u,required:c,sx:w,children:[me(yl,F(l({},K),{name:t,label:r,type:Y?"text":"password",value:s,onChange:h,onFocus:g,onBlur:y,placeholder:b,variant:i,size:f,color:d,fullWidth:m,required:c,error:!!n,disabled:u,slotProps:L,slots:O,sx:A,ref:V,helperText:q})),a&&T(),n&&!o&&n.message&&me(ao,{children:n.message}),!n&&o&&me(ao,{children:o})]})}));mo.displayName="PasswordField";var He=mo;import{Controller as hl}from"react-hook-form";import{memo as Tl,useMemo as po}from"react";import{jsx as co}from"react/jsx-runtime";var fo=Tl(o=>{var u=o,{name:t,label:r,control:s,errors:e,size:g,defaultValue:y="",onChange:p}=u,n=x(u,["name","label","control","errors","size","defaultValue","onChange"]);let b=po(()=>{var f;return e!=null&&e[t]?{message:String(((f=e[t])==null?void 0:f.message)||"")}:null},[e,t]),i=po(()=>{var f,d;return(f=e==null?void 0:e[t])!=null&&f.message?String((d=e[t])==null?void 0:d.message):void 0},[e,t]);return co(hl,{name:t,control:s,defaultValue:y,render:({field:f})=>{var a;let c=n,{size:d}=c,m=x(c,["size"]);return co(He,F(l({},m),{name:t,label:r,value:(a=f.value)!=null?a:"",onChange:v=>{f.onChange(v),p==null||p(v.target.value)},onBlur:f.onBlur,error:b,helperText:i,size:g!=null?g:d}))}})});fo.displayName="FormInputPasswordField";var ct=fo;import{FormControl as Rl,InputAdornment as Fo,TextField as El}from"@mui/material";import{forwardRef as Sl,useState as Dl,useEffect as Ll,useCallback as wl,memo as Ml,useMemo as ce}from"react";import{jsx as Be}from"react/jsx-runtime";var ae=t=>t.replace(/\D/g,""),go=(t,r)=>{if(!r||!t)return t;let s="",e=0;for(let g=0;g<r.length&&e<t.length;g++)r[g]==="X"?(s+=t[e],e++):s+=r[g];return s},kl=t=>t?t.replace(/X/g,"0"):"",Hl=t=>{let r=ae(t);return r.length<=3?r:r.length<=6?`(${r.slice(0,3)}) ${r.slice(3)}`:`(${r.slice(0,3)}) ${r.slice(3,6)}-${r.slice(6,10)}`},Bl=t=>{var e;let r=t.replace(/\D/g,"");return(((e=r.match(/.{1,4}/g))==null?void 0:e.join(" "))||r).slice(0,19)},bo=(t,r=!0)=>{let s=t.replace(/[^\d.]/g,"");if(!r)return s.replace(/\D/g,"");let e=s.split(".");return e.length>2?e[0]+"."+e.slice(1).join(""):e.length===2&&e[1].length>2?e[0]+"."+e[1].slice(0,2):s},Al=t=>{let r=t.replace(/\D/g,"");return r.length<=3?r:r.length<=5?`${r.slice(0,3)}-${r.slice(3)}`:`${r.slice(0,3)}-${r.slice(3,5)}-${r.slice(5,9)}`},zl=t=>{let r=t.replace(/\D/g,"");return r.length<=5?r:`${r.slice(0,5)}-${r.slice(5,9)}`},Ol=t=>t.replace(/\D/g,"").slice(0,3),yo=Ml(Sl((Y,W)=>{var _=Y,{name:t,label:r,value:s,onChange:e,onFocus:g,onBlur:y,onEnterPress:p,error:n,helperText:o,disabled:u=!1,placeholder:b,variant:i="outlined",size:f,color:d="primary",fullWidth:m=!0,required:c,pattern:a="integer",customPattern:v,customFormatter:P,min:E,max:S,step:M,allowDecimals:H=!0,decimalPlaces:B=2,startAdornment:A,endAdornment:w,inputStyles:k,formControlStyles:O,slotProps:K,slots:V}=_,N=x(_,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","pattern","customPattern","customFormatter","min","max","step","allowDecimals","decimalPlaces","startAdornment","endAdornment","inputStyles","formControlStyles","slotProps","slots"]);let[G,Z]=Dl(s),T=typeof a=="string"&&a.includes("X"),h=T?a:void 0,R=T?void 0:a,L=wl(X=>{if(!X)return"";if(h){let ee=ae(X);return go(ee,h)}switch(R){case"phone":return Hl(X);case"credit-card":return Bl(X);case"currency":return bo(X,H);case"ssn":return Al(X);case"zip-code":return zl(X);case"percentage":return Ol(X);case"decimal":return bo(X,H);case"integer":return ae(X);case"custom":return P?P(X):ae(X);default:return ae(X)}},[h,R,H,P,v]);Ll(()=>{let X=L(s);Z(ee=>ee!==X?X:ee)},[s,L]);let q=(X,ee)=>{if(["Backspace","Delete","Tab","Escape","Enter"].includes(ee)||ee==="a"||ee==="c"||ee==="v"||ee==="x"||(R==="decimal"||R==="currency")&&H&&ee===".")return!0;if(!/^\d$/.test(ee))return!1;if(h){let te=(h.match(/X/g)||[]).length;return ae(X).length<te}if(R==="custom"&&v){let te=X+ee;return v.test(te)}return!0},$=X=>{let ee=X.target.value,te=L(ee);Z(te);let le=h?ae(ee):te,ie=F(l({},X),{target:F(l({},X.target),{value:le}),currentTarget:F(l({},X.currentTarget),{value:le})});e&&e(ie)},J=X=>{if(u)return;X.preventDefault();let ee=X.clipboardData.getData("text"),te=ae(ee),le=h?(h.match(/X/g)||[]).length:void 0,ie=le?te.slice(0,le):te,mt=h?go(ie,h):L(ie);Z(mt);let j=F(l({},X),{target:F(l({},X.target),{value:ie}),currentTarget:F(l({},X.currentTarget),{value:ie})});e&&e(j)},I=X=>{let ee=X.currentTarget.querySelector("input");if(!ee)return;let te=ee.value||"",le=X.key;if(["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(le)){le==="Enter"&&p&&p(G),N.onKeyDown&&N.onKeyDown(X);return}if(X.ctrlKey||X.metaKey){N.onKeyDown&&N.onKeyDown(X);return}if(!q(te,le)){X.preventDefault();return}N.onKeyDown&&N.onKeyDown(X)},C=ce(()=>l({min:E,max:S,step:M,inputMode:R==="phone"?"tel":R==="decimal"||R==="currency"?"decimal":"numeric",maxLength:h?h.length:void 0},N.inputProps||{}),[E,S,M,R,h,N]),D=ce(()=>A?Be(Fo,{position:"start",children:A}):void 0,[A]),z=ce(()=>w?Be(Fo,{position:"end",children:w}):void 0,[w]),U=ce(()=>F(l({},K),{input:l(l(F(l({},K==null?void 0:K.input),{inputProps:C}),D&&{startAdornment:D}),z&&{endAdornment:z})}),[K,C,D,z]),Q=ce(()=>R==="phone"?"tel":"text",[R]),oe=ce(()=>b||(h?kl(h):b),[b,h]),se=ce(()=>o!=null?o:n!=null&&n.message?n.message:void 0,[o,n==null?void 0:n.message]);return Be(Rl,{error:!!n,disabled:u,required:c,fullWidth:m,sx:O,children:Be(El,F(l({},N),{name:t,label:r,value:G,onChange:$,onFocus:g,onBlur:y,onKeyDown:I,onPaste:J,placeholder:oe,variant:i,size:f,color:d,fullWidth:m,required:c,error:!!n,disabled:u,type:Q,autoComplete:"off",slotProps:U,slots:V,sx:k,ref:W,helperText:se}))})}));yo.displayName="NumberField";var Ae=yo;import{Controller as Nl}from"react-hook-form";import{memo as Vl,useMemo as xo}from"react";import{jsx as vo}from"react/jsx-runtime";var Io=Vl(d=>{var m=d,{name:t,label:r,control:s,errors:e,pattern:g,min:y,max:p,step:n,allowDecimals:o,decimalPlaces:u,defaultValue:b="",onChange:i}=m,f=x(m,["name","label","control","errors","pattern","min","max","step","allowDecimals","decimalPlaces","defaultValue","onChange"]);let c=xo(()=>{var v;return e!=null&&e[t]?{message:String(((v=e[t])==null?void 0:v.message)||"")}:null},[e,t]),a=xo(()=>{var v,P;return(v=e==null?void 0:e[t])!=null&&v.message?String((P=e[t])==null?void 0:P.message):void 0},[e,t]);return vo(Nl,{name:t,control:s,defaultValue:b,render:({field:v})=>{var M;let S=f,{size:P}=S,E=x(S,["size"]);return vo(Ae,F(l({},E),{name:t,label:r,value:(M=v.value)!=null?M:"",onChange:H=>{v.onChange(H),i==null||i(H.target.value)},onBlur:v.onBlur,pattern:g,min:y,max:p,step:n,allowDecimals:o,decimalPlaces:u,size:P,error:c,helperText:a}))}})});Io.displayName="FormInputNumberField";var ft=Io;import{FormControl as Wl,InputAdornment as Ft,TextField as Kl}from"@mui/material";import{forwardRef as ql,useState as Gl,useEffect as $l,useRef as Ul,memo as Xl,useCallback as gt,useMemo as ye}from"react";import{jsx as Se}from"react/jsx-runtime";var ze=t=>t.replace(/\D/g,""),bt=(t,r)=>{if(!r||!t)return t;let s="",e=0;for(let g=0;g<r.length&&e<t.length;g++)r[g]==="X"?(s+=t[e],e++):s+=r[g];return s},Yl=t=>t?t.replace(/X/g,"0"):"0000000000",Co=Xl(ql((V,K)=>{var N=V,{name:t,label:r,value:s,onChange:e,onFocus:g,onBlur:y,onEnterPress:p,error:n,helperText:o,disabled:u=!1,placeholder:b,variant:i="outlined",size:f,color:d="primary",fullWidth:m=!0,required:c,pattern:a="XXXXXXXXXX",maxLength:v,countryCode:P="+1",showCountryCode:E=!1,startAdornment:S,endAdornment:M,inputStyles:H,formControlStyles:B,countryCodeStyles:A,slotProps:w,slots:k}=N,O=x(N,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","pattern","maxLength","countryCode","showCountryCode","startAdornment","endAdornment","inputStyles","formControlStyles","countryCodeStyles","slotProps","slots"]);let[W,Y]=Gl(""),_=Ul(null),G=v||(a?a.length:15);$l(()=>{let C=ze(s),D=a?bt(C,a):C;Y(z=>z!==D?D:z),_.current&&setTimeout(()=>{if(_.current){let z=D.length;_.current.setSelectionRange(z,z)}},0)},[s,a]);let Z=gt(C=>{if(u)return;let D=C.target.value,z=ze(D),U=G?z.slice(0,G):z,Q=a?bt(U,a):U;Y(Q);let oe=F(l({},C),{target:F(l({},C.target),{value:U}),currentTarget:F(l({},C.currentTarget),{value:U})});e&&e(oe)},[u,G,a,e]),T=gt(C=>{if(u)return;C.preventDefault();let D=C.clipboardData.getData("text"),z=ze(D),U=G?z.slice(0,G):z,Q=a?bt(U,a):U;Y(Q);let oe=F(l({},C),{target:F(l({},C.target),{value:U}),currentTarget:F(l({},C.currentTarget),{value:U})});e&&e(oe)},[u,G,a,e]),h=gt(C=>{if(u)return;let D=C.key,z=/[0-9]/.test(D),U=D==="Backspace"||D==="Delete"||D==="Tab"||D==="Escape"||D==="Enter"||D==="ArrowLeft"||D==="ArrowRight"||D==="ArrowUp"||D==="ArrowDown"||D==="Home"||D==="End"||(C.ctrlKey||C.metaKey)&&(D==="a"||D==="c"||D==="v"||D==="x");if(!z&&!U){C.preventDefault();return}D==="Enter"&&p&&p(ze(W)),O.onKeyDown&&O.onKeyDown(C)},[u,p,W,O.onKeyDown]),R=ye(()=>l({maxLength:G,inputMode:"tel",autoComplete:"tel"},O.inputProps||{}),[G,O]),L=ye(()=>E?Se(Ft,{position:"start",sx:A,children:P}):S?Se(Ft,{position:"start",children:S}):void 0,[E,A,P,S]),q=ye(()=>M?Se(Ft,{position:"end",children:M}):void 0,[M]),$=ye(()=>F(l({},w),{input:l(l(F(l({},w==null?void 0:w.input),{inputProps:R}),L&&{startAdornment:L}),q&&{endAdornment:q})}),[w,R,L,q]),J=ye(()=>b||(a?Yl(a):""),[b,a]),I=ye(()=>o!=null?o:n!=null&&n.message?n.message:void 0,[o,n==null?void 0:n.message]);return Se(Wl,{error:!!n,disabled:u,required:c,fullWidth:m,sx:B,children:Se(Kl,F(l({},O),{name:t,label:r,value:W,onChange:Z,onFocus:g,onBlur:y,onKeyDown:h,onPaste:T,placeholder:J,variant:i,size:f,color:d,fullWidth:m,required:c,error:!!n,disabled:u,type:"tel",autoComplete:"tel",slotProps:$,slots:k,sx:H,ref:K,inputRef:_,helperText:I}))})}));Co.displayName="TeliField";var Oe=Co;import{Controller as _l}from"react-hook-form";import{memo as Zl,useMemo as Po}from"react";import{jsx as ho}from"react/jsx-runtime";var To=Zl(n=>{var o=n,{name:t,label:r,control:s,errors:e,defaultValue:g="",onChange:y}=o,p=x(o,["name","label","control","errors","defaultValue","onChange"]);let u=Po(()=>{var i;return e!=null&&e[t]?{message:String(((i=e[t])==null?void 0:i.message)||"")}:null},[e,t]),b=Po(()=>{var i,f;return(i=e==null?void 0:e[t])!=null&&i.message?String((f=e[t])==null?void 0:f.message):void 0},[e,t]);return ho(_l,{name:t,control:s,defaultValue:g,render:({field:i})=>{var c;let m=p,{size:f}=m,d=x(m,["size"]);return ho(Oe,F(l({},d),{name:t,label:r,value:(c=i.value)!=null?c:"",onChange:a=>{i.onChange(a),y==null||y(a.target.value)},onBlur:i.onBlur,size:f,error:u,helperText:b}))}})});To.displayName="FormInputTelField";var yt=To;import{Close as Jl,Search as Ql}from"@mui/icons-material";import{FormControl as jl,IconButton as Ro,InputAdornment as er,TextField as tr}from"@mui/material";import{forwardRef as or,useEffect as nr,useRef as xt,memo as lr,useCallback as xe,useMemo as Eo}from"react";import{jsx as ve,jsxs as rr}from"react/jsx-runtime";var So=lr(or((G,_)=>{var Z=G,{name:t,label:r,value:s,onChange:e,onFocus:g,onBlur:y,onSearch:p,onClear:n,onEnterPress:o,error:u,helperText:b,disabled:i=!1,placeholder:f,variant:d="outlined",size:m,color:c="primary",fullWidth:a=!0,required:v,showClearButton:P=!0,showSearchButton:E=!0,clearIcon:S,searchIcon:M,clearButtonProps:H,searchButtonProps:B,enableDebounce:A=!0,debounceDelay:w=300,enableThrottle:k=!1,throttleDelay:O=300,inputStyles:K,formControlStyles:V,slotProps:N,slots:W}=Z,Y=x(Z,["name","label","value","onChange","onFocus","onBlur","onSearch","onClear","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","showClearButton","showSearchButton","clearIcon","searchIcon","clearButtonProps","searchButtonProps","enableDebounce","debounceDelay","enableThrottle","throttleDelay","inputStyles","formControlStyles","slotProps","slots"]);let T=xt(null),h=xt(null),R=xt(0);nr(()=>()=>{T.current&&clearTimeout(T.current),h.current&&clearTimeout(h.current)},[]);let L=xe(U=>{T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{p&&p(U)},w)},[p,w]),q=xe(U=>{let Q=Date.now(),oe=Q-R.current;oe>=O?(R.current=Q,p&&p(U)):(h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{R.current=Date.now(),p&&p(U)},O-oe))},[p,O]),$=xe(U=>{let Q=U.target.value;e&&e(U),p&&(A&&!k?L(Q):k&&!A?q(Q):A&&k?L(Q):p(Q))},[e,p,A,k,L,q]),J=xe(()=>{T.current&&(clearTimeout(T.current),T.current=null),h.current&&(clearTimeout(h.current),h.current=null),n&&n(),p&&p(""),e&&e({target:{value:"",name:t||""},currentTarget:{value:"",name:t||""}})},[n,p,e,t,T,h]),I=xe(()=>{T.current&&(clearTimeout(T.current),T.current=null),h.current&&(clearTimeout(h.current),h.current=null),p&&p(s)},[p,s,T,h]),C=xe(U=>{U.key==="Enter"&&(T.current&&(clearTimeout(T.current),T.current=null),h.current&&(clearTimeout(h.current),h.current=null),o&&o(s),p&&p(s)),Y.onKeyDown&&Y.onKeyDown(U)},[o,p,s,T,h,Y.onKeyDown]),D=Eo(()=>rr(er,{position:"end",children:[P&&s&&ve(Ro,F(l({onClick:J,disabled:i,edge:"end",size:m},H),{children:S||ve(Jl,{})})),E&&ve(Ro,F(l({onClick:I,disabled:i,edge:"end",size:m},B),{children:M||ve(Ql,{})}))]}),[P,s,J,i,m,H,S,E,I,B,M]),z=Eo(()=>b!=null?b:u!=null&&u.message?u.message:void 0,[b,u==null?void 0:u.message]);return ve(jl,{error:!!u,disabled:i,required:v,fullWidth:a,sx:V,children:ve(tr,F(l({},Y),{name:t,label:r,value:s,onChange:$,onFocus:g,onBlur:y,onKeyDown:C,placeholder:f,variant:d,size:m,color:c,fullWidth:a,required:v,error:!!u,disabled:i,slotProps:F(l({},N),{input:F(l({},N==null?void 0:N.input),{endAdornment:D})}),slots:W,sx:K,ref:_,helperText:z}))})}));So.displayName="SearchField";var Ne=So;import{Controller as ir}from"react-hook-form";import{memo as ar,useMemo as Do}from"react";import{jsx as Lo}from"react/jsx-runtime";var wo=ar(n=>{var o=n,{name:t,label:r,control:s,errors:e,defaultValue:g="",onChange:y}=o,p=x(o,["name","label","control","errors","defaultValue","onChange"]);let u=Do(()=>{var i;return e!=null&&e[t]?{message:String(((i=e[t])==null?void 0:i.message)||"")}:null},[e,t]),b=Do(()=>{var i,f;return(i=e==null?void 0:e[t])!=null&&i.message?String((f=e[t])==null?void 0:f.message):void 0},[e,t]);return Lo(ir,{name:t,control:s,defaultValue:g,render:({field:i})=>{var c;let m=p,{size:f}=m,d=x(m,["size"]);return Lo(Ne,F(l({},d),{name:t,label:r,value:(c=i.value)!=null?c:"",onChange:a=>{i.onChange(a),y==null||y(a.target.value)},onBlur:i.onBlur,size:f,error:u,helperText:b}))}})});wo.displayName="FormInputSearchField";var vt=wo;import{FormControl as sr,FormHelperText as Mo,TextField as ur,Box as ko}from"@mui/material";import{forwardRef as mr,useState as pr,useRef as Ie,useEffect as Ve}from"react";import{jsx as De,jsxs as Ho}from"react/jsx-runtime";var Bo=mr((O,k)=>{var K=O,{name:t,label:r,value:s,onChange:e,onComplete:g,onFocus:y,onBlur:p,onEnterPress:n,error:o,helperText:u,disabled:b=!1,variant:i="outlined",size:f,color:d="primary",fullWidth:m=!0,required:c,length:a=6,spacing:v=1,autoFocus:P=!1,autoSubmit:E=!1,containerStyles:S,inputStyles:M,formControlStyles:H,slotProps:B,slots:A}=K,w=x(K,["name","label","value","onChange","onComplete","onFocus","onBlur","onEnterPress","error","helperText","disabled","variant","size","color","fullWidth","required","length","spacing","autoFocus","autoSubmit","containerStyles","inputStyles","formControlStyles","slotProps","slots"]);let[V,N]=pr(Array(a).fill("")),W=Ie([]),Y=Ie(""),_=Ie(!1),G=Ie(Array(a).fill("")),Z=Ie(!1),T=Ie(null);Ve(()=>{G.current=V},[V]),Ve(()=>{let I=G.current.join("");if(Z.current){if(s===Y.current)return;let C=I,D=s||"";if(C===D&&C.length>0||D.length===C.length&&D===Y.current)return}if(!(_.current&&(_.current=!1,s===Y.current))&&s!==I)if(s){let C=s.split("").slice(0,a),D=[...C,...Array(a-C.length).fill("")];N(D)}else N(Array(a).fill(""))},[s,a]),Ve(()=>{P&&W.current[0]&&W.current[0].focus()},[P]),Ve(()=>()=>{T.current&&clearTimeout(T.current)},[]);let h=(I,C)=>{if(b)return;let D=C.target.value;if(D===""){R(I,"",!1);return}let z=D.slice(-1);/^\d$/.test(z)&&R(I,z,!0)},R=(I,C,D=!0)=>{let z=[...V];z[I]=C,_.current=!0,Z.current=!0,T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{Z.current=!1},500),N(z);let U=z.join("");Y.current=U,e&&e(U),C&&I<a-1&&D&&setTimeout(()=>{var Q;(Q=W.current[I+1])==null||Q.focus()},0),z.every(Q=>Q!=="")&&(g&&g(U),E&&n&&n(U))},L=(I,C)=>{var z,U,Q;if(b)return;let D=C.key;if(D==="Backspace"){V[I]===""&&I>0?((z=W.current[I-1])==null||z.focus(),R(I-1,"",!1)):R(I,"",!1),C.preventDefault();return}if(D==="Delete"){R(I,"",!1),C.preventDefault();return}if(D==="ArrowLeft"&&I>0){(U=W.current[I-1])==null||U.focus(),C.preventDefault();return}if(D==="ArrowRight"&&I<a-1){(Q=W.current[I+1])==null||Q.focus(),C.preventDefault();return}if(D==="Enter"&&n){let oe=V.join("");n(oe);return}(C.ctrlKey||C.metaKey)&&D==="v"||/^\d$/.test(D)||["Tab","Escape","Home","End"].includes(D)||C.preventDefault()},q=(I,C)=>{var ee;if(b)return;C.preventDefault();let z=C.clipboardData.getData("text").replace(/\D/g,"").slice(0,a);if(z.length===0)return;let U=[...V],Q=I;for(let te=0;te<z.length&&Q+te<a;te++)U[Q+te]=z[te];N(U);let oe=U.join("");e&&e(oe);let se=U.findIndex(te=>te===""),X=se!==-1?se:Math.min(Q+z.length,a-1);(ee=W.current[X])==null||ee.focus(),U.every(te=>te!=="")&&(g&&g(oe),E&&n&&n(oe))},$=(I,C)=>{C.target.select(),y&&y(C)},J=(I,C)=>{p&&p(C)};return Ho(sr,{error:!!o,disabled:b,required:c,fullWidth:m,sx:H,children:[r&&Ho(ko,{component:"label",sx:{mb:1,display:"block"},children:[r,c&&De("span",{style:{color:"error.main"},children:" *"})]}),De(ko,{ref:k,sx:l({display:"flex",gap:v,justifyContent:"flex-start"},S),children:V.map((I,C)=>{var D;return De(ur,l({inputRef:z=>{W.current[C]=z},name:t?`${t}-${C}`:void 0,value:I,onChange:z=>h(C,z),onKeyDown:z=>L(C,z),onPaste:z=>q(C,z),onFocus:z=>$(C,z),onBlur:z=>J(C,z),variant:i,size:f,color:d,error:!!o,disabled:b,required:c,slotProps:F(l({},B),{input:F(l({},B==null?void 0:B.input),{inputProps:l({maxLength:1,inputMode:"numeric",pattern:"[0-9]*",style:{textAlign:"center",fontSize:f==="small"?"1rem":"1.25rem",fontWeight:"bold"}},((D=B==null?void 0:B.input)==null?void 0:D.inputProps)||{})})}),slots:A,sx:l({width:f==="small"?"40px":"48px"},M)},w),C)})}),o&&De(Mo,{children:u!=null?u:o!=null&&o.message?o.message:""}),!o&&u&&De(Mo,{children:u})]})});Bo.displayName="OTPField";var We=Bo;import{Controller as dr}from"react-hook-form";import{memo as cr,useMemo as Ao}from"react";import{jsx as zo}from"react/jsx-runtime";var Oo=cr(n=>{var o=n,{name:t,label:r,control:s,errors:e,defaultValue:g="",onChange:y}=o,p=x(o,["name","label","control","errors","defaultValue","onChange"]);let u=Ao(()=>{var i;return e!=null&&e[t]?{message:String(((i=e[t])==null?void 0:i.message)||"")}:null},[e,t]),b=Ao(()=>{var i,f;return(i=e==null?void 0:e[t])!=null&&i.message?String((f=e[t])==null?void 0:f.message):void 0},[e,t]);return zo(dr,{name:t,control:s,defaultValue:g,render:({field:i})=>{var c;let m=p,{size:f}=m,d=x(m,["size"]);return zo(We,F(l({},d),{name:t,label:r,value:(c=i.value)!=null?c:"",onChange:a=>{i.onChange(a),y==null||y(a)},onBlur:i.onBlur,size:f,error:u,helperText:b}))}})});Oo.displayName="FormInputOTPField";var It=Oo;import{FormControl as fr,FormHelperText as No,InputLabel as Fr,MenuItem as gr,Select as br}from"@mui/material";import{forwardRef as yr}from"react";import{jsx as Le,jsxs as xr}from"react/jsx-runtime";var Vo=yr((W,N)=>{var Y=W,{name:t,label:r,value:s,onChange:e,onOpen:g,onClose:y,options:p,error:n,helperText:o,disabled:u=!1,variant:b="outlined",size:i,color:f,fullWidth:d=!0,required:m,multiple:c=!1,icon:a,renderValue:v,renderMenuItem:P,menuItemStyles:E,selectStyles:S,formControlStyles:M,labelStyles:H,slotProps:B,slots:A,displayEmpty:w=!1,autoWidth:k=!1,native:O=!1,MenuProps:K}=Y,V=x(Y,["name","label","value","onChange","onOpen","onClose","options","error","helperText","disabled","variant","size","color","fullWidth","required","multiple","icon","renderValue","renderMenuItem","menuItemStyles","selectStyles","formControlStyles","labelStyles","slotProps","slots","displayEmpty","autoWidth","native","MenuProps"]);let _=R=>{var L;if(c&&Array.isArray(R))return R.length===0?"":R.map(q=>{var J;let $=p.find(I=>I.value===q);return(J=$==null?void 0:$.name)!=null?J:String(q)}).join(", ");if(!c&&R!==""&&R!==null&&R!==void 0){let q=p.find($=>$.value===R);return(L=q==null?void 0:q.name)!=null?L:String(R)}return""},G=(R,L)=>{let q=typeof E=="function"?E(R,L):E;return Le(gr,{value:R.value,disabled:R.disabled,sx:q,children:P?P(R,L):R.name},`${R.value}-${L}`)},Z=(R,L)=>{e&&e(R,L)},T=r?`${t||"select"}-label`:void 0,h=r?`${t||"select"}-select`:void 0;return xr(fr,{fullWidth:d,error:!!n,disabled:u,required:m,size:i,variant:b,sx:M,children:[r&&Le(Fr,{id:T,sx:H,children:r}),Le(br,F(l({},V),{labelId:T,id:h,name:t,value:s,label:r,onChange:Z,onOpen:g,onClose:y,disabled:u,multiple:c,displayEmpty:w,autoWidth:k,native:O,MenuProps:K,IconComponent:a,renderValue:v!=null?v:_,slotProps:B,slots:A,sx:S,ref:N,children:p&&Array.isArray(p)&&p.map((R,L)=>G(R,L))})),n&&Le(No,{children:o!=null?o:n!=null&&n.message?n.message:""}),!n&&o&&Le(No,{children:o})]})});Vo.displayName="SelectInputField";var Ce=Vo;import{Controller as vr}from"react-hook-form";import{memo as Ir,useMemo as Ct}from"react";import{jsx as Wo}from"react/jsx-runtime";var Ko=Ir(o=>{var u=o,{name:t,label:r,control:s,errors:e,options:g=[],defaultValue:y="",onChange:p}=u,n=x(u,["name","label","control","errors","options","defaultValue","onChange"]);let b=Ct(()=>{var d;return e!=null&&e[t]?{message:String(((d=e[t])==null?void 0:d.message)||"")}:null},[e,t]),i=Ct(()=>{var d,m;return(d=e==null?void 0:e[t])!=null&&d.message?String((m=e[t])==null?void 0:m.message):void 0},[e,t]),f=Ct(()=>g,[g]);return Wo(vr,{name:t,control:s,defaultValue:y,render:({field:d})=>{var v;let a=n,{size:m}=a,c=x(a,["size"]);return Wo(Ce,F(l({},c),{name:t,label:r,options:f,value:(v=d.value)!=null?v:"",onChange:P=>{d.onChange(P),p==null||p(P.target.value)},onBlur:d.onBlur,size:m,error:b,helperText:i}))}})});Ko.displayName="FormInputSelect";var Pt=Ko;import{Controller as Cr}from"react-hook-form";import{memo as Pr,useMemo as ht}from"react";import{jsx as qo}from"react/jsx-runtime";var Go=Pr(o=>{var u=o,{name:t,label:r,control:s,errors:e,options:g=[],defaultValue:y=[],onChange:p}=u,n=x(u,["name","label","control","errors","options","defaultValue","onChange"]);let b=ht(()=>{var d;return e!=null&&e[t]?{message:String(((d=e[t])==null?void 0:d.message)||"")}:null},[e,t]),i=ht(()=>{var d,m;return(d=e==null?void 0:e[t])!=null&&d.message?String((m=e[t])==null?void 0:m.message):void 0},[e,t]),f=ht(()=>g,[g]);return qo(Cr,{name:t,control:s,defaultValue:y,render:({field:d})=>{let v=n,{size:m}=v,c=x(v,["size"]),a=Array.isArray(d.value)?d.value:[];return qo(Ce,F(l({},c),{name:t,label:r,options:f,multiple:!0,value:a,onChange:P=>{d.onChange(P),p==null||p(P.target.value)},onBlur:d.onBlur,size:m,error:b,helperText:i}))}})});Go.displayName="FormInputMultiSelect";var Tt=Go;import{Autocomplete as hr,FormControl as Tr,FormHelperText as Rr,TextField as Er}from"@mui/material";import{forwardRef as Sr,memo as Dr,useCallback as Ke,useMemo as Lr}from"react";import{jsx as Rt,jsxs as Mr}from"react/jsx-runtime";import{createElement as wr}from"react";var $o=Dr(Sr((T,Z)=>{var h=T,{name:t,label:r,value:s,onChange:e,onInputChange:g,onOpen:y,onClose:p,options:n,error:o,helperText:u,disabled:b=!1,placeholder:i,variant:f="outlined",size:d,color:m,fullWidth:c=!0,required:a,getOptionLabel:v,isOptionEqualToValue:P,renderOption:E,popupIcon:S,inputStyles:M,autocompleteStyles:H,formControlStyles:B,loading:A=!1,loadingText:w="Loading...",noOptionsText:k="No options",filterOptions:O,autoHighlight:K=!0,autoSelect:V=!1,disablePortal:N=!1,disableListWrap:W=!1,slotProps:Y,slots:_}=h,G=x(h,["name","label","value","onChange","onInputChange","onOpen","onClose","options","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","getOptionLabel","isOptionEqualToValue","renderOption","popupIcon","inputStyles","autocompleteStyles","formControlStyles","loading","loadingText","noOptionsText","filterOptions","autoHighlight","autoSelect","disablePortal","disableListWrap","slotProps","slots"]);let R=Ke(I=>{var C,D;return typeof I=="string"?I:(D=I==null?void 0:I.name)!=null?D:String((C=I==null?void 0:I.value)!=null?C:"")},[]),L=Ke((I,C)=>(I==null?void 0:I.name)===(C==null?void 0:C.name)&&(I==null?void 0:I.value)===(C==null?void 0:C.value),[]),q=Ke((I,C)=>wr("li",F(l({},I),{key:`${C.name}-${C.value}`}),C.name),[]),$=Ke((I,C,D)=>{e&&e(I,C,D)},[e]),J=Lr(()=>u!=null?u:o!=null&&o.message?o.message:void 0,[u,o==null?void 0:o.message]);return Mr(Tr,{fullWidth:c,error:!!o,sx:B,children:[Rt(hr,F(l({},G),{options:n,value:s,onChange:$,onInputChange:g,onOpen:y,onClose:p,getOptionLabel:v!=null?v:R,isOptionEqualToValue:P!=null?P:L,renderOption:E!=null?E:q,disabled:b,loading:A,loadingText:w,noOptionsText:k,filterOptions:O,autoHighlight:K,autoSelect:V,disablePortal:N,disableListWrap:W,popupIcon:S,slotProps:Y,slots:_,sx:H,ref:Z,renderInput:I=>Rt(Er,F(l({},I),{name:t,label:r,variant:f,size:d,color:m,placeholder:i,required:a,error:!!o,disabled:b,slotProps:{input:F(l({},I.InputProps),{inputProps:l({},I.inputProps)})},sx:M,helperText:J}))})),o&&!u&&o.message&&Rt(Rr,{children:o.message})]})}));$o.displayName="AutoCompleteField";var Pe=$o;import{Controller as kr}from"react-hook-form";import{memo as Hr,useMemo as Et}from"react";import{jsx as Uo}from"react/jsx-runtime";var Xo=Hr(b=>{var i=b,{name:t,label:r,control:s,errors:e,options:g=[],disabled:y,placeholder:p,defaultValue:n=null,onChange:o}=i,u=x(i,["name","label","control","errors","options","disabled","placeholder","defaultValue","onChange"]);let f=Et(()=>{var c;return e!=null&&e[t]?{message:String(((c=e[t])==null?void 0:c.message)||"")}:null},[e,t]),d=Et(()=>{var c,a;return(c=e==null?void 0:e[t])!=null&&c.message?String((a=e[t])==null?void 0:a.message):void 0},[e,t]),m=Et(()=>g,[g]);return Uo(kr,{name:t,control:s,defaultValue:n,render:({field:c})=>{let{value:a,onBlur:v}=c,S=u,{size:P}=S,E=x(S,["size"]);return Uo(Pe,F(l({},E),{name:t,label:r,placeholder:p,disabled:y,options:m,value:a!=null?a:null,onChange:(M,H)=>{c.onChange(H),o==null||o(H)},onBlur:v,size:P,error:f,helperText:d}))}})});Xo.displayName="FormInputAutoComplete";var St=Xo;import{Controller as Br}from"react-hook-form";import{memo as Ar,useMemo as Dt}from"react";import{jsx as Yo}from"react/jsx-runtime";var _o=Ar(b=>{var i=b,{name:t,label:r,control:s,errors:e,options:g=[],disabled:y,placeholder:p,defaultValue:n=[],onChange:o}=i,u=x(i,["name","label","control","errors","options","disabled","placeholder","defaultValue","onChange"]);let f=Dt(()=>{var c;return e!=null&&e[t]?{message:String(((c=e[t])==null?void 0:c.message)||"")}:null},[e,t]),d=Dt(()=>{var c,a;return(c=e==null?void 0:e[t])!=null&&c.message?String((a=e[t])==null?void 0:a.message):void 0},[e,t]),m=Dt(()=>g,[g]);return Yo(Br,{name:t,control:s,defaultValue:n,render:({field:c})=>{let{value:a,onBlur:v}=c,M=u,{size:P}=M,E=x(M,["size"]),S=Array.isArray(a)?a:[];return Yo(Pe,F(l({},E),{name:t,label:r,placeholder:p,disabled:y,options:m,multiple:!0,value:S,onChange:(H,B)=>{c.onChange(B),o==null||o(B)},onBlur:v,size:P,error:f,helperText:d}))}})});_o.displayName="FormInputMultiAutoComplete";var Lt=_o;import{FormControl as zr,TextField as Or,Box as Nr,InputAdornment as Vr}from"@mui/material";import{forwardRef as Wr,useState as Kr,useRef as Zo,useEffect as qr,useCallback as qe,useMemo as wt,memo as Gr}from"react";import{jsx as Ge,jsxs as Xr}from"react/jsx-runtime";var $r=t=>/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(t),Ur=t=>{let r=t.replace("#","");return r.length===3&&(r=r.split("").map(s=>s+s).join("")),"#"+r},Jo=Gr(Wr((V,K)=>{var N=V,{name:t,label:r,value:s,onChange:e,onFocus:g,onBlur:y,onEnterPress:p,error:n,helperText:o,disabled:u=!1,placeholder:b="#000000",variant:i="outlined",size:f,color:d="primary",fullWidth:m=!0,required:c,format:a="hex",showPreview:v=!0,showNativeInput:P=!0,showPopoverPicker:E=!0,presetColors:S=["#000000","#FFFFFF","#FF0000","#00FF00","#0000FF","#FFFF00","#FF00FF","#00FFFF"],showPresetColors:M=!1,previewStyles:H,formControlStyles:B,inputStyles:A,slotProps:w,slots:k}=N,O=x(N,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","format","showPreview","showNativeInput","showPopoverPicker","presetColors","showPresetColors","previewStyles","formControlStyles","inputStyles","slotProps","slots"]);let[W,Y]=Kr(s||"#000000"),_=Zo(null),G=Zo(null);qr(()=>{s!==void 0&&Y(s||"#000000")},[s]);let Z=$r(W)?Ur(W):W||"#000000",T=qe(I=>{if(u)return;let C=I.target.value;Y(C),e&&e(C)},[e]),h=qe(I=>{if(u)return;I.stopPropagation();let C=I.target.value;Y(C),e&&e(C)},[e]),R=qe(I=>{u||(I.preventDefault(),I.stopPropagation(),_.current&&_.current.click())},[u,_]),L=qe(I=>{I.key==="Enter"&&p&&p(Z),O.onKeyDown&&O.onKeyDown(I)},[p,Z,O.onKeyDown]),q=wt(()=>Ge(Vr,{position:"start",children:Ge(Nr,{ref:G,onClick:u?void 0:R,sx:l({width:f==="small"?24:32,height:f==="small"?24:32,borderRadius:1,border:"1px solid",borderColor:n?"error.main":"divider",backgroundColor:Z,cursor:u?"default":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s","&:hover":{opacity:u?1:.8}},H),title:u?void 0:"Click to open color picker"})}),[G,u,R,f,n,Z,H]),$=wt(()=>{var I;return F(l({},w),{input:l(F(l({},w==null?void 0:w.input),{inputProps:l({},((I=w==null?void 0:w.input)==null?void 0:I.inputProps)||{})}),v&&{startAdornment:q})})},[w,v,q]),J=wt(()=>o!=null?o:n!=null&&n.message?n.message:void 0,[o,n==null?void 0:n.message]);return Xr(zr,{error:!!n,disabled:u,required:c,fullWidth:m,sx:B,children:[Ge(Or,F(l({},O),{ref:K,name:t,label:r,value:Z,onChange:T,onFocus:g,onBlur:y,onKeyDown:L,placeholder:b,variant:i,size:f,color:d,fullWidth:m,required:c,error:!!n,disabled:u,slotProps:$,slots:k,sx:A,helperText:J})),Ge("input",{ref:_,type:"color",value:Z,onChange:h,disabled:u,style:{position:"absolute",width:0,height:0,opacity:0,pointerEvents:"none",visibility:"hidden"},"aria-hidden":"true"})]})}));Jo.displayName="ColorPickerField";var $e=Jo;import{Controller as Yr}from"react-hook-form";import{memo as _r,useMemo as Qo}from"react";import{jsx as jo}from"react/jsx-runtime";var en=_r(n=>{var o=n,{name:t,label:r,control:s,errors:e,defaultValue:g="#000000",onChange:y}=o,p=x(o,["name","label","control","errors","defaultValue","onChange"]);let u=Qo(()=>{var i;return e!=null&&e[t]?{message:String(((i=e[t])==null?void 0:i.message)||"")}:null},[e,t]),b=Qo(()=>{var i,f;return(i=e==null?void 0:e[t])!=null&&i.message?String((f=e[t])==null?void 0:f.message):void 0},[e,t]);return jo(Yr,{name:t,control:s,defaultValue:g,render:({field:i})=>{var c;let m=p,{size:f}=m,d=x(m,["size"]);return jo($e,F(l({},d),{name:t,label:r,value:(c=i.value)!=null?c:g,onChange:a=>{i.onChange(a),y==null||y(a)},onBlur:i.onBlur,size:f,error:u,helperText:b}))}})});en.displayName="FormInputColorPicker";var Mt=en;import{Button as tn,FormControl as Zr,FormHelperText as Jr,InputAdornment as Qr,TextField as jr}from"@mui/material";import{CloudUpload as ei}from"@mui/icons-material";import{forwardRef as ti,useRef as oi,useState as on}from"react";import{jsx as fe,jsxs as kt}from"react/jsx-runtime";var nn=ti((h,T)=>{var R=h,{name:t,label:r,value:s,onChange:e,onFileSelect:g,onFileRemove:y,onValidationError:p,onDrop:n,error:o,helperText:u,disabled:b=!1,accept:i,multiple:f=!1,maxSize:d,minSize:m,allowedTypes:c,showPreview:a=!0,enableDragDrop:v=!1,placeholder:P="No file chosen",variant:E="outlined",size:S,color:M,fullWidth:H=!0,required:B,buttonText:A="Upload",buttonVariant:w="contained",buttonColor:k="primary",buttonSize:O,uploadIcon:K=fe(ei,{}),inputStyles:V,buttonStyles:N,formControlStyles:W,containerStyles:Y,slotProps:_,slots:G}=R,Z=x(R,["name","label","value","onChange","onFileSelect","onFileRemove","onValidationError","onDrop","error","helperText","disabled","accept","multiple","maxSize","minSize","allowedTypes","showPreview","enableDragDrop","placeholder","variant","size","color","fullWidth","required","buttonText","buttonVariant","buttonColor","buttonSize","uploadIcon","inputStyles","buttonStyles","formControlStyles","containerStyles","slotProps","slots"]);let L=oi(null),[q,$]=on(!1),[,J]=on(0),I=T&&typeof T=="object"&&"current"in T?T:L,C=()=>s?s instanceof File?s.name:Array.isArray(s)?s.length===0?"":s.length===1?s[0].name:`${s.length} files selected`:typeof s=="object"&&"name"in s?s.name:"":"",D=j=>{if(d&&j.size>d)return`File size exceeds maximum allowed size of ${z(d)}`;if(m&&j.size<m)return`File size is below minimum required size of ${z(m)}`;if(c&&c.length>0){let ne=j.type||U(j.name);if(!c.some(re=>re.startsWith(".")?j.name.toLowerCase().endsWith(re.toLowerCase()):ne.includes(re)||ne===re))return`File type not allowed. Allowed types: ${c.join(", ")}`}return null},z=j=>{if(j===0)return"0 Bytes";let ne=1024,ue=["Bytes","KB","MB","GB"],re=Math.floor(Math.log(j)/Math.log(ne));return Math.round(j/Math.pow(ne,re)*100)/100+" "+ue[re]},U=j=>j.slice((j.lastIndexOf(".")-1>>>0)+2),Q=j=>{let ne=j.target.files;if(!ne||ne.length===0){e&&e(void 0),g&&g(void 0);return}let ue=Array.from(ne),re=[],Yt=!1;for(let Ee of ue){let _t=D(Ee);_t?(Yt=!0,p&&p(_t)):re.push(Ee)}if(re.length>0){let Ee=f?re:re[0];e&&e(Ee),g&&g(Ee)}},oe=()=>{var j;b||(j=I.current)==null||j.click()},se=()=>{I.current&&(I.current.value=""),e&&e(void 0),y&&y()},X=j=>{j.preventDefault(),j.stopPropagation(),J(ne=>ne+1),j.dataTransfer.items&&j.dataTransfer.items.length>0&&$(!0)},ee=j=>{j.preventDefault(),j.stopPropagation(),J(ne=>{let ue=ne-1;return ue===0&&$(!1),ue})},te=j=>{j.preventDefault(),j.stopPropagation()},le=j=>{if(j.preventDefault(),j.stopPropagation(),$(!1),J(0),b)return;let ne=j.dataTransfer.files;ne&&ne.length>0&&(n&&n(ne),Q({target:{files:ne}}))},ie=C(),mt=a&&ie?ie:P;return kt(Zr,{error:!!o,disabled:b,required:B,fullWidth:H,sx:W,children:[kt("div",{style:Y,onDragEnter:v?X:void 0,onDragLeave:v?ee:void 0,onDragOver:v?te:void 0,onDrop:v?le:void 0,children:[fe("input",{type:"file",accept:i,multiple:f,name:t,id:t?`file-upload-${t}`:void 0,onChange:Q,style:{display:"none"},ref:I,disabled:b}),fe(jr,F(l({},Z),{label:r,value:mt,placeholder:P,variant:E,size:S,color:M,fullWidth:H,required:B,error:!!o,disabled:b,name:t,sx:V,slotProps:F(l({},_),{input:F(l({},_==null?void 0:_.input),{readOnly:!0,endAdornment:kt(Qr,{position:"end",children:[a&&ie&&fe(tn,{size:"small",onClick:se,disabled:b,sx:{mr:1},children:"Clear"}),fe(tn,{variant:w,color:k,size:O||S,onClick:oe,disabled:b,startIcon:K,sx:N,children:A})]})})}),slots:G,helperText:u!=null?u:o!=null&&o.message?o.message:void 0})),v&&q&&fe("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.05)",border:"2px dashed",borderColor:"primary.main",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:"Drop files here"})]}),o&&!u&&o.message&&fe(Jr,{children:o.message})]})});nn.displayName="FileUploadField";var Ue=nn;import{useRef as ni,memo as li,useMemo as ln}from"react";import{Controller as ri}from"react-hook-form";import{jsx as rn}from"react/jsx-runtime";var an=li(o=>{var u=o,{name:t,label:r,control:s,errors:e,size:g,defaultValue:y=null,onChange:p}=u,n=x(u,["name","label","control","errors","size","defaultValue","onChange"]);let b=ni(null),i=ln(()=>{var d;return e!=null&&e[t]?{message:String(((d=e[t])==null?void 0:d.message)||"")}:null},[e,t]),f=ln(()=>{var d,m;return(d=e==null?void 0:e[t])!=null&&d.message?String((m=e[t])==null?void 0:m.message):void 0},[e,t]);return rn(ri,{name:t,control:s,defaultValue:y,render:({field:d})=>{var m;return rn(Ue,F(l({},n),{name:t,label:r,value:(m=d.value)!=null?m:null,error:i,helperText:f,size:g,ref:b,onChange:c=>{d.onChange(c),p==null||p(c)},onBlur:d.onBlur}))}})});an.displayName="FormInputFileUpload";var Ht=an;import{Box as ii,FormControl as ai,FormHelperText as sn,FormLabel as si,IconButton as ui}from"@mui/material";import{Clear as mi}from"@mui/icons-material";import{DatePicker as pi,LocalizationProvider as di}from"@mui/x-date-pickers";import{AdapterDateFns as ci}from"@mui/x-date-pickers/AdapterDateFns/index";import{forwardRef as fi,useRef as Fi}from"react";import{jsx as pe,jsxs as gi}from"react/jsx-runtime";var un=fi((z,D)=>{var U=z,{name:t,label:r,value:s,defaultValue:e,onChange:g,onFocus:y,onBlur:p,onViewChange:n,onMonthChange:o,onYearChange:u,onOpen:b,onClose:i,error:f,helperText:d,disabled:m=!1,fullWidth:c=!0,required:a,minDate:v,maxDate:P,shouldDisableDate:E,shouldDisableMonth:S,shouldDisableYear:M,size:H="medium",variant:B="outlined",color:A="primary",placeholder:w,readOnly:k=!1,showClearButton:O=!0,disablePast:K=!1,disableFuture:V=!1,referenceDate:N,view:W,format:Y,openTo:_="day",pickerStyles:G,formControlStyles:Z,formLabelStyles:T,containerStyles:h,textFieldStyles:R,slotProps:L,slots:q,dateAdapter:$=ci,reduceAnimations:J=!1,autoFocus:I=!1}=U,C=x(U,["name","label","value","defaultValue","onChange","onFocus","onBlur","onViewChange","onMonthChange","onYearChange","onOpen","onClose","error","helperText","disabled","fullWidth","required","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear","size","variant","color","placeholder","readOnly","showClearButton","disablePast","disableFuture","referenceDate","view","format","openTo","pickerStyles","formControlStyles","formLabelStyles","containerStyles","textFieldStyles","slotProps","slots","dateAdapter","reduceAnimations","autoFocus"]);let Q=Fi(null),oe=te=>{g&&g(te)},se=()=>{g&&g(null),Q.current&&Q.current.focus()},X=w||"MM/DD/YYYY",ee=F(l({},L),{textField:F(l({},L==null?void 0:L.textField),{error:!!f,size:H,variant:B,color:A,helperText:f?d!=null?d:f.message:d,fullWidth:c,placeholder:X,autoFocus:I,onFocus:y,onBlur:p,inputRef:D||Q,sx:l(l({},R),L!=null&&L.textField&&typeof L.textField=="object"&&"sx"in L.textField?L.textField.sx:{}),InputProps:F(l({},L!=null&&L.textField&&typeof L.textField=="object"&&"InputProps"in L.textField?L.textField.InputProps:{}),{endAdornment:O&&s?pe(ui,{onClick:se,size:"small",edge:"end",sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)"},"aria-label":"clear date",children:pe(mi,{fontSize:"small"})}):void 0})})});return gi(ai,{error:!!f,disabled:m,required:a,fullWidth:c,sx:Z,children:[r&&pe(si,{sx:l({mb:1},T),children:r}),pe(ii,{ref:D,sx:l({},h),children:pe(di,{dateAdapter:$,children:pe(pi,F(l({},C),{name:t,label:r,value:s,defaultValue:e,onChange:oe,onViewChange:n,onMonthChange:o,onYearChange:u,onOpen:b,onClose:i,disabled:m,minDate:v,maxDate:P,shouldDisableDate:E,shouldDisableMonth:S,shouldDisableYear:M,disablePast:K,disableFuture:V,referenceDate:N,view:W,format:Y,openTo:_,reduceAnimations:J,slotProps:ee,slots:q,sx:G}))})}),f&&pe(sn,{children:d!=null?d:f!=null&&f.message?f.message:""}),!f&&d&&pe(sn,{children:d})]})});un.displayName="DatePickerField";var Xe=un;import{Controller as bi}from"react-hook-form";import{memo as yi,useMemo as mn}from"react";import{jsx as pn}from"react/jsx-runtime";var dn=yi(f=>{var d=f,{name:t,label:r,control:s,errors:e,size:g,readOnly:y,shouldDisableDate:p,disabled:n,placeholder:o,defaultValue:u=null,onChange:b}=d,i=x(d,["name","label","control","errors","size","readOnly","shouldDisableDate","disabled","placeholder","defaultValue","onChange"]);let m=mn(()=>{var a;return e!=null&&e[t]?{message:String(((a=e[t])==null?void 0:a.message)||"")}:null},[e,t]),c=mn(()=>{var a,v;return(a=e==null?void 0:e[t])!=null&&a.message?String((v=e[t])==null?void 0:v.message):void 0},[e,t]);return pn(bi,{name:t,control:s,defaultValue:u,render:({field:a})=>{var B;let H=i,{views:v,ampm:P,ampmInClock:E,timezone:S}=H,M=x(H,["views","ampm","ampmInClock","timezone"]);return pn(Xe,F(l({},M),{name:t,label:r,disabled:n,value:(B=a.value)!=null?B:null,onChange:A=>{a.onChange(A),b==null||b(A)},onBlur:a.onBlur,error:m,shouldDisableDate:p,helperText:c,size:g,placeholder:o,readOnly:y}))}})});dn.displayName="FormInputDatePicker";var Bt=dn;import{Box as xi,FormControl as vi,FormHelperText as cn,FormLabel as Ii,IconButton as Ci}from"@mui/material";import{Clear as Pi}from"@mui/icons-material";import{TimePicker as hi,LocalizationProvider as Ti}from"@mui/x-date-pickers";import{AdapterDateFns as Ri}from"@mui/x-date-pickers/AdapterDateFns/index";import{forwardRef as Ei,useRef as Si}from"react";import{jsx as de,jsxs as Di}from"react/jsx-runtime";var fn=Ei((J,$)=>{var I=J,{name:t,label:r,value:s,defaultValue:e,onChange:g,onFocus:y,onBlur:p,onViewChange:n,onOpen:o,onClose:u,error:b,helperText:i,disabled:f=!1,fullWidth:d=!0,required:m,minTime:c,maxTime:a,shouldDisableTime:v,size:P="medium",variant:E="outlined",color:S="primary",placeholder:M,readOnly:H=!1,showClearButton:B=!0,disablePast:A=!1,disableFuture:w=!1,ampm:k=!0,views:O,view:K,openTo:V="hours",format:N,pickerStyles:W,formControlStyles:Y,formLabelStyles:_,containerStyles:G,textFieldStyles:Z,slotProps:T,slots:h,dateAdapter:R=Ri,autoFocus:L=!1}=I,q=x(I,["name","label","value","defaultValue","onChange","onFocus","onBlur","onViewChange","onOpen","onClose","error","helperText","disabled","fullWidth","required","minTime","maxTime","shouldDisableTime","size","variant","color","placeholder","readOnly","showClearButton","disablePast","disableFuture","ampm","views","view","openTo","format","pickerStyles","formControlStyles","formLabelStyles","containerStyles","textFieldStyles","slotProps","slots","dateAdapter","autoFocus"]);let C=Si(null),D=oe=>{g&&g(oe)},z=()=>{g&&g(null),C.current&&C.current.focus()},U=M||(k?"hh:mm AM/PM":"hh:mm"),Q=F(l({},T),{textField:F(l({},T==null?void 0:T.textField),{error:!!b,size:P,variant:E,color:S,helperText:b?i!=null?i:b.message:i,fullWidth:d,placeholder:U,autoFocus:L,onFocus:y,onBlur:p,inputRef:$||C,sx:l(l({},Z),T!=null&&T.textField&&typeof T.textField=="object"&&"sx"in T.textField?T.textField.sx:{}),InputProps:F(l({},T!=null&&T.textField&&typeof T.textField=="object"&&"InputProps"in T.textField?T.textField.InputProps:{}),{endAdornment:B&&s?de(Ci,{onClick:z,size:"small",edge:"end",sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)"},"aria-label":"clear time",children:de(Pi,{fontSize:"small"})}):void 0})})});return Di(vi,{error:!!b,disabled:f,required:m,fullWidth:d,sx:Y,children:[r&&de(Ii,{sx:l({mb:1},_),children:r}),de(xi,{ref:$,sx:l({},G),children:de(Ti,{dateAdapter:R,children:de(hi,F(l({},q),{name:t,label:r&&void 0,value:s,defaultValue:e,onChange:D,onViewChange:n,onOpen:o,onClose:u,disabled:f,minTime:c,maxTime:a,shouldDisableTime:v,disablePast:A,disableFuture:w,ampm:k,views:O,view:K,openTo:V,format:N,slotProps:Q,slots:h,sx:W}))})}),b&&de(cn,{children:i!=null?i:b!=null&&b.message?b.message:""}),!b&&i&&de(cn,{children:i})]})});fn.displayName="TimePickerField";var Ye=fn;import{Controller as Li}from"react-hook-form";import{memo as wi,useMemo as Fn}from"react";import{jsx as gn}from"react/jsx-runtime";var bn=wi(u=>{var b=u,{name:t,label:r,control:s,errors:e,ampm:g=!0,timezone:y,defaultValue:p=null,onChange:n}=b,o=x(b,["name","label","control","errors","ampm","timezone","defaultValue","onChange"]);let i=Fn(()=>{var d;return e!=null&&e[t]?{message:String(((d=e[t])==null?void 0:d.message)||"")}:null},[e,t]),f=Fn(()=>{var d,m;return(d=e==null?void 0:e[t])!=null&&d.message?String((m=e[t])==null?void 0:m.message):void 0},[e,t]);return gn(Li,{name:t,control:s,defaultValue:p,render:({field:d})=>{var v;let a=o,{size:m}=a,c=x(a,["size"]);return gn(Ye,F(l({},c),{name:t,label:r,value:(v=d.value)!=null?v:null,onChange:P=>{d.onChange(P),n==null||n(P)},onBlur:d.onBlur,ampm:g,timezone:y,size:m,error:i,helperText:f}))}})});bn.displayName="FormInputTimePicker";var At=bn;import{Box as Mi,Button as ki,FormControl as Hi,FormHelperText as yn,FormLabel as Bi,Stack as Ai}from"@mui/material";import{TimeClock as zi,LocalizationProvider as Oi}from"@mui/x-date-pickers";import{AdapterDateFns as Ni}from"@mui/x-date-pickers/AdapterDateFns/index";import{forwardRef as Vi,useState as Wi}from"react";import{jsx as Fe,jsxs as xn}from"react/jsx-runtime";var vn=Vi((Z,G)=>{var T=Z,{name:t,label:r,value:s,defaultValue:e,onChange:g,error:y,helperText:p,disabled:n=!1,fullWidth:o=!1,required:u,views:b=["hours","minutes"],ampmInClock:i=!1,ampm:f=!0,disablePast:d=!1,disableFuture:m=!1,minTime:c,maxTime:a,shouldDisableTime:v,clockStyles:P,formControlStyles:E,formLabelStyles:S,containerStyles:M,buttonsStackStyles:H,buttonStyles:B,activeButtonStyles:A,showViewButtons:w=!0,initialView:k="hours",view:O,onViewChange:K,slotProps:V,slots:N,dateAdapter:W=Ni,autoFocus:Y=!1}=T,_=x(T,["name","label","value","defaultValue","onChange","error","helperText","disabled","fullWidth","required","views","ampmInClock","ampm","disablePast","disableFuture","minTime","maxTime","shouldDisableTime","clockStyles","formControlStyles","formLabelStyles","containerStyles","buttonsStackStyles","buttonStyles","activeButtonStyles","showViewButtons","initialView","view","onViewChange","slotProps","slots","dateAdapter","autoFocus"]);let[h,R]=Wi(k),L=O!=null?O:h,q=K!=null?K:R,$=I=>{g&&g(I)},J=I=>{q(I)};return xn(Hi,{error:!!y,disabled:n,required:u,fullWidth:o,sx:E,children:[r&&Fe(Bi,{sx:l({mb:1},S),children:r}),xn(Mi,{ref:G,sx:l({},M),children:[w&&b&&b.length>1&&Fe(Ai,{direction:"row",justifyContent:"center",spacing:1,sx:l({mt:1,mb:1},H),children:b.map(I=>Fe(ki,{size:"small",variant:L===I?"contained":"outlined",onClick:()=>J(I),disabled:n,sx:L===I?l(l({},B),A):B,children:I},I))}),Fe(Oi,{dateAdapter:W,children:Fe(zi,F(l({},_),{value:s,defaultValue:e,onChange:$,view:L,onViewChange:J,disabled:n,views:b,ampmInClock:i,ampm:f,disablePast:d,disableFuture:m,minTime:c,maxTime:a,shouldDisableTime:v,autoFocus:Y,slotProps:V,slots:N,sx:P}))})]}),y&&Fe(yn,{children:p!=null?p:y!=null&&y.message?y.message:""}),!y&&p&&Fe(yn,{children:p})]})});vn.displayName="TimeClockField";var _e=vn;import{Box as Ki,FormHelperText as qi,FormLabel as Gi}from"@mui/material";import{Controller as $i}from"react-hook-form";import{memo as Ui,useMemo as Ze}from"react";import{jsx as Je,jsxs as Xi}from"react/jsx-runtime";var In=Ui(d=>{var m=d,{name:t,label:r,control:s,errors:e,readOnly:g,disabled:y,ampm:p=!0,views:n,ampmInClock:o=!0,disablePast:u=!1,defaultValue:b=null,onChange:i}=m,f=x(m,["name","label","control","errors","readOnly","disabled","ampm","views","ampmInClock","disablePast","defaultValue","onChange"]);let c=Ze(()=>{var E;return e!=null&&e[t]?{message:String(((E=e[t])==null?void 0:E.message)||"")}:null},[e,t]),a=Ze(()=>{var E,S;return(E=e==null?void 0:e[t])!=null&&E.message?String((S=e[t])==null?void 0:S.message):""},[e,t]),v=Ze(()=>!!(e!=null&&e[t]),[e,t]),P=Ze(()=>typeof p=="boolean"?p:void 0,[p]);return Xi(Ki,{sx:{border:E=>`1px solid ${E.palette.grey[600]}`,borderRadius:E=>E.spacing(.5),display:"flex",flexDirection:"column"},children:[Je(Gi,{sx:E=>({borderBottom:`1px solid ${E.palette.grey[600]}`,padding:S=>S.spacing(1)}),children:r}),Je($i,{name:t,control:s,defaultValue:b,render:({field:E})=>{var S;return Je(_e,F(l({},f),{name:t,value:(S=E.value)!=null?S:null,onChange:M=>{E.onChange(M),i==null||i(M)},ampm:P,disabled:y,readOnly:g,ampmInClock:o,disablePast:u,views:n,error:c}))}}),v&&Je(qi,{sx:{color:"error.main",mt:1},children:a})]})});In.displayName="FormInputTimeClock";var zt=In;import{Box as Yi,FormControl as _i,FormHelperText as Cn,FormLabel as Zi}from"@mui/material";import{AdapterDateFns as Ji}from"@mui/x-date-pickers/AdapterDateFns/index";import{DateCalendar as Qi,LocalizationProvider as ji}from"@mui/x-date-pickers";import{forwardRef as ea}from"react";import{jsx as he,jsxs as ta}from"react/jsx-runtime";var Pn=ea((Y,W)=>{var _=Y,{name:t,label:r,value:s,defaultValue:e,onChange:g,onViewChange:y,onMonthChange:p,onYearChange:n,error:o,helperText:u,disabled:b=!1,fullWidth:i=!1,required:f,minDate:d,maxDate:m,shouldDisableDate:c,shouldDisableMonth:a,shouldDisableYear:v,calendarStyles:P,formControlStyles:E,formLabelStyles:S,containerStyles:M,slotProps:H,slots:B,dateAdapter:A=Ji,showDaysOutsideCurrentMonth:w=!1,disablePast:k=!1,disableFuture:O=!1,referenceDate:K,view:V}=_,N=x(_,["name","label","value","defaultValue","onChange","onViewChange","onMonthChange","onYearChange","error","helperText","disabled","fullWidth","required","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear","calendarStyles","formControlStyles","formLabelStyles","containerStyles","slotProps","slots","dateAdapter","showDaysOutsideCurrentMonth","disablePast","disableFuture","referenceDate","view"]);let G=Z=>{g&&g(Z)};return ta(_i,{error:!!o,disabled:b,required:f,fullWidth:i,sx:E,children:[r&&he(Zi,{sx:l({mb:1},S),children:r}),he(Yi,{ref:W,sx:l({},M),children:he(ji,{dateAdapter:A,children:he(Qi,F(l({},N),{value:s,defaultValue:e,onChange:G,onViewChange:y,onMonthChange:p,onYearChange:n,disabled:b,minDate:d,maxDate:m,shouldDisableDate:c,shouldDisableMonth:a,shouldDisableYear:v,showDaysOutsideCurrentMonth:w,disablePast:k,disableFuture:O,referenceDate:K,view:V,slotProps:H,slots:B,sx:P}))})}),o&&he(Cn,{children:u!=null?u:o!=null&&o.message?o.message:""}),!o&&u&&he(Cn,{children:u})]})});Pn.displayName="DateCalendarField";var Qe=Pn;import{Box as oa,FormHelperText as na,FormLabel as la}from"@mui/material";import{Controller as ra}from"react-hook-form";import{memo as ia,useMemo as Ot}from"react";import{jsx as je,jsxs as aa}from"react/jsx-runtime";var hn=ia(u=>{var b=u,{name:t,label:r,control:s,errors:e,readOnly:g,disabled:y,defaultValue:p=null,onChange:n}=b,o=x(b,["name","label","control","errors","readOnly","disabled","defaultValue","onChange"]);let i=Ot(()=>{var m;return e!=null&&e[t]?{message:String(((m=e[t])==null?void 0:m.message)||"")}:null},[e,t]),f=Ot(()=>{var m,c;return(m=e==null?void 0:e[t])!=null&&m.message?String((c=e[t])==null?void 0:c.message):""},[e,t]),d=Ot(()=>!!(e!=null&&e[t]),[e,t]);return aa(oa,{sx:{border:m=>`1px solid ${m.palette.grey[600]}`,borderRadius:m=>m.spacing(.5),display:"flex",flexDirection:"column"},children:[je(la,{sx:m=>({borderBottom:`1px solid ${m.palette.grey[600]}`,padding:c=>c.spacing(1)}),children:r}),je(ra,{name:t,control:s,defaultValue:p,render:({field:m})=>{var P;let v=o,{views:c}=v,a=x(v,["views"]);return je(Qe,F(l({},a),{name:t,value:(P=m.value)!=null?P:null,onChange:E=>{m.onChange(E),n==null||n(E)},disabled:y,readOnly:g,error:i,sx:l({height:"300px"},a.sx)}))}}),d&&je(na,{sx:{color:"error.main",mt:1},children:f})]})});hn.displayName="FormInputCalendar";var Nt=hn;import{Checkbox as sa,FormControl as ua,FormControlLabel as ma,FormHelperText as Tn}from"@mui/material";import{forwardRef as pa}from"react";import{jsx as et,jsxs as da}from"react/jsx-runtime";var Rn=pa((w,A)=>{var k=w,{name:t,label:r,value:s,onChange:e,onClick:g,onFocus:y,onBlur:p,error:n,helperText:o,disabled:u=!1,color:b="primary",size:i,fullWidth:f=!1,required:d,labelPlacement:m="end",checkedIcon:c,icon:a,indeterminate:v=!1,checkboxStyles:P,labelStyles:E,formControlStyles:S,slotProps:M,slots:H}=k,B=x(k,["name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","checkedIcon","icon","indeterminate","checkboxStyles","labelStyles","formControlStyles","slotProps","slots"]);let O=(V,N)=>{e&&e(N)},K=V=>{g&&g(V)};return da(ua,{error:!!n,disabled:u,required:d,fullWidth:f,size:i==="large"?"medium":i,sx:S,children:[et(ma,{control:et(sa,F(l({},B),{checked:s,indeterminate:v,onChange:O,onClick:K,onFocus:y,onBlur:p,disabled:u,color:b,size:i,checkedIcon:c,icon:a,name:t,slotProps:M,slots:H,sx:P,ref:A})),label:r,labelPlacement:m,sx:E}),n&&et(Tn,{children:o!=null?o:n!=null&&n.message?n.message:""}),!n&&o&&et(Tn,{children:o})]})});Rn.displayName="CheckboxField";var tt=Rn;import{Controller as ca}from"react-hook-form";import{memo as fa,useMemo as En}from"react";import{jsx as Sn}from"react/jsx-runtime";var Dn=fa(n=>{var o=n,{name:t,label:r,control:s,errors:e,defaultValue:g=!1,onChange:y}=o,p=x(o,["name","label","control","errors","defaultValue","onChange"]);let u=En(()=>{var i;return e!=null&&e[t]?{message:String(((i=e[t])==null?void 0:i.message)||"")}:null},[e,t]),b=En(()=>{var i,f;return(i=e==null?void 0:e[t])!=null&&i.message?String((f=e[t])==null?void 0:f.message):void 0},[e,t]);return Sn(ca,{name:t,control:s,defaultValue:g,render:({field:i})=>{var c;let m=p,{size:f}=m,d=x(m,["size"]);return Sn(tt,F(l({},d),{name:t,label:r,value:(c=i.value)!=null?c:!1,onChange:a=>{i.onChange(a),y==null||y(a)},onBlur:i.onBlur,size:f,error:u,helperText:b}))}})});Dn.displayName="FormInputCheckBox";var Vt=Dn;import{FormControl as Fa,FormHelperText as Ln,FormLabel as ga,Checkbox as ba,FormControlLabel as ya,Box as xa}from"@mui/material";import{forwardRef as va}from"react";import{jsx as Te,jsxs as Ia}from"react/jsx-runtime";var wn=va((N,V)=>{var W=N,{name:t,label:r,value:s,options:e,onChange:g,onFocus:y,onBlur:p,onClick:n,error:o,helperText:u,disabled:b=!1,fullWidth:i=!0,required:f,color:d="primary",size:m,labelPlacement:c="end",row:a=!1,checkedIcon:v,icon:P,checkboxStyles:E,labelStyles:S,formControlStyles:M,formLabelStyles:H,renderCheckbox:B,slotProps:A,slots:w,formLabelProps:k,formControlLabelProps:O}=W,K=x(W,["name","label","value","options","onChange","onFocus","onBlur","onClick","error","helperText","disabled","fullWidth","required","color","size","labelPlacement","row","checkedIcon","icon","checkboxStyles","labelStyles","formControlStyles","formLabelStyles","renderCheckbox","slotProps","slots","formLabelProps","formControlLabelProps"]);let Y=h=>R=>{if(b)return;let L=R.target.checked,q;L?q=[...s,h]:q=s.filter($=>$!==h),g&&g(q)},_=h=>R=>{y&&y(R,h)},G=h=>R=>{p&&p(R,h)},Z=h=>R=>{n&&n(R,h)},T=(h,R,L,q)=>Te(ya,l({control:Te(ba,{name:t?`${t}-${h.value}`:void 0,checked:L,onChange:q,onFocus:_(h.value),onBlur:G(h.value),onClick:Z(h.value),disabled:b||h.disabled,color:d,size:m,checkedIcon:v,icon:P,slotProps:A==null?void 0:A.checkbox,slots:w==null?void 0:w.checkbox,sx:E}),label:h.label,labelPlacement:c,slotProps:A==null?void 0:A.formControlLabel,sx:S},O),`${h.value}-${R}`);return Ia(Fa,F(l({},K),{error:!!o,disabled:b,required:f,fullWidth:i,component:"fieldset",sx:M,children:[r&&Te(ga,F(l({component:"legend",sx:H},k),{children:r})),Te(xa,{ref:V,sx:{display:"flex",flexDirection:a?"row":"column",flexWrap:a?"wrap":"nowrap",gap:1,mt:r?1:0},children:e.map((h,R)=>{let L=s.includes(h.value),q=Y(h.value);return B?B(h,R,L,q):T(h,R,L,q)})}),o&&Te(Ln,{children:u!=null?u:o!=null&&o.message?o.message:""}),!o&&u&&Te(Ln,{children:u})]}))});wn.displayName="CheckboxFieldGroup";var ot=wn;import{Controller as Ca}from"react-hook-form";import{memo as Pa,useMemo as Wt}from"react";import{jsx as Mn}from"react/jsx-runtime";var kn=Pa(i=>{var f=i,{name:t,label:r,control:s,errors:e,options:g=[],defaultValue:y=[],onChange:p,row:n,color:o,labelPlacement:u}=f,b=x(f,["name","label","control","errors","options","defaultValue","onChange","row","color","labelPlacement"]);let d=Wt(()=>g.map(a=>({value:a.value,label:a.name,disabled:a.disabled})),[g]),m=Wt(()=>{var a;return e!=null&&e[t]?{message:String(((a=e[t])==null?void 0:a.message)||"")}:null},[e,t]),c=Wt(()=>{var a,v;return(a=e==null?void 0:e[t])!=null&&a.message?String((v=e[t])==null?void 0:v.message):void 0},[e,t]);return Mn(Ca,{name:t,control:s,defaultValue:y,render:({field:a})=>{let S=b,{size:v}=S,P=x(S,["size"]),E=Array.isArray(a.value)?a.value:[];return Mn(ot,F(l({},P),{name:t,label:r,value:E,options:d,onChange:M=>{a.onChange(M),p==null||p(M)},onBlur:a.onBlur,row:n,color:o,labelPlacement:u,size:v,error:m,helperText:c}))}})});kn.displayName="FormInputCheckBoxGroup";var Kt=kn;import{FormControl as Hn,FormControlLabel as ha,FormHelperText as Bn,Switch as Ta}from"@mui/material";import{forwardRef as Ra}from"react";import{jsx as nt,jsxs as An}from"react/jsx-runtime";var zn=Ra((A,B)=>{var w=A,{name:t,label:r,value:s,onChange:e,onClick:g,onFocus:y,onBlur:p,error:n,helperText:o,disabled:u=!1,color:b="primary",size:i,fullWidth:f=!1,required:d,labelPlacement:m="end",edge:c,switchStyles:a,labelStyles:v,formControlStyles:P,slotProps:E,slots:S,formControlLabelProps:M}=w,H=x(w,["name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","edge","switchStyles","labelStyles","formControlStyles","slotProps","slots","formControlLabelProps"]);let k=(V,N)=>{e&&e(N)},O=V=>{g&&g(V)},K=nt(Ta,F(l({},H),{checked:s,onChange:k,onClick:O,onFocus:y,onBlur:p,disabled:u,color:b,size:i,edge:c,name:t,slotProps:E,slots:S,sx:a,ref:B}));return r?An(Hn,{error:!!n,disabled:u,required:d,fullWidth:f,size:i,sx:l({display:"flex",flexDirection:"column"},P),children:[nt(ha,l({control:K,label:r,labelPlacement:m,disabled:u,sx:v},M)),(n||o)&&nt(Bn,{sx:{marginLeft:m==="start"?"72px":0,marginRight:0},children:n?o!=null?o:n!=null&&n.message?n.message:"":o})]}):An(Hn,{error:!!n,disabled:u,required:d,fullWidth:f,sx:l({display:"inline-flex",flexDirection:"column"},P),children:[K,(n||o)&&nt(Bn,{sx:{marginLeft:0,marginRight:0},children:n?o!=null?o:n!=null&&n.message?n.message:"":o})]})});zn.displayName="SwitchField";var lt=zn;import{Controller as Ea}from"react-hook-form";import{memo as Sa,useMemo as On}from"react";import{jsx as Nn}from"react/jsx-runtime";var Vn=Sa(n=>{var o=n,{name:t,label:r,control:s,errors:e,defaultValue:g=!1,onChange:y}=o,p=x(o,["name","label","control","errors","defaultValue","onChange"]);let u=On(()=>{var i;return e!=null&&e[t]?{message:String(((i=e[t])==null?void 0:i.message)||"")}:null},[e,t]),b=On(()=>{var i,f;return(i=e==null?void 0:e[t])!=null&&i.message?String((f=e[t])==null?void 0:f.message):void 0},[e,t]);return Nn(Ea,{name:t,control:s,defaultValue:g,render:({field:i})=>{var c;let m=p,{size:f}=m,d=x(m,["size"]);return Nn(lt,F(l({},d),{name:t,label:r,value:(c=i.value)!=null?c:!1,onChange:a=>{i.onChange(a),y==null||y(a)},onBlur:i.onBlur,size:f,error:u,helperText:b}))}})});Vn.displayName="FormInputSwitch";var qt=Vn;import{FormControl as Da,FormHelperText as Wn,FormLabel as La,Slider as wa}from"@mui/material";import{forwardRef as Ma}from"react";import{jsx as rt,jsxs as ka}from"react/jsx-runtime";var Kn=Ma((N,V)=>{var W=N,{name:t,label:r,value:s,onChange:e,onChangeCommitted:g,onFocus:y,onBlur:p,error:n,helperText:o,disabled:u=!1,fullWidth:b=!0,required:i,orientation:f="horizontal",min:d=0,max:m=100,step:c=1,valueLabelDisplay:a="auto",valueLabelFormat:v,color:P="primary",size:E,marks:S,track:M="normal",sliderStyles:H,formControlStyles:B,formLabelStyles:A,slotProps:w,slots:k,formLabelProps:O}=W,K=x(W,["name","label","value","onChange","onChangeCommitted","onFocus","onBlur","error","helperText","disabled","fullWidth","required","orientation","min","max","step","valueLabelDisplay","valueLabelFormat","color","size","marks","track","sliderStyles","formControlStyles","formLabelStyles","slotProps","slots","formLabelProps"]);let Y=(Z,T,h)=>{e&&e(T)},_=(Z,T)=>{g&&g(T)},G=f==="vertical";return ka(Da,{error:!!n,disabled:u,required:i,fullWidth:b&&!G,sx:l(l({},B),G&&{display:"flex",flexDirection:"column",alignItems:"flex-start",height:"100%",width:"auto"}),children:[r&&rt(La,F(l({sx:A},O),{children:r})),rt(wa,F(l({},K),{name:t,value:s,onChange:Y,onChangeCommitted:_,onFocus:y,onBlur:p,orientation:f,min:d,max:m,step:c,valueLabelDisplay:a,valueLabelFormat:v,color:P,size:E,marks:S===!0?!0:S||!1,track:M,disabled:u,slotProps:w,slots:k,sx:l(l({},H),G&&{height:"100%","& .MuiSlider-track":{width:"6px"},"& .MuiSlider-rail":{width:"6px"}}),ref:V})),n&&rt(Wn,{children:o!=null?o:n!=null&&n.message?n.message:""}),!n&&o&&rt(Wn,{children:o})]})});Kn.displayName="SliderField";var it=Kn;import{Controller as Ha}from"react-hook-form";import{memo as Ba,useMemo as qn}from"react";import{jsx as Gn}from"react/jsx-runtime";var $n=Ba(n=>{var o=n,{name:t,label:r,control:s,errors:e,defaultValue:g=0,onChange:y}=o,p=x(o,["name","label","control","errors","defaultValue","onChange"]);let u=qn(()=>{var i;return e!=null&&e[t]?{message:String(((i=e[t])==null?void 0:i.message)||"")}:null},[e,t]),b=qn(()=>{var i,f;return(i=e==null?void 0:e[t])!=null&&i.message?String((f=e[t])==null?void 0:f.message):void 0},[e,t]);return Gn(Ha,{name:t,control:s,defaultValue:g,render:({field:i})=>{var c;let m=p,{size:f}=m,d=x(m,["size"]);return Gn(it,F(l({},d),{name:t,label:r,value:(c=i.value)!=null?c:g,onChange:a=>{i.onChange(a),y==null||y(a)},onBlur:i.onBlur,size:f,error:u,helperText:b}))}})});$n.displayName="FormInputSlider";var Gt=$n;import{FormControl as Aa,FormControlLabel as za,FormHelperText as Un,Radio as Oa}from"@mui/material";import{forwardRef as Na}from"react";import{jsx as at,jsxs as Va}from"react/jsx-runtime";var Xn=Na((w,A)=>{var k=w,{name:t,label:r,value:s,onChange:e,onClick:g,onFocus:y,onBlur:p,error:n,helperText:o,disabled:u=!1,color:b="primary",size:i,fullWidth:f=!1,required:d,labelPlacement:m="end",checkedIcon:c,icon:a,radioStyles:v,labelStyles:P,formControlStyles:E,slotProps:S,slots:M,formControlLabelProps:H}=k,B=x(k,["name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","checkedIcon","icon","radioStyles","labelStyles","formControlStyles","slotProps","slots","formControlLabelProps"]);let O=(V,N)=>{e&&e(N)},K=V=>{g&&g(V)};return Va(Aa,{error:!!n,disabled:u,required:d,fullWidth:f,size:i,sx:E,children:[at(za,l({control:at(Oa,F(l({},B),{checked:s,onChange:O,onClick:K,onFocus:y,onBlur:p,disabled:u,color:b,size:i,checkedIcon:c,icon:a,name:t,slotProps:S,slots:M,sx:v,ref:A})),label:r,labelPlacement:m,sx:P},H)),n&&at(Un,{children:o!=null?o:n!=null&&n.message?n.message:""}),!n&&o&&at(Un,{children:o})]})});Xn.displayName="RadioButtonField";var st=Xn;import{Controller as Wa}from"react-hook-form";import{memo as Ka,useMemo as Yn}from"react";import{jsx as _n}from"react/jsx-runtime";var Zn=Ka(b=>{var i=b,{name:t,label:r,control:s,errors:e,checked:g=!1,defaultValue:y=!1,onChange:p,color:n,labelPlacement:o}=i,u=x(i,["name","label","control","errors","checked","defaultValue","onChange","color","labelPlacement"]);let f=Yn(()=>{var m;return e!=null&&e[t]?{message:String(((m=e[t])==null?void 0:m.message)||"")}:null},[e,t]),d=Yn(()=>{var m,c;return(m=e==null?void 0:e[t])!=null&&m.message?String((c=e[t])==null?void 0:c.message):void 0},[e,t]);return _n(Wa,{name:t,control:s,defaultValue:y,render:({field:m})=>{var P;let v=u,{size:c}=v,a=x(v,["size"]);return _n(st,F(l({},a),{name:t,label:r,value:(P=m.value)!=null?P:!1,onChange:E=>{m.onChange(E),p==null||p(E)},onBlur:m.onBlur,color:n,labelPlacement:o,size:c,error:f,helperText:d}))}})});Zn.displayName="FormInputRadioButton";var $t=Zn;import{FormControl as qa,FormControlLabel as Ga,FormHelperText as Jn,FormLabel as $a,Radio as Ua,RadioGroup as Xa}from"@mui/material";import{forwardRef as Ya}from"react";import{jsx as Re,jsxs as _a}from"react/jsx-runtime";var Qn=Ya((W,N)=>{var Y=W,{name:t,label:r,value:s,onChange:e,onClick:g,onFocus:y,onBlur:p,options:n,error:o,helperText:u,disabled:b=!1,color:i="primary",size:f,fullWidth:d=!1,required:m,labelPlacement:c="end",row:a=!1,checkedIcon:v,icon:P,radioStyles:E,labelStyles:S,formControlStyles:M,formLabelStyles:H,radioGroupStyles:B,renderRadio:A,slotProps:w,slots:k,formLabelProps:O,formControlLabelProps:K}=Y,V=x(Y,["name","label","value","onChange","onClick","onFocus","onBlur","options","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","row","checkedIcon","icon","radioStyles","labelStyles","formControlStyles","formLabelStyles","radioGroupStyles","renderRadio","slotProps","slots","formLabelProps","formControlLabelProps"]);let _=T=>{var q;let h=T.target.value,R=(q=n.find($=>String($.value)===h))==null?void 0:q.value;e&&e(typeof R=="number"?R:h)},G=T=>{g&&g(T)},Z=T=>Re(Ga,F(l({value:String(T.value),control:Re(Ua,{color:i,size:f,disabled:b||T.disabled,checkedIcon:v,icon:P,onClick:G,onFocus:y,onBlur:p,slotProps:w==null?void 0:w.radio,slots:k==null?void 0:k.radio,sx:E}),label:T.name,labelPlacement:c,disabled:b||T.disabled,sx:S},K),{slotProps:w==null?void 0:w.formControlLabel,slots:k==null?void 0:k.formControlLabel}),T.value);return _a(qa,{component:"fieldset",error:!!o,disabled:b,required:m,fullWidth:d,sx:M,children:[r&&Re($a,F(l({component:"legend",sx:H},O),{children:r})),Re(Xa,F(l({name:t,value:s!=null?String(s):"",onChange:_,row:a,ref:N,sx:B},V),{children:n&&Array.isArray(n)&&n.map((T,h)=>A?A(T,h):Z(T))})),o&&Re(Jn,{children:u!=null?u:o!=null&&o.message?o.message:""}),!o&&u&&Re(Jn,{children:u})]})});Qn.displayName="RadioButtonFieldGroup";var ut=Qn;import{Controller as Za}from"react-hook-form";import{memo as Ja,useMemo as Ut}from"react";import{jsx as jn}from"react/jsx-runtime";var el=Ja(o=>{var u=o,{name:t,label:r,control:s,errors:e,options:g=[],defaultValue:y="",onChange:p}=u,n=x(u,["name","label","control","errors","options","defaultValue","onChange"]);let b=Ut(()=>{var d;return e!=null&&e[t]?{message:String(((d=e[t])==null?void 0:d.message)||"")}:null},[e,t]),i=Ut(()=>{var d,m;return(d=e==null?void 0:e[t])!=null&&d.message?String((m=e[t])==null?void 0:m.message):void 0},[e,t]),f=Ut(()=>Array.isArray(g)?g:[],[g]);return jn(Za,{name:t,control:s,defaultValue:y,render:({field:d})=>{var v;let a=n,{size:m}=a,c=x(a,["size"]);return jn(ut,F(l({},c),{name:t,label:r,value:(v=d.value)!=null?v:"",onChange:P=>{d.onChange(P),p==null||p(P)},onBlur:d.onBlur,options:f,size:m,error:b,helperText:i}))}})});el.displayName="FormInputRadioButtonGroup";var Xt=el;var Qa={FormInputTextField:pt,FormInputTextArea:dt,FormInputPasswordField:ct,FormInputNumberField:ft,FormInputTelField:yt,FormInputSearchField:vt,FormInputOTPField:It,FormInputSelect:Pt,FormInputMultiSelect:Tt,FormInputAutoComplete:St,FormInputMultiAutoComplete:Lt,FormInputColorPicker:Mt,FormInputFileUpload:Ht,FormInputDatePicker:Bt,FormInputTimePicker:At,FormInputTimeClock:zt,FormInputCalendar:Nt,FormInputCheckBox:Vt,FormInputCheckBoxGroup:Kt,FormInputSwitch:qt,FormInputSlider:Gt,FormInputSingleRadio:$t,FormInputRadioButtonGroup:Xt,TextInputField:be,PasswordField:He,NumberField:Ae,TelInputField:Oe,SearchInputField:Ne,OTPField:We,SelectInputField:Ce,AutoCompleteField:Pe,ColorPickerField:$e,FileUploadField:Ue,DatePickerField:Xe,TimePickerField:Ye,TimeClockField:_e,DateCalendarField:Qe,CheckBoxField:tt,CheckBoxFieldGroup:ot,RadioButtonField:st,RadioButtonFieldGroup:ut,SwitchField:lt,SliderField:it},Qc=Qa;export{Pe as AutoCompleteField,tt as CheckBoxField,ot as CheckBoxFieldGroup,$e as ColorPickerField,Qe as DateCalendarField,Xe as DatePickerField,Ue as FileUploadField,St as FormInputAutoComplete,Nt as FormInputCalendar,Vt as FormInputCheckBox,Kt as FormInputCheckBoxGroup,Mt as FormInputColorPicker,Bt as FormInputDatePicker,Ht as FormInputFileUpload,Lt as FormInputMultiAutoComplete,Tt as FormInputMultiSelect,ft as FormInputNumberField,It as FormInputOTPField,ct as FormInputPasswordField,Xt as FormInputRadioButtonGroup,vt as FormInputSearchField,Pt as FormInputSelect,$t as FormInputSingleRadio,Gt as FormInputSlider,qt as FormInputSwitch,yt as FormInputTelField,dt as FormInputTextArea,pt as FormInputTextField,zt as FormInputTimeClock,At as FormInputTimePicker,Ae as NumberField,We as OTPField,He as PasswordField,st as RadioButtonField,ut as RadioButtonFieldGroup,Ne as SearchInputField,Ce as SelectInputField,it as SliderField,lt as SwitchField,Oe as TelInputField,be as TextInputField,_e as TimeClockField,Ye as TimePickerField,Qc as default};
|
|
1
|
+
var cl=Object.defineProperty,fl=Object.defineProperties;var Fl=Object.getOwnPropertyDescriptors;var Pt=Object.getOwnPropertySymbols;var lo=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable;var no=(e,a,n)=>a in e?cl(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n,r=(e,a)=>{for(var n in a||(a={}))lo.call(a,n)&&no(e,n,a[n]);if(Pt)for(var n of Pt(a))ro.call(a,n)&&no(e,n,a[n]);return e},g=(e,a)=>fl(e,Fl(a));var y=(e,a)=>{var n={};for(var t in e)lo.call(e,t)&&a.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&Pt)for(var t of Pt(e))a.indexOf(t)<0&&ro.call(e,t)&&(n[t]=e[t]);return n};import{FormControl as gl,InputAdornment as ao,TextField as bl}from"@mui/material";import{forwardRef as xl,memo as yl,useCallback as vl,useMemo as Re}from"react";import{jsx as Tt}from"react/jsx-runtime";var io=yl(xl((_,Y)=>{var K=_,{name:e,label:a,value:n,onChange:t,onFocus:F,onBlur:x,onEnterPress:m,error:o,helperText:l,disabled:i=!1,placeholder:b,variant:s="outlined",size:c,color:d="primary",fullWidth:p=!0,required:f,multiline:u=!1,rows:v,minRows:I,maxRows:E,resize:S="both",maxLength:L,minLength:M,type:H="text",autoComplete:A="off",startAdornment:w,endAdornment:B,inputStyles:O,formControlStyles:G,slotProps:V,slots:N}=K,W=y(K,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","multiline","rows","minRows","maxRows","resize","maxLength","minLength","type","autoComplete","startAdornment","endAdornment","inputStyles","formControlStyles","slotProps","slots"]);let Z=vl(J=>{J.key==="Enter"&&!u&&m&&m(n),W.onKeyDown&&W.onKeyDown(J)},[u,m,n,W.onKeyDown]),T=Re(()=>r({maxLength:L,minLength:M},W.inputProps||{}),[L,M,W]),P=Re(()=>w?Tt(ao,{position:"start",children:w}):void 0,[w]),R=Re(()=>B?Tt(ao,{position:"end",children:B}):void 0,[B]),k=Re(()=>g(r({},V),{input:r(r(g(r({},V==null?void 0:V.input),{inputProps:T}),P&&{startAdornment:P}),R&&{endAdornment:R})}),[V,T,P,R]),q=Re(()=>u?g(r({},O),{"& textarea":{resize:S}}):O,[u,O,S]),X=Re(()=>l!=null?l:o!=null&&o.message?o.message:void 0,[l,o==null?void 0:o.message]);return Tt(gl,{error:!!o,disabled:i,required:f,fullWidth:p,sx:G,children:Tt(bl,g(r({},W),{name:e,label:a,value:n,onChange:t,onFocus:F,onBlur:x,onKeyDown:Z,placeholder:b,variant:s,size:c,color:d,fullWidth:p,required:f,error:!!o,disabled:i,multiline:u,rows:v,minRows:I,maxRows:E,type:u?void 0:H,autoComplete:A,slotProps:k,slots:N,sx:q,ref:Y,helperText:X}))})}));io.displayName="TextInputField";var pe=io;import{Controller as Cl}from"react-hook-form";import{memo as hl,useMemo as so}from"react";import{jsx as uo}from"react/jsx-runtime";var mo=hl(o=>{var l=o,{name:e,label:a,control:n,errors:t,defaultValue:F="",onChange:x}=l,m=y(l,["name","label","control","errors","defaultValue","onChange"]);let i=so(()=>{var s;return t!=null&&t[e]?{message:String(((s=t[e])==null?void 0:s.message)||"")}:null},[t,e]),b=so(()=>{var s,c;return(s=t==null?void 0:t[e])!=null&&s.message?String((c=t[e])==null?void 0:c.message):void 0},[t,e]);return uo(Cl,{name:e,control:n,defaultValue:F,render:({field:s})=>{var f;let p=m,{size:c}=p,d=y(p,["size"]);return uo(pe,g(r({},d),{name:e,label:a,value:(f=s.value)!=null?f:"",onChange:u=>{s.onChange(u),x==null||x(u.target.value)},onBlur:s.onBlur,size:c,error:i,helperText:b}))}})});mo.displayName="FormInputTextField";var Qe=mo;import{Controller as Il}from"react-hook-form";import{memo as Pl,useMemo as po}from"react";import{jsx as co}from"react/jsx-runtime";var fo=Pl(s=>{var c=s,{name:e,label:a,control:n,errors:t,rows:F,minRows:x,maxRows:m,resize:o,defaultValue:l="",onChange:i}=c,b=y(c,["name","label","control","errors","rows","minRows","maxRows","resize","defaultValue","onChange"]);let d=po(()=>{var f;return t!=null&&t[e]?{message:String(((f=t[e])==null?void 0:f.message)||"")}:null},[t,e]),p=po(()=>{var f,u;return(f=t==null?void 0:t[e])!=null&&f.message?String((u=t[e])==null?void 0:u.message):void 0},[t,e]);return co(Il,{name:e,control:n,defaultValue:l,render:({field:f})=>{var E;let I=b,{size:u}=I,v=y(I,["size"]);return co(pe,g(r({},v),{name:e,label:a,value:(E=f.value)!=null?E:"",onChange:S=>{f.onChange(S),i==null||i(S.target.value)},onBlur:f.onBlur,multiline:!0,rows:F,minRows:x,maxRows:m,resize:o,size:u,error:d,helperText:p}))}})});fo.displayName="FormInputTextArea";var je=fo;import{Visibility as Tl,VisibilityOff as Rl}from"@mui/icons-material";import{FormControl as El,FormHelperText as Fo,IconButton as Sl,InputAdornment as Dl,TextField as kl}from"@mui/material";import{forwardRef as wl,useState as Ll,memo as Bl,useCallback as go,useMemo as Rt}from"react";import{jsx as xe,jsxs as bo}from"react/jsx-runtime";var Ml=e=>{if(!e)return"weak";let a=0;return e.length>=8&&a++,e.length>=12&&a++,/[a-z]/.test(e)&&a++,/[A-Z]/.test(e)&&a++,/[0-9]/.test(e)&&a++,/[^a-zA-Z0-9]/.test(e)&&a++,a<=2?"weak":a<=4?"medium":a<=5?"strong":"very-strong"},Hl=e=>{switch(e){case"weak":return"#f44336";case"medium":return"#ff9800";case"strong":return"#4caf50";case"very-strong":return"#2196f3";default:return"#9e9e9e"}},xo=Bl(wl((N,V)=>{var W=N,{name:e,label:a,value:n,onChange:t,onFocus:F,onBlur:x,onVisibilityToggle:m,error:o,helperText:l,disabled:i=!1,placeholder:b,variant:s="outlined",size:c,color:d,fullWidth:p=!0,required:f,showPasswordStrength:u=!1,minLength:v,maxLength:I,defaultShowPassword:E=!1,visibilityIcon:S=xe(Tl,{}),visibilityOffIcon:L=xe(Rl,{}),iconButtonProps:M,getPasswordStrength:H=Ml,inputStyles:A,formControlStyles:w,slotProps:B,slots:O}=W,G=y(W,["name","label","value","onChange","onFocus","onBlur","onVisibilityToggle","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","showPasswordStrength","minLength","maxLength","defaultShowPassword","visibilityIcon","visibilityOffIcon","iconButtonProps","getPasswordStrength","inputStyles","formControlStyles","slotProps","slots"]);let[Y,_]=Ll(E),K=go(()=>{_(X=>{let J=!X;return m&&m(J),J})},[m]),Z=Rt(()=>u?H(n):null,[u,n]),T=()=>{if(!Z||!n)return null;let X=Hl(Z),J=Z.charAt(0).toUpperCase()+Z.slice(1).replace("-"," ");return xe("div",{style:{marginTop:"4px",fontSize:"0.75rem"},children:bo("span",{style:{color:X,fontWeight:500},children:["Strength: ",J]})})},P=go(X=>{let J=X.target.value;I&&J.length>I||t&&t(X)},[I,t]),R=Rt(()=>xe(Dl,{position:"end",children:xe(Sl,g(r({onClick:K,onMouseDown:X=>X.preventDefault(),edge:"end",disabled:i},M),{children:Y?L:S}))}),[K,i,M,Y,L,S]),k=Rt(()=>{var X;return g(r({},B),{input:g(r(r({},B==null?void 0:B.input),v||I?{inputProps:r(r({minLength:v,maxLength:I},((X=B==null?void 0:B.input)==null?void 0:X.inputProps)||{}),G.inputProps||{})}:{}),{endAdornment:R})})},[B,v,I,G,R]),q=Rt(()=>l!=null?l:o!=null&&o.message?o.message:void 0,[l,o==null?void 0:o.message]);return bo(El,{fullWidth:p,error:!!o,disabled:i,required:f,sx:w,children:[xe(kl,g(r({},G),{name:e,label:a,type:Y?"text":"password",value:n,onChange:P,onFocus:F,onBlur:x,placeholder:b,variant:s,size:c,color:d,fullWidth:p,required:f,error:!!o,disabled:i,slotProps:k,slots:O,sx:A,ref:V,helperText:q})),u&&T(),o&&!l&&o.message&&xe(Fo,{children:o.message}),!o&&l&&xe(Fo,{children:l})]})}));xo.displayName="PasswordField";var Ee=xo;import{Controller as Al}from"react-hook-form";import{memo as zl,useMemo as yo}from"react";import{jsx as vo}from"react/jsx-runtime";var Co=zl(l=>{var i=l,{name:e,label:a,control:n,errors:t,size:F,defaultValue:x="",onChange:m}=i,o=y(i,["name","label","control","errors","size","defaultValue","onChange"]);let b=yo(()=>{var c;return t!=null&&t[e]?{message:String(((c=t[e])==null?void 0:c.message)||"")}:null},[t,e]),s=yo(()=>{var c,d;return(c=t==null?void 0:t[e])!=null&&c.message?String((d=t[e])==null?void 0:d.message):void 0},[t,e]);return vo(Al,{name:e,control:n,defaultValue:x,render:({field:c})=>{var u;let f=o,{size:d}=f,p=y(f,["size"]);return vo(Ee,g(r({},p),{name:e,label:a,value:(u=c.value)!=null?u:"",onChange:v=>{c.onChange(v),m==null||m(v.target.value)},onBlur:c.onBlur,error:b,helperText:s,size:F!=null?F:d}))}})});Co.displayName="FormInputPasswordField";var et=Co;import{FormControl as Ol,InputAdornment as ho,TextField as Nl}from"@mui/material";import{forwardRef as Vl,useState as Wl,useEffect as Gl,useCallback as ql,memo as Kl,useMemo as Ie}from"react";import{jsx as Et}from"react/jsx-runtime";var de=e=>e.replace(/\D/g,""),Io=(e,a)=>{if(!a||!e)return e;let n="",t=0;for(let F=0;F<a.length&&t<e.length;F++)a[F]==="X"?(n+=e[t],t++):n+=a[F];return n},Xl=e=>e?e.replace(/X/g,"0"):"",$l=e=>{let a=de(e);return a.length<=3?a:a.length<=6?`(${a.slice(0,3)}) ${a.slice(3)}`:`(${a.slice(0,3)}) ${a.slice(3,6)}-${a.slice(6,10)}`},Ul=e=>{var t;let a=e.replace(/\D/g,"");return(((t=a.match(/.{1,4}/g))==null?void 0:t.join(" "))||a).slice(0,19)},Po=(e,a=!0)=>{let n=e.replace(/[^\d.]/g,"");if(!a)return n.replace(/\D/g,"");let t=n.split(".");return t.length>2?t[0]+"."+t.slice(1).join(""):t.length===2&&t[1].length>2?t[0]+"."+t[1].slice(0,2):n},Yl=e=>{let a=e.replace(/\D/g,"");return a.length<=3?a:a.length<=5?`${a.slice(0,3)}-${a.slice(3)}`:`${a.slice(0,3)}-${a.slice(3,5)}-${a.slice(5,9)}`},_l=e=>{let a=e.replace(/\D/g,"");return a.length<=5?a:`${a.slice(0,5)}-${a.slice(5,9)}`},Zl=e=>e.replace(/\D/g,"").slice(0,3),To=Kl(Vl((Y,W)=>{var _=Y,{name:e,label:a,value:n,onChange:t,onFocus:F,onBlur:x,onEnterPress:m,error:o,helperText:l,disabled:i=!1,placeholder:b,variant:s="outlined",size:c,color:d="primary",fullWidth:p=!0,required:f,pattern:u="integer",customPattern:v,customFormatter:I,min:E,max:S,step:L,allowDecimals:M=!0,decimalPlaces:H=2,startAdornment:A,endAdornment:w,inputStyles:B,formControlStyles:O,slotProps:G,slots:V}=_,N=y(_,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","pattern","customPattern","customFormatter","min","max","step","allowDecimals","decimalPlaces","startAdornment","endAdornment","inputStyles","formControlStyles","slotProps","slots"]);let[K,Z]=Wl(n),T=typeof u=="string"&&u.includes("X"),P=T?u:void 0,R=T?void 0:u,k=ql(U=>{if(!U)return"";if(P){let oe=de(U);return Io(oe,P)}switch(R){case"phone":return $l(U);case"credit-card":return Ul(U);case"currency":return Po(U,M);case"ssn":return Yl(U);case"zip-code":return _l(U);case"percentage":return Zl(U);case"decimal":return Po(U,M);case"integer":return de(U);case"custom":return I?I(U):de(U);default:return de(U)}},[P,R,M,I,v]);Gl(()=>{let U=k(n);Z(oe=>oe!==U?U:oe)},[n,k]);let q=(U,oe)=>{if(["Backspace","Delete","Tab","Escape","Enter"].includes(oe)||oe==="a"||oe==="c"||oe==="v"||oe==="x"||(R==="decimal"||R==="currency")&&M&&oe===".")return!0;if(!/^\d$/.test(oe))return!1;if(P){let ne=(P.match(/X/g)||[]).length;return de(U).length<ne}if(R==="custom"&&v){let ne=U+oe;return v.test(ne)}return!0},X=U=>{let oe=U.target.value,ne=k(oe);Z(ne);let ie=P?de(oe):ne,ue=g(r({},U),{target:g(r({},U.target),{value:ie}),currentTarget:g(r({},U.currentTarget),{value:ie})});t&&t(ue)},J=U=>{if(i)return;U.preventDefault();let oe=U.clipboardData.getData("text"),ne=de(oe),ie=P?(P.match(/X/g)||[]).length:void 0,ue=ie?ne.slice(0,ie):ne,Vt=P?Io(ue,P):k(ue);Z(Vt);let j=g(r({},U),{target:g(r({},U.target),{value:ue}),currentTarget:g(r({},U.currentTarget),{value:ue})});t&&t(j)},C=U=>{let oe=U.currentTarget.querySelector("input");if(!oe)return;let ne=oe.value||"",ie=U.key;if(["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(ie)){ie==="Enter"&&m&&m(K),N.onKeyDown&&N.onKeyDown(U);return}if(U.ctrlKey||U.metaKey){N.onKeyDown&&N.onKeyDown(U);return}if(!q(ne,ie)){U.preventDefault();return}N.onKeyDown&&N.onKeyDown(U)},h=Ie(()=>r({min:E,max:S,step:L,inputMode:R==="phone"?"tel":R==="decimal"||R==="currency"?"decimal":"numeric",maxLength:P?P.length:void 0},N.inputProps||{}),[E,S,L,R,P,N]),D=Ie(()=>A?Et(ho,{position:"start",children:A}):void 0,[A]),z=Ie(()=>w?Et(ho,{position:"end",children:w}):void 0,[w]),$=Ie(()=>g(r({},G),{input:r(r(g(r({},G==null?void 0:G.input),{inputProps:h}),D&&{startAdornment:D}),z&&{endAdornment:z})}),[G,h,D,z]),Q=Ie(()=>R==="phone"?"tel":"text",[R]),re=Ie(()=>b||(P?Xl(P):b),[b,P]),ge=Ie(()=>l!=null?l:o!=null&&o.message?o.message:void 0,[l,o==null?void 0:o.message]);return Et(Ol,{error:!!o,disabled:i,required:f,fullWidth:p,sx:O,children:Et(Nl,g(r({},N),{name:e,label:a,value:K,onChange:X,onFocus:F,onBlur:x,onKeyDown:C,onPaste:J,placeholder:re,variant:s,size:c,color:d,fullWidth:p,required:f,error:!!o,disabled:i,type:Q,autoComplete:"off",slotProps:$,slots:V,sx:B,ref:W,helperText:ge}))})}));To.displayName="NumberField";var Se=To;import{Controller as Jl}from"react-hook-form";import{memo as Ql,useMemo as Ro}from"react";import{jsx as Eo}from"react/jsx-runtime";var So=Ql(d=>{var p=d,{name:e,label:a,control:n,errors:t,pattern:F,min:x,max:m,step:o,allowDecimals:l,decimalPlaces:i,defaultValue:b="",onChange:s}=p,c=y(p,["name","label","control","errors","pattern","min","max","step","allowDecimals","decimalPlaces","defaultValue","onChange"]);let f=Ro(()=>{var v;return t!=null&&t[e]?{message:String(((v=t[e])==null?void 0:v.message)||"")}:null},[t,e]),u=Ro(()=>{var v,I;return(v=t==null?void 0:t[e])!=null&&v.message?String((I=t[e])==null?void 0:I.message):void 0},[t,e]);return Eo(Jl,{name:e,control:n,defaultValue:b,render:({field:v})=>{var L;let S=c,{size:I}=S,E=y(S,["size"]);return Eo(Se,g(r({},E),{name:e,label:a,value:(L=v.value)!=null?L:"",onChange:M=>{v.onChange(M),s==null||s(M.target.value)},onBlur:v.onBlur,pattern:F,min:x,max:m,step:o,allowDecimals:l,decimalPlaces:i,size:I,error:f,helperText:u}))}})});So.displayName="FormInputNumberField";var tt=So;import{FormControl as jl,InputAdornment as Wt,TextField as er}from"@mui/material";import{forwardRef as tr,useState as or,useEffect as nr,useRef as lr,memo as rr,useCallback as Gt,useMemo as De}from"react";import{jsx as ot}from"react/jsx-runtime";var St=e=>e.replace(/\D/g,""),qt=(e,a)=>{if(!a||!e)return e;let n="",t=0;for(let F=0;F<a.length&&t<e.length;F++)a[F]==="X"?(n+=e[t],t++):n+=a[F];return n},ar=e=>e?e.replace(/X/g,"0"):"0000000000",Do=rr(tr((V,G)=>{var N=V,{name:e,label:a,value:n,onChange:t,onFocus:F,onBlur:x,onEnterPress:m,error:o,helperText:l,disabled:i=!1,placeholder:b,variant:s="outlined",size:c,color:d="primary",fullWidth:p=!0,required:f,pattern:u="XXXXXXXXXX",maxLength:v,countryCode:I="+1",showCountryCode:E=!1,startAdornment:S,endAdornment:L,inputStyles:M,formControlStyles:H,countryCodeStyles:A,slotProps:w,slots:B}=N,O=y(N,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","pattern","maxLength","countryCode","showCountryCode","startAdornment","endAdornment","inputStyles","formControlStyles","countryCodeStyles","slotProps","slots"]);let[W,Y]=or(""),_=lr(null),K=v||(u?u.length:15);nr(()=>{let h=St(n),D=u?qt(h,u):h;Y(z=>z!==D?D:z),_.current&&setTimeout(()=>{if(_.current){let z=D.length;_.current.setSelectionRange(z,z)}},0)},[n,u]);let Z=Gt(h=>{if(i)return;let D=h.target.value,z=St(D),$=K?z.slice(0,K):z,Q=u?qt($,u):$;Y(Q);let re=g(r({},h),{target:g(r({},h.target),{value:$}),currentTarget:g(r({},h.currentTarget),{value:$})});t&&t(re)},[i,K,u,t]),T=Gt(h=>{if(i)return;h.preventDefault();let D=h.clipboardData.getData("text"),z=St(D),$=K?z.slice(0,K):z,Q=u?qt($,u):$;Y(Q);let re=g(r({},h),{target:g(r({},h.target),{value:$}),currentTarget:g(r({},h.currentTarget),{value:$})});t&&t(re)},[i,K,u,t]),P=Gt(h=>{if(i)return;let D=h.key,z=/[0-9]/.test(D),$=D==="Backspace"||D==="Delete"||D==="Tab"||D==="Escape"||D==="Enter"||D==="ArrowLeft"||D==="ArrowRight"||D==="ArrowUp"||D==="ArrowDown"||D==="Home"||D==="End"||(h.ctrlKey||h.metaKey)&&(D==="a"||D==="c"||D==="v"||D==="x");if(!z&&!$){h.preventDefault();return}D==="Enter"&&m&&m(St(W)),O.onKeyDown&&O.onKeyDown(h)},[i,m,W,O.onKeyDown]),R=De(()=>r({maxLength:K,inputMode:"tel",autoComplete:"tel"},O.inputProps||{}),[K,O]),k=De(()=>E?ot(Wt,{position:"start",sx:A,children:I}):S?ot(Wt,{position:"start",children:S}):void 0,[E,A,I,S]),q=De(()=>L?ot(Wt,{position:"end",children:L}):void 0,[L]),X=De(()=>g(r({},w),{input:r(r(g(r({},w==null?void 0:w.input),{inputProps:R}),k&&{startAdornment:k}),q&&{endAdornment:q})}),[w,R,k,q]),J=De(()=>b||(u?ar(u):""),[b,u]),C=De(()=>l!=null?l:o!=null&&o.message?o.message:void 0,[l,o==null?void 0:o.message]);return ot(jl,{error:!!o,disabled:i,required:f,fullWidth:p,sx:H,children:ot(er,g(r({},O),{name:e,label:a,value:W,onChange:Z,onFocus:F,onBlur:x,onKeyDown:P,onPaste:T,placeholder:J,variant:s,size:c,color:d,fullWidth:p,required:f,error:!!o,disabled:i,type:"tel",autoComplete:"tel",slotProps:X,slots:B,sx:M,ref:G,inputRef:_,helperText:C}))})}));Do.displayName="TeliField";var ke=Do;import{Controller as ir}from"react-hook-form";import{memo as sr,useMemo as ko}from"react";import{jsx as wo}from"react/jsx-runtime";var Lo=sr(o=>{var l=o,{name:e,label:a,control:n,errors:t,defaultValue:F="",onChange:x}=l,m=y(l,["name","label","control","errors","defaultValue","onChange"]);let i=ko(()=>{var s;return t!=null&&t[e]?{message:String(((s=t[e])==null?void 0:s.message)||"")}:null},[t,e]),b=ko(()=>{var s,c;return(s=t==null?void 0:t[e])!=null&&s.message?String((c=t[e])==null?void 0:c.message):void 0},[t,e]);return wo(ir,{name:e,control:n,defaultValue:F,render:({field:s})=>{var f;let p=m,{size:c}=p,d=y(p,["size"]);return wo(ke,g(r({},d),{name:e,label:a,value:(f=s.value)!=null?f:"",onChange:u=>{s.onChange(u),x==null||x(u.target.value)},onBlur:s.onBlur,size:c,error:i,helperText:b}))}})});Lo.displayName="FormInputTelField";var nt=Lo;import{Close as ur,Search as mr}from"@mui/icons-material";import{FormControl as pr,IconButton as Bo,InputAdornment as dr,TextField as cr}from"@mui/material";import{forwardRef as fr,useEffect as Fr,useRef as Kt,memo as gr,useCallback as we,useMemo as Mo}from"react";import{jsx as Le,jsxs as br}from"react/jsx-runtime";var Ho=gr(fr((K,_)=>{var Z=K,{name:e,label:a,value:n,onChange:t,onFocus:F,onBlur:x,onSearch:m,onClear:o,onEnterPress:l,error:i,helperText:b,disabled:s=!1,placeholder:c,variant:d="outlined",size:p,color:f="primary",fullWidth:u=!0,required:v,showClearButton:I=!0,showSearchButton:E=!0,clearIcon:S,searchIcon:L,clearButtonProps:M,searchButtonProps:H,enableDebounce:A=!0,debounceDelay:w=300,enableThrottle:B=!1,throttleDelay:O=300,inputStyles:G,formControlStyles:V,slotProps:N,slots:W}=Z,Y=y(Z,["name","label","value","onChange","onFocus","onBlur","onSearch","onClear","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","showClearButton","showSearchButton","clearIcon","searchIcon","clearButtonProps","searchButtonProps","enableDebounce","debounceDelay","enableThrottle","throttleDelay","inputStyles","formControlStyles","slotProps","slots"]);let T=Kt(null),P=Kt(null),R=Kt(0);Fr(()=>()=>{T.current&&clearTimeout(T.current),P.current&&clearTimeout(P.current)},[]);let k=we($=>{T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{m&&m($)},w)},[m,w]),q=we($=>{let Q=Date.now(),re=Q-R.current;re>=O?(R.current=Q,m&&m($)):(P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{R.current=Date.now(),m&&m($)},O-re))},[m,O]),X=we($=>{let Q=$.target.value;t&&t($),m&&(A&&!B?k(Q):B&&!A?q(Q):A&&B?k(Q):m(Q))},[t,m,A,B,k,q]),J=we(()=>{T.current&&(clearTimeout(T.current),T.current=null),P.current&&(clearTimeout(P.current),P.current=null),o&&o(),m&&m(""),t&&t({target:{value:"",name:e||""},currentTarget:{value:"",name:e||""}})},[o,m,t,e,T,P]),C=we(()=>{T.current&&(clearTimeout(T.current),T.current=null),P.current&&(clearTimeout(P.current),P.current=null),m&&m(n)},[m,n,T,P]),h=we($=>{$.key==="Enter"&&(T.current&&(clearTimeout(T.current),T.current=null),P.current&&(clearTimeout(P.current),P.current=null),l&&l(n),m&&m(n)),Y.onKeyDown&&Y.onKeyDown($)},[l,m,n,T,P,Y.onKeyDown]),D=Mo(()=>br(dr,{position:"end",children:[I&&n&&Le(Bo,g(r({onClick:J,disabled:s,edge:"end",size:p},M),{children:S||Le(ur,{})})),E&&Le(Bo,g(r({onClick:C,disabled:s,edge:"end",size:p},H),{children:L||Le(mr,{})}))]}),[I,n,J,s,p,M,S,E,C,H,L]),z=Mo(()=>b!=null?b:i!=null&&i.message?i.message:void 0,[b,i==null?void 0:i.message]);return Le(pr,{error:!!i,disabled:s,required:v,fullWidth:u,sx:V,children:Le(cr,g(r({},Y),{name:e,label:a,value:n,onChange:X,onFocus:F,onBlur:x,onKeyDown:h,placeholder:c,variant:d,size:p,color:f,fullWidth:u,required:v,error:!!i,disabled:s,slotProps:g(r({},N),{input:g(r({},N==null?void 0:N.input),{endAdornment:D})}),slots:W,sx:G,ref:_,helperText:z}))})}));Ho.displayName="SearchField";var Be=Ho;import{Controller as xr}from"react-hook-form";import{memo as yr,useMemo as Ao}from"react";import{jsx as zo}from"react/jsx-runtime";var Oo=yr(o=>{var l=o,{name:e,label:a,control:n,errors:t,defaultValue:F="",onChange:x}=l,m=y(l,["name","label","control","errors","defaultValue","onChange"]);let i=Ao(()=>{var s;return t!=null&&t[e]?{message:String(((s=t[e])==null?void 0:s.message)||"")}:null},[t,e]),b=Ao(()=>{var s,c;return(s=t==null?void 0:t[e])!=null&&s.message?String((c=t[e])==null?void 0:c.message):void 0},[t,e]);return zo(xr,{name:e,control:n,defaultValue:F,render:({field:s})=>{var f;let p=m,{size:c}=p,d=y(p,["size"]);return zo(Be,g(r({},d),{name:e,label:a,value:(f=s.value)!=null?f:"",onChange:u=>{s.onChange(u),x==null||x(u.target.value)},onBlur:s.onBlur,size:c,error:i,helperText:b}))}})});Oo.displayName="FormInputSearchField";var lt=Oo;import{FormControl as vr,FormHelperText as No,TextField as Cr,Box as Vo}from"@mui/material";import{forwardRef as hr,useState as Ir,useRef as Me,useEffect as Dt}from"react";import{jsx as rt,jsxs as Wo}from"react/jsx-runtime";var Go=hr((O,B)=>{var G=O,{name:e,label:a,value:n,onChange:t,onComplete:F,onFocus:x,onBlur:m,onEnterPress:o,error:l,helperText:i,disabled:b=!1,variant:s="outlined",size:c,color:d="primary",fullWidth:p=!0,required:f,length:u=6,spacing:v=1,autoFocus:I=!1,autoSubmit:E=!1,containerStyles:S,inputStyles:L,formControlStyles:M,slotProps:H,slots:A}=G,w=y(G,["name","label","value","onChange","onComplete","onFocus","onBlur","onEnterPress","error","helperText","disabled","variant","size","color","fullWidth","required","length","spacing","autoFocus","autoSubmit","containerStyles","inputStyles","formControlStyles","slotProps","slots"]);let[V,N]=Ir(Array(u).fill("")),W=Me([]),Y=Me(""),_=Me(!1),K=Me(Array(u).fill("")),Z=Me(!1),T=Me(null);Dt(()=>{K.current=V},[V]),Dt(()=>{let C=K.current.join("");if(Z.current){if(n===Y.current)return;let h=C,D=n||"";if(h===D&&h.length>0||D.length===h.length&&D===Y.current)return}if(!(_.current&&(_.current=!1,n===Y.current))&&n!==C)if(n){let h=n.split("").slice(0,u),D=[...h,...Array(u-h.length).fill("")];N(D)}else N(Array(u).fill(""))},[n,u]),Dt(()=>{I&&W.current[0]&&W.current[0].focus()},[I]),Dt(()=>()=>{T.current&&clearTimeout(T.current)},[]);let P=(C,h)=>{if(b)return;let D=h.target.value;if(D===""){R(C,"",!1);return}let z=D.slice(-1);/^\d$/.test(z)&&R(C,z,!0)},R=(C,h,D=!0)=>{let z=[...V];z[C]=h,_.current=!0,Z.current=!0,T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{Z.current=!1},500),N(z);let $=z.join("");Y.current=$,t&&t($),h&&C<u-1&&D&&setTimeout(()=>{var Q;(Q=W.current[C+1])==null||Q.focus()},0),z.every(Q=>Q!=="")&&(F&&F($),E&&o&&o($))},k=(C,h)=>{var z,$,Q;if(b)return;let D=h.key;if(D==="Backspace"){V[C]===""&&C>0?((z=W.current[C-1])==null||z.focus(),R(C-1,"",!1)):R(C,"",!1),h.preventDefault();return}if(D==="Delete"){R(C,"",!1),h.preventDefault();return}if(D==="ArrowLeft"&&C>0){($=W.current[C-1])==null||$.focus(),h.preventDefault();return}if(D==="ArrowRight"&&C<u-1){(Q=W.current[C+1])==null||Q.focus(),h.preventDefault();return}if(D==="Enter"&&o){let re=V.join("");o(re);return}(h.ctrlKey||h.metaKey)&&D==="v"||/^\d$/.test(D)||["Tab","Escape","Home","End"].includes(D)||h.preventDefault()},q=(C,h)=>{var oe;if(b)return;h.preventDefault();let z=h.clipboardData.getData("text").replace(/\D/g,"").slice(0,u);if(z.length===0)return;let $=[...V],Q=C;for(let ne=0;ne<z.length&&Q+ne<u;ne++)$[Q+ne]=z[ne];N($);let re=$.join("");t&&t(re);let ge=$.findIndex(ne=>ne===""),U=ge!==-1?ge:Math.min(Q+z.length,u-1);(oe=W.current[U])==null||oe.focus(),$.every(ne=>ne!=="")&&(F&&F(re),E&&o&&o(re))},X=(C,h)=>{h.target.select(),x&&x(h)},J=(C,h)=>{m&&m(h)};return Wo(vr,{error:!!l,disabled:b,required:f,fullWidth:p,sx:M,children:[a&&Wo(Vo,{component:"label",sx:{mb:1,display:"block"},children:[a,f&&rt("span",{style:{color:"error.main"},children:" *"})]}),rt(Vo,{ref:B,sx:r({display:"flex",gap:v,justifyContent:"flex-start"},S),children:V.map((C,h)=>{var D;return rt(Cr,r({inputRef:z=>{W.current[h]=z},name:e?`${e}-${h}`:void 0,value:C,onChange:z=>P(h,z),onKeyDown:z=>k(h,z),onPaste:z=>q(h,z),onFocus:z=>X(h,z),onBlur:z=>J(h,z),variant:s,size:c,color:d,error:!!l,disabled:b,required:f,slotProps:g(r({},H),{input:g(r({},H==null?void 0:H.input),{inputProps:r({maxLength:1,inputMode:"numeric",pattern:"[0-9]*",style:{textAlign:"center",fontSize:c==="small"?"1rem":"1.25rem",fontWeight:"bold"}},((D=H==null?void 0:H.input)==null?void 0:D.inputProps)||{})})}),slots:A,sx:r({width:c==="small"?"40px":"48px"},L)},w),h)})}),l&&rt(No,{children:i!=null?i:l!=null&&l.message?l.message:""}),!l&&i&&rt(No,{children:i})]})});Go.displayName="OTPField";var He=Go;import{Controller as Pr}from"react-hook-form";import{memo as Tr,useMemo as qo}from"react";import{jsx as Ko}from"react/jsx-runtime";var Xo=Tr(o=>{var l=o,{name:e,label:a,control:n,errors:t,defaultValue:F="",onChange:x}=l,m=y(l,["name","label","control","errors","defaultValue","onChange"]);let i=qo(()=>{var s;return t!=null&&t[e]?{message:String(((s=t[e])==null?void 0:s.message)||"")}:null},[t,e]),b=qo(()=>{var s,c;return(s=t==null?void 0:t[e])!=null&&s.message?String((c=t[e])==null?void 0:c.message):void 0},[t,e]);return Ko(Pr,{name:e,control:n,defaultValue:F,render:({field:s})=>{var f;let p=m,{size:c}=p,d=y(p,["size"]);return Ko(He,g(r({},d),{name:e,label:a,value:(f=s.value)!=null?f:"",onChange:u=>{s.onChange(u),x==null||x(u)},onBlur:s.onBlur,size:c,error:i,helperText:b}))}})});Xo.displayName="FormInputOTPField";var at=Xo;import{FormControl as Rr,FormHelperText as $o,InputLabel as Er,MenuItem as Sr,Select as Dr}from"@mui/material";import{forwardRef as kr}from"react";import{jsx as it,jsxs as wr}from"react/jsx-runtime";var Uo=kr((W,N)=>{var Y=W,{name:e,label:a,value:n,onChange:t,onOpen:F,onClose:x,options:m,error:o,helperText:l,disabled:i=!1,variant:b="outlined",size:s,color:c,fullWidth:d=!0,required:p,multiple:f=!1,icon:u,renderValue:v,renderMenuItem:I,menuItemStyles:E,selectStyles:S,formControlStyles:L,labelStyles:M,slotProps:H,slots:A,displayEmpty:w=!1,autoWidth:B=!1,native:O=!1,MenuProps:G}=Y,V=y(Y,["name","label","value","onChange","onOpen","onClose","options","error","helperText","disabled","variant","size","color","fullWidth","required","multiple","icon","renderValue","renderMenuItem","menuItemStyles","selectStyles","formControlStyles","labelStyles","slotProps","slots","displayEmpty","autoWidth","native","MenuProps"]);let _=R=>{var k;if(f&&Array.isArray(R))return R.length===0?"":R.map(q=>{var J;let X=m.find(C=>C.value===q);return(J=X==null?void 0:X.name)!=null?J:String(q)}).join(", ");if(!f&&R!==""&&R!==null&&R!==void 0){let q=m.find(X=>X.value===R);return(k=q==null?void 0:q.name)!=null?k:String(R)}return""},K=(R,k)=>{let q=typeof E=="function"?E(R,k):E;return it(Sr,{value:R.value,disabled:R.disabled,sx:q,children:I?I(R,k):R.name},`${R.value}-${k}`)},Z=(R,k)=>{t&&t(R,k)},T=a?`${e||"select"}-label`:void 0,P=a?`${e||"select"}-select`:void 0;return wr(Rr,{fullWidth:d,error:!!o,disabled:i,required:p,size:s,variant:b,sx:L,children:[a&&it(Er,{id:T,sx:M,children:a}),it(Dr,g(r({},V),{labelId:T,id:P,name:e,value:n,label:a,onChange:Z,onOpen:F,onClose:x,disabled:i,multiple:f,displayEmpty:w,autoWidth:B,native:O,MenuProps:G,IconComponent:u,renderValue:v!=null?v:_,slotProps:H,slots:A,sx:S,ref:N,children:m&&Array.isArray(m)&&m.map((R,k)=>K(R,k))})),o&&it($o,{children:l!=null?l:o!=null&&o.message?o.message:""}),!o&&l&&it($o,{children:l})]})});Uo.displayName="SelectInputField";var ce=Uo;import{Controller as Lr}from"react-hook-form";import{memo as Br,useMemo as Xt}from"react";import{jsx as Yo}from"react/jsx-runtime";var _o=Br(l=>{var i=l,{name:e,label:a,control:n,errors:t,options:F=[],defaultValue:x="",onChange:m}=i,o=y(i,["name","label","control","errors","options","defaultValue","onChange"]);let b=Xt(()=>{var d;return t!=null&&t[e]?{message:String(((d=t[e])==null?void 0:d.message)||"")}:null},[t,e]),s=Xt(()=>{var d,p;return(d=t==null?void 0:t[e])!=null&&d.message?String((p=t[e])==null?void 0:p.message):void 0},[t,e]),c=Xt(()=>F,[F]);return Yo(Lr,{name:e,control:n,defaultValue:x,render:({field:d})=>{var v;let u=o,{size:p}=u,f=y(u,["size"]);return Yo(ce,g(r({},f),{name:e,label:a,options:c,value:(v=d.value)!=null?v:"",onChange:I=>{d.onChange(I),m==null||m(I.target.value)},onBlur:d.onBlur,size:p,error:b,helperText:s}))}})});_o.displayName="FormInputSelect";var st=_o;import{Controller as Mr}from"react-hook-form";import{memo as Hr,useMemo as $t}from"react";import{jsx as Zo}from"react/jsx-runtime";var Jo=Hr(l=>{var i=l,{name:e,label:a,control:n,errors:t,options:F=[],defaultValue:x=[],onChange:m}=i,o=y(i,["name","label","control","errors","options","defaultValue","onChange"]);let b=$t(()=>{var d;return t!=null&&t[e]?{message:String(((d=t[e])==null?void 0:d.message)||"")}:null},[t,e]),s=$t(()=>{var d,p;return(d=t==null?void 0:t[e])!=null&&d.message?String((p=t[e])==null?void 0:p.message):void 0},[t,e]),c=$t(()=>F,[F]);return Zo(Mr,{name:e,control:n,defaultValue:x,render:({field:d})=>{let v=o,{size:p}=v,f=y(v,["size"]),u=Array.isArray(d.value)?d.value:[];return Zo(ce,g(r({},f),{name:e,label:a,options:c,multiple:!0,value:u,onChange:I=>{d.onChange(I),m==null||m(I.target.value)},onBlur:d.onBlur,size:p,error:b,helperText:s}))}})});Jo.displayName="FormInputMultiSelect";var ut=Jo;import{Autocomplete as Ar,FormControl as zr,FormHelperText as Or,TextField as Nr}from"@mui/material";import{forwardRef as Vr,memo as Wr,useCallback as kt,useMemo as Gr}from"react";import{jsx as Ut,jsxs as Kr}from"react/jsx-runtime";import{createElement as qr}from"react";var Qo=Wr(Vr((T,Z)=>{var P=T,{name:e,label:a,value:n,onChange:t,onInputChange:F,onOpen:x,onClose:m,options:o,error:l,helperText:i,disabled:b=!1,placeholder:s,variant:c="outlined",size:d,color:p,fullWidth:f=!0,required:u,getOptionLabel:v,isOptionEqualToValue:I,renderOption:E,popupIcon:S,inputStyles:L,autocompleteStyles:M,formControlStyles:H,loading:A=!1,loadingText:w="Loading...",noOptionsText:B="No options",filterOptions:O,autoHighlight:G=!0,autoSelect:V=!1,disablePortal:N=!1,disableListWrap:W=!1,slotProps:Y,slots:_}=P,K=y(P,["name","label","value","onChange","onInputChange","onOpen","onClose","options","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","getOptionLabel","isOptionEqualToValue","renderOption","popupIcon","inputStyles","autocompleteStyles","formControlStyles","loading","loadingText","noOptionsText","filterOptions","autoHighlight","autoSelect","disablePortal","disableListWrap","slotProps","slots"]);let R=kt(C=>{var h,D;return typeof C=="string"?C:(D=C==null?void 0:C.name)!=null?D:String((h=C==null?void 0:C.value)!=null?h:"")},[]),k=kt((C,h)=>(C==null?void 0:C.name)===(h==null?void 0:h.name)&&(C==null?void 0:C.value)===(h==null?void 0:h.value),[]),q=kt((C,h)=>qr("li",g(r({},C),{key:`${h.name}-${h.value}`}),h.name),[]),X=kt((C,h,D)=>{t&&t(C,h,D)},[t]),J=Gr(()=>i!=null?i:l!=null&&l.message?l.message:void 0,[i,l==null?void 0:l.message]);return Kr(zr,{fullWidth:f,error:!!l,sx:H,children:[Ut(Ar,g(r({},K),{options:o,value:n,onChange:X,onInputChange:F,onOpen:x,onClose:m,getOptionLabel:v!=null?v:R,isOptionEqualToValue:I!=null?I:k,renderOption:E!=null?E:q,disabled:b,loading:A,loadingText:w,noOptionsText:B,filterOptions:O,autoHighlight:G,autoSelect:V,disablePortal:N,disableListWrap:W,popupIcon:S,slotProps:Y,slots:_,sx:M,ref:Z,renderInput:C=>Ut(Nr,g(r({},C),{name:e,label:a,variant:c,size:d,color:p,placeholder:s,required:u,error:!!l,disabled:b,slotProps:{input:g(r({},C.InputProps),{inputProps:r({},C.inputProps)})},sx:L,helperText:J}))})),l&&!i&&l.message&&Ut(Or,{children:l.message})]})}));Qo.displayName="AutoCompleteField";var fe=Qo;import{Controller as Xr}from"react-hook-form";import{memo as $r,useMemo as Yt}from"react";import{jsx as jo}from"react/jsx-runtime";var en=$r(b=>{var s=b,{name:e,label:a,control:n,errors:t,options:F=[],disabled:x,placeholder:m,defaultValue:o=null,onChange:l}=s,i=y(s,["name","label","control","errors","options","disabled","placeholder","defaultValue","onChange"]);let c=Yt(()=>{var f;return t!=null&&t[e]?{message:String(((f=t[e])==null?void 0:f.message)||"")}:null},[t,e]),d=Yt(()=>{var f,u;return(f=t==null?void 0:t[e])!=null&&f.message?String((u=t[e])==null?void 0:u.message):void 0},[t,e]),p=Yt(()=>F,[F]);return jo(Xr,{name:e,control:n,defaultValue:o,render:({field:f})=>{let{value:u,onBlur:v}=f,S=i,{size:I}=S,E=y(S,["size"]);return jo(fe,g(r({},E),{name:e,label:a,placeholder:m,disabled:x,options:p,value:u!=null?u:null,onChange:(L,M)=>{f.onChange(M),l==null||l(M)},onBlur:v,size:I,error:c,helperText:d}))}})});en.displayName="FormInputAutoComplete";var mt=en;import{Controller as Ur}from"react-hook-form";import{memo as Yr,useMemo as _t}from"react";import{jsx as tn}from"react/jsx-runtime";var on=Yr(b=>{var s=b,{name:e,label:a,control:n,errors:t,options:F=[],disabled:x,placeholder:m,defaultValue:o=[],onChange:l}=s,i=y(s,["name","label","control","errors","options","disabled","placeholder","defaultValue","onChange"]);let c=_t(()=>{var f;return t!=null&&t[e]?{message:String(((f=t[e])==null?void 0:f.message)||"")}:null},[t,e]),d=_t(()=>{var f,u;return(f=t==null?void 0:t[e])!=null&&f.message?String((u=t[e])==null?void 0:u.message):void 0},[t,e]),p=_t(()=>F,[F]);return tn(Ur,{name:e,control:n,defaultValue:o,render:({field:f})=>{let{value:u,onBlur:v}=f,L=i,{size:I}=L,E=y(L,["size"]),S=Array.isArray(u)?u:[];return tn(fe,g(r({},E),{name:e,label:a,placeholder:m,disabled:x,options:p,multiple:!0,value:S,onChange:(M,H)=>{f.onChange(H),l==null||l(H)},onBlur:v,size:I,error:c,helperText:d}))}})});on.displayName="FormInputMultiAutoComplete";var pt=on;import{FormControl as _r,TextField as Zr,Box as Jr,InputAdornment as Qr}from"@mui/material";import{forwardRef as jr,useState as ea,useRef as nn,useEffect as ta,useCallback as wt,useMemo as Zt,memo as oa}from"react";import{jsx as Lt,jsxs as ra}from"react/jsx-runtime";var na=e=>/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e),la=e=>{let a=e.replace("#","");return a.length===3&&(a=a.split("").map(n=>n+n).join("")),"#"+a},ln=oa(jr((V,G)=>{var N=V,{name:e,label:a,value:n,onChange:t,onFocus:F,onBlur:x,onEnterPress:m,error:o,helperText:l,disabled:i=!1,placeholder:b="#000000",variant:s="outlined",size:c,color:d="primary",fullWidth:p=!0,required:f,format:u="hex",showPreview:v=!0,showNativeInput:I=!0,showPopoverPicker:E=!0,presetColors:S=["#000000","#FFFFFF","#FF0000","#00FF00","#0000FF","#FFFF00","#FF00FF","#00FFFF"],showPresetColors:L=!1,previewStyles:M,formControlStyles:H,inputStyles:A,slotProps:w,slots:B}=N,O=y(N,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","format","showPreview","showNativeInput","showPopoverPicker","presetColors","showPresetColors","previewStyles","formControlStyles","inputStyles","slotProps","slots"]);let[W,Y]=ea(n||"#000000"),_=nn(null),K=nn(null);ta(()=>{n!==void 0&&Y(n||"#000000")},[n]);let Z=na(W)?la(W):W||"#000000",T=wt(C=>{if(i)return;let h=C.target.value;Y(h),t&&t(h)},[t]),P=wt(C=>{if(i)return;C.stopPropagation();let h=C.target.value;Y(h),t&&t(h)},[t]),R=wt(C=>{i||(C.preventDefault(),C.stopPropagation(),_.current&&_.current.click())},[i,_]),k=wt(C=>{C.key==="Enter"&&m&&m(Z),O.onKeyDown&&O.onKeyDown(C)},[m,Z,O.onKeyDown]),q=Zt(()=>Lt(Qr,{position:"start",children:Lt(Jr,{ref:K,onClick:i?void 0:R,sx:r({width:c==="small"?24:32,height:c==="small"?24:32,borderRadius:1,border:"1px solid",borderColor:o?"error.main":"divider",backgroundColor:Z,cursor:i?"default":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s","&:hover":{opacity:i?1:.8}},M),title:i?void 0:"Click to open color picker"})}),[K,i,R,c,o,Z,M]),X=Zt(()=>{var C;return g(r({},w),{input:r(g(r({},w==null?void 0:w.input),{inputProps:r({},((C=w==null?void 0:w.input)==null?void 0:C.inputProps)||{})}),v&&{startAdornment:q})})},[w,v,q]),J=Zt(()=>l!=null?l:o!=null&&o.message?o.message:void 0,[l,o==null?void 0:o.message]);return ra(_r,{error:!!o,disabled:i,required:f,fullWidth:p,sx:H,children:[Lt(Zr,g(r({},O),{ref:G,name:e,label:a,value:Z,onChange:T,onFocus:F,onBlur:x,onKeyDown:k,placeholder:b,variant:s,size:c,color:d,fullWidth:p,required:f,error:!!o,disabled:i,slotProps:X,slots:B,sx:A,helperText:J})),Lt("input",{ref:_,type:"color",value:Z,onChange:P,disabled:i,style:{position:"absolute",width:0,height:0,opacity:0,pointerEvents:"none",visibility:"hidden"},"aria-hidden":"true"})]})}));ln.displayName="ColorPickerField";var Ae=ln;import{Controller as aa}from"react-hook-form";import{memo as ia,useMemo as rn}from"react";import{jsx as an}from"react/jsx-runtime";var sn=ia(o=>{var l=o,{name:e,label:a,control:n,errors:t,defaultValue:F="#000000",onChange:x}=l,m=y(l,["name","label","control","errors","defaultValue","onChange"]);let i=rn(()=>{var s;return t!=null&&t[e]?{message:String(((s=t[e])==null?void 0:s.message)||"")}:null},[t,e]),b=rn(()=>{var s,c;return(s=t==null?void 0:t[e])!=null&&s.message?String((c=t[e])==null?void 0:c.message):void 0},[t,e]);return an(aa,{name:e,control:n,defaultValue:F,render:({field:s})=>{var f;let p=m,{size:c}=p,d=y(p,["size"]);return an(Ae,g(r({},d),{name:e,label:a,value:(f=s.value)!=null?f:F,onChange:u=>{s.onChange(u),x==null||x(u)},onBlur:s.onBlur,size:c,error:i,helperText:b}))}})});sn.displayName="FormInputColorPicker";var dt=sn;import{Button as un,FormControl as sa,FormHelperText as ua,InputAdornment as ma,TextField as pa}from"@mui/material";import{CloudUpload as da}from"@mui/icons-material";import{forwardRef as ca,useRef as fa,useState as mn}from"react";import{jsx as Pe,jsxs as Jt}from"react/jsx-runtime";var pn=ca((P,T)=>{var R=P,{name:e,label:a,value:n,onChange:t,onFileSelect:F,onFileRemove:x,onValidationError:m,onDrop:o,error:l,helperText:i,disabled:b=!1,accept:s,multiple:c=!1,maxSize:d,minSize:p,allowedTypes:f,showPreview:u=!0,enableDragDrop:v=!1,placeholder:I="No file chosen",variant:E="outlined",size:S,color:L,fullWidth:M=!0,required:H,buttonText:A="Upload",buttonVariant:w="contained",buttonColor:B="primary",buttonSize:O,uploadIcon:G=Pe(da,{}),inputStyles:V,buttonStyles:N,formControlStyles:W,containerStyles:Y,slotProps:_,slots:K}=R,Z=y(R,["name","label","value","onChange","onFileSelect","onFileRemove","onValidationError","onDrop","error","helperText","disabled","accept","multiple","maxSize","minSize","allowedTypes","showPreview","enableDragDrop","placeholder","variant","size","color","fullWidth","required","buttonText","buttonVariant","buttonColor","buttonSize","uploadIcon","inputStyles","buttonStyles","formControlStyles","containerStyles","slotProps","slots"]);let k=fa(null),[q,X]=mn(!1),[,J]=mn(0),C=T&&typeof T=="object"&&"current"in T?T:k,h=()=>n?n instanceof File?n.name:Array.isArray(n)?n.length===0?"":n.length===1?n[0].name:`${n.length} files selected`:typeof n=="object"&&"name"in n?n.name:"":"",D=j=>{if(d&&j.size>d)return`File size exceeds maximum allowed size of ${z(d)}`;if(p&&j.size<p)return`File size is below minimum required size of ${z(p)}`;if(f&&f.length>0){let ae=j.type||$(j.name);if(!f.some(se=>se.startsWith(".")?j.name.toLowerCase().endsWith(se.toLowerCase()):ae.includes(se)||ae===se))return`File type not allowed. Allowed types: ${f.join(", ")}`}return null},z=j=>{if(j===0)return"0 Bytes";let ae=1024,be=["Bytes","KB","MB","GB"],se=Math.floor(Math.log(j)/Math.log(ae));return Math.round(j/Math.pow(ae,se)*100)/100+" "+be[se]},$=j=>j.slice((j.lastIndexOf(".")-1>>>0)+2),Q=j=>{let ae=j.target.files;if(!ae||ae.length===0){t&&t(void 0),F&&F(void 0);return}let be=Array.from(ae),se=[],to=!1;for(let Je of be){let oo=D(Je);oo?(to=!0,m&&m(oo)):se.push(Je)}if(se.length>0){let Je=c?se:se[0];t&&t(Je),F&&F(Je)}},re=()=>{var j;b||(j=C.current)==null||j.click()},ge=()=>{C.current&&(C.current.value=""),t&&t(void 0),x&&x()},U=j=>{j.preventDefault(),j.stopPropagation(),J(ae=>ae+1),j.dataTransfer.items&&j.dataTransfer.items.length>0&&X(!0)},oe=j=>{j.preventDefault(),j.stopPropagation(),J(ae=>{let be=ae-1;return be===0&&X(!1),be})},ne=j=>{j.preventDefault(),j.stopPropagation()},ie=j=>{if(j.preventDefault(),j.stopPropagation(),X(!1),J(0),b)return;let ae=j.dataTransfer.files;ae&&ae.length>0&&(o&&o(ae),Q({target:{files:ae}}))},ue=h(),Vt=u&&ue?ue:I;return Jt(sa,{error:!!l,disabled:b,required:H,fullWidth:M,sx:W,children:[Jt("div",{style:Y,onDragEnter:v?U:void 0,onDragLeave:v?oe:void 0,onDragOver:v?ne:void 0,onDrop:v?ie:void 0,children:[Pe("input",{type:"file",accept:s,multiple:c,name:e,id:e?`file-upload-${e}`:void 0,onChange:Q,style:{display:"none"},ref:C,disabled:b}),Pe(pa,g(r({},Z),{label:a,value:Vt,placeholder:I,variant:E,size:S,color:L,fullWidth:M,required:H,error:!!l,disabled:b,name:e,sx:V,slotProps:g(r({},_),{input:g(r({},_==null?void 0:_.input),{readOnly:!0,endAdornment:Jt(ma,{position:"end",children:[u&&ue&&Pe(un,{size:"small",onClick:ge,disabled:b,sx:{mr:1},children:"Clear"}),Pe(un,{variant:w,color:B,size:O||S,onClick:re,disabled:b,startIcon:G,sx:N,children:A})]})})}),slots:K,helperText:i!=null?i:l!=null&&l.message?l.message:void 0})),v&&q&&Pe("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.05)",border:"2px dashed",borderColor:"primary.main",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:"Drop files here"})]}),l&&!i&&l.message&&Pe(ua,{children:l.message})]})});pn.displayName="FileUploadField";var ze=pn;import{useRef as Fa,memo as ga,useMemo as dn}from"react";import{Controller as ba}from"react-hook-form";import{jsx as cn}from"react/jsx-runtime";var fn=ga(l=>{var i=l,{name:e,label:a,control:n,errors:t,size:F,defaultValue:x=null,onChange:m}=i,o=y(i,["name","label","control","errors","size","defaultValue","onChange"]);let b=Fa(null),s=dn(()=>{var d;return t!=null&&t[e]?{message:String(((d=t[e])==null?void 0:d.message)||"")}:null},[t,e]),c=dn(()=>{var d,p;return(d=t==null?void 0:t[e])!=null&&d.message?String((p=t[e])==null?void 0:p.message):void 0},[t,e]);return cn(ba,{name:e,control:n,defaultValue:x,render:({field:d})=>{var p;return cn(ze,g(r({},o),{name:e,label:a,value:(p=d.value)!=null?p:null,error:s,helperText:c,size:F,ref:b,onChange:f=>{d.onChange(f),m==null||m(f)},onBlur:d.onBlur}))}})});fn.displayName="FormInputFileUpload";var ct=fn;import{Box as xa,FormControl as ya,FormHelperText as Fn,FormLabel as va,IconButton as Ca}from"@mui/material";import{Clear as ha}from"@mui/icons-material";import{DatePicker as Ia,LocalizationProvider as Pa}from"@mui/x-date-pickers";import{AdapterDateFns as Ta}from"@mui/x-date-pickers/AdapterDateFns";import{forwardRef as Ra,useRef as Ea}from"react";import{jsx as ye,jsxs as Sa}from"react/jsx-runtime";var gn=Ra((z,D)=>{var $=z,{name:e,label:a,value:n,defaultValue:t,onChange:F,onFocus:x,onBlur:m,onViewChange:o,onMonthChange:l,onYearChange:i,onOpen:b,onClose:s,error:c,helperText:d,disabled:p=!1,fullWidth:f=!0,required:u,minDate:v,maxDate:I,shouldDisableDate:E,shouldDisableMonth:S,shouldDisableYear:L,size:M="medium",variant:H="outlined",color:A="primary",placeholder:w,readOnly:B=!1,showClearButton:O=!0,disablePast:G=!1,disableFuture:V=!1,referenceDate:N,view:W,format:Y,openTo:_="day",pickerStyles:K,formControlStyles:Z,formLabelStyles:T,containerStyles:P,textFieldStyles:R,slotProps:k,slots:q,dateAdapter:X=Ta,reduceAnimations:J=!1,autoFocus:C=!1}=$,h=y($,["name","label","value","defaultValue","onChange","onFocus","onBlur","onViewChange","onMonthChange","onYearChange","onOpen","onClose","error","helperText","disabled","fullWidth","required","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear","size","variant","color","placeholder","readOnly","showClearButton","disablePast","disableFuture","referenceDate","view","format","openTo","pickerStyles","formControlStyles","formLabelStyles","containerStyles","textFieldStyles","slotProps","slots","dateAdapter","reduceAnimations","autoFocus"]);let Q=Ea(null),re=ne=>{F&&F(ne)},ge=()=>{F&&F(null),Q.current&&Q.current.focus()},U=w||"MM/DD/YYYY",oe=g(r({},k),{textField:g(r({},k==null?void 0:k.textField),{error:!!c,size:M,variant:H,color:A,helperText:c?d!=null?d:c.message:d,fullWidth:f,placeholder:U,autoFocus:C,onFocus:x,onBlur:m,inputRef:D||Q,sx:r(r({},R),k!=null&&k.textField&&typeof k.textField=="object"&&"sx"in k.textField?k.textField.sx:{}),InputProps:g(r({},k!=null&&k.textField&&typeof k.textField=="object"&&"InputProps"in k.textField?k.textField.InputProps:{}),{endAdornment:O&&n?ye(Ca,{onClick:ge,size:"small",edge:"end",sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)"},"aria-label":"clear date",children:ye(ha,{fontSize:"small"})}):void 0})})});return Sa(ya,{error:!!c,disabled:p,required:u,fullWidth:f,sx:Z,children:[a&&ye(va,{sx:r({mb:1},T),children:a}),ye(xa,{ref:D,sx:r({},P),children:ye(Pa,{dateAdapter:X,children:ye(Ia,g(r({},h),{name:e,label:a,value:n,defaultValue:t,onChange:re,onViewChange:o,onMonthChange:l,onYearChange:i,onOpen:b,onClose:s,disabled:p,minDate:v,maxDate:I,shouldDisableDate:E,shouldDisableMonth:S,shouldDisableYear:L,disablePast:G,disableFuture:V,referenceDate:N,view:W,format:Y,openTo:_,reduceAnimations:J,slotProps:oe,slots:q,sx:K}))})}),c&&ye(Fn,{children:d!=null?d:c!=null&&c.message?c.message:""}),!c&&d&&ye(Fn,{children:d})]})});gn.displayName="DatePickerField";var Oe=gn;import{Controller as Da}from"react-hook-form";import{memo as ka,useMemo as bn}from"react";import{jsx as xn}from"react/jsx-runtime";var yn=ka(c=>{var d=c,{name:e,label:a,control:n,errors:t,size:F,readOnly:x,shouldDisableDate:m,disabled:o,placeholder:l,defaultValue:i=null,onChange:b}=d,s=y(d,["name","label","control","errors","size","readOnly","shouldDisableDate","disabled","placeholder","defaultValue","onChange"]);let p=bn(()=>{var u;return t!=null&&t[e]?{message:String(((u=t[e])==null?void 0:u.message)||"")}:null},[t,e]),f=bn(()=>{var u,v;return(u=t==null?void 0:t[e])!=null&&u.message?String((v=t[e])==null?void 0:v.message):void 0},[t,e]);return xn(Da,{name:e,control:n,defaultValue:i,render:({field:u})=>{var H;let M=s,{views:v,ampm:I,ampmInClock:E,timezone:S}=M,L=y(M,["views","ampm","ampmInClock","timezone"]);return xn(Oe,g(r({},L),{name:e,label:a,disabled:o,value:(H=u.value)!=null?H:null,onChange:A=>{u.onChange(A),b==null||b(A)},onBlur:u.onBlur,error:p,shouldDisableDate:m,helperText:f,size:F,placeholder:l,readOnly:x}))}})});yn.displayName="FormInputDatePicker";var ft=yn;import{Box as wa,FormControl as La,FormHelperText as vn,FormLabel as Ba,IconButton as Ma}from"@mui/material";import{Clear as Ha}from"@mui/icons-material";import{TimePicker as Aa,LocalizationProvider as za}from"@mui/x-date-pickers";import{AdapterDateFns as Oa}from"@mui/x-date-pickers/AdapterDateFns";import{forwardRef as Na,useRef as Va}from"react";import{jsx as ve,jsxs as Wa}from"react/jsx-runtime";var Cn=Na((J,X)=>{var C=J,{name:e,label:a,value:n,defaultValue:t,onChange:F,onFocus:x,onBlur:m,onViewChange:o,onOpen:l,onClose:i,error:b,helperText:s,disabled:c=!1,fullWidth:d=!0,required:p,minTime:f,maxTime:u,shouldDisableTime:v,size:I="medium",variant:E="outlined",color:S="primary",placeholder:L,readOnly:M=!1,showClearButton:H=!0,disablePast:A=!1,disableFuture:w=!1,ampm:B=!0,views:O,view:G,openTo:V="hours",format:N,pickerStyles:W,formControlStyles:Y,formLabelStyles:_,containerStyles:K,textFieldStyles:Z,slotProps:T,slots:P,dateAdapter:R=Oa,autoFocus:k=!1}=C,q=y(C,["name","label","value","defaultValue","onChange","onFocus","onBlur","onViewChange","onOpen","onClose","error","helperText","disabled","fullWidth","required","minTime","maxTime","shouldDisableTime","size","variant","color","placeholder","readOnly","showClearButton","disablePast","disableFuture","ampm","views","view","openTo","format","pickerStyles","formControlStyles","formLabelStyles","containerStyles","textFieldStyles","slotProps","slots","dateAdapter","autoFocus"]);let h=Va(null),D=re=>{F&&F(re)},z=()=>{F&&F(null),h.current&&h.current.focus()},$=L||(B?"hh:mm AM/PM":"hh:mm"),Q=g(r({},T),{textField:g(r({},T==null?void 0:T.textField),{error:!!b,size:I,variant:E,color:S,helperText:b?s!=null?s:b.message:s,fullWidth:d,placeholder:$,autoFocus:k,onFocus:x,onBlur:m,inputRef:X||h,sx:r(r({},Z),T!=null&&T.textField&&typeof T.textField=="object"&&"sx"in T.textField?T.textField.sx:{}),InputProps:g(r({},T!=null&&T.textField&&typeof T.textField=="object"&&"InputProps"in T.textField?T.textField.InputProps:{}),{endAdornment:H&&n?ve(Ma,{onClick:z,size:"small",edge:"end",sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)"},"aria-label":"clear time",children:ve(Ha,{fontSize:"small"})}):void 0})})});return Wa(La,{error:!!b,disabled:c,required:p,fullWidth:d,sx:Y,children:[a&&ve(Ba,{sx:r({mb:1},_),children:a}),ve(wa,{ref:X,sx:r({},K),children:ve(za,{dateAdapter:R,children:ve(Aa,g(r({},q),{name:e,label:a&&void 0,value:n,defaultValue:t,onChange:D,onViewChange:o,onOpen:l,onClose:i,disabled:c,minTime:f,maxTime:u,shouldDisableTime:v,disablePast:A,disableFuture:w,ampm:B,views:O,view:G,openTo:V,format:N,slotProps:Q,slots:P,sx:W}))})}),b&&ve(vn,{children:s!=null?s:b!=null&&b.message?b.message:""}),!b&&s&&ve(vn,{children:s})]})});Cn.displayName="TimePickerField";var Ne=Cn;import{Controller as Ga}from"react-hook-form";import{memo as qa,useMemo as hn}from"react";import{jsx as In}from"react/jsx-runtime";var Pn=qa(i=>{var b=i,{name:e,label:a,control:n,errors:t,ampm:F=!0,timezone:x,defaultValue:m=null,onChange:o}=b,l=y(b,["name","label","control","errors","ampm","timezone","defaultValue","onChange"]);let s=hn(()=>{var d;return t!=null&&t[e]?{message:String(((d=t[e])==null?void 0:d.message)||"")}:null},[t,e]),c=hn(()=>{var d,p;return(d=t==null?void 0:t[e])!=null&&d.message?String((p=t[e])==null?void 0:p.message):void 0},[t,e]);return In(Ga,{name:e,control:n,defaultValue:m,render:({field:d})=>{var v;let u=l,{size:p}=u,f=y(u,["size"]);return In(Ne,g(r({},f),{name:e,label:a,value:(v=d.value)!=null?v:null,onChange:I=>{d.onChange(I),o==null||o(I)},onBlur:d.onBlur,ampm:F,timezone:x,size:p,error:s,helperText:c}))}})});Pn.displayName="FormInputTimePicker";var Ft=Pn;import{Box as Ka,Button as Xa,FormControl as $a,FormHelperText as Tn,FormLabel as Ua,Stack as Ya}from"@mui/material";import{TimeClock as _a,LocalizationProvider as Za}from"@mui/x-date-pickers";import{AdapterDateFns as Ja}from"@mui/x-date-pickers/AdapterDateFns";import{forwardRef as Qa,useState as ja}from"react";import{jsx as Te,jsxs as Rn}from"react/jsx-runtime";var En=Qa((Z,K)=>{var T=Z,{name:e,label:a,value:n,defaultValue:t,onChange:F,error:x,helperText:m,disabled:o=!1,fullWidth:l=!1,required:i,views:b=["hours","minutes"],ampmInClock:s=!1,ampm:c=!0,disablePast:d=!1,disableFuture:p=!1,minTime:f,maxTime:u,shouldDisableTime:v,clockStyles:I,formControlStyles:E,formLabelStyles:S,containerStyles:L,buttonsStackStyles:M,buttonStyles:H,activeButtonStyles:A,showViewButtons:w=!0,initialView:B="hours",view:O,onViewChange:G,slotProps:V,slots:N,dateAdapter:W=Ja,autoFocus:Y=!1}=T,_=y(T,["name","label","value","defaultValue","onChange","error","helperText","disabled","fullWidth","required","views","ampmInClock","ampm","disablePast","disableFuture","minTime","maxTime","shouldDisableTime","clockStyles","formControlStyles","formLabelStyles","containerStyles","buttonsStackStyles","buttonStyles","activeButtonStyles","showViewButtons","initialView","view","onViewChange","slotProps","slots","dateAdapter","autoFocus"]);let[P,R]=ja(B),k=O!=null?O:P,q=G!=null?G:R,X=C=>{F&&F(C)},J=C=>{q(C)};return Rn($a,{error:!!x,disabled:o,required:i,fullWidth:l,sx:E,children:[a&&Te(Ua,{sx:r({mb:1},S),children:a}),Rn(Ka,{ref:K,sx:r({},L),children:[w&&b&&b.length>1&&Te(Ya,{direction:"row",justifyContent:"center",spacing:1,sx:r({mt:1,mb:1},M),children:b.map(C=>Te(Xa,{size:"small",variant:k===C?"contained":"outlined",onClick:()=>J(C),disabled:o,sx:k===C?r(r({},H),A):H,children:C},C))}),Te(Za,{dateAdapter:W,children:Te(_a,g(r({},_),{value:n,defaultValue:t,onChange:X,view:k,onViewChange:J,disabled:o,views:b,ampmInClock:s,ampm:c,disablePast:d,disableFuture:p,minTime:f,maxTime:u,shouldDisableTime:v,autoFocus:Y,slotProps:V,slots:N,sx:I}))})]}),x&&Te(Tn,{children:m!=null?m:x!=null&&x.message?x.message:""}),!x&&m&&Te(Tn,{children:m})]})});En.displayName="TimeClockField";var Ve=En;import{Box as ei,FormHelperText as ti,FormLabel as oi}from"@mui/material";import{Controller as ni}from"react-hook-form";import{memo as li,useMemo as Bt}from"react";import{jsx as Mt,jsxs as ri}from"react/jsx-runtime";var Sn=li(d=>{var p=d,{name:e,label:a,control:n,errors:t,readOnly:F,disabled:x,ampm:m=!0,views:o,ampmInClock:l=!0,disablePast:i=!1,defaultValue:b=null,onChange:s}=p,c=y(p,["name","label","control","errors","readOnly","disabled","ampm","views","ampmInClock","disablePast","defaultValue","onChange"]);let f=Bt(()=>{var E;return t!=null&&t[e]?{message:String(((E=t[e])==null?void 0:E.message)||"")}:null},[t,e]),u=Bt(()=>{var E,S;return(E=t==null?void 0:t[e])!=null&&E.message?String((S=t[e])==null?void 0:S.message):""},[t,e]),v=Bt(()=>!!(t!=null&&t[e]),[t,e]),I=Bt(()=>typeof m=="boolean"?m:void 0,[m]);return ri(ei,{sx:{border:E=>`1px solid ${E.palette.grey[600]}`,borderRadius:E=>E.spacing(.5),display:"flex",flexDirection:"column"},children:[Mt(oi,{sx:E=>({borderBottom:`1px solid ${E.palette.grey[600]}`,padding:S=>S.spacing(1)}),children:a}),Mt(ni,{name:e,control:n,defaultValue:b,render:({field:E})=>{var S;return Mt(Ve,g(r({},c),{name:e,value:(S=E.value)!=null?S:null,onChange:L=>{E.onChange(L),s==null||s(L)},ampm:I,disabled:x,readOnly:F,ampmInClock:l,disablePast:i,views:o,error:f}))}}),v&&Mt(ti,{sx:{color:"error.main",mt:1},children:u})]})});Sn.displayName="FormInputTimeClock";var gt=Sn;import{Box as ai,FormControl as ii,FormHelperText as Dn,FormLabel as si}from"@mui/material";import{DateCalendar as ui,LocalizationProvider as mi}from"@mui/x-date-pickers";import{AdapterDateFns as pi}from"@mui/x-date-pickers/AdapterDateFns";import{forwardRef as di}from"react";import{jsx as We,jsxs as ci}from"react/jsx-runtime";var kn=di((Y,W)=>{var _=Y,{name:e,label:a,value:n,defaultValue:t,onChange:F,onViewChange:x,onMonthChange:m,onYearChange:o,error:l,helperText:i,disabled:b=!1,fullWidth:s=!1,required:c,minDate:d,maxDate:p,shouldDisableDate:f,shouldDisableMonth:u,shouldDisableYear:v,calendarStyles:I,formControlStyles:E,formLabelStyles:S,containerStyles:L,slotProps:M,slots:H,dateAdapter:A=pi,showDaysOutsideCurrentMonth:w=!1,disablePast:B=!1,disableFuture:O=!1,referenceDate:G,view:V}=_,N=y(_,["name","label","value","defaultValue","onChange","onViewChange","onMonthChange","onYearChange","error","helperText","disabled","fullWidth","required","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear","calendarStyles","formControlStyles","formLabelStyles","containerStyles","slotProps","slots","dateAdapter","showDaysOutsideCurrentMonth","disablePast","disableFuture","referenceDate","view"]);let K=Z=>{F&&F(Z)};return ci(ii,{error:!!l,disabled:b,required:c,fullWidth:s,sx:E,children:[a&&We(si,{sx:r({mb:1},S),children:a}),We(ai,{ref:W,sx:r({},L),children:We(mi,{dateAdapter:A,children:We(ui,g(r({},N),{value:n,defaultValue:t,onChange:K,onViewChange:x,onMonthChange:m,onYearChange:o,disabled:b,minDate:d,maxDate:p,shouldDisableDate:f,shouldDisableMonth:u,shouldDisableYear:v,showDaysOutsideCurrentMonth:w,disablePast:B,disableFuture:O,referenceDate:G,view:V,slotProps:M,slots:H,sx:I}))})}),l&&We(Dn,{children:i!=null?i:l!=null&&l.message?l.message:""}),!l&&i&&We(Dn,{children:i})]})});kn.displayName="DateCalendarField";var Ge=kn;import{Box as fi,FormHelperText as Fi,FormLabel as gi}from"@mui/material";import{Controller as bi}from"react-hook-form";import{memo as xi,useMemo as Qt}from"react";import{jsx as Ht,jsxs as yi}from"react/jsx-runtime";var wn=xi(i=>{var b=i,{name:e,label:a,control:n,errors:t,readOnly:F,disabled:x,defaultValue:m=null,onChange:o}=b,l=y(b,["name","label","control","errors","readOnly","disabled","defaultValue","onChange"]);let s=Qt(()=>{var p;return t!=null&&t[e]?{message:String(((p=t[e])==null?void 0:p.message)||"")}:null},[t,e]),c=Qt(()=>{var p,f;return(p=t==null?void 0:t[e])!=null&&p.message?String((f=t[e])==null?void 0:f.message):""},[t,e]),d=Qt(()=>!!(t!=null&&t[e]),[t,e]);return yi(fi,{sx:{border:p=>`1px solid ${p.palette.grey[600]}`,borderRadius:p=>p.spacing(.5),display:"flex",flexDirection:"column"},children:[Ht(gi,{sx:p=>({borderBottom:`1px solid ${p.palette.grey[600]}`,padding:f=>f.spacing(1)}),children:a}),Ht(bi,{name:e,control:n,defaultValue:m,render:({field:p})=>{var I;let v=l,{views:f}=v,u=y(v,["views"]);return Ht(Ge,g(r({},u),{name:e,value:(I=p.value)!=null?I:null,onChange:E=>{p.onChange(E),o==null||o(E)},disabled:x,readOnly:F,error:s,sx:r({height:"300px"},u.sx)}))}}),d&&Ht(Fi,{sx:{color:"error.main",mt:1},children:c})]})});wn.displayName="FormInputCalendar";var bt=wn;import{Checkbox as vi,FormControl as Ci,FormControlLabel as hi,FormHelperText as Ln}from"@mui/material";import{forwardRef as Ii}from"react";import{jsx as At,jsxs as Pi}from"react/jsx-runtime";var Bn=Ii((w,A)=>{var B=w,{name:e,label:a,value:n,onChange:t,onClick:F,onFocus:x,onBlur:m,error:o,helperText:l,disabled:i=!1,color:b="primary",size:s,fullWidth:c=!1,required:d,labelPlacement:p="end",checkedIcon:f,icon:u,indeterminate:v=!1,checkboxStyles:I,labelStyles:E,formControlStyles:S,slotProps:L,slots:M}=B,H=y(B,["name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","checkedIcon","icon","indeterminate","checkboxStyles","labelStyles","formControlStyles","slotProps","slots"]);let O=(V,N)=>{t&&t(N)},G=V=>{F&&F(V)};return Pi(Ci,{error:!!o,disabled:i,required:d,fullWidth:c,size:s==="large"?"medium":s,sx:S,children:[At(hi,{control:At(vi,g(r({},H),{checked:n,indeterminate:v,onChange:O,onClick:G,onFocus:x,onBlur:m,disabled:i,color:b,size:s,checkedIcon:f,icon:u,name:e,slotProps:L,slots:M,sx:I,ref:A})),label:a,labelPlacement:p,sx:E}),o&&At(Ln,{children:l!=null?l:o!=null&&o.message?o.message:""}),!o&&l&&At(Ln,{children:l})]})});Bn.displayName="CheckboxField";var qe=Bn;import{Controller as Ti}from"react-hook-form";import{memo as Ri,useMemo as Mn}from"react";import{jsx as Hn}from"react/jsx-runtime";var An=Ri(o=>{var l=o,{name:e,label:a,control:n,errors:t,defaultValue:F=!1,onChange:x}=l,m=y(l,["name","label","control","errors","defaultValue","onChange"]);let i=Mn(()=>{var s;return t!=null&&t[e]?{message:String(((s=t[e])==null?void 0:s.message)||"")}:null},[t,e]),b=Mn(()=>{var s,c;return(s=t==null?void 0:t[e])!=null&&s.message?String((c=t[e])==null?void 0:c.message):void 0},[t,e]);return Hn(Ti,{name:e,control:n,defaultValue:F,render:({field:s})=>{var f;let p=m,{size:c}=p,d=y(p,["size"]);return Hn(qe,g(r({},d),{name:e,label:a,value:(f=s.value)!=null?f:!1,onChange:u=>{s.onChange(u),x==null||x(u)},onBlur:s.onBlur,size:c,error:i,helperText:b}))}})});An.displayName="FormInputCheckBox";var xt=An;import{FormControl as Ei,FormHelperText as zn,FormLabel as Si,Checkbox as Di,FormControlLabel as ki,Box as wi}from"@mui/material";import{forwardRef as Li}from"react";import{jsx as Ke,jsxs as Bi}from"react/jsx-runtime";var On=Li((N,V)=>{var W=N,{name:e,label:a,value:n,options:t,onChange:F,onFocus:x,onBlur:m,onClick:o,error:l,helperText:i,disabled:b=!1,fullWidth:s=!0,required:c,color:d="primary",size:p,labelPlacement:f="end",row:u=!1,checkedIcon:v,icon:I,checkboxStyles:E,labelStyles:S,formControlStyles:L,formLabelStyles:M,renderCheckbox:H,slotProps:A,slots:w,formLabelProps:B,formControlLabelProps:O}=W,G=y(W,["name","label","value","options","onChange","onFocus","onBlur","onClick","error","helperText","disabled","fullWidth","required","color","size","labelPlacement","row","checkedIcon","icon","checkboxStyles","labelStyles","formControlStyles","formLabelStyles","renderCheckbox","slotProps","slots","formLabelProps","formControlLabelProps"]);let Y=P=>R=>{if(b)return;let k=R.target.checked,q;k?q=[...n,P]:q=n.filter(X=>X!==P),F&&F(q)},_=P=>R=>{x&&x(R,P)},K=P=>R=>{m&&m(R,P)},Z=P=>R=>{o&&o(R,P)},T=(P,R,k,q)=>Ke(ki,r({control:Ke(Di,{name:e?`${e}-${P.value}`:void 0,checked:k,onChange:q,onFocus:_(P.value),onBlur:K(P.value),onClick:Z(P.value),disabled:b||P.disabled,color:d,size:p,checkedIcon:v,icon:I,slotProps:A==null?void 0:A.checkbox,slots:w==null?void 0:w.checkbox,sx:E}),label:P.label,labelPlacement:f,slotProps:A==null?void 0:A.formControlLabel,sx:S},O),`${P.value}-${R}`);return Bi(Ei,g(r({},G),{error:!!l,disabled:b,required:c,fullWidth:s,component:"fieldset",sx:L,children:[a&&Ke(Si,g(r({component:"legend",sx:M},B),{children:a})),Ke(wi,{ref:V,sx:{display:"flex",flexDirection:u?"row":"column",flexWrap:u?"wrap":"nowrap",gap:1,mt:a?1:0},children:t.map((P,R)=>{let k=n.includes(P.value),q=Y(P.value);return H?H(P,R,k,q):T(P,R,k,q)})}),l&&Ke(zn,{children:i!=null?i:l!=null&&l.message?l.message:""}),!l&&i&&Ke(zn,{children:i})]}))});On.displayName="CheckboxFieldGroup";var Xe=On;import{Controller as Mi}from"react-hook-form";import{memo as Hi,useMemo as jt}from"react";import{jsx as Nn}from"react/jsx-runtime";var Vn=Hi(s=>{var c=s,{name:e,label:a,control:n,errors:t,options:F=[],defaultValue:x=[],onChange:m,row:o,color:l,labelPlacement:i}=c,b=y(c,["name","label","control","errors","options","defaultValue","onChange","row","color","labelPlacement"]);let d=jt(()=>F.map(u=>({value:u.value,label:u.name,disabled:u.disabled})),[F]),p=jt(()=>{var u;return t!=null&&t[e]?{message:String(((u=t[e])==null?void 0:u.message)||"")}:null},[t,e]),f=jt(()=>{var u,v;return(u=t==null?void 0:t[e])!=null&&u.message?String((v=t[e])==null?void 0:v.message):void 0},[t,e]);return Nn(Mi,{name:e,control:n,defaultValue:x,render:({field:u})=>{let S=b,{size:v}=S,I=y(S,["size"]),E=Array.isArray(u.value)?u.value:[];return Nn(Xe,g(r({},I),{name:e,label:a,value:E,options:d,onChange:L=>{u.onChange(L),m==null||m(L)},onBlur:u.onBlur,row:o,color:l,labelPlacement:i,size:v,error:p,helperText:f}))}})});Vn.displayName="FormInputCheckBoxGroup";var yt=Vn;import{FormControl as Wn,FormControlLabel as Ai,FormHelperText as Gn,Switch as zi}from"@mui/material";import{forwardRef as Oi}from"react";import{jsx as zt,jsxs as qn}from"react/jsx-runtime";var Kn=Oi((A,H)=>{var w=A,{name:e,label:a,value:n,onChange:t,onClick:F,onFocus:x,onBlur:m,error:o,helperText:l,disabled:i=!1,color:b="primary",size:s,fullWidth:c=!1,required:d,labelPlacement:p="end",edge:f,switchStyles:u,labelStyles:v,formControlStyles:I,slotProps:E,slots:S,formControlLabelProps:L}=w,M=y(w,["name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","edge","switchStyles","labelStyles","formControlStyles","slotProps","slots","formControlLabelProps"]);let B=(V,N)=>{t&&t(N)},O=V=>{F&&F(V)},G=zt(zi,g(r({},M),{checked:n,onChange:B,onClick:O,onFocus:x,onBlur:m,disabled:i,color:b,size:s,edge:f,name:e,slotProps:E,slots:S,sx:u,ref:H}));return a?qn(Wn,{error:!!o,disabled:i,required:d,fullWidth:c,size:s,sx:r({display:"flex",flexDirection:"column"},I),children:[zt(Ai,r({control:G,label:a,labelPlacement:p,disabled:i,sx:v},L)),(o||l)&&zt(Gn,{sx:{marginLeft:p==="start"?"72px":0,marginRight:0},children:o?l!=null?l:o!=null&&o.message?o.message:"":l})]}):qn(Wn,{error:!!o,disabled:i,required:d,fullWidth:c,sx:r({display:"inline-flex",flexDirection:"column"},I),children:[G,(o||l)&&zt(Gn,{sx:{marginLeft:0,marginRight:0},children:o?l!=null?l:o!=null&&o.message?o.message:"":l})]})});Kn.displayName="SwitchField";var $e=Kn;import{Controller as Ni}from"react-hook-form";import{memo as Vi,useMemo as Xn}from"react";import{jsx as $n}from"react/jsx-runtime";var Un=Vi(o=>{var l=o,{name:e,label:a,control:n,errors:t,defaultValue:F=!1,onChange:x}=l,m=y(l,["name","label","control","errors","defaultValue","onChange"]);let i=Xn(()=>{var s;return t!=null&&t[e]?{message:String(((s=t[e])==null?void 0:s.message)||"")}:null},[t,e]),b=Xn(()=>{var s,c;return(s=t==null?void 0:t[e])!=null&&s.message?String((c=t[e])==null?void 0:c.message):void 0},[t,e]);return $n(Ni,{name:e,control:n,defaultValue:F,render:({field:s})=>{var f;let p=m,{size:c}=p,d=y(p,["size"]);return $n($e,g(r({},d),{name:e,label:a,value:(f=s.value)!=null?f:!1,onChange:u=>{s.onChange(u),x==null||x(u)},onBlur:s.onBlur,size:c,error:i,helperText:b}))}})});Un.displayName="FormInputSwitch";var vt=Un;import{FormControl as Wi,FormHelperText as Yn,FormLabel as Gi,Slider as qi}from"@mui/material";import{forwardRef as Ki}from"react";import{jsx as Ot,jsxs as Xi}from"react/jsx-runtime";var _n=Ki((N,V)=>{var W=N,{name:e,label:a,value:n,onChange:t,onChangeCommitted:F,onFocus:x,onBlur:m,error:o,helperText:l,disabled:i=!1,fullWidth:b=!0,required:s,orientation:c="horizontal",min:d=0,max:p=100,step:f=1,valueLabelDisplay:u="auto",valueLabelFormat:v,color:I="primary",size:E,marks:S,track:L="normal",sliderStyles:M,formControlStyles:H,formLabelStyles:A,slotProps:w,slots:B,formLabelProps:O}=W,G=y(W,["name","label","value","onChange","onChangeCommitted","onFocus","onBlur","error","helperText","disabled","fullWidth","required","orientation","min","max","step","valueLabelDisplay","valueLabelFormat","color","size","marks","track","sliderStyles","formControlStyles","formLabelStyles","slotProps","slots","formLabelProps"]);let Y=(Z,T,P)=>{t&&t(T)},_=(Z,T)=>{F&&F(T)},K=c==="vertical";return Xi(Wi,{error:!!o,disabled:i,required:s,fullWidth:b&&!K,sx:r(r({},H),K&&{display:"flex",flexDirection:"column",alignItems:"flex-start",height:"100%",width:"auto"}),children:[a&&Ot(Gi,g(r({sx:A},O),{children:a})),Ot(qi,g(r({},G),{name:e,value:n,onChange:Y,onChangeCommitted:_,onFocus:x,onBlur:m,orientation:c,min:d,max:p,step:f,valueLabelDisplay:u,valueLabelFormat:v,color:I,size:E,marks:S===!0?!0:S||!1,track:L,disabled:i,slotProps:w,slots:B,sx:r(r({},M),K&&{height:"100%","& .MuiSlider-track":{width:"6px"},"& .MuiSlider-rail":{width:"6px"}}),ref:V})),o&&Ot(Yn,{children:l!=null?l:o!=null&&o.message?o.message:""}),!o&&l&&Ot(Yn,{children:l})]})});_n.displayName="SliderField";var Ue=_n;import{Controller as $i}from"react-hook-form";import{memo as Ui,useMemo as Zn}from"react";import{jsx as Jn}from"react/jsx-runtime";var Qn=Ui(o=>{var l=o,{name:e,label:a,control:n,errors:t,defaultValue:F=0,onChange:x}=l,m=y(l,["name","label","control","errors","defaultValue","onChange"]);let i=Zn(()=>{var s;return t!=null&&t[e]?{message:String(((s=t[e])==null?void 0:s.message)||"")}:null},[t,e]),b=Zn(()=>{var s,c;return(s=t==null?void 0:t[e])!=null&&s.message?String((c=t[e])==null?void 0:c.message):void 0},[t,e]);return Jn($i,{name:e,control:n,defaultValue:F,render:({field:s})=>{var f;let p=m,{size:c}=p,d=y(p,["size"]);return Jn(Ue,g(r({},d),{name:e,label:a,value:(f=s.value)!=null?f:F,onChange:u=>{s.onChange(u),x==null||x(u)},onBlur:s.onBlur,size:c,error:i,helperText:b}))}})});Qn.displayName="FormInputSlider";var Ct=Qn;import{FormControl as Yi,FormControlLabel as _i,FormHelperText as jn,Radio as Zi}from"@mui/material";import{forwardRef as Ji}from"react";import{jsx as Nt,jsxs as Qi}from"react/jsx-runtime";var el=Ji((w,A)=>{var B=w,{name:e,label:a,value:n,onChange:t,onClick:F,onFocus:x,onBlur:m,error:o,helperText:l,disabled:i=!1,color:b="primary",size:s,fullWidth:c=!1,required:d,labelPlacement:p="end",checkedIcon:f,icon:u,radioStyles:v,labelStyles:I,formControlStyles:E,slotProps:S,slots:L,formControlLabelProps:M}=B,H=y(B,["name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","checkedIcon","icon","radioStyles","labelStyles","formControlStyles","slotProps","slots","formControlLabelProps"]);let O=(V,N)=>{t&&t(N)},G=V=>{F&&F(V)};return Qi(Yi,{error:!!o,disabled:i,required:d,fullWidth:c,size:s,sx:E,children:[Nt(_i,r({control:Nt(Zi,g(r({},H),{checked:n,onChange:O,onClick:G,onFocus:x,onBlur:m,disabled:i,color:b,size:s,checkedIcon:f,icon:u,name:e,slotProps:S,slots:L,sx:v,ref:A})),label:a,labelPlacement:p,sx:I},M)),o&&Nt(jn,{children:l!=null?l:o!=null&&o.message?o.message:""}),!o&&l&&Nt(jn,{children:l})]})});el.displayName="RadioButtonField";var Ye=el;import{Controller as ji}from"react-hook-form";import{memo as es,useMemo as tl}from"react";import{jsx as ol}from"react/jsx-runtime";var nl=es(b=>{var s=b,{name:e,label:a,control:n,errors:t,checked:F=!1,defaultValue:x=!1,onChange:m,color:o,labelPlacement:l}=s,i=y(s,["name","label","control","errors","checked","defaultValue","onChange","color","labelPlacement"]);let c=tl(()=>{var p;return t!=null&&t[e]?{message:String(((p=t[e])==null?void 0:p.message)||"")}:null},[t,e]),d=tl(()=>{var p,f;return(p=t==null?void 0:t[e])!=null&&p.message?String((f=t[e])==null?void 0:f.message):void 0},[t,e]);return ol(ji,{name:e,control:n,defaultValue:x,render:({field:p})=>{var I;let v=i,{size:f}=v,u=y(v,["size"]);return ol(Ye,g(r({},u),{name:e,label:a,value:(I=p.value)!=null?I:!1,onChange:E=>{p.onChange(E),m==null||m(E)},onBlur:p.onBlur,color:o,labelPlacement:l,size:f,error:c,helperText:d}))}})});nl.displayName="FormInputRadioButton";var ht=nl;import{FormControl as ts,FormControlLabel as os,FormHelperText as ll,FormLabel as ns,Radio as ls,RadioGroup as rs}from"@mui/material";import{forwardRef as as}from"react";import{jsx as _e,jsxs as is}from"react/jsx-runtime";var rl=as((W,N)=>{var Y=W,{name:e,label:a,value:n,onChange:t,onClick:F,onFocus:x,onBlur:m,options:o,error:l,helperText:i,disabled:b=!1,color:s="primary",size:c,fullWidth:d=!1,required:p,labelPlacement:f="end",row:u=!1,checkedIcon:v,icon:I,radioStyles:E,labelStyles:S,formControlStyles:L,formLabelStyles:M,radioGroupStyles:H,renderRadio:A,slotProps:w,slots:B,formLabelProps:O,formControlLabelProps:G}=Y,V=y(Y,["name","label","value","onChange","onClick","onFocus","onBlur","options","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","row","checkedIcon","icon","radioStyles","labelStyles","formControlStyles","formLabelStyles","radioGroupStyles","renderRadio","slotProps","slots","formLabelProps","formControlLabelProps"]);let _=T=>{var q;let P=T.target.value,R=(q=o.find(X=>String(X.value)===P))==null?void 0:q.value;t&&t(typeof R=="number"?R:P)},K=T=>{F&&F(T)},Z=T=>_e(os,g(r({value:String(T.value),control:_e(ls,{color:s,size:c,disabled:b||T.disabled,checkedIcon:v,icon:I,onClick:K,onFocus:x,onBlur:m,slotProps:w==null?void 0:w.radio,slots:B==null?void 0:B.radio,sx:E}),label:T.name,labelPlacement:f,disabled:b||T.disabled,sx:S},G),{slotProps:w==null?void 0:w.formControlLabel,slots:B==null?void 0:B.formControlLabel}),T.value);return is(ts,{component:"fieldset",error:!!l,disabled:b,required:p,fullWidth:d,sx:L,children:[a&&_e(ns,g(r({component:"legend",sx:M},O),{children:a})),_e(rs,g(r({name:e,value:n!=null?String(n):"",onChange:_,row:u,ref:N,sx:H},V),{children:o&&Array.isArray(o)&&o.map((T,P)=>A?A(T,P):Z(T))})),l&&_e(ll,{children:i!=null?i:l!=null&&l.message?l.message:""}),!l&&i&&_e(ll,{children:i})]})});rl.displayName="RadioButtonFieldGroup";var Ze=rl;import{Controller as ss}from"react-hook-form";import{memo as us,useMemo as eo}from"react";import{jsx as al}from"react/jsx-runtime";var il=us(l=>{var i=l,{name:e,label:a,control:n,errors:t,options:F=[],defaultValue:x="",onChange:m}=i,o=y(i,["name","label","control","errors","options","defaultValue","onChange"]);let b=eo(()=>{var d;return t!=null&&t[e]?{message:String(((d=t[e])==null?void 0:d.message)||"")}:null},[t,e]),s=eo(()=>{var d,p;return(d=t==null?void 0:t[e])!=null&&d.message?String((p=t[e])==null?void 0:p.message):void 0},[t,e]),c=eo(()=>Array.isArray(F)?F:[],[F]);return al(ss,{name:e,control:n,defaultValue:x,render:({field:d})=>{var v;let u=o,{size:p}=u,f=y(u,["size"]);return al(Ze,g(r({},f),{name:e,label:a,value:(v=d.value)!=null?v:"",onChange:I=>{d.onChange(I),m==null||m(I)},onBlur:d.onBlur,options:c,size:p,error:b,helperText:s}))}})});il.displayName="FormInputRadioButtonGroup";var It=il;import{useState as sl}from"react";import{Box as Fe,Paper as ms,Typography as ul,Button as ml,Divider as ps}from"@mui/material";import{jsx as te,jsxs as Ce}from"react/jsx-runtime";var ds=()=>{let[e,a]=sl({text:"",textarea:"",password:"",number:"",tel:"",search:"",otp:"",select:"",multiselect:[],autocomplete:null,multiautocomplete:[],color:"#000000",file:null,date:null,time:null,timeclock:null,calendar:null,checkbox:!1,checkboxgroup:[],switch:!1,slider:0,singleradio:!1,radiogroup:""}),[n,t]=sl({}),F=[{name:"Option 1",value:"opt1"},{name:"Option 2",value:"opt2"},{name:"Option 3",value:"opt3"}],x=[{value:"check1",label:"Checkbox 1"},{value:"check2",label:"Checkbox 2"},{value:"check3",label:"Checkbox 3"}],m=[{name:"Radio 1",value:"radio1"},{name:"Radio 2",value:"radio2"},{name:"Radio 3",value:"radio3"}],o=i=>b=>{a(s=>g(r({},s),{[i]:b})),n[i]&&t(s=>{let c=r({},s);return delete c[i],c})};return Ce(ms,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[te(ul,{variant:"h4",gutterBottom:!0,children:"Normal Form (Direct FormInputs)"}),te(ul,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"Using FormInputs directly with useState"}),te(ps,{sx:{my:2}}),te("form",{onSubmit:i=>{i.preventDefault(),console.log("Normal Form Data:",e);let b={};e.text||(b.text="Text is required"),e.password||(b.password="Password is required"),t(b)},children:Ce(Fe,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"repeat(3, 1fr)"},gap:2},children:[Ce(Fe,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[te(pe,{name:"text",label:"Text Field",value:e.text,onChange:i=>o("text")(i.target.value),error:n.text?{message:n.text}:null}),te(Ee,{name:"password",label:"Password",value:e.password,onChange:i=>o("password")(i.target.value),error:n.password?{message:n.password}:null})]}),te(pe,{name:"textarea",label:"Text Area",value:e.textarea,onChange:i=>o("textarea")(i.target.value),multiline:!0,rows:4}),Ce(Fe,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[te(Se,{name:"number",label:"Number",pattern:"credit-card",value:e.number,onChange:i=>o("number")(i.target.value)}),te(ke,{name:"tel",label:"Telephone",pattern:"XX-XXXX-XXXX",value:e.tel,onChange:i=>o("tel")(i.target.value)})]}),te(Be,{name:"search",label:"Search",value:e.search,onChange:i=>o("search")(i.target.value)}),te(He,{name:"otp",value:e.otp,onChange:o("otp"),length:6,spacing:2}),te(ce,{name:"select",label:"Select",value:e.select,onChange:i=>o("select")(i.target.value),options:F}),te(ce,{name:"multiselect",label:"Multi Select",value:e.multiselect,onChange:i=>o("multiselect")(i.target.value),options:F,multiple:!0}),te(fe,{name:"autocomplete",label:"Autocomplete",value:e.autocomplete,onChange:(i,b)=>o("autocomplete")(b),options:F}),te(fe,{name:"multiautocomplete",label:"Multi Autocomplete",value:e.multiautocomplete,onChange:(i,b)=>o("multiautocomplete")(b),options:F,multiple:!0}),te(Ae,{name:"color",label:"Color Picker",value:e.color,onChange:o("color")}),te(ze,{name:"file",label:"File Upload",value:e.file,onChange:o("file")}),te(Oe,{name:"date",value:e.date,onChange:o("date")}),Ce(Fe,{children:[te(Ne,{name:"time",value:e.time,onChange:o("time")}),Ce(Fe,{sx:{display:"grid",gridTemplateColumns:{md:"1fr 1fr"},gap:2,mt:2},children:[te(Xe,{name:"checkboxgroup",label:"Checkbox Group",value:e.checkboxgroup,onChange:o("checkboxgroup"),options:x}),te(Ze,{name:"radiogroup",label:"Radio Group",value:e.radiogroup,onChange:o("radiogroup"),options:m})]}),Ce(Fe,{sx:{display:"flex",gap:2,mt:2},children:[te(qe,{name:"checkbox",label:"Checkbox",value:e.checkbox,onChange:o("checkbox")}),te(Ye,{name:"singleradio",label:"Radio",value:e.singleradio,onChange:o("singleradio")}),te($e,{name:"switch",label:"Switch",value:e.switch,onChange:o("switch")})]})]}),te(Fe,{sx:{border:1,borderColor:"grey.300",borderRadius:1,p:2},children:te(Ve,{name:"timeclock",label:"Time Clock",value:e.timeclock,onChange:o("timeclock")})}),te(Fe,{sx:{border:1,borderColor:"grey.300",borderRadius:1,p:2},children:te(Ge,{name:"calendar",label:"Calendar",value:e.calendar,onChange:o("calendar")})}),te(Ue,{name:"slider",label:"Slider",value:e.slider,onChange:o("slider"),min:0,max:100}),Ce(Fe,{sx:{gridColumn:{xs:"1",md:"1 / -1"},display:"flex",gap:2,justifyContent:"flex-end"},children:[te(ml,{variant:"outlined",onClick:()=>a({text:"",textarea:"",password:"",number:"",tel:"",search:"",otp:"",select:"",multiselect:[],autocomplete:null,multiautocomplete:[],color:"#000000",file:null,date:null,time:null,timeclock:null,calendar:null,checkbox:!1,checkboxgroup:[],switch:!1,slider:0,singleradio:!1,radiogroup:""}),children:"Reset"}),te(ml,{type:"submit",variant:"contained",children:"Submit"})]})]})})]})},cs=ds;import{useForm as fs}from"react-hook-form";import{Box as me,Paper as Fs,Typography as pl,Button as dl,Divider as gs}from"@mui/material";import{jsx as ee,jsxs as he}from"react/jsx-runtime";var le="small",bs=()=>{let{control:e,handleSubmit:a,formState:{errors:n},reset:t}=fs({defaultValues:{text:"",textarea:"",password:"",number:"",tel:"",search:"",otp:"",select:"",multiselect:[],autocomplete:null,multiautocomplete:[],color:"#000000",file:null,date:null,time:null,timeclock:null,calendar:null,checkbox:!1,checkboxgroup:[],switch:!1,slider:0,singleradio:!1,radiogroup:""}}),F=[{name:"Option 1",value:"opt1"},{name:"Option 2",value:"opt2"},{name:"Option 3",value:"opt3"}],x=[{name:"Checkbox 1",value:"check1"},{name:"Checkbox 2",value:"check2"},{name:"Checkbox 3",value:"check3"}],m=[{name:"Radio 1",value:"radio1"},{name:"Radio 2",value:"radio2"},{name:"Radio 3",value:"radio3"}];return he(Fs,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[ee(pl,{variant:"h4",gutterBottom:!0,children:"React Hook Form (HookFormFields)"}),ee(pl,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"Using HookFormFields with react-hook-form"}),ee(gs,{sx:{my:2}}),ee("form",{onSubmit:a(l=>{console.log("React Hook Form Data:",l)}),children:he(me,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"repeat(3, 1fr)"},gap:2},children:[he(me,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[ee(Qe,{name:"text",label:"Text Field",control:e,errors:n,size:le}),ee(et,{name:"password",label:"Password",control:e,errors:n,size:le})]}),ee(je,{name:"textarea",label:"Text Area",control:e,errors:n,rows:4,size:le}),he(me,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[ee(tt,{name:"number",label:"Number",pattern:"zip-code",control:e,errors:n,size:le}),ee(nt,{name:"tel",label:"Telephone",pattern:"XX-XXX-XXXXXX-X-XX",control:e,errors:n,size:le})]}),ee(lt,{name:"search",label:"Search",control:e,errors:n,size:le}),ee(at,{name:"otp",control:e,errors:n,spacing:2,size:le}),ee(st,{name:"select",label:"Select",control:e,errors:n,options:F,size:le}),ee(ut,{name:"multiselect",label:"Multi Select",control:e,errors:n,options:F,size:le}),ee(mt,{name:"autocomplete",label:"Autocomplete",control:e,errors:n,options:F,size:le}),ee(pt,{name:"multiautocomplete",label:"Multi Autocomplete",control:e,errors:n,options:F,size:le}),ee(dt,{name:"color",label:"Color Picker",control:e,errors:n,size:le}),ee(ct,{name:"file",label:"File Upload",control:e,errors:n,size:le}),ee(ft,{name:"date",control:e,errors:n,size:le}),he(me,{children:[ee(Ft,{name:"time",control:e,errors:n,size:le}),he(me,{sx:{display:"grid",gridTemplateColumns:{md:"1fr 1fr"},gap:2,mt:2},children:[ee(yt,{name:"checkboxgroup",label:"Select Options",control:e,errors:n,options:x,size:le}),ee(It,{name:"radiogroup",label:"Radio Group",control:e,errors:n,options:m,size:le})]}),he(me,{sx:{display:"flex",gap:2,mt:2},children:[ee(xt,{name:"checkbox",label:"Checkbox",control:e,errors:n,size:le}),ee(ht,{name:"singleradio",label:"Radio",control:e,errors:n,size:le}),ee(vt,{name:"switch",label:"Switch",control:e,errors:n,size:le})]})]}),ee(me,{sx:{border:1,borderColor:"grey.300",borderRadius:1,p:2},children:ee(gt,{name:"timeclock",label:"Time Clock",control:e,errors:n,size:le})}),ee(me,{sx:{border:1,borderColor:"grey.300",borderRadius:1,p:2},children:ee(bt,{name:"calendar",label:"Calendar",control:e,errors:n,size:le})}),ee(me,{children:ee(Ct,{name:"slider",label:"Slider",control:e,errors:n,size:le})}),he(me,{sx:{gridColumn:{xs:"1",md:"1 / -1"},display:"flex",gap:2,justifyContent:"flex-end"},children:[ee(dl,{variant:"outlined",onClick:()=>t(),children:"Reset"}),ee(dl,{type:"submit",variant:"contained",children:"Submit"})]})]})})]})},xs=bs;var ys={FormInputTextField:Qe,FormInputTextArea:je,FormInputPasswordField:et,FormInputNumberField:tt,FormInputTelField:nt,FormInputSearchField:lt,FormInputOTPField:at,FormInputSelect:st,FormInputMultiSelect:ut,FormInputAutoComplete:mt,FormInputMultiAutoComplete:pt,FormInputColorPicker:dt,FormInputFileUpload:ct,FormInputDatePicker:ft,FormInputTimePicker:Ft,FormInputTimeClock:gt,FormInputCalendar:bt,FormInputCheckBox:xt,FormInputCheckBoxGroup:yt,FormInputSwitch:vt,FormInputSlider:Ct,FormInputSingleRadio:ht,FormInputRadioButtonGroup:It,TextInputField:pe,PasswordField:Ee,NumberField:Se,TelInputField:ke,SearchInputField:Be,OTPField:He,SelectInputField:ce,AutoCompleteField:fe,ColorPickerField:Ae,FileUploadField:ze,DatePickerField:Oe,TimePickerField:Ne,TimeClockField:Ve,DateCalendarField:Ge,CheckBoxField:qe,CheckBoxFieldGroup:Xe,RadioButtonField:Ye,RadioButtonFieldGroup:Ze,SwitchField:$e,SliderField:Ue},Qf=ys;export{fe as AutoCompleteField,qe as CheckBoxField,Xe as CheckBoxFieldGroup,Ae as ColorPickerField,Ge as DateCalendarField,Oe as DatePickerField,cs as DemoForm,xs as DemoHookForm,ze as FileUploadField,mt as FormInputAutoComplete,bt as FormInputCalendar,xt as FormInputCheckBox,yt as FormInputCheckBoxGroup,dt as FormInputColorPicker,ft as FormInputDatePicker,ct as FormInputFileUpload,pt as FormInputMultiAutoComplete,ut as FormInputMultiSelect,tt as FormInputNumberField,at as FormInputOTPField,et as FormInputPasswordField,It as FormInputRadioButtonGroup,lt as FormInputSearchField,st as FormInputSelect,ht as FormInputSingleRadio,Ct as FormInputSlider,vt as FormInputSwitch,nt as FormInputTelField,je as FormInputTextArea,Qe as FormInputTextField,gt as FormInputTimeClock,Ft as FormInputTimePicker,Se as NumberField,He as OTPField,Ee as PasswordField,Ye as RadioButtonField,Ze as RadioButtonFieldGroup,Be as SearchInputField,ce as SelectInputField,Ue as SliderField,$e as SwitchField,ke as TelInputField,pe as TextInputField,Ve as TimeClockField,Ne as TimePickerField,Qf as default};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|