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