@applica-software-guru/react-admin 1.1.111 → 1.1.112
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/react-admin.cjs.js +1 -1
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +1281 -1281
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +1 -1
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ra-fields/ReferenceManyField.jsx +2 -2
package/dist/react-admin.cjs.js
CHANGED
|
@@ -199,7 +199,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
199
199
|
animation: ${0} 1.4s linear infinite;
|
|
200
200
|
`),Hk)),Yk=ce("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),Gk=ce("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Te(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>W({stroke:"currentColor"},e.variant==="determinate"&&{transition:t.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&Kt.css(mE||(mE=zc`
|
|
201
201
|
animation: ${0} 1.4s ease-in-out infinite;
|
|
202
|
-
`),zk)),jB=N.forwardRef(function(t,n){const r=_t({props:t,name:"MuiCircularProgress"}),{className:i,color:a="primary",disableShrink:l=!1,size:u=40,style:A,thickness:f=3.6,value:p=0,variant:C="indeterminate"}=r,h=Ge(r,Vk),E=W({},r,{color:a,disableShrink:l,size:u,thickness:f,value:p,variant:C}),I=Wk(E),B={},v={},S={};if(C==="determinate"){const M=2*Math.PI*((to-f)/2);B.strokeDasharray=M.toFixed(3),S["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*M).toFixed(3)}px`,v.transform="rotate(-90deg)"}return g.jsx(Uk,W({className:Je(I.root,i),style:W({width:u,height:u},v,A),ownerState:E,ref:n,role:"progressbar"},S,h,{children:g.jsx(Yk,{className:I.svg,ownerState:E,viewBox:`${to/2} ${to/2} ${to} ${to}`,children:g.jsx(Gk,{className:I.circle,style:B,ownerState:E,cx:to,cy:to,r:(to-f)/2,fill:"none",strokeWidth:f})})}))});process.env.NODE_ENV!=="production"&&(jB.propTypes={classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","primary","secondary","error","info","success","warning"]),c.string]),disableShrink:Wr(c.bool,e=>e.disableShrink&&e.variant&&e.variant!=="indeterminate"?new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect."):null),size:c.oneOfType([c.number,c.string]),style:c.object,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),thickness:c.number,value:c.number,variant:c.oneOf(["determinate","indeterminate"])});const kB=jB;function Kk(e){return zt("MuiLoadingButton",e)}const qk=qt("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),Or=qk,_k=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],Jk=e=>{const{loading:t,loadingPosition:n,classes:r}=e,i={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Te(n)}`],endIcon:[t&&`endIconLoading${Te(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Te(n)}`]},a=Cr.unstable_composeClasses(i,Kk,r);return W({},r,a)},Xk=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",Zk=ce(Lk,{shouldForwardProp:e=>Xk(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Or.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Or.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>W({[`& .${Or.startIconLoadingStart}, & .${Or.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},e.loadingPosition==="center"&&{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${Or.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Or.startIconLoadingStart}, & .${Or.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Or.startIconLoadingStart}, & .${Or.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),$k=ce("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Te(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>W({position:"absolute",visibility:"visible",display:"flex"},t.loadingPosition==="start"&&(t.variant==="outlined"||t.variant==="contained")&&{left:t.size==="small"?10:14},t.loadingPosition==="start"&&t.variant==="text"&&{left:6},t.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},t.loadingPosition==="end"&&(t.variant==="outlined"||t.variant==="contained")&&{right:t.size==="small"?10:14},t.loadingPosition==="end"&&t.variant==="text"&&{right:6},t.loadingPosition==="start"&&t.fullWidth&&{position:"relative",left:-10},t.loadingPosition==="end"&&t.fullWidth&&{position:"relative",right:-10})),FB=N.forwardRef(function(t,n){const r=_t({props:t,name:"MuiLoadingButton"}),{children:i,disabled:a=!1,id:l,loading:u=!1,loadingIndicator:A,loadingPosition:f="center",variant:p="text"}=r,C=Ge(r,_k),h=Xd(l),E=A??g.jsx(kB,{"aria-labelledby":h,color:"inherit",size:16}),I=W({},r,{disabled:a,loading:u,loadingIndicator:E,loadingPosition:f,variant:p}),B=Jk(I),v=u?g.jsx($k,{className:B.loadingIndicator,ownerState:I,children:E}):null;return g.jsxs(Zk,W({disabled:a||u,id:h,ref:n},C,{variant:p,classes:B,ownerState:I,children:[I.loadingPosition==="end"?i:v,I.loadingPosition==="end"?v:i]}))});process.env.NODE_ENV!=="production"&&(FB.propTypes={children:c.node,classes:c.object,disabled:c.bool,id:c.string,loading:c.bool,loadingIndicator:c.node,loadingPosition:Wr(c.oneOf(["start","end","center"]),e=>e.loadingPosition==="start"&&!e.startIcon?new Error('MUI: The loadingPosition="start" should be used in combination with startIcon.'):e.loadingPosition==="end"&&!e.endIcon?new Error('MUI: The loadingPosition="end" should be used in combination with endIcon.'):null),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["contained","outlined","text"]),c.string])});const e5=FB;function JA({variant:e,theme:t,color:n,loadingPosition:r}){const i=nn(t,n),{lighter:a,main:l,dark:u,contrastText:A}=i,f=`${n}Button`,p=Zi(t,f),C={"& .MuiLoadingButton-loadingIndicator":{color:l}},h={...r&&r!=="center"&&{color:l}},E={"&::after":{boxShadow:`0 0 6px 6px ${Ve(l,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${Ve(l,.9)}`},"&:focus-visible":{outline:`2px solid ${u}`,outlineOffset:2}};switch(e){case"contained":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...E};case"light":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...E};case"shadow":return{boxShadow:p,backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{boxShadow:"none",backgroundColor:u,color:A},...E};case"outlined":return{backgroundColor:"transparent",borderColor:l,...h,...C};case"dashed":return{backgroundColor:a,borderColor:l,...h,...C,...E};case"text":default:return{color:l,...C,...E}}}const t5=ce(e5,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:i,loadingPosition:a})=>({"::after":{content:'""',display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:n==="rounded"?"50%":4,opacity:0,transition:"all 0.5s"},":active::after":{position:"absolute",borderRadius:n==="rounded"?"50%":4,left:0,top:0,opacity:1,transition:"0s"},...t==="text"&&{...JA({variant:t,theme:e,color:r,loadingPosition:a}),"&.MuiButton-sizeMedium":{height:36},"&.MuiButton-sizeSmall":{height:30},"&.MuiButton-sizeLarge":{height:44}},...n&&{minWidth:0,"&.MuiButton-sizeMedium":{width:36,height:36},"&.MuiButton-sizeSmall":{width:30,height:30},"&.MuiButton-sizeLarge":{width:44,height:44},...n==="rounded"&&{borderRadius:"50%"}},...t==="outlined"&&{border:"1px solid"},...t==="dashed"&&{border:"1px dashed"},...(t==="contained"||t==="shadow")&&!i&&{color:"#fff"},...t!=="text"&&{...JA({variant:t,theme:e,color:r,loadingPosition:a})},"&.Mui-disabled":{...t!=="text"&&{...JA({variant:t,theme:e,color:r,loadingPosition:a})}}})),Yf=O.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...i},a)=>{const l=Tt();return g.jsx(t5,{ref:a,variant:e,shape:t,theme:l,loadingPosition:i.loadingPosition,loading:i.loading,color:r,...i,children:n})});Yf.propTypes={variant:c.string,shape:c.string,children:c.node,color:c.string};Yf.displayName="LoadingButton";function n5({color:e,theme:t,labelColor:n}){const r=nn(t,e),{main:i,contrastText:a}=r;let l=e||"";return["primary","secondary","info","success","warning","error"].includes(l)?{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:i,color:n||a},[`& .${b.tooltipClasses.arrow}`]:{color:i}}:{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:l,color:n||a,boxShadow:t.shadows[1]},[`& .${b.tooltipClasses.arrow}`]:{color:l}}}const r5=ce(({className:e,...t})=>g.jsx(b.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&n5({color:t,theme:e,labelColor:n})}));function LB({children:e,arrow:t,labelColor:n="",...r}){const i=Tt();return g.jsx(b.Box,{display:"flex",children:g.jsx(r5,{arrow:t,...r,theme:i,labelColor:n,children:e})})}LB.propTypes={children:c.element,arrow:c.bool,labelColor:c.string,rest:c.array};const Co=O.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...i},a)=>{let l={transformOrigin:"0 0 0"};switch(t){case"top-right":l={transformOrigin:"top right"};break;case"top":l={transformOrigin:"top"};break;case"bottom-left":l={transformOrigin:"bottom left"};break;case"bottom-right":l={transformOrigin:"bottom right"};break;case"bottom":l={transformOrigin:"bottom"};break;case"top-left":default:l={transformOrigin:"0 0 0"};break}return g.jsxs(b.Box,{ref:a,children:[n==="grow"&&g.jsx(b.Grow,{...i,timeout:{appear:0,enter:150,exit:150},children:g.jsx(b.Box,{sx:l,children:e})}),n==="collapse"&&g.jsx(b.Collapse,{...i,sx:l,children:e}),n==="fade"&&g.jsx(b.Fade,{...i,timeout:{appear:0,enter:300,exit:150},children:g.jsx(b.Box,{sx:l,children:e})}),n==="slide"&&g.jsx(b.Slide,{...i,timeout:{appear:0,enter:150,exit:150},direction:r,children:g.jsx(b.Box,{sx:l,children:e})}),n==="zoom"&&g.jsx(b.Zoom,{...i,children:g.jsx(b.Box,{sx:l,children:e})})]})});Co.propTypes={children:c.node,type:c.oneOf(["grow","fade","collapse","slide","zoom"]),position:c.oneOf(["top-left","top-right","top","bottom-left","bottom-right","bottom"]),direction:c.oneOf(["up","down","left","right"])};O.forwardRef(function(t,n){return g.jsx(b.Zoom,{ref:n,timeout:200,...t})});function NB({value:e,...t}){return g.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[g.jsx(b.CircularProgress,{variant:"determinate",value:e,...t}),g.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(e)}%`})})]})}NB.propTypes={value:c.number};function VB({value:e,size:t,variant:n,thickness:r,showLabel:i,pathColor:a,sx:l,...u}){return g.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[g.jsx(b.CircularProgress,{variant:"determinate",sx:{color:a||"grey.200"},size:t,thickness:r,...u,value:100}),i&&g.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:e?`${Math.round(e)}%`:"0%"})}),g.jsx(b.CircularProgress,{variant:n,sx:{...l,position:"absolute",left:0,[`& .${b.circularProgressClasses.circle}`]:{strokeLinecap:"round"}},size:t,thickness:r,value:e,...u})]})}VB.propTypes={value:c.number,size:c.number,variant:c.string,thickness:c.number,showLabel:c.bool,pathColor:c.string,sx:c.array,others:c.array};function HB({icon:e,value:t,...n}){return g.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[g.jsx(b.Box,{sx:{width:"100%",mr:1},children:g.jsx(b.LinearProgress,{variant:"determinate",value:t,...n})}),g.jsx(b.Box,{sx:{minWidth:35},children:e})]})}HB.propTypes={icon:c.node,value:c.number};function zB({value:e,...t}){return g.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[g.jsx(b.Box,{sx:{width:"100%",mr:1},children:g.jsx(b.LinearProgress,{variant:"determinate",value:e,...t})}),g.jsx(b.Box,{sx:{minWidth:35},children:g.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:`${Math.round(e)}%`})})]})}zB.propTypes={value:c.number};const WB=O.createContext({});function o5(e){const{useDefaults:t=!1}=e,n=R.useResourceContext(),r=R.useDataProvider(),{search:i}=Mr.useLocation(),a=`${n}/new`,l=O.useCallback(()=>{if(!t||!gt.isFunction(r.get))return Promise.resolve({});const p={};return new URLSearchParams(i??"").forEach((C,h)=>{p[h]=C}),r.get(a,p).then(C=>C.data).then(C=>{const{responseCode:h,value:E}=C;return h==="ok"?E:Promise.reject(C)})},[n,t,i,r]),{data:u,isLoading:A}=qd.useQuery({queryKey:[n,i],queryFn:l}),f=gt.omit(e,["useDefaults"]);return A?g.jsx(b.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:g.jsx(b.CircularProgress,{})}):g.jsx(WB.Provider,{value:u??{},children:g.jsx(R.Create,{...f})})}function i5(){return O.useContext(WB)}const s5=ce(o5,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"& .RaCreate-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaCreate-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),a5=_i(R.Toolbar,{name:"RaApplicaToolbar",slot:"Root"})(({theme:e})=>({...e.mixins.toolbar,backgroundColor:e.palette.background.paper,justifyContent:"flex-end","& .RaToolbar-defaultToolbar":{justifyContent:"right",paddingBottom:e.spacing(2),"& > *":{marginLeft:e.spacing(1)}},"& .MuiButtonBase-root":{marginLeft:e.spacing(1)}})),Yr=e=>g.jsx(a5,{...e});Yr.defaultProps={...R.Toolbar.defaultProps};Yr.propTypes={...R.Toolbar.propTypes};const Gf=({children:e,content:t,title:n,subheader:r,secondary:i,toolbar:a,...l})=>{const u=R.useTranslate(),A=R.useResourceContext(),{cardTitle:f,cardSubheader:p}=O.useMemo(()=>{const C=n||`resources.${A}.title`;return{cardTitle:u(C,{_:C}),cardSubheader:r!==null?u(r,{_:r}):null}},[A,r,n,u]);return g.jsx(b.Grid,{item:!0,...l,children:g.jsx(Yn,{content:t,title:f,subheader:p,secondary:i,divider:!0,children:g.jsxs(O.Fragment,{children:[e,a===!0?g.jsx(Yr,{children:g.jsx(R.SaveButton,{})}):a]})})})};Gf.defaultProps={...b.Grid.defaultProps,content:!0,subheader:null,title:null,secondary:null,toolbar:!1,item:!0,lg:12,md:12,sm:12,xs:12};Gf.propTypes={...b.Grid.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),contained:c.bool,content:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object]),spacing:c.number,toolbar:c.oneOfType([c.node,c.bool])};const l5=ce(R.Form,{name:"RaApplicaCardForm",slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*2),padding:0}})),Wc=({children:e,spacing:t,defaultValues:n,...r})=>{const{spacing:i}=Zn();return g.jsx(l5,{defaultValues:n,spacing:t||i,children:g.jsx(b.Grid,{container:!0,...r,spacing:t||i,children:e})})};Wc.propTypes={...b.Grid.propTypes,...R.Form.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),spacing:c.number,defaultValues:c.oneOfType([c.object,c.func]),record:c.object,validate:c.func};Wc.defaultProps={...b.Stack.defaultProps};Wc.Section=Gf;const c5=_i(R.SimpleForm,{name:"RaApplicaSimpleForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?2:1)}})),Uc=({title:e,modal:t,content:n,subheader:r,secondary:i,sx:a,...l})=>{const u=Z0(e),A=R.useRecordContext();return g.jsx(Yn,{content:n,title:u,subheader:r,secondary:A!=null&&A.id?i:null,sx:{...a,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!t,divider:!0,children:g.jsx(c5,{toolbar:g.jsx(Yr,{}),...l})})};Uc.defaultProps={modal:!1,content:!1,subheader:null,title:null,toolbar:g.jsx(Yr,{children:g.jsx(R.SaveButton,{type:"button"})}),secondary:g.jsx(Ji,{children:g.jsx(R.DeleteWithConfirmButton,{})})};Uc.propTypes={...R.SimpleForm.propTypes,modal:c.bool,content:c.bool,contained:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object])};const Yc=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:a,divider:l,...u})=>{const A=Kt.useTheme(),{getCurrentDialog:f}=Jo(),{source:p,resource:C,isRequired:h}=u,{getFieldState:E,formState:I}=mc.useFormContext(),{error:B}=E(p,I),v=f();return g.jsxs(b.Stack,{spacing:1,sx:{"& .MuiFormHelperText-root":{color:B?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&a!==!1&&g.jsx(b.InputLabel,{error:!!B,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:g.jsx(R.FieldTitle,{label:e,source:p,resource:v||C,isRequired:h})}),O.isValidElement(t)?O.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&g.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:!!B,children:r})]})};Yc.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool};Yc.defaultProps={display:"label",divider:!1};const u5=ce(R.ArrayInput,{name:"ApplicaArrayInput",slot:"root"})(({theme:e})=>({"& .MuiStack-root > label":{marginTop:e.spacing(2)},"& .MuiInputLabel-shrink":{paddingBottom:0},marginTop:"0 !important","& .RaSimpleFormIterator-line > .RaSimpleFormIterator-form":{paddingBottom:e.spacing(.5),"& > div":{width:"100%"}}})),A5=({label:e,addLabel:t,source:n,helperText:r,divider:i=!0,...a})=>g.jsx(Yc,{label:e,addLabel:t,source:n,helperText:r,divider:i,children:g.jsx(u5,{source:n,label:!1,...a})}),Kf=({canEdit:e,canDelete:t,canClone:n})=>!e&&!t&&!n?null:g.jsxs(Ji,{children:[e&&g.jsx(R.EditButton,{}),t&&g.jsx(R.DeleteWithConfirmButton,{}),n&&g.jsx(R.CloneButton,{})]});Kf.defaultProps={canEdit:!0,canDelete:!0,canClone:!1};Kf.propTypes={canEdit:c.bool,canDelete:c.bool,canClone:c.bool};const EE=ce("div",{name:"ApplicaBaseAttachmentField",overridesResolver:(e,t)=>t.root})({display:"inline-block"}),d5=ce("ul")({display:"inline-block"}),UB=e=>{var p;const{className:t,emptyText:n,source:r,title:i,...a}=e,l=be.useRecordContext(e),u=it.get(l,r),A=be.useTranslate();if(!u)return n?g.jsx(b.Typography,{component:"span",variant:"body2",className:t,...a,children:n&&A(n,{_:n})}):g.jsx(EE,{className:t,...a});if(Array.isArray(u))return g.jsx(d5,{className:t,...a,children:u.map((C,h)=>{var I;const E=i instanceof String?(I=it.get(C,i))==null?void 0:I.toString():i;return g.jsx("li",{children:E},h)})});const f=i instanceof String?(p=it.get(l,i))==null?void 0:p.toString():i;return g.jsx(EE,{className:t,...a,children:f})};UB.propTypes={className:c.string,emptyText:c.string,source:c.string.isRequired,src:c.string,title:c.oneOfType([c.string,c.element]),target:c.string,download:c.oneOfType([c.bool,c.string]),ping:c.string,rel:c.string};var YB={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Un,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",l="second",u="minute",A="hour",f="day",p="week",C="month",h="quarter",E="year",I="date",B="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(X){var G=["th","st","nd","rd"],H=X%100;return"["+X+(G[(H-20)%10]||G[H]||G[0])+"]"}},x=function(X,G,H){var J=String(X);return!J||J.length>=G?X:""+Array(G+1-J.length).join(H)+X},T={s:x,z:function(X){var G=-X.utcOffset(),H=Math.abs(G),J=Math.floor(H/60),k=H%60;return(G<=0?"+":"-")+x(J,2,"0")+":"+x(k,2,"0")},m:function X(G,H){if(G.date()<H.date())return-X(H,G);var J=12*(H.year()-G.year())+(H.month()-G.month()),k=G.clone().add(J,C),ee=H-k<0,z=G.clone().add(J+(ee?-1:1),C);return+(-(J+(H-k)/(ee?k-z:z-k))||0)},a:function(X){return X<0?Math.ceil(X)||0:Math.floor(X)},p:function(X){return{M:C,y:E,w:p,d:f,D:I,h:A,m:u,s:l,ms:a,Q:h}[X]||String(X||"").toLowerCase().replace(/s$/,"")},u:function(X){return X===void 0}},P="en",F={};F[P]=M;var j="$isDayjsObject",K=function(X){return X instanceof ae||!(!X||!X[j])},q=function X(G,H,J){var k;if(!G)return P;if(typeof G=="string"){var ee=G.toLowerCase();F[ee]&&(k=ee),H&&(F[ee]=H,k=ee);var z=G.split("-");if(!k&&z.length>1)return X(z[0])}else{var _=G.name;F[_]=G,k=_}return!J&&k&&(P=k),k||!J&&P},U=function(X,G){if(K(X))return X.clone();var H=typeof G=="object"?G:{};return H.date=X,H.args=arguments,new ae(H)},$=T;$.l=q,$.i=K,$.w=function(X,G){return U(X,{locale:G.$L,utc:G.$u,x:G.$x,$offset:G.$offset})};var ae=function(){function X(H){this.$L=q(H.locale,null,!0),this.parse(H),this.$x=this.$x||H.x||{},this[j]=!0}var G=X.prototype;return G.parse=function(H){this.$d=function(J){var k=J.date,ee=J.utc;if(k===null)return new Date(NaN);if($.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var z=k.match(v);if(z){var _=z[2]-1||0,Ae=(z[7]||"0").substring(0,3);return ee?new Date(Date.UTC(z[1],_,z[3]||1,z[4]||0,z[5]||0,z[6]||0,Ae)):new Date(z[1],_,z[3]||1,z[4]||0,z[5]||0,z[6]||0,Ae)}}return new Date(k)}(H),this.init()},G.init=function(){var H=this.$d;this.$y=H.getFullYear(),this.$M=H.getMonth(),this.$D=H.getDate(),this.$W=H.getDay(),this.$H=H.getHours(),this.$m=H.getMinutes(),this.$s=H.getSeconds(),this.$ms=H.getMilliseconds()},G.$utils=function(){return $},G.isValid=function(){return this.$d.toString()!==B},G.isSame=function(H,J){var k=U(H);return this.startOf(J)<=k&&k<=this.endOf(J)},G.isAfter=function(H,J){return U(H)<this.startOf(J)},G.isBefore=function(H,J){return this.endOf(J)<U(H)},G.$g=function(H,J,k){return $.u(H)?this[J]:this.set(k,H)},G.unix=function(){return Math.floor(this.valueOf()/1e3)},G.valueOf=function(){return this.$d.getTime()},G.startOf=function(H,J){var k=this,ee=!!$.u(J)||J,z=$.p(H),_=function(pe,me){var Qe=$.w(k.$u?Date.UTC(k.$y,me,pe):new Date(k.$y,me,pe),k);return ee?Qe:Qe.endOf(f)},Ae=function(pe,me){return $.w(k.toDate()[pe].apply(k.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(me)),k)},fe=this.$W,le=this.$M,ue=this.$D,ge="set"+(this.$u?"UTC":"");switch(z){case E:return ee?_(1,0):_(31,11);case C:return ee?_(1,le):_(0,le+1);case p:var Ee=this.$locale().weekStart||0,Ce=(fe<Ee?fe+7:fe)-Ee;return _(ee?ue-Ce:ue+(6-Ce),le);case f:case I:return Ae(ge+"Hours",0);case A:return Ae(ge+"Minutes",1);case u:return Ae(ge+"Seconds",2);case l:return Ae(ge+"Milliseconds",3);default:return this.clone()}},G.endOf=function(H){return this.startOf(H,!1)},G.$set=function(H,J){var k,ee=$.p(H),z="set"+(this.$u?"UTC":""),_=(k={},k[f]=z+"Date",k[I]=z+"Date",k[C]=z+"Month",k[E]=z+"FullYear",k[A]=z+"Hours",k[u]=z+"Minutes",k[l]=z+"Seconds",k[a]=z+"Milliseconds",k)[ee],Ae=ee===f?this.$D+(J-this.$W):J;if(ee===C||ee===E){var fe=this.clone().set(I,1);fe.$d[_](Ae),fe.init(),this.$d=fe.set(I,Math.min(this.$D,fe.daysInMonth())).$d}else _&&this.$d[_](Ae);return this.init(),this},G.set=function(H,J){return this.clone().$set(H,J)},G.get=function(H){return this[$.p(H)]()},G.add=function(H,J){var k,ee=this;H=Number(H);var z=$.p(J),_=function(le){var ue=U(ee);return $.w(ue.date(ue.date()+Math.round(le*H)),ee)};if(z===C)return this.set(C,this.$M+H);if(z===E)return this.set(E,this.$y+H);if(z===f)return _(1);if(z===p)return _(7);var Ae=(k={},k[u]=r,k[A]=i,k[l]=n,k)[z]||1,fe=this.$d.getTime()+H*Ae;return $.w(fe,this)},G.subtract=function(H,J){return this.add(-1*H,J)},G.format=function(H){var J=this,k=this.$locale();if(!this.isValid())return k.invalidDate||B;var ee=H||"YYYY-MM-DDTHH:mm:ssZ",z=$.z(this),_=this.$H,Ae=this.$m,fe=this.$M,le=k.weekdays,ue=k.months,ge=k.meridiem,Ee=function(me,Qe,se,He){return me&&(me[Qe]||me(J,ee))||se[Qe].slice(0,He)},Ce=function(me){return $.s(_%12||12,me,"0")},pe=ge||function(me,Qe,se){var He=me<12?"AM":"PM";return se?He.toLowerCase():He};return ee.replace(S,function(me,Qe){return Qe||function(se){switch(se){case"YY":return String(J.$y).slice(-2);case"YYYY":return $.s(J.$y,4,"0");case"M":return fe+1;case"MM":return $.s(fe+1,2,"0");case"MMM":return Ee(k.monthsShort,fe,ue,3);case"MMMM":return Ee(ue,fe);case"D":return J.$D;case"DD":return $.s(J.$D,2,"0");case"d":return String(J.$W);case"dd":return Ee(k.weekdaysMin,J.$W,le,2);case"ddd":return Ee(k.weekdaysShort,J.$W,le,3);case"dddd":return le[J.$W];case"H":return String(_);case"HH":return $.s(_,2,"0");case"h":return Ce(1);case"hh":return Ce(2);case"a":return pe(_,Ae,!0);case"A":return pe(_,Ae,!1);case"m":return String(Ae);case"mm":return $.s(Ae,2,"0");case"s":return String(J.$s);case"ss":return $.s(J.$s,2,"0");case"SSS":return $.s(J.$ms,3,"0");case"Z":return z}return null}(me)||z.replace(":","")})},G.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},G.diff=function(H,J,k){var ee,z=this,_=$.p(J),Ae=U(H),fe=(Ae.utcOffset()-this.utcOffset())*r,le=this-Ae,ue=function(){return $.m(z,Ae)};switch(_){case E:ee=ue()/12;break;case C:ee=ue();break;case h:ee=ue()/3;break;case p:ee=(le-fe)/6048e5;break;case f:ee=(le-fe)/864e5;break;case A:ee=le/i;break;case u:ee=le/r;break;case l:ee=le/n;break;default:ee=le}return k?ee:$.a(ee)},G.daysInMonth=function(){return this.endOf(C).$D},G.$locale=function(){return F[this.$L]},G.locale=function(H,J){if(!H)return this.$L;var k=this.clone(),ee=q(H,J,!0);return ee&&(k.$L=ee),k},G.clone=function(){return $.w(this.$d,this)},G.toDate=function(){return new Date(this.valueOf())},G.toJSON=function(){return this.isValid()?this.toISOString():null},G.toISOString=function(){return this.$d.toISOString()},G.toString=function(){return this.$d.toUTCString()},X}(),ie=ae.prototype;return U.prototype=ie,[["$ms",a],["$s",l],["$m",u],["$H",A],["$W",f],["$M",C],["$y",E],["$D",I]].forEach(function(X){ie[X[1]]=function(G){return this.$g(G,X[0],X[1])}}),U.extend=function(X,G){return X.$i||(X(G,ae,U),X.$i=!0),U},U.locale=q,U.isDayjs=K,U.unix=function(X){return U(1e3*X)},U.en=F[P],U.Ls=F,U.p={},U})})(YB);var f5=YB.exports;const Hr=Gi(f5),qf=({entityId:e,property:t,disabled:n,userResource:r="entities/user",...i})=>{const[a,l]=O.useState(null),u=R.useRecordContext(i),A=R.useDataProvider(),f=R.useResourceContext(),p=O.useCallback(async E=>{E.preventDefault(),E.stopPropagation();const I=it.get(u,i==null?void 0:i.source),B=f.replace("entities/",""),v=await A.getFile(`/attachments/${B}/${e||(u==null?void 0:u.id)}/${t||(i==null?void 0:i.source)}/${(I==null?void 0:I.id)||(u==null?void 0:u.id)}`),S=document.createElement("a");S.href=v,S.download=it.get(u,(i==null?void 0:i.title)||(i==null?void 0:i.source)),S.click()},[A,u,e,f,t,i==null?void 0:i.source,i==null?void 0:i.title]),C=O.useMemo(()=>({...u,[i==null?void 0:i.source]:(u==null?void 0:u.src)||it.get(u,i==null?void 0:i.source),[i==null?void 0:i.title]:(u==null?void 0:u.title)||it.get(u,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),[u,i==null?void 0:i.source,i==null?void 0:i.title]),h=R.useTranslate();return O.useEffect(()=>{!u||!(u!=null&&u.userId)||A.getOne(r,{id:u==null?void 0:u.userId}).then(({data:E})=>l(E)).catch(()=>l(null))},[u,A,r]),g.jsx(UB,{...i,disabled:n,record:C,onClick:p,title:g.jsxs(b.Box,{sx:{cursor:"pointer"},children:[g.jsx(b.Typography,{variant:"subtitle1",children:it.get(C,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),g.jsxs(b.Typography,{variant:"caption",color:"secondary",children:[it.get(C,"sizeDescription"),a&&" | ",a&&h("ra.attachment.info",{user:a==null?void 0:a.name,created:Hr(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})};qf.propTypes={...R.FileField.propTypes,source:c.string,title:c.string,disabled:c.bool};const g5=ce(R.ImageField,{name:"RaApplicaImageField",slot:"root"})(()=>({})),ga=e=>{const t=`_${e==null?void 0:e.source}`;return g.jsx(g5,{...e,source:t})};ga.propTypes={...R.ImageField.propTypes,source:c.string};const Gc=({width:e,height:t,circle:n,justify:r,record:i,...a})=>{const l=O.useMemo(()=>({width:typeof e=="number"?`${e}px !important`:`${e} !important`,height:typeof t=="number"?`${t}px !important`:`${t} !important`,borderRadius:n?"50%":1.5}),[e,t,n]),u=R.useRecordContext(),A=i||u;return g.jsx(ga,{sx:f=>({margin:0,display:"flex",justifyContent:r,"& img":{margin:"0px !important",border:`1px solid ${f.palette.divider}`,objectFit:"cover !important",...l,minWidth:l.width,minHeight:l.height}}),...a,record:A})};Gc.defaultProps={...ga.defaultProps,width:150,height:150,circle:!1,justify:"flex-start"};Gc.propTypes={...ga.propTypes,width:c.oneOfType([c.number,c.string]),height:c.oneOfType([c.number,c.string]),circle:c.bool,justify:c.oneOf(["flex-start","center","flex-end"])};var GB={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Un,function(){return function(n,r,i){n=n||{};var a=r.prototype,l={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(f,p,C,h){return a.fromToBase(f,p,C,h)}i.en.relativeTime=l,a.fromToBase=function(f,p,C,h,E){for(var I,B,v,S=C.$locale().relativeTime||l,M=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],x=M.length,T=0;T<x;T+=1){var P=M[T];P.d&&(I=h?i(f).diff(C,P.d,!0):C.diff(f,P.d,!0));var F=(n.rounding||Math.round)(Math.abs(I));if(v=I>0,F<=P.r||!P.r){F<=1&&T>0&&(P=M[T-1]);var j=S[P.l];E&&(F=E(""+F)),B=typeof j=="string"?j.replace("%d",F):j(F,p,P.l,v);break}}if(p)return B;var K=v?S.future:S.past;return typeof K=="function"?K(B):K.replace("%s",B)},a.to=function(f,p){return u(f,p,this,!0)},a.from=function(f,p){return u(f,p,this)};var A=function(f){return f.$u?i.utc():i()};a.toNow=function(f){return this.to(A(this),f)},a.fromNow=function(f){return this.from(A(this),f)}}})})(GB);var p5=GB.exports;const h5=Gi(p5);Hr.extend(h5);const Kc=e=>{const t=R.useRecordContext(e),[n]=R.useLocaleState(),r=O.useMemo(()=>Hr(it.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return g.jsxs(O.Fragment,{children:[g.jsx(R.DateField,{record:t,source:e.source,showTime:!0}),g.jsx("br",{}),g.jsx(b.Typography,{variant:"caption",color:"textSecondary",children:r})]})};Kc.displayName="DateAgoField";Kc.propTypes={source:c.string.isRequired};const KB=ce(R.DateField,{name:"RaApplicaDateField",slot:"Root"})(()=>({}));KB.propTypes={...R.DateField.propTypes};const _f=e=>g.jsx(KB,{...e});_f.defaultProps={...R.DateField.defaultProps,variant:"body1"};_f.propTypes={...R.DateField.propTypes};const qB=ce(R.EmailField,{name:"RaApplicaEmailField",slot:"Root"})(()=>({}));qB.propTypes={...R.EmailField.propTypes};const Jf=e=>g.jsx(qB,{...e});Jf.defaultProps={...R.EmailField.defaultProps,variant:"body1"};Jf.propTypes={...R.EmailField.propTypes};const C5=ce(R.FileField,{name:"RaApplicaFileField",slot:"root"})(()=>({})),Xf=({...e})=>{const t=R.useRecordContext(e),n=O.useCallback(r=>{r.preventDefault(),r.stopPropagation();const i=it.get(t,`_${e==null?void 0:e.source}`,it.get(t,e==null?void 0:e.source)),a=it.get(t,(e==null?void 0:e.title)||(e==null?void 0:e.source))||(e==null?void 0:e.title),l=document.createElement("a");l.href=i,l.download=a,l.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return g.jsx(C5,{...e,record:t,onClick:n})};Xf.propTypes={...R.FileField.propTypes,source:c.string,title:c.string};const _B=e=>g.jsx(R.FunctionField,{...e});_B.defaultProps={variant:"body1"};const m5=ce("div")(({theme:e})=>({borderBottom:`1px solid ${e.palette.divider}`,paddingTop:e.spacing(1),paddingBottom:e.spacing(1),marginBottom:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",[e.breakpoints.down("sm")]:{whiteSpace:"normal",overflow:"visible",textOverflow:"inherit"}})),Zf=({source:e,defaultValue:t,...n})=>{const r=R.useRecordContext(n),i=it.get(r,e,t);return g.jsx("span",{dangerouslySetInnerHTML:{__html:i&&i!==null?i:t}})};Zf.propTypes={defaultValue:c.any,source:c.string,record:c.object};Zf.defaultProps={defaultValue:" "};const JB=({title:e,children:t})=>e&&e!==!1?g.jsx(b.Tooltip,{title:e,placement:"top",children:t}):t;JB.propTypes={title:c.oneOfType([c.string,c.bool]),children:c.oneOfType([c.element,c.arrayOf(c.element)])};const $f=({label:e,source:t,defaultValue:n,children:r,tooltip:i,...a})=>{const{getCurrentDialog:l}=Jo(),u=R.useRecordContext(a),A=R.useResourceContext(a),f=l(),p=O.useMemo(()=>!i||i===!1?!1:typeof i=="function"?i(u):typeof i=="string"?it.get(u,i,i):i,[u,i]);return g.jsx(JB,{title:p,children:g.jsxs(O.Fragment,{children:[g.jsx(b.InputLabel,{children:g.jsx(R.FieldTitle,{label:e,source:t,resource:f||A})}),g.jsx(m5,{...a,children:O.cloneElement(r,{source:t,record:u,defaultValue:n,resource:f||A})})]})})};$f.propTypes={defaultValue:c.any,tooltip:c.oneOfType([c.string,c.bool,c.func]),source:c.string,label:c.string,name:c.string,children:c.element};$f.defaultProps={defaultValue:" ",children:g.jsx(Zf,{})};const E5=_i("div",{name:"RaApplicaReferenceManyField",slot:"root"})(({theme:e,margin:t,border:n})=>({marginLeft:t?0:`-${e.spacing(2.5)}`,marginRight:t?0:`-${e.spacing(2.5)}`,borderBottom:n?`1px solid ${e.palette.divider}`:"none","& form":{padding:e.spacing(2)},"& .MuiCardContent-root":{borderTop:n?`1px solid ${e.palette.divider}`:"none"},"& .MuiToolbar-root":{[e.breakpoints.up("sm")]:{marginTop:`-${e.spacing(2)}`,marginBottom:e.spacing(t?0:1),marginLeft:e.spacing(t?1:2),marginRight:e.spacing(t?1:2),width:t?"auto":`calc(100% - ${e.spacing(5)})`},[e.breakpoints.down("md")]:{marginTop:0}},"& .RaDatagrid-root":{overflowX:"auto",paddingTop:48,[e.breakpoints.down("sm")]:{width:"calc(100vw - 34px)"}},"& .RaDatagrid-table":{borderBottom:`1px solid ${e.palette.divider}`},"& .MuiTablePagination-toolbar":{marginTop:e.spacing(1),marginBottom:0},"& .RaBulkActionsToolbar-collapsed.RaBulkActionsToolbar-toolbar":{minHeight:0},"& .RaBulkActionsToolbar-toolbar":{minHeight:48,bottom:-56,"& h6":{marginTop:e.spacing(.5)},"& .RaBulkActionsToolbar-topToolbar":{marginTop:e.spacing(1)},[e.breakpoints.down("sm")]:{bottom:-48,borderRadius:0}}})),$i=e=>g.jsx(E5,{children:g.jsx(R.ReferenceManyField,{...e})});$i.defaultProps={...R.ReferenceManyField.defaultProps,margin:!1,border:!1};$i.propTypes={...R.ReferenceManyField.propTypes,margin:c.bool,border:c.bool};const XB=({source:e,...t})=>{const n=R.useRecordContext(t),r=it.get(n,e,0),i=r/1024,a=i/1024,l=a/1024,u=l>1?`${l.toFixed(2)} GB`:a>1?`${a.toFixed(2)} MB`:i>1?`${i.toFixed(2)} KB`:`${r.toFixed(2)} B`;return g.jsx(b.Typography,{component:"span",variant:"body1",...t,children:u})};XB.propTypes={record:c.object,source:c.string};const ZB=ce(R.TextField,{name:"RaApplicaTextField",slot:"Root"})(()=>({}));ZB.propTypes={...R.TextField.propTypes};const eg=e=>g.jsx(ZB,{...e});eg.defaultProps={...R.TextField.defaultProps,variant:"body1"};eg.propTypes={...R.TextField.propTypes};const at=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:a,divider:l,...u})=>{const A=Kt.useTheme(),{getCurrentDialog:f}=Jo(),{source:p,resource:C,isRequired:h}=u,{fieldState:{invalid:E}}=R.useInput(u),I=f();return g.jsxs(b.Stack,{spacing:1,sx:{width:u!=null&&u.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:E?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&a!==!1&&g.jsx(b.InputLabel,{error:E===!0,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:g.jsx(R.FieldTitle,{label:e,source:p,resource:I||C,isRequired:h})}),O.isValidElement(t)?O.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&g.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:E===!0,children:r})]})};at.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool};at.defaultProps={display:"label",divider:!1};const I5=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},B5=ce(R.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({disabled:e,theme:t})=>({"& .previews":{},"& .previews>div":{marginTop:t.spacing(1),padding:t.spacing(1.5),border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:t.palette.action.hover},"& .MuiLink-root":{fontSize:t.typography.body1.fontSize}},...I5(e)})),tg=({children:e,disabled:t,type:n,...r})=>{const i=R.useRecordContext(r),a=r==null?void 0:r.source,l=i==null?void 0:i.id;return R.useInput({source:`__${n}__${r==null?void 0:r.source}`,defaultValue:r==null?void 0:r.source}),g.jsx(at,{...r,children:g.jsx(B5,{disabled:t,children:O.cloneElement(e,{...e.props,entityId:l,property:a})})})};tg.propTypes={...R.FileInput.propTypes,children:c.node,multiple:c.bool,disabled:c.bool};tg.defaultProps={children:g.jsx(qf,{title:"name",source:"path"}),multiple:!0,disabled:!1,type:"attachment"};const y5=ce(R.AutocompleteArrayInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"}})),ng=({...e})=>g.jsx(at,{...e,children:g.jsx(y5,{})});ng.propTypes={...R.AutocompleteArrayInput.propTypes,...at.propTypes};ng.defaultProps={...R.AutocompleteArrayInput.defaultProps,size:"small"};const v5=ce(R.AutocompleteInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},"& .MuiOutlinedInput-root.MuiInputBase-sizeSmall":{paddingTop:"4px"}})),rg=e=>{const{perPage:t,...n}=e;return g.jsx(at,{...n,children:g.jsx(v5,{})})};rg.propTypes={...R.AutocompleteInput.propTypes,...at.propTypes};rg.defaultProps={...R.AutocompleteInput.defaultProps,size:"small"};const b5=ce(R.BooleanInput,{name:"RaApplicaBooleanInput",slot:"Root"})(()=>({})),og=({horizontal:e,...t})=>{const n=Tt();return g.jsx(at,{...t,sx:e?{flexDirection:e?"row":"column",alignItems:e?"center":"flex-start","& .MuiFormGroup-root":{margin:0},"& .MuiFormControlLabel-root":{margin:0,"& .MuiTypography-root":{display:"none",visibility:"hidden"},"& .MuiSwitch-root":{marginRight:`-${n.spacing(.5)}`}}}:{},children:g.jsx(b5,{})})};og.defaultProps={...R.BooleanInput.defaultProps,...at.defaultProps};og.propTypes={...R.BooleanInput.propTypes,...at.propTypes,horizontal:c.bool};const Q5=ce(R.DateInput,{name:"RaApplicaDateInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),ig=e=>g.jsx(at,{...e,children:g.jsx(Q5,{})});ig.propTypes={...R.DateInput.propTypes,...at.propTypes};ig.defaultProps={...R.DateInput.defaultProps,...at.defaultProps};const x5=ce(R.DateTimeInput,{name:"RaApplicaDateTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),sg=e=>g.jsx(at,{...e,children:g.jsx(x5,{})});sg.propTypes={...R.DateTimeInput.propTypes,...at.propTypes};sg.defaultProps={...at.defaultProps};const w5=ce(R.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({theme:e})=>({"& .previews":{},"& .previews>div":{marginTop:e.spacing(1),padding:e.spacing(1.5),border:`1px solid ${e.palette.divider}`,borderRadius:e.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:e.palette.action.hover},"& .MuiLink-root":{fontSize:e.typography.body1.fontSize}}})),ag=({children:e,title:t,...n})=>{const r=mc.useWatch({name:n.source}),i=R.useRecordContext(n),{source:a}=n,l=O.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const u=it.get(i,a);if(u){const A=u.split("__");return A.length>0?A[A.length-1]:u}return u},[i,a,r]);return g.jsx(at,{...n,children:g.jsx(w5,{children:O.cloneElement(e,{...e.props,title:t||a,source:a,record:{...i,[a]:(r==null?void 0:r.title)||it.get(i,a),[`_${a}`]:(r==null?void 0:r.src)||it.get(i,`_${a}`),[t||a]:l}})})})};ag.propTypes={...R.FileInput.propTypes,source:c.string,title:c.string,children:c.node};ag.defaultProps={children:g.jsx(Xf,{})};const lg=({children:e,title:t,...n})=>{const r=mc.useWatch({name:n.source}),i=R.useRecordContext(n),{source:a}=n;return R.useInput({source:`__image__${n==null?void 0:n.source}`,defaultValue:n==null?void 0:n.source}),g.jsx(at,{...n,children:g.jsx(R.ImageInput,{accept:"image/*",children:O.cloneElement(e,{...e.props,title:t,source:a,record:{...i,[a]:(r==null?void 0:r.title)||it.get(i,a),[`_${a}`]:(r==null?void 0:r.src)||it.get(i,`_${a}`)}})})})};lg.defaultProps={children:g.jsx(Gc,{}),multiple:!1};lg.propTypes={...R.ImageInput.propTypes,source:c.string,title:c.string,children:c.node,multiple:c.bool};const T5=ce(R.NumberInput,{name:"RaApplicaNumberInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),cg=e=>g.jsx(at,{...e,children:g.jsx(T5,{})});cg.propTypes={...R.NumberInput.propTypes,...at.propTypes};cg.defaultProps={...R.NumberInput.defaultProps,...at.defaultProps};const $B=({source:e,minWidth:t=300,children:n})=>{const r=R.useResourceContext(),i=R.useRecordContext(),[a,l]=O.useState(it.get(i,e,"")),[u,A]=O.useState(!1),f=O.useCallback(I=>l(I.target.value),[]),p=R.useDataProvider(),C=O.useCallback(I=>{I.key==="Enter"&&(A(!0),p.update(r,{id:i.id,data:{...i,[e]:a,_changed:e}}).then(()=>A(!1)))},[a,p,r,i,e]),h=O.useCallback(()=>{it.get(i,e)!==a&&(A(!0),p.update(r,{id:i.id,data:{...i,[e]:a,_changed:e}}).then(()=>A(!1)))},[a,p,r,e,i]),E=O.useCallback(I=>{A(!0),p.update(r,{id:i.id,data:{...i,[e]:I,_changed:e}}).then(()=>A(!1))},[p,r,e,i]);return O.useEffect(()=>l(it.get(i,e)),[i,e]),n?O.cloneElement(n,{...n.props,source:e,value:a,onChange:E}):g.jsx(b.TextField,{value:a,disabled:u,onChange:f,onKeyPress:C,onBlur:h,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})};$B.propTypes={source:c.string.isRequired,minWidth:c.number,children:c.element};const ug=({children:e,...t})=>g.jsx(R.ReferenceArrayInput,{...t,children:O.cloneElement(e,{...t,source:e.props.source||t.source})});ug.propTypes={...R.ReferenceArrayInput.propTypes,children:c.element};ug.defaultProps={...R.ReferenceArrayInput.defaultProps};const Ag=({children:e,...t})=>g.jsx(R.ReferenceInput,{...t,children:O.cloneElement(e,{...t,source:e.props.source||t.source})});Ag.propTypes={...R.ReferenceInput.propTypes,children:c.element};Ag.defaultProps={...R.ReferenceInput.defaultProps};const dg=({reference:e,target:t,children:n,filters:r,actions:i,...a})=>g.jsx(R.ResourceContextProvider,{value:e,children:g.jsx($i,{perPage:5,pagination:g.jsx(R.Pagination,{}),...a,reference:e,target:t,children:g.jsxs(O.Fragment,{children:[g.jsx(R.ListToolbar,{filters:r,actions:i}),n]})})});dg.propTypes={...$i.propTypes,children:c.node.isRequired,reference:c.string.isRequired,target:c.string.isRequired,filters:c.oneOfType([c.element,c.func,c.element,c.arrayOf(c.node)]),actions:c.oneOfType([c.element,c.func,c.element])};dg.defaultProps={...$i.defaultProps};const P5=ce(R.SearchInput,{name:"RaApplicaSearchInput",slot:"root"})(()=>({})),R5=e=>g.jsx(P5,{...e}),ey=ce(R.SelectArrayInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .RaSelectArrayInput-chips > .RaSelectArrayInput-chip":{marginTop:"-2px",marginBottom:"-2px"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}}));ey.propTypes={...R.SelectArrayInput.propTypes};const fg=e=>g.jsx(at,{...e,children:g.jsx(ey,{options:{autoWidth:!1}})});fg.defaultProps={optionText:"name",optionValue:"id"};fg.propTypes={...R.SelectArrayInput.propTypes,...at.propTypes};const S5=ce(R.SelectInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}})),ty=e=>g.jsx(at,{...e,children:g.jsx(S5,{})});ty.propTypes={...R.SelectInput.propTypes,...at.propTypes};const Gn=e=>g.jsx(at,{...e,children:g.jsx(R.TextInput,{})});Gn.propTypes={...R.TextInput.propTypes,...at.propTypes};const qc=({...e})=>{var u,A;const t=R.useTranslate(),n=R.maxLength(e==null?void 0:e.maxLength,"app.input.max_length_error"),r=(A=(u=mc.useController({name:e==null?void 0:e.source}))==null?void 0:u.field)==null?void 0:A.value;let i=e.helperText,a=e.validate;a?Array.isArray(a)&&a.indexOf(n)===-1&&a.push(n):a=[n];const l=t("app.input.max_length_info",{count:(r==null?void 0:r.length)||0,max:e==null?void 0:e.maxLength});return e!=null&&e.maxLength&&(i=i&&i.length>0?`${l} - ${t(i)}`:l),g.jsx(Gn,{...e,validate:a,helperText:i,inputProps:{maxLength:e==null?void 0:e.maxLength}})};qc.displayName="SmartTextInput";qc.defaultProps={multiline:!1};qc.propTypes={...Gn.propTypes,maxLength:c.number,multiline:c.bool,rows:c.number};const ny=e=>{const t=e.split(":");t.length===1&&t.push("00");const n=parseInt(t[0]),r=parseInt(t[1]);return Hr().hour(n).minute(r)};function O5(){let e=new Date().getTime();return window.performance&&typeof window.performance.now=="function"&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)})}const D5=e=>{if(!e)return"";const t=ny(e);return t?t.format("HH:mm"):""},M5=e=>e,j5=ce(R.TimeInput,{name:"RaApplicaTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),gg=e=>g.jsx(at,{...e,children:g.jsx(j5,{})});gg.defaultProps={...R.TimeInput.defaultProps,format:D5,parse:M5};gg.propTypes={...R.TimeInput.propTypes,...at.propTypes};const pg=({onSuccess:e,firstAccess:t})=>{const{spacing:n}=Zn(),[r,i]=O.useState(!1),a=be.useAuthProvider(),l=be.useTranslate(),u=be.useNotify(),A=O.useCallback(f=>{const{oldPassword:p,newPassword:C}=f;i(!0),a==null||a.changePassword(p,C).then(()=>{u("ra.auth.password_changed"),e()}).catch(h=>u(h,{type:"error"})).finally(()=>i(!1))},[a,e]);return g.jsx(be.ResourceContextProvider,{value:"user/change-password",children:g.jsx(be.EditContextProvider,{value:{record:{},resource:"user/change-password",save:A},children:g.jsx(Uc,{onSubmit:A,toolbar:g.jsx(Yr,{children:g.jsx(R.SaveButton,{disabled:r})}),children:g.jsxs(b.Grid,{container:!0,spacing:n,children:[t===!0&&g.jsx(b.Grid,{item:!0,xs:12,children:g.jsxs(b.Alert,{severity:"warning",children:[g.jsx(b.AlertTitle,{children:l("ra.auth.first_access.change_password")}),l("ra.auth.first_access.change_password_helper")]})}),g.jsx(b.Grid,{item:!0,xs:12,children:g.jsx(Gn,{source:"oldPassword",type:"password",validate:be.required()})}),g.jsx(b.Grid,{item:!0,xs:12,children:g.jsx(Gn,{source:"newPassword",type:"password",validate:be.required()})})]})})})})},k5=ce(R.Edit,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaEdit-card":{[e.breakpoints.down("sm")]:{marginBottom:e.spacing(6)}},"& .RaEdi-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaToolbar-mobileToolbar":{borderTop:`1px solid ${e.palette.divider}`},"& .RaEdit-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),F5=ce(b.CardHeader)(({theme:e})=>({marginTop:e.spacing(4),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),L5=ce(b.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`})),hg=({title:e,divider:t,variant:n})=>{const r=R.useTranslate();return g.jsxs(O.Fragment,{children:[g.jsx(F5,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&g.jsx(L5,{})]})};hg.propTypes={title:c.string.isRequired,divider:c.bool,variant:c.oneOf(["h1","h2","h3","h4","h5","h6"])};hg.defaultProps={divider:!0,variant:"h4"};const lc=c.shape({xl:c.number,lg:c.number,md:c.number,sm:c.number,xs:c.number}),N5=ce("div")(({theme:e})=>({marginBottom:e.spacing(2)})),_c=({children:e,visibility:t})=>b.useMediaQuery(r=>r.breakpoints.up(t))?g.jsx(N5,{children:e}):null;_c.propTypes={visibility:c.oneOf(["xl","lg","md","sm","xs"]),position:c.oneOf(["top","bottom"]).isRequired,children:c.node.isRequired};_c.defaultProps={position:"top",visibility:"md"};const V5={display:"none"},Jc=({intent:e,hidden:t,unmountOnExit:n,label:r,icon:i,value:a,syncWithLocation:l,selected:u,onChange:A,children:f,badgeColor:p,badgeContent:C,...h})=>{const E=R.useTranslate(),I=Mr.useLocation(),B={component:pt.Link,to:{...I,pathname:a}},v=O.isValidElement(r)?r:E(r,{_:r}),S=O.useCallback(()=>A(a),[A,a]);return e==="header"?(()=>g.jsxs(b.ListItemButton,{selected:u,...l?B:{},onClick:S,children:[i&&g.jsx(b.ListItemIcon,{children:i}),g.jsx(b.ListItemText,{primary:v}),C&&g.jsx(b.ListItemSecondaryAction,{children:g.jsx(b.Avatar,{sx:{width:24,height:24,fontSize:12,backgroundColor:T=>{var P;return(P=T.palette[p])==null?void 0:P.main},color:T=>{var P;return(P=T.palette[p])==null?void 0:P.contrastText}},children:C})})]}))():(()=>n&&t?null:g.jsx(R.FormGroupContextProvider,{name:a.toString(),children:g.jsx(b.Stack,{alignContent:"stretch",style:t?V5:{},id:`tabpanel-${a}`,"aria-labelledby":`tabheader-${a}`,"aria-hidden":t||void 0,...h,children:f})}))()};Jc.propTypes={intent:c.oneOf(["header","content","sidebar"]),className:c.string,contentClassName:c.string,url:c.string,icon:c.element,label:c.oneOfType([c.string,c.element]).isRequired,value:c.oneOfType([c.string,c.number]),syncWithLocation:c.bool,onChange:c.func,selected:c.bool,hidden:c.bool,unmountOnExit:c.bool,children:c.node,badgeColor:c.oneOf(["default","error","info","primary","secondary","success","warning"]),badgeContent:c.oneOfType([c.string,c.number])};Jc.defaultProps={badgeColor:"default",unmountOnExit:!1};const H5=_i(b.List,{name:"RaLongFormTabs",slot:"Root"})(({theme:e})=>({p:0,"& .MuiListItemIcon-root":{minWidth:32,color:e.palette.grey[500]},"& .MuiListItemButton-root.Mui-selected":{borderRight:`2px solid ${e.palette.primary.main}`,marginRight:"-2px"}})),ry=({children:e,syncWithLocation:t,value:n,url:r,onChange:i})=>{const a=Mr.useLocation();return g.jsx(Yn,{children:g.jsx(H5,{component:"nav",children:O.Children.map(e,(l,u)=>{if(!O.isValidElement(l))return null;const A=z5(l,u),f=t?!!Mr.matchPath(`${r}/${A}`,a.pathname):u===n;return O.cloneElement(l,{intent:"header",value:t?A:u,syncWithLocation:t,onChange:i,url:r,selected:f})})})})},z5=(e,t)=>e.props.path!=null?e.props.path:t>0?t.toString():"";ry.propTypes={children:c.node,url:c.string,tabsWithErrors:c.arrayOf(c.string),syncWithLocation:c.bool,onChange:c.func,value:c.oneOfType([c.string,c.number])};var W5=e=>{let t=e;for(;t=t.parentElement;){const n=getComputedStyle(t,null).getPropertyValue("overflow-y");if(t===document.body)return window;if(n==="auto"||n==="scroll"||n==="overlay")return t}return window},oy=e=>e.firstChild?e.firstChild.offsetParent===e:!0,U5=(e,t)=>{let n=e,r=0;oy(t)||(r+=e.offsetTop-t.offsetTop,t=e.offsetParent,r+=-e.offsetTop);do r+=n.offsetTop,n=n.offsetParent;while(n&&n!==t);return r},Y5=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},ra=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?ra="sticky":CSS.supports("position","-webkit-sticky")&&(ra="-webkit-sticky"));var cc=!1;try{const e=Object.defineProperty({},"passive",{get(){cc={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var XA=e=>{const{el:t,onChange:n,unsubs:r,measure:i}=e;if(t===window){const a=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),l=i(a()),u=()=>{Object.assign(l,i(a())),n()};return window.addEventListener("resize",u,cc),r.push(()=>window.removeEventListener("resize",u)),l}else{const a=i(t.getBoundingClientRect()),l=()=>{Object.assign(a,i(t.getBoundingClientRect())),n()},u=new ResizeObserver(l);return u.observe(t),r.push(()=>u.disconnect()),a}},G5=e=>{const t=getComputedStyle(e,null),n=parseInt(t.getPropertyValue("padding-top"),10),r=parseInt(t.getPropertyValue("padding-bottom"),10);return{top:n,bottom:r}},K5=(e,t,n)=>{const{bottom:r,offsetBottom:i,offsetTop:a}=n,l=W5(e);let u=!1;const A=()=>{u||requestAnimationFrame(()=>{const j=C();j!==x&&T(j),u=!1}),u=!0};let f=l===window?window.scrollY:l.scrollTop;const p=j=>{const{offsetTop:K,height:q}=E,{naturalTop:U}=v,{height:$}=S;return j+K+q>=U+$+M+i},C=()=>{const{height:j}=E,{height:K}=S;return K+a+i<=j?3:p(f)?1:2},h=l!==window&&oy(l),E=XA({el:l,onChange:A,unsubs:t,measure:({height:j,top:K})=>({height:j,offsetTop:h?K:0})}),I=Y5(e),B=I===window?{top:0,bottom:0}:G5(I),v=XA({el:I,onChange:A,unsubs:t,measure:({height:j})=>({height:j-B.top-B.bottom,naturalTop:I===window?0:U5(I,l)+B.top+E.offsetTop})}),S=XA({el:e,onChange:A,unsubs:t,measure:({height:j})=>({height:j})});let M=0,x=C();const T=j=>{const K=x;if(x=j,K===2&&(M=-1),j===3){e.style.position=ra,r?e.style.bottom=`${i}px`:e.style.top=`${a}px`;return}const{height:q,offsetTop:U}=E,{height:$,naturalTop:ae}=v,{height:ie}=S;if(j===2)if(e.style.position="relative",M=K===0?Math.max(0,U+f-ae+a):Math.max(0,U+f+q-(ae+ie+i)),r){const X=Math.max(0,$-ie-M);e.style.bottom=`${X}px`}else e.style.top=`${M}px`;else e.style.position=ra,j===1?r?e.style.bottom=`${i}px`:e.style.top=`${q-ie-i}px`:r?e.style.bottom=`${q-ie-i}px`:e.style.top=`${a}px`};T(x);const P=j=>{if(j===f)return;const K=j-f;if(f=j,x===3)return;const{offsetTop:q,height:U}=E,{naturalTop:$,height:ae}=v,{height:ie}=S;if(K>0)if(x===0){if(j+q+a>$){const X=Math.max(0,q+f-$+a);j+q+U<=$+ie+X+i?T(2):T(1)}}else x===2&&p(j)&&T(1);else if(x===1){if(q+j+U<$+ae+i){const X=Math.max(0,q+f+U-($+ie+i));q+j+a>=$+X?T(2):T(0)}}else x===2&&q+j+a<$+M&&T(0)},F=l===window?()=>P(window.scrollY):()=>P(l.scrollTop);l.addEventListener("scroll",F,cc),l.addEventListener("mousewheel",F,cc),t.push(()=>l.removeEventListener("scroll",F),()=>l.removeEventListener("mousewheel",F))},q5=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,i]=O.useState(null);return O.useEffect(()=>{if(!r||!ra)return;const a=[];return K5(r,a,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{a.forEach(l=>l())}},[r,t,e,n]),i},_5=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:i,className:a,style:l}=e,u=q5({offsetTop:t,offsetBottom:n,bottom:r});return g.jsx("div",{className:a,style:l,ref:u,children:i})},J5=_5;const X5=ce(b.Grid,{name:"ApplicaLongFormView",slot:"Root"})(({theme:e})=>({"& .MuiToolbar-root":{position:"initial",marginTop:e.spacing(2),marginLeft:`-${e.spacing(3)}`,marginRight:`-${e.spacing(3)}`,marginBottom:`-${e.spacing(2)}`,borderTop:`1px solid ${e.palette.divider}`,[e.breakpoints.down("sm")]:{position:"initial !important",width:"auto !important"}},"& form > .MuiToolbar-root":{margin:0,marginRight:`-${e.spacing(.5)}`,[e.breakpoints.down("sm")]:{marginRight:e.spacing(.5)}}})),IE=(e,t)=>e&&e.type===_c&&e.props.position===t,Z5=e=>e&&e.type===Jc,Cg=({children:e,formRootPathname:t,syncWithLocation:n,spacing:r,tabs:i,tabsDisposition:a,contentDisposition:l,sticky:u,...A})=>{const[f,p]=O.useState(0),C=Mr.useResolvedPath(""),h=R.useResourceContext(A),E=Mr.useLocation(),I=O.useMemo(()=>O.Children.toArray(e).find(T=>IE(T,"top")),[e]),B=O.useMemo(()=>O.Children.toArray(e).find(T=>IE(T,"bottom")),[e]),v=O.useMemo(()=>O.Children.toArray(e).filter(T=>Z5(T)),[e]),S=T=>{n||p(T)},M=()=>O.cloneElement(i,{onChange:S,syncWithLocation:n,url:t,value:f,intent:"header"},v),x=O.useMemo(()=>g.jsxs(O.Fragment,{children:[I,n?g.jsx(Mr.Routes,{children:g.jsx(Mr.Route,{path:"/*",element:M()})}):M(),B]}),[I,n,M,B]);return g.jsxs(X5,{container:!0,spacing:r*2,children:[g.jsx(b.Grid,{item:!0,...a,children:u?g.jsx(J5,{offsetTop:74,offsetBottom:r*2,children:x}):x}),g.jsx(b.Grid,{item:!0,...l,children:O.Children.map(v,(T,P)=>{if(!T)return null;const F=R.getTabbedFormTabFullPath(T,P),j=n?!Mr.matchPath(`${C.pathname}/${F}`,E.pathname):f!==P;return O.isValidElement(T)?O.cloneElement(T,{intent:"content",resource:h,hidden:j,value:n?F:P}):null})})]})};Cg.propTypes={children:c.node,spacing:c.number,syncWithLocation:c.bool,tabs:c.element,formRootPathname:c.string,tabsDisposition:lc,contentDisposition:lc};Cg.defaultProps={tabs:g.jsx(ry,{})};const $5=()=>{const e=pt.useLocation(),t=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/*",":resource/:id/*"];for(const n of t){const r=pt.matchPath(n,e.pathname);if(r)return r.pathnameBase}return""},pa=({spacing:e,...t})=>{const n=$5(),{spacing:r}=Zn(),i=e||r;return g.jsx(R.Form,{formRootPathname:n,...t,children:g.jsx(Cg,{formRootPathname:n,...t,spacing:i})})};pa.propTypes={syncWithLocation:c.bool,spacing:c.number,tabsDisposition:lc,contentDisposition:lc,sticky:c.bool};pa.defaultProps={syncWithLocation:!1,sticky:!0,spacing:2,tabsDisposition:{xl:3,lg:3,md:4,sm:4,xs:12},contentDisposition:{xl:9,lg:9,md:8,sm:8,xs:12}};pa.Tab=Jc;pa.Sidebar=_c;const e8=ce(R.Show,{name:"RaApplicaShow",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaShow-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaShow-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),t8=ce(R.SimpleFormIterator,{name:"ApplicaSimpleFormIterator",root:"root"})(({theme:e})=>({"& .RaSimpleFormIterator-line":{paddingTop:e.spacing(1),paddingBottom:e.spacing(.5)},"& .RaSimpleFormIterator-action":{display:"flex",flexDirection:"row",alignItems:"center",mb:1.5},"& section":{width:"100%","& label":{position:"relative",overflow:"visible",transform:"none",marginLeft:0}}})),Xc=_i(R.TabbedForm,{name:"RaApplicaTabbedForm",slot:"Root"})(()=>({}));Xc.propTypes={...R.TabbedForm.propTypes};Xc.defaultProps={...R.TabbedForm.defaultProps};Xc.Tab=R.TabbedForm.Tab;const iy=O.createContext(void 0),n8=O.createContext(void 0),r8=()=>O.useContext(iy),o8=N.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:i=!1,index:a,member:l,resource:u}=e,A=R.useTranslate(),[f,p]=N.useState(!1),{total:C,remove:h}=r8(),E=N.useCallback(()=>{p(!1),h(a)},[a,h]),I=O.useMemo(()=>({index:a,total:C,remove:()=>h(a)}),[a,C,h]);return g.jsxs(n8.Provider,{value:I,children:[O.Children.map(n,(B,v)=>{if(!O.isValidElement(B))return null;const{source:S,...M}=B.props;return g.jsx(b.TableCell,{sx:{border:0,verticalAlign:"top"},children:O.cloneElement(B,{source:S?`${l}.${S}`:l,index:S?void 0:v,resource:u,disabled:r,...M,label:!1})})}),!i&&g.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",border:0,pt:2},children:g.jsx(Ji,{horizontal:!0,children:g.jsx(b.Typography,{color:"error",onClick:()=>p(!0),children:A("ra.action.delete")})})}),n.length>0&&g.jsx(R.Confirm,{isOpen:f,title:A("ra.action.remove_item"),content:A("ra.message.remove_item"),onConfirm:E,onClose:()=>p(!1)})]})});var i8=Array.isArray,mg=i8,s8=typeof Un=="object"&&Un&&Un.Object===Object&&Un,a8=s8,l8=a8,c8=typeof self=="object"&&self&&self.Object===Object&&self,u8=l8||c8||Function("return this")(),Eg=u8,A8=Eg,d8=A8.Symbol,Ig=d8,BE=Ig,sy=Object.prototype,f8=sy.hasOwnProperty,g8=sy.toString,Ss=BE?BE.toStringTag:void 0;function p8(e){var t=f8.call(e,Ss),n=e[Ss];try{e[Ss]=void 0;var r=!0}catch{}var i=g8.call(e);return r&&(t?e[Ss]=n:delete e[Ss]),i}var h8=p8,C8=Object.prototype,m8=C8.toString;function E8(e){return m8.call(e)}var I8=E8,yE=Ig,B8=h8,y8=I8,v8="[object Null]",b8="[object Undefined]",vE=yE?yE.toStringTag:void 0;function Q8(e){return e==null?e===void 0?b8:v8:vE&&vE in Object(e)?B8(e):y8(e)}var ay=Q8;function x8(e){return e!=null&&typeof e=="object"}var w8=x8,T8=ay,P8=w8,R8="[object Symbol]";function S8(e){return typeof e=="symbol"||P8(e)&&T8(e)==R8}var Bg=S8,O8=mg,D8=Bg,M8=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j8=/^\w*$/;function k8(e,t){if(O8(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||D8(e)?!0:j8.test(e)||!M8.test(e)||t!=null&&e in Object(t)}var F8=k8;function L8(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ly=L8,N8=ay,V8=ly,H8="[object AsyncFunction]",z8="[object Function]",W8="[object GeneratorFunction]",U8="[object Proxy]";function Y8(e){if(!V8(e))return!1;var t=N8(e);return t==z8||t==W8||t==H8||t==U8}var G8=Y8,K8=Eg,q8=K8["__core-js_shared__"],_8=q8,ZA=_8,bE=function(){var e=/[^.]+$/.exec(ZA&&ZA.keys&&ZA.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function J8(e){return!!bE&&bE in e}var X8=J8,Z8=Function.prototype,$8=Z8.toString;function e6(e){if(e!=null){try{return $8.call(e)}catch{}try{return e+""}catch{}}return""}var t6=e6,n6=G8,r6=X8,o6=ly,i6=t6,s6=/[\\^$.*+?()[\]{}|]/g,a6=/^\[object .+?Constructor\]$/,l6=Function.prototype,c6=Object.prototype,u6=l6.toString,A6=c6.hasOwnProperty,d6=RegExp("^"+u6.call(A6).replace(s6,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f6(e){if(!o6(e)||r6(e))return!1;var t=n6(e)?d6:a6;return t.test(i6(e))}var g6=f6;function p6(e,t){return e==null?void 0:e[t]}var h6=p6,C6=g6,m6=h6;function E6(e,t){var n=m6(e,t);return C6(n)?n:void 0}var cy=E6,I6=cy,B6=I6(Object,"create"),Zc=B6,QE=Zc;function y6(){this.__data__=QE?QE(null):{},this.size=0}var v6=y6;function b6(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Q6=b6,x6=Zc,w6="__lodash_hash_undefined__",T6=Object.prototype,P6=T6.hasOwnProperty;function R6(e){var t=this.__data__;if(x6){var n=t[e];return n===w6?void 0:n}return P6.call(t,e)?t[e]:void 0}var S6=R6,O6=Zc,D6=Object.prototype,M6=D6.hasOwnProperty;function j6(e){var t=this.__data__;return O6?t[e]!==void 0:M6.call(t,e)}var k6=j6,F6=Zc,L6="__lodash_hash_undefined__";function N6(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=F6&&t===void 0?L6:t,this}var V6=N6,H6=v6,z6=Q6,W6=S6,U6=k6,Y6=V6;function es(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}es.prototype.clear=H6;es.prototype.delete=z6;es.prototype.get=W6;es.prototype.has=U6;es.prototype.set=Y6;var G6=es;function K6(){this.__data__=[],this.size=0}var q6=K6;function _6(e,t){return e===t||e!==e&&t!==t}var J6=_6,X6=J6;function Z6(e,t){for(var n=e.length;n--;)if(X6(e[n][0],t))return n;return-1}var $c=Z6,$6=$c,eF=Array.prototype,tF=eF.splice;function nF(e){var t=this.__data__,n=$6(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():tF.call(t,n,1),--this.size,!0}var rF=nF,oF=$c;function iF(e){var t=this.__data__,n=oF(t,e);return n<0?void 0:t[n][1]}var sF=iF,aF=$c;function lF(e){return aF(this.__data__,e)>-1}var cF=lF,uF=$c;function AF(e,t){var n=this.__data__,r=uF(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var dF=AF,fF=q6,gF=rF,pF=sF,hF=cF,CF=dF;function ts(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ts.prototype.clear=fF;ts.prototype.delete=gF;ts.prototype.get=pF;ts.prototype.has=hF;ts.prototype.set=CF;var mF=ts,EF=cy,IF=Eg,BF=EF(IF,"Map"),yF=BF,xE=G6,vF=mF,bF=yF;function QF(){this.size=0,this.__data__={hash:new xE,map:new(bF||vF),string:new xE}}var xF=QF;function wF(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var TF=wF,PF=TF;function RF(e,t){var n=e.__data__;return PF(t)?n[typeof t=="string"?"string":"hash"]:n.map}var eu=RF,SF=eu;function OF(e){var t=SF(this,e).delete(e);return this.size-=t?1:0,t}var DF=OF,MF=eu;function jF(e){return MF(this,e).get(e)}var kF=jF,FF=eu;function LF(e){return FF(this,e).has(e)}var NF=LF,VF=eu;function HF(e,t){var n=VF(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var zF=HF,WF=xF,UF=DF,YF=kF,GF=NF,KF=zF;function ns(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ns.prototype.clear=WF;ns.prototype.delete=UF;ns.prototype.get=YF;ns.prototype.has=GF;ns.prototype.set=KF;var qF=ns,uy=qF,_F="Expected a function";function yg(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(_F);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var l=e.apply(this,r);return n.cache=a.set(i,l)||a,l};return n.cache=new(yg.Cache||uy),n}yg.Cache=uy;var JF=yg,XF=JF,ZF=500;function $F(e){var t=XF(e,function(r){return n.size===ZF&&n.clear(),r}),n=t.cache;return t}var eL=$F,tL=eL,nL=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rL=/\\(\\)?/g,oL=tL(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(nL,function(n,r,i,a){t.push(i?a.replace(rL,"$1"):r||n)}),t}),iL=oL;function sL(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var aL=sL,wE=Ig,lL=aL,cL=mg,uL=Bg,AL=1/0,TE=wE?wE.prototype:void 0,PE=TE?TE.toString:void 0;function Ay(e){if(typeof e=="string")return e;if(cL(e))return lL(e,Ay)+"";if(uL(e))return PE?PE.call(e):"";var t=e+"";return t=="0"&&1/e==-AL?"-0":t}var dL=Ay,fL=dL;function gL(e){return e==null?"":fL(e)}var pL=gL,hL=mg,CL=F8,mL=iL,EL=pL;function IL(e,t){return hL(e)?e:CL(e,t)?[e]:mL(EL(e))}var BL=IL,yL=Bg,vL=1/0;function bL(e){if(typeof e=="string"||yL(e))return e;var t=e+"";return t=="0"&&1/e==-vL?"-0":t}var QL=bL,xL=BL,wL=QL;function TL(e,t){t=xL(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[wL(t[n++])];return n&&n==r?e:void 0}var PL=TL,RL=PL;function SL(e,t,n){var r=e==null?void 0:RL(e,t);return r===void 0?n:r}var OL=SL;const DL=Gi(OL),dy=e=>{const{children:t,resource:n,source:r,label:i,disableActions:a=!1,disableAdd:l=!1,disableRemove:u=!1,className:A,empty:f}=e,[p,C]=O.useState(!1),{fields:h,remove:E,replace:I}=R.useArrayInput(e),B=Tt(),v=be.useTranslate(),S=be.useRecordContext(e),M=O.useRef({}),x=be.useTranslateLabel(),T=O.useCallback(q=>{E(q)},[E]);if(h.length>0){const{...q}=h[0];M.current=q;for(const U in M.current)M.current[U]=null}const P=O.useCallback(()=>{I([]),C(!1)},[I]),F=DL(S,r),j=O.useMemo(()=>({total:h.length,remove:T,source:r}),[h.length,T,r]),K=B.palette.mode==="dark"?B.palette.grey.A400:B.palette.grey.A800;return h?g.jsx(iy.Provider,{value:j,children:g.jsxs("div",{className:A,children:[g.jsx(fy,{label:i,source:r,disableAdd:l}),g.jsx(b.TableContainer,{component:b.Paper,sx:{mt:2,border:`1px solid ${K}`},children:g.jsxs(b.Table,{children:[g.jsx(b.TableHead,{sx:{borderTop:0,borderBottom:`1px solid ${K}`},children:g.jsxs(b.TableRow,{children:[O.Children.map(t,(q,U)=>N.isValidElement(q)?g.jsx(b.TableCell,{children:g.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none",children:x({...q.props,resource:n})})},U):null),!a&&g.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"top"},children:g.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none"})},"actions")]})}),g.jsxs(b.TableBody,{children:[h.length===0&&g.jsx(b.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0}},children:g.jsx(b.TableCell,{colSpan:4+(a?0:1),align:"center",children:f||g.jsx(b.Typography,{variant:"body1",color:"text.secondary",children:"-"})})}),h.length>0&&h.map((q,U)=>g.jsx(b.TableRow,{sx:{borderBottom:`1px solid ${K}}`},children:g.jsx(o8,{disableRemove:u,disableActions:a,index:U,member:`${r}.${U}`,onRemoveField:T,record:F&&F[U]||{},resource:n,source:r,children:t})},q.id))]})]})}),h.length>0&&g.jsx(R.Confirm,{isOpen:p,title:v("ra.action.clear_array_input"),content:v("ra.message.clear_array_input"),onConfirm:P,onClose:()=>C(!1)})]})}):null},fy=e=>{const{label:t,disableAdd:n}=e,{append:r}=R.useArrayInput(e),i=Tt(),a=i.palette.mode==="dark"?i.palette.grey.A400:i.palette.grey.A800,l=i.palette.mode==="light"?"#000000":"#FFFFFF";return g.jsxs(b.Stack,{justifyContent:"space-between",alignItems:"center",flexDirection:"row",children:[g.jsx(b.Typography,{children:t}),!n&&g.jsx(b.IconButton,{size:"small",color:"secondary",sx:{border:`1px solid ${a}`},onClick:()=>r({}),children:g.jsx(ot.PlusCircleOutlined,{style:{color:l}})})]})},ML=ce(dy,{name:"RaApplicaTableFormIterator",slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8)})`}}}));fy.propTypes={label:c.string.isRequired,source:c.string.isRequired};dy.propTypes={addButton:c.element,children:c.node,className:c.string,field:c.object,fields:c.array,fieldState:c.object,formState:c.object,record:c.object,source:c.string,label:c.string,resource:c.string,translate:c.func,disableAdd:c.bool,disableRemove:c.oneOfType([c.func,c.bool]),TransitionProps:c.shape({}),empty:c.oneOfType([c.node,c.string])};function jL(e,t){const n=gt.clone(e),{type:r,payload:i}=t;switch(r){case"updateMedia":{const a=gt.chain(n.media).clone().extend(i).value();return gt.extend(n,{media:a})}case"updateDrawer":{const a=gt.chain(n.drawer).clone().extend(i).value();return gt.extend(n,{drawer:a})}case"updateLogo":{const a=gt.chain(n.logo).clone().extend(i).value();return gt.extend(n,{logo:a})}case"updateNotifications":{const a=gt.chain(n.notifications).clone().extend(i).value();return gt.extend(n,{notifications:a})}case"updateTheme":{const a=gt.chain(n.theme).clone().extend(i).value();return gt.extend(n,{theme:a})}default:return n}}const kL={drawer:{open:!0,width:260,handleDrawerToggle:()=>{}},media:{downMd:!1,downLg:!1,downXl:!1,horizontal:!1},logo:{},notifications:{enable:!0,resource:"entities/notification"},theme:{iconColor:"grey.300",iconColorOpen:"grey.100"}},gy=O.createContext(void 0);function py(e){var K;const t=be.useGetIdentity(),n=b.useTheme(),r=b.useMediaQuery(n.breakpoints.down("md")),i=b.useMediaQuery(n.breakpoints.down("lg")),a=b.useMediaQuery(n.breakpoints.down("xl")),{miniDrawer:l,isHorizontalLayout:u,menuOrientation:A,drawerWidth:f}=Zn(),p=u(A)&&!i,{drawerOpen:C,openDrawer:h}=fo(),E=O.useCallback(()=>{h(!C)},[C,h]),[I,B]=O.useState(!1),[v,S]=O.useReducer(jL,gt.chain(kL).clone().merge({drawer:{open:!l||C}}).value()),M=O.useCallback(()=>B(!1),[]),x=O.useMemo(()=>({state:v,dispatch:S}),[v,S]),{logoIcon:T,logoMain:P,enableNotification:F,notification:j}=e;return O.useEffect(()=>{S({type:"updateMedia",payload:{downMd:r,downLg:i,downXl:a,horizontal:p}})},[A,r,i,a]),O.useEffect(()=>{S({type:"updateDrawer",payload:{open:C,width:f,handleDrawerToggle:E}})},[C,f,E]),O.useEffect(()=>{l||h(!a)},[a,l]),O.useEffect(()=>{S({type:"updateLogo",payload:{main:P,icon:T}})},[T,P]),O.useEffect(()=>{S({type:"updateNotifications",payload:{enable:F,resource:j??"entities/notification"}})},[F,j]),O.useEffect(()=>{S({type:"updateTheme",payload:{iconColorOpen:n.palette.mode==="dark"?"grey.200":"grey.300",iconColor:n.palette.mode==="dark"?"background.default":"grey.100"}})},[n.palette.mode]),O.useEffect(()=>{var q;B(((q=t==null?void 0:t.data)==null?void 0:q.needToChangePassword)===!0)},[(K=t==null?void 0:t.data)==null?void 0:K.needToChangePassword]),g.jsxs(gy.Provider,{value:x,children:[g.jsx(b.Dialog,{open:I,maxWidth:"xs",fullWidth:!0,children:g.jsx(pg,{onSuccess:M,firstAccess:!0})}),e.children]})}function hy(e){return O.forwardRef((t,n)=>{const{logoIcon:r,logoMain:i,enableNotification:a}=t;return g.jsx(py,{logoIcon:r,logoMain:i,enableNotification:a,children:g.jsx(e,{ref:n,...t})})})}function vg(){const e=O.useContext(gy);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function FL(){return vg().dispatch}function rs(){return vg().state}function $n(){return rs().media}function $o(){return rs().drawer}function Cy(){return rs().logo}function tu(){return rs().notifications}function nu(){return rs().theme}function my(){const{iconColor:e,iconColorOpen:t}=nu(),{open:n,handleDrawerToggle:r}=$o();return g.jsx(ho,{"aria-label":"open drawer",onClick:r,edge:"start",color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:n?t:e,ml:{xs:0,lg:-2}},children:n?g.jsx(ot.MenuFoldOutlined,{}):g.jsx(ot.MenuUnfoldOutlined,{})})}function Ey(e){const t=O.useRef(),n=b.useTheme(),{downLg:r,horizontal:i}=$n(),{open:a,width:l}=$o(),u=r?b.AppBar:$0,A=Xi(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:i?"100%":a?`calc(100% - ${l}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),f={position:"fixed",color:"inherit",elevation:0,sx:A};return r||gt.extend(f,{open:a}),g.jsx(u,{ref:t,...f,children:g.jsxs(b.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!i&&g.jsx(my,{}),e.children]})})}function LL(e){const t=b.useTheme(),{notification:n,onClick:r,selected:i,divider:a}=e,{resource:l}=tu(),u=be.useNotify(),A=be.useRedirect(),[f]=be.useUpdate(l,{id:n==null?void 0:n.id,data:{...n,readed:Hr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n!=null&&n.resource?n!=null&&n.resource.startsWith("/")?(A(n==null?void 0:n.resource),r()):document.location.href=n==null?void 0:n.resource:r()},onFailure:()=>{u("resources.notifications.messages.readed.error","warning")}}),p=O.useCallback(()=>f(),[f]),[C]=be.useLocaleState(),h=O.useMemo(()=>Hr(n.created).locale(C).fromNow(),[n,C]);return g.jsx(b.ListItem,{disablePadding:!0,divider:a,children:g.jsxs(b.ListItemButton,{selected:i,onClick:p,children:[g.jsx(b.ListItemAvatar,{children:g.jsx(b.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:g.jsx(ot.MessageOutlined,{})})}),g.jsx(b.ListItemText,{primary:n.title,secondary:n.content}),g.jsx(b.Box,{flexGrow:1,flexShrink:1,minWidth:t.spacing(2)}),g.jsx(b.ListItemText,{primary:h,primaryTypographyProps:{variant:"caption"}})]})})}const NL={width:36,height:36,fontSize:"1rem"},VL={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function Iy(){const{enable:e}=tu();return e?g.jsx(HL,{}):null}function HL(){const e=b.useTheme(),t=O.useRef(),{resource:n}=tu(),{downMd:r}=$n(),{iconColor:i,iconColorOpen:a}=nu(),[l,u]=O.useState(!1),[A,f]=O.useState([]),p=A.filter(B=>B.readed===null).length,C=O.useCallback(()=>u(!l),[l]),h=O.useCallback(()=>{t.current&&t.current.contains(event.target)||u(!1)},[t.current,u]),{data:E,isLoading:I}=be.useGetList(n,{pagination:{page:1,perPage:50},sort:{field:"created",order:"DESC"},filter:{readed:!1}});return O.useEffect(()=>{!I&&E&&f(E??[])},[E,I]),g.jsxs(b.Box,{sx:{flexShrink:0},children:[g.jsx(ho,{color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:l?a:i},"aria-label":"open profile",ref:t,"aria-controls":l?"profile-grow":void 0,"aria-haspopup":"true",onClick:C,children:g.jsx(b.Badge,{badgeContent:p,color:"primary",children:g.jsx(ot.BellOutlined,{})})}),g.jsx(b.Popper,{placement:r?"bottom":"bottom-end",open:l,anchorEl:t.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[r?-5:0,9]}}]},children:({TransitionProps:B})=>g.jsx(Co,{type:"grow",position:r?"top":"top-right",in:open,...B,children:g.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:"100%",minWidth:285,maxWidth:420,[e.breakpoints.down("md")]:{maxWidth:285}},children:g.jsx(b.ClickAwayListener,{onClickAway:h,children:g.jsx(Yn,{title:"Notification",elevation:0,border:!1,content:!1,secondary:g.jsx(g.Fragment,{children:p>0&&g.jsx(b.Tooltip,{title:"Mark as all read",children:g.jsx(ho,{color:"success",size:"small",children:g.jsx(ot.CheckCircleOutlined,{style:{fontSize:"1.15rem"}})})})}),children:g.jsx(b.List,{component:"nav",sx:{p:0,"& .MuiListItemButton-root":{py:.5,"&.Mui-selected":{bgcolor:"grey.50",color:"text.primary"},"& .MuiAvatar-root":NL,"& .MuiListItemSecondaryAction-root":{...VL,position:"relative"}}},children:A.map((v,S)=>g.jsx(LL,{selected:p>0,notification:v,onClick:h,divider:S<A.length-1},v.id))})})})})})})]})}const zL=()=>{const[e,t]=O.useState(!1),n=O.useCallback(()=>t(!1),[t]),r=O.useCallback(()=>t(!0),[t]),i=be.useTranslate();return g.jsxs(O.Fragment,{children:[g.jsxs(b.ListItemButton,{onClick:r,children:[g.jsx(b.ListItemIcon,{children:g.jsx(_n.Key,{})}),g.jsx(b.ListItemText,{primary:i("ra.auth.change_password")})]}),g.jsx(b.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:g.jsx(pg,{onSuccess:n})})]})},WL=()=>{const e=be.useLogout(),t=be.useTranslate();return g.jsx(O.Fragment,{children:g.jsxs(b.ListItemButton,{onClick:e,children:[g.jsx(b.ListItemIcon,{children:g.jsx(_n.LogoutOutlined,{})}),g.jsx(b.ListItemText,{primary:t("ra.auth.logout")})]})})},UL=()=>{const e=be.useTranslate(),t=be.useAuthProvider(),n=O.useCallback(()=>t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,i]=O.useState(!1);return O.useEffect(()=>{t.isImpersonating&&t.isImpersonating().then(a=>i(a))},[t,i]),r?g.jsx(O.Fragment,{children:g.jsxs(b.ListItemButton,{onClick:n,children:[g.jsx(b.ListItemIcon,{children:g.jsx(_n.LogoutOutlined,{})}),g.jsx(b.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};c.node,c.any.isRequired,c.any.isRequired;const By=()=>{var B;const e=b.useTheme(),{identity:t}=R.useGetIdentity(),n=t!==void 0&&t.image&&t.image!==null&&t.image!=="",r=O.useRef(null),[i,a]=O.useState(!1),l=()=>{a(v=>!v)},u=v=>{r.current&&r.current.contains(v.target)||a(!1)},A=e.palette.mode==="dark"?"grey.200":"grey.300",f=R.useLogout(),p=R.useDataProvider(),C=R.useAuthProvider(),h=O.useCallback(()=>{f()},[C,f]),[E,I]=O.useState(null);return O.useEffect(()=>{if(!n)return;async function v(){var S=await p.getFile("/profile/me/image");I(S)}v()},[p,n]),g.jsxs(b.Box,{sx:{flexShrink:0},children:[g.jsx(b.ButtonBase,{sx:{p:.25,bgcolor:i?A:"transparent",borderRadius:1,"&:hover":{bgcolor:e.palette.mode==="dark"?"secondary.light":"secondary.lighter"},"&:focus-visible":{outline:`2px solid ${e.palette.secondary.dark}`,outlineOffset:2}},"aria-label":"open profile",ref:r,"aria-controls":i?"profile-grow":void 0,"aria-haspopup":"true",onClick:l,children:g.jsxs(b.Stack,{direction:"row",spacing:2,alignItems:"center",sx:{p:.5},children:[g.jsx(sc,{alt:(B=t==null?void 0:t.name)==null?void 0:B.toUpperCase(),src:E,size:"xs"}),g.jsx(b.Typography,{variant:"subtitle1",children:t==null?void 0:t.name})]})}),g.jsx(b.Popper,{placement:"bottom-end",open:i,anchorEl:r.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:v})=>{var S;return g.jsx(Co,{type:"grow",position:"top-right",in:i,...v,children:g.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:290,minWidth:240,maxWidth:290,[e.breakpoints.down("md")]:{maxWidth:250}},children:g.jsx(b.ClickAwayListener,{onClickAway:u,children:g.jsxs(Yn,{elevation:0,border:!1,content:!1,children:[g.jsx(b.CardContent,{sx:{px:2.5,pt:3},children:g.jsxs(b.Grid,{container:!0,justifyContent:"space-between",alignItems:"center",children:[g.jsx(b.Grid,{item:!0,children:g.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[g.jsx(sc,{alt:"profile user",src:E,sx:{width:32,height:32}}),g.jsxs(b.Stack,{children:[g.jsx(b.Typography,{variant:"h6",children:t==null?void 0:t.name}),g.jsx(b.Typography,{variant:"body2",color:"textSecondary",children:(S=t==null?void 0:t.roles)==null?void 0:S.map(M=>M.name.replace("ROLE_","")).join(",")})]})]})}),g.jsx(b.Grid,{item:!0,children:g.jsx(b.Tooltip,{title:"Logout",children:g.jsx(ho,{size:"large",sx:{color:"text.primary"},onClick:h,children:g.jsx(ot.LogoutOutlined,{})})})})]})}),g.jsx(b.Grid,{container:!0,children:g.jsx(b.Grid,{item:!0,xs:12,children:g.jsxs(b.List,{component:"nav",sx:{p:0,"& .MuiListItemIcon-root":{minWidth:32}},children:[g.jsx(zL,{}),g.jsx(WL,{}),g.jsx(UL,{})]})})})]})})})})}})]})},yy=e=>{const t=Tt(),{downMd:n}=$n(),{iconColor:r,iconColorOpen:i}=nu(),[a,l]=O.useState(!1),u=O.useRef(null),A=O.useCallback(()=>{l(!a)},[a]),f=O.useCallback(p=>{u.current&&u.current.contains(p.target)||l(!1)},[]);return n?g.jsxs(g.Fragment,{children:[g.jsx(b.Box,{sx:{flexShrink:0},children:g.jsx(ho,{sx:{color:"text.primary",bgcolor:a?i:r},"aria-label":"open more menu",ref:u,"aria-controls":a?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:A,color:"secondary",variant:"light",children:g.jsx(ot.MoreOutlined,{})})}),g.jsx(b.Popper,{placement:"bottom-end",open:a,anchorEl:u.current,role:void 0,transition:!0,disablePortal:!0,style:{width:"100%"},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:p})=>g.jsx(Co,{type:"fade",in:a,...p,children:g.jsx(b.Paper,{sx:{boxShadow:t.customShadows.z1},children:g.jsx(b.ClickAwayListener,{onClickAway:f,children:g.jsx(b.AppBar,{color:"inherit",children:g.jsx(b.Toolbar,{children:e.children})})})})})})]}):g.jsx(g.Fragment,{children:e.children})};function vy(e){return g.jsx(b.Box,{...e,flex:1})}function ha(e){const{name:t,version:n}=e;return g.jsx(b.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:"24px 16px 0px",mt:"auto"},children:g.jsxs(b.Typography,{variant:"caption",children:[g.jsx("span",{dangerouslySetInnerHTML:{__html:(e==null?void 0:e.copy)||""}})," ",t," - ",n]})})}ha.propTypes={name:c.string.isRequired,version:c.string.isRequired,copy:c.string};ha.defaultProps={copy:"© Applica Software Guru for"};function by(e){const{width:t}=$o(),{horizontal:n}=$n(),{container:r}=Zn();return g.jsxs(b.Box,{component:"main",sx:{width:`calc(100% - ${t}px)`,flexGrow:1,p:{xs:0,sm:2,lg:1},pt:{lg:2}},children:[g.jsx(b.Toolbar,{sx:{mt:n?8:"inherit"}})," ",g.jsx(b.Container,{maxWidth:r?"xl":!1,sx:{...r&&{px:{xs:0,sm:2}},position:"relative",minHeight:"calc(100vh - 110px)",display:"flex",flexDirection:"column"},children:e.children})]})}const Qy=O.forwardRef((e,t)=>{const n=Xi(e,{display:"flex",width:"100%"});return g.jsx(b.Box,{ref:t,...e,sx:n,children:e.children})});var xy={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(xy);var YL=xy.exports,$A={};const GL=KP(Tk);var RE;function KL(){return RE||(RE=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=GL}($A)),$A}function wy(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=wy(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function qL(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=wy(e))&&(r&&(r+=" "),r+=t);return r}var Fd=globalThis&&globalThis.__assign||function(){return Fd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Fd.apply(this,arguments)},_L=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Ty=function(e){var t=e.className,n=e.sx,r=_L(e,["className","sx"]),i=be.useLoading(),a=Tt();return N.createElement(JL,{className:t,sx:n},i?N.createElement(kB,Fd({className:qL("app-loader",uc.loader),color:"inherit",size:a.spacing(2),thickness:6},r)):N.createElement(_y,{className:uc.loadedIcon}))};Ty.propTypes={classes:c.object,className:c.string,width:c.string};var Ld="RaLoadingIndicator",uc={loader:"".concat(Ld,"-loader"),loadedIcon:"".concat(Ld,"-loadedIcon")},JL=ce("div",{name:Ld,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={},t["& .".concat(uc.loader)]={marginLeft:n.spacing(1.5),marginRight:n.spacing(1.5)},t["& .".concat(uc.loadedIcon)]={},t});const bg=e=>e.scrollTop;function Hi(e,t){var n,r;const{timeout:i,easing:a,style:l={}}=e;return{duration:(n=l.transitionDuration)!=null?n:typeof i=="number"?i:i[t.mode]||0,easing:(r=l.transitionTimingFunction)!=null?r:typeof a=="object"?a[t.mode]:a,delay:l.transitionDelay}}const XL=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function ZL(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),a=qi(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const f=a.getComputedStyle(t);l=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("transform")}let u=0,A=0;if(l&&l!=="none"&&typeof l=="string"){const f=l.split("(")[1].split(")")[0].split(",");u=parseInt(f[4],10),A=parseInt(f[5],10)}return e==="left"?i?`translateX(${i.right+u-r.left}px)`:`translateX(${a.innerWidth+u-r.left}px)`:e==="right"?i?`translateX(-${r.right-i.left-u}px)`:`translateX(-${r.left+r.width-u}px)`:e==="up"?i?`translateY(${i.bottom+A-r.top}px)`:`translateY(${a.innerHeight+A-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-A}px)`:`translateY(-${r.top+r.height-A}px)`}function Py(e){return typeof e=="function"?e():e}function wl(e,t,n){const r=Py(n),i=ZL(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const Ry=N.forwardRef(function(t,n){const r=Tt(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},a={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:u=!0,children:A,container:f,direction:p="down",easing:C=i,in:h,onEnter:E,onEntered:I,onEntering:B,onExit:v,onExited:S,onExiting:M,style:x,timeout:T=a,TransitionComponent:P=Hf}=t,F=Ge(t,XL),j=N.useRef(null),K=Rn(A.ref,j,n),q=k=>ee=>{k&&(ee===void 0?k(j.current):k(j.current,ee))},U=q((k,ee)=>{wl(p,k,f),bg(k),E&&E(k,ee)}),$=q((k,ee)=>{const z=Hi({timeout:T,style:x,easing:C},{mode:"enter"});k.style.webkitTransition=r.transitions.create("-webkit-transform",W({},z)),k.style.transition=r.transitions.create("transform",W({},z)),k.style.webkitTransform="none",k.style.transform="none",B&&B(k,ee)}),ae=q(I),ie=q(M),X=q(k=>{const ee=Hi({timeout:T,style:x,easing:C},{mode:"exit"});k.style.webkitTransition=r.transitions.create("-webkit-transform",ee),k.style.transition=r.transitions.create("transform",ee),wl(p,k,f),v&&v(k)}),G=q(k=>{k.style.webkitTransition="",k.style.transition="",S&&S(k)}),H=k=>{l&&l(j.current,k)},J=N.useCallback(()=>{j.current&&wl(p,j.current,f)},[p,f]);return N.useEffect(()=>{if(h||p==="down"||p==="right")return;const k=Q0(()=>{j.current&&wl(p,j.current,f)}),ee=qi(j.current);return ee.addEventListener("resize",k),()=>{k.clear(),ee.removeEventListener("resize",k)}},[p,h,f]),N.useEffect(()=>{h||J()},[h,J]),g.jsx(P,W({nodeRef:j,onEnter:U,onEntered:ae,onEntering:$,onExit:X,onExited:G,onExiting:ie,addEndListener:H,appear:u,in:h,timeout:T},F,{children:(k,ee)=>N.cloneElement(A,W({ref:K,style:W({visibility:k==="exited"&&!h?"hidden":void 0},x,A.props.style)},ee))}))});process.env.NODE_ENV!=="production"&&(Ry.propTypes={addEndListener:c.func,appear:c.bool,children:Ki.isRequired,container:Wr(c.oneOfType([Ko,c.func]),e=>{if(e.open){const t=Py(e.container);if(t&&t.nodeType===1){const n=t.getBoundingClientRect();if(process.env.NODE_ENV!=="test"&&n.top===0&&n.left===0&&n.right===0&&n.bottom===0)return new Error(["MUI: The `container` prop provided to the component is invalid.","The anchor element should be part of the document layout.","Make sure the element is present in the document or that it's not display none."].join(`
|
|
202
|
+
`),zk)),jB=N.forwardRef(function(t,n){const r=_t({props:t,name:"MuiCircularProgress"}),{className:i,color:a="primary",disableShrink:l=!1,size:u=40,style:A,thickness:f=3.6,value:p=0,variant:C="indeterminate"}=r,h=Ge(r,Vk),E=W({},r,{color:a,disableShrink:l,size:u,thickness:f,value:p,variant:C}),I=Wk(E),B={},v={},S={};if(C==="determinate"){const M=2*Math.PI*((to-f)/2);B.strokeDasharray=M.toFixed(3),S["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*M).toFixed(3)}px`,v.transform="rotate(-90deg)"}return g.jsx(Uk,W({className:Je(I.root,i),style:W({width:u,height:u},v,A),ownerState:E,ref:n,role:"progressbar"},S,h,{children:g.jsx(Yk,{className:I.svg,ownerState:E,viewBox:`${to/2} ${to/2} ${to} ${to}`,children:g.jsx(Gk,{className:I.circle,style:B,ownerState:E,cx:to,cy:to,r:(to-f)/2,fill:"none",strokeWidth:f})})}))});process.env.NODE_ENV!=="production"&&(jB.propTypes={classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","primary","secondary","error","info","success","warning"]),c.string]),disableShrink:Wr(c.bool,e=>e.disableShrink&&e.variant&&e.variant!=="indeterminate"?new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect."):null),size:c.oneOfType([c.number,c.string]),style:c.object,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),thickness:c.number,value:c.number,variant:c.oneOf(["determinate","indeterminate"])});const kB=jB;function Kk(e){return zt("MuiLoadingButton",e)}const qk=qt("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),Or=qk,_k=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],Jk=e=>{const{loading:t,loadingPosition:n,classes:r}=e,i={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Te(n)}`],endIcon:[t&&`endIconLoading${Te(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Te(n)}`]},a=Cr.unstable_composeClasses(i,Kk,r);return W({},r,a)},Xk=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",Zk=ce(Lk,{shouldForwardProp:e=>Xk(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Or.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Or.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>W({[`& .${Or.startIconLoadingStart}, & .${Or.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},e.loadingPosition==="center"&&{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${Or.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Or.startIconLoadingStart}, & .${Or.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Or.startIconLoadingStart}, & .${Or.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),$k=ce("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Te(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>W({position:"absolute",visibility:"visible",display:"flex"},t.loadingPosition==="start"&&(t.variant==="outlined"||t.variant==="contained")&&{left:t.size==="small"?10:14},t.loadingPosition==="start"&&t.variant==="text"&&{left:6},t.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},t.loadingPosition==="end"&&(t.variant==="outlined"||t.variant==="contained")&&{right:t.size==="small"?10:14},t.loadingPosition==="end"&&t.variant==="text"&&{right:6},t.loadingPosition==="start"&&t.fullWidth&&{position:"relative",left:-10},t.loadingPosition==="end"&&t.fullWidth&&{position:"relative",right:-10})),FB=N.forwardRef(function(t,n){const r=_t({props:t,name:"MuiLoadingButton"}),{children:i,disabled:a=!1,id:l,loading:u=!1,loadingIndicator:A,loadingPosition:f="center",variant:p="text"}=r,C=Ge(r,_k),h=Xd(l),E=A??g.jsx(kB,{"aria-labelledby":h,color:"inherit",size:16}),I=W({},r,{disabled:a,loading:u,loadingIndicator:E,loadingPosition:f,variant:p}),B=Jk(I),v=u?g.jsx($k,{className:B.loadingIndicator,ownerState:I,children:E}):null;return g.jsxs(Zk,W({disabled:a||u,id:h,ref:n},C,{variant:p,classes:B,ownerState:I,children:[I.loadingPosition==="end"?i:v,I.loadingPosition==="end"?v:i]}))});process.env.NODE_ENV!=="production"&&(FB.propTypes={children:c.node,classes:c.object,disabled:c.bool,id:c.string,loading:c.bool,loadingIndicator:c.node,loadingPosition:Wr(c.oneOf(["start","end","center"]),e=>e.loadingPosition==="start"&&!e.startIcon?new Error('MUI: The loadingPosition="start" should be used in combination with startIcon.'):e.loadingPosition==="end"&&!e.endIcon?new Error('MUI: The loadingPosition="end" should be used in combination with endIcon.'):null),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["contained","outlined","text"]),c.string])});const e5=FB;function JA({variant:e,theme:t,color:n,loadingPosition:r}){const i=nn(t,n),{lighter:a,main:l,dark:u,contrastText:A}=i,f=`${n}Button`,p=Zi(t,f),C={"& .MuiLoadingButton-loadingIndicator":{color:l}},h={...r&&r!=="center"&&{color:l}},E={"&::after":{boxShadow:`0 0 6px 6px ${Ve(l,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${Ve(l,.9)}`},"&:focus-visible":{outline:`2px solid ${u}`,outlineOffset:2}};switch(e){case"contained":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...E};case"light":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...E};case"shadow":return{boxShadow:p,backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{boxShadow:"none",backgroundColor:u,color:A},...E};case"outlined":return{backgroundColor:"transparent",borderColor:l,...h,...C};case"dashed":return{backgroundColor:a,borderColor:l,...h,...C,...E};case"text":default:return{color:l,...C,...E}}}const t5=ce(e5,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:i,loadingPosition:a})=>({"::after":{content:'""',display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:n==="rounded"?"50%":4,opacity:0,transition:"all 0.5s"},":active::after":{position:"absolute",borderRadius:n==="rounded"?"50%":4,left:0,top:0,opacity:1,transition:"0s"},...t==="text"&&{...JA({variant:t,theme:e,color:r,loadingPosition:a}),"&.MuiButton-sizeMedium":{height:36},"&.MuiButton-sizeSmall":{height:30},"&.MuiButton-sizeLarge":{height:44}},...n&&{minWidth:0,"&.MuiButton-sizeMedium":{width:36,height:36},"&.MuiButton-sizeSmall":{width:30,height:30},"&.MuiButton-sizeLarge":{width:44,height:44},...n==="rounded"&&{borderRadius:"50%"}},...t==="outlined"&&{border:"1px solid"},...t==="dashed"&&{border:"1px dashed"},...(t==="contained"||t==="shadow")&&!i&&{color:"#fff"},...t!=="text"&&{...JA({variant:t,theme:e,color:r,loadingPosition:a})},"&.Mui-disabled":{...t!=="text"&&{...JA({variant:t,theme:e,color:r,loadingPosition:a})}}})),Yf=O.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...i},a)=>{const l=Tt();return g.jsx(t5,{ref:a,variant:e,shape:t,theme:l,loadingPosition:i.loadingPosition,loading:i.loading,color:r,...i,children:n})});Yf.propTypes={variant:c.string,shape:c.string,children:c.node,color:c.string};Yf.displayName="LoadingButton";function n5({color:e,theme:t,labelColor:n}){const r=nn(t,e),{main:i,contrastText:a}=r;let l=e||"";return["primary","secondary","info","success","warning","error"].includes(l)?{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:i,color:n||a},[`& .${b.tooltipClasses.arrow}`]:{color:i}}:{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:l,color:n||a,boxShadow:t.shadows[1]},[`& .${b.tooltipClasses.arrow}`]:{color:l}}}const r5=ce(({className:e,...t})=>g.jsx(b.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&n5({color:t,theme:e,labelColor:n})}));function LB({children:e,arrow:t,labelColor:n="",...r}){const i=Tt();return g.jsx(b.Box,{display:"flex",children:g.jsx(r5,{arrow:t,...r,theme:i,labelColor:n,children:e})})}LB.propTypes={children:c.element,arrow:c.bool,labelColor:c.string,rest:c.array};const Co=O.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...i},a)=>{let l={transformOrigin:"0 0 0"};switch(t){case"top-right":l={transformOrigin:"top right"};break;case"top":l={transformOrigin:"top"};break;case"bottom-left":l={transformOrigin:"bottom left"};break;case"bottom-right":l={transformOrigin:"bottom right"};break;case"bottom":l={transformOrigin:"bottom"};break;case"top-left":default:l={transformOrigin:"0 0 0"};break}return g.jsxs(b.Box,{ref:a,children:[n==="grow"&&g.jsx(b.Grow,{...i,timeout:{appear:0,enter:150,exit:150},children:g.jsx(b.Box,{sx:l,children:e})}),n==="collapse"&&g.jsx(b.Collapse,{...i,sx:l,children:e}),n==="fade"&&g.jsx(b.Fade,{...i,timeout:{appear:0,enter:300,exit:150},children:g.jsx(b.Box,{sx:l,children:e})}),n==="slide"&&g.jsx(b.Slide,{...i,timeout:{appear:0,enter:150,exit:150},direction:r,children:g.jsx(b.Box,{sx:l,children:e})}),n==="zoom"&&g.jsx(b.Zoom,{...i,children:g.jsx(b.Box,{sx:l,children:e})})]})});Co.propTypes={children:c.node,type:c.oneOf(["grow","fade","collapse","slide","zoom"]),position:c.oneOf(["top-left","top-right","top","bottom-left","bottom-right","bottom"]),direction:c.oneOf(["up","down","left","right"])};O.forwardRef(function(t,n){return g.jsx(b.Zoom,{ref:n,timeout:200,...t})});function NB({value:e,...t}){return g.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[g.jsx(b.CircularProgress,{variant:"determinate",value:e,...t}),g.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(e)}%`})})]})}NB.propTypes={value:c.number};function VB({value:e,size:t,variant:n,thickness:r,showLabel:i,pathColor:a,sx:l,...u}){return g.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[g.jsx(b.CircularProgress,{variant:"determinate",sx:{color:a||"grey.200"},size:t,thickness:r,...u,value:100}),i&&g.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:e?`${Math.round(e)}%`:"0%"})}),g.jsx(b.CircularProgress,{variant:n,sx:{...l,position:"absolute",left:0,[`& .${b.circularProgressClasses.circle}`]:{strokeLinecap:"round"}},size:t,thickness:r,value:e,...u})]})}VB.propTypes={value:c.number,size:c.number,variant:c.string,thickness:c.number,showLabel:c.bool,pathColor:c.string,sx:c.array,others:c.array};function HB({icon:e,value:t,...n}){return g.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[g.jsx(b.Box,{sx:{width:"100%",mr:1},children:g.jsx(b.LinearProgress,{variant:"determinate",value:t,...n})}),g.jsx(b.Box,{sx:{minWidth:35},children:e})]})}HB.propTypes={icon:c.node,value:c.number};function zB({value:e,...t}){return g.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[g.jsx(b.Box,{sx:{width:"100%",mr:1},children:g.jsx(b.LinearProgress,{variant:"determinate",value:e,...t})}),g.jsx(b.Box,{sx:{minWidth:35},children:g.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:`${Math.round(e)}%`})})]})}zB.propTypes={value:c.number};const WB=O.createContext({});function o5(e){const{useDefaults:t=!1}=e,n=R.useResourceContext(),r=R.useDataProvider(),{search:i}=Mr.useLocation(),a=`${n}/new`,l=O.useCallback(()=>{if(!t||!gt.isFunction(r.get))return Promise.resolve({});const p={};return new URLSearchParams(i??"").forEach((C,h)=>{p[h]=C}),r.get(a,p).then(C=>C.data).then(C=>{const{responseCode:h,value:E}=C;return h==="ok"?E:Promise.reject(C)})},[n,t,i,r]),{data:u,isLoading:A}=qd.useQuery({queryKey:[n,i],queryFn:l}),f=gt.omit(e,["useDefaults"]);return A?g.jsx(b.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:g.jsx(b.CircularProgress,{})}):g.jsx(WB.Provider,{value:u??{},children:g.jsx(R.Create,{...f})})}function i5(){return O.useContext(WB)}const s5=ce(o5,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"& .RaCreate-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaCreate-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),a5=_i(R.Toolbar,{name:"RaApplicaToolbar",slot:"Root"})(({theme:e})=>({...e.mixins.toolbar,backgroundColor:e.palette.background.paper,justifyContent:"flex-end","& .RaToolbar-defaultToolbar":{justifyContent:"right",paddingBottom:e.spacing(2),"& > *":{marginLeft:e.spacing(1)}},"& .MuiButtonBase-root":{marginLeft:e.spacing(1)}})),Yr=e=>g.jsx(a5,{...e});Yr.defaultProps={...R.Toolbar.defaultProps};Yr.propTypes={...R.Toolbar.propTypes};const Gf=({children:e,content:t,title:n,subheader:r,secondary:i,toolbar:a,...l})=>{const u=R.useTranslate(),A=R.useResourceContext(),{cardTitle:f,cardSubheader:p}=O.useMemo(()=>{const C=n||`resources.${A}.title`;return{cardTitle:u(C,{_:C}),cardSubheader:r!==null?u(r,{_:r}):null}},[A,r,n,u]);return g.jsx(b.Grid,{item:!0,...l,children:g.jsx(Yn,{content:t,title:f,subheader:p,secondary:i,divider:!0,children:g.jsxs(O.Fragment,{children:[e,a===!0?g.jsx(Yr,{children:g.jsx(R.SaveButton,{})}):a]})})})};Gf.defaultProps={...b.Grid.defaultProps,content:!0,subheader:null,title:null,secondary:null,toolbar:!1,item:!0,lg:12,md:12,sm:12,xs:12};Gf.propTypes={...b.Grid.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),contained:c.bool,content:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object]),spacing:c.number,toolbar:c.oneOfType([c.node,c.bool])};const l5=ce(R.Form,{name:"RaApplicaCardForm",slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*2),padding:0}})),Wc=({children:e,spacing:t,defaultValues:n,...r})=>{const{spacing:i}=Zn();return g.jsx(l5,{defaultValues:n,spacing:t||i,children:g.jsx(b.Grid,{container:!0,...r,spacing:t||i,children:e})})};Wc.propTypes={...b.Grid.propTypes,...R.Form.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),spacing:c.number,defaultValues:c.oneOfType([c.object,c.func]),record:c.object,validate:c.func};Wc.defaultProps={...b.Stack.defaultProps};Wc.Section=Gf;const c5=_i(R.SimpleForm,{name:"RaApplicaSimpleForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?2:1)}})),Uc=({title:e,modal:t,content:n,subheader:r,secondary:i,sx:a,...l})=>{const u=Z0(e),A=R.useRecordContext();return g.jsx(Yn,{content:n,title:u,subheader:r,secondary:A!=null&&A.id?i:null,sx:{...a,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!t,divider:!0,children:g.jsx(c5,{toolbar:g.jsx(Yr,{}),...l})})};Uc.defaultProps={modal:!1,content:!1,subheader:null,title:null,toolbar:g.jsx(Yr,{children:g.jsx(R.SaveButton,{type:"button"})}),secondary:g.jsx(Ji,{children:g.jsx(R.DeleteWithConfirmButton,{})})};Uc.propTypes={...R.SimpleForm.propTypes,modal:c.bool,content:c.bool,contained:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object])};const Yc=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:a,divider:l,...u})=>{const A=Kt.useTheme(),{getCurrentDialog:f}=Jo(),{source:p,resource:C,isRequired:h}=u,{getFieldState:E,formState:I}=mc.useFormContext(),{error:B}=E(p,I),v=f();return g.jsxs(b.Stack,{spacing:1,sx:{"& .MuiFormHelperText-root":{color:B?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&a!==!1&&g.jsx(b.InputLabel,{error:!!B,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:g.jsx(R.FieldTitle,{label:e,source:p,resource:v||C,isRequired:h})}),O.isValidElement(t)?O.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&g.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:!!B,children:r})]})};Yc.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool};Yc.defaultProps={display:"label",divider:!1};const u5=ce(R.ArrayInput,{name:"ApplicaArrayInput",slot:"root"})(({theme:e})=>({"& .MuiStack-root > label":{marginTop:e.spacing(2)},"& .MuiInputLabel-shrink":{paddingBottom:0},marginTop:"0 !important","& .RaSimpleFormIterator-line > .RaSimpleFormIterator-form":{paddingBottom:e.spacing(.5),"& > div":{width:"100%"}}})),A5=({label:e,addLabel:t,source:n,helperText:r,divider:i=!0,...a})=>g.jsx(Yc,{label:e,addLabel:t,source:n,helperText:r,divider:i,children:g.jsx(u5,{source:n,label:!1,...a})}),Kf=({canEdit:e,canDelete:t,canClone:n})=>!e&&!t&&!n?null:g.jsxs(Ji,{children:[e&&g.jsx(R.EditButton,{}),t&&g.jsx(R.DeleteWithConfirmButton,{}),n&&g.jsx(R.CloneButton,{})]});Kf.defaultProps={canEdit:!0,canDelete:!0,canClone:!1};Kf.propTypes={canEdit:c.bool,canDelete:c.bool,canClone:c.bool};const EE=ce("div",{name:"ApplicaBaseAttachmentField",overridesResolver:(e,t)=>t.root})({display:"inline-block"}),d5=ce("ul")({display:"inline-block"}),UB=e=>{var p;const{className:t,emptyText:n,source:r,title:i,...a}=e,l=be.useRecordContext(e),u=it.get(l,r),A=be.useTranslate();if(!u)return n?g.jsx(b.Typography,{component:"span",variant:"body2",className:t,...a,children:n&&A(n,{_:n})}):g.jsx(EE,{className:t,...a});if(Array.isArray(u))return g.jsx(d5,{className:t,...a,children:u.map((C,h)=>{var I;const E=i instanceof String?(I=it.get(C,i))==null?void 0:I.toString():i;return g.jsx("li",{children:E},h)})});const f=i instanceof String?(p=it.get(l,i))==null?void 0:p.toString():i;return g.jsx(EE,{className:t,...a,children:f})};UB.propTypes={className:c.string,emptyText:c.string,source:c.string.isRequired,src:c.string,title:c.oneOfType([c.string,c.element]),target:c.string,download:c.oneOfType([c.bool,c.string]),ping:c.string,rel:c.string};var YB={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Un,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",l="second",u="minute",A="hour",f="day",p="week",C="month",h="quarter",E="year",I="date",B="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(X){var G=["th","st","nd","rd"],H=X%100;return"["+X+(G[(H-20)%10]||G[H]||G[0])+"]"}},x=function(X,G,H){var J=String(X);return!J||J.length>=G?X:""+Array(G+1-J.length).join(H)+X},T={s:x,z:function(X){var G=-X.utcOffset(),H=Math.abs(G),J=Math.floor(H/60),k=H%60;return(G<=0?"+":"-")+x(J,2,"0")+":"+x(k,2,"0")},m:function X(G,H){if(G.date()<H.date())return-X(H,G);var J=12*(H.year()-G.year())+(H.month()-G.month()),k=G.clone().add(J,C),ee=H-k<0,z=G.clone().add(J+(ee?-1:1),C);return+(-(J+(H-k)/(ee?k-z:z-k))||0)},a:function(X){return X<0?Math.ceil(X)||0:Math.floor(X)},p:function(X){return{M:C,y:E,w:p,d:f,D:I,h:A,m:u,s:l,ms:a,Q:h}[X]||String(X||"").toLowerCase().replace(/s$/,"")},u:function(X){return X===void 0}},P="en",F={};F[P]=M;var j="$isDayjsObject",K=function(X){return X instanceof ae||!(!X||!X[j])},q=function X(G,H,J){var k;if(!G)return P;if(typeof G=="string"){var ee=G.toLowerCase();F[ee]&&(k=ee),H&&(F[ee]=H,k=ee);var z=G.split("-");if(!k&&z.length>1)return X(z[0])}else{var _=G.name;F[_]=G,k=_}return!J&&k&&(P=k),k||!J&&P},U=function(X,G){if(K(X))return X.clone();var H=typeof G=="object"?G:{};return H.date=X,H.args=arguments,new ae(H)},$=T;$.l=q,$.i=K,$.w=function(X,G){return U(X,{locale:G.$L,utc:G.$u,x:G.$x,$offset:G.$offset})};var ae=function(){function X(H){this.$L=q(H.locale,null,!0),this.parse(H),this.$x=this.$x||H.x||{},this[j]=!0}var G=X.prototype;return G.parse=function(H){this.$d=function(J){var k=J.date,ee=J.utc;if(k===null)return new Date(NaN);if($.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var z=k.match(v);if(z){var _=z[2]-1||0,Ae=(z[7]||"0").substring(0,3);return ee?new Date(Date.UTC(z[1],_,z[3]||1,z[4]||0,z[5]||0,z[6]||0,Ae)):new Date(z[1],_,z[3]||1,z[4]||0,z[5]||0,z[6]||0,Ae)}}return new Date(k)}(H),this.init()},G.init=function(){var H=this.$d;this.$y=H.getFullYear(),this.$M=H.getMonth(),this.$D=H.getDate(),this.$W=H.getDay(),this.$H=H.getHours(),this.$m=H.getMinutes(),this.$s=H.getSeconds(),this.$ms=H.getMilliseconds()},G.$utils=function(){return $},G.isValid=function(){return this.$d.toString()!==B},G.isSame=function(H,J){var k=U(H);return this.startOf(J)<=k&&k<=this.endOf(J)},G.isAfter=function(H,J){return U(H)<this.startOf(J)},G.isBefore=function(H,J){return this.endOf(J)<U(H)},G.$g=function(H,J,k){return $.u(H)?this[J]:this.set(k,H)},G.unix=function(){return Math.floor(this.valueOf()/1e3)},G.valueOf=function(){return this.$d.getTime()},G.startOf=function(H,J){var k=this,ee=!!$.u(J)||J,z=$.p(H),_=function(pe,me){var Qe=$.w(k.$u?Date.UTC(k.$y,me,pe):new Date(k.$y,me,pe),k);return ee?Qe:Qe.endOf(f)},Ae=function(pe,me){return $.w(k.toDate()[pe].apply(k.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(me)),k)},fe=this.$W,le=this.$M,ue=this.$D,ge="set"+(this.$u?"UTC":"");switch(z){case E:return ee?_(1,0):_(31,11);case C:return ee?_(1,le):_(0,le+1);case p:var Ee=this.$locale().weekStart||0,Ce=(fe<Ee?fe+7:fe)-Ee;return _(ee?ue-Ce:ue+(6-Ce),le);case f:case I:return Ae(ge+"Hours",0);case A:return Ae(ge+"Minutes",1);case u:return Ae(ge+"Seconds",2);case l:return Ae(ge+"Milliseconds",3);default:return this.clone()}},G.endOf=function(H){return this.startOf(H,!1)},G.$set=function(H,J){var k,ee=$.p(H),z="set"+(this.$u?"UTC":""),_=(k={},k[f]=z+"Date",k[I]=z+"Date",k[C]=z+"Month",k[E]=z+"FullYear",k[A]=z+"Hours",k[u]=z+"Minutes",k[l]=z+"Seconds",k[a]=z+"Milliseconds",k)[ee],Ae=ee===f?this.$D+(J-this.$W):J;if(ee===C||ee===E){var fe=this.clone().set(I,1);fe.$d[_](Ae),fe.init(),this.$d=fe.set(I,Math.min(this.$D,fe.daysInMonth())).$d}else _&&this.$d[_](Ae);return this.init(),this},G.set=function(H,J){return this.clone().$set(H,J)},G.get=function(H){return this[$.p(H)]()},G.add=function(H,J){var k,ee=this;H=Number(H);var z=$.p(J),_=function(le){var ue=U(ee);return $.w(ue.date(ue.date()+Math.round(le*H)),ee)};if(z===C)return this.set(C,this.$M+H);if(z===E)return this.set(E,this.$y+H);if(z===f)return _(1);if(z===p)return _(7);var Ae=(k={},k[u]=r,k[A]=i,k[l]=n,k)[z]||1,fe=this.$d.getTime()+H*Ae;return $.w(fe,this)},G.subtract=function(H,J){return this.add(-1*H,J)},G.format=function(H){var J=this,k=this.$locale();if(!this.isValid())return k.invalidDate||B;var ee=H||"YYYY-MM-DDTHH:mm:ssZ",z=$.z(this),_=this.$H,Ae=this.$m,fe=this.$M,le=k.weekdays,ue=k.months,ge=k.meridiem,Ee=function(me,Qe,se,He){return me&&(me[Qe]||me(J,ee))||se[Qe].slice(0,He)},Ce=function(me){return $.s(_%12||12,me,"0")},pe=ge||function(me,Qe,se){var He=me<12?"AM":"PM";return se?He.toLowerCase():He};return ee.replace(S,function(me,Qe){return Qe||function(se){switch(se){case"YY":return String(J.$y).slice(-2);case"YYYY":return $.s(J.$y,4,"0");case"M":return fe+1;case"MM":return $.s(fe+1,2,"0");case"MMM":return Ee(k.monthsShort,fe,ue,3);case"MMMM":return Ee(ue,fe);case"D":return J.$D;case"DD":return $.s(J.$D,2,"0");case"d":return String(J.$W);case"dd":return Ee(k.weekdaysMin,J.$W,le,2);case"ddd":return Ee(k.weekdaysShort,J.$W,le,3);case"dddd":return le[J.$W];case"H":return String(_);case"HH":return $.s(_,2,"0");case"h":return Ce(1);case"hh":return Ce(2);case"a":return pe(_,Ae,!0);case"A":return pe(_,Ae,!1);case"m":return String(Ae);case"mm":return $.s(Ae,2,"0");case"s":return String(J.$s);case"ss":return $.s(J.$s,2,"0");case"SSS":return $.s(J.$ms,3,"0");case"Z":return z}return null}(me)||z.replace(":","")})},G.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},G.diff=function(H,J,k){var ee,z=this,_=$.p(J),Ae=U(H),fe=(Ae.utcOffset()-this.utcOffset())*r,le=this-Ae,ue=function(){return $.m(z,Ae)};switch(_){case E:ee=ue()/12;break;case C:ee=ue();break;case h:ee=ue()/3;break;case p:ee=(le-fe)/6048e5;break;case f:ee=(le-fe)/864e5;break;case A:ee=le/i;break;case u:ee=le/r;break;case l:ee=le/n;break;default:ee=le}return k?ee:$.a(ee)},G.daysInMonth=function(){return this.endOf(C).$D},G.$locale=function(){return F[this.$L]},G.locale=function(H,J){if(!H)return this.$L;var k=this.clone(),ee=q(H,J,!0);return ee&&(k.$L=ee),k},G.clone=function(){return $.w(this.$d,this)},G.toDate=function(){return new Date(this.valueOf())},G.toJSON=function(){return this.isValid()?this.toISOString():null},G.toISOString=function(){return this.$d.toISOString()},G.toString=function(){return this.$d.toUTCString()},X}(),ie=ae.prototype;return U.prototype=ie,[["$ms",a],["$s",l],["$m",u],["$H",A],["$W",f],["$M",C],["$y",E],["$D",I]].forEach(function(X){ie[X[1]]=function(G){return this.$g(G,X[0],X[1])}}),U.extend=function(X,G){return X.$i||(X(G,ae,U),X.$i=!0),U},U.locale=q,U.isDayjs=K,U.unix=function(X){return U(1e3*X)},U.en=F[P],U.Ls=F,U.p={},U})})(YB);var f5=YB.exports;const Hr=Gi(f5),qf=({entityId:e,property:t,disabled:n,userResource:r="entities/user",...i})=>{const[a,l]=O.useState(null),u=R.useRecordContext(i),A=R.useDataProvider(),f=R.useResourceContext(),p=O.useCallback(async E=>{E.preventDefault(),E.stopPropagation();const I=it.get(u,i==null?void 0:i.source),B=f.replace("entities/",""),v=await A.getFile(`/attachments/${B}/${e||(u==null?void 0:u.id)}/${t||(i==null?void 0:i.source)}/${(I==null?void 0:I.id)||(u==null?void 0:u.id)}`),S=document.createElement("a");S.href=v,S.download=it.get(u,(i==null?void 0:i.title)||(i==null?void 0:i.source)),S.click()},[A,u,e,f,t,i==null?void 0:i.source,i==null?void 0:i.title]),C=O.useMemo(()=>({...u,[i==null?void 0:i.source]:(u==null?void 0:u.src)||it.get(u,i==null?void 0:i.source),[i==null?void 0:i.title]:(u==null?void 0:u.title)||it.get(u,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),[u,i==null?void 0:i.source,i==null?void 0:i.title]),h=R.useTranslate();return O.useEffect(()=>{!u||!(u!=null&&u.userId)||A.getOne(r,{id:u==null?void 0:u.userId}).then(({data:E})=>l(E)).catch(()=>l(null))},[u,A,r]),g.jsx(UB,{...i,disabled:n,record:C,onClick:p,title:g.jsxs(b.Box,{sx:{cursor:"pointer"},children:[g.jsx(b.Typography,{variant:"subtitle1",children:it.get(C,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),g.jsxs(b.Typography,{variant:"caption",color:"secondary",children:[it.get(C,"sizeDescription"),a&&" | ",a&&h("ra.attachment.info",{user:a==null?void 0:a.name,created:Hr(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})};qf.propTypes={...R.FileField.propTypes,source:c.string,title:c.string,disabled:c.bool};const g5=ce(R.ImageField,{name:"RaApplicaImageField",slot:"root"})(()=>({})),ga=e=>{const t=`_${e==null?void 0:e.source}`;return g.jsx(g5,{...e,source:t})};ga.propTypes={...R.ImageField.propTypes,source:c.string};const Gc=({width:e,height:t,circle:n,justify:r,record:i,...a})=>{const l=O.useMemo(()=>({width:typeof e=="number"?`${e}px !important`:`${e} !important`,height:typeof t=="number"?`${t}px !important`:`${t} !important`,borderRadius:n?"50%":1.5}),[e,t,n]),u=R.useRecordContext(),A=i||u;return g.jsx(ga,{sx:f=>({margin:0,display:"flex",justifyContent:r,"& img":{margin:"0px !important",border:`1px solid ${f.palette.divider}`,objectFit:"cover !important",...l,minWidth:l.width,minHeight:l.height}}),...a,record:A})};Gc.defaultProps={...ga.defaultProps,width:150,height:150,circle:!1,justify:"flex-start"};Gc.propTypes={...ga.propTypes,width:c.oneOfType([c.number,c.string]),height:c.oneOfType([c.number,c.string]),circle:c.bool,justify:c.oneOf(["flex-start","center","flex-end"])};var GB={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Un,function(){return function(n,r,i){n=n||{};var a=r.prototype,l={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(f,p,C,h){return a.fromToBase(f,p,C,h)}i.en.relativeTime=l,a.fromToBase=function(f,p,C,h,E){for(var I,B,v,S=C.$locale().relativeTime||l,M=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],x=M.length,T=0;T<x;T+=1){var P=M[T];P.d&&(I=h?i(f).diff(C,P.d,!0):C.diff(f,P.d,!0));var F=(n.rounding||Math.round)(Math.abs(I));if(v=I>0,F<=P.r||!P.r){F<=1&&T>0&&(P=M[T-1]);var j=S[P.l];E&&(F=E(""+F)),B=typeof j=="string"?j.replace("%d",F):j(F,p,P.l,v);break}}if(p)return B;var K=v?S.future:S.past;return typeof K=="function"?K(B):K.replace("%s",B)},a.to=function(f,p){return u(f,p,this,!0)},a.from=function(f,p){return u(f,p,this)};var A=function(f){return f.$u?i.utc():i()};a.toNow=function(f){return this.to(A(this),f)},a.fromNow=function(f){return this.from(A(this),f)}}})})(GB);var p5=GB.exports;const h5=Gi(p5);Hr.extend(h5);const Kc=e=>{const t=R.useRecordContext(e),[n]=R.useLocaleState(),r=O.useMemo(()=>Hr(it.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return g.jsxs(O.Fragment,{children:[g.jsx(R.DateField,{record:t,source:e.source,showTime:!0}),g.jsx("br",{}),g.jsx(b.Typography,{variant:"caption",color:"textSecondary",children:r})]})};Kc.displayName="DateAgoField";Kc.propTypes={source:c.string.isRequired};const KB=ce(R.DateField,{name:"RaApplicaDateField",slot:"Root"})(()=>({}));KB.propTypes={...R.DateField.propTypes};const _f=e=>g.jsx(KB,{...e});_f.defaultProps={...R.DateField.defaultProps,variant:"body1"};_f.propTypes={...R.DateField.propTypes};const qB=ce(R.EmailField,{name:"RaApplicaEmailField",slot:"Root"})(()=>({}));qB.propTypes={...R.EmailField.propTypes};const Jf=e=>g.jsx(qB,{...e});Jf.defaultProps={...R.EmailField.defaultProps,variant:"body1"};Jf.propTypes={...R.EmailField.propTypes};const C5=ce(R.FileField,{name:"RaApplicaFileField",slot:"root"})(()=>({})),Xf=({...e})=>{const t=R.useRecordContext(e),n=O.useCallback(r=>{r.preventDefault(),r.stopPropagation();const i=it.get(t,`_${e==null?void 0:e.source}`,it.get(t,e==null?void 0:e.source)),a=it.get(t,(e==null?void 0:e.title)||(e==null?void 0:e.source))||(e==null?void 0:e.title),l=document.createElement("a");l.href=i,l.download=a,l.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return g.jsx(C5,{...e,record:t,onClick:n})};Xf.propTypes={...R.FileField.propTypes,source:c.string,title:c.string};const _B=e=>g.jsx(R.FunctionField,{...e});_B.defaultProps={variant:"body1"};const m5=ce("div")(({theme:e})=>({borderBottom:`1px solid ${e.palette.divider}`,paddingTop:e.spacing(1),paddingBottom:e.spacing(1),marginBottom:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",[e.breakpoints.down("sm")]:{whiteSpace:"normal",overflow:"visible",textOverflow:"inherit"}})),Zf=({source:e,defaultValue:t,...n})=>{const r=R.useRecordContext(n),i=it.get(r,e,t);return g.jsx("span",{dangerouslySetInnerHTML:{__html:i&&i!==null?i:t}})};Zf.propTypes={defaultValue:c.any,source:c.string,record:c.object};Zf.defaultProps={defaultValue:" "};const JB=({title:e,children:t})=>e&&e!==!1?g.jsx(b.Tooltip,{title:e,placement:"top",children:t}):t;JB.propTypes={title:c.oneOfType([c.string,c.bool]),children:c.oneOfType([c.element,c.arrayOf(c.element)])};const $f=({label:e,source:t,defaultValue:n,children:r,tooltip:i,...a})=>{const{getCurrentDialog:l}=Jo(),u=R.useRecordContext(a),A=R.useResourceContext(a),f=l(),p=O.useMemo(()=>!i||i===!1?!1:typeof i=="function"?i(u):typeof i=="string"?it.get(u,i,i):i,[u,i]);return g.jsx(JB,{title:p,children:g.jsxs(O.Fragment,{children:[g.jsx(b.InputLabel,{children:g.jsx(R.FieldTitle,{label:e,source:t,resource:f||A})}),g.jsx(m5,{...a,children:O.cloneElement(r,{source:t,record:u,defaultValue:n,resource:f||A})})]})})};$f.propTypes={defaultValue:c.any,tooltip:c.oneOfType([c.string,c.bool,c.func]),source:c.string,label:c.string,name:c.string,children:c.element};$f.defaultProps={defaultValue:" ",children:g.jsx(Zf,{})};const E5=_i("div",{name:"RaApplicaReferenceManyField",slot:"root"})(({theme:e,margin:t,border:n})=>({marginLeft:t?0:`-${e.spacing(2.5)}`,marginRight:t?0:`-${e.spacing(2.5)}`,borderBottom:n?`1px solid ${e.palette.divider}`:"none","& form":{padding:e.spacing(2)},"& .MuiCardContent-root":{borderTop:n?`1px solid ${e.palette.divider}`:"none"},"& .MuiToolbar-root":{[e.breakpoints.up("sm")]:{marginTop:`-${e.spacing(2)}`,marginBottom:e.spacing(t?0:1),marginLeft:e.spacing(t?1:2),marginRight:e.spacing(t?1:2),width:t?"auto":`calc(100% - ${e.spacing(5)})`},[e.breakpoints.down("md")]:{marginTop:0}},"& .RaDatagrid-root":{overflowX:"auto",paddingTop:48,[e.breakpoints.down("sm")]:{width:"calc(100vw - 34px)"}},"& .RaDatagrid-table":{borderBottom:`1px solid ${e.palette.divider}`},"& .MuiTablePagination-toolbar":{marginTop:e.spacing(1),marginBottom:0},"& .RaBulkActionsToolbar-collapsed.RaBulkActionsToolbar-toolbar":{minHeight:0},"& .RaBulkActionsToolbar-toolbar":{minHeight:48,bottom:-56,"& h6":{marginTop:e.spacing(.5)},"& .RaBulkActionsToolbar-topToolbar":{marginTop:e.spacing(1)},[e.breakpoints.down("sm")]:{bottom:-48,borderRadius:0}}})),$i=e=>g.jsx(E5,{children:g.jsx(R.ReferenceManyField,{pagination:g.jsx(R.Pagination,{}),...e})});$i.defaultProps={...R.ReferenceManyField.defaultProps,margin:!1,border:!1};$i.propTypes={...R.ReferenceManyField.propTypes,margin:c.bool,border:c.bool};const XB=({source:e,...t})=>{const n=R.useRecordContext(t),r=it.get(n,e,0),i=r/1024,a=i/1024,l=a/1024,u=l>1?`${l.toFixed(2)} GB`:a>1?`${a.toFixed(2)} MB`:i>1?`${i.toFixed(2)} KB`:`${r.toFixed(2)} B`;return g.jsx(b.Typography,{component:"span",variant:"body1",...t,children:u})};XB.propTypes={record:c.object,source:c.string};const ZB=ce(R.TextField,{name:"RaApplicaTextField",slot:"Root"})(()=>({}));ZB.propTypes={...R.TextField.propTypes};const eg=e=>g.jsx(ZB,{...e});eg.defaultProps={...R.TextField.defaultProps,variant:"body1"};eg.propTypes={...R.TextField.propTypes};const at=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:a,divider:l,...u})=>{const A=Kt.useTheme(),{getCurrentDialog:f}=Jo(),{source:p,resource:C,isRequired:h}=u,{fieldState:{invalid:E}}=R.useInput(u),I=f();return g.jsxs(b.Stack,{spacing:1,sx:{width:u!=null&&u.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:E?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&a!==!1&&g.jsx(b.InputLabel,{error:E===!0,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:g.jsx(R.FieldTitle,{label:e,source:p,resource:I||C,isRequired:h})}),O.isValidElement(t)?O.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&g.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:E===!0,children:r})]})};at.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool};at.defaultProps={display:"label",divider:!1};const I5=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},B5=ce(R.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({disabled:e,theme:t})=>({"& .previews":{},"& .previews>div":{marginTop:t.spacing(1),padding:t.spacing(1.5),border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:t.palette.action.hover},"& .MuiLink-root":{fontSize:t.typography.body1.fontSize}},...I5(e)})),tg=({children:e,disabled:t,type:n,...r})=>{const i=R.useRecordContext(r),a=r==null?void 0:r.source,l=i==null?void 0:i.id;return R.useInput({source:`__${n}__${r==null?void 0:r.source}`,defaultValue:r==null?void 0:r.source}),g.jsx(at,{...r,children:g.jsx(B5,{disabled:t,children:O.cloneElement(e,{...e.props,entityId:l,property:a})})})};tg.propTypes={...R.FileInput.propTypes,children:c.node,multiple:c.bool,disabled:c.bool};tg.defaultProps={children:g.jsx(qf,{title:"name",source:"path"}),multiple:!0,disabled:!1,type:"attachment"};const y5=ce(R.AutocompleteArrayInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"}})),ng=({...e})=>g.jsx(at,{...e,children:g.jsx(y5,{})});ng.propTypes={...R.AutocompleteArrayInput.propTypes,...at.propTypes};ng.defaultProps={...R.AutocompleteArrayInput.defaultProps,size:"small"};const v5=ce(R.AutocompleteInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},"& .MuiOutlinedInput-root.MuiInputBase-sizeSmall":{paddingTop:"4px"}})),rg=e=>{const{perPage:t,...n}=e;return g.jsx(at,{...n,children:g.jsx(v5,{})})};rg.propTypes={...R.AutocompleteInput.propTypes,...at.propTypes};rg.defaultProps={...R.AutocompleteInput.defaultProps,size:"small"};const b5=ce(R.BooleanInput,{name:"RaApplicaBooleanInput",slot:"Root"})(()=>({})),og=({horizontal:e,...t})=>{const n=Tt();return g.jsx(at,{...t,sx:e?{flexDirection:e?"row":"column",alignItems:e?"center":"flex-start","& .MuiFormGroup-root":{margin:0},"& .MuiFormControlLabel-root":{margin:0,"& .MuiTypography-root":{display:"none",visibility:"hidden"},"& .MuiSwitch-root":{marginRight:`-${n.spacing(.5)}`}}}:{},children:g.jsx(b5,{})})};og.defaultProps={...R.BooleanInput.defaultProps,...at.defaultProps};og.propTypes={...R.BooleanInput.propTypes,...at.propTypes,horizontal:c.bool};const Q5=ce(R.DateInput,{name:"RaApplicaDateInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),ig=e=>g.jsx(at,{...e,children:g.jsx(Q5,{})});ig.propTypes={...R.DateInput.propTypes,...at.propTypes};ig.defaultProps={...R.DateInput.defaultProps,...at.defaultProps};const x5=ce(R.DateTimeInput,{name:"RaApplicaDateTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),sg=e=>g.jsx(at,{...e,children:g.jsx(x5,{})});sg.propTypes={...R.DateTimeInput.propTypes,...at.propTypes};sg.defaultProps={...at.defaultProps};const w5=ce(R.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({theme:e})=>({"& .previews":{},"& .previews>div":{marginTop:e.spacing(1),padding:e.spacing(1.5),border:`1px solid ${e.palette.divider}`,borderRadius:e.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:e.palette.action.hover},"& .MuiLink-root":{fontSize:e.typography.body1.fontSize}}})),ag=({children:e,title:t,...n})=>{const r=mc.useWatch({name:n.source}),i=R.useRecordContext(n),{source:a}=n,l=O.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const u=it.get(i,a);if(u){const A=u.split("__");return A.length>0?A[A.length-1]:u}return u},[i,a,r]);return g.jsx(at,{...n,children:g.jsx(w5,{children:O.cloneElement(e,{...e.props,title:t||a,source:a,record:{...i,[a]:(r==null?void 0:r.title)||it.get(i,a),[`_${a}`]:(r==null?void 0:r.src)||it.get(i,`_${a}`),[t||a]:l}})})})};ag.propTypes={...R.FileInput.propTypes,source:c.string,title:c.string,children:c.node};ag.defaultProps={children:g.jsx(Xf,{})};const lg=({children:e,title:t,...n})=>{const r=mc.useWatch({name:n.source}),i=R.useRecordContext(n),{source:a}=n;return R.useInput({source:`__image__${n==null?void 0:n.source}`,defaultValue:n==null?void 0:n.source}),g.jsx(at,{...n,children:g.jsx(R.ImageInput,{accept:"image/*",children:O.cloneElement(e,{...e.props,title:t,source:a,record:{...i,[a]:(r==null?void 0:r.title)||it.get(i,a),[`_${a}`]:(r==null?void 0:r.src)||it.get(i,`_${a}`)}})})})};lg.defaultProps={children:g.jsx(Gc,{}),multiple:!1};lg.propTypes={...R.ImageInput.propTypes,source:c.string,title:c.string,children:c.node,multiple:c.bool};const T5=ce(R.NumberInput,{name:"RaApplicaNumberInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),cg=e=>g.jsx(at,{...e,children:g.jsx(T5,{})});cg.propTypes={...R.NumberInput.propTypes,...at.propTypes};cg.defaultProps={...R.NumberInput.defaultProps,...at.defaultProps};const $B=({source:e,minWidth:t=300,children:n})=>{const r=R.useResourceContext(),i=R.useRecordContext(),[a,l]=O.useState(it.get(i,e,"")),[u,A]=O.useState(!1),f=O.useCallback(I=>l(I.target.value),[]),p=R.useDataProvider(),C=O.useCallback(I=>{I.key==="Enter"&&(A(!0),p.update(r,{id:i.id,data:{...i,[e]:a,_changed:e}}).then(()=>A(!1)))},[a,p,r,i,e]),h=O.useCallback(()=>{it.get(i,e)!==a&&(A(!0),p.update(r,{id:i.id,data:{...i,[e]:a,_changed:e}}).then(()=>A(!1)))},[a,p,r,e,i]),E=O.useCallback(I=>{A(!0),p.update(r,{id:i.id,data:{...i,[e]:I,_changed:e}}).then(()=>A(!1))},[p,r,e,i]);return O.useEffect(()=>l(it.get(i,e)),[i,e]),n?O.cloneElement(n,{...n.props,source:e,value:a,onChange:E}):g.jsx(b.TextField,{value:a,disabled:u,onChange:f,onKeyPress:C,onBlur:h,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})};$B.propTypes={source:c.string.isRequired,minWidth:c.number,children:c.element};const ug=({children:e,...t})=>g.jsx(R.ReferenceArrayInput,{...t,children:O.cloneElement(e,{...t,source:e.props.source||t.source})});ug.propTypes={...R.ReferenceArrayInput.propTypes,children:c.element};ug.defaultProps={...R.ReferenceArrayInput.defaultProps};const Ag=({children:e,...t})=>g.jsx(R.ReferenceInput,{...t,children:O.cloneElement(e,{...t,source:e.props.source||t.source})});Ag.propTypes={...R.ReferenceInput.propTypes,children:c.element};Ag.defaultProps={...R.ReferenceInput.defaultProps};const dg=({reference:e,target:t,children:n,filters:r,actions:i,...a})=>g.jsx(R.ResourceContextProvider,{value:e,children:g.jsx($i,{perPage:5,pagination:g.jsx(R.Pagination,{}),...a,reference:e,target:t,children:g.jsxs(O.Fragment,{children:[g.jsx(R.ListToolbar,{filters:r,actions:i}),n]})})});dg.propTypes={...$i.propTypes,children:c.node.isRequired,reference:c.string.isRequired,target:c.string.isRequired,filters:c.oneOfType([c.element,c.func,c.element,c.arrayOf(c.node)]),actions:c.oneOfType([c.element,c.func,c.element])};dg.defaultProps={...$i.defaultProps};const P5=ce(R.SearchInput,{name:"RaApplicaSearchInput",slot:"root"})(()=>({})),R5=e=>g.jsx(P5,{...e}),ey=ce(R.SelectArrayInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .RaSelectArrayInput-chips > .RaSelectArrayInput-chip":{marginTop:"-2px",marginBottom:"-2px"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}}));ey.propTypes={...R.SelectArrayInput.propTypes};const fg=e=>g.jsx(at,{...e,children:g.jsx(ey,{options:{autoWidth:!1}})});fg.defaultProps={optionText:"name",optionValue:"id"};fg.propTypes={...R.SelectArrayInput.propTypes,...at.propTypes};const S5=ce(R.SelectInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}})),ty=e=>g.jsx(at,{...e,children:g.jsx(S5,{})});ty.propTypes={...R.SelectInput.propTypes,...at.propTypes};const Gn=e=>g.jsx(at,{...e,children:g.jsx(R.TextInput,{})});Gn.propTypes={...R.TextInput.propTypes,...at.propTypes};const qc=({...e})=>{var u,A;const t=R.useTranslate(),n=R.maxLength(e==null?void 0:e.maxLength,"app.input.max_length_error"),r=(A=(u=mc.useController({name:e==null?void 0:e.source}))==null?void 0:u.field)==null?void 0:A.value;let i=e.helperText,a=e.validate;a?Array.isArray(a)&&a.indexOf(n)===-1&&a.push(n):a=[n];const l=t("app.input.max_length_info",{count:(r==null?void 0:r.length)||0,max:e==null?void 0:e.maxLength});return e!=null&&e.maxLength&&(i=i&&i.length>0?`${l} - ${t(i)}`:l),g.jsx(Gn,{...e,validate:a,helperText:i,inputProps:{maxLength:e==null?void 0:e.maxLength}})};qc.displayName="SmartTextInput";qc.defaultProps={multiline:!1};qc.propTypes={...Gn.propTypes,maxLength:c.number,multiline:c.bool,rows:c.number};const ny=e=>{const t=e.split(":");t.length===1&&t.push("00");const n=parseInt(t[0]),r=parseInt(t[1]);return Hr().hour(n).minute(r)};function O5(){let e=new Date().getTime();return window.performance&&typeof window.performance.now=="function"&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)})}const D5=e=>{if(!e)return"";const t=ny(e);return t?t.format("HH:mm"):""},M5=e=>e,j5=ce(R.TimeInput,{name:"RaApplicaTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),gg=e=>g.jsx(at,{...e,children:g.jsx(j5,{})});gg.defaultProps={...R.TimeInput.defaultProps,format:D5,parse:M5};gg.propTypes={...R.TimeInput.propTypes,...at.propTypes};const pg=({onSuccess:e,firstAccess:t})=>{const{spacing:n}=Zn(),[r,i]=O.useState(!1),a=be.useAuthProvider(),l=be.useTranslate(),u=be.useNotify(),A=O.useCallback(f=>{const{oldPassword:p,newPassword:C}=f;i(!0),a==null||a.changePassword(p,C).then(()=>{u("ra.auth.password_changed"),e()}).catch(h=>u(h,{type:"error"})).finally(()=>i(!1))},[a,e]);return g.jsx(be.ResourceContextProvider,{value:"user/change-password",children:g.jsx(be.EditContextProvider,{value:{record:{},resource:"user/change-password",save:A},children:g.jsx(Uc,{onSubmit:A,toolbar:g.jsx(Yr,{children:g.jsx(R.SaveButton,{disabled:r})}),children:g.jsxs(b.Grid,{container:!0,spacing:n,children:[t===!0&&g.jsx(b.Grid,{item:!0,xs:12,children:g.jsxs(b.Alert,{severity:"warning",children:[g.jsx(b.AlertTitle,{children:l("ra.auth.first_access.change_password")}),l("ra.auth.first_access.change_password_helper")]})}),g.jsx(b.Grid,{item:!0,xs:12,children:g.jsx(Gn,{source:"oldPassword",type:"password",validate:be.required()})}),g.jsx(b.Grid,{item:!0,xs:12,children:g.jsx(Gn,{source:"newPassword",type:"password",validate:be.required()})})]})})})})},k5=ce(R.Edit,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaEdit-card":{[e.breakpoints.down("sm")]:{marginBottom:e.spacing(6)}},"& .RaEdi-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaToolbar-mobileToolbar":{borderTop:`1px solid ${e.palette.divider}`},"& .RaEdit-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),F5=ce(b.CardHeader)(({theme:e})=>({marginTop:e.spacing(4),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),L5=ce(b.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`})),hg=({title:e,divider:t,variant:n})=>{const r=R.useTranslate();return g.jsxs(O.Fragment,{children:[g.jsx(F5,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&g.jsx(L5,{})]})};hg.propTypes={title:c.string.isRequired,divider:c.bool,variant:c.oneOf(["h1","h2","h3","h4","h5","h6"])};hg.defaultProps={divider:!0,variant:"h4"};const lc=c.shape({xl:c.number,lg:c.number,md:c.number,sm:c.number,xs:c.number}),N5=ce("div")(({theme:e})=>({marginBottom:e.spacing(2)})),_c=({children:e,visibility:t})=>b.useMediaQuery(r=>r.breakpoints.up(t))?g.jsx(N5,{children:e}):null;_c.propTypes={visibility:c.oneOf(["xl","lg","md","sm","xs"]),position:c.oneOf(["top","bottom"]).isRequired,children:c.node.isRequired};_c.defaultProps={position:"top",visibility:"md"};const V5={display:"none"},Jc=({intent:e,hidden:t,unmountOnExit:n,label:r,icon:i,value:a,syncWithLocation:l,selected:u,onChange:A,children:f,badgeColor:p,badgeContent:C,...h})=>{const E=R.useTranslate(),I=Mr.useLocation(),B={component:pt.Link,to:{...I,pathname:a}},v=O.isValidElement(r)?r:E(r,{_:r}),S=O.useCallback(()=>A(a),[A,a]);return e==="header"?(()=>g.jsxs(b.ListItemButton,{selected:u,...l?B:{},onClick:S,children:[i&&g.jsx(b.ListItemIcon,{children:i}),g.jsx(b.ListItemText,{primary:v}),C&&g.jsx(b.ListItemSecondaryAction,{children:g.jsx(b.Avatar,{sx:{width:24,height:24,fontSize:12,backgroundColor:T=>{var P;return(P=T.palette[p])==null?void 0:P.main},color:T=>{var P;return(P=T.palette[p])==null?void 0:P.contrastText}},children:C})})]}))():(()=>n&&t?null:g.jsx(R.FormGroupContextProvider,{name:a.toString(),children:g.jsx(b.Stack,{alignContent:"stretch",style:t?V5:{},id:`tabpanel-${a}`,"aria-labelledby":`tabheader-${a}`,"aria-hidden":t||void 0,...h,children:f})}))()};Jc.propTypes={intent:c.oneOf(["header","content","sidebar"]),className:c.string,contentClassName:c.string,url:c.string,icon:c.element,label:c.oneOfType([c.string,c.element]).isRequired,value:c.oneOfType([c.string,c.number]),syncWithLocation:c.bool,onChange:c.func,selected:c.bool,hidden:c.bool,unmountOnExit:c.bool,children:c.node,badgeColor:c.oneOf(["default","error","info","primary","secondary","success","warning"]),badgeContent:c.oneOfType([c.string,c.number])};Jc.defaultProps={badgeColor:"default",unmountOnExit:!1};const H5=_i(b.List,{name:"RaLongFormTabs",slot:"Root"})(({theme:e})=>({p:0,"& .MuiListItemIcon-root":{minWidth:32,color:e.palette.grey[500]},"& .MuiListItemButton-root.Mui-selected":{borderRight:`2px solid ${e.palette.primary.main}`,marginRight:"-2px"}})),ry=({children:e,syncWithLocation:t,value:n,url:r,onChange:i})=>{const a=Mr.useLocation();return g.jsx(Yn,{children:g.jsx(H5,{component:"nav",children:O.Children.map(e,(l,u)=>{if(!O.isValidElement(l))return null;const A=z5(l,u),f=t?!!Mr.matchPath(`${r}/${A}`,a.pathname):u===n;return O.cloneElement(l,{intent:"header",value:t?A:u,syncWithLocation:t,onChange:i,url:r,selected:f})})})})},z5=(e,t)=>e.props.path!=null?e.props.path:t>0?t.toString():"";ry.propTypes={children:c.node,url:c.string,tabsWithErrors:c.arrayOf(c.string),syncWithLocation:c.bool,onChange:c.func,value:c.oneOfType([c.string,c.number])};var W5=e=>{let t=e;for(;t=t.parentElement;){const n=getComputedStyle(t,null).getPropertyValue("overflow-y");if(t===document.body)return window;if(n==="auto"||n==="scroll"||n==="overlay")return t}return window},oy=e=>e.firstChild?e.firstChild.offsetParent===e:!0,U5=(e,t)=>{let n=e,r=0;oy(t)||(r+=e.offsetTop-t.offsetTop,t=e.offsetParent,r+=-e.offsetTop);do r+=n.offsetTop,n=n.offsetParent;while(n&&n!==t);return r},Y5=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},ra=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?ra="sticky":CSS.supports("position","-webkit-sticky")&&(ra="-webkit-sticky"));var cc=!1;try{const e=Object.defineProperty({},"passive",{get(){cc={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var XA=e=>{const{el:t,onChange:n,unsubs:r,measure:i}=e;if(t===window){const a=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),l=i(a()),u=()=>{Object.assign(l,i(a())),n()};return window.addEventListener("resize",u,cc),r.push(()=>window.removeEventListener("resize",u)),l}else{const a=i(t.getBoundingClientRect()),l=()=>{Object.assign(a,i(t.getBoundingClientRect())),n()},u=new ResizeObserver(l);return u.observe(t),r.push(()=>u.disconnect()),a}},G5=e=>{const t=getComputedStyle(e,null),n=parseInt(t.getPropertyValue("padding-top"),10),r=parseInt(t.getPropertyValue("padding-bottom"),10);return{top:n,bottom:r}},K5=(e,t,n)=>{const{bottom:r,offsetBottom:i,offsetTop:a}=n,l=W5(e);let u=!1;const A=()=>{u||requestAnimationFrame(()=>{const j=C();j!==x&&T(j),u=!1}),u=!0};let f=l===window?window.scrollY:l.scrollTop;const p=j=>{const{offsetTop:K,height:q}=E,{naturalTop:U}=v,{height:$}=S;return j+K+q>=U+$+M+i},C=()=>{const{height:j}=E,{height:K}=S;return K+a+i<=j?3:p(f)?1:2},h=l!==window&&oy(l),E=XA({el:l,onChange:A,unsubs:t,measure:({height:j,top:K})=>({height:j,offsetTop:h?K:0})}),I=Y5(e),B=I===window?{top:0,bottom:0}:G5(I),v=XA({el:I,onChange:A,unsubs:t,measure:({height:j})=>({height:j-B.top-B.bottom,naturalTop:I===window?0:U5(I,l)+B.top+E.offsetTop})}),S=XA({el:e,onChange:A,unsubs:t,measure:({height:j})=>({height:j})});let M=0,x=C();const T=j=>{const K=x;if(x=j,K===2&&(M=-1),j===3){e.style.position=ra,r?e.style.bottom=`${i}px`:e.style.top=`${a}px`;return}const{height:q,offsetTop:U}=E,{height:$,naturalTop:ae}=v,{height:ie}=S;if(j===2)if(e.style.position="relative",M=K===0?Math.max(0,U+f-ae+a):Math.max(0,U+f+q-(ae+ie+i)),r){const X=Math.max(0,$-ie-M);e.style.bottom=`${X}px`}else e.style.top=`${M}px`;else e.style.position=ra,j===1?r?e.style.bottom=`${i}px`:e.style.top=`${q-ie-i}px`:r?e.style.bottom=`${q-ie-i}px`:e.style.top=`${a}px`};T(x);const P=j=>{if(j===f)return;const K=j-f;if(f=j,x===3)return;const{offsetTop:q,height:U}=E,{naturalTop:$,height:ae}=v,{height:ie}=S;if(K>0)if(x===0){if(j+q+a>$){const X=Math.max(0,q+f-$+a);j+q+U<=$+ie+X+i?T(2):T(1)}}else x===2&&p(j)&&T(1);else if(x===1){if(q+j+U<$+ae+i){const X=Math.max(0,q+f+U-($+ie+i));q+j+a>=$+X?T(2):T(0)}}else x===2&&q+j+a<$+M&&T(0)},F=l===window?()=>P(window.scrollY):()=>P(l.scrollTop);l.addEventListener("scroll",F,cc),l.addEventListener("mousewheel",F,cc),t.push(()=>l.removeEventListener("scroll",F),()=>l.removeEventListener("mousewheel",F))},q5=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,i]=O.useState(null);return O.useEffect(()=>{if(!r||!ra)return;const a=[];return K5(r,a,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{a.forEach(l=>l())}},[r,t,e,n]),i},_5=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:i,className:a,style:l}=e,u=q5({offsetTop:t,offsetBottom:n,bottom:r});return g.jsx("div",{className:a,style:l,ref:u,children:i})},J5=_5;const X5=ce(b.Grid,{name:"ApplicaLongFormView",slot:"Root"})(({theme:e})=>({"& .MuiToolbar-root":{position:"initial",marginTop:e.spacing(2),marginLeft:`-${e.spacing(3)}`,marginRight:`-${e.spacing(3)}`,marginBottom:`-${e.spacing(2)}`,borderTop:`1px solid ${e.palette.divider}`,[e.breakpoints.down("sm")]:{position:"initial !important",width:"auto !important"}},"& form > .MuiToolbar-root":{margin:0,marginRight:`-${e.spacing(.5)}`,[e.breakpoints.down("sm")]:{marginRight:e.spacing(.5)}}})),IE=(e,t)=>e&&e.type===_c&&e.props.position===t,Z5=e=>e&&e.type===Jc,Cg=({children:e,formRootPathname:t,syncWithLocation:n,spacing:r,tabs:i,tabsDisposition:a,contentDisposition:l,sticky:u,...A})=>{const[f,p]=O.useState(0),C=Mr.useResolvedPath(""),h=R.useResourceContext(A),E=Mr.useLocation(),I=O.useMemo(()=>O.Children.toArray(e).find(T=>IE(T,"top")),[e]),B=O.useMemo(()=>O.Children.toArray(e).find(T=>IE(T,"bottom")),[e]),v=O.useMemo(()=>O.Children.toArray(e).filter(T=>Z5(T)),[e]),S=T=>{n||p(T)},M=()=>O.cloneElement(i,{onChange:S,syncWithLocation:n,url:t,value:f,intent:"header"},v),x=O.useMemo(()=>g.jsxs(O.Fragment,{children:[I,n?g.jsx(Mr.Routes,{children:g.jsx(Mr.Route,{path:"/*",element:M()})}):M(),B]}),[I,n,M,B]);return g.jsxs(X5,{container:!0,spacing:r*2,children:[g.jsx(b.Grid,{item:!0,...a,children:u?g.jsx(J5,{offsetTop:74,offsetBottom:r*2,children:x}):x}),g.jsx(b.Grid,{item:!0,...l,children:O.Children.map(v,(T,P)=>{if(!T)return null;const F=R.getTabbedFormTabFullPath(T,P),j=n?!Mr.matchPath(`${C.pathname}/${F}`,E.pathname):f!==P;return O.isValidElement(T)?O.cloneElement(T,{intent:"content",resource:h,hidden:j,value:n?F:P}):null})})]})};Cg.propTypes={children:c.node,spacing:c.number,syncWithLocation:c.bool,tabs:c.element,formRootPathname:c.string,tabsDisposition:lc,contentDisposition:lc};Cg.defaultProps={tabs:g.jsx(ry,{})};const $5=()=>{const e=pt.useLocation(),t=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/*",":resource/:id/*"];for(const n of t){const r=pt.matchPath(n,e.pathname);if(r)return r.pathnameBase}return""},pa=({spacing:e,...t})=>{const n=$5(),{spacing:r}=Zn(),i=e||r;return g.jsx(R.Form,{formRootPathname:n,...t,children:g.jsx(Cg,{formRootPathname:n,...t,spacing:i})})};pa.propTypes={syncWithLocation:c.bool,spacing:c.number,tabsDisposition:lc,contentDisposition:lc,sticky:c.bool};pa.defaultProps={syncWithLocation:!1,sticky:!0,spacing:2,tabsDisposition:{xl:3,lg:3,md:4,sm:4,xs:12},contentDisposition:{xl:9,lg:9,md:8,sm:8,xs:12}};pa.Tab=Jc;pa.Sidebar=_c;const e8=ce(R.Show,{name:"RaApplicaShow",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaShow-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaShow-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),t8=ce(R.SimpleFormIterator,{name:"ApplicaSimpleFormIterator",root:"root"})(({theme:e})=>({"& .RaSimpleFormIterator-line":{paddingTop:e.spacing(1),paddingBottom:e.spacing(.5)},"& .RaSimpleFormIterator-action":{display:"flex",flexDirection:"row",alignItems:"center",mb:1.5},"& section":{width:"100%","& label":{position:"relative",overflow:"visible",transform:"none",marginLeft:0}}})),Xc=_i(R.TabbedForm,{name:"RaApplicaTabbedForm",slot:"Root"})(()=>({}));Xc.propTypes={...R.TabbedForm.propTypes};Xc.defaultProps={...R.TabbedForm.defaultProps};Xc.Tab=R.TabbedForm.Tab;const iy=O.createContext(void 0),n8=O.createContext(void 0),r8=()=>O.useContext(iy),o8=N.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:i=!1,index:a,member:l,resource:u}=e,A=R.useTranslate(),[f,p]=N.useState(!1),{total:C,remove:h}=r8(),E=N.useCallback(()=>{p(!1),h(a)},[a,h]),I=O.useMemo(()=>({index:a,total:C,remove:()=>h(a)}),[a,C,h]);return g.jsxs(n8.Provider,{value:I,children:[O.Children.map(n,(B,v)=>{if(!O.isValidElement(B))return null;const{source:S,...M}=B.props;return g.jsx(b.TableCell,{sx:{border:0,verticalAlign:"top"},children:O.cloneElement(B,{source:S?`${l}.${S}`:l,index:S?void 0:v,resource:u,disabled:r,...M,label:!1})})}),!i&&g.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",border:0,pt:2},children:g.jsx(Ji,{horizontal:!0,children:g.jsx(b.Typography,{color:"error",onClick:()=>p(!0),children:A("ra.action.delete")})})}),n.length>0&&g.jsx(R.Confirm,{isOpen:f,title:A("ra.action.remove_item"),content:A("ra.message.remove_item"),onConfirm:E,onClose:()=>p(!1)})]})});var i8=Array.isArray,mg=i8,s8=typeof Un=="object"&&Un&&Un.Object===Object&&Un,a8=s8,l8=a8,c8=typeof self=="object"&&self&&self.Object===Object&&self,u8=l8||c8||Function("return this")(),Eg=u8,A8=Eg,d8=A8.Symbol,Ig=d8,BE=Ig,sy=Object.prototype,f8=sy.hasOwnProperty,g8=sy.toString,Ss=BE?BE.toStringTag:void 0;function p8(e){var t=f8.call(e,Ss),n=e[Ss];try{e[Ss]=void 0;var r=!0}catch{}var i=g8.call(e);return r&&(t?e[Ss]=n:delete e[Ss]),i}var h8=p8,C8=Object.prototype,m8=C8.toString;function E8(e){return m8.call(e)}var I8=E8,yE=Ig,B8=h8,y8=I8,v8="[object Null]",b8="[object Undefined]",vE=yE?yE.toStringTag:void 0;function Q8(e){return e==null?e===void 0?b8:v8:vE&&vE in Object(e)?B8(e):y8(e)}var ay=Q8;function x8(e){return e!=null&&typeof e=="object"}var w8=x8,T8=ay,P8=w8,R8="[object Symbol]";function S8(e){return typeof e=="symbol"||P8(e)&&T8(e)==R8}var Bg=S8,O8=mg,D8=Bg,M8=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j8=/^\w*$/;function k8(e,t){if(O8(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||D8(e)?!0:j8.test(e)||!M8.test(e)||t!=null&&e in Object(t)}var F8=k8;function L8(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ly=L8,N8=ay,V8=ly,H8="[object AsyncFunction]",z8="[object Function]",W8="[object GeneratorFunction]",U8="[object Proxy]";function Y8(e){if(!V8(e))return!1;var t=N8(e);return t==z8||t==W8||t==H8||t==U8}var G8=Y8,K8=Eg,q8=K8["__core-js_shared__"],_8=q8,ZA=_8,bE=function(){var e=/[^.]+$/.exec(ZA&&ZA.keys&&ZA.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function J8(e){return!!bE&&bE in e}var X8=J8,Z8=Function.prototype,$8=Z8.toString;function e6(e){if(e!=null){try{return $8.call(e)}catch{}try{return e+""}catch{}}return""}var t6=e6,n6=G8,r6=X8,o6=ly,i6=t6,s6=/[\\^$.*+?()[\]{}|]/g,a6=/^\[object .+?Constructor\]$/,l6=Function.prototype,c6=Object.prototype,u6=l6.toString,A6=c6.hasOwnProperty,d6=RegExp("^"+u6.call(A6).replace(s6,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f6(e){if(!o6(e)||r6(e))return!1;var t=n6(e)?d6:a6;return t.test(i6(e))}var g6=f6;function p6(e,t){return e==null?void 0:e[t]}var h6=p6,C6=g6,m6=h6;function E6(e,t){var n=m6(e,t);return C6(n)?n:void 0}var cy=E6,I6=cy,B6=I6(Object,"create"),Zc=B6,QE=Zc;function y6(){this.__data__=QE?QE(null):{},this.size=0}var v6=y6;function b6(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Q6=b6,x6=Zc,w6="__lodash_hash_undefined__",T6=Object.prototype,P6=T6.hasOwnProperty;function R6(e){var t=this.__data__;if(x6){var n=t[e];return n===w6?void 0:n}return P6.call(t,e)?t[e]:void 0}var S6=R6,O6=Zc,D6=Object.prototype,M6=D6.hasOwnProperty;function j6(e){var t=this.__data__;return O6?t[e]!==void 0:M6.call(t,e)}var k6=j6,F6=Zc,L6="__lodash_hash_undefined__";function N6(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=F6&&t===void 0?L6:t,this}var V6=N6,H6=v6,z6=Q6,W6=S6,U6=k6,Y6=V6;function es(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}es.prototype.clear=H6;es.prototype.delete=z6;es.prototype.get=W6;es.prototype.has=U6;es.prototype.set=Y6;var G6=es;function K6(){this.__data__=[],this.size=0}var q6=K6;function _6(e,t){return e===t||e!==e&&t!==t}var J6=_6,X6=J6;function Z6(e,t){for(var n=e.length;n--;)if(X6(e[n][0],t))return n;return-1}var $c=Z6,$6=$c,eF=Array.prototype,tF=eF.splice;function nF(e){var t=this.__data__,n=$6(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():tF.call(t,n,1),--this.size,!0}var rF=nF,oF=$c;function iF(e){var t=this.__data__,n=oF(t,e);return n<0?void 0:t[n][1]}var sF=iF,aF=$c;function lF(e){return aF(this.__data__,e)>-1}var cF=lF,uF=$c;function AF(e,t){var n=this.__data__,r=uF(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var dF=AF,fF=q6,gF=rF,pF=sF,hF=cF,CF=dF;function ts(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ts.prototype.clear=fF;ts.prototype.delete=gF;ts.prototype.get=pF;ts.prototype.has=hF;ts.prototype.set=CF;var mF=ts,EF=cy,IF=Eg,BF=EF(IF,"Map"),yF=BF,xE=G6,vF=mF,bF=yF;function QF(){this.size=0,this.__data__={hash:new xE,map:new(bF||vF),string:new xE}}var xF=QF;function wF(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var TF=wF,PF=TF;function RF(e,t){var n=e.__data__;return PF(t)?n[typeof t=="string"?"string":"hash"]:n.map}var eu=RF,SF=eu;function OF(e){var t=SF(this,e).delete(e);return this.size-=t?1:0,t}var DF=OF,MF=eu;function jF(e){return MF(this,e).get(e)}var kF=jF,FF=eu;function LF(e){return FF(this,e).has(e)}var NF=LF,VF=eu;function HF(e,t){var n=VF(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var zF=HF,WF=xF,UF=DF,YF=kF,GF=NF,KF=zF;function ns(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ns.prototype.clear=WF;ns.prototype.delete=UF;ns.prototype.get=YF;ns.prototype.has=GF;ns.prototype.set=KF;var qF=ns,uy=qF,_F="Expected a function";function yg(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(_F);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var l=e.apply(this,r);return n.cache=a.set(i,l)||a,l};return n.cache=new(yg.Cache||uy),n}yg.Cache=uy;var JF=yg,XF=JF,ZF=500;function $F(e){var t=XF(e,function(r){return n.size===ZF&&n.clear(),r}),n=t.cache;return t}var eL=$F,tL=eL,nL=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rL=/\\(\\)?/g,oL=tL(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(nL,function(n,r,i,a){t.push(i?a.replace(rL,"$1"):r||n)}),t}),iL=oL;function sL(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var aL=sL,wE=Ig,lL=aL,cL=mg,uL=Bg,AL=1/0,TE=wE?wE.prototype:void 0,PE=TE?TE.toString:void 0;function Ay(e){if(typeof e=="string")return e;if(cL(e))return lL(e,Ay)+"";if(uL(e))return PE?PE.call(e):"";var t=e+"";return t=="0"&&1/e==-AL?"-0":t}var dL=Ay,fL=dL;function gL(e){return e==null?"":fL(e)}var pL=gL,hL=mg,CL=F8,mL=iL,EL=pL;function IL(e,t){return hL(e)?e:CL(e,t)?[e]:mL(EL(e))}var BL=IL,yL=Bg,vL=1/0;function bL(e){if(typeof e=="string"||yL(e))return e;var t=e+"";return t=="0"&&1/e==-vL?"-0":t}var QL=bL,xL=BL,wL=QL;function TL(e,t){t=xL(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[wL(t[n++])];return n&&n==r?e:void 0}var PL=TL,RL=PL;function SL(e,t,n){var r=e==null?void 0:RL(e,t);return r===void 0?n:r}var OL=SL;const DL=Gi(OL),dy=e=>{const{children:t,resource:n,source:r,label:i,disableActions:a=!1,disableAdd:l=!1,disableRemove:u=!1,className:A,empty:f}=e,[p,C]=O.useState(!1),{fields:h,remove:E,replace:I}=R.useArrayInput(e),B=Tt(),v=be.useTranslate(),S=be.useRecordContext(e),M=O.useRef({}),x=be.useTranslateLabel(),T=O.useCallback(q=>{E(q)},[E]);if(h.length>0){const{...q}=h[0];M.current=q;for(const U in M.current)M.current[U]=null}const P=O.useCallback(()=>{I([]),C(!1)},[I]),F=DL(S,r),j=O.useMemo(()=>({total:h.length,remove:T,source:r}),[h.length,T,r]),K=B.palette.mode==="dark"?B.palette.grey.A400:B.palette.grey.A800;return h?g.jsx(iy.Provider,{value:j,children:g.jsxs("div",{className:A,children:[g.jsx(fy,{label:i,source:r,disableAdd:l}),g.jsx(b.TableContainer,{component:b.Paper,sx:{mt:2,border:`1px solid ${K}`},children:g.jsxs(b.Table,{children:[g.jsx(b.TableHead,{sx:{borderTop:0,borderBottom:`1px solid ${K}`},children:g.jsxs(b.TableRow,{children:[O.Children.map(t,(q,U)=>N.isValidElement(q)?g.jsx(b.TableCell,{children:g.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none",children:x({...q.props,resource:n})})},U):null),!a&&g.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"top"},children:g.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none"})},"actions")]})}),g.jsxs(b.TableBody,{children:[h.length===0&&g.jsx(b.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0}},children:g.jsx(b.TableCell,{colSpan:4+(a?0:1),align:"center",children:f||g.jsx(b.Typography,{variant:"body1",color:"text.secondary",children:"-"})})}),h.length>0&&h.map((q,U)=>g.jsx(b.TableRow,{sx:{borderBottom:`1px solid ${K}}`},children:g.jsx(o8,{disableRemove:u,disableActions:a,index:U,member:`${r}.${U}`,onRemoveField:T,record:F&&F[U]||{},resource:n,source:r,children:t})},q.id))]})]})}),h.length>0&&g.jsx(R.Confirm,{isOpen:p,title:v("ra.action.clear_array_input"),content:v("ra.message.clear_array_input"),onConfirm:P,onClose:()=>C(!1)})]})}):null},fy=e=>{const{label:t,disableAdd:n}=e,{append:r}=R.useArrayInput(e),i=Tt(),a=i.palette.mode==="dark"?i.palette.grey.A400:i.palette.grey.A800,l=i.palette.mode==="light"?"#000000":"#FFFFFF";return g.jsxs(b.Stack,{justifyContent:"space-between",alignItems:"center",flexDirection:"row",children:[g.jsx(b.Typography,{children:t}),!n&&g.jsx(b.IconButton,{size:"small",color:"secondary",sx:{border:`1px solid ${a}`},onClick:()=>r({}),children:g.jsx(ot.PlusCircleOutlined,{style:{color:l}})})]})},ML=ce(dy,{name:"RaApplicaTableFormIterator",slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8)})`}}}));fy.propTypes={label:c.string.isRequired,source:c.string.isRequired};dy.propTypes={addButton:c.element,children:c.node,className:c.string,field:c.object,fields:c.array,fieldState:c.object,formState:c.object,record:c.object,source:c.string,label:c.string,resource:c.string,translate:c.func,disableAdd:c.bool,disableRemove:c.oneOfType([c.func,c.bool]),TransitionProps:c.shape({}),empty:c.oneOfType([c.node,c.string])};function jL(e,t){const n=gt.clone(e),{type:r,payload:i}=t;switch(r){case"updateMedia":{const a=gt.chain(n.media).clone().extend(i).value();return gt.extend(n,{media:a})}case"updateDrawer":{const a=gt.chain(n.drawer).clone().extend(i).value();return gt.extend(n,{drawer:a})}case"updateLogo":{const a=gt.chain(n.logo).clone().extend(i).value();return gt.extend(n,{logo:a})}case"updateNotifications":{const a=gt.chain(n.notifications).clone().extend(i).value();return gt.extend(n,{notifications:a})}case"updateTheme":{const a=gt.chain(n.theme).clone().extend(i).value();return gt.extend(n,{theme:a})}default:return n}}const kL={drawer:{open:!0,width:260,handleDrawerToggle:()=>{}},media:{downMd:!1,downLg:!1,downXl:!1,horizontal:!1},logo:{},notifications:{enable:!0,resource:"entities/notification"},theme:{iconColor:"grey.300",iconColorOpen:"grey.100"}},gy=O.createContext(void 0);function py(e){var K;const t=be.useGetIdentity(),n=b.useTheme(),r=b.useMediaQuery(n.breakpoints.down("md")),i=b.useMediaQuery(n.breakpoints.down("lg")),a=b.useMediaQuery(n.breakpoints.down("xl")),{miniDrawer:l,isHorizontalLayout:u,menuOrientation:A,drawerWidth:f}=Zn(),p=u(A)&&!i,{drawerOpen:C,openDrawer:h}=fo(),E=O.useCallback(()=>{h(!C)},[C,h]),[I,B]=O.useState(!1),[v,S]=O.useReducer(jL,gt.chain(kL).clone().merge({drawer:{open:!l||C}}).value()),M=O.useCallback(()=>B(!1),[]),x=O.useMemo(()=>({state:v,dispatch:S}),[v,S]),{logoIcon:T,logoMain:P,enableNotification:F,notification:j}=e;return O.useEffect(()=>{S({type:"updateMedia",payload:{downMd:r,downLg:i,downXl:a,horizontal:p}})},[A,r,i,a]),O.useEffect(()=>{S({type:"updateDrawer",payload:{open:C,width:f,handleDrawerToggle:E}})},[C,f,E]),O.useEffect(()=>{l||h(!a)},[a,l]),O.useEffect(()=>{S({type:"updateLogo",payload:{main:P,icon:T}})},[T,P]),O.useEffect(()=>{S({type:"updateNotifications",payload:{enable:F,resource:j??"entities/notification"}})},[F,j]),O.useEffect(()=>{S({type:"updateTheme",payload:{iconColorOpen:n.palette.mode==="dark"?"grey.200":"grey.300",iconColor:n.palette.mode==="dark"?"background.default":"grey.100"}})},[n.palette.mode]),O.useEffect(()=>{var q;B(((q=t==null?void 0:t.data)==null?void 0:q.needToChangePassword)===!0)},[(K=t==null?void 0:t.data)==null?void 0:K.needToChangePassword]),g.jsxs(gy.Provider,{value:x,children:[g.jsx(b.Dialog,{open:I,maxWidth:"xs",fullWidth:!0,children:g.jsx(pg,{onSuccess:M,firstAccess:!0})}),e.children]})}function hy(e){return O.forwardRef((t,n)=>{const{logoIcon:r,logoMain:i,enableNotification:a}=t;return g.jsx(py,{logoIcon:r,logoMain:i,enableNotification:a,children:g.jsx(e,{ref:n,...t})})})}function vg(){const e=O.useContext(gy);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function FL(){return vg().dispatch}function rs(){return vg().state}function $n(){return rs().media}function $o(){return rs().drawer}function Cy(){return rs().logo}function tu(){return rs().notifications}function nu(){return rs().theme}function my(){const{iconColor:e,iconColorOpen:t}=nu(),{open:n,handleDrawerToggle:r}=$o();return g.jsx(ho,{"aria-label":"open drawer",onClick:r,edge:"start",color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:n?t:e,ml:{xs:0,lg:-2}},children:n?g.jsx(ot.MenuFoldOutlined,{}):g.jsx(ot.MenuUnfoldOutlined,{})})}function Ey(e){const t=O.useRef(),n=b.useTheme(),{downLg:r,horizontal:i}=$n(),{open:a,width:l}=$o(),u=r?b.AppBar:$0,A=Xi(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:i?"100%":a?`calc(100% - ${l}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),f={position:"fixed",color:"inherit",elevation:0,sx:A};return r||gt.extend(f,{open:a}),g.jsx(u,{ref:t,...f,children:g.jsxs(b.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!i&&g.jsx(my,{}),e.children]})})}function LL(e){const t=b.useTheme(),{notification:n,onClick:r,selected:i,divider:a}=e,{resource:l}=tu(),u=be.useNotify(),A=be.useRedirect(),[f]=be.useUpdate(l,{id:n==null?void 0:n.id,data:{...n,readed:Hr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n!=null&&n.resource?n!=null&&n.resource.startsWith("/")?(A(n==null?void 0:n.resource),r()):document.location.href=n==null?void 0:n.resource:r()},onFailure:()=>{u("resources.notifications.messages.readed.error","warning")}}),p=O.useCallback(()=>f(),[f]),[C]=be.useLocaleState(),h=O.useMemo(()=>Hr(n.created).locale(C).fromNow(),[n,C]);return g.jsx(b.ListItem,{disablePadding:!0,divider:a,children:g.jsxs(b.ListItemButton,{selected:i,onClick:p,children:[g.jsx(b.ListItemAvatar,{children:g.jsx(b.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:g.jsx(ot.MessageOutlined,{})})}),g.jsx(b.ListItemText,{primary:n.title,secondary:n.content}),g.jsx(b.Box,{flexGrow:1,flexShrink:1,minWidth:t.spacing(2)}),g.jsx(b.ListItemText,{primary:h,primaryTypographyProps:{variant:"caption"}})]})})}const NL={width:36,height:36,fontSize:"1rem"},VL={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function Iy(){const{enable:e}=tu();return e?g.jsx(HL,{}):null}function HL(){const e=b.useTheme(),t=O.useRef(),{resource:n}=tu(),{downMd:r}=$n(),{iconColor:i,iconColorOpen:a}=nu(),[l,u]=O.useState(!1),[A,f]=O.useState([]),p=A.filter(B=>B.readed===null).length,C=O.useCallback(()=>u(!l),[l]),h=O.useCallback(()=>{t.current&&t.current.contains(event.target)||u(!1)},[t.current,u]),{data:E,isLoading:I}=be.useGetList(n,{pagination:{page:1,perPage:50},sort:{field:"created",order:"DESC"},filter:{readed:!1}});return O.useEffect(()=>{!I&&E&&f(E??[])},[E,I]),g.jsxs(b.Box,{sx:{flexShrink:0},children:[g.jsx(ho,{color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:l?a:i},"aria-label":"open profile",ref:t,"aria-controls":l?"profile-grow":void 0,"aria-haspopup":"true",onClick:C,children:g.jsx(b.Badge,{badgeContent:p,color:"primary",children:g.jsx(ot.BellOutlined,{})})}),g.jsx(b.Popper,{placement:r?"bottom":"bottom-end",open:l,anchorEl:t.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[r?-5:0,9]}}]},children:({TransitionProps:B})=>g.jsx(Co,{type:"grow",position:r?"top":"top-right",in:open,...B,children:g.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:"100%",minWidth:285,maxWidth:420,[e.breakpoints.down("md")]:{maxWidth:285}},children:g.jsx(b.ClickAwayListener,{onClickAway:h,children:g.jsx(Yn,{title:"Notification",elevation:0,border:!1,content:!1,secondary:g.jsx(g.Fragment,{children:p>0&&g.jsx(b.Tooltip,{title:"Mark as all read",children:g.jsx(ho,{color:"success",size:"small",children:g.jsx(ot.CheckCircleOutlined,{style:{fontSize:"1.15rem"}})})})}),children:g.jsx(b.List,{component:"nav",sx:{p:0,"& .MuiListItemButton-root":{py:.5,"&.Mui-selected":{bgcolor:"grey.50",color:"text.primary"},"& .MuiAvatar-root":NL,"& .MuiListItemSecondaryAction-root":{...VL,position:"relative"}}},children:A.map((v,S)=>g.jsx(LL,{selected:p>0,notification:v,onClick:h,divider:S<A.length-1},v.id))})})})})})})]})}const zL=()=>{const[e,t]=O.useState(!1),n=O.useCallback(()=>t(!1),[t]),r=O.useCallback(()=>t(!0),[t]),i=be.useTranslate();return g.jsxs(O.Fragment,{children:[g.jsxs(b.ListItemButton,{onClick:r,children:[g.jsx(b.ListItemIcon,{children:g.jsx(_n.Key,{})}),g.jsx(b.ListItemText,{primary:i("ra.auth.change_password")})]}),g.jsx(b.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:g.jsx(pg,{onSuccess:n})})]})},WL=()=>{const e=be.useLogout(),t=be.useTranslate();return g.jsx(O.Fragment,{children:g.jsxs(b.ListItemButton,{onClick:e,children:[g.jsx(b.ListItemIcon,{children:g.jsx(_n.LogoutOutlined,{})}),g.jsx(b.ListItemText,{primary:t("ra.auth.logout")})]})})},UL=()=>{const e=be.useTranslate(),t=be.useAuthProvider(),n=O.useCallback(()=>t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,i]=O.useState(!1);return O.useEffect(()=>{t.isImpersonating&&t.isImpersonating().then(a=>i(a))},[t,i]),r?g.jsx(O.Fragment,{children:g.jsxs(b.ListItemButton,{onClick:n,children:[g.jsx(b.ListItemIcon,{children:g.jsx(_n.LogoutOutlined,{})}),g.jsx(b.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};c.node,c.any.isRequired,c.any.isRequired;const By=()=>{var B;const e=b.useTheme(),{identity:t}=R.useGetIdentity(),n=t!==void 0&&t.image&&t.image!==null&&t.image!=="",r=O.useRef(null),[i,a]=O.useState(!1),l=()=>{a(v=>!v)},u=v=>{r.current&&r.current.contains(v.target)||a(!1)},A=e.palette.mode==="dark"?"grey.200":"grey.300",f=R.useLogout(),p=R.useDataProvider(),C=R.useAuthProvider(),h=O.useCallback(()=>{f()},[C,f]),[E,I]=O.useState(null);return O.useEffect(()=>{if(!n)return;async function v(){var S=await p.getFile("/profile/me/image");I(S)}v()},[p,n]),g.jsxs(b.Box,{sx:{flexShrink:0},children:[g.jsx(b.ButtonBase,{sx:{p:.25,bgcolor:i?A:"transparent",borderRadius:1,"&:hover":{bgcolor:e.palette.mode==="dark"?"secondary.light":"secondary.lighter"},"&:focus-visible":{outline:`2px solid ${e.palette.secondary.dark}`,outlineOffset:2}},"aria-label":"open profile",ref:r,"aria-controls":i?"profile-grow":void 0,"aria-haspopup":"true",onClick:l,children:g.jsxs(b.Stack,{direction:"row",spacing:2,alignItems:"center",sx:{p:.5},children:[g.jsx(sc,{alt:(B=t==null?void 0:t.name)==null?void 0:B.toUpperCase(),src:E,size:"xs"}),g.jsx(b.Typography,{variant:"subtitle1",children:t==null?void 0:t.name})]})}),g.jsx(b.Popper,{placement:"bottom-end",open:i,anchorEl:r.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:v})=>{var S;return g.jsx(Co,{type:"grow",position:"top-right",in:i,...v,children:g.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:290,minWidth:240,maxWidth:290,[e.breakpoints.down("md")]:{maxWidth:250}},children:g.jsx(b.ClickAwayListener,{onClickAway:u,children:g.jsxs(Yn,{elevation:0,border:!1,content:!1,children:[g.jsx(b.CardContent,{sx:{px:2.5,pt:3},children:g.jsxs(b.Grid,{container:!0,justifyContent:"space-between",alignItems:"center",children:[g.jsx(b.Grid,{item:!0,children:g.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[g.jsx(sc,{alt:"profile user",src:E,sx:{width:32,height:32}}),g.jsxs(b.Stack,{children:[g.jsx(b.Typography,{variant:"h6",children:t==null?void 0:t.name}),g.jsx(b.Typography,{variant:"body2",color:"textSecondary",children:(S=t==null?void 0:t.roles)==null?void 0:S.map(M=>M.name.replace("ROLE_","")).join(",")})]})]})}),g.jsx(b.Grid,{item:!0,children:g.jsx(b.Tooltip,{title:"Logout",children:g.jsx(ho,{size:"large",sx:{color:"text.primary"},onClick:h,children:g.jsx(ot.LogoutOutlined,{})})})})]})}),g.jsx(b.Grid,{container:!0,children:g.jsx(b.Grid,{item:!0,xs:12,children:g.jsxs(b.List,{component:"nav",sx:{p:0,"& .MuiListItemIcon-root":{minWidth:32}},children:[g.jsx(zL,{}),g.jsx(WL,{}),g.jsx(UL,{})]})})})]})})})})}})]})},yy=e=>{const t=Tt(),{downMd:n}=$n(),{iconColor:r,iconColorOpen:i}=nu(),[a,l]=O.useState(!1),u=O.useRef(null),A=O.useCallback(()=>{l(!a)},[a]),f=O.useCallback(p=>{u.current&&u.current.contains(p.target)||l(!1)},[]);return n?g.jsxs(g.Fragment,{children:[g.jsx(b.Box,{sx:{flexShrink:0},children:g.jsx(ho,{sx:{color:"text.primary",bgcolor:a?i:r},"aria-label":"open more menu",ref:u,"aria-controls":a?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:A,color:"secondary",variant:"light",children:g.jsx(ot.MoreOutlined,{})})}),g.jsx(b.Popper,{placement:"bottom-end",open:a,anchorEl:u.current,role:void 0,transition:!0,disablePortal:!0,style:{width:"100%"},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:p})=>g.jsx(Co,{type:"fade",in:a,...p,children:g.jsx(b.Paper,{sx:{boxShadow:t.customShadows.z1},children:g.jsx(b.ClickAwayListener,{onClickAway:f,children:g.jsx(b.AppBar,{color:"inherit",children:g.jsx(b.Toolbar,{children:e.children})})})})})})]}):g.jsx(g.Fragment,{children:e.children})};function vy(e){return g.jsx(b.Box,{...e,flex:1})}function ha(e){const{name:t,version:n}=e;return g.jsx(b.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:"24px 16px 0px",mt:"auto"},children:g.jsxs(b.Typography,{variant:"caption",children:[g.jsx("span",{dangerouslySetInnerHTML:{__html:(e==null?void 0:e.copy)||""}})," ",t," - ",n]})})}ha.propTypes={name:c.string.isRequired,version:c.string.isRequired,copy:c.string};ha.defaultProps={copy:"© Applica Software Guru for"};function by(e){const{width:t}=$o(),{horizontal:n}=$n(),{container:r}=Zn();return g.jsxs(b.Box,{component:"main",sx:{width:`calc(100% - ${t}px)`,flexGrow:1,p:{xs:0,sm:2,lg:1},pt:{lg:2}},children:[g.jsx(b.Toolbar,{sx:{mt:n?8:"inherit"}})," ",g.jsx(b.Container,{maxWidth:r?"xl":!1,sx:{...r&&{px:{xs:0,sm:2}},position:"relative",minHeight:"calc(100vh - 110px)",display:"flex",flexDirection:"column"},children:e.children})]})}const Qy=O.forwardRef((e,t)=>{const n=Xi(e,{display:"flex",width:"100%"});return g.jsx(b.Box,{ref:t,...e,sx:n,children:e.children})});var xy={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(xy);var YL=xy.exports,$A={};const GL=KP(Tk);var RE;function KL(){return RE||(RE=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=GL}($A)),$A}function wy(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=wy(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function qL(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=wy(e))&&(r&&(r+=" "),r+=t);return r}var Fd=globalThis&&globalThis.__assign||function(){return Fd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Fd.apply(this,arguments)},_L=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Ty=function(e){var t=e.className,n=e.sx,r=_L(e,["className","sx"]),i=be.useLoading(),a=Tt();return N.createElement(JL,{className:t,sx:n},i?N.createElement(kB,Fd({className:qL("app-loader",uc.loader),color:"inherit",size:a.spacing(2),thickness:6},r)):N.createElement(_y,{className:uc.loadedIcon}))};Ty.propTypes={classes:c.object,className:c.string,width:c.string};var Ld="RaLoadingIndicator",uc={loader:"".concat(Ld,"-loader"),loadedIcon:"".concat(Ld,"-loadedIcon")},JL=ce("div",{name:Ld,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={},t["& .".concat(uc.loader)]={marginLeft:n.spacing(1.5),marginRight:n.spacing(1.5)},t["& .".concat(uc.loadedIcon)]={},t});const bg=e=>e.scrollTop;function Hi(e,t){var n,r;const{timeout:i,easing:a,style:l={}}=e;return{duration:(n=l.transitionDuration)!=null?n:typeof i=="number"?i:i[t.mode]||0,easing:(r=l.transitionTimingFunction)!=null?r:typeof a=="object"?a[t.mode]:a,delay:l.transitionDelay}}const XL=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function ZL(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),a=qi(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const f=a.getComputedStyle(t);l=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("transform")}let u=0,A=0;if(l&&l!=="none"&&typeof l=="string"){const f=l.split("(")[1].split(")")[0].split(",");u=parseInt(f[4],10),A=parseInt(f[5],10)}return e==="left"?i?`translateX(${i.right+u-r.left}px)`:`translateX(${a.innerWidth+u-r.left}px)`:e==="right"?i?`translateX(-${r.right-i.left-u}px)`:`translateX(-${r.left+r.width-u}px)`:e==="up"?i?`translateY(${i.bottom+A-r.top}px)`:`translateY(${a.innerHeight+A-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-A}px)`:`translateY(-${r.top+r.height-A}px)`}function Py(e){return typeof e=="function"?e():e}function wl(e,t,n){const r=Py(n),i=ZL(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const Ry=N.forwardRef(function(t,n){const r=Tt(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},a={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:u=!0,children:A,container:f,direction:p="down",easing:C=i,in:h,onEnter:E,onEntered:I,onEntering:B,onExit:v,onExited:S,onExiting:M,style:x,timeout:T=a,TransitionComponent:P=Hf}=t,F=Ge(t,XL),j=N.useRef(null),K=Rn(A.ref,j,n),q=k=>ee=>{k&&(ee===void 0?k(j.current):k(j.current,ee))},U=q((k,ee)=>{wl(p,k,f),bg(k),E&&E(k,ee)}),$=q((k,ee)=>{const z=Hi({timeout:T,style:x,easing:C},{mode:"enter"});k.style.webkitTransition=r.transitions.create("-webkit-transform",W({},z)),k.style.transition=r.transitions.create("transform",W({},z)),k.style.webkitTransform="none",k.style.transform="none",B&&B(k,ee)}),ae=q(I),ie=q(M),X=q(k=>{const ee=Hi({timeout:T,style:x,easing:C},{mode:"exit"});k.style.webkitTransition=r.transitions.create("-webkit-transform",ee),k.style.transition=r.transitions.create("transform",ee),wl(p,k,f),v&&v(k)}),G=q(k=>{k.style.webkitTransition="",k.style.transition="",S&&S(k)}),H=k=>{l&&l(j.current,k)},J=N.useCallback(()=>{j.current&&wl(p,j.current,f)},[p,f]);return N.useEffect(()=>{if(h||p==="down"||p==="right")return;const k=Q0(()=>{j.current&&wl(p,j.current,f)}),ee=qi(j.current);return ee.addEventListener("resize",k),()=>{k.clear(),ee.removeEventListener("resize",k)}},[p,h,f]),N.useEffect(()=>{h||J()},[h,J]),g.jsx(P,W({nodeRef:j,onEnter:U,onEntered:ae,onEntering:$,onExit:X,onExited:G,onExiting:ie,addEndListener:H,appear:u,in:h,timeout:T},F,{children:(k,ee)=>N.cloneElement(A,W({ref:K,style:W({visibility:k==="exited"&&!h?"hidden":void 0},x,A.props.style)},ee))}))});process.env.NODE_ENV!=="production"&&(Ry.propTypes={addEndListener:c.func,appear:c.bool,children:Ki.isRequired,container:Wr(c.oneOfType([Ko,c.func]),e=>{if(e.open){const t=Py(e.container);if(t&&t.nodeType===1){const n=t.getBoundingClientRect();if(process.env.NODE_ENV!=="test"&&n.top===0&&n.left===0&&n.right===0&&n.bottom===0)return new Error(["MUI: The `container` prop provided to the component is invalid.","The anchor element should be part of the document layout.","Make sure the element is present in the document or that it's not display none."].join(`
|
|
203
203
|
`))}else if(!t||typeof t.getBoundingClientRect!="function"||t.contextElement!=null&&t.contextElement.nodeType!==1)return new Error(["MUI: The `container` prop provided to the component is invalid.","It should be an HTML element instance."].join(`
|
|
204
204
|
`))}return null}),direction:c.oneOf(["down","left","right","up"]),easing:c.oneOfType([c.shape({enter:c.string,exit:c.string}),c.string]),in:c.bool,onEnter:c.func,onEntered:c.func,onEntering:c.func,onExit:c.func,onExited:c.func,onExiting:c.func,style:c.object,timeout:c.oneOfType([c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});const $L=Ry;function e9(e){return typeof e=="string"}function t9(e,t,n){return e===void 0||e9(e)?t:W({},t,{ownerState:W({},t.ownerState,n)})}const n9={disableDefaultClasses:!1},r9=N.createContext(n9);function o9(e){const{disableDefaultClasses:t}=N.useContext(r9);return n=>t?"":e(n)}function Sy(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function i9(e,t,n){return typeof e=="function"?e(t,n):e}function SE(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function s9(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:a}=e;if(!t){const E=Je(i==null?void 0:i.className,r==null?void 0:r.className,a,n==null?void 0:n.className),I=W({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),B=W({},n,i,r);return E.length>0&&(B.className=E),Object.keys(I).length>0&&(B.style=I),{props:B,internalRef:void 0}}const l=Sy(W({},i,r)),u=SE(r),A=SE(i),f=t(l),p=Je(f==null?void 0:f.className,n==null?void 0:n.className,a,i==null?void 0:i.className,r==null?void 0:r.className),C=W({},f==null?void 0:f.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),h=W({},f,n,A,u);return p.length>0&&(h.className=p),Object.keys(C).length>0&&(h.style=C),{props:h,internalRef:f.ref}}const a9=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function l9(e){var t;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:a=!1}=e,l=Ge(e,a9),u=a?{}:i9(r,i),{props:A,internalRef:f}=s9(W({},l,{externalSlotProps:u})),p=Rn(f,u==null?void 0:u.ref,(t=e.additionalProps)==null?void 0:t.ref);return t9(n,W({},A,{ref:p}),i)}function c9(e){const t=lr(e);return t.body===e?qi(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Ys(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function OE(e){return parseInt(qi(e).getComputedStyle(e).paddingRight,10)||0}function u9(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function DE(e,t,n,r,i){const a=[t,n,...r];[].forEach.call(e.children,l=>{const u=a.indexOf(l)===-1,A=!u9(l);u&&A&&Ys(l,i)})}function ed(e,t){let n=-1;return e.some((r,i)=>t(r)?(n=i,!0):!1),n}function A9(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(c9(r)){const l=xR(lr(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${OE(r)+l}px`;const u=lr(r).querySelectorAll(".mui-fixed");[].forEach.call(u,A=>{n.push({value:A.style.paddingRight,property:"padding-right",el:A}),A.style.paddingRight=`${OE(A)+l}px`})}let a;if(r.parentNode instanceof DocumentFragment)a=lr(r).body;else{const l=r.parentElement,u=qi(r);a=(l==null?void 0:l.nodeName)==="HTML"&&u.getComputedStyle(l).overflowY==="scroll"?l:r}n.push({value:a.style.overflow,property:"overflow",el:a},{value:a.style.overflowX,property:"overflow-x",el:a},{value:a.style.overflowY,property:"overflow-y",el:a}),a.style.overflow="hidden"}return()=>{n.forEach(({value:a,el:l,property:u})=>{a?l.style.setProperty(u,a):l.style.removeProperty(u)})}}function d9(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class f9{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&Ys(t.modalRef,!1);const i=d9(n);DE(n,t.mount,t.modalRef,i,!0);const a=ed(this.containers,l=>l.container===n);return a!==-1?(this.containers[a].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:i}),r)}mount(t,n){const r=ed(this.containers,a=>a.modals.indexOf(t)!==-1),i=this.containers[r];i.restore||(i.restore=A9(i,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const i=ed(this.containers,l=>l.modals.indexOf(t)!==-1),a=this.containers[i];if(a.modals.splice(a.modals.indexOf(t),1),this.modals.splice(r,1),a.modals.length===0)a.restore&&a.restore(),t.modalRef&&Ys(t.modalRef,n),DE(a.container,t.mount,t.modalRef,a.hiddenSiblings,!1),this.containers.splice(i,1);else{const l=a.modals[a.modals.length-1];l.modalRef&&Ys(l.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function g9(e){return typeof e=="function"?e():e}function p9(e){return e?e.props.hasOwnProperty("in"):!1}const h9=new f9;function C9(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=h9,closeAfterTransition:a=!1,onTransitionEnter:l,onTransitionExited:u,children:A,onClose:f,open:p,rootRef:C}=e,h=N.useRef({}),E=N.useRef(null),I=N.useRef(null),B=Rn(I,C),[v,S]=N.useState(!p),M=p9(A);let x=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(x=!1);const T=()=>lr(E.current),P=()=>(h.current.modalRef=I.current,h.current.mount=E.current,h.current),F=()=>{i.mount(P(),{disableScrollLock:r}),I.current&&(I.current.scrollTop=0)},j=ao(()=>{const H=g9(t)||T().body;i.add(P(),H),I.current&&F()}),K=N.useCallback(()=>i.isTopModal(P()),[i]),q=ao(H=>{E.current=H,H&&(p&&K()?F():I.current&&Ys(I.current,x))}),U=N.useCallback(()=>{i.remove(P(),x)},[x,i]);N.useEffect(()=>()=>{U()},[U]),N.useEffect(()=>{p?j():(!M||!a)&&U()},[p,U,M,a,j]);const $=H=>J=>{var k;(k=H.onKeyDown)==null||k.call(H,J),!(J.key!=="Escape"||!K())&&(n||(J.stopPropagation(),f&&f(J,"escapeKeyDown")))},ae=H=>J=>{var k;(k=H.onClick)==null||k.call(H,J),J.target===J.currentTarget&&f&&f(J,"backdropClick")};return{getRootProps:(H={})=>{const J=Sy(e);delete J.onTransitionEnter,delete J.onTransitionExited;const k=W({},J,H);return W({role:"presentation"},k,{onKeyDown:$(k),ref:B})},getBackdropProps:(H={})=>{const J=H;return W({"aria-hidden":!0},J,{onClick:ae(J),open:p})},getTransitionProps:()=>{const H=()=>{S(!1),l&&l()},J=()=>{S(!0),u&&u(),a&&U()};return{onEnter:hd(H,A==null?void 0:A.props.onEnter),onExited:hd(J,A==null?void 0:A.props.onExited)}},rootRef:B,portalRef:q,isTopModal:K,exited:v,hasTransition:M}}const m9=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function E9(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function I9(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function B9(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||I9(e))}function y9(e){const t=[],n=[];return Array.from(e.querySelectorAll(m9)).forEach((r,i)=>{const a=E9(r);a===-1||!B9(r)||(a===0?t.push(r):n.push({documentOrder:i,tabIndex:a,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(t)}function v9(){return!0}function Ac(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:a=y9,isEnabled:l=v9,open:u}=e,A=N.useRef(!1),f=N.useRef(null),p=N.useRef(null),C=N.useRef(null),h=N.useRef(null),E=N.useRef(!1),I=N.useRef(null),B=Rn(t.ref,I),v=N.useRef(null);N.useEffect(()=>{!u||!I.current||(E.current=!n)},[n,u]),N.useEffect(()=>{if(!u||!I.current)return;const x=lr(I.current);return I.current.contains(x.activeElement)||(I.current.hasAttribute("tabIndex")||(process.env.NODE_ENV!=="production"&&console.error(["MUI: The modal content node does not accept focus.",'For the benefit of assistive technologies, the tabIndex of the node is being set to "-1".'].join(`
|
|
205
205
|
`)),I.current.setAttribute("tabIndex","-1")),E.current&&I.current.focus()),()=>{i||(C.current&&C.current.focus&&(A.current=!0,C.current.focus()),C.current=null)}},[u]),N.useEffect(()=>{if(!u||!I.current)return;const x=lr(I.current),T=j=>{v.current=j,!(r||!l()||j.key!=="Tab")&&x.activeElement===I.current&&j.shiftKey&&(A.current=!0,p.current&&p.current.focus())},P=()=>{const j=I.current;if(j===null)return;if(!x.hasFocus()||!l()||A.current){A.current=!1;return}if(j.contains(x.activeElement)||r&&x.activeElement!==f.current&&x.activeElement!==p.current)return;if(x.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!E.current)return;let K=[];if((x.activeElement===f.current||x.activeElement===p.current)&&(K=a(I.current)),K.length>0){var q,U;const $=!!((q=v.current)!=null&&q.shiftKey&&((U=v.current)==null?void 0:U.key)==="Tab"),ae=K[0],ie=K[K.length-1];typeof ae!="string"&&typeof ie!="string"&&($?ie.focus():ae.focus())}else j.focus()};x.addEventListener("focusin",P),x.addEventListener("keydown",T,!0);const F=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&P()},50);return()=>{clearInterval(F),x.removeEventListener("focusin",P),x.removeEventListener("keydown",T,!0)}},[n,r,i,l,u,a]);const S=x=>{C.current===null&&(C.current=x.relatedTarget),E.current=!0,h.current=x.target;const T=t.props.onFocus;T&&T(x)},M=x=>{C.current===null&&(C.current=x.relatedTarget),E.current=!0};return g.jsxs(N.Fragment,{children:[g.jsx("div",{tabIndex:u?0:-1,onFocus:M,ref:f,"data-testid":"sentinelStart"}),N.cloneElement(t,{ref:B,onFocus:S}),g.jsx("div",{tabIndex:u?0:-1,onFocus:M,ref:p,"data-testid":"sentinelEnd"})]})}process.env.NODE_ENV!=="production"&&(Ac.propTypes={children:Ki,disableAutoFocus:c.bool,disableEnforceFocus:c.bool,disableRestoreFocus:c.bool,getTabbable:c.func,isEnabled:c.func,open:c.bool.isRequired});process.env.NODE_ENV!=="production"&&(Ac["propTypes"]=Ec(Ac.propTypes));function b9(e){return typeof e=="function"?e():e}const oa=N.forwardRef(function(t,n){const{children:r,container:i,disablePortal:a=!1}=t,[l,u]=N.useState(null),A=Rn(N.isValidElement(r)?r.ref:null,n);if(Fi(()=>{a||u(b9(i)||document.body)},[i,a]),Fi(()=>{if(l&&!a)return Yl(n,l),()=>{Yl(n,null)}},[n,l,a]),a){if(N.isValidElement(r)){const f={ref:A};return N.cloneElement(r,f)}return g.jsx(N.Fragment,{children:r})}return g.jsx(N.Fragment,{children:l&&GP.createPortal(r,l)})});process.env.NODE_ENV!=="production"&&(oa.propTypes={children:c.node,container:c.oneOfType([Ko,c.func]),disablePortal:c.bool});process.env.NODE_ENV!=="production"&&(oa["propTypes"]=Ec(oa.propTypes));const Q9=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],x9={entering:{opacity:1},entered:{opacity:1}},Oy=N.forwardRef(function(t,n){const r=Tt(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:l=!0,children:u,easing:A,in:f,onEnter:p,onEntered:C,onEntering:h,onExit:E,onExited:I,onExiting:B,style:v,timeout:S=i,TransitionComponent:M=Hf}=t,x=Ge(t,Q9),T=N.useRef(null),P=Rn(T,u.ref,n),F=X=>G=>{if(X){const H=T.current;G===void 0?X(H):X(H,G)}},j=F(h),K=F((X,G)=>{bg(X);const H=Hi({style:v,timeout:S,easing:A},{mode:"enter"});X.style.webkitTransition=r.transitions.create("opacity",H),X.style.transition=r.transitions.create("opacity",H),p&&p(X,G)}),q=F(C),U=F(B),$=F(X=>{const G=Hi({style:v,timeout:S,easing:A},{mode:"exit"});X.style.webkitTransition=r.transitions.create("opacity",G),X.style.transition=r.transitions.create("opacity",G),E&&E(X)}),ae=F(I),ie=X=>{a&&a(T.current,X)};return g.jsx(M,W({appear:l,in:f,nodeRef:T,onEnter:K,onEntered:q,onEntering:j,onExit:$,onExited:ae,onExiting:U,addEndListener:ie,timeout:S},x,{children:(X,G)=>N.cloneElement(u,W({style:W({opacity:0,visibility:X==="exited"&&!f?"hidden":void 0},x9[X],v,u.props.style),ref:P},G))}))});process.env.NODE_ENV!=="production"&&(Oy.propTypes={addEndListener:c.func,appear:c.bool,children:Ki.isRequired,easing:c.oneOfType([c.shape({enter:c.string,exit:c.string}),c.string]),in:c.bool,onEnter:c.func,onEntered:c.func,onEntering:c.func,onExit:c.func,onExited:c.func,onExiting:c.func,style:c.object,timeout:c.oneOfType([c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});const w9=Oy;function T9(e){return zt("MuiBackdrop",e)}qt("MuiBackdrop",["root","invisible"]);const P9=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],R9=e=>{const{classes:t,invisible:n}=e;return En({root:["root",n&&"invisible"]},T9,t)},S9=ce("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>W({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),Dy=N.forwardRef(function(t,n){var r,i,a;const l=_t({props:t,name:"MuiBackdrop"}),{children:u,className:A,component:f="div",components:p={},componentsProps:C={},invisible:h=!1,open:E,slotProps:I={},slots:B={},TransitionComponent:v=w9,transitionDuration:S}=l,M=Ge(l,P9),x=W({},l,{component:f,invisible:h}),T=R9(x),P=(r=I.root)!=null?r:C.root;return g.jsx(v,W({in:E,timeout:S},M,{children:g.jsx(S9,W({"aria-hidden":!0},P,{as:(i=(a=B.root)!=null?a:p.Root)!=null?i:f,className:Je(T.root,A,P==null?void 0:P.className),ownerState:W({},x,P==null?void 0:P.ownerState),classes:T,ref:n,children:u}))}))});process.env.NODE_ENV!=="production"&&(Dy.propTypes={children:c.node,classes:c.object,className:c.string,component:c.elementType,components:c.shape({Root:c.elementType}),componentsProps:c.shape({root:c.object}),invisible:c.bool,open:c.bool.isRequired,slotProps:c.shape({root:c.object}),slots:c.shape({root:c.elementType}),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),TransitionComponent:c.elementType,transitionDuration:c.oneOfType([c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});const O9=Dy;function D9(e){return zt("MuiModal",e)}qt("MuiModal",["root","hidden","backdrop"]);const M9=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],j9=e=>{const{open:t,exited:n,classes:r}=e;return En({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},D9,r)},k9=ce("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(({theme:e,ownerState:t})=>W({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),F9=ce(O9,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),My=N.forwardRef(function(t,n){var r,i,a,l,u,A;const f=_t({name:"MuiModal",props:t}),{BackdropComponent:p=F9,BackdropProps:C,className:h,closeAfterTransition:E=!1,children:I,container:B,component:v,components:S={},componentsProps:M={},disableAutoFocus:x=!1,disableEnforceFocus:T=!1,disableEscapeKeyDown:P=!1,disablePortal:F=!1,disableRestoreFocus:j=!1,disableScrollLock:K=!1,hideBackdrop:q=!1,keepMounted:U=!1,onBackdropClick:$,open:ae,slotProps:ie,slots:X}=f,G=Ge(f,M9),H=W({},f,{closeAfterTransition:E,disableAutoFocus:x,disableEnforceFocus:T,disableEscapeKeyDown:P,disablePortal:F,disableRestoreFocus:j,disableScrollLock:K,hideBackdrop:q,keepMounted:U}),{getRootProps:J,getBackdropProps:k,getTransitionProps:ee,portalRef:z,isTopModal:_,exited:Ae,hasTransition:fe}=C9(W({},H,{rootRef:n})),le=W({},H,{exited:Ae}),ue=j9(le),ge={};if(I.props.tabIndex===void 0&&(ge.tabIndex="-1"),fe){const{onEnter:He,onExited:de}=ee();ge.onEnter=He,ge.onExited=de}const Ee=(r=(i=X==null?void 0:X.root)!=null?i:S.Root)!=null?r:k9,Ce=(a=(l=X==null?void 0:X.backdrop)!=null?l:S.Backdrop)!=null?a:p,pe=(u=ie==null?void 0:ie.root)!=null?u:M.root,me=(A=ie==null?void 0:ie.backdrop)!=null?A:M.backdrop,Qe=Cr.useSlotProps({elementType:Ee,externalSlotProps:pe,externalForwardedProps:G,getSlotProps:J,additionalProps:{ref:n,as:v},ownerState:le,className:Je(h,pe==null?void 0:pe.className,ue==null?void 0:ue.root,!le.open&&le.exited&&(ue==null?void 0:ue.hidden))}),se=Cr.useSlotProps({elementType:Ce,externalSlotProps:me,additionalProps:C,getSlotProps:He=>k(W({},He,{onClick:de=>{$&&$(de),He!=null&&He.onClick&&He.onClick(de)}})),className:Je(me==null?void 0:me.className,C==null?void 0:C.className,ue==null?void 0:ue.backdrop),ownerState:le});return!U&&!ae&&(!fe||Ae)?null:g.jsx(oa,{ref:z,container:B,disablePortal:F,children:g.jsxs(Ee,W({},Qe,{children:[!q&&p?g.jsx(Ce,W({},se)):null,g.jsx(Ac,{disableEnforceFocus:T,disableAutoFocus:x,disableRestoreFocus:j,isEnabled:_,open:ae,children:N.cloneElement(I,ge)})]}))})});process.env.NODE_ENV!=="production"&&(My.propTypes={BackdropComponent:c.elementType,BackdropProps:c.object,children:Ki.isRequired,classes:c.object,className:c.string,closeAfterTransition:c.bool,component:c.elementType,components:c.shape({Backdrop:c.elementType,Root:c.elementType}),componentsProps:c.shape({backdrop:c.oneOfType([c.func,c.object]),root:c.oneOfType([c.func,c.object])}),container:c.oneOfType([Ko,c.func]),disableAutoFocus:c.bool,disableEnforceFocus:c.bool,disableEscapeKeyDown:c.bool,disablePortal:c.bool,disableRestoreFocus:c.bool,disableScrollLock:c.bool,hideBackdrop:c.bool,keepMounted:c.bool,onBackdropClick:c.func,onClose:c.func,onTransitionEnter:c.func,onTransitionExited:c.func,open:c.bool.isRequired,slotProps:c.shape({backdrop:c.oneOfType([c.func,c.object]),root:c.oneOfType([c.func,c.object])}),slots:c.shape({backdrop:c.elementType,root:c.elementType}),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object])});const L9=My;var Qg={},N9=YL;Object.defineProperty(Qg,"__esModule",{value:!0});var jy=Qg.default=void 0,V9=N9(KL()),H9=g,z9=(0,V9.default)((0,H9.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");jy=Qg.default=z9;const W9=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function Nd(e){return`scale(${e}, ${e**2})`}const U9={entering:{opacity:1,transform:Nd(1)},entered:{opacity:1,transform:"none"}},td=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),xg=N.forwardRef(function(t,n){const{addEndListener:r,appear:i=!0,children:a,easing:l,in:u,onEnter:A,onEntered:f,onEntering:p,onExit:C,onExited:h,onExiting:E,style:I,timeout:B="auto",TransitionComponent:v=Hf}=t,S=Ge(t,W9),M=N.useRef(),x=N.useRef(),T=Tt(),P=N.useRef(null),F=Rn(P,a.ref,n),j=G=>H=>{if(G){const J=P.current;H===void 0?G(J):G(J,H)}},K=j(p),q=j((G,H)=>{bg(G);const{duration:J,delay:k,easing:ee}=Hi({style:I,timeout:B,easing:l},{mode:"enter"});let z;B==="auto"?(z=T.transitions.getAutoHeightDuration(G.clientHeight),x.current=z):z=J,G.style.transition=[T.transitions.create("opacity",{duration:z,delay:k}),T.transitions.create("transform",{duration:td?z:z*.666,delay:k,easing:ee})].join(","),A&&A(G,H)}),U=j(f),$=j(E),ae=j(G=>{const{duration:H,delay:J,easing:k}=Hi({style:I,timeout:B,easing:l},{mode:"exit"});let ee;B==="auto"?(ee=T.transitions.getAutoHeightDuration(G.clientHeight),x.current=ee):ee=H,G.style.transition=[T.transitions.create("opacity",{duration:ee,delay:J}),T.transitions.create("transform",{duration:td?ee:ee*.666,delay:td?J:J||ee*.333,easing:k})].join(","),G.style.opacity=0,G.style.transform=Nd(.75),C&&C(G)}),ie=j(h),X=G=>{B==="auto"&&(M.current=setTimeout(G,x.current||0)),r&&r(P.current,G)};return N.useEffect(()=>()=>{clearTimeout(M.current)},[]),g.jsx(v,W({appear:i,in:u,nodeRef:P,onEnter:q,onEntered:U,onEntering:K,onExit:ae,onExited:ie,onExiting:$,addEndListener:X,timeout:B==="auto"?null:B},S,{children:(G,H)=>N.cloneElement(a,W({style:W({opacity:0,transform:Nd(.75),visibility:G==="exited"&&!u?"hidden":void 0},U9[G],I,a.props.style),ref:F},H))}))});process.env.NODE_ENV!=="production"&&(xg.propTypes={addEndListener:c.func,appear:c.bool,children:Ki.isRequired,easing:c.oneOfType([c.shape({enter:c.string,exit:c.string}),c.string]),in:c.bool,onEnter:c.func,onEntered:c.func,onEntering:c.func,onExit:c.func,onExited:c.func,onExiting:c.func,style:c.object,timeout:c.oneOfType([c.oneOf(["auto"]),c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});xg.muiSupportAuto=!0;const ME=xg;var pn="top",Jn="bottom",Xn="right",hn="left",wg="auto",Ca=[pn,Jn,Xn,hn],zi="start",ia="end",Y9="clippingParents",ky="viewport",Os="popper",G9="reference",jE=Ca.reduce(function(e,t){return e.concat([t+"-"+zi,t+"-"+ia])},[]),Fy=[].concat(Ca,[wg]).reduce(function(e,t){return e.concat([t,t+"-"+zi,t+"-"+ia])},[]),K9="beforeRead",q9="read",_9="afterRead",J9="beforeMain",X9="main",Z9="afterMain",$9="beforeWrite",eN="write",tN="afterWrite",nN=[K9,q9,_9,J9,X9,Z9,$9,eN,tN];function Br(e){return e?(e.nodeName||"").toLowerCase():null}function On(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function _o(e){var t=On(e).Element;return e instanceof t||e instanceof Element}function Kn(e){var t=On(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Tg(e){if(typeof ShadowRoot>"u")return!1;var t=On(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function rN(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},a=t.elements[n];!Kn(a)||!Br(a)||(Object.assign(a.style,r),Object.keys(i).forEach(function(l){var u=i[l];u===!1?a.removeAttribute(l):a.setAttribute(l,u===!0?"":u)}))})}function oN(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],a=t.attributes[r]||{},l=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=l.reduce(function(A,f){return A[f]="",A},{});!Kn(i)||!Br(i)||(Object.assign(i.style,u),Object.keys(a).forEach(function(A){i.removeAttribute(A)}))})}}const iN={name:"applyStyles",enabled:!0,phase:"write",fn:rN,effect:oN,requires:["computeStyles"]};function Er(e){return e.split("-")[0]}var Go=Math.max,dc=Math.min,Wi=Math.round;function Vd(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Ly(){return!/^((?!chrome|android).)*safari/i.test(Vd())}function Ui(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&Kn(e)&&(i=e.offsetWidth>0&&Wi(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Wi(r.height)/e.offsetHeight||1);var l=_o(e)?On(e):window,u=l.visualViewport,A=!Ly()&&n,f=(r.left+(A&&u?u.offsetLeft:0))/i,p=(r.top+(A&&u?u.offsetTop:0))/a,C=r.width/i,h=r.height/a;return{width:C,height:h,top:p,right:f+C,bottom:p+h,left:f,x:f,y:p}}function Pg(e){var t=Ui(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Ny(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Tg(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function zr(e){return On(e).getComputedStyle(e)}function sN(e){return["table","td","th"].indexOf(Br(e))>=0}function Io(e){return((_o(e)?e.ownerDocument:e.document)||window.document).documentElement}function ru(e){return Br(e)==="html"?e:e.assignedSlot||e.parentNode||(Tg(e)?e.host:null)||Io(e)}function kE(e){return!Kn(e)||zr(e).position==="fixed"?null:e.offsetParent}function aN(e){var t=/firefox/i.test(Vd()),n=/Trident/i.test(Vd());if(n&&Kn(e)){var r=zr(e);if(r.position==="fixed")return null}var i=ru(e);for(Tg(i)&&(i=i.host);Kn(i)&&["html","body"].indexOf(Br(i))<0;){var a=zr(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function ma(e){for(var t=On(e),n=kE(e);n&&sN(n)&&zr(n).position==="static";)n=kE(n);return n&&(Br(n)==="html"||Br(n)==="body"&&zr(n).position==="static")?t:n||aN(e)||t}function Rg(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Gs(e,t,n){return Go(e,dc(t,n))}function lN(e,t,n){var r=Gs(e,t,n);return r>n?n:r}function Vy(){return{top:0,right:0,bottom:0,left:0}}function Hy(e){return Object.assign({},Vy(),e)}function zy(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var cN=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Hy(typeof t!="number"?t:zy(t,Ca))};function uN(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,l=n.modifiersData.popperOffsets,u=Er(n.placement),A=Rg(u),f=[hn,Xn].indexOf(u)>=0,p=f?"height":"width";if(!(!a||!l)){var C=cN(i.padding,n),h=Pg(a),E=A==="y"?pn:hn,I=A==="y"?Jn:Xn,B=n.rects.reference[p]+n.rects.reference[A]-l[A]-n.rects.popper[p],v=l[A]-n.rects.reference[A],S=ma(a),M=S?A==="y"?S.clientHeight||0:S.clientWidth||0:0,x=B/2-v/2,T=C[E],P=M-h[p]-C[I],F=M/2-h[p]/2+x,j=Gs(T,F,P),K=A;n.modifiersData[r]=(t={},t[K]=j,t.centerOffset=j-F,t)}}function AN(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Ny(t.elements.popper,i)&&(t.elements.arrow=i))}const dN={name:"arrow",enabled:!0,phase:"main",fn:uN,effect:AN,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Yi(e){return e.split("-")[1]}var fN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function gN(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Wi(n*i)/i||0,y:Wi(r*i)/i||0}}function FE(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,l=e.offsets,u=e.position,A=e.gpuAcceleration,f=e.adaptive,p=e.roundOffsets,C=e.isFixed,h=l.x,E=h===void 0?0:h,I=l.y,B=I===void 0?0:I,v=typeof p=="function"?p({x:E,y:B}):{x:E,y:B};E=v.x,B=v.y;var S=l.hasOwnProperty("x"),M=l.hasOwnProperty("y"),x=hn,T=pn,P=window;if(f){var F=ma(n),j="clientHeight",K="clientWidth";if(F===On(n)&&(F=Io(n),zr(F).position!=="static"&&u==="absolute"&&(j="scrollHeight",K="scrollWidth")),F=F,i===pn||(i===hn||i===Xn)&&a===ia){T=Jn;var q=C&&F===P&&P.visualViewport?P.visualViewport.height:F[j];B-=q-r.height,B*=A?1:-1}if(i===hn||(i===pn||i===Jn)&&a===ia){x=Xn;var U=C&&F===P&&P.visualViewport?P.visualViewport.width:F[K];E-=U-r.width,E*=A?1:-1}}var $=Object.assign({position:u},f&&fN),ae=p===!0?gN({x:E,y:B},On(n)):{x:E,y:B};if(E=ae.x,B=ae.y,A){var ie;return Object.assign({},$,(ie={},ie[T]=M?"0":"",ie[x]=S?"0":"",ie.transform=(P.devicePixelRatio||1)<=1?"translate("+E+"px, "+B+"px)":"translate3d("+E+"px, "+B+"px, 0)",ie))}return Object.assign({},$,(t={},t[T]=M?B+"px":"",t[x]=S?E+"px":"",t.transform="",t))}function pN(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,l=a===void 0?!0:a,u=n.roundOffsets,A=u===void 0?!0:u,f={placement:Er(t.placement),variation:Yi(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,FE(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:A})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,FE(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const hN={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:pN,data:{}};var Tl={passive:!0};function CN(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,l=r.resize,u=l===void 0?!0:l,A=On(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&f.forEach(function(p){p.addEventListener("scroll",n.update,Tl)}),u&&A.addEventListener("resize",n.update,Tl),function(){a&&f.forEach(function(p){p.removeEventListener("scroll",n.update,Tl)}),u&&A.removeEventListener("resize",n.update,Tl)}}const mN={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:CN,data:{}};var EN={left:"right",right:"left",bottom:"top",top:"bottom"};function Vl(e){return e.replace(/left|right|bottom|top/g,function(t){return EN[t]})}var IN={start:"end",end:"start"};function LE(e){return e.replace(/start|end/g,function(t){return IN[t]})}function Sg(e){var t=On(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Og(e){return Ui(Io(e)).left+Sg(e).scrollLeft}function BN(e,t){var n=On(e),r=Io(e),i=n.visualViewport,a=r.clientWidth,l=r.clientHeight,u=0,A=0;if(i){a=i.width,l=i.height;var f=Ly();(f||!f&&t==="fixed")&&(u=i.offsetLeft,A=i.offsetTop)}return{width:a,height:l,x:u+Og(e),y:A}}function yN(e){var t,n=Io(e),r=Sg(e),i=(t=e.ownerDocument)==null?void 0:t.body,a=Go(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),l=Go(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+Og(e),A=-r.scrollTop;return zr(i||n).direction==="rtl"&&(u+=Go(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:l,x:u,y:A}}function Dg(e){var t=zr(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Wy(e){return["html","body","#document"].indexOf(Br(e))>=0?e.ownerDocument.body:Kn(e)&&Dg(e)?e:Wy(ru(e))}function Ks(e,t){var n;t===void 0&&(t=[]);var r=Wy(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=On(r),l=i?[a].concat(a.visualViewport||[],Dg(r)?r:[]):r,u=t.concat(l);return i?u:u.concat(Ks(ru(l)))}function Hd(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function vN(e,t){var n=Ui(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function NE(e,t,n){return t===ky?Hd(BN(e,n)):_o(t)?vN(t,n):Hd(yN(Io(e)))}function bN(e){var t=Ks(ru(e)),n=["absolute","fixed"].indexOf(zr(e).position)>=0,r=n&&Kn(e)?ma(e):e;return _o(r)?t.filter(function(i){return _o(i)&&Ny(i,r)&&Br(i)!=="body"}):[]}function QN(e,t,n,r){var i=t==="clippingParents"?bN(e):[].concat(t),a=[].concat(i,[n]),l=a[0],u=a.reduce(function(A,f){var p=NE(e,f,r);return A.top=Go(p.top,A.top),A.right=dc(p.right,A.right),A.bottom=dc(p.bottom,A.bottom),A.left=Go(p.left,A.left),A},NE(e,l,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function Uy(e){var t=e.reference,n=e.element,r=e.placement,i=r?Er(r):null,a=r?Yi(r):null,l=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,A;switch(i){case pn:A={x:l,y:t.y-n.height};break;case Jn:A={x:l,y:t.y+t.height};break;case Xn:A={x:t.x+t.width,y:u};break;case hn:A={x:t.x-n.width,y:u};break;default:A={x:t.x,y:t.y}}var f=i?Rg(i):null;if(f!=null){var p=f==="y"?"height":"width";switch(a){case zi:A[f]=A[f]-(t[p]/2-n[p]/2);break;case ia:A[f]=A[f]+(t[p]/2-n[p]/2);break}}return A}function sa(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,l=a===void 0?e.strategy:a,u=n.boundary,A=u===void 0?Y9:u,f=n.rootBoundary,p=f===void 0?ky:f,C=n.elementContext,h=C===void 0?Os:C,E=n.altBoundary,I=E===void 0?!1:E,B=n.padding,v=B===void 0?0:B,S=Hy(typeof v!="number"?v:zy(v,Ca)),M=h===Os?G9:Os,x=e.rects.popper,T=e.elements[I?M:h],P=QN(_o(T)?T:T.contextElement||Io(e.elements.popper),A,p,l),F=Ui(e.elements.reference),j=Uy({reference:F,element:x,strategy:"absolute",placement:i}),K=Hd(Object.assign({},x,j)),q=h===Os?K:F,U={top:P.top-q.top+S.top,bottom:q.bottom-P.bottom+S.bottom,left:P.left-q.left+S.left,right:q.right-P.right+S.right},$=e.modifiersData.offset;if(h===Os&&$){var ae=$[i];Object.keys(U).forEach(function(ie){var X=[Xn,Jn].indexOf(ie)>=0?1:-1,G=[pn,Jn].indexOf(ie)>=0?"y":"x";U[ie]+=ae[G]*X})}return U}function xN(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,l=n.padding,u=n.flipVariations,A=n.allowedAutoPlacements,f=A===void 0?Fy:A,p=Yi(r),C=p?u?jE:jE.filter(function(I){return Yi(I)===p}):Ca,h=C.filter(function(I){return f.indexOf(I)>=0});h.length===0&&(h=C);var E=h.reduce(function(I,B){return I[B]=sa(e,{placement:B,boundary:i,rootBoundary:a,padding:l})[Er(B)],I},{});return Object.keys(E).sort(function(I,B){return E[I]-E[B]})}function wN(e){if(Er(e)===wg)return[];var t=Vl(e);return[LE(e),t,LE(t)]}function TN(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0?!0:i,l=n.altAxis,u=l===void 0?!0:l,A=n.fallbackPlacements,f=n.padding,p=n.boundary,C=n.rootBoundary,h=n.altBoundary,E=n.flipVariations,I=E===void 0?!0:E,B=n.allowedAutoPlacements,v=t.options.placement,S=Er(v),M=S===v,x=A||(M||!I?[Vl(v)]:wN(v)),T=[v].concat(x).reduce(function(le,ue){return le.concat(Er(ue)===wg?xN(t,{placement:ue,boundary:p,rootBoundary:C,padding:f,flipVariations:I,allowedAutoPlacements:B}):ue)},[]),P=t.rects.reference,F=t.rects.popper,j=new Map,K=!0,q=T[0],U=0;U<T.length;U++){var $=T[U],ae=Er($),ie=Yi($)===zi,X=[pn,Jn].indexOf(ae)>=0,G=X?"width":"height",H=sa(t,{placement:$,boundary:p,rootBoundary:C,altBoundary:h,padding:f}),J=X?ie?Xn:hn:ie?Jn:pn;P[G]>F[G]&&(J=Vl(J));var k=Vl(J),ee=[];if(a&&ee.push(H[ae]<=0),u&&ee.push(H[J]<=0,H[k]<=0),ee.every(function(le){return le})){q=$,K=!1;break}j.set($,ee)}if(K)for(var z=I?3:1,_=function(ue){var ge=T.find(function(Ee){var Ce=j.get(Ee);if(Ce)return Ce.slice(0,ue).every(function(pe){return pe})});if(ge)return q=ge,"break"},Ae=z;Ae>0;Ae--){var fe=_(Ae);if(fe==="break")break}t.placement!==q&&(t.modifiersData[r]._skip=!0,t.placement=q,t.reset=!0)}}const PN={name:"flip",enabled:!0,phase:"main",fn:TN,requiresIfExists:["offset"],data:{_skip:!1}};function VE(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function HE(e){return[pn,Xn,Jn,hn].some(function(t){return e[t]>=0})}function RN(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,l=sa(t,{elementContext:"reference"}),u=sa(t,{altBoundary:!0}),A=VE(l,r),f=VE(u,i,a),p=HE(A),C=HE(f);t.modifiersData[n]={referenceClippingOffsets:A,popperEscapeOffsets:f,isReferenceHidden:p,hasPopperEscaped:C},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":C})}const SN={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:RN};function ON(e,t,n){var r=Er(e),i=[hn,pn].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,l=a[0],u=a[1];return l=l||0,u=(u||0)*i,[hn,Xn].indexOf(r)>=0?{x:u,y:l}:{x:l,y:u}}function DN(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,l=Fy.reduce(function(p,C){return p[C]=ON(C,t.rects,a),p},{}),u=l[t.placement],A=u.x,f=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=A,t.modifiersData.popperOffsets.y+=f),t.modifiersData[r]=l}const MN={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:DN};function jN(e){var t=e.state,n=e.name;t.modifiersData[n]=Uy({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const kN={name:"popperOffsets",enabled:!0,phase:"read",fn:jN,data:{}};function FN(e){return e==="x"?"y":"x"}function LN(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,l=n.altAxis,u=l===void 0?!1:l,A=n.boundary,f=n.rootBoundary,p=n.altBoundary,C=n.padding,h=n.tether,E=h===void 0?!0:h,I=n.tetherOffset,B=I===void 0?0:I,v=sa(t,{boundary:A,rootBoundary:f,padding:C,altBoundary:p}),S=Er(t.placement),M=Yi(t.placement),x=!M,T=Rg(S),P=FN(T),F=t.modifiersData.popperOffsets,j=t.rects.reference,K=t.rects.popper,q=typeof B=="function"?B(Object.assign({},t.rects,{placement:t.placement})):B,U=typeof q=="number"?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),$=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,ae={x:0,y:0};if(F){if(a){var ie,X=T==="y"?pn:hn,G=T==="y"?Jn:Xn,H=T==="y"?"height":"width",J=F[T],k=J+v[X],ee=J-v[G],z=E?-K[H]/2:0,_=M===zi?j[H]:K[H],Ae=M===zi?-K[H]:-j[H],fe=t.elements.arrow,le=E&&fe?Pg(fe):{width:0,height:0},ue=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Vy(),ge=ue[X],Ee=ue[G],Ce=Gs(0,j[H],le[H]),pe=x?j[H]/2-z-Ce-ge-U.mainAxis:_-Ce-ge-U.mainAxis,me=x?-j[H]/2+z+Ce+Ee+U.mainAxis:Ae+Ce+Ee+U.mainAxis,Qe=t.elements.arrow&&ma(t.elements.arrow),se=Qe?T==="y"?Qe.clientTop||0:Qe.clientLeft||0:0,He=(ie=$==null?void 0:$[T])!=null?ie:0,de=J+pe-He-se,lt=J+me-He,Nt=Gs(E?dc(k,de):k,J,E?Go(ee,lt):ee);F[T]=Nt,ae[T]=Nt-J}if(u){var Ct,Qt=T==="x"?pn:hn,cr=T==="x"?Jn:Xn,Bt=F[P],mt=P==="y"?"height":"width",ut=Bt+v[Qt],jt=Bt-v[cr],kt=[pn,hn].indexOf(S)!==-1,Pe=(Ct=$==null?void 0:$[P])!=null?Ct:0,je=kt?ut:Bt-j[mt]-K[mt]-Pe+U.altAxis,xe=kt?Bt+j[mt]+K[mt]-Pe-U.altAxis:jt,ze=E&&kt?lN(je,Bt,xe):Gs(E?je:ut,Bt,E?xe:jt);F[P]=ze,ae[P]=ze-Bt}t.modifiersData[r]=ae}}const NN={name:"preventOverflow",enabled:!0,phase:"main",fn:LN,requiresIfExists:["offset"]};function VN(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function HN(e){return e===On(e)||!Kn(e)?Sg(e):VN(e)}function zN(e){var t=e.getBoundingClientRect(),n=Wi(t.width)/e.offsetWidth||1,r=Wi(t.height)/e.offsetHeight||1;return n!==1||r!==1}function WN(e,t,n){n===void 0&&(n=!1);var r=Kn(t),i=Kn(t)&&zN(t),a=Io(t),l=Ui(e,i,n),u={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(r||!r&&!n)&&((Br(t)!=="body"||Dg(a))&&(u=HN(t)),Kn(t)?(A=Ui(t,!0),A.x+=t.clientLeft,A.y+=t.clientTop):a&&(A.x=Og(a))),{x:l.left+u.scrollLeft-A.x,y:l.top+u.scrollTop-A.y,width:l.width,height:l.height}}function UN(e){var t=new Map,n=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function i(a){n.add(a.name);var l=[].concat(a.requires||[],a.requiresIfExists||[]);l.forEach(function(u){if(!n.has(u)){var A=t.get(u);A&&i(A)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||i(a)}),r}function YN(e){var t=UN(e);return nN.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function GN(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function KN(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var zE={placement:"bottom",modifiers:[],strategy:"absolute"};function WE(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function qN(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?zE:i;return function(u,A,f){f===void 0&&(f=a);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},zE,a),modifiersData:{},elements:{reference:u,popper:A},attributes:{},styles:{}},C=[],h=!1,E={state:p,setOptions:function(S){var M=typeof S=="function"?S(p.options):S;B(),p.options=Object.assign({},a,p.options,M),p.scrollParents={reference:_o(u)?Ks(u):u.contextElement?Ks(u.contextElement):[],popper:Ks(A)};var x=YN(KN([].concat(r,p.options.modifiers)));return p.orderedModifiers=x.filter(function(T){return T.enabled}),I(),E.update()},forceUpdate:function(){if(!h){var S=p.elements,M=S.reference,x=S.popper;if(WE(M,x)){p.rects={reference:WN(M,ma(x),p.options.strategy==="fixed"),popper:Pg(x)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(U){return p.modifiersData[U.name]=Object.assign({},U.data)});for(var T=0;T<p.orderedModifiers.length;T++){if(p.reset===!0){p.reset=!1,T=-1;continue}var P=p.orderedModifiers[T],F=P.fn,j=P.options,K=j===void 0?{}:j,q=P.name;typeof F=="function"&&(p=F({state:p,options:K,name:q,instance:E})||p)}}}},update:GN(function(){return new Promise(function(v){E.forceUpdate(),v(p)})}),destroy:function(){B(),h=!0}};if(!WE(u,A))return E;E.setOptions(f).then(function(v){!h&&f.onFirstUpdate&&f.onFirstUpdate(v)});function I(){p.orderedModifiers.forEach(function(v){var S=v.name,M=v.options,x=M===void 0?{}:M,T=v.effect;if(typeof T=="function"){var P=T({state:p,name:S,instance:E,options:x}),F=function(){};C.push(P||F)}})}function B(){C.forEach(function(v){return v()}),C=[]}return E}}var _N=[mN,kN,hN,iN,MN,PN,NN,dN,SN],JN=qN({defaultModifiers:_N});function XN(e){return zt("MuiPopper",e)}qt("MuiPopper",["root"]);const ZN=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],$N=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function e7(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function fc(e){return typeof e=="function"?e():e}function ou(e){return e.nodeType!==void 0}function t7(e){return!ou(e)}const n7=()=>En({root:["root"]},o9(XN)),r7={},o7=N.forwardRef(function(t,n){var r;const{anchorEl:i,children:a,direction:l,disablePortal:u,modifiers:A,open:f,placement:p,popperOptions:C,popperRef:h,slotProps:E={},slots:I={},TransitionProps:B}=t,v=Ge(t,ZN),S=N.useRef(null),M=Rn(S,n),x=N.useRef(null),T=Rn(x,h),P=N.useRef(T);Fi(()=>{P.current=T},[T]),N.useImperativeHandle(h,()=>x.current,[]);const F=e7(p,l),[j,K]=N.useState(F),[q,U]=N.useState(fc(i));N.useEffect(()=>{x.current&&x.current.forceUpdate()}),N.useEffect(()=>{i&&U(fc(i))},[i]),Fi(()=>{if(!q||!f)return;const G=k=>{K(k.placement)};if(process.env.NODE_ENV!=="production"&&q&&ou(q)&&q.nodeType===1){const k=q.getBoundingClientRect();process.env.NODE_ENV!=="test"&&k.top===0&&k.left===0&&k.right===0&&k.bottom===0&&console.warn(["MUI: The `anchorEl` prop provided to the component is invalid.","The anchor element should be part of the document layout.","Make sure the element is present in the document or that it's not display none."].join(`
|