@applica-software-guru/react-admin 1.4.0-beta.6 → 1.4.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Layout/Header/Profile/buttons/StopImpersonateButton.d.ts.map +1 -1
- package/dist/components/Layout/Provider.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +1 -1
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +10 -2
- 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/Layout/Header/Profile/buttons/StopImpersonateButton.tsx +4 -2
- package/src/components/Layout/Provider.tsx +6 -0
package/dist/react-admin.cjs.js
CHANGED
|
@@ -202,7 +202,7 @@ attempted value: ${a}
|
|
|
202
202
|
animation: ${0} 1.4s linear infinite;
|
|
203
203
|
`),C6)),B6=Ae("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),v6=Ae("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Pe(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>z({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&&qt.css(EI||(EI=Hu`
|
|
204
204
|
animation: ${0} 1.4s ease-in-out infinite;
|
|
205
|
-
`),m6)),Ab=M.forwardRef(function(t,n){const r=Ht({props:t,name:"MuiCircularProgress"}),{className:o,color:s="primary",disableShrink:a=!1,size:c=40,style:u,thickness:A=3.6,value:p=0,variant:h="indeterminate"}=r,C=Ne(r,h6),m=z({},r,{color:s,disableShrink:a,size:c,thickness:A,value:p,variant:h}),I=E6(m),B={},v={},S={};if(h==="determinate"){const O=2*Math.PI*((ho-A)/2);B.strokeDasharray=O.toFixed(3),S["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*O).toFixed(3)}px`,v.transform="rotate(-90deg)"}return g.jsx(I6,z({className:Ge(I.root,o),style:z({width:c,height:c},v,u),ownerState:m,ref:n,role:"progressbar"},S,C,{children:g.jsx(B6,{className:I.svg,ownerState:m,viewBox:`${ho/2} ${ho/2} ${ho} ${ho}`,children:g.jsx(v6,{className:I.circle,style:B,ownerState:m,cx:ho,cy:ho,r:(ho-A)/2,fill:"none",strokeWidth:A})})}))});process.env.NODE_ENV!=="production"&&(Ab.propTypes={classes:f.object,className:f.string,color:f.oneOfType([f.oneOf(["inherit","primary","secondary","error","info","success","warning"]),f.string]),disableShrink:Or(f.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:f.oneOfType([f.number,f.string]),style:f.object,sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),thickness:f.number,value:f.number,variant:f.oneOf(["determinate","indeterminate"])});const dp=Ab;function b6(e){return Dt("MuiLoadingButton",e)}const y6=Vt("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),Yr=y6,Q6=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],x6=e=>{const{loading:t,loadingPosition:n,classes:r}=e,o={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Pe(n)}`],endIcon:[t&&`endIconLoading${Pe(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Pe(n)}`]},s=pr.unstable_composeClasses(o,b6,r);return z({},r,s)},w6=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",T6=Ae(f6,{shouldForwardProp:e=>w6(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Yr.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Yr.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>z({[`& .${Yr.startIconLoadingStart}, & .${Yr.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}),[`&.${Yr.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Yr.startIconLoadingStart}, & .${Yr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Yr.startIconLoadingStart}, & .${Yr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),S6=Ae("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Pe(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>z({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})),db=M.forwardRef(function(t,n){const r=Ht({props:t,name:"MuiLoadingButton"}),{children:o,disabled:s=!1,id:a,loading:c=!1,loadingIndicator:u,loadingPosition:A="center",variant:p="text"}=r,h=Ne(r,Q6),C=of(a),m=u??g.jsx(dp,{"aria-labelledby":C,color:"inherit",size:16}),I=z({},r,{disabled:s,loading:c,loadingIndicator:m,loadingPosition:A,variant:p}),B=x6(I),v=c?g.jsx(S6,{className:B.loadingIndicator,ownerState:I,children:m}):null;return g.jsxs(T6,z({disabled:s||c,id:C,ref:n},h,{variant:p,classes:B,ownerState:I,children:[I.loadingPosition==="end"?o:v,I.loadingPosition==="end"?v:o]}))});process.env.NODE_ENV!=="production"&&(db.propTypes={children:f.node,classes:f.object,disabled:f.bool,id:f.string,loading:f.bool,loadingIndicator:f.node,loadingPosition:Or(f.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:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),variant:f.oneOfType([f.oneOf(["contained","outlined","text"]),f.string])});const P6=db;function Jd({variant:e,theme:t,color:n,loadingPosition:r}){const o=rn(t,n),{lighter:s,main:a,dark:c,contrastText:u}=o,A=`${n}Button`,p=Ss(t,A),h={"& .MuiLoadingButton-loadingIndicator":{color:a}},C={...r&&r!=="center"&&{color:a}},m={"&::after":{boxShadow:`0 0 6px 6px ${ze(a,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${ze(a,.9)}`},"&:focus-visible":{outline:`2px solid ${c}`,outlineOffset:2}};switch(e){case"contained":return{backgroundColor:a,...r&&r!=="center"&&{color:u},"& .MuiLoadingButton-loadingIndicator":{color:u},"&:hover":{backgroundColor:c,color:u},...m};case"light":return{backgroundColor:a,...r&&r!=="center"&&{color:u},"& .MuiLoadingButton-loadingIndicator":{color:u},"&:hover":{backgroundColor:c,color:u},...m};case"shadow":return{boxShadow:p,backgroundColor:a,...r&&r!=="center"&&{color:u},"& .MuiLoadingButton-loadingIndicator":{color:u},"&:hover":{boxShadow:"none",backgroundColor:c,color:u},...m};case"outlined":return{backgroundColor:"transparent",borderColor:a,...C,...h};case"dashed":return{backgroundColor:s,borderColor:a,...C,...h,...m};case"text":default:return{color:a,...h,...m}}}const R6=Ae(P6,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:o,loadingPosition:s})=>({"::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"&&{...Jd({variant:t,theme:e,color:r,loadingPosition:s}),"&.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")&&!o&&{color:"#fff"},...t!=="text"&&{...Jd({variant:t,theme:e,color:r,loadingPosition:s})},"&.Mui-disabled":{...t!=="text"&&{...Jd({variant:t,theme:e,color:r,loadingPosition:s})}}})),gp=Q.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...o},s)=>{const a=bt();return g.jsx(R6,{ref:s,variant:e,shape:t,theme:a,loadingPosition:o.loadingPosition,loading:o.loading,color:r,...o,children:n})});gp.propTypes={variant:f.string,shape:f.string,children:f.node,color:f.string};gp.displayName="LoadingButton";function O6({color:e,theme:t,labelColor:n}){const r=rn(t,e),{main:o,contrastText:s}=r;let a=e||"";return["primary","secondary","info","success","warning","error"].includes(a)?{[`& .${y.tooltipClasses.tooltip}`]:{backgroundColor:o,color:n||s},[`& .${y.tooltipClasses.arrow}`]:{color:o}}:{[`& .${y.tooltipClasses.tooltip}`]:{backgroundColor:a,color:n||s,boxShadow:t.shadows[1]},[`& .${y.tooltipClasses.arrow}`]:{color:a}}}const j6=Ae(({className:e,...t})=>g.jsx(y.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&O6({color:t,theme:e,labelColor:n})}));function zu({children:e,arrow:t,labelColor:n="",...r}){const o=bt();return g.jsx(y.Box,{display:"flex",children:g.jsx(j6,{arrow:t,...r,theme:o,labelColor:n,children:e})})}zu.propTypes={children:f.element,arrow:f.bool,labelColor:f.string,rest:f.array};const Do=Q.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...o},s)=>{let a={transformOrigin:"0 0 0"};switch(t){case"top-right":a={transformOrigin:"top right"};break;case"top":a={transformOrigin:"top"};break;case"bottom-left":a={transformOrigin:"bottom left"};break;case"bottom-right":a={transformOrigin:"bottom right"};break;case"bottom":a={transformOrigin:"bottom"};break;case"top-left":default:a={transformOrigin:"0 0 0"};break}return g.jsxs(y.Box,{ref:s,children:[n==="grow"&&g.jsx(y.Grow,{...o,timeout:{appear:0,enter:150,exit:150},children:g.jsx(y.Box,{sx:a,children:e})}),n==="collapse"&&g.jsx(y.Collapse,{...o,sx:a,children:e}),n==="fade"&&g.jsx(y.Fade,{...o,timeout:{appear:0,enter:300,exit:150},children:g.jsx(y.Box,{sx:a,children:e})}),n==="slide"&&g.jsx(y.Slide,{...o,timeout:{appear:0,enter:150,exit:150},direction:r,children:g.jsx(y.Box,{sx:a,children:e})}),n==="zoom"&&g.jsx(y.Zoom,{...o,children:g.jsx(y.Box,{sx:a,children:e})})]})});Do.propTypes={children:f.node,type:f.oneOf(["grow","fade","collapse","slide","zoom"]),position:f.oneOf(["top-left","top-right","top","bottom-left","bottom-right","bottom"]),direction:f.oneOf(["up","down","left","right"])};Q.forwardRef(function(t,n){return g.jsx(y.Zoom,{ref:n,timeout:200,...t})});function gb({value:e,...t}){return g.jsxs(y.Box,{sx:{position:"relative",display:"inline-flex"},children:[g.jsx(y.CircularProgress,{variant:"determinate",value:e,...t}),g.jsx(y.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(y.Typography,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(e)}%`})})]})}gb.propTypes={value:f.number};function fb({value:e,size:t,variant:n,thickness:r,showLabel:o,pathColor:s,sx:a,...c}){return g.jsxs(y.Box,{sx:{position:"relative",display:"inline-flex"},children:[g.jsx(y.CircularProgress,{variant:"determinate",sx:{color:s||"grey.200"},size:t,thickness:r,...c,value:100}),o&&g.jsx(y.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(y.Typography,{variant:"caption",component:"div",color:"text.secondary",children:e?`${Math.round(e)}%`:"0%"})}),g.jsx(y.CircularProgress,{variant:n,sx:{...a,position:"absolute",left:0,[`& .${y.circularProgressClasses.circle}`]:{strokeLinecap:"round"}},size:t,thickness:r,value:e,...c})]})}fb.propTypes={value:f.number,size:f.number,variant:f.string,thickness:f.number,showLabel:f.bool,pathColor:f.string,sx:f.array,others:f.array};function pb({icon:e,value:t,...n}){return g.jsxs(y.Box,{sx:{display:"flex",alignItems:"center"},children:[g.jsx(y.Box,{sx:{width:"100%",mr:1},children:g.jsx(y.LinearProgress,{variant:"determinate",value:t,...n})}),g.jsx(y.Box,{sx:{minWidth:35},children:e})]})}pb.propTypes={icon:f.node,value:f.number};function hb({value:e,...t}){return g.jsxs(y.Box,{sx:{display:"flex",alignItems:"center"},children:[g.jsx(y.Box,{sx:{width:"100%",mr:1},children:g.jsx(y.LinearProgress,{variant:"determinate",value:e,...t})}),g.jsx(y.Box,{sx:{minWidth:35},children:g.jsx(y.Typography,{variant:"body2",color:"text.secondary",children:`${Math.round(e)}%`})})]})}hb.propTypes={value:f.number};const D6=Q.forwardRef(function(t,n){const r=Er(t,{color:"text.primary"},{defaults:!0});return g.jsx(Ps,{ref:n,...t,color:"secondary",variant:"text",sx:r})}),Rs=Q.forwardRef(function(t,n){const r=Er(t,{color:"text.primary",borderStyle:"none",padding:1,fontSize:"1.5rem",width:36,height:36},{defaults:!0});return g.jsx(y.ToggleButton,{ref:n,...t,color:"secondary",sx:r})}),M6=qa(j.Toolbar,{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)}}));function wi(e){return g.jsx(M6,{...e})}function k6({children:e,content:t=!0,title:n,subheader:r=null,secondary:o=null,toolbar:s=!1,lg:a=12,md:c=12,sm:u=12,xs:A=12,...p}){const h=j.useTranslate(),C=j.useResourceContext(),{cardTitle:m,cardSubheader:I}=Q.useMemo(()=>{const B=n||`resources.${C}.title`;return{cardTitle:h(B,{_:B}),cardSubheader:r!==null?h(r,{_:r}):null}},[C,r,n,h]);return g.jsx(y.Grid,{item:!0,...p,lg:a,md:c,sm:u,xs:A,children:g.jsx(er,{content:t,title:m,subheader:I,secondary:o,divider:!0,children:g.jsxs(Q.Fragment,{children:[e,s===!0?g.jsx(wi,{children:g.jsx(j.SaveButton,{})}):s]})})})}const F6=Ae(j.Form,{slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*1.25),padding:0,minHeight:"unset"},"& .RaToolbar-mobileToolbar":{paddingTop:"20px !important",paddingRight:"0 !important",paddingLeft:"0 !important",paddingBottom:0}}));function Cb({children:e,spacing:t,defaultValues:n,...r}){const{spacing:o}=Qn();return g.jsx(F6,{defaultValues:n,spacing:t||o,children:g.jsx(y.Grid,{container:!0,...r,spacing:t||o,children:e})})}Cb.Section=k6;const L6=qa(j.SimpleForm,{slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:2.5)},paddingBottom:"0 !important"}));function mb({title:e,modal:t=!1,content:n=!1,subheader:r=null,toolbar:o=g.jsx(wi,{children:g.jsx(j.SaveButton,{type:"button"})}),secondary:s=g.jsx(Bi,{children:g.jsx(j.DeleteWithConfirmButton,{})}),sx:a,...c}){const u=Df(e),A=j.useRecordContext();return g.jsx(er,{content:n,title:u,subheader:r,secondary:A!=null&&A.id?s:null,sx:{...a,"& .MuiToolbar-root":{paddingLeft:2.5,paddingRight:2.5,paddingBottom:2.5}},border:!t,divider:!0,children:g.jsx(L6,{toolbar:o,...c})})}function Eb({label:e,children:t,display:n="label",helperText:r,sx:o,addLabel:s,divider:a=!1,fullWidth:c,...u}){const A=qt.useTheme(),{getCurrentDialog:p}=vi(),{source:h,resource:C,isRequired:m}=u,{getFieldState:I,formState:B}=Ii.useFormContext(),{error:v}=I(h,B),S=p();return g.jsxs(y.Stack,{spacing:1,sx:{"& .MuiFormHelperText-root":{color:v?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},width:c?"100%":"auto",...o},children:[n==="label"&&e!==!1&&s!==!1&&g.jsx(y.InputLabel,{error:!!v,sx:{borderBottom:a?`1px solid ${A.palette.divider}`:"none",pb:a?1:0,mt:a?1:0,pt:1},children:g.jsx(j.FieldTitle,{label:e,source:h,resource:S||C,isRequired:m})}),Q.isValidElement(t)?Q.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&g.jsx(y.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:!!v,children:r})]})}const N6=Ae(j.ArrayInput,{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%"}}}));function V6({label:e,addLabel:t,source:n,helperText:r,divider:o=!0,...s}){return g.jsx(Eb,{label:e,addLabel:t,source:n,helperText:r,divider:o,fullWidth:s==null?void 0:s.fullWidth,children:g.jsx(N6,{source:n,label:!1,...s})})}function H6({canEdit:e=!0,canDelete:t=!0,canClone:n=!1}){return!e&&!t&&!n?null:g.jsxs(Bi,{children:[e&&g.jsx(j.EditButton,{}),t&&g.jsx(j.DeleteWithConfirmButton,{}),n&&g.jsx(j.CloneButton,{})]})}const II=Ae("div",{overridesResolver:(e,t)=>t.root})({display:"inline-block"}),z6=Ae("ul")({display:"inline-block"});function W6(e){var p;const{className:t,emptyText:n,source:r,title:o,...s}=e,a=ce.useRecordContext(e),c=lt.get(a,r),u=ce.useTranslate();if(!c)return n?g.jsx(y.Typography,{component:"span",variant:"body2",className:t,...s,children:n&&u(n,{_:n})}):g.jsx(II,{className:t,...s});if(Array.isArray(c))return g.jsx(z6,{className:t,...s,children:c.map((h,C)=>{var I;const m=o instanceof String?(I=lt.get(h,o))==null?void 0:I.toString():o;return g.jsx("li",{children:m},C)})});const A=o instanceof String?(p=lt.get(a,o))==null?void 0:p.toString():o;return g.jsx(II,{className:t,...s,children:A})}function Ib({entityId:e,property:t,disabled:n,showUser:r=!1,userResource:o="entities/user",...s}){const[a,c]=Q.useState(null),u=j.useRecordContext(s),A=j.useDataProvider(),p=j.useResourceContext(),h=Q.useCallback(async I=>{I.preventDefault(),I.stopPropagation();const B=lt.get(u,s==null?void 0:s.source),v=p.replace("entities/",""),S=await A.getFile(`/attachments/${v}/${e||(u==null?void 0:u.id)}/${t||(s==null?void 0:s.source)}/${(B==null?void 0:B.id)||(u==null?void 0:u.id)}`),O=document.createElement("a");O.href=S,O.download=lt.get(u,(s==null?void 0:s.title)||(s==null?void 0:s.source)),O.click()},[A,u,e,p,t,s==null?void 0:s.source,s==null?void 0:s.title]),C=Q.useMemo(()=>({...u,[s==null?void 0:s.source]:(u==null?void 0:u.src)||lt.get(u,s==null?void 0:s.source),[s==null?void 0:s.title]:(u==null?void 0:u.title)||lt.get(u,(s==null?void 0:s.title)||(s==null?void 0:s.source))}),[u,s==null?void 0:s.source,s==null?void 0:s.title]),m=j.useTranslate();return Q.useEffect(()=>{!u||!(u!=null&&u.userId)||r===!1||A.getOne(o,{id:u==null?void 0:u.userId}).then(({data:I})=>c(I)).catch(()=>c(null))},[u,A,o]),g.jsx(W6,{...s,disabled:n,record:C,onClick:h,title:g.jsxs(y.Box,{sx:{cursor:"pointer"},children:[g.jsx(y.Typography,{variant:"subtitle1",children:lt.get(C,(s==null?void 0:s.title)||(s==null?void 0:s.source))}),g.jsxs(y.Typography,{variant:"caption",color:"secondary",children:[lt.get(C,"sizeDescription"),r&&a&&" | ",r&&a&&m("ra.attachment.info",{user:a==null?void 0:a.name,created:Pr(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})}const U6=Ae(j.ImageField,{slot:"root"})(()=>({}));function Bb(e){const t=`_${e==null?void 0:e.source}`;return g.jsx(U6,{...e,source:t})}function vb({width:e=150,height:t=150,circle:n=!1,justify:r="flex-start",record:o,...s}){const a=Q.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]),c=j.useRecordContext(),u=o||c;return g.jsx(Bb,{sx:A=>({margin:0,display:"flex",justifyContent:r,"& img":{margin:"0px !important",border:`1px solid ${A.palette.divider}`,objectFit:"cover !important",...a,minWidth:a.width,minHeight:a.height}}),...s,record:u})}var bb={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(In,function(){return function(n,r,o){n=n||{};var s=r.prototype,a={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 c(A,p,h,C){return s.fromToBase(A,p,h,C)}o.en.relativeTime=a,s.fromToBase=function(A,p,h,C,m){for(var I,B,v,S=h.$locale().relativeTime||a,O=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=O.length,R=0;R<x;R+=1){var P=O[R];P.d&&(I=C?o(A).diff(h,P.d,!0):h.diff(A,P.d,!0));var k=(n.rounding||Math.round)(Math.abs(I));if(v=I>0,k<=P.r||!P.r){k<=1&&R>0&&(P=O[R-1]);var F=S[P.l];m&&(k=m(""+k)),B=typeof F=="string"?F.replace("%d",k):F(k,p,P.l,v);break}}if(p)return B;var G=v?S.future:S.past;return typeof G=="function"?G(B):G.replace("%s",B)},s.to=function(A,p){return c(A,p,this,!0)},s.from=function(A,p){return c(A,p,this)};var u=function(A){return A.$u?o.utc():o()};s.toNow=function(A){return this.to(u(this),A)},s.fromNow=function(A){return this.from(u(this),A)}}})})(bb);var Y6=bb.exports;const G6=ro(Y6);var K6={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(In,function(){return{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(n){var r=["th","st","nd","rd"],o=n%100;return"["+n+(r[(o-20)%10]||r[o]||r[0])+"]"}}})})(K6);var q6={exports:{}};(function(e,t){(function(n,r){e.exports=r(yB)})(In,function(n){function r(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var o=r(n),s={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(a){return a+"º"}};return o.default.locale(s,null,!0),s})})(q6);Pr.extend(G6);function yb(e){const t=j.useRecordContext(e),[n]=j.useLocaleState(),r=Q.useMemo(()=>Pr(lt.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return g.jsxs(Q.Fragment,{children:[g.jsx(j.DateField,{record:t,source:e.source,showTime:!0}),g.jsx("br",{}),g.jsx(y.Typography,{variant:"caption",color:"textSecondary",children:r})]})}const J6=Ae(j.DateField,{slot:"Root"})(()=>({}));function X6({variant:e="body1",...t}){return g.jsx(J6,{...t,variant:e})}const Z6=Ae(j.EmailField,{slot:"Root"})(()=>({}));function _6({variant:e="body1",...t}){return g.jsx(Z6,{...t,variant:e})}const $6=Ae(j.FileField,{slot:"root"})(()=>({}));function Qb({...e}){const t=j.useRecordContext(e),n=Q.useCallback(r=>{r.preventDefault(),r.stopPropagation();const o=lt.get(t,`_${e==null?void 0:e.source}`,lt.get(t,e==null?void 0:e.source)),s=lt.get(t,(e==null?void 0:e.title)||(e==null?void 0:e.source))||(e==null?void 0:e.title),a=document.createElement("a");a.href=o,a.download=s,a.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return g.jsx($6,{...e,record:t,onClick:n})}function eL({variant:e="body1",...t}){return g.jsx(j.FunctionField,{...t,variant:e})}const tL=Ae(j.TextField,{slot:"Root"})(()=>({}));function xb({variant:e="body1",...t}){return g.jsx(tL,{...t,variant:e})}function nL(e){const t=y.useTheme(),n=ce.useLocales(),{source:r=""}=e,o=ce.useRecordContext(e),s=o[r],a=!Mf(s,n),c=Er(e,{flex:1}),[u]=ce.useLocaleState(),A=Q.useMemo(()=>a?g.jsx(Ze.FlagFilled,{style:{color:t.palette.warning.main}}):g.jsx(Ze.FlagOutlined,{}),[a]),p=Q.useMemo(()=>g.jsx(y.Stack,{children:te.map(n,(h,C)=>g.jsx(y.Typography,{children:`${h.locale.toUpperCase()}: ${(s??{})[h.locale]??""}`},C))}),[s,n]);return g.jsx(zu,{title:p,arrow:!1,children:g.jsxs(y.Stack,{alignItems:"center",direction:"row",gap:1,children:[A,g.jsx(xb,{...e,source:`${r}.${u}`,sx:c})]})})}const rL=Ae("div")(({theme:e,fullWidth:t})=>({borderBottom:`1px solid ${e.palette.divider}`,paddingTop:e.spacing(1),paddingBottom:e.spacing(1),marginBottom:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:t?"100%":"auto",[e.breakpoints.down("sm")]:{whiteSpace:"normal",overflow:"visible",textOverflow:"inherit"}})),oL=({source:e,defaultValue:t=" ",...n})=>{const r=j.useRecordContext(n),o=lt.get(r,e,t);return g.jsx(y.Typography,{...n,dangerouslySetInnerHTML:{__html:o&&o!==null?o:t}})},iL=({title:e,children:t})=>t==null?null:typeof e=="string"||e===!0?g.jsx(y.Tooltip,{title:e,placement:"top",children:t}):t;function sL({label:e,source:t,defaultValue:n=" ",children:r=g.jsx(oL,{source:"",defaultValue:void 0,record:void 0}),tooltip:o,...s}){const{getCurrentDialog:a}=vi(),c=j.useRecordContext(s),u=j.useResourceContext(s),A=a(),p=Q.useMemo(()=>o===!1?!1:typeof o=="function"?o(c):typeof o=="string"?lt.get(c,o,o):o,[c,o]),h=Er(s,{width:s!=null&&s.fullWidth?"100%":"auto"});return g.jsx(iL,{title:p,children:g.jsxs(Q.Fragment,{children:[g.jsx(y.InputLabel,{sx:{pt:1},children:g.jsx(j.FieldTitle,{label:e,source:t,resource:A||u})}),g.jsx(rL,{...s,children:Q.cloneElement(r,{source:t,record:c,defaultValue:n,resource:A||u,sx:h})})]})})}const aL=function({children:e=null,className:t=""}){return g.jsx("div",{className:t,children:e})},lL=qa(aL,{slot:"root"})(({theme:e,bulkActionButtons:t})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,"&>div:first-of-type":{alignItems:"center","& form":{padding:e.spacing(2.5)},"& .MuiToolbar-root":{alignItems:"center",padding:"0 !important",marginTop:e.spacing(1),[e.breakpoints.up("sm")]:{marginLeft:e.spacing(2),marginRight:e.spacing(2),width:`calc(100% - ${e.spacing(4)})`},[e.breakpoints.down("md")]:{marginTop:0,display:"none",visibility:"hidden"}}},"& .RaDatagrid-root":{overflowX:"auto",paddingTop:t===!1?0:48,[e.breakpoints.down("sm")]:{width:"calc(100vw - 26px)"},"& .RaBulkActionsToolbar-toolbar":{borderRadius:0,"& > .RaBulkActionsToolbar-title":{alignItems:"center"},[e.breakpoints.down("sm")]:{paddingLeft:e.spacing(3)}},"& .RaDatagrid-table":{borderBottom:`1px solid ${e.palette.divider}`}},"& .MuiTablePagination-toolbar":{marginTop:"0 !important",marginBottom:"0 !important"},"& .RaBulkActionsToolbar-collapsed.RaBulkActionsToolbar-toolbar":{minHeight:0}}));function wb(e){return g.jsx(lL,{...e,children:g.jsx(j.ReferenceManyField,{pagination:g.jsx(j.Pagination,{}),...e})})}function cL({source:e,...t}){const n=j.useRecordContext(t),r=lt.get(n,e,0),o=r/1024,s=o/1024,a=s/1024,c=a>1?`${a.toFixed(2)} GB`:s>1?`${s.toFixed(2)} MB`:o>1?`${o.toFixed(2)} KB`:`${r.toFixed(2)} B`;return g.jsx(y.Typography,{component:"span",variant:"body1",...t,children:c})}function un({label:e,children:t,display:n="label",helperText:r,sx:o,addLabel:s,divider:a=!1,...c}){const u=bt(),{getCurrentDialog:A}=vi(),{source:p,resource:h,isRequired:C}=c,{fieldState:{invalid:m}}=j.useInput(c),I=A();return g.jsxs(y.Stack,{spacing:1,sx:{width:c!=null&&c.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:m?u.palette.error.main:u.palette.text.secondary,"& span":{display:"none"}},...o},children:[n==="label"&&e!==!1&&s!==!1&&g.jsx(y.InputLabel,{error:m===!0,sx:{borderBottom:a?`1px solid ${u.palette.divider}`:"none",pt:.5,pb:a?1:0,mt:a?1:0},children:g.jsx(j.FieldTitle,{label:e,source:p,resource:I||h,isRequired:C})}),Q.isValidElement(t)?Q.cloneElement(t,{...t.props,...c,label:n==="legend"?e:!1}):t,n==="label"&&r&&g.jsx(y.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:m===!0,children:r})]})}const uL=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},AL=Ae(j.FileInput,{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}},...uL(e)}));function dL({children:e=g.jsx(Ib,{title:"name",source:"path"}),multiple:t=!0,disabled:n=!1,type:r="attachment",...o}){const s=j.useRecordContext(o),a=o==null?void 0:o.source,c=s==null?void 0:s.id;return j.useInput({source:`__${r}__${o==null?void 0:o.source}`,defaultValue:o==null?void 0:o.source}),g.jsx(un,{...o,disabled:n,children:g.jsx(AL,{type:r,multiple:t,disabled:n,children:Q.cloneElement(e,{...e.props,entityId:c,property:a})})})}const gL=Ae(j.AutocompleteArrayInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"}}));function fL({size:e="small",...t}){return g.jsx(un,{...t,children:g.jsx(gL,{size:e})})}const pL=Ae(j.AutocompleteInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},"& .MuiOutlinedInput-root.MuiInputBase-sizeSmall":{paddingTop:"4px"}}));function hL({size:e="small",...t}){const{perPage:n,...r}=t;return g.jsx(un,{...r,children:g.jsx(pL,{size:e})})}const CL=Ae(j.BooleanInput,{slot:"Root"})(()=>({marginTop:"0 !important"}));function mL({...e}){const t=qt.useTheme();return g.jsx(un,{...e,children:g.jsx(CL,{sx:{"& .MuiFormControlLabel-root":{marginLeft:"0 !important",marginRight:"0 !important"},"& .MuiSwitch-root":{margin:"0 !important",marginTop:e.display==="legend"?0:`${t.spacing(1)} !important`}}})})}const EL=Ae(j.DateInput,{slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}}));function IL(e){return g.jsx(un,{...e,children:g.jsx(EL,{})})}const BL=Ae(j.DateTimeInput,{slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}}));function vL(e){return g.jsx(un,{...e,children:g.jsx(BL,{})})}const bL=Ae(j.FileInput,{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}}}));function yL({children:e=g.jsx(Qb,{source:"",title:""}),title:t,...n}){const r=Ii.useWatch({name:n.source}),o=j.useRecordContext(n),{source:s}=n,a=Q.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const c=lt.get(o,s);if(c){const u=c.split("__");return u.length>0?u[u.length-1]:c}return c},[o,s,r]);return g.jsx(un,{...n,children:g.jsx(bL,{children:Q.cloneElement(e,{...e.props,title:t||s,source:s,record:{...o,[s]:(r==null?void 0:r.title)||lt.get(o,s),[`_${s}`]:(r==null?void 0:r.src)||lt.get(o,`_${s}`),[t||s]:a}})})})}function QL({children:e=g.jsx(vb,{}),title:t,multiple:n=!1,...r}){const o=Ii.useWatch({name:r.source}),s=j.useRecordContext(r),{source:a}=r;return j.useInput({source:`__image__${r==null?void 0:r.source}`,defaultValue:r==null?void 0:r.source}),g.jsx(un,{...r,multiple:n,children:g.jsx(j.ImageInput,{accept:"image/*",children:Q.cloneElement(e,{...e.props,title:t,source:a,record:{...s,[a]:(o==null?void 0:o.title)||lt.get(s,a),[`_${a}`]:(o==null?void 0:o.src)||lt.get(s,`_${a}`)}})})})}function Cr(e){return g.jsx(un,{...e,children:g.jsx(j.TextInput,{})})}const xL={vertical:"bottom",horizontal:"right"},wL={vertical:"top",horizontal:"right"};function TL(e){const{source:t}=e,{fieldState:n}=ce.useInput(e),r=Ii.useWatch({name:t}),{error:o}=n,s=ce.useLocales(),a=!Mf(r,s),[c]=ce.useLocaleState(),[u,A]=Q.useState(c),[p,h]=Q.useState(null),C=!!p,m=Q.useCallback(v=>h(C?null:v.currentTarget),[C,h]),I=Q.useCallback(()=>h(null),[h]),B=Q.useMemo(()=>te.map(s,(v,S)=>g.jsx(y.MenuItem,{onClick:()=>{A(v.locale),I()},children:g.jsx(y.ListItemText,{primary:`${v.locale.toUpperCase()}: ${(r??{})[v.locale]??""}`})},S)),[s,A,I,r]);return g.jsx(un,{...e,helperText:o==null?void 0:o.message,children:g.jsxs(y.Box,{flex:1,children:[te.map(s,(v,S)=>g.jsx(Cr,{...e,source:`${t}.${v.locale}`,sx:{width:"100%",display:v.locale===u?"inline-flex":"none"},label:!1,InputProps:{endAdornment:g.jsx(y.Chip,{label:g.jsx(y.Typography,{variant:"button",children:u}),size:"small",onClick:m,color:a?"warning":void 0})}},S)),g.jsx(y.Menu,{anchorEl:p,open:C,anchorOrigin:xL,transformOrigin:wL,onClose:I,children:B})]})})}const SL=Ae(j.NumberInput,{slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}}));function PL(e){return g.jsx(un,{...e,children:g.jsx(SL,{})})}function RL({source:e,minWidth:t=300,children:n}){const r=j.useResourceContext(),o=j.useRecordContext(),[s,a]=Q.useState(lt.get(o,e,"")),[c,u]=Q.useState(!1),A=Q.useCallback(I=>a(I.target.value),[]),p=j.useDataProvider(),h=Q.useCallback(I=>{I.key==="Enter"&&(u(!0),p.update(r,{id:o.id,data:{...o,[e]:s,_changed:e},previousData:o}).then(()=>u(!1)))},[s,p,r,o,e]),C=Q.useCallback(()=>{lt.get(o,e)!==s&&(u(!0),p.update(r,{id:o.id,data:{...o,[e]:s,_changed:e},previousData:o}).then(()=>u(!1)))},[s,p,r,e,o]),m=Q.useCallback(I=>{u(!0),p.update(r,{id:o.id,data:{...o,[e]:I,_changed:e},previousData:o}).then(()=>u(!1))},[p,r,e,o]);return Q.useEffect(()=>a(lt.get(o,e)),[o,e]),n?Q.cloneElement(n,{...n.props,source:e,value:s,onChange:m}):g.jsx(y.TextField,{value:s,disabled:c,onChange:A,onKeyPress:h,onBlur:C,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})}function OL({children:e,...t}){return g.jsx(j.ReferenceArrayInput,{...t,children:Q.cloneElement(e,{...t,source:e.props.source||t.source})})}function jL({children:e,...t}){return g.jsx(j.ReferenceInput,{...t,children:Q.cloneElement(e,{...t,source:e.props.source||t.source})})}function DL({reference:e,target:t,children:n,filters:r,actions:o,...s}){return g.jsx(j.ResourceContextProvider,{value:e,children:g.jsx(wb,{perPage:5,pagination:g.jsx(j.Pagination,{}),...s,reference:e,target:t,children:g.jsxs(Q.Fragment,{children:[g.jsx(j.ListToolbar,{filters:r,actions:o}),n]})})})}const ML=Ae(j.SearchInput,{slot:"root"})(()=>({}));function kL(e){return g.jsx(ML,{...e})}const FL=Ae(j.SelectArrayInput,{slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .RaSelectArrayInput-chips > .RaSelectArrayInput-chip":{marginTop:"-2px",marginBottom:"-2px"}}));function LL({optionText:e="name",optionValue:t="id",...n}){return g.jsx(un,{...n,children:g.jsx(FL,{optionText:e,optionValue:t,options:{autoWidth:!1}})})}const NL=Ae(j.SelectInput,{slot:"Root"})(({label:e})=>({"& legend":{width:e===!1||e===null?0:"auto"}}));function VL(e){return g.jsx(un,{...e,children:g.jsx(NL,{})})}function HL({multiline:e=!1,...t}){var u,A;const n=j.useTranslate(),r=j.maxLength(t==null?void 0:t.maxLength,"app.input.max_length_error"),o=(A=(u=Ii.useController({name:t==null?void 0:t.source}))==null?void 0:u.field)==null?void 0:A.value;let s=t.helperText,a=t.validate;a?Array.isArray(a)&&a.indexOf(r)===-1&&a.push(r):a=[r];const c=n("app.input.max_length_info",{count:(o==null?void 0:o.length)||0,max:t==null?void 0:t.maxLength});return t!=null&&t.maxLength&&(s=s&&s.length>0?`${c} - ${n(s)}`:c),g.jsx(Cr,{...t,validate:a,helperText:s,multiline:e,inputProps:{maxLength:t==null?void 0:t.maxLength}})}function zL(e){if(!e)return"";const t=QB(e);return t?t.format("HH:mm"):""}function WL(e){return e}const UL=Ae(j.TimeInput,{slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}}));function YL({parse:e=WL,format:t=zL,...n}){return g.jsx(un,{...n,children:g.jsx(UL,{parse:e,format:t,...n})})}function fp({onSuccess:e,firstAccess:t}){const{spacing:n}=Qn(),[r,o]=Q.useState(!1),s=ce.useAuthProvider(),a=ce.useTranslate(),c=ce.useNotify(),u=Q.useCallback(A=>{const{oldPassword:p,newPassword:h}=A;o(!0),s==null||s.changePassword(p,h).then(()=>{c("ra.auth.password_changed"),e()}).catch(C=>{c((C==null?void 0:C.message)||(C==null?void 0:C.toString()),{type:"error"})}).finally(()=>o(!1))},[s,e]);return g.jsx(ce.ResourceContextProvider,{value:"user/change-password",children:g.jsx(ce.EditContextProvider,{value:{record:{},resource:"user/change-password",save:u},children:g.jsx(mb,{onSubmit:u,toolbar:g.jsx(wi,{children:g.jsx(j.SaveButton,{disabled:r})}),children:g.jsxs(y.Grid,{container:!0,spacing:n,children:[t===!0&&g.jsx(y.Grid,{item:!0,xs:12,children:g.jsxs(y.Alert,{severity:"warning",children:[g.jsx(y.AlertTitle,{children:a("ra.auth.first_access.change_password")}),a("ra.auth.first_access.change_password_helper")]})}),g.jsx(y.Grid,{item:!0,xs:12,children:g.jsx(Cr,{source:"oldPassword",type:"password",validate:ce.required()})}),g.jsx(y.Grid,{item:!0,xs:12,children:g.jsx(Cr,{source:"newPassword",type:"password",validate:ce.required()})})]})})})})}const Tb=Q.createContext({});function GL(e){const{useDefaults:t=!1,queryOptions:n={}}=e,r=j.useResourceContext(),o=j.useDataProvider(),{search:s}=hs.useLocation(),a=`${r}/new`,c=Q.useCallback(()=>{if(!t||!te.isFunction(o.get))return Promise.resolve({});const C={};return new URLSearchParams(s??"").forEach((m,I)=>{C[I]=m}),o.get(a,C).then(m=>m.data).then(m=>{const{responseCode:I,value:B}=m;return I==="ok"?B:Promise.reject(m)})},[r,t,s,o]),u=Q.useMemo(()=>te.chain(n).extend({queryKey:[r,s],queryFn:c}).value(),[r,s,c,n]),{data:A,isLoading:p}=As.useQuery(u),h=te.omit(e,["useDefaults"]);return p?g.jsx(y.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:g.jsx(y.CircularProgress,{})}):g.jsx(Tb.Provider,{value:A??{},children:g.jsx(j.Create,{...h})})}function KL(){return Q.useContext(Tb)}const qL=Ae(GL,{slot:"root"})(({theme:e})=>({"& .RaCreate-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaCreate-main":{marginTop:0},"& .RaCreate-main>.MuiPaper-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaToolbar-mobileToolbar":{position:"initial !important",paddingLeft:"20px !important",paddingRight:"20px !important",paddingTop:"0 !important"},"& .RaCreate-main:has(.LongFormView)>.MuiPaper-root:first-of-type":{overflow:"visible"},"& .RaCreate-main:has(.tabbed-form) .MuiTableContainer-root":{width:"inherit"}})),JL=Ae(j.Edit,{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":{position:"initial !important",paddingLeft:"20px !important",paddingRight:"20px !important",paddingTop:"0 !important"},"& .RaEdit-main":{marginTop:0},"& .RaEdit-main>.MuiPaper-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaEdit-main:has(.LongFormView)>.MuiPaper-root:first-of-type":{overflow:"visible"},"& .RaEdit-main:has(.tabbed-form) .MuiTableContainer-root":{width:"inherit"}}));function XL(e){return g.jsx(JL,{...e})}const ZL=Ae(y.CardHeader)(({theme:e})=>({marginTop:e.spacing(2.5),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),_L=Ae(y.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`}));function $L({title:e,divider:t=!0,variant:n="h5"}){const r=j.useTranslate();return g.jsxs(Q.Fragment,{children:[g.jsx(ZL,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&g.jsx(_L,{})]})}const e9=Ae(y.Grid,{name:"LongFormView",slot:"Root"})(({theme:e})=>({"& .MuiToolbar-root.RaToolbar-desktopToolbar":{position:"initial",marginLeft:`-${e.spacing(3)}`,marginRight:`-${e.spacing(3)}`,marginBottom:`-${e.spacing(2)}`,paddingTop:e.spacing(2.5),paddingBottom:e.spacing(2.5),[e.breakpoints.down("sm")]:{position:"initial !important",width:"auto !important",marginRight:0}},"& .RaToolbar-mobileToolbar":{position:"initial !important",paddingTop:"20px !important",paddingLeft:"0 !important",paddingRight:"0 !important",paddingBottom:"0 !important"},"& form > .MuiToolbar-root":{margin:0,marginRight:`-${e.spacing(.5)}`,[e.breakpoints.down("sm")]:{marginRight:e.spacing(.5)}}}));function Sb(e){const{spacing:t}=Qn(),{spacing:n=t}=e,r=te.omit(e,["spacing"]);return g.jsx(j.Form,{...r,className:"LongFormView",children:g.jsx(e9,{container:!0,spacing:n*2,children:e.children})})}function Pb(e){const{disposition:t={xl:9,lg:9,md:8,sm:8,xs:12}}=e,n=te.omit(e,["disposition"]);return g.jsx(y.Grid,{...n,item:!0,...t,children:e.children})}function Wg(e){return e.id??e.label}function Rb(e,t){const n=`^${e}.`.replaceAll(".","\\."),r=new RegExp(n,"g");return t.match(r)!==null}function t9(e){return te.map(e,"id")}function tu(e){const t=e.match(new RegExp("[^.]+","g"));return t===null?0:t.length}function Ob(e,t){const n=e!==void 0?tu(e):0;return te.chain(t).filter(o=>e!==void 0?Rb(e,o.id):!0).filter(o=>tu(o.id)===n+1).value()}function n9(e,t){var s;const n=te.clone(e),{type:r,payload:o}=t;switch(r){case"setFormRootPath":return te.extend(n,{formRootPath:o});case"setSyncWithLocation":return te.extend(n,{syncWithLocation:o});case"setErrorCount":return te.extend(n,{errorCount:o});case"setActiveItem":return te.includes(t9(e.items),o)?te.extend(n,{activeItem:o}):n;case"addItem":{const{id:a}=o;return te.extend(n,{items:te.chain(n.items).clone().reject(c=>c.id===a).concat([o]).orderBy(c=>c.index).value()})}case"removeItem":{const a=te.isString(o)?o:o.id,c=te.chain(n.items).clone().reject(u=>u.id===a).value();return te.extend(n,{items:c}),n.activeItem===a&&te.extend(n,{activeItem:((s=te.first(c))==null?void 0:s.id)??void 0}),n}default:return n}}const r9={syncWithLocation:!0,errorCount:!0,items:[],activeItem:void 0},jb=Q.createContext(void 0);function Db(e){const t=!!(e.syncWithLocation??!0),n=!!(e.errorCount??!0),{rootMatchString:r}=e,{pathname:o}=hs.useLocation(),[s,a]=Q.useReducer(n9,te.cloneDeep(r9)),{formRootPath:c,items:u}=s,A=Q.useMemo(()=>({state:s,dispatch:a}),[s,a]);return Q.useEffect(()=>{const p=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/show/*",":resource/:id/show/*","entities/:resource/:id/*",":resource/:id/*"];r!==void 0&&p.push(r);const h=te.chain(p).map(m=>hs.matchPath(m,o)).reject(m=>m===null).first().value(),C=h==null?void 0:h.pathnameBase;C!==void 0&&C!==c&&a({type:"setFormRootPath",payload:C})},[o,c,r]),Q.useEffect(()=>{a({type:"setSyncWithLocation",payload:!!t})},[t,a]),Q.useEffect(()=>{a({type:"setErrorCount",payload:!!n})},[n,a]),Q.useEffect(()=>{var p;if(t&&c!==void 0){let h=o.replace(c,"").replace(new RegExp(/^\/?/),"");te.isEmpty(h)&&(h=((p=te.chain(u).filter(C=>Ob(C.id,u).length===0).orderBy([C=>tu(C.id),C=>C.index]).first().value())==null?void 0:p.id)??void 0),a({type:"setActiveItem",payload:h})}},[a,c,o,u]),g.jsx(jb.Provider,{value:A,children:e.children})}function Mb(){const e=Q.useContext(jb);if(e===void 0)throw new Error("[LongForm] useFormContext: context undefined. Please provide a valid Context using LongForm.Provider");return e}function el(){return Mb().state}function pp(){return Mb().dispatch}function kb(){return el().formRootPath}function Fb(){return el().activeItem}function Lb(){return el().items}function Nb(){return el().syncWithLocation}function Vb(){return el().errorCount}function Hb(){const e=pp();return Q.useCallback(n=>{e({type:"setActiveItem",payload:n})},[e])}function zb(){const e=pp();return Q.useCallback(n=>{e({type:"addItem",payload:n})},[e])}function Wb(){const e=pp();return Q.useCallback(n=>{e({type:"removeItem",payload:n})},[e])}function Ub(e){const t=Fb();return t===void 0?!1:e===t||Rb(e,t)}function Yb(e){const t=Lb();return Q.useMemo(()=>Ob(e,t),[t,e])}function o9(){const e=kb(),{search:t}=hs.useLocation(),n=hs.useNavigate();return Q.useCallback(o=>{n(`${e}/${o}${t}`)},[e,n])}function Gb(){const e=Yb();return g.jsx(y.Card,{variant:"outlined",children:g.jsx(y.List,{sx:{"& .MuiListItemButton-root.Mui-selected":{borderColor:"palette.primary.main",borderRightStyle:"solid",borderRightWidth:2},"& .MuiListItemAvatar-root":{minWidth:24}},children:te.map(e,(t,n)=>g.jsx(hp,{...t},n))})})}function hp(e){const t=ce.useTranslate()??te.identity,n=Kb(e),{selected:r,label:o,icon:s,onClick:a,badge:c,items:u,isGroup:A,level:p,errors:h=0}=n,{spacing:C}=Qn(),[m,I]=Q.useState(r),B=Q.useCallback(O=>{I(!m),a(O)},[a,m]),v=s!==void 0,S=te.omit(e,["label","icon","selected","badge"]);return Q.useEffect(()=>{r&&!m&&I(r)},[r,m,I]),g.jsxs(g.Fragment,{children:[g.jsx(y.ListItem,{...S,disablePadding:!0,children:g.jsxs(y.ListItemButton,{selected:r&&!A,onClick:B,sx:{pl:C*p},children:[v&&g.jsx(y.ListItemIcon,{children:s}),g.jsx(y.ListItemText,{inset:!v,primary:h===0?t(o):g.jsx(y.Badge,{variant:"dot",color:"error",sx:{"& > .MuiBadge-badge":{transform:"scale(1) translate(125%, 0)"}},children:t(o)})}),c&&g.jsx(y.ListItemAvatar,{children:g.jsx(ka,{type:"filled",size:"xs",color:c.color??"default",children:c.content})}),A&&(m?g.jsx(rr.ExpandLess,{}):g.jsx(rr.ExpandMore,{}))]})}),A&&g.jsx(y.Collapse,{in:m,timeout:"auto",children:g.jsx(y.List,{children:te.map(u,(O,x)=>g.jsx(hp,{...O},x))})})]})}function Kb(e){const{id:t}=e,n=Ub(t),r=tu(t),o=o9(),s=Nb(),a=Hb(),c=Yb(t),u=!te.isEmpty(c),A=Q.useCallback(h=>{u||(s?o(e.id):a(e.id)),te.isFunction(e.onClick)&&e.onClick(h)},[a,o,e,s,u]);return Q.useMemo(()=>({...e,selected:n,onClick:A,items:c,isGroup:u,level:r}),[e,n,A,c,u])}var i9=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},qb=e=>e.firstChild?e.firstChild.offsetParent===e:!0,s9=(e,t)=>{let n=e,r=0;qb(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},a9=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},Fa=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?Fa="sticky":CSS.supports("position","-webkit-sticky")&&(Fa="-webkit-sticky"));var nu=!1;try{const e=Object.defineProperty({},"passive",{get(){nu={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var Xd=e=>{const{el:t,onChange:n,unsubs:r,measure:o}=e;if(t===window){const s=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),a=o(s()),c=()=>{Object.assign(a,o(s())),n()};return window.addEventListener("resize",c,nu),r.push(()=>window.removeEventListener("resize",c)),a}else{const s=o(t.getBoundingClientRect()),a=()=>{Object.assign(s,o(t.getBoundingClientRect())),n()},c=new ResizeObserver(a);return c.observe(t),r.push(()=>c.disconnect()),s}},l9=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}},c9=(e,t,n)=>{const{bottom:r,offsetBottom:o,offsetTop:s}=n,a=i9(e);let c=!1;const u=()=>{c||requestAnimationFrame(()=>{const F=h();F!==x&&R(F),c=!1}),c=!0};let A=a===window?window.scrollY:a.scrollTop;const p=F=>{const{offsetTop:G,height:K}=m,{naturalTop:$}=v,{height:Y}=S;return F+G+K>=$+Y+O+o},h=()=>{const{height:F}=m,{height:G}=S;return G+s+o<=F?3:p(A)?1:2},C=a!==window&&qb(a),m=Xd({el:a,onChange:u,unsubs:t,measure:({height:F,top:G})=>({height:F,offsetTop:C?G:0})}),I=a9(e),B=I===window?{top:0,bottom:0}:l9(I),v=Xd({el:I,onChange:u,unsubs:t,measure:({height:F})=>({height:F-B.top-B.bottom,naturalTop:I===window?0:s9(I,a)+B.top+m.offsetTop})}),S=Xd({el:e,onChange:u,unsubs:t,measure:({height:F})=>({height:F})});let O=0,x=h();const R=F=>{const G=x;if(x=F,G===2&&(O=-1),F===3){e.style.position=Fa,r?e.style.bottom=`${o}px`:e.style.top=`${s}px`;return}const{height:K,offsetTop:$}=m,{height:Y,naturalTop:ie}=v,{height:se}=S;if(F===2)if(e.style.position="relative",O=G===0?Math.max(0,$+A-ie+s):Math.max(0,$+A+K-(ie+se+o)),r){const X=Math.max(0,Y-se-O);e.style.bottom=`${X}px`}else e.style.top=`${O}px`;else e.style.position=Fa,F===1?r?e.style.bottom=`${o}px`:e.style.top=`${K-se-o}px`:r?e.style.bottom=`${K-se-o}px`:e.style.top=`${s}px`};R(x);const P=F=>{if(F===A)return;const G=F-A;if(A=F,x===3)return;const{offsetTop:K,height:$}=m,{naturalTop:Y,height:ie}=v,{height:se}=S;if(G>0)if(x===0){if(F+K+s>Y){const X=Math.max(0,K+A-Y+s);F+K+$<=Y+se+X+o?R(2):R(1)}}else x===2&&p(F)&&R(1);else if(x===1){if(K+F+$<Y+ie+o){const X=Math.max(0,K+A+$-(Y+se+o));K+F+s>=Y+X?R(2):R(0)}}else x===2&&K+F+s<Y+O&&R(0)},k=a===window?()=>P(window.scrollY):()=>P(a.scrollTop);a.addEventListener("scroll",k,nu),a.addEventListener("mousewheel",k,nu),t.push(()=>a.removeEventListener("scroll",k),()=>a.removeEventListener("mousewheel",k))},u9=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,o]=Q.useState(null);return Q.useEffect(()=>{if(!r||!Fa)return;const s=[];return c9(r,s,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{s.forEach(a=>a())}},[r,t,e,n]),o},A9=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:o,className:s,style:a}=e,c=u9({offsetTop:t,offsetBottom:n,bottom:r});return g.jsx("div",{className:s,style:a,ref:c,children:o})},d9=A9,Jb=(e=>(e.TOP="top",e.BOTTOM="bottom",e))(Jb||{});function Xb(e){const{sticky:t=!0,disposition:n={xl:3,lg:3,md:4,sm:4,xs:12},spacing:r=2}=e,o=te.omit(e,["sticky","disposition","spacing"]),s=t?d9:y.Box,a=Q.useMemo(()=>t?{offsetTop:74,offsetBottom:r*2}:{},[t,r]);return g.jsx(y.Grid,{...o,item:!0,...n,children:g.jsx(s,{...a,children:g.jsx(y.Stack,{spacing:r,children:e.children})})})}function Zb(e){return g.jsx(g.Fragment,{children:e.children})}function _b(e){const{children:t}=e;return Q.useMemo(()=>{const r={top:[],bottom:[]};return Q.Children.forEach(t,o=>{if(Q.isValidElement(o)&&(o==null?void 0:o.type)===Zb){const{position:s}=o.props;switch(s){case"top":r.top.push(o);break;case"bottom":r.bottom.push(o);break}}}),r},[t])}function $b(e=[],t){const n=te.isArray(e)?e:[e],r=te.filter(n,o=>Q.isValidElement(o));te.each(r,o=>{var s;t(o),$b(((s=o==null?void 0:o.props)==null?void 0:s.children)??[],t)})}function ey(e){const{errors:t}=Ii.useFormState(),n=Vb(),{label:r,icon:o,badge:s,index:a=0,children:c}=e,u=Wg(e),A=zb(),p=Wb(),h=Ub(u),C=[];n&&(e.sources!==void 0?C.push(...e.sources):$b(c,I=>{var B;((B=I==null?void 0:I.props)==null?void 0:B.source)!==void 0&&C.push(I.props.source)}));const m=te.chain(C).uniq().map(I=>te.get(t,I)).reject(I=>I===void 0).value().length;return Q.useEffect(()=>{A({id:u,index:a,label:r,icon:o,badge:s,errors:m})},[A,p,r,o,u,s,a,m]),Q.useEffect(()=>()=>{p(u)},[u]),g.jsx(y.Box,{display:h?"unset":"none",children:e.children})}function ty(e){const t=Cp(e),n=Wg(e);return g.jsx(ey,{...e,id:n,children:Q.Children.map(t,r=>{const o=Wg(r.props);return Q.cloneElement(r,{id:`${n}.${o}`})})})}function ny(e){return g.jsx(ey,{...e})}function Cp(e){const{children:t}=e;return Q.useMemo(()=>te.chain(Q.Children.toArray(t)).filter(r=>Q.isValidElement(r)&&((r==null?void 0:r.type)===ny||(r==null?void 0:r.type)===ty)).map((r,o)=>Q.cloneElement(r,{index:o})).value(),[t])}function g9(e){const{tabsDisposition:t,contentDisposition:n,spacing:r=2}=e,o=te.pick(e,["syncWithLocation","errorCount"]),s=te.omit(e,["tabsDisposition","contentDisposition","syncWithLocation"]),{top:a,bottom:c}=_b(e),u=Cp(e);return g.jsx(Db,{...o,children:g.jsxs(Sb,{...s,spacing:r,children:[g.jsxs(Xb,{disposition:t,spacing:r,children:[a,g.jsx(Gb,{}),c]}),g.jsx(Pb,{disposition:n,children:u})]})})}const Rt=g9;Rt.BaseForm=Sb;Rt.Content=Pb;Rt.Provider=Db;Rt.useItems=Lb;Rt.useSyncWithLocation=Nb;Rt.useErrorCount=Vb;Rt.useFormRootPath=kb;Rt.useActiveItem=Fb;Rt.useSetActiveItem=Hb;Rt.useAddItem=zb;Rt.useRemoveItem=Wb;Rt.Sidebar=Xb;Rt.SidebarSection=Zb;Rt.SidebarSectionPosition=Jb;Rt.useSidebarChildren=_b;Rt.NavMenu=Gb;Rt.NavMenuItem=hp;Rt.useNavMenuItem=Kb;Rt.Tab=ny;Rt.Group=ty;Rt.useBaseItemChildren=Cp;const f9=Ae(j.Show,{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"}}));function p9(e){return g.jsx(f9,{...e})}const h9=Ae(j.SimpleFormIterator,{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}}}));function C9(e){return g.jsx(h9,{...e})}const m9=qa(j.TabbedForm,{slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:1)},[e.breakpoints.down("sm")]:{paddingBottom:0,"& .MuiTableContainer-root":{paddingBottom:e.spacing(1)}}}));function E9({children:e}){return g.jsx(g.Fragment,{children:e})}function mp(e){const{title:t,modal:n,content:r,subheader:o,secondary:s=g.jsx(Bi,{children:g.jsx(j.DeleteWithConfirmButton,{})}),sx:a,noPadding:c,toolbar:u=g.jsx(wi,{children:g.jsx(j.SaveButton,{type:"button"})}),...A}=e,p=Df(t);return g.jsx(er,{title:p,modal:n,content:r,subheader:o,secondary:s,sx:{...a,"& .MuiTabs-root":{m:2.5,mb:0},"& .tabbed-form .MuiDivider-root":{ml:2.5,mr:2.5},"& .MuiToolbar-root.RaToolbar-desktopToolbar":{position:"initial",paddingTop:0},"& .MuiToolbar-root":{padding:2.5}},border:!n,divider:!0,children:g.jsx(m9,{toolbar:u,component:c?E9:void 0,...A})})}function I9({children:e,...t}){return g.jsx(j.TabbedForm.Tab,{...t,children:g.jsx(y.Box,{sx:{width:"100%",p:2.5},children:e})})}mp.Tab=j.TabbedForm.Tab;mp.TabStack=I9;const ry=M.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:o=!1,index:s,member:a,resource:c}=e,u=j.useTranslate(),[A,p]=M.useState(!1),{total:h,remove:C}=vB(),m=M.useCallback(()=>{p(!1),C(s)},[s,C]),I=Q.useMemo(()=>({index:s,total:h,remove:()=>C(s)}),[s,h,C]);return g.jsxs(xf.Provider,{value:I,children:[Q.Children.map(n,(B,v)=>{if(!Q.isValidElement(B))return null;const{source:S,...O}=B.props;return g.jsx(y.TableCell,{children:Q.cloneElement(B,{source:S?`${a}.${S}`:a,index:S?void 0:v,resource:c,disabled:r,...O,label:""})})}),!o&&g.jsx(y.TableCell,{children:g.jsx(y.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:g.jsx(Bi,{horizontal:!0,children:g.jsx(y.Typography,{color:"error",onClick:()=>p(!0),children:u("ra.action.delete")})})})}),n.length>0&&g.jsx(j.Confirm,{isOpen:A,title:u("ra.action.remove_item"),content:u("ra.message.remove_item"),onConfirm:m,onClose:()=>p(!1)})]})});var B9=Array.isArray,Wu=B9,v9=typeof In=="object"&&In&&In.Object===Object&&In,b9=v9,y9=b9,Q9=typeof self=="object"&&self&&self.Object===Object&&self,x9=y9||Q9||Function("return this")(),Uu=x9,w9=Uu,T9=w9.Symbol,Yu=T9,BI=Yu,oy=Object.prototype,S9=oy.hasOwnProperty,P9=oy.toString,ua=BI?BI.toStringTag:void 0;function R9(e){var t=S9.call(e,ua),n=e[ua];try{e[ua]=void 0;var r=!0}catch{}var o=P9.call(e);return r&&(t?e[ua]=n:delete e[ua]),o}var O9=R9,j9=Object.prototype,D9=j9.toString;function M9(e){return D9.call(e)}var k9=M9,vI=Yu,F9=O9,L9=k9,N9="[object Null]",V9="[object Undefined]",bI=vI?vI.toStringTag:void 0;function H9(e){return e==null?e===void 0?V9:N9:bI&&bI in Object(e)?F9(e):L9(e)}var Ep=H9;function z9(e){return e!=null&&typeof e=="object"}var Gu=z9,W9=Ep,U9=Gu,Y9="[object Symbol]";function G9(e){return typeof e=="symbol"||U9(e)&&W9(e)==Y9}var Ip=G9,K9=Wu,q9=Ip,J9=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X9=/^\w*$/;function Z9(e,t){if(K9(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||q9(e)?!0:X9.test(e)||!J9.test(e)||t!=null&&e in Object(t)}var _9=Z9;function $9(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var iy=$9,eN=Ep,tN=iy,nN="[object AsyncFunction]",rN="[object Function]",oN="[object GeneratorFunction]",iN="[object Proxy]";function sN(e){if(!tN(e))return!1;var t=eN(e);return t==rN||t==oN||t==nN||t==iN}var sy=sN,aN=Uu,lN=aN["__core-js_shared__"],cN=lN,Zd=cN,yI=function(){var e=/[^.]+$/.exec(Zd&&Zd.keys&&Zd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function uN(e){return!!yI&&yI in e}var AN=uN,dN=Function.prototype,gN=dN.toString;function fN(e){if(e!=null){try{return gN.call(e)}catch{}try{return e+""}catch{}}return""}var pN=fN,hN=sy,CN=AN,mN=iy,EN=pN,IN=/[\\^$.*+?()[\]{}|]/g,BN=/^\[object .+?Constructor\]$/,vN=Function.prototype,bN=Object.prototype,yN=vN.toString,QN=bN.hasOwnProperty,xN=RegExp("^"+yN.call(QN).replace(IN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wN(e){if(!mN(e)||CN(e))return!1;var t=hN(e)?xN:BN;return t.test(EN(e))}var TN=wN;function SN(e,t){return e==null?void 0:e[t]}var PN=SN,RN=TN,ON=PN;function jN(e,t){var n=ON(e,t);return RN(n)?n:void 0}var Ku=jN,DN=Ku,MN=DN(Object,"create"),qu=MN,QI=qu;function kN(){this.__data__=QI?QI(null):{},this.size=0}var FN=kN;function LN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var NN=LN,VN=qu,HN="__lodash_hash_undefined__",zN=Object.prototype,WN=zN.hasOwnProperty;function UN(e){var t=this.__data__;if(VN){var n=t[e];return n===HN?void 0:n}return WN.call(t,e)?t[e]:void 0}var YN=UN,GN=qu,KN=Object.prototype,qN=KN.hasOwnProperty;function JN(e){var t=this.__data__;return GN?t[e]!==void 0:qN.call(t,e)}var XN=JN,ZN=qu,_N="__lodash_hash_undefined__";function $N(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ZN&&t===void 0?_N:t,this}var e7=$N,t7=FN,n7=NN,r7=YN,o7=XN,i7=e7;function Os(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])}}Os.prototype.clear=t7;Os.prototype.delete=n7;Os.prototype.get=r7;Os.prototype.has=o7;Os.prototype.set=i7;var s7=Os;function a7(){this.__data__=[],this.size=0}var l7=a7;function c7(e,t){return e===t||e!==e&&t!==t}var u7=c7,A7=u7;function d7(e,t){for(var n=e.length;n--;)if(A7(e[n][0],t))return n;return-1}var Ju=d7,g7=Ju,f7=Array.prototype,p7=f7.splice;function h7(e){var t=this.__data__,n=g7(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():p7.call(t,n,1),--this.size,!0}var C7=h7,m7=Ju;function E7(e){var t=this.__data__,n=m7(t,e);return n<0?void 0:t[n][1]}var I7=E7,B7=Ju;function v7(e){return B7(this.__data__,e)>-1}var b7=v7,y7=Ju;function Q7(e,t){var n=this.__data__,r=y7(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var x7=Q7,w7=l7,T7=C7,S7=I7,P7=b7,R7=x7;function js(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])}}js.prototype.clear=w7;js.prototype.delete=T7;js.prototype.get=S7;js.prototype.has=P7;js.prototype.set=R7;var O7=js,j7=Ku,D7=Uu,M7=j7(D7,"Map"),k7=M7,xI=s7,F7=O7,L7=k7;function N7(){this.size=0,this.__data__={hash:new xI,map:new(L7||F7),string:new xI}}var V7=N7;function H7(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var z7=H7,W7=z7;function U7(e,t){var n=e.__data__;return W7(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Xu=U7,Y7=Xu;function G7(e){var t=Y7(this,e).delete(e);return this.size-=t?1:0,t}var K7=G7,q7=Xu;function J7(e){return q7(this,e).get(e)}var X7=J7,Z7=Xu;function _7(e){return Z7(this,e).has(e)}var $7=_7,eV=Xu;function tV(e,t){var n=eV(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var nV=tV,rV=V7,oV=K7,iV=X7,sV=$7,aV=nV;function Ds(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])}}Ds.prototype.clear=rV;Ds.prototype.delete=oV;Ds.prototype.get=iV;Ds.prototype.has=sV;Ds.prototype.set=aV;var ay=Ds,ly=ay,lV="Expected a function";function Bp(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(lV);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var a=e.apply(this,r);return n.cache=s.set(o,a)||s,a};return n.cache=new(Bp.Cache||ly),n}Bp.Cache=ly;var cV=Bp,uV=cV,AV=500;function dV(e){var t=uV(e,function(r){return n.size===AV&&n.clear(),r}),n=t.cache;return t}var gV=dV,fV=gV,pV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hV=/\\(\\)?/g,CV=fV(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(pV,function(n,r,o,s){t.push(o?s.replace(hV,"$1"):r||n)}),t}),mV=CV;function EV(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var cy=EV,wI=Yu,IV=cy,BV=Wu,vV=Ip,bV=1/0,TI=wI?wI.prototype:void 0,SI=TI?TI.toString:void 0;function uy(e){if(typeof e=="string")return e;if(BV(e))return IV(e,uy)+"";if(vV(e))return SI?SI.call(e):"";var t=e+"";return t=="0"&&1/e==-bV?"-0":t}var yV=uy,QV=yV;function xV(e){return e==null?"":QV(e)}var wV=xV,TV=Wu,SV=_9,PV=mV,RV=wV;function OV(e,t){return TV(e)?e:SV(e,t)?[e]:PV(RV(e))}var jV=OV,DV=Ip,MV=1/0;function kV(e){if(typeof e=="string"||DV(e))return e;var t=e+"";return t=="0"&&1/e==-MV?"-0":t}var FV=kV,LV=jV,NV=FV;function VV(e,t){t=LV(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[NV(t[n++])];return n&&n==r?e:void 0}var HV=VV,zV=HV;function WV(e,t,n){var r=e==null?void 0:zV(e,t);return r===void 0?n:r}var UV=WV;const YV=ro(UV);function Ay(e){var J,L;const{children:t,resource:n,source:r,label:o,disableActions:s=!1,disableAdd:a=!1,disableRemove:c=!1,enableClearAll:u=!1,className:A,empty:p,template:h={},inset:C}=e,[m,I]=Q.useState(!1),{fields:B,remove:v,replace:S,append:O}=j.useArrayInput(e),{resetField:x}=Ii.useFormContext(),R=bt(),P=ce.useTranslate(),k=ce.useRecordContext(e),F=Q.useRef(h||{}),G=ce.useTranslateLabel(),K=Q.useCallback(_=>{v(_)},[v]);if(B.length>0){const{..._}=B[0];F.current=_;for(const V in F.current)F.current[V]=null}const $=Q.useCallback((_=void 0)=>{let V=_;_==null&&(V=F.current,Q.Children.count(t)===1&&M.isValidElement(Q.Children.only(t))&&!Q.Children.only(t).props.source&&Q.Children.map(t,le=>M.isValidElement(le)&&le.type!==ce.FormDataConsumer).some(Boolean)?V="":(V=V||{},Q.Children.forEach(t,le=>{M.isValidElement(le)&&le.type!==ce.FormDataConsumer&&le.props.source&&(V[le.props.source]=le.props.defaultValue??null)})));const q={...V,...h};O(q),x(`${r}.${B.length}`,{defaultValue:V})},[O,t,x,r,B.length,h]),Y=_=>V=>{$(),_&&_(V)},ie=Q.useCallback(()=>{S([]),I(!1)},[S]),se=YV(k,r),X=Q.useMemo(()=>({total:B.length,remove:K,source:r}),[B.length,K,r]),Z=R.palette.mode==="dark"?R.palette.grey.A400:R.palette.grey.A800,H=B.length>0&&u;return B?g.jsx(Qf.Provider,{value:X,children:g.jsxs("div",{className:A,children:[M.cloneElement(g.jsx(GV,{}),{label:o,source:r,disableAdd:a,template:h,onClick:Y((L=(J=e==null?void 0:e.addButton)==null?void 0:J.props)==null?void 0:L.onClick),inset:C}),g.jsx(y.TableContainer,{component:y.Paper,sx:C===!0?{borderRadius:0}:{mt:2,border:`1px solid ${Z}`},children:g.jsxs(y.Table,{size:"small",children:[g.jsx(y.TableHead,{sx:C===!0?{}:{borderTop:0,borderBottom:`1px solid ${Z}`},children:g.jsxs(y.TableRow,{children:[Q.Children.map(t,(_,V)=>M.isValidElement(_)?g.jsx(y.TableCell,{children:g.jsx(y.Typography,{display:"flex",variant:"subtitle1",color:"text.primary",textTransform:"none",children:G({..._.props,resource:n})})},V):null),!s&&(H?g.jsx(y.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:g.jsx(Bi,{horizontal:!0,children:g.jsx(y.Typography,{color:"error",onClick:()=>I(!0),children:P("ra.action.delete")})})},"actions"):g.jsx(y.TableCell,{},"empty_actions"))]})}),g.jsxs(y.TableBody,{children:[B.length===0&&g.jsx(y.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0}},children:g.jsx(y.TableCell,{colSpan:4+(s?0:1),align:"center",children:p||g.jsx(y.Typography,{variant:"body1",color:"text.secondary",children:"-"})})}),B.length>0&&B.map((_,V)=>g.jsx(y.TableRow,{sx:{borderBottom:`1px solid ${Z}}`},children:g.jsx(ry,{disableRemove:c,disableActions:s,index:V,member:`${r}.${V}`,onRemoveField:K,record:se&&se[V]||{},resource:n,source:r,children:t})},_.id))]})]})}),B.length>0&&g.jsx(j.Confirm,{isOpen:m,title:P("ra.action.clear_array_input"),content:P("ra.message.clear_array_input"),onConfirm:ie,onClose:()=>I(!1)})]})}):null}function GV(e){const{label:t,disableAdd:n,onClick:r,inset:o}=e,s=bt(),a=s.palette.mode==="dark"?s.palette.grey.A400:s.palette.grey.A800,c=s.palette.mode==="light"?"#000000":"#FFFFFF";return g.jsxs(y.Stack,{justifyContent:"space-between",alignItems:"center",flexDirection:"row",sx:o?{p:2.5}:{pt:2},children:[t!==!1&&g.jsx(y.Typography,{children:t}),!n&&(M.isValidElement(e==null?void 0:e.addButton)?M.cloneElement(e==null?void 0:e.addButton,{onClick:r}):g.jsx(y.IconButton,{color:"secondary",sx:{border:`1px solid ${a}`},onClick:r,children:g.jsx(Ze.PlusCircleOutlined,{style:{color:c}})}))]})}const KV=Ae(Ay,{slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8.25)})`}},[e.breakpoints.down("sm")]:{"& .MuiTableRow-root:last-child":{borderBottom:0}}}));function qV(e,t){const n=te.clone(e),{type:r,payload:o}=t;switch(r){case"updateMedia":{const s=te.chain(n.media).clone().extend(o).value();return te.extend(n,{media:s})}case"updateDrawer":{const s=te.chain(n.drawer).clone().extend(o).value();return te.extend(n,{drawer:s})}case"updateLogo":{const s=te.chain(n.logo).clone().extend(o).value();return te.extend(n,{logo:s})}case"updateNotifications":{const s=te.chain(n.notifications).clone().extend(o).value();return te.extend(n,s)}case"updateTheme":{const s=te.chain(n.theme).clone().extend(o).value();return te.extend(n,{theme:s})}default:return n}}const JV={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"}},dy=Q.createContext(void 0);function gy(e){var K;const t=ce.useAuthProvider();console.log("authProvider: ",t);const n=ce.useGetIdentity(),r=y.useTheme(),o=y.useMediaQuery(r.breakpoints.down("md")),s=y.useMediaQuery(r.breakpoints.down("lg")),a=y.useMediaQuery(r.breakpoints.down("xl")),{miniDrawer:c,isHorizontalLayout:u,menuOrientation:A,drawerWidth:p}=Qn(),h=u(A)&&!s,{drawerOpen:C,openDrawer:m}=mi(),I=Q.useCallback(()=>{m(!C)},[C,m]),[B,v]=Q.useState(!1),[S,O]=Q.useReducer(qV,te.chain(JV).clone().merge({drawer:{open:!c||C}}).value()),x=Q.useCallback(()=>v(!1),[]),R=Q.useMemo(()=>({state:S,dispatch:O}),[S,O]),{logoIcon:P,logoMain:k,enableNotification:F,notification:G}=e;return Q.useEffect(()=>{O({type:"updateMedia",payload:{downMd:o,downLg:s,downXl:a,horizontal:h}})},[A,o,s,a]),Q.useEffect(()=>{O({type:"updateDrawer",payload:{open:C,width:p,handleDrawerToggle:I}})},[C,p,I]),Q.useEffect(()=>{c||m(!a)},[a,c]),Q.useEffect(()=>{O({type:"updateLogo",payload:{main:k,icon:P}})},[P,k]),Q.useEffect(()=>{O({type:"updateNotifications",payload:{enable:F,resource:G??"entities/notification"}})},[F,G]),Q.useEffect(()=>{O({type:"updateTheme",payload:{iconColorOpen:r.palette.mode==="dark"?"grey.200":"grey.300",iconColor:r.palette.mode==="dark"?"background.default":"grey.100"}})},[r.palette.mode]),Q.useEffect(()=>{t==null||t.isImpersonating().then($=>{var Y;v(!$&&((Y=n==null?void 0:n.data)==null?void 0:Y.needToChangePassword)===!0)})},[(K=n==null?void 0:n.data)==null?void 0:K.needToChangePassword,t]),g.jsxs(dy.Provider,{value:R,children:[g.jsx(y.Dialog,{open:B,maxWidth:"xs",fullWidth:!0,children:g.jsx(fp,{onSuccess:x,firstAccess:!0})}),e.children]})}function fy(e){return Q.forwardRef((t,n)=>{const{logoIcon:r,logoMain:o,enableNotification:s,notification:a}=t;return g.jsx(gy,{logoIcon:r,logoMain:o,enableNotification:s,notification:a,children:g.jsx(e,{ref:n,...t})})})}function vp(){const e=Q.useContext(dy);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function XV(){return vp().dispatch}function Ms(){return vp().state}function Nn(){return Ms().media}function Ti(){return Ms().drawer}function py(){return Ms().logo}function Zu(){return Ms().notifications}function ZV(){return Ms().theme}const _V={ml:{xs:0,lg:-2}};function hy(){const{open:e,handleDrawerToggle:t}=Ti();return g.jsx(Rs,{value:"drawer","aria-label":"open drawer",sx:_V,onChange:t,selected:e,children:e?g.jsx(Ze.MenuFoldOutlined,{}):g.jsx(Ze.MenuUnfoldOutlined,{})})}function Cy(e){const t=Q.useRef(),n=y.useTheme(),{downLg:r,horizontal:o}=Nn(),{open:s,width:a}=Ti(),c=r?y.AppBar:TB,u=Er(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:o?"100%":s?`calc(100% - ${a}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),A={position:"fixed",color:"inherit",elevation:0,sx:u};return r||te.extend(A,{open:s}),g.jsx(c,{ref:t,...A,children:g.jsxs(y.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!o&&g.jsx(hy,{}),e.children]})})}function $V(e){const t=y.useTheme(),{notification:n,onClick:r,selected:o,divider:s}=e,{resource:a}=Zu(),c=ce.useNotify(),u=ce.useRedirect(),[A]=ce.useUpdate(a,{id:n==null?void 0:n.id,data:{...n,readed:Pr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n!=null&&n.resource?n!=null&&n.resource.startsWith("/")?(u(n==null?void 0:n.resource),r()):(r(),document.location.href=n==null?void 0:n.resource):r()},onFailure:()=>{c("resources.notifications.messages.readed.error","warning")}}),p=Q.useCallback(()=>A(),[A]),[h]=ce.useLocaleState(),C=Q.useMemo(()=>Pr(n.created).locale(h).fromNow(),[n,h]);return g.jsx(y.ListItem,{disablePadding:!0,divider:s,children:g.jsxs(y.ListItemButton,{selected:o,onClick:p,children:[g.jsx(y.ListItemAvatar,{children:g.jsx(y.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:g.jsx(Ze.MessageOutlined,{})})}),g.jsx(y.ListItemText,{sx:{overflow:"hidden",wordBreak:"break-word",width:"90%"},primary:n.title,secondary:n.content}),g.jsx(y.Box,{flexGrow:1,flexShrink:1,minWidth:t.spacing(2)}),g.jsx(y.ListItemText,{sx:{overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-word"},primary:C,primaryTypographyProps:{variant:"caption"}})]})})}const eH={width:36,height:36,fontSize:"1rem"},tH={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function my(){const{enable:e}=Zu();return e?g.jsx(nH,{}):null}function nH(){const e=ce.useTranslate(),t=y.useTheme(),n=ce.useRefresh(),r=ce.useNotify(),{downMd:o}=Nn(),{resource:s}=Zu(),[a,c]=Q.useState([]),{data:u,isLoading:A}=ce.useGetList(s,{pagination:{page:1,perPage:25},sort:{field:"created",order:"DESC"},filter:{readed:!1}}),p=a.filter(O=>O.readed===null).length,{open:h,anchorEl:C,handleClose:m,handleToggle:I}=Ru();Q.useEffect(()=>{!A&&u&&c(u??[])},[u,A]);const B=a.filter(O=>!O.readed).map(O=>O.id),[v]=ce.useUpdateMany(s,{ids:B,data:{readed:Pr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n(),r("resources.notifications.messages.readed.done")},onError:()=>r("ra.notification.readed_error")}),S=Q.useCallback(()=>{v()},[v]);return g.jsxs(g.Fragment,{children:[g.jsx(Rs,{value:"notifications",selected:h,onChange:I,children:g.jsx(y.Badge,{badgeContent:p,color:"primary",children:g.jsx(Ze.BellOutlined,{})})}),g.jsx(y.Popper,{placement:o?"bottom":"bottom-end",open:h,anchorEl:C,role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:O})=>g.jsx(Do,{type:"grow",position:o?"top":"top-right",in:h,...O,children:g.jsx(y.Paper,{sx:{marginTop:1,boxShadow:t.customShadows.z1,width:"100%",minWidth:285,maxWidth:420,[t.breakpoints.down("md")]:{maxWidth:285}},children:g.jsx(y.ClickAwayListener,{onClickAway:m,children:g.jsxs(er,{title:e("ra.notification.title"),elevation:0,border:!1,content:!1,secondary:g.jsx(g.Fragment,{children:p>0&&g.jsx(y.Tooltip,{title:e("ra.notification.mark-as-read"),onClick:S,children:g.jsx(Ps,{color:"success",size:"small",children:g.jsx(Ze.CheckCircleOutlined,{style:{fontSize:"1.15rem"}})})})}),children:[g.jsx(y.List,{component:"nav",sx:{p:0,"& .MuiListItemButton-root":{py:.5,"&.Mui-selected":{bgcolor:"grey.50",color:"text.primary"},"& .MuiAvatar-root":eH,"& .MuiListItemSecondaryAction-root":{...tH,position:"relative"}},maxHeight:"calc(100vh - 240px)",overflow:"auto"},children:a.map((x,R)=>g.jsx($V,{selected:p>0,notification:x,onClick:m,divider:R<a.length-1},x.id))}),g.jsx(y.ListItemButton,{sx:{textAlign:"center",py:"12px !important"},to:`/${s}`,LinkComponent:Ct.Link,onClick:m,children:g.jsx(y.ListItemText,{primary:g.jsx(y.Typography,{variant:"h6",color:"primary",children:e("ra.notification.view_all")})})}),g.jsx(y.Divider,{})]})})})})})]})}const rH=()=>{const[e,t]=Q.useState(!1),n=Q.useCallback(()=>t(!1),[t]),r=Q.useCallback(()=>t(!0),[t]),o=ce.useTranslate();return g.jsxs(Q.Fragment,{children:[g.jsxs(y.ListItemButton,{onClick:r,children:[g.jsx(y.ListItemIcon,{children:g.jsx(rr.Key,{})}),g.jsx(y.ListItemText,{primary:o("ra.auth.change_password")})]}),g.jsx(y.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:g.jsx(fp,{onSuccess:n})})]})},oH=()=>{const e=ce.useLogout(),t=ce.useTranslate();return g.jsx(Q.Fragment,{children:g.jsxs(y.ListItemButton,{onClick:e,children:[g.jsx(y.ListItemIcon,{children:g.jsx(rr.LogoutOutlined,{})}),g.jsx(y.ListItemText,{primary:t("ra.auth.logout")})]})})},iH=()=>{const e=ce.useTranslate(),t=ce.useAuthProvider(),n=Q.useCallback(()=>t==null?void 0:t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,o]=Q.useState(!1);return Q.useEffect(()=>{t.isImpersonating&&(t==null||t.isImpersonating().then(s=>o(s)))},[t,o]),r?g.jsx(Q.Fragment,{children:g.jsxs(y.ListItemButton,{onClick:n,children:[g.jsx(y.ListItemIcon,{children:g.jsx(rr.LogoutOutlined,{})}),g.jsx(y.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};function Ey(){var m;const e=y.useTheme(),t=ce.useDataProvider(),n=ce.useAuthProvider(),{identity:r}=ce.useGetIdentity(),o=r!==void 0&&r.image&&r.image!==null&&r.image!=="",[s,a]=Q.useState(null),{open:c,anchorEl:u,handleToggle:A,handleClose:p}=Ru(),h=ce.useLogout(),C=Q.useCallback(()=>{h()},[n,h]);return Q.useEffect(()=>{o&&t.getFile("/profile/me/image").then(I=>a(I))},[t,o]),g.jsxs(g.Fragment,{children:[g.jsx(Rs,{sx:{p:.25,width:"auto"},onClick:A,value:"profile",selected:c,children:g.jsxs(y.Stack,{direction:"row",spacing:2,alignItems:"center",sx:{p:.5},children:[g.jsx(ka,{alt:(m=r==null?void 0:r.name)==null?void 0:m.toUpperCase(),src:s,size:"xs"}),g.jsx(y.Typography,{variant:"subtitle1",children:r==null?void 0:r.name})]})}),g.jsx(pr.Popper,{placement:"bottom-end",open:c,anchorEl:u,role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:I})=>{var B;return g.jsx(Do,{type:"grow",position:"top-right",in:c,...I,children:g.jsx(y.Paper,{sx:{boxShadow:e.customShadows.z1,width:290,minWidth:240,maxWidth:290,[e.breakpoints.down("md")]:{maxWidth:250},marginTop:1},children:g.jsx(y.ClickAwayListener,{onClickAway:p,children:g.jsxs(er,{elevation:0,border:!1,content:!1,children:[g.jsx(y.CardContent,{sx:{px:2.5,pt:3},children:g.jsxs(y.Grid,{container:!0,justifyContent:"space-between",alignItems:"center",children:[g.jsx(y.Grid,{item:!0,children:g.jsxs(y.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[g.jsx(ka,{alt:"profile user",src:s,sx:{width:32,height:32}}),g.jsxs(y.Stack,{children:[g.jsx(y.Typography,{variant:"h6",children:r==null?void 0:r.name}),g.jsx(y.Typography,{variant:"body2",color:"textSecondary",children:(B=r==null?void 0:r.roles)==null?void 0:B.map(v=>v.name.replace("ROLE_","")).join(",")})]})]})}),g.jsx(y.Grid,{item:!0,children:g.jsx(y.Tooltip,{title:"Logout",children:g.jsx(Ps,{size:"large",sx:{color:"text.primary"},onClick:C,children:g.jsx(Ze.LogoutOutlined,{})})})})]})}),g.jsx(y.Grid,{container:!0,children:g.jsx(y.Grid,{item:!0,xs:12,children:g.jsxs(y.List,{component:"nav",sx:{p:0,"& .MuiListItemIcon-root":{minWidth:32}},children:[g.jsx(rH,{}),g.jsx(oH,{}),g.jsx(iH,{})]})})})]})})})})}})]})}const Iy=e=>{const t=bt(),{downMd:n}=Nn(),{open:r,anchorEl:o,handleToggle:s,handleClose:a}=Ru();return n?g.jsxs(g.Fragment,{children:[g.jsx(Rs,{value:"drawer","aria-label":"open more menu","aria-controls":r?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:s,selected:r,children:g.jsx(Ze.MoreOutlined,{})}),g.jsx(y.Popper,{placement:"bottom-end",open:r,anchorEl:o,role:void 0,transition:!0,disablePortal:!0,style:{width:"100%"},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:c})=>g.jsx(Do,{type:"fade",in:r,...c,children:g.jsx(y.Paper,{sx:{boxShadow:t.customShadows.z1},children:g.jsx(y.ClickAwayListener,{onClickAway:a,children:g.jsx(y.AppBar,{color:"inherit",children:g.jsx(y.Toolbar,{children:e.children})})})})})})]}):g.jsx(g.Fragment,{children:e.children})};function By(e){return g.jsx(y.Box,{...e,flex:1})}function bp(e){const{name:t,version:n,copy:r="© Applica Software Guru for"}=e;return g.jsx(y.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:"24px 16px 0px",mt:"auto"},children:g.jsxs(y.Typography,{variant:"caption",children:[g.jsx("span",{dangerouslySetInnerHTML:{__html:r||""}})," ",t," - ",n]})})}var vy={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})(vy);var _u=vy.exports,_d={};const sH=pO(o6);var PI;function $u(){return PI||(PI=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=sH}(_d)),_d}function by(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=by(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function yy(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=by(e))&&(r&&(r+=" "),r+=t);return r}var aH="__lodash_hash_undefined__";function lH(e){return this.__data__.set(e,aH),this}var cH=lH;function uH(e){return this.__data__.has(e)}var AH=uH,dH=ay,gH=cH,fH=AH;function ru(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new dH;++t<n;)this.add(e[t])}ru.prototype.add=ru.prototype.push=gH;ru.prototype.has=fH;var Qy=ru;function pH(e,t){return e.has(t)}var xy=pH;function hH(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var wy=hH;function CH(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var mH=CH,EH=Ep,IH=Gu,BH="[object Arguments]";function vH(e){return IH(e)&&EH(e)==BH}var bH=vH,RI=bH,yH=Gu,Ty=Object.prototype,QH=Ty.hasOwnProperty,xH=Ty.propertyIsEnumerable,wH=RI(function(){return arguments}())?RI:function(e){return yH(e)&&QH.call(e,"callee")&&!xH.call(e,"callee")},TH=wH,SH=9007199254740991;function PH(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=SH}var RH=PH;function OH(e){return function(t){return e(t)}}var jH=OH,DH=sy,MH=RH;function kH(e){return e!=null&&MH(e.length)&&!DH(e)}var FH=kH,LH=Ku,NH=Uu,VH=LH(NH,"Set"),HH=VH,zH=Ku,WH=function(){try{var e=zH(Object,"defineProperty");return e({},"",{}),e}catch{}}(),UH=WH,YH=FH,GH=Gu;function KH(e){return GH(e)&&YH(e)}var Sy=KH;function qH(e){return e}var Py=qH;function JH(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var XH=JH,ZH=XH,OI=Math.max;function _H(e,t,n){return t=OI(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,s=OI(r.length-t,0),a=Array(s);++o<s;)a[o]=r[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=r[o];return c[t]=n(a),ZH(e,this,c)}}var $H=_H;function ez(e){return function(){return e}}var tz=ez,nz=tz,jI=UH,rz=Py,oz=jI?function(e,t){return jI(e,"toString",{configurable:!0,enumerable:!1,value:nz(t),writable:!0})}:rz,iz=oz,sz=800,az=16,lz=Date.now;function cz(e){var t=0,n=0;return function(){var r=lz(),o=az-(r-n);if(n=r,o>0){if(++t>=sz)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var uz=cz,Az=iz,dz=uz,gz=dz(Az),fz=gz,pz=Py,hz=$H,Cz=fz;function mz(e,t){return Cz(hz(e,t,pz),e+"")}var Ry=mz,Ug=globalThis&&globalThis.__assign||function(){return Ug=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Ug.apply(this,arguments)},Ez=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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},gc,$d,Oy=function(e){var t=e.className,n=e.onClick,r=e.sx,o=Ez(e,["className","onClick","sx"]),s=ce.useLoading(),a=bt();return M.createElement(Iz,{className:t,sx:r},M.createElement(iQ,{className:"".concat(gs.loadedIcon," ").concat(s&&gs.loadedLoading),onClick:n}),s&&M.createElement(dp,Ug({className:yy("app-loader",gs.loader),color:"inherit",size:a.spacing(2),thickness:6},o)))};Oy.propTypes={classes:f.object,className:f.string,width:f.string};var Tc="RaLoadingIndicator",gs={loader:"".concat(Tc,"-loader"),loadedLoading:"".concat(Tc,"-loadedLoading"),loadedIcon:"".concat(Tc,"-loadedIcon")},Iz=Ae("div",{name:Tc,overridesResolver:function(e,t){return t.root}})((gc={position:"relative"},gc["& .".concat(gs.loadedIcon)]=($d={},$d["&.".concat(gs.loadedLoading)]={opacity:0},$d),gc["& .".concat(gs.loader)]={position:"absolute",top:"30%",left:"30%"},gc));const yp=e=>e.scrollTop;function vs(e,t){var n,r;const{timeout:o,easing:s,style:a={}}=e;return{duration:(n=a.transitionDuration)!=null?n:typeof o=="number"?o:o[t.mode]||0,easing:(r=a.transitionTimingFunction)!=null?r:typeof s=="object"?s[t.mode]:s,delay:a.transitionDelay}}const Bz=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function vz(e,t,n){const r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),s=Ts(t);let a;if(t.fakeTransform)a=t.fakeTransform;else{const A=s.getComputedStyle(t);a=A.getPropertyValue("-webkit-transform")||A.getPropertyValue("transform")}let c=0,u=0;if(a&&a!=="none"&&typeof a=="string"){const A=a.split("(")[1].split(")")[0].split(",");c=parseInt(A[4],10),u=parseInt(A[5],10)}return e==="left"?o?`translateX(${o.right+c-r.left}px)`:`translateX(${s.innerWidth+c-r.left}px)`:e==="right"?o?`translateX(-${r.right-o.left-c}px)`:`translateX(-${r.left+r.width-c}px)`:e==="up"?o?`translateY(${o.bottom+u-r.top}px)`:`translateY(${s.innerHeight+u-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-u}px)`:`translateY(-${r.top+r.height-u}px)`}function jy(e){return typeof e=="function"?e():e}function fc(e,t,n){const r=jy(n),o=vz(e,t,r);o&&(t.style.webkitTransform=o,t.style.transform=o)}const Dy=M.forwardRef(function(t,n){const r=bt(),o={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:c=!0,children:u,container:A,direction:p="down",easing:h=o,in:C,onEnter:m,onEntered:I,onEntering:B,onExit:v,onExited:S,onExiting:O,style:x,timeout:R=s,TransitionComponent:P=ap}=t,k=Ne(t,Bz),F=M.useRef(null),G=kn(u.ref,F,n),K=L=>_=>{L&&(_===void 0?L(F.current):L(F.current,_))},$=K((L,_)=>{fc(p,L,A),yp(L),m&&m(L,_)}),Y=K((L,_)=>{const V=vs({timeout:R,style:x,easing:h},{mode:"enter"});L.style.webkitTransition=r.transitions.create("-webkit-transform",z({},V)),L.style.transition=r.transitions.create("transform",z({},V)),L.style.webkitTransform="none",L.style.transform="none",B&&B(L,_)}),ie=K(I),se=K(O),X=K(L=>{const _=vs({timeout:R,style:x,easing:h},{mode:"exit"});L.style.webkitTransition=r.transitions.create("-webkit-transform",_),L.style.transition=r.transitions.create("transform",_),fc(p,L,A),v&&v(L)}),Z=K(L=>{L.style.webkitTransition="",L.style.transition="",S&&S(L)}),H=L=>{a&&a(F.current,L)},J=M.useCallback(()=>{F.current&&fc(p,F.current,A)},[p,A]);return M.useEffect(()=>{if(C||p==="down"||p==="right")return;const L=D0(()=>{F.current&&fc(p,F.current,A)}),_=Ts(F.current);return _.addEventListener("resize",L),()=>{L.clear(),_.removeEventListener("resize",L)}},[p,C,A]),M.useEffect(()=>{C||J()},[C,J]),g.jsx(P,z({nodeRef:F,onEnter:$,onEntered:ie,onEntering:Y,onExit:X,onExited:Z,onExiting:se,addEndListener:H,appear:c,in:C,timeout:R},k,{children:(L,_)=>M.cloneElement(u,z({ref:G,style:z({visibility:L==="exited"&&!C?"hidden":void 0},x,u.props.style)},_))}))});process.env.NODE_ENV!=="production"&&(Dy.propTypes={addEndListener:f.func,appear:f.bool,children:ws.isRequired,container:Or(f.oneOfType([hi,f.func]),e=>{if(e.open){const t=jy(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(`
|
|
205
|
+
`),m6)),Ab=M.forwardRef(function(t,n){const r=Ht({props:t,name:"MuiCircularProgress"}),{className:o,color:s="primary",disableShrink:a=!1,size:c=40,style:u,thickness:A=3.6,value:p=0,variant:h="indeterminate"}=r,C=Ne(r,h6),m=z({},r,{color:s,disableShrink:a,size:c,thickness:A,value:p,variant:h}),I=E6(m),B={},v={},S={};if(h==="determinate"){const O=2*Math.PI*((ho-A)/2);B.strokeDasharray=O.toFixed(3),S["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*O).toFixed(3)}px`,v.transform="rotate(-90deg)"}return g.jsx(I6,z({className:Ge(I.root,o),style:z({width:c,height:c},v,u),ownerState:m,ref:n,role:"progressbar"},S,C,{children:g.jsx(B6,{className:I.svg,ownerState:m,viewBox:`${ho/2} ${ho/2} ${ho} ${ho}`,children:g.jsx(v6,{className:I.circle,style:B,ownerState:m,cx:ho,cy:ho,r:(ho-A)/2,fill:"none",strokeWidth:A})})}))});process.env.NODE_ENV!=="production"&&(Ab.propTypes={classes:f.object,className:f.string,color:f.oneOfType([f.oneOf(["inherit","primary","secondary","error","info","success","warning"]),f.string]),disableShrink:Or(f.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:f.oneOfType([f.number,f.string]),style:f.object,sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),thickness:f.number,value:f.number,variant:f.oneOf(["determinate","indeterminate"])});const dp=Ab;function b6(e){return Dt("MuiLoadingButton",e)}const y6=Vt("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),Yr=y6,Q6=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],x6=e=>{const{loading:t,loadingPosition:n,classes:r}=e,o={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Pe(n)}`],endIcon:[t&&`endIconLoading${Pe(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Pe(n)}`]},s=pr.unstable_composeClasses(o,b6,r);return z({},r,s)},w6=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",T6=Ae(f6,{shouldForwardProp:e=>w6(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Yr.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Yr.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>z({[`& .${Yr.startIconLoadingStart}, & .${Yr.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}),[`&.${Yr.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Yr.startIconLoadingStart}, & .${Yr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Yr.startIconLoadingStart}, & .${Yr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),S6=Ae("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Pe(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>z({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})),db=M.forwardRef(function(t,n){const r=Ht({props:t,name:"MuiLoadingButton"}),{children:o,disabled:s=!1,id:a,loading:c=!1,loadingIndicator:u,loadingPosition:A="center",variant:p="text"}=r,h=Ne(r,Q6),C=of(a),m=u??g.jsx(dp,{"aria-labelledby":C,color:"inherit",size:16}),I=z({},r,{disabled:s,loading:c,loadingIndicator:m,loadingPosition:A,variant:p}),B=x6(I),v=c?g.jsx(S6,{className:B.loadingIndicator,ownerState:I,children:m}):null;return g.jsxs(T6,z({disabled:s||c,id:C,ref:n},h,{variant:p,classes:B,ownerState:I,children:[I.loadingPosition==="end"?o:v,I.loadingPosition==="end"?v:o]}))});process.env.NODE_ENV!=="production"&&(db.propTypes={children:f.node,classes:f.object,disabled:f.bool,id:f.string,loading:f.bool,loadingIndicator:f.node,loadingPosition:Or(f.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:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),variant:f.oneOfType([f.oneOf(["contained","outlined","text"]),f.string])});const P6=db;function Jd({variant:e,theme:t,color:n,loadingPosition:r}){const o=rn(t,n),{lighter:s,main:a,dark:c,contrastText:u}=o,A=`${n}Button`,p=Ss(t,A),h={"& .MuiLoadingButton-loadingIndicator":{color:a}},C={...r&&r!=="center"&&{color:a}},m={"&::after":{boxShadow:`0 0 6px 6px ${ze(a,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${ze(a,.9)}`},"&:focus-visible":{outline:`2px solid ${c}`,outlineOffset:2}};switch(e){case"contained":return{backgroundColor:a,...r&&r!=="center"&&{color:u},"& .MuiLoadingButton-loadingIndicator":{color:u},"&:hover":{backgroundColor:c,color:u},...m};case"light":return{backgroundColor:a,...r&&r!=="center"&&{color:u},"& .MuiLoadingButton-loadingIndicator":{color:u},"&:hover":{backgroundColor:c,color:u},...m};case"shadow":return{boxShadow:p,backgroundColor:a,...r&&r!=="center"&&{color:u},"& .MuiLoadingButton-loadingIndicator":{color:u},"&:hover":{boxShadow:"none",backgroundColor:c,color:u},...m};case"outlined":return{backgroundColor:"transparent",borderColor:a,...C,...h};case"dashed":return{backgroundColor:s,borderColor:a,...C,...h,...m};case"text":default:return{color:a,...h,...m}}}const R6=Ae(P6,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:o,loadingPosition:s})=>({"::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"&&{...Jd({variant:t,theme:e,color:r,loadingPosition:s}),"&.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")&&!o&&{color:"#fff"},...t!=="text"&&{...Jd({variant:t,theme:e,color:r,loadingPosition:s})},"&.Mui-disabled":{...t!=="text"&&{...Jd({variant:t,theme:e,color:r,loadingPosition:s})}}})),gp=Q.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...o},s)=>{const a=bt();return g.jsx(R6,{ref:s,variant:e,shape:t,theme:a,loadingPosition:o.loadingPosition,loading:o.loading,color:r,...o,children:n})});gp.propTypes={variant:f.string,shape:f.string,children:f.node,color:f.string};gp.displayName="LoadingButton";function O6({color:e,theme:t,labelColor:n}){const r=rn(t,e),{main:o,contrastText:s}=r;let a=e||"";return["primary","secondary","info","success","warning","error"].includes(a)?{[`& .${y.tooltipClasses.tooltip}`]:{backgroundColor:o,color:n||s},[`& .${y.tooltipClasses.arrow}`]:{color:o}}:{[`& .${y.tooltipClasses.tooltip}`]:{backgroundColor:a,color:n||s,boxShadow:t.shadows[1]},[`& .${y.tooltipClasses.arrow}`]:{color:a}}}const j6=Ae(({className:e,...t})=>g.jsx(y.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&O6({color:t,theme:e,labelColor:n})}));function zu({children:e,arrow:t,labelColor:n="",...r}){const o=bt();return g.jsx(y.Box,{display:"flex",children:g.jsx(j6,{arrow:t,...r,theme:o,labelColor:n,children:e})})}zu.propTypes={children:f.element,arrow:f.bool,labelColor:f.string,rest:f.array};const Do=Q.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...o},s)=>{let a={transformOrigin:"0 0 0"};switch(t){case"top-right":a={transformOrigin:"top right"};break;case"top":a={transformOrigin:"top"};break;case"bottom-left":a={transformOrigin:"bottom left"};break;case"bottom-right":a={transformOrigin:"bottom right"};break;case"bottom":a={transformOrigin:"bottom"};break;case"top-left":default:a={transformOrigin:"0 0 0"};break}return g.jsxs(y.Box,{ref:s,children:[n==="grow"&&g.jsx(y.Grow,{...o,timeout:{appear:0,enter:150,exit:150},children:g.jsx(y.Box,{sx:a,children:e})}),n==="collapse"&&g.jsx(y.Collapse,{...o,sx:a,children:e}),n==="fade"&&g.jsx(y.Fade,{...o,timeout:{appear:0,enter:300,exit:150},children:g.jsx(y.Box,{sx:a,children:e})}),n==="slide"&&g.jsx(y.Slide,{...o,timeout:{appear:0,enter:150,exit:150},direction:r,children:g.jsx(y.Box,{sx:a,children:e})}),n==="zoom"&&g.jsx(y.Zoom,{...o,children:g.jsx(y.Box,{sx:a,children:e})})]})});Do.propTypes={children:f.node,type:f.oneOf(["grow","fade","collapse","slide","zoom"]),position:f.oneOf(["top-left","top-right","top","bottom-left","bottom-right","bottom"]),direction:f.oneOf(["up","down","left","right"])};Q.forwardRef(function(t,n){return g.jsx(y.Zoom,{ref:n,timeout:200,...t})});function gb({value:e,...t}){return g.jsxs(y.Box,{sx:{position:"relative",display:"inline-flex"},children:[g.jsx(y.CircularProgress,{variant:"determinate",value:e,...t}),g.jsx(y.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(y.Typography,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(e)}%`})})]})}gb.propTypes={value:f.number};function fb({value:e,size:t,variant:n,thickness:r,showLabel:o,pathColor:s,sx:a,...c}){return g.jsxs(y.Box,{sx:{position:"relative",display:"inline-flex"},children:[g.jsx(y.CircularProgress,{variant:"determinate",sx:{color:s||"grey.200"},size:t,thickness:r,...c,value:100}),o&&g.jsx(y.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(y.Typography,{variant:"caption",component:"div",color:"text.secondary",children:e?`${Math.round(e)}%`:"0%"})}),g.jsx(y.CircularProgress,{variant:n,sx:{...a,position:"absolute",left:0,[`& .${y.circularProgressClasses.circle}`]:{strokeLinecap:"round"}},size:t,thickness:r,value:e,...c})]})}fb.propTypes={value:f.number,size:f.number,variant:f.string,thickness:f.number,showLabel:f.bool,pathColor:f.string,sx:f.array,others:f.array};function pb({icon:e,value:t,...n}){return g.jsxs(y.Box,{sx:{display:"flex",alignItems:"center"},children:[g.jsx(y.Box,{sx:{width:"100%",mr:1},children:g.jsx(y.LinearProgress,{variant:"determinate",value:t,...n})}),g.jsx(y.Box,{sx:{minWidth:35},children:e})]})}pb.propTypes={icon:f.node,value:f.number};function hb({value:e,...t}){return g.jsxs(y.Box,{sx:{display:"flex",alignItems:"center"},children:[g.jsx(y.Box,{sx:{width:"100%",mr:1},children:g.jsx(y.LinearProgress,{variant:"determinate",value:e,...t})}),g.jsx(y.Box,{sx:{minWidth:35},children:g.jsx(y.Typography,{variant:"body2",color:"text.secondary",children:`${Math.round(e)}%`})})]})}hb.propTypes={value:f.number};const D6=Q.forwardRef(function(t,n){const r=Er(t,{color:"text.primary"},{defaults:!0});return g.jsx(Ps,{ref:n,...t,color:"secondary",variant:"text",sx:r})}),Rs=Q.forwardRef(function(t,n){const r=Er(t,{color:"text.primary",borderStyle:"none",padding:1,fontSize:"1.5rem",width:36,height:36},{defaults:!0});return g.jsx(y.ToggleButton,{ref:n,...t,color:"secondary",sx:r})}),M6=qa(j.Toolbar,{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)}}));function wi(e){return g.jsx(M6,{...e})}function k6({children:e,content:t=!0,title:n,subheader:r=null,secondary:o=null,toolbar:s=!1,lg:a=12,md:c=12,sm:u=12,xs:A=12,...p}){const h=j.useTranslate(),C=j.useResourceContext(),{cardTitle:m,cardSubheader:I}=Q.useMemo(()=>{const B=n||`resources.${C}.title`;return{cardTitle:h(B,{_:B}),cardSubheader:r!==null?h(r,{_:r}):null}},[C,r,n,h]);return g.jsx(y.Grid,{item:!0,...p,lg:a,md:c,sm:u,xs:A,children:g.jsx(er,{content:t,title:m,subheader:I,secondary:o,divider:!0,children:g.jsxs(Q.Fragment,{children:[e,s===!0?g.jsx(wi,{children:g.jsx(j.SaveButton,{})}):s]})})})}const F6=Ae(j.Form,{slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*1.25),padding:0,minHeight:"unset"},"& .RaToolbar-mobileToolbar":{paddingTop:"20px !important",paddingRight:"0 !important",paddingLeft:"0 !important",paddingBottom:0}}));function Cb({children:e,spacing:t,defaultValues:n,...r}){const{spacing:o}=Qn();return g.jsx(F6,{defaultValues:n,spacing:t||o,children:g.jsx(y.Grid,{container:!0,...r,spacing:t||o,children:e})})}Cb.Section=k6;const L6=qa(j.SimpleForm,{slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:2.5)},paddingBottom:"0 !important"}));function mb({title:e,modal:t=!1,content:n=!1,subheader:r=null,toolbar:o=g.jsx(wi,{children:g.jsx(j.SaveButton,{type:"button"})}),secondary:s=g.jsx(Bi,{children:g.jsx(j.DeleteWithConfirmButton,{})}),sx:a,...c}){const u=Df(e),A=j.useRecordContext();return g.jsx(er,{content:n,title:u,subheader:r,secondary:A!=null&&A.id?s:null,sx:{...a,"& .MuiToolbar-root":{paddingLeft:2.5,paddingRight:2.5,paddingBottom:2.5}},border:!t,divider:!0,children:g.jsx(L6,{toolbar:o,...c})})}function Eb({label:e,children:t,display:n="label",helperText:r,sx:o,addLabel:s,divider:a=!1,fullWidth:c,...u}){const A=qt.useTheme(),{getCurrentDialog:p}=vi(),{source:h,resource:C,isRequired:m}=u,{getFieldState:I,formState:B}=Ii.useFormContext(),{error:v}=I(h,B),S=p();return g.jsxs(y.Stack,{spacing:1,sx:{"& .MuiFormHelperText-root":{color:v?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},width:c?"100%":"auto",...o},children:[n==="label"&&e!==!1&&s!==!1&&g.jsx(y.InputLabel,{error:!!v,sx:{borderBottom:a?`1px solid ${A.palette.divider}`:"none",pb:a?1:0,mt:a?1:0,pt:1},children:g.jsx(j.FieldTitle,{label:e,source:h,resource:S||C,isRequired:m})}),Q.isValidElement(t)?Q.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&g.jsx(y.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:!!v,children:r})]})}const N6=Ae(j.ArrayInput,{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%"}}}));function V6({label:e,addLabel:t,source:n,helperText:r,divider:o=!0,...s}){return g.jsx(Eb,{label:e,addLabel:t,source:n,helperText:r,divider:o,fullWidth:s==null?void 0:s.fullWidth,children:g.jsx(N6,{source:n,label:!1,...s})})}function H6({canEdit:e=!0,canDelete:t=!0,canClone:n=!1}){return!e&&!t&&!n?null:g.jsxs(Bi,{children:[e&&g.jsx(j.EditButton,{}),t&&g.jsx(j.DeleteWithConfirmButton,{}),n&&g.jsx(j.CloneButton,{})]})}const II=Ae("div",{overridesResolver:(e,t)=>t.root})({display:"inline-block"}),z6=Ae("ul")({display:"inline-block"});function W6(e){var p;const{className:t,emptyText:n,source:r,title:o,...s}=e,a=ce.useRecordContext(e),c=lt.get(a,r),u=ce.useTranslate();if(!c)return n?g.jsx(y.Typography,{component:"span",variant:"body2",className:t,...s,children:n&&u(n,{_:n})}):g.jsx(II,{className:t,...s});if(Array.isArray(c))return g.jsx(z6,{className:t,...s,children:c.map((h,C)=>{var I;const m=o instanceof String?(I=lt.get(h,o))==null?void 0:I.toString():o;return g.jsx("li",{children:m},C)})});const A=o instanceof String?(p=lt.get(a,o))==null?void 0:p.toString():o;return g.jsx(II,{className:t,...s,children:A})}function Ib({entityId:e,property:t,disabled:n,showUser:r=!1,userResource:o="entities/user",...s}){const[a,c]=Q.useState(null),u=j.useRecordContext(s),A=j.useDataProvider(),p=j.useResourceContext(),h=Q.useCallback(async I=>{I.preventDefault(),I.stopPropagation();const B=lt.get(u,s==null?void 0:s.source),v=p.replace("entities/",""),S=await A.getFile(`/attachments/${v}/${e||(u==null?void 0:u.id)}/${t||(s==null?void 0:s.source)}/${(B==null?void 0:B.id)||(u==null?void 0:u.id)}`),O=document.createElement("a");O.href=S,O.download=lt.get(u,(s==null?void 0:s.title)||(s==null?void 0:s.source)),O.click()},[A,u,e,p,t,s==null?void 0:s.source,s==null?void 0:s.title]),C=Q.useMemo(()=>({...u,[s==null?void 0:s.source]:(u==null?void 0:u.src)||lt.get(u,s==null?void 0:s.source),[s==null?void 0:s.title]:(u==null?void 0:u.title)||lt.get(u,(s==null?void 0:s.title)||(s==null?void 0:s.source))}),[u,s==null?void 0:s.source,s==null?void 0:s.title]),m=j.useTranslate();return Q.useEffect(()=>{!u||!(u!=null&&u.userId)||r===!1||A.getOne(o,{id:u==null?void 0:u.userId}).then(({data:I})=>c(I)).catch(()=>c(null))},[u,A,o]),g.jsx(W6,{...s,disabled:n,record:C,onClick:h,title:g.jsxs(y.Box,{sx:{cursor:"pointer"},children:[g.jsx(y.Typography,{variant:"subtitle1",children:lt.get(C,(s==null?void 0:s.title)||(s==null?void 0:s.source))}),g.jsxs(y.Typography,{variant:"caption",color:"secondary",children:[lt.get(C,"sizeDescription"),r&&a&&" | ",r&&a&&m("ra.attachment.info",{user:a==null?void 0:a.name,created:Pr(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})}const U6=Ae(j.ImageField,{slot:"root"})(()=>({}));function Bb(e){const t=`_${e==null?void 0:e.source}`;return g.jsx(U6,{...e,source:t})}function vb({width:e=150,height:t=150,circle:n=!1,justify:r="flex-start",record:o,...s}){const a=Q.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]),c=j.useRecordContext(),u=o||c;return g.jsx(Bb,{sx:A=>({margin:0,display:"flex",justifyContent:r,"& img":{margin:"0px !important",border:`1px solid ${A.palette.divider}`,objectFit:"cover !important",...a,minWidth:a.width,minHeight:a.height}}),...s,record:u})}var bb={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(In,function(){return function(n,r,o){n=n||{};var s=r.prototype,a={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 c(A,p,h,C){return s.fromToBase(A,p,h,C)}o.en.relativeTime=a,s.fromToBase=function(A,p,h,C,m){for(var I,B,v,S=h.$locale().relativeTime||a,O=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=O.length,R=0;R<x;R+=1){var P=O[R];P.d&&(I=C?o(A).diff(h,P.d,!0):h.diff(A,P.d,!0));var k=(n.rounding||Math.round)(Math.abs(I));if(v=I>0,k<=P.r||!P.r){k<=1&&R>0&&(P=O[R-1]);var F=S[P.l];m&&(k=m(""+k)),B=typeof F=="string"?F.replace("%d",k):F(k,p,P.l,v);break}}if(p)return B;var G=v?S.future:S.past;return typeof G=="function"?G(B):G.replace("%s",B)},s.to=function(A,p){return c(A,p,this,!0)},s.from=function(A,p){return c(A,p,this)};var u=function(A){return A.$u?o.utc():o()};s.toNow=function(A){return this.to(u(this),A)},s.fromNow=function(A){return this.from(u(this),A)}}})})(bb);var Y6=bb.exports;const G6=ro(Y6);var K6={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(In,function(){return{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(n){var r=["th","st","nd","rd"],o=n%100;return"["+n+(r[(o-20)%10]||r[o]||r[0])+"]"}}})})(K6);var q6={exports:{}};(function(e,t){(function(n,r){e.exports=r(yB)})(In,function(n){function r(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var o=r(n),s={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(a){return a+"º"}};return o.default.locale(s,null,!0),s})})(q6);Pr.extend(G6);function yb(e){const t=j.useRecordContext(e),[n]=j.useLocaleState(),r=Q.useMemo(()=>Pr(lt.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return g.jsxs(Q.Fragment,{children:[g.jsx(j.DateField,{record:t,source:e.source,showTime:!0}),g.jsx("br",{}),g.jsx(y.Typography,{variant:"caption",color:"textSecondary",children:r})]})}const J6=Ae(j.DateField,{slot:"Root"})(()=>({}));function X6({variant:e="body1",...t}){return g.jsx(J6,{...t,variant:e})}const Z6=Ae(j.EmailField,{slot:"Root"})(()=>({}));function _6({variant:e="body1",...t}){return g.jsx(Z6,{...t,variant:e})}const $6=Ae(j.FileField,{slot:"root"})(()=>({}));function Qb({...e}){const t=j.useRecordContext(e),n=Q.useCallback(r=>{r.preventDefault(),r.stopPropagation();const o=lt.get(t,`_${e==null?void 0:e.source}`,lt.get(t,e==null?void 0:e.source)),s=lt.get(t,(e==null?void 0:e.title)||(e==null?void 0:e.source))||(e==null?void 0:e.title),a=document.createElement("a");a.href=o,a.download=s,a.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return g.jsx($6,{...e,record:t,onClick:n})}function eL({variant:e="body1",...t}){return g.jsx(j.FunctionField,{...t,variant:e})}const tL=Ae(j.TextField,{slot:"Root"})(()=>({}));function xb({variant:e="body1",...t}){return g.jsx(tL,{...t,variant:e})}function nL(e){const t=y.useTheme(),n=ce.useLocales(),{source:r=""}=e,o=ce.useRecordContext(e),s=o[r],a=!Mf(s,n),c=Er(e,{flex:1}),[u]=ce.useLocaleState(),A=Q.useMemo(()=>a?g.jsx(Ze.FlagFilled,{style:{color:t.palette.warning.main}}):g.jsx(Ze.FlagOutlined,{}),[a]),p=Q.useMemo(()=>g.jsx(y.Stack,{children:te.map(n,(h,C)=>g.jsx(y.Typography,{children:`${h.locale.toUpperCase()}: ${(s??{})[h.locale]??""}`},C))}),[s,n]);return g.jsx(zu,{title:p,arrow:!1,children:g.jsxs(y.Stack,{alignItems:"center",direction:"row",gap:1,children:[A,g.jsx(xb,{...e,source:`${r}.${u}`,sx:c})]})})}const rL=Ae("div")(({theme:e,fullWidth:t})=>({borderBottom:`1px solid ${e.palette.divider}`,paddingTop:e.spacing(1),paddingBottom:e.spacing(1),marginBottom:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:t?"100%":"auto",[e.breakpoints.down("sm")]:{whiteSpace:"normal",overflow:"visible",textOverflow:"inherit"}})),oL=({source:e,defaultValue:t=" ",...n})=>{const r=j.useRecordContext(n),o=lt.get(r,e,t);return g.jsx(y.Typography,{...n,dangerouslySetInnerHTML:{__html:o&&o!==null?o:t}})},iL=({title:e,children:t})=>t==null?null:typeof e=="string"||e===!0?g.jsx(y.Tooltip,{title:e,placement:"top",children:t}):t;function sL({label:e,source:t,defaultValue:n=" ",children:r=g.jsx(oL,{source:"",defaultValue:void 0,record:void 0}),tooltip:o,...s}){const{getCurrentDialog:a}=vi(),c=j.useRecordContext(s),u=j.useResourceContext(s),A=a(),p=Q.useMemo(()=>o===!1?!1:typeof o=="function"?o(c):typeof o=="string"?lt.get(c,o,o):o,[c,o]),h=Er(s,{width:s!=null&&s.fullWidth?"100%":"auto"});return g.jsx(iL,{title:p,children:g.jsxs(Q.Fragment,{children:[g.jsx(y.InputLabel,{sx:{pt:1},children:g.jsx(j.FieldTitle,{label:e,source:t,resource:A||u})}),g.jsx(rL,{...s,children:Q.cloneElement(r,{source:t,record:c,defaultValue:n,resource:A||u,sx:h})})]})})}const aL=function({children:e=null,className:t=""}){return g.jsx("div",{className:t,children:e})},lL=qa(aL,{slot:"root"})(({theme:e,bulkActionButtons:t})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,"&>div:first-of-type":{alignItems:"center","& form":{padding:e.spacing(2.5)},"& .MuiToolbar-root":{alignItems:"center",padding:"0 !important",marginTop:e.spacing(1),[e.breakpoints.up("sm")]:{marginLeft:e.spacing(2),marginRight:e.spacing(2),width:`calc(100% - ${e.spacing(4)})`},[e.breakpoints.down("md")]:{marginTop:0,display:"none",visibility:"hidden"}}},"& .RaDatagrid-root":{overflowX:"auto",paddingTop:t===!1?0:48,[e.breakpoints.down("sm")]:{width:"calc(100vw - 26px)"},"& .RaBulkActionsToolbar-toolbar":{borderRadius:0,"& > .RaBulkActionsToolbar-title":{alignItems:"center"},[e.breakpoints.down("sm")]:{paddingLeft:e.spacing(3)}},"& .RaDatagrid-table":{borderBottom:`1px solid ${e.palette.divider}`}},"& .MuiTablePagination-toolbar":{marginTop:"0 !important",marginBottom:"0 !important"},"& .RaBulkActionsToolbar-collapsed.RaBulkActionsToolbar-toolbar":{minHeight:0}}));function wb(e){return g.jsx(lL,{...e,children:g.jsx(j.ReferenceManyField,{pagination:g.jsx(j.Pagination,{}),...e})})}function cL({source:e,...t}){const n=j.useRecordContext(t),r=lt.get(n,e,0),o=r/1024,s=o/1024,a=s/1024,c=a>1?`${a.toFixed(2)} GB`:s>1?`${s.toFixed(2)} MB`:o>1?`${o.toFixed(2)} KB`:`${r.toFixed(2)} B`;return g.jsx(y.Typography,{component:"span",variant:"body1",...t,children:c})}function un({label:e,children:t,display:n="label",helperText:r,sx:o,addLabel:s,divider:a=!1,...c}){const u=bt(),{getCurrentDialog:A}=vi(),{source:p,resource:h,isRequired:C}=c,{fieldState:{invalid:m}}=j.useInput(c),I=A();return g.jsxs(y.Stack,{spacing:1,sx:{width:c!=null&&c.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:m?u.palette.error.main:u.palette.text.secondary,"& span":{display:"none"}},...o},children:[n==="label"&&e!==!1&&s!==!1&&g.jsx(y.InputLabel,{error:m===!0,sx:{borderBottom:a?`1px solid ${u.palette.divider}`:"none",pt:.5,pb:a?1:0,mt:a?1:0},children:g.jsx(j.FieldTitle,{label:e,source:p,resource:I||h,isRequired:C})}),Q.isValidElement(t)?Q.cloneElement(t,{...t.props,...c,label:n==="legend"?e:!1}):t,n==="label"&&r&&g.jsx(y.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:m===!0,children:r})]})}const uL=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},AL=Ae(j.FileInput,{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}},...uL(e)}));function dL({children:e=g.jsx(Ib,{title:"name",source:"path"}),multiple:t=!0,disabled:n=!1,type:r="attachment",...o}){const s=j.useRecordContext(o),a=o==null?void 0:o.source,c=s==null?void 0:s.id;return j.useInput({source:`__${r}__${o==null?void 0:o.source}`,defaultValue:o==null?void 0:o.source}),g.jsx(un,{...o,disabled:n,children:g.jsx(AL,{type:r,multiple:t,disabled:n,children:Q.cloneElement(e,{...e.props,entityId:c,property:a})})})}const gL=Ae(j.AutocompleteArrayInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"}}));function fL({size:e="small",...t}){return g.jsx(un,{...t,children:g.jsx(gL,{size:e})})}const pL=Ae(j.AutocompleteInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},"& .MuiOutlinedInput-root.MuiInputBase-sizeSmall":{paddingTop:"4px"}}));function hL({size:e="small",...t}){const{perPage:n,...r}=t;return g.jsx(un,{...r,children:g.jsx(pL,{size:e})})}const CL=Ae(j.BooleanInput,{slot:"Root"})(()=>({marginTop:"0 !important"}));function mL({...e}){const t=qt.useTheme();return g.jsx(un,{...e,children:g.jsx(CL,{sx:{"& .MuiFormControlLabel-root":{marginLeft:"0 !important",marginRight:"0 !important"},"& .MuiSwitch-root":{margin:"0 !important",marginTop:e.display==="legend"?0:`${t.spacing(1)} !important`}}})})}const EL=Ae(j.DateInput,{slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}}));function IL(e){return g.jsx(un,{...e,children:g.jsx(EL,{})})}const BL=Ae(j.DateTimeInput,{slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}}));function vL(e){return g.jsx(un,{...e,children:g.jsx(BL,{})})}const bL=Ae(j.FileInput,{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}}}));function yL({children:e=g.jsx(Qb,{source:"",title:""}),title:t,...n}){const r=Ii.useWatch({name:n.source}),o=j.useRecordContext(n),{source:s}=n,a=Q.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const c=lt.get(o,s);if(c){const u=c.split("__");return u.length>0?u[u.length-1]:c}return c},[o,s,r]);return g.jsx(un,{...n,children:g.jsx(bL,{children:Q.cloneElement(e,{...e.props,title:t||s,source:s,record:{...o,[s]:(r==null?void 0:r.title)||lt.get(o,s),[`_${s}`]:(r==null?void 0:r.src)||lt.get(o,`_${s}`),[t||s]:a}})})})}function QL({children:e=g.jsx(vb,{}),title:t,multiple:n=!1,...r}){const o=Ii.useWatch({name:r.source}),s=j.useRecordContext(r),{source:a}=r;return j.useInput({source:`__image__${r==null?void 0:r.source}`,defaultValue:r==null?void 0:r.source}),g.jsx(un,{...r,multiple:n,children:g.jsx(j.ImageInput,{accept:"image/*",children:Q.cloneElement(e,{...e.props,title:t,source:a,record:{...s,[a]:(o==null?void 0:o.title)||lt.get(s,a),[`_${a}`]:(o==null?void 0:o.src)||lt.get(s,`_${a}`)}})})})}function Cr(e){return g.jsx(un,{...e,children:g.jsx(j.TextInput,{})})}const xL={vertical:"bottom",horizontal:"right"},wL={vertical:"top",horizontal:"right"};function TL(e){const{source:t}=e,{fieldState:n}=ce.useInput(e),r=Ii.useWatch({name:t}),{error:o}=n,s=ce.useLocales(),a=!Mf(r,s),[c]=ce.useLocaleState(),[u,A]=Q.useState(c),[p,h]=Q.useState(null),C=!!p,m=Q.useCallback(v=>h(C?null:v.currentTarget),[C,h]),I=Q.useCallback(()=>h(null),[h]),B=Q.useMemo(()=>te.map(s,(v,S)=>g.jsx(y.MenuItem,{onClick:()=>{A(v.locale),I()},children:g.jsx(y.ListItemText,{primary:`${v.locale.toUpperCase()}: ${(r??{})[v.locale]??""}`})},S)),[s,A,I,r]);return g.jsx(un,{...e,helperText:o==null?void 0:o.message,children:g.jsxs(y.Box,{flex:1,children:[te.map(s,(v,S)=>g.jsx(Cr,{...e,source:`${t}.${v.locale}`,sx:{width:"100%",display:v.locale===u?"inline-flex":"none"},label:!1,InputProps:{endAdornment:g.jsx(y.Chip,{label:g.jsx(y.Typography,{variant:"button",children:u}),size:"small",onClick:m,color:a?"warning":void 0})}},S)),g.jsx(y.Menu,{anchorEl:p,open:C,anchorOrigin:xL,transformOrigin:wL,onClose:I,children:B})]})})}const SL=Ae(j.NumberInput,{slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}}));function PL(e){return g.jsx(un,{...e,children:g.jsx(SL,{})})}function RL({source:e,minWidth:t=300,children:n}){const r=j.useResourceContext(),o=j.useRecordContext(),[s,a]=Q.useState(lt.get(o,e,"")),[c,u]=Q.useState(!1),A=Q.useCallback(I=>a(I.target.value),[]),p=j.useDataProvider(),h=Q.useCallback(I=>{I.key==="Enter"&&(u(!0),p.update(r,{id:o.id,data:{...o,[e]:s,_changed:e},previousData:o}).then(()=>u(!1)))},[s,p,r,o,e]),C=Q.useCallback(()=>{lt.get(o,e)!==s&&(u(!0),p.update(r,{id:o.id,data:{...o,[e]:s,_changed:e},previousData:o}).then(()=>u(!1)))},[s,p,r,e,o]),m=Q.useCallback(I=>{u(!0),p.update(r,{id:o.id,data:{...o,[e]:I,_changed:e},previousData:o}).then(()=>u(!1))},[p,r,e,o]);return Q.useEffect(()=>a(lt.get(o,e)),[o,e]),n?Q.cloneElement(n,{...n.props,source:e,value:s,onChange:m}):g.jsx(y.TextField,{value:s,disabled:c,onChange:A,onKeyPress:h,onBlur:C,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})}function OL({children:e,...t}){return g.jsx(j.ReferenceArrayInput,{...t,children:Q.cloneElement(e,{...t,source:e.props.source||t.source})})}function jL({children:e,...t}){return g.jsx(j.ReferenceInput,{...t,children:Q.cloneElement(e,{...t,source:e.props.source||t.source})})}function DL({reference:e,target:t,children:n,filters:r,actions:o,...s}){return g.jsx(j.ResourceContextProvider,{value:e,children:g.jsx(wb,{perPage:5,pagination:g.jsx(j.Pagination,{}),...s,reference:e,target:t,children:g.jsxs(Q.Fragment,{children:[g.jsx(j.ListToolbar,{filters:r,actions:o}),n]})})})}const ML=Ae(j.SearchInput,{slot:"root"})(()=>({}));function kL(e){return g.jsx(ML,{...e})}const FL=Ae(j.SelectArrayInput,{slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .RaSelectArrayInput-chips > .RaSelectArrayInput-chip":{marginTop:"-2px",marginBottom:"-2px"}}));function LL({optionText:e="name",optionValue:t="id",...n}){return g.jsx(un,{...n,children:g.jsx(FL,{optionText:e,optionValue:t,options:{autoWidth:!1}})})}const NL=Ae(j.SelectInput,{slot:"Root"})(({label:e})=>({"& legend":{width:e===!1||e===null?0:"auto"}}));function VL(e){return g.jsx(un,{...e,children:g.jsx(NL,{})})}function HL({multiline:e=!1,...t}){var u,A;const n=j.useTranslate(),r=j.maxLength(t==null?void 0:t.maxLength,"app.input.max_length_error"),o=(A=(u=Ii.useController({name:t==null?void 0:t.source}))==null?void 0:u.field)==null?void 0:A.value;let s=t.helperText,a=t.validate;a?Array.isArray(a)&&a.indexOf(r)===-1&&a.push(r):a=[r];const c=n("app.input.max_length_info",{count:(o==null?void 0:o.length)||0,max:t==null?void 0:t.maxLength});return t!=null&&t.maxLength&&(s=s&&s.length>0?`${c} - ${n(s)}`:c),g.jsx(Cr,{...t,validate:a,helperText:s,multiline:e,inputProps:{maxLength:t==null?void 0:t.maxLength}})}function zL(e){if(!e)return"";const t=QB(e);return t?t.format("HH:mm"):""}function WL(e){return e}const UL=Ae(j.TimeInput,{slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}}));function YL({parse:e=WL,format:t=zL,...n}){return g.jsx(un,{...n,children:g.jsx(UL,{parse:e,format:t,...n})})}function fp({onSuccess:e,firstAccess:t}){const{spacing:n}=Qn(),[r,o]=Q.useState(!1),s=ce.useAuthProvider(),a=ce.useTranslate(),c=ce.useNotify(),u=Q.useCallback(A=>{const{oldPassword:p,newPassword:h}=A;o(!0),s==null||s.changePassword(p,h).then(()=>{c("ra.auth.password_changed"),e()}).catch(C=>{c((C==null?void 0:C.message)||(C==null?void 0:C.toString()),{type:"error"})}).finally(()=>o(!1))},[s,e]);return g.jsx(ce.ResourceContextProvider,{value:"user/change-password",children:g.jsx(ce.EditContextProvider,{value:{record:{},resource:"user/change-password",save:u},children:g.jsx(mb,{onSubmit:u,toolbar:g.jsx(wi,{children:g.jsx(j.SaveButton,{disabled:r})}),children:g.jsxs(y.Grid,{container:!0,spacing:n,children:[t===!0&&g.jsx(y.Grid,{item:!0,xs:12,children:g.jsxs(y.Alert,{severity:"warning",children:[g.jsx(y.AlertTitle,{children:a("ra.auth.first_access.change_password")}),a("ra.auth.first_access.change_password_helper")]})}),g.jsx(y.Grid,{item:!0,xs:12,children:g.jsx(Cr,{source:"oldPassword",type:"password",validate:ce.required()})}),g.jsx(y.Grid,{item:!0,xs:12,children:g.jsx(Cr,{source:"newPassword",type:"password",validate:ce.required()})})]})})})})}const Tb=Q.createContext({});function GL(e){const{useDefaults:t=!1,queryOptions:n={}}=e,r=j.useResourceContext(),o=j.useDataProvider(),{search:s}=hs.useLocation(),a=`${r}/new`,c=Q.useCallback(()=>{if(!t||!te.isFunction(o.get))return Promise.resolve({});const C={};return new URLSearchParams(s??"").forEach((m,I)=>{C[I]=m}),o.get(a,C).then(m=>m.data).then(m=>{const{responseCode:I,value:B}=m;return I==="ok"?B:Promise.reject(m)})},[r,t,s,o]),u=Q.useMemo(()=>te.chain(n).extend({queryKey:[r,s],queryFn:c}).value(),[r,s,c,n]),{data:A,isLoading:p}=As.useQuery(u),h=te.omit(e,["useDefaults"]);return p?g.jsx(y.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:g.jsx(y.CircularProgress,{})}):g.jsx(Tb.Provider,{value:A??{},children:g.jsx(j.Create,{...h})})}function KL(){return Q.useContext(Tb)}const qL=Ae(GL,{slot:"root"})(({theme:e})=>({"& .RaCreate-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaCreate-main":{marginTop:0},"& .RaCreate-main>.MuiPaper-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaToolbar-mobileToolbar":{position:"initial !important",paddingLeft:"20px !important",paddingRight:"20px !important",paddingTop:"0 !important"},"& .RaCreate-main:has(.LongFormView)>.MuiPaper-root:first-of-type":{overflow:"visible"},"& .RaCreate-main:has(.tabbed-form) .MuiTableContainer-root":{width:"inherit"}})),JL=Ae(j.Edit,{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":{position:"initial !important",paddingLeft:"20px !important",paddingRight:"20px !important",paddingTop:"0 !important"},"& .RaEdit-main":{marginTop:0},"& .RaEdit-main>.MuiPaper-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaEdit-main:has(.LongFormView)>.MuiPaper-root:first-of-type":{overflow:"visible"},"& .RaEdit-main:has(.tabbed-form) .MuiTableContainer-root":{width:"inherit"}}));function XL(e){return g.jsx(JL,{...e})}const ZL=Ae(y.CardHeader)(({theme:e})=>({marginTop:e.spacing(2.5),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),_L=Ae(y.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`}));function $L({title:e,divider:t=!0,variant:n="h5"}){const r=j.useTranslate();return g.jsxs(Q.Fragment,{children:[g.jsx(ZL,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&g.jsx(_L,{})]})}const e9=Ae(y.Grid,{name:"LongFormView",slot:"Root"})(({theme:e})=>({"& .MuiToolbar-root.RaToolbar-desktopToolbar":{position:"initial",marginLeft:`-${e.spacing(3)}`,marginRight:`-${e.spacing(3)}`,marginBottom:`-${e.spacing(2)}`,paddingTop:e.spacing(2.5),paddingBottom:e.spacing(2.5),[e.breakpoints.down("sm")]:{position:"initial !important",width:"auto !important",marginRight:0}},"& .RaToolbar-mobileToolbar":{position:"initial !important",paddingTop:"20px !important",paddingLeft:"0 !important",paddingRight:"0 !important",paddingBottom:"0 !important"},"& form > .MuiToolbar-root":{margin:0,marginRight:`-${e.spacing(.5)}`,[e.breakpoints.down("sm")]:{marginRight:e.spacing(.5)}}}));function Sb(e){const{spacing:t}=Qn(),{spacing:n=t}=e,r=te.omit(e,["spacing"]);return g.jsx(j.Form,{...r,className:"LongFormView",children:g.jsx(e9,{container:!0,spacing:n*2,children:e.children})})}function Pb(e){const{disposition:t={xl:9,lg:9,md:8,sm:8,xs:12}}=e,n=te.omit(e,["disposition"]);return g.jsx(y.Grid,{...n,item:!0,...t,children:e.children})}function Wg(e){return e.id??e.label}function Rb(e,t){const n=`^${e}.`.replaceAll(".","\\."),r=new RegExp(n,"g");return t.match(r)!==null}function t9(e){return te.map(e,"id")}function tu(e){const t=e.match(new RegExp("[^.]+","g"));return t===null?0:t.length}function Ob(e,t){const n=e!==void 0?tu(e):0;return te.chain(t).filter(o=>e!==void 0?Rb(e,o.id):!0).filter(o=>tu(o.id)===n+1).value()}function n9(e,t){var s;const n=te.clone(e),{type:r,payload:o}=t;switch(r){case"setFormRootPath":return te.extend(n,{formRootPath:o});case"setSyncWithLocation":return te.extend(n,{syncWithLocation:o});case"setErrorCount":return te.extend(n,{errorCount:o});case"setActiveItem":return te.includes(t9(e.items),o)?te.extend(n,{activeItem:o}):n;case"addItem":{const{id:a}=o;return te.extend(n,{items:te.chain(n.items).clone().reject(c=>c.id===a).concat([o]).orderBy(c=>c.index).value()})}case"removeItem":{const a=te.isString(o)?o:o.id,c=te.chain(n.items).clone().reject(u=>u.id===a).value();return te.extend(n,{items:c}),n.activeItem===a&&te.extend(n,{activeItem:((s=te.first(c))==null?void 0:s.id)??void 0}),n}default:return n}}const r9={syncWithLocation:!0,errorCount:!0,items:[],activeItem:void 0},jb=Q.createContext(void 0);function Db(e){const t=!!(e.syncWithLocation??!0),n=!!(e.errorCount??!0),{rootMatchString:r}=e,{pathname:o}=hs.useLocation(),[s,a]=Q.useReducer(n9,te.cloneDeep(r9)),{formRootPath:c,items:u}=s,A=Q.useMemo(()=>({state:s,dispatch:a}),[s,a]);return Q.useEffect(()=>{const p=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/show/*",":resource/:id/show/*","entities/:resource/:id/*",":resource/:id/*"];r!==void 0&&p.push(r);const h=te.chain(p).map(m=>hs.matchPath(m,o)).reject(m=>m===null).first().value(),C=h==null?void 0:h.pathnameBase;C!==void 0&&C!==c&&a({type:"setFormRootPath",payload:C})},[o,c,r]),Q.useEffect(()=>{a({type:"setSyncWithLocation",payload:!!t})},[t,a]),Q.useEffect(()=>{a({type:"setErrorCount",payload:!!n})},[n,a]),Q.useEffect(()=>{var p;if(t&&c!==void 0){let h=o.replace(c,"").replace(new RegExp(/^\/?/),"");te.isEmpty(h)&&(h=((p=te.chain(u).filter(C=>Ob(C.id,u).length===0).orderBy([C=>tu(C.id),C=>C.index]).first().value())==null?void 0:p.id)??void 0),a({type:"setActiveItem",payload:h})}},[a,c,o,u]),g.jsx(jb.Provider,{value:A,children:e.children})}function Mb(){const e=Q.useContext(jb);if(e===void 0)throw new Error("[LongForm] useFormContext: context undefined. Please provide a valid Context using LongForm.Provider");return e}function el(){return Mb().state}function pp(){return Mb().dispatch}function kb(){return el().formRootPath}function Fb(){return el().activeItem}function Lb(){return el().items}function Nb(){return el().syncWithLocation}function Vb(){return el().errorCount}function Hb(){const e=pp();return Q.useCallback(n=>{e({type:"setActiveItem",payload:n})},[e])}function zb(){const e=pp();return Q.useCallback(n=>{e({type:"addItem",payload:n})},[e])}function Wb(){const e=pp();return Q.useCallback(n=>{e({type:"removeItem",payload:n})},[e])}function Ub(e){const t=Fb();return t===void 0?!1:e===t||Rb(e,t)}function Yb(e){const t=Lb();return Q.useMemo(()=>Ob(e,t),[t,e])}function o9(){const e=kb(),{search:t}=hs.useLocation(),n=hs.useNavigate();return Q.useCallback(o=>{n(`${e}/${o}${t}`)},[e,n])}function Gb(){const e=Yb();return g.jsx(y.Card,{variant:"outlined",children:g.jsx(y.List,{sx:{"& .MuiListItemButton-root.Mui-selected":{borderColor:"palette.primary.main",borderRightStyle:"solid",borderRightWidth:2},"& .MuiListItemAvatar-root":{minWidth:24}},children:te.map(e,(t,n)=>g.jsx(hp,{...t},n))})})}function hp(e){const t=ce.useTranslate()??te.identity,n=Kb(e),{selected:r,label:o,icon:s,onClick:a,badge:c,items:u,isGroup:A,level:p,errors:h=0}=n,{spacing:C}=Qn(),[m,I]=Q.useState(r),B=Q.useCallback(O=>{I(!m),a(O)},[a,m]),v=s!==void 0,S=te.omit(e,["label","icon","selected","badge"]);return Q.useEffect(()=>{r&&!m&&I(r)},[r,m,I]),g.jsxs(g.Fragment,{children:[g.jsx(y.ListItem,{...S,disablePadding:!0,children:g.jsxs(y.ListItemButton,{selected:r&&!A,onClick:B,sx:{pl:C*p},children:[v&&g.jsx(y.ListItemIcon,{children:s}),g.jsx(y.ListItemText,{inset:!v,primary:h===0?t(o):g.jsx(y.Badge,{variant:"dot",color:"error",sx:{"& > .MuiBadge-badge":{transform:"scale(1) translate(125%, 0)"}},children:t(o)})}),c&&g.jsx(y.ListItemAvatar,{children:g.jsx(ka,{type:"filled",size:"xs",color:c.color??"default",children:c.content})}),A&&(m?g.jsx(rr.ExpandLess,{}):g.jsx(rr.ExpandMore,{}))]})}),A&&g.jsx(y.Collapse,{in:m,timeout:"auto",children:g.jsx(y.List,{children:te.map(u,(O,x)=>g.jsx(hp,{...O},x))})})]})}function Kb(e){const{id:t}=e,n=Ub(t),r=tu(t),o=o9(),s=Nb(),a=Hb(),c=Yb(t),u=!te.isEmpty(c),A=Q.useCallback(h=>{u||(s?o(e.id):a(e.id)),te.isFunction(e.onClick)&&e.onClick(h)},[a,o,e,s,u]);return Q.useMemo(()=>({...e,selected:n,onClick:A,items:c,isGroup:u,level:r}),[e,n,A,c,u])}var i9=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},qb=e=>e.firstChild?e.firstChild.offsetParent===e:!0,s9=(e,t)=>{let n=e,r=0;qb(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},a9=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},Fa=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?Fa="sticky":CSS.supports("position","-webkit-sticky")&&(Fa="-webkit-sticky"));var nu=!1;try{const e=Object.defineProperty({},"passive",{get(){nu={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var Xd=e=>{const{el:t,onChange:n,unsubs:r,measure:o}=e;if(t===window){const s=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),a=o(s()),c=()=>{Object.assign(a,o(s())),n()};return window.addEventListener("resize",c,nu),r.push(()=>window.removeEventListener("resize",c)),a}else{const s=o(t.getBoundingClientRect()),a=()=>{Object.assign(s,o(t.getBoundingClientRect())),n()},c=new ResizeObserver(a);return c.observe(t),r.push(()=>c.disconnect()),s}},l9=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}},c9=(e,t,n)=>{const{bottom:r,offsetBottom:o,offsetTop:s}=n,a=i9(e);let c=!1;const u=()=>{c||requestAnimationFrame(()=>{const F=h();F!==x&&R(F),c=!1}),c=!0};let A=a===window?window.scrollY:a.scrollTop;const p=F=>{const{offsetTop:G,height:K}=m,{naturalTop:$}=v,{height:Y}=S;return F+G+K>=$+Y+O+o},h=()=>{const{height:F}=m,{height:G}=S;return G+s+o<=F?3:p(A)?1:2},C=a!==window&&qb(a),m=Xd({el:a,onChange:u,unsubs:t,measure:({height:F,top:G})=>({height:F,offsetTop:C?G:0})}),I=a9(e),B=I===window?{top:0,bottom:0}:l9(I),v=Xd({el:I,onChange:u,unsubs:t,measure:({height:F})=>({height:F-B.top-B.bottom,naturalTop:I===window?0:s9(I,a)+B.top+m.offsetTop})}),S=Xd({el:e,onChange:u,unsubs:t,measure:({height:F})=>({height:F})});let O=0,x=h();const R=F=>{const G=x;if(x=F,G===2&&(O=-1),F===3){e.style.position=Fa,r?e.style.bottom=`${o}px`:e.style.top=`${s}px`;return}const{height:K,offsetTop:$}=m,{height:Y,naturalTop:ie}=v,{height:se}=S;if(F===2)if(e.style.position="relative",O=G===0?Math.max(0,$+A-ie+s):Math.max(0,$+A+K-(ie+se+o)),r){const X=Math.max(0,Y-se-O);e.style.bottom=`${X}px`}else e.style.top=`${O}px`;else e.style.position=Fa,F===1?r?e.style.bottom=`${o}px`:e.style.top=`${K-se-o}px`:r?e.style.bottom=`${K-se-o}px`:e.style.top=`${s}px`};R(x);const P=F=>{if(F===A)return;const G=F-A;if(A=F,x===3)return;const{offsetTop:K,height:$}=m,{naturalTop:Y,height:ie}=v,{height:se}=S;if(G>0)if(x===0){if(F+K+s>Y){const X=Math.max(0,K+A-Y+s);F+K+$<=Y+se+X+o?R(2):R(1)}}else x===2&&p(F)&&R(1);else if(x===1){if(K+F+$<Y+ie+o){const X=Math.max(0,K+A+$-(Y+se+o));K+F+s>=Y+X?R(2):R(0)}}else x===2&&K+F+s<Y+O&&R(0)},k=a===window?()=>P(window.scrollY):()=>P(a.scrollTop);a.addEventListener("scroll",k,nu),a.addEventListener("mousewheel",k,nu),t.push(()=>a.removeEventListener("scroll",k),()=>a.removeEventListener("mousewheel",k))},u9=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,o]=Q.useState(null);return Q.useEffect(()=>{if(!r||!Fa)return;const s=[];return c9(r,s,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{s.forEach(a=>a())}},[r,t,e,n]),o},A9=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:o,className:s,style:a}=e,c=u9({offsetTop:t,offsetBottom:n,bottom:r});return g.jsx("div",{className:s,style:a,ref:c,children:o})},d9=A9,Jb=(e=>(e.TOP="top",e.BOTTOM="bottom",e))(Jb||{});function Xb(e){const{sticky:t=!0,disposition:n={xl:3,lg:3,md:4,sm:4,xs:12},spacing:r=2}=e,o=te.omit(e,["sticky","disposition","spacing"]),s=t?d9:y.Box,a=Q.useMemo(()=>t?{offsetTop:74,offsetBottom:r*2}:{},[t,r]);return g.jsx(y.Grid,{...o,item:!0,...n,children:g.jsx(s,{...a,children:g.jsx(y.Stack,{spacing:r,children:e.children})})})}function Zb(e){return g.jsx(g.Fragment,{children:e.children})}function _b(e){const{children:t}=e;return Q.useMemo(()=>{const r={top:[],bottom:[]};return Q.Children.forEach(t,o=>{if(Q.isValidElement(o)&&(o==null?void 0:o.type)===Zb){const{position:s}=o.props;switch(s){case"top":r.top.push(o);break;case"bottom":r.bottom.push(o);break}}}),r},[t])}function $b(e=[],t){const n=te.isArray(e)?e:[e],r=te.filter(n,o=>Q.isValidElement(o));te.each(r,o=>{var s;t(o),$b(((s=o==null?void 0:o.props)==null?void 0:s.children)??[],t)})}function ey(e){const{errors:t}=Ii.useFormState(),n=Vb(),{label:r,icon:o,badge:s,index:a=0,children:c}=e,u=Wg(e),A=zb(),p=Wb(),h=Ub(u),C=[];n&&(e.sources!==void 0?C.push(...e.sources):$b(c,I=>{var B;((B=I==null?void 0:I.props)==null?void 0:B.source)!==void 0&&C.push(I.props.source)}));const m=te.chain(C).uniq().map(I=>te.get(t,I)).reject(I=>I===void 0).value().length;return Q.useEffect(()=>{A({id:u,index:a,label:r,icon:o,badge:s,errors:m})},[A,p,r,o,u,s,a,m]),Q.useEffect(()=>()=>{p(u)},[u]),g.jsx(y.Box,{display:h?"unset":"none",children:e.children})}function ty(e){const t=Cp(e),n=Wg(e);return g.jsx(ey,{...e,id:n,children:Q.Children.map(t,r=>{const o=Wg(r.props);return Q.cloneElement(r,{id:`${n}.${o}`})})})}function ny(e){return g.jsx(ey,{...e})}function Cp(e){const{children:t}=e;return Q.useMemo(()=>te.chain(Q.Children.toArray(t)).filter(r=>Q.isValidElement(r)&&((r==null?void 0:r.type)===ny||(r==null?void 0:r.type)===ty)).map((r,o)=>Q.cloneElement(r,{index:o})).value(),[t])}function g9(e){const{tabsDisposition:t,contentDisposition:n,spacing:r=2}=e,o=te.pick(e,["syncWithLocation","errorCount"]),s=te.omit(e,["tabsDisposition","contentDisposition","syncWithLocation"]),{top:a,bottom:c}=_b(e),u=Cp(e);return g.jsx(Db,{...o,children:g.jsxs(Sb,{...s,spacing:r,children:[g.jsxs(Xb,{disposition:t,spacing:r,children:[a,g.jsx(Gb,{}),c]}),g.jsx(Pb,{disposition:n,children:u})]})})}const Rt=g9;Rt.BaseForm=Sb;Rt.Content=Pb;Rt.Provider=Db;Rt.useItems=Lb;Rt.useSyncWithLocation=Nb;Rt.useErrorCount=Vb;Rt.useFormRootPath=kb;Rt.useActiveItem=Fb;Rt.useSetActiveItem=Hb;Rt.useAddItem=zb;Rt.useRemoveItem=Wb;Rt.Sidebar=Xb;Rt.SidebarSection=Zb;Rt.SidebarSectionPosition=Jb;Rt.useSidebarChildren=_b;Rt.NavMenu=Gb;Rt.NavMenuItem=hp;Rt.useNavMenuItem=Kb;Rt.Tab=ny;Rt.Group=ty;Rt.useBaseItemChildren=Cp;const f9=Ae(j.Show,{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"}}));function p9(e){return g.jsx(f9,{...e})}const h9=Ae(j.SimpleFormIterator,{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}}}));function C9(e){return g.jsx(h9,{...e})}const m9=qa(j.TabbedForm,{slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:1)},[e.breakpoints.down("sm")]:{paddingBottom:0,"& .MuiTableContainer-root":{paddingBottom:e.spacing(1)}}}));function E9({children:e}){return g.jsx(g.Fragment,{children:e})}function mp(e){const{title:t,modal:n,content:r,subheader:o,secondary:s=g.jsx(Bi,{children:g.jsx(j.DeleteWithConfirmButton,{})}),sx:a,noPadding:c,toolbar:u=g.jsx(wi,{children:g.jsx(j.SaveButton,{type:"button"})}),...A}=e,p=Df(t);return g.jsx(er,{title:p,modal:n,content:r,subheader:o,secondary:s,sx:{...a,"& .MuiTabs-root":{m:2.5,mb:0},"& .tabbed-form .MuiDivider-root":{ml:2.5,mr:2.5},"& .MuiToolbar-root.RaToolbar-desktopToolbar":{position:"initial",paddingTop:0},"& .MuiToolbar-root":{padding:2.5}},border:!n,divider:!0,children:g.jsx(m9,{toolbar:u,component:c?E9:void 0,...A})})}function I9({children:e,...t}){return g.jsx(j.TabbedForm.Tab,{...t,children:g.jsx(y.Box,{sx:{width:"100%",p:2.5},children:e})})}mp.Tab=j.TabbedForm.Tab;mp.TabStack=I9;const ry=M.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:o=!1,index:s,member:a,resource:c}=e,u=j.useTranslate(),[A,p]=M.useState(!1),{total:h,remove:C}=vB(),m=M.useCallback(()=>{p(!1),C(s)},[s,C]),I=Q.useMemo(()=>({index:s,total:h,remove:()=>C(s)}),[s,h,C]);return g.jsxs(xf.Provider,{value:I,children:[Q.Children.map(n,(B,v)=>{if(!Q.isValidElement(B))return null;const{source:S,...O}=B.props;return g.jsx(y.TableCell,{children:Q.cloneElement(B,{source:S?`${a}.${S}`:a,index:S?void 0:v,resource:c,disabled:r,...O,label:""})})}),!o&&g.jsx(y.TableCell,{children:g.jsx(y.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:g.jsx(Bi,{horizontal:!0,children:g.jsx(y.Typography,{color:"error",onClick:()=>p(!0),children:u("ra.action.delete")})})})}),n.length>0&&g.jsx(j.Confirm,{isOpen:A,title:u("ra.action.remove_item"),content:u("ra.message.remove_item"),onConfirm:m,onClose:()=>p(!1)})]})});var B9=Array.isArray,Wu=B9,v9=typeof In=="object"&&In&&In.Object===Object&&In,b9=v9,y9=b9,Q9=typeof self=="object"&&self&&self.Object===Object&&self,x9=y9||Q9||Function("return this")(),Uu=x9,w9=Uu,T9=w9.Symbol,Yu=T9,BI=Yu,oy=Object.prototype,S9=oy.hasOwnProperty,P9=oy.toString,ua=BI?BI.toStringTag:void 0;function R9(e){var t=S9.call(e,ua),n=e[ua];try{e[ua]=void 0;var r=!0}catch{}var o=P9.call(e);return r&&(t?e[ua]=n:delete e[ua]),o}var O9=R9,j9=Object.prototype,D9=j9.toString;function M9(e){return D9.call(e)}var k9=M9,vI=Yu,F9=O9,L9=k9,N9="[object Null]",V9="[object Undefined]",bI=vI?vI.toStringTag:void 0;function H9(e){return e==null?e===void 0?V9:N9:bI&&bI in Object(e)?F9(e):L9(e)}var Ep=H9;function z9(e){return e!=null&&typeof e=="object"}var Gu=z9,W9=Ep,U9=Gu,Y9="[object Symbol]";function G9(e){return typeof e=="symbol"||U9(e)&&W9(e)==Y9}var Ip=G9,K9=Wu,q9=Ip,J9=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X9=/^\w*$/;function Z9(e,t){if(K9(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||q9(e)?!0:X9.test(e)||!J9.test(e)||t!=null&&e in Object(t)}var _9=Z9;function $9(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var iy=$9,eN=Ep,tN=iy,nN="[object AsyncFunction]",rN="[object Function]",oN="[object GeneratorFunction]",iN="[object Proxy]";function sN(e){if(!tN(e))return!1;var t=eN(e);return t==rN||t==oN||t==nN||t==iN}var sy=sN,aN=Uu,lN=aN["__core-js_shared__"],cN=lN,Zd=cN,yI=function(){var e=/[^.]+$/.exec(Zd&&Zd.keys&&Zd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function uN(e){return!!yI&&yI in e}var AN=uN,dN=Function.prototype,gN=dN.toString;function fN(e){if(e!=null){try{return gN.call(e)}catch{}try{return e+""}catch{}}return""}var pN=fN,hN=sy,CN=AN,mN=iy,EN=pN,IN=/[\\^$.*+?()[\]{}|]/g,BN=/^\[object .+?Constructor\]$/,vN=Function.prototype,bN=Object.prototype,yN=vN.toString,QN=bN.hasOwnProperty,xN=RegExp("^"+yN.call(QN).replace(IN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wN(e){if(!mN(e)||CN(e))return!1;var t=hN(e)?xN:BN;return t.test(EN(e))}var TN=wN;function SN(e,t){return e==null?void 0:e[t]}var PN=SN,RN=TN,ON=PN;function jN(e,t){var n=ON(e,t);return RN(n)?n:void 0}var Ku=jN,DN=Ku,MN=DN(Object,"create"),qu=MN,QI=qu;function kN(){this.__data__=QI?QI(null):{},this.size=0}var FN=kN;function LN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var NN=LN,VN=qu,HN="__lodash_hash_undefined__",zN=Object.prototype,WN=zN.hasOwnProperty;function UN(e){var t=this.__data__;if(VN){var n=t[e];return n===HN?void 0:n}return WN.call(t,e)?t[e]:void 0}var YN=UN,GN=qu,KN=Object.prototype,qN=KN.hasOwnProperty;function JN(e){var t=this.__data__;return GN?t[e]!==void 0:qN.call(t,e)}var XN=JN,ZN=qu,_N="__lodash_hash_undefined__";function $N(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ZN&&t===void 0?_N:t,this}var e7=$N,t7=FN,n7=NN,r7=YN,o7=XN,i7=e7;function Os(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])}}Os.prototype.clear=t7;Os.prototype.delete=n7;Os.prototype.get=r7;Os.prototype.has=o7;Os.prototype.set=i7;var s7=Os;function a7(){this.__data__=[],this.size=0}var l7=a7;function c7(e,t){return e===t||e!==e&&t!==t}var u7=c7,A7=u7;function d7(e,t){for(var n=e.length;n--;)if(A7(e[n][0],t))return n;return-1}var Ju=d7,g7=Ju,f7=Array.prototype,p7=f7.splice;function h7(e){var t=this.__data__,n=g7(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():p7.call(t,n,1),--this.size,!0}var C7=h7,m7=Ju;function E7(e){var t=this.__data__,n=m7(t,e);return n<0?void 0:t[n][1]}var I7=E7,B7=Ju;function v7(e){return B7(this.__data__,e)>-1}var b7=v7,y7=Ju;function Q7(e,t){var n=this.__data__,r=y7(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var x7=Q7,w7=l7,T7=C7,S7=I7,P7=b7,R7=x7;function js(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])}}js.prototype.clear=w7;js.prototype.delete=T7;js.prototype.get=S7;js.prototype.has=P7;js.prototype.set=R7;var O7=js,j7=Ku,D7=Uu,M7=j7(D7,"Map"),k7=M7,xI=s7,F7=O7,L7=k7;function N7(){this.size=0,this.__data__={hash:new xI,map:new(L7||F7),string:new xI}}var V7=N7;function H7(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var z7=H7,W7=z7;function U7(e,t){var n=e.__data__;return W7(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Xu=U7,Y7=Xu;function G7(e){var t=Y7(this,e).delete(e);return this.size-=t?1:0,t}var K7=G7,q7=Xu;function J7(e){return q7(this,e).get(e)}var X7=J7,Z7=Xu;function _7(e){return Z7(this,e).has(e)}var $7=_7,eV=Xu;function tV(e,t){var n=eV(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var nV=tV,rV=V7,oV=K7,iV=X7,sV=$7,aV=nV;function Ds(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])}}Ds.prototype.clear=rV;Ds.prototype.delete=oV;Ds.prototype.get=iV;Ds.prototype.has=sV;Ds.prototype.set=aV;var ay=Ds,ly=ay,lV="Expected a function";function Bp(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(lV);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var a=e.apply(this,r);return n.cache=s.set(o,a)||s,a};return n.cache=new(Bp.Cache||ly),n}Bp.Cache=ly;var cV=Bp,uV=cV,AV=500;function dV(e){var t=uV(e,function(r){return n.size===AV&&n.clear(),r}),n=t.cache;return t}var gV=dV,fV=gV,pV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hV=/\\(\\)?/g,CV=fV(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(pV,function(n,r,o,s){t.push(o?s.replace(hV,"$1"):r||n)}),t}),mV=CV;function EV(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var cy=EV,wI=Yu,IV=cy,BV=Wu,vV=Ip,bV=1/0,TI=wI?wI.prototype:void 0,SI=TI?TI.toString:void 0;function uy(e){if(typeof e=="string")return e;if(BV(e))return IV(e,uy)+"";if(vV(e))return SI?SI.call(e):"";var t=e+"";return t=="0"&&1/e==-bV?"-0":t}var yV=uy,QV=yV;function xV(e){return e==null?"":QV(e)}var wV=xV,TV=Wu,SV=_9,PV=mV,RV=wV;function OV(e,t){return TV(e)?e:SV(e,t)?[e]:PV(RV(e))}var jV=OV,DV=Ip,MV=1/0;function kV(e){if(typeof e=="string"||DV(e))return e;var t=e+"";return t=="0"&&1/e==-MV?"-0":t}var FV=kV,LV=jV,NV=FV;function VV(e,t){t=LV(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[NV(t[n++])];return n&&n==r?e:void 0}var HV=VV,zV=HV;function WV(e,t,n){var r=e==null?void 0:zV(e,t);return r===void 0?n:r}var UV=WV;const YV=ro(UV);function Ay(e){var J,L;const{children:t,resource:n,source:r,label:o,disableActions:s=!1,disableAdd:a=!1,disableRemove:c=!1,enableClearAll:u=!1,className:A,empty:p,template:h={},inset:C}=e,[m,I]=Q.useState(!1),{fields:B,remove:v,replace:S,append:O}=j.useArrayInput(e),{resetField:x}=Ii.useFormContext(),R=bt(),P=ce.useTranslate(),k=ce.useRecordContext(e),F=Q.useRef(h||{}),G=ce.useTranslateLabel(),K=Q.useCallback(_=>{v(_)},[v]);if(B.length>0){const{..._}=B[0];F.current=_;for(const V in F.current)F.current[V]=null}const $=Q.useCallback((_=void 0)=>{let V=_;_==null&&(V=F.current,Q.Children.count(t)===1&&M.isValidElement(Q.Children.only(t))&&!Q.Children.only(t).props.source&&Q.Children.map(t,le=>M.isValidElement(le)&&le.type!==ce.FormDataConsumer).some(Boolean)?V="":(V=V||{},Q.Children.forEach(t,le=>{M.isValidElement(le)&&le.type!==ce.FormDataConsumer&&le.props.source&&(V[le.props.source]=le.props.defaultValue??null)})));const q={...V,...h};O(q),x(`${r}.${B.length}`,{defaultValue:V})},[O,t,x,r,B.length,h]),Y=_=>V=>{$(),_&&_(V)},ie=Q.useCallback(()=>{S([]),I(!1)},[S]),se=YV(k,r),X=Q.useMemo(()=>({total:B.length,remove:K,source:r}),[B.length,K,r]),Z=R.palette.mode==="dark"?R.palette.grey.A400:R.palette.grey.A800,H=B.length>0&&u;return B?g.jsx(Qf.Provider,{value:X,children:g.jsxs("div",{className:A,children:[M.cloneElement(g.jsx(GV,{}),{label:o,source:r,disableAdd:a,template:h,onClick:Y((L=(J=e==null?void 0:e.addButton)==null?void 0:J.props)==null?void 0:L.onClick),inset:C}),g.jsx(y.TableContainer,{component:y.Paper,sx:C===!0?{borderRadius:0}:{mt:2,border:`1px solid ${Z}`},children:g.jsxs(y.Table,{size:"small",children:[g.jsx(y.TableHead,{sx:C===!0?{}:{borderTop:0,borderBottom:`1px solid ${Z}`},children:g.jsxs(y.TableRow,{children:[Q.Children.map(t,(_,V)=>M.isValidElement(_)?g.jsx(y.TableCell,{children:g.jsx(y.Typography,{display:"flex",variant:"subtitle1",color:"text.primary",textTransform:"none",children:G({..._.props,resource:n})})},V):null),!s&&(H?g.jsx(y.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:g.jsx(Bi,{horizontal:!0,children:g.jsx(y.Typography,{color:"error",onClick:()=>I(!0),children:P("ra.action.delete")})})},"actions"):g.jsx(y.TableCell,{},"empty_actions"))]})}),g.jsxs(y.TableBody,{children:[B.length===0&&g.jsx(y.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0}},children:g.jsx(y.TableCell,{colSpan:4+(s?0:1),align:"center",children:p||g.jsx(y.Typography,{variant:"body1",color:"text.secondary",children:"-"})})}),B.length>0&&B.map((_,V)=>g.jsx(y.TableRow,{sx:{borderBottom:`1px solid ${Z}}`},children:g.jsx(ry,{disableRemove:c,disableActions:s,index:V,member:`${r}.${V}`,onRemoveField:K,record:se&&se[V]||{},resource:n,source:r,children:t})},_.id))]})]})}),B.length>0&&g.jsx(j.Confirm,{isOpen:m,title:P("ra.action.clear_array_input"),content:P("ra.message.clear_array_input"),onConfirm:ie,onClose:()=>I(!1)})]})}):null}function GV(e){const{label:t,disableAdd:n,onClick:r,inset:o}=e,s=bt(),a=s.palette.mode==="dark"?s.palette.grey.A400:s.palette.grey.A800,c=s.palette.mode==="light"?"#000000":"#FFFFFF";return g.jsxs(y.Stack,{justifyContent:"space-between",alignItems:"center",flexDirection:"row",sx:o?{p:2.5}:{pt:2},children:[t!==!1&&g.jsx(y.Typography,{children:t}),!n&&(M.isValidElement(e==null?void 0:e.addButton)?M.cloneElement(e==null?void 0:e.addButton,{onClick:r}):g.jsx(y.IconButton,{color:"secondary",sx:{border:`1px solid ${a}`},onClick:r,children:g.jsx(Ze.PlusCircleOutlined,{style:{color:c}})}))]})}const KV=Ae(Ay,{slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8.25)})`}},[e.breakpoints.down("sm")]:{"& .MuiTableRow-root:last-child":{borderBottom:0}}}));function qV(e,t){const n=te.clone(e),{type:r,payload:o}=t;switch(r){case"updateMedia":{const s=te.chain(n.media).clone().extend(o).value();return te.extend(n,{media:s})}case"updateDrawer":{const s=te.chain(n.drawer).clone().extend(o).value();return te.extend(n,{drawer:s})}case"updateLogo":{const s=te.chain(n.logo).clone().extend(o).value();return te.extend(n,{logo:s})}case"updateNotifications":{const s=te.chain(n.notifications).clone().extend(o).value();return te.extend(n,s)}case"updateTheme":{const s=te.chain(n.theme).clone().extend(o).value();return te.extend(n,{theme:s})}default:return n}}const JV={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"}},dy=Q.createContext(void 0);function gy(e){var K;const t=ce.useAuthProvider();console.log("authProvider: ",t);const n=ce.useGetIdentity(),r=y.useTheme(),o=y.useMediaQuery(r.breakpoints.down("md")),s=y.useMediaQuery(r.breakpoints.down("lg")),a=y.useMediaQuery(r.breakpoints.down("xl")),{miniDrawer:c,isHorizontalLayout:u,menuOrientation:A,drawerWidth:p}=Qn(),h=u(A)&&!s,{drawerOpen:C,openDrawer:m}=mi(),I=Q.useCallback(()=>{m(!C)},[C,m]),[B,v]=Q.useState(!1),[S,O]=Q.useReducer(qV,te.chain(JV).clone().merge({drawer:{open:!c||C}}).value()),x=Q.useCallback(()=>v(!1),[]),R=Q.useMemo(()=>({state:S,dispatch:O}),[S,O]),{logoIcon:P,logoMain:k,enableNotification:F,notification:G}=e;return Q.useEffect(()=>{O({type:"updateMedia",payload:{downMd:o,downLg:s,downXl:a,horizontal:h}})},[A,o,s,a]),Q.useEffect(()=>{O({type:"updateDrawer",payload:{open:C,width:p,handleDrawerToggle:I}})},[C,p,I]),Q.useEffect(()=>{c||m(!a)},[a,c]),Q.useEffect(()=>{O({type:"updateLogo",payload:{main:k,icon:P}})},[P,k]),Q.useEffect(()=>{O({type:"updateNotifications",payload:{enable:F,resource:G??"entities/notification"}})},[F,G]),Q.useEffect(()=>{O({type:"updateTheme",payload:{iconColorOpen:r.palette.mode==="dark"?"grey.200":"grey.300",iconColor:r.palette.mode==="dark"?"background.default":"grey.100"}})},[r.palette.mode]),Q.useEffect(()=>{if(!t.isImpersonating){console.warn("authProvider does not contain a method called isImpersonating",t);return}t==null||t.isImpersonating().then($=>{var Y;v(!$&&((Y=n==null?void 0:n.data)==null?void 0:Y.needToChangePassword)===!0)})},[(K=n==null?void 0:n.data)==null?void 0:K.needToChangePassword,t]),g.jsxs(dy.Provider,{value:R,children:[g.jsx(y.Dialog,{open:B,maxWidth:"xs",fullWidth:!0,children:g.jsx(fp,{onSuccess:x,firstAccess:!0})}),e.children]})}function fy(e){return Q.forwardRef((t,n)=>{const{logoIcon:r,logoMain:o,enableNotification:s,notification:a}=t;return g.jsx(gy,{logoIcon:r,logoMain:o,enableNotification:s,notification:a,children:g.jsx(e,{ref:n,...t})})})}function vp(){const e=Q.useContext(dy);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function XV(){return vp().dispatch}function Ms(){return vp().state}function Nn(){return Ms().media}function Ti(){return Ms().drawer}function py(){return Ms().logo}function Zu(){return Ms().notifications}function ZV(){return Ms().theme}const _V={ml:{xs:0,lg:-2}};function hy(){const{open:e,handleDrawerToggle:t}=Ti();return g.jsx(Rs,{value:"drawer","aria-label":"open drawer",sx:_V,onChange:t,selected:e,children:e?g.jsx(Ze.MenuFoldOutlined,{}):g.jsx(Ze.MenuUnfoldOutlined,{})})}function Cy(e){const t=Q.useRef(),n=y.useTheme(),{downLg:r,horizontal:o}=Nn(),{open:s,width:a}=Ti(),c=r?y.AppBar:TB,u=Er(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:o?"100%":s?`calc(100% - ${a}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),A={position:"fixed",color:"inherit",elevation:0,sx:u};return r||te.extend(A,{open:s}),g.jsx(c,{ref:t,...A,children:g.jsxs(y.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!o&&g.jsx(hy,{}),e.children]})})}function $V(e){const t=y.useTheme(),{notification:n,onClick:r,selected:o,divider:s}=e,{resource:a}=Zu(),c=ce.useNotify(),u=ce.useRedirect(),[A]=ce.useUpdate(a,{id:n==null?void 0:n.id,data:{...n,readed:Pr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n!=null&&n.resource?n!=null&&n.resource.startsWith("/")?(u(n==null?void 0:n.resource),r()):(r(),document.location.href=n==null?void 0:n.resource):r()},onFailure:()=>{c("resources.notifications.messages.readed.error","warning")}}),p=Q.useCallback(()=>A(),[A]),[h]=ce.useLocaleState(),C=Q.useMemo(()=>Pr(n.created).locale(h).fromNow(),[n,h]);return g.jsx(y.ListItem,{disablePadding:!0,divider:s,children:g.jsxs(y.ListItemButton,{selected:o,onClick:p,children:[g.jsx(y.ListItemAvatar,{children:g.jsx(y.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:g.jsx(Ze.MessageOutlined,{})})}),g.jsx(y.ListItemText,{sx:{overflow:"hidden",wordBreak:"break-word",width:"90%"},primary:n.title,secondary:n.content}),g.jsx(y.Box,{flexGrow:1,flexShrink:1,minWidth:t.spacing(2)}),g.jsx(y.ListItemText,{sx:{overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-word"},primary:C,primaryTypographyProps:{variant:"caption"}})]})})}const eH={width:36,height:36,fontSize:"1rem"},tH={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function my(){const{enable:e}=Zu();return e?g.jsx(nH,{}):null}function nH(){const e=ce.useTranslate(),t=y.useTheme(),n=ce.useRefresh(),r=ce.useNotify(),{downMd:o}=Nn(),{resource:s}=Zu(),[a,c]=Q.useState([]),{data:u,isLoading:A}=ce.useGetList(s,{pagination:{page:1,perPage:25},sort:{field:"created",order:"DESC"},filter:{readed:!1}}),p=a.filter(O=>O.readed===null).length,{open:h,anchorEl:C,handleClose:m,handleToggle:I}=Ru();Q.useEffect(()=>{!A&&u&&c(u??[])},[u,A]);const B=a.filter(O=>!O.readed).map(O=>O.id),[v]=ce.useUpdateMany(s,{ids:B,data:{readed:Pr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n(),r("resources.notifications.messages.readed.done")},onError:()=>r("ra.notification.readed_error")}),S=Q.useCallback(()=>{v()},[v]);return g.jsxs(g.Fragment,{children:[g.jsx(Rs,{value:"notifications",selected:h,onChange:I,children:g.jsx(y.Badge,{badgeContent:p,color:"primary",children:g.jsx(Ze.BellOutlined,{})})}),g.jsx(y.Popper,{placement:o?"bottom":"bottom-end",open:h,anchorEl:C,role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:O})=>g.jsx(Do,{type:"grow",position:o?"top":"top-right",in:h,...O,children:g.jsx(y.Paper,{sx:{marginTop:1,boxShadow:t.customShadows.z1,width:"100%",minWidth:285,maxWidth:420,[t.breakpoints.down("md")]:{maxWidth:285}},children:g.jsx(y.ClickAwayListener,{onClickAway:m,children:g.jsxs(er,{title:e("ra.notification.title"),elevation:0,border:!1,content:!1,secondary:g.jsx(g.Fragment,{children:p>0&&g.jsx(y.Tooltip,{title:e("ra.notification.mark-as-read"),onClick:S,children:g.jsx(Ps,{color:"success",size:"small",children:g.jsx(Ze.CheckCircleOutlined,{style:{fontSize:"1.15rem"}})})})}),children:[g.jsx(y.List,{component:"nav",sx:{p:0,"& .MuiListItemButton-root":{py:.5,"&.Mui-selected":{bgcolor:"grey.50",color:"text.primary"},"& .MuiAvatar-root":eH,"& .MuiListItemSecondaryAction-root":{...tH,position:"relative"}},maxHeight:"calc(100vh - 240px)",overflow:"auto"},children:a.map((x,R)=>g.jsx($V,{selected:p>0,notification:x,onClick:m,divider:R<a.length-1},x.id))}),g.jsx(y.ListItemButton,{sx:{textAlign:"center",py:"12px !important"},to:`/${s}`,LinkComponent:Ct.Link,onClick:m,children:g.jsx(y.ListItemText,{primary:g.jsx(y.Typography,{variant:"h6",color:"primary",children:e("ra.notification.view_all")})})}),g.jsx(y.Divider,{})]})})})})})]})}const rH=()=>{const[e,t]=Q.useState(!1),n=Q.useCallback(()=>t(!1),[t]),r=Q.useCallback(()=>t(!0),[t]),o=ce.useTranslate();return g.jsxs(Q.Fragment,{children:[g.jsxs(y.ListItemButton,{onClick:r,children:[g.jsx(y.ListItemIcon,{children:g.jsx(rr.Key,{})}),g.jsx(y.ListItemText,{primary:o("ra.auth.change_password")})]}),g.jsx(y.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:g.jsx(fp,{onSuccess:n})})]})},oH=()=>{const e=ce.useLogout(),t=ce.useTranslate();return g.jsx(Q.Fragment,{children:g.jsxs(y.ListItemButton,{onClick:e,children:[g.jsx(y.ListItemIcon,{children:g.jsx(rr.LogoutOutlined,{})}),g.jsx(y.ListItemText,{primary:t("ra.auth.logout")})]})})},iH=()=>{const e=ce.useTranslate(),t=ce.useAuthProvider(),n=Q.useCallback(()=>t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,o]=Q.useState(!1);return Q.useEffect(()=>{if(!t.isImpersonating){console.warn("The authProvider does not support the isImpersonating feature",t);return}t.isImpersonating().then(s=>o(s))},[t,o]),r?g.jsx(Q.Fragment,{children:g.jsxs(y.ListItemButton,{onClick:n,children:[g.jsx(y.ListItemIcon,{children:g.jsx(rr.LogoutOutlined,{})}),g.jsx(y.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};function Ey(){var m;const e=y.useTheme(),t=ce.useDataProvider(),n=ce.useAuthProvider(),{identity:r}=ce.useGetIdentity(),o=r!==void 0&&r.image&&r.image!==null&&r.image!=="",[s,a]=Q.useState(null),{open:c,anchorEl:u,handleToggle:A,handleClose:p}=Ru(),h=ce.useLogout(),C=Q.useCallback(()=>{h()},[n,h]);return Q.useEffect(()=>{o&&t.getFile("/profile/me/image").then(I=>a(I))},[t,o]),g.jsxs(g.Fragment,{children:[g.jsx(Rs,{sx:{p:.25,width:"auto"},onClick:A,value:"profile",selected:c,children:g.jsxs(y.Stack,{direction:"row",spacing:2,alignItems:"center",sx:{p:.5},children:[g.jsx(ka,{alt:(m=r==null?void 0:r.name)==null?void 0:m.toUpperCase(),src:s,size:"xs"}),g.jsx(y.Typography,{variant:"subtitle1",children:r==null?void 0:r.name})]})}),g.jsx(pr.Popper,{placement:"bottom-end",open:c,anchorEl:u,role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:I})=>{var B;return g.jsx(Do,{type:"grow",position:"top-right",in:c,...I,children:g.jsx(y.Paper,{sx:{boxShadow:e.customShadows.z1,width:290,minWidth:240,maxWidth:290,[e.breakpoints.down("md")]:{maxWidth:250},marginTop:1},children:g.jsx(y.ClickAwayListener,{onClickAway:p,children:g.jsxs(er,{elevation:0,border:!1,content:!1,children:[g.jsx(y.CardContent,{sx:{px:2.5,pt:3},children:g.jsxs(y.Grid,{container:!0,justifyContent:"space-between",alignItems:"center",children:[g.jsx(y.Grid,{item:!0,children:g.jsxs(y.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[g.jsx(ka,{alt:"profile user",src:s,sx:{width:32,height:32}}),g.jsxs(y.Stack,{children:[g.jsx(y.Typography,{variant:"h6",children:r==null?void 0:r.name}),g.jsx(y.Typography,{variant:"body2",color:"textSecondary",children:(B=r==null?void 0:r.roles)==null?void 0:B.map(v=>v.name.replace("ROLE_","")).join(",")})]})]})}),g.jsx(y.Grid,{item:!0,children:g.jsx(y.Tooltip,{title:"Logout",children:g.jsx(Ps,{size:"large",sx:{color:"text.primary"},onClick:C,children:g.jsx(Ze.LogoutOutlined,{})})})})]})}),g.jsx(y.Grid,{container:!0,children:g.jsx(y.Grid,{item:!0,xs:12,children:g.jsxs(y.List,{component:"nav",sx:{p:0,"& .MuiListItemIcon-root":{minWidth:32}},children:[g.jsx(rH,{}),g.jsx(oH,{}),g.jsx(iH,{})]})})})]})})})})}})]})}const Iy=e=>{const t=bt(),{downMd:n}=Nn(),{open:r,anchorEl:o,handleToggle:s,handleClose:a}=Ru();return n?g.jsxs(g.Fragment,{children:[g.jsx(Rs,{value:"drawer","aria-label":"open more menu","aria-controls":r?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:s,selected:r,children:g.jsx(Ze.MoreOutlined,{})}),g.jsx(y.Popper,{placement:"bottom-end",open:r,anchorEl:o,role:void 0,transition:!0,disablePortal:!0,style:{width:"100%"},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:c})=>g.jsx(Do,{type:"fade",in:r,...c,children:g.jsx(y.Paper,{sx:{boxShadow:t.customShadows.z1},children:g.jsx(y.ClickAwayListener,{onClickAway:a,children:g.jsx(y.AppBar,{color:"inherit",children:g.jsx(y.Toolbar,{children:e.children})})})})})})]}):g.jsx(g.Fragment,{children:e.children})};function By(e){return g.jsx(y.Box,{...e,flex:1})}function bp(e){const{name:t,version:n,copy:r="© Applica Software Guru for"}=e;return g.jsx(y.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:"24px 16px 0px",mt:"auto"},children:g.jsxs(y.Typography,{variant:"caption",children:[g.jsx("span",{dangerouslySetInnerHTML:{__html:r||""}})," ",t," - ",n]})})}var vy={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})(vy);var _u=vy.exports,_d={};const sH=pO(o6);var PI;function $u(){return PI||(PI=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=sH}(_d)),_d}function by(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=by(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function yy(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=by(e))&&(r&&(r+=" "),r+=t);return r}var aH="__lodash_hash_undefined__";function lH(e){return this.__data__.set(e,aH),this}var cH=lH;function uH(e){return this.__data__.has(e)}var AH=uH,dH=ay,gH=cH,fH=AH;function ru(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new dH;++t<n;)this.add(e[t])}ru.prototype.add=ru.prototype.push=gH;ru.prototype.has=fH;var Qy=ru;function pH(e,t){return e.has(t)}var xy=pH;function hH(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var wy=hH;function CH(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var mH=CH,EH=Ep,IH=Gu,BH="[object Arguments]";function vH(e){return IH(e)&&EH(e)==BH}var bH=vH,RI=bH,yH=Gu,Ty=Object.prototype,QH=Ty.hasOwnProperty,xH=Ty.propertyIsEnumerable,wH=RI(function(){return arguments}())?RI:function(e){return yH(e)&&QH.call(e,"callee")&&!xH.call(e,"callee")},TH=wH,SH=9007199254740991;function PH(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=SH}var RH=PH;function OH(e){return function(t){return e(t)}}var jH=OH,DH=sy,MH=RH;function kH(e){return e!=null&&MH(e.length)&&!DH(e)}var FH=kH,LH=Ku,NH=Uu,VH=LH(NH,"Set"),HH=VH,zH=Ku,WH=function(){try{var e=zH(Object,"defineProperty");return e({},"",{}),e}catch{}}(),UH=WH,YH=FH,GH=Gu;function KH(e){return GH(e)&&YH(e)}var Sy=KH;function qH(e){return e}var Py=qH;function JH(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var XH=JH,ZH=XH,OI=Math.max;function _H(e,t,n){return t=OI(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,s=OI(r.length-t,0),a=Array(s);++o<s;)a[o]=r[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=r[o];return c[t]=n(a),ZH(e,this,c)}}var $H=_H;function ez(e){return function(){return e}}var tz=ez,nz=tz,jI=UH,rz=Py,oz=jI?function(e,t){return jI(e,"toString",{configurable:!0,enumerable:!1,value:nz(t),writable:!0})}:rz,iz=oz,sz=800,az=16,lz=Date.now;function cz(e){var t=0,n=0;return function(){var r=lz(),o=az-(r-n);if(n=r,o>0){if(++t>=sz)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var uz=cz,Az=iz,dz=uz,gz=dz(Az),fz=gz,pz=Py,hz=$H,Cz=fz;function mz(e,t){return Cz(hz(e,t,pz),e+"")}var Ry=mz,Ug=globalThis&&globalThis.__assign||function(){return Ug=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Ug.apply(this,arguments)},Ez=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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},gc,$d,Oy=function(e){var t=e.className,n=e.onClick,r=e.sx,o=Ez(e,["className","onClick","sx"]),s=ce.useLoading(),a=bt();return M.createElement(Iz,{className:t,sx:r},M.createElement(iQ,{className:"".concat(gs.loadedIcon," ").concat(s&&gs.loadedLoading),onClick:n}),s&&M.createElement(dp,Ug({className:yy("app-loader",gs.loader),color:"inherit",size:a.spacing(2),thickness:6},o)))};Oy.propTypes={classes:f.object,className:f.string,width:f.string};var Tc="RaLoadingIndicator",gs={loader:"".concat(Tc,"-loader"),loadedLoading:"".concat(Tc,"-loadedLoading"),loadedIcon:"".concat(Tc,"-loadedIcon")},Iz=Ae("div",{name:Tc,overridesResolver:function(e,t){return t.root}})((gc={position:"relative"},gc["& .".concat(gs.loadedIcon)]=($d={},$d["&.".concat(gs.loadedLoading)]={opacity:0},$d),gc["& .".concat(gs.loader)]={position:"absolute",top:"30%",left:"30%"},gc));const yp=e=>e.scrollTop;function vs(e,t){var n,r;const{timeout:o,easing:s,style:a={}}=e;return{duration:(n=a.transitionDuration)!=null?n:typeof o=="number"?o:o[t.mode]||0,easing:(r=a.transitionTimingFunction)!=null?r:typeof s=="object"?s[t.mode]:s,delay:a.transitionDelay}}const Bz=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function vz(e,t,n){const r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),s=Ts(t);let a;if(t.fakeTransform)a=t.fakeTransform;else{const A=s.getComputedStyle(t);a=A.getPropertyValue("-webkit-transform")||A.getPropertyValue("transform")}let c=0,u=0;if(a&&a!=="none"&&typeof a=="string"){const A=a.split("(")[1].split(")")[0].split(",");c=parseInt(A[4],10),u=parseInt(A[5],10)}return e==="left"?o?`translateX(${o.right+c-r.left}px)`:`translateX(${s.innerWidth+c-r.left}px)`:e==="right"?o?`translateX(-${r.right-o.left-c}px)`:`translateX(-${r.left+r.width-c}px)`:e==="up"?o?`translateY(${o.bottom+u-r.top}px)`:`translateY(${s.innerHeight+u-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-u}px)`:`translateY(-${r.top+r.height-u}px)`}function jy(e){return typeof e=="function"?e():e}function fc(e,t,n){const r=jy(n),o=vz(e,t,r);o&&(t.style.webkitTransform=o,t.style.transform=o)}const Dy=M.forwardRef(function(t,n){const r=bt(),o={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:c=!0,children:u,container:A,direction:p="down",easing:h=o,in:C,onEnter:m,onEntered:I,onEntering:B,onExit:v,onExited:S,onExiting:O,style:x,timeout:R=s,TransitionComponent:P=ap}=t,k=Ne(t,Bz),F=M.useRef(null),G=kn(u.ref,F,n),K=L=>_=>{L&&(_===void 0?L(F.current):L(F.current,_))},$=K((L,_)=>{fc(p,L,A),yp(L),m&&m(L,_)}),Y=K((L,_)=>{const V=vs({timeout:R,style:x,easing:h},{mode:"enter"});L.style.webkitTransition=r.transitions.create("-webkit-transform",z({},V)),L.style.transition=r.transitions.create("transform",z({},V)),L.style.webkitTransform="none",L.style.transform="none",B&&B(L,_)}),ie=K(I),se=K(O),X=K(L=>{const _=vs({timeout:R,style:x,easing:h},{mode:"exit"});L.style.webkitTransition=r.transitions.create("-webkit-transform",_),L.style.transition=r.transitions.create("transform",_),fc(p,L,A),v&&v(L)}),Z=K(L=>{L.style.webkitTransition="",L.style.transition="",S&&S(L)}),H=L=>{a&&a(F.current,L)},J=M.useCallback(()=>{F.current&&fc(p,F.current,A)},[p,A]);return M.useEffect(()=>{if(C||p==="down"||p==="right")return;const L=D0(()=>{F.current&&fc(p,F.current,A)}),_=Ts(F.current);return _.addEventListener("resize",L),()=>{L.clear(),_.removeEventListener("resize",L)}},[p,C,A]),M.useEffect(()=>{C||J()},[C,J]),g.jsx(P,z({nodeRef:F,onEnter:$,onEntered:ie,onEntering:Y,onExit:X,onExited:Z,onExiting:se,addEndListener:H,appear:c,in:C,timeout:R},k,{children:(L,_)=>M.cloneElement(u,z({ref:G,style:z({visibility:L==="exited"&&!C?"hidden":void 0},x,u.props.style)},_))}))});process.env.NODE_ENV!=="production"&&(Dy.propTypes={addEndListener:f.func,appear:f.bool,children:ws.isRequired,container:Or(f.oneOfType([hi,f.func]),e=>{if(e.open){const t=jy(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(`
|
|
206
206
|
`))}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(`
|
|
207
207
|
`))}return null}),direction:f.oneOf(["down","left","right","up"]),easing:f.oneOfType([f.shape({enter:f.string,exit:f.string}),f.string]),in:f.bool,onEnter:f.func,onEntered:f.func,onEntering:f.func,onExit:f.func,onExited:f.func,onExiting:f.func,style:f.object,timeout:f.oneOfType([f.number,f.shape({appear:f.number,enter:f.number,exit:f.number})])});const bz=Dy;function yz(e){return typeof e=="string"}function Qz(e,t,n){return e===void 0||yz(e)?t:z({},t,{ownerState:z({},t.ownerState,n)})}const xz={disableDefaultClasses:!1},wz=M.createContext(xz);function Tz(e){const{disableDefaultClasses:t}=M.useContext(wz);return n=>t?"":e(n)}function My(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 Sz(e,t,n){return typeof e=="function"?e(t,n):e}function DI(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 Pz(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:s}=e;if(!t){const m=Ge(o==null?void 0:o.className,r==null?void 0:r.className,s,n==null?void 0:n.className),I=z({},n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),B=z({},n,o,r);return m.length>0&&(B.className=m),Object.keys(I).length>0&&(B.style=I),{props:B,internalRef:void 0}}const a=My(z({},o,r)),c=DI(r),u=DI(o),A=t(a),p=Ge(A==null?void 0:A.className,n==null?void 0:n.className,s,o==null?void 0:o.className,r==null?void 0:r.className),h=z({},A==null?void 0:A.style,n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),C=z({},A,n,u,c);return p.length>0&&(C.className=p),Object.keys(h).length>0&&(C.style=h),{props:C,internalRef:A.ref}}const Rz=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Oz(e){var t;const{elementType:n,externalSlotProps:r,ownerState:o,skipResolvingSlotProps:s=!1}=e,a=Ne(e,Rz),c=s?{}:Sz(r,o),{props:u,internalRef:A}=Pz(z({},a,{externalSlotProps:c})),p=kn(A,c==null?void 0:c.ref,(t=e.additionalProps)==null?void 0:t.ref);return Qz(n,z({},u,{ref:p}),o)}function jz(e){const t=hr(e);return t.body===e?Ts(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function xa(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function MI(e){return parseInt(Ts(e).getComputedStyle(e).paddingRight,10)||0}function Dz(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 kI(e,t,n,r,o){const s=[t,n,...r];[].forEach.call(e.children,a=>{const c=s.indexOf(a)===-1,u=!Dz(a);c&&u&&xa(a,o)})}function eg(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function Mz(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(jz(r)){const a=JO(hr(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${MI(r)+a}px`;const c=hr(r).querySelectorAll(".mui-fixed");[].forEach.call(c,u=>{n.push({value:u.style.paddingRight,property:"padding-right",el:u}),u.style.paddingRight=`${MI(u)+a}px`})}let s;if(r.parentNode instanceof DocumentFragment)s=hr(r).body;else{const a=r.parentElement,c=Ts(r);s=(a==null?void 0:a.nodeName)==="HTML"&&c.getComputedStyle(a).overflowY==="scroll"?a:r}n.push({value:s.style.overflow,property:"overflow",el:s},{value:s.style.overflowX,property:"overflow-x",el:s},{value:s.style.overflowY,property:"overflow-y",el:s}),s.style.overflow="hidden"}return()=>{n.forEach(({value:s,el:a,property:c})=>{s?a.style.setProperty(c,s):a.style.removeProperty(c)})}}function kz(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class Fz{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&&xa(t.modalRef,!1);const o=kz(n);kI(n,t.mount,t.modalRef,o,!0);const s=eg(this.containers,a=>a.container===n);return s!==-1?(this.containers[s].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=eg(this.containers,s=>s.modals.indexOf(t)!==-1),o=this.containers[r];o.restore||(o.restore=Mz(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=eg(this.containers,a=>a.modals.indexOf(t)!==-1),s=this.containers[o];if(s.modals.splice(s.modals.indexOf(t),1),this.modals.splice(r,1),s.modals.length===0)s.restore&&s.restore(),t.modalRef&&xa(t.modalRef,n),kI(s.container,t.mount,t.modalRef,s.hiddenSiblings,!1),this.containers.splice(o,1);else{const a=s.modals[s.modals.length-1];a.modalRef&&xa(a.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function Lz(e){return typeof e=="function"?e():e}function Nz(e){return e?e.props.hasOwnProperty("in"):!1}const Vz=new Fz;function Hz(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:o=Vz,closeAfterTransition:s=!1,onTransitionEnter:a,onTransitionExited:c,children:u,onClose:A,open:p,rootRef:h}=e,C=M.useRef({}),m=M.useRef(null),I=M.useRef(null),B=kn(I,h),[v,S]=M.useState(!p),O=Nz(u);let x=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(x=!1);const R=()=>hr(m.current),P=()=>(C.current.modalRef=I.current,C.current.mount=m.current,C.current),k=()=>{o.mount(P(),{disableScrollLock:r}),I.current&&(I.current.scrollTop=0)},F=Qo(()=>{const H=Lz(t)||R().body;o.add(P(),H),I.current&&k()}),G=M.useCallback(()=>o.isTopModal(P()),[o]),K=Qo(H=>{m.current=H,H&&(p&&G()?k():I.current&&xa(I.current,x))}),$=M.useCallback(()=>{o.remove(P(),x)},[x,o]);M.useEffect(()=>()=>{$()},[$]),M.useEffect(()=>{p?F():(!O||!s)&&$()},[p,$,O,s,F]);const Y=H=>J=>{var L;(L=H.onKeyDown)==null||L.call(H,J),!(J.key!=="Escape"||!G())&&(n||(J.stopPropagation(),A&&A(J,"escapeKeyDown")))},ie=H=>J=>{var L;(L=H.onClick)==null||L.call(H,J),J.target===J.currentTarget&&A&&A(J,"backdropClick")};return{getRootProps:(H={})=>{const J=My(e);delete J.onTransitionEnter,delete J.onTransitionExited;const L=z({},J,H);return z({role:"presentation"},L,{onKeyDown:Y(L),ref:B})},getBackdropProps:(H={})=>{const J=H;return z({"aria-hidden":!0},J,{onClick:ie(J),open:p})},getTransitionProps:()=>{const H=()=>{S(!1),a&&a()},J=()=>{S(!0),c&&c(),s&&$()};return{onEnter:mg(H,u==null?void 0:u.props.onEnter),onExited:mg(J,u==null?void 0:u.props.onExited)}},rootRef:B,portalRef:K,isTopModal:G,exited:v,hasTransition:O}}const zz=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Wz(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 Uz(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 Yz(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||Uz(e))}function Gz(e){const t=[],n=[];return Array.from(e.querySelectorAll(zz)).forEach((r,o)=>{const s=Wz(r);s===-1||!Yz(r)||(s===0?t.push(r):n.push({documentOrder:o,tabIndex:s,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function Kz(){return!0}function ou(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:s=Gz,isEnabled:a=Kz,open:c}=e,u=M.useRef(!1),A=M.useRef(null),p=M.useRef(null),h=M.useRef(null),C=M.useRef(null),m=M.useRef(!1),I=M.useRef(null),B=kn(t.ref,I),v=M.useRef(null);M.useEffect(()=>{!c||!I.current||(m.current=!n)},[n,c]),M.useEffect(()=>{if(!c||!I.current)return;const x=hr(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(`
|
|
208
208
|
`)),I.current.setAttribute("tabIndex","-1")),m.current&&I.current.focus()),()=>{o||(h.current&&h.current.focus&&(u.current=!0,h.current.focus()),h.current=null)}},[c]),M.useEffect(()=>{if(!c||!I.current)return;const x=hr(I.current),R=F=>{v.current=F,!(r||!a()||F.key!=="Tab")&&x.activeElement===I.current&&F.shiftKey&&(u.current=!0,p.current&&p.current.focus())},P=()=>{const F=I.current;if(F===null)return;if(!x.hasFocus()||!a()||u.current){u.current=!1;return}if(F.contains(x.activeElement)||r&&x.activeElement!==A.current&&x.activeElement!==p.current)return;if(x.activeElement!==C.current)C.current=null;else if(C.current!==null)return;if(!m.current)return;let G=[];if((x.activeElement===A.current||x.activeElement===p.current)&&(G=s(I.current)),G.length>0){var K,$;const Y=!!((K=v.current)!=null&&K.shiftKey&&(($=v.current)==null?void 0:$.key)==="Tab"),ie=G[0],se=G[G.length-1];typeof ie!="string"&&typeof se!="string"&&(Y?se.focus():ie.focus())}else F.focus()};x.addEventListener("focusin",P),x.addEventListener("keydown",R,!0);const k=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&P()},50);return()=>{clearInterval(k),x.removeEventListener("focusin",P),x.removeEventListener("keydown",R,!0)}},[n,r,o,a,c,s]);const S=x=>{h.current===null&&(h.current=x.relatedTarget),m.current=!0,C.current=x.target;const R=t.props.onFocus;R&&R(x)},O=x=>{h.current===null&&(h.current=x.relatedTarget),m.current=!0};return g.jsxs(M.Fragment,{children:[g.jsx("div",{tabIndex:c?0:-1,onFocus:O,ref:A,"data-testid":"sentinelStart"}),M.cloneElement(t,{ref:B,onFocus:S}),g.jsx("div",{tabIndex:c?0:-1,onFocus:O,ref:p,"data-testid":"sentinelEnd"})]})}process.env.NODE_ENV!=="production"&&(ou.propTypes={children:ws,disableAutoFocus:f.bool,disableEnforceFocus:f.bool,disableRestoreFocus:f.bool,getTabbable:f.func,isEnabled:f.func,open:f.bool.isRequired});process.env.NODE_ENV!=="production"&&(ou["propTypes"]=pu(ou.propTypes));function qz(e){return typeof e=="function"?e():e}const La=M.forwardRef(function(t,n){const{children:r,container:o,disablePortal:s=!1}=t,[a,c]=M.useState(null),u=kn(M.isValidElement(r)?r.ref:null,n);if(ms(()=>{s||c(qz(o)||document.body)},[o,s]),ms(()=>{if(a&&!s)return Lc(n,a),()=>{Lc(n,null)}},[n,a,s]),s){if(M.isValidElement(r)){const A={ref:u};return M.cloneElement(r,A)}return g.jsx(M.Fragment,{children:r})}return g.jsx(M.Fragment,{children:a&&fO.createPortal(r,a)})});process.env.NODE_ENV!=="production"&&(La.propTypes={children:f.node,container:f.oneOfType([hi,f.func]),disablePortal:f.bool});process.env.NODE_ENV!=="production"&&(La["propTypes"]=pu(La.propTypes));const Jz=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],Xz={entering:{opacity:1},entered:{opacity:1}},ky=M.forwardRef(function(t,n){const r=bt(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:c,easing:u,in:A,onEnter:p,onEntered:h,onEntering:C,onExit:m,onExited:I,onExiting:B,style:v,timeout:S=o,TransitionComponent:O=ap}=t,x=Ne(t,Jz),R=M.useRef(null),P=kn(R,c.ref,n),k=X=>Z=>{if(X){const H=R.current;Z===void 0?X(H):X(H,Z)}},F=k(C),G=k((X,Z)=>{yp(X);const H=vs({style:v,timeout:S,easing:u},{mode:"enter"});X.style.webkitTransition=r.transitions.create("opacity",H),X.style.transition=r.transitions.create("opacity",H),p&&p(X,Z)}),K=k(h),$=k(B),Y=k(X=>{const Z=vs({style:v,timeout:S,easing:u},{mode:"exit"});X.style.webkitTransition=r.transitions.create("opacity",Z),X.style.transition=r.transitions.create("opacity",Z),m&&m(X)}),ie=k(I),se=X=>{s&&s(R.current,X)};return g.jsx(O,z({appear:a,in:A,nodeRef:R,onEnter:G,onEntered:K,onEntering:F,onExit:Y,onExited:ie,onExiting:$,addEndListener:se,timeout:S},x,{children:(X,Z)=>M.cloneElement(c,z({style:z({opacity:0,visibility:X==="exited"&&!A?"hidden":void 0},Xz[X],v,c.props.style),ref:P},Z))}))});process.env.NODE_ENV!=="production"&&(ky.propTypes={addEndListener:f.func,appear:f.bool,children:ws.isRequired,easing:f.oneOfType([f.shape({enter:f.string,exit:f.string}),f.string]),in:f.bool,onEnter:f.func,onEntered:f.func,onEntering:f.func,onExit:f.func,onExited:f.func,onExiting:f.func,style:f.object,timeout:f.oneOfType([f.number,f.shape({appear:f.number,enter:f.number,exit:f.number})])});const Zz=ky;function _z(e){return Dt("MuiBackdrop",e)}Vt("MuiBackdrop",["root","invisible"]);const $z=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],eW=e=>{const{classes:t,invisible:n}=e;return nn({root:["root",n&&"invisible"]},_z,t)},tW=Ae("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>z({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"})),Fy=M.forwardRef(function(t,n){var r,o,s;const a=Ht({props:t,name:"MuiBackdrop"}),{children:c,className:u,component:A="div",components:p={},componentsProps:h={},invisible:C=!1,open:m,slotProps:I={},slots:B={},TransitionComponent:v=Zz,transitionDuration:S}=a,O=Ne(a,$z),x=z({},a,{component:A,invisible:C}),R=eW(x),P=(r=I.root)!=null?r:h.root;return g.jsx(v,z({in:m,timeout:S},O,{children:g.jsx(tW,z({"aria-hidden":!0},P,{as:(o=(s=B.root)!=null?s:p.Root)!=null?o:A,className:Ge(R.root,u,P==null?void 0:P.className),ownerState:z({},x,P==null?void 0:P.ownerState),classes:R,ref:n,children:c}))}))});process.env.NODE_ENV!=="production"&&(Fy.propTypes={children:f.node,classes:f.object,className:f.string,component:f.elementType,components:f.shape({Root:f.elementType}),componentsProps:f.shape({root:f.object}),invisible:f.bool,open:f.bool.isRequired,slotProps:f.shape({root:f.object}),slots:f.shape({root:f.elementType}),sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),TransitionComponent:f.elementType,transitionDuration:f.oneOfType([f.number,f.shape({appear:f.number,enter:f.number,exit:f.number})])});const nW=Fy;function rW(e){return Dt("MuiModal",e)}Vt("MuiModal",["root","hidden","backdrop"]);const oW=["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"],iW=e=>{const{open:t,exited:n,classes:r}=e;return nn({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},rW,r)},sW=Ae("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})=>z({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),aW=Ae(nW,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),Ly=M.forwardRef(function(t,n){var r,o,s,a,c,u;const A=Ht({name:"MuiModal",props:t}),{BackdropComponent:p=aW,BackdropProps:h,className:C,closeAfterTransition:m=!1,children:I,container:B,component:v,components:S={},componentsProps:O={},disableAutoFocus:x=!1,disableEnforceFocus:R=!1,disableEscapeKeyDown:P=!1,disablePortal:k=!1,disableRestoreFocus:F=!1,disableScrollLock:G=!1,hideBackdrop:K=!1,keepMounted:$=!1,onBackdropClick:Y,open:ie,slotProps:se,slots:X}=A,Z=Ne(A,oW),H=z({},A,{closeAfterTransition:m,disableAutoFocus:x,disableEnforceFocus:R,disableEscapeKeyDown:P,disablePortal:k,disableRestoreFocus:F,disableScrollLock:G,hideBackdrop:K,keepMounted:$}),{getRootProps:J,getBackdropProps:L,getTransitionProps:_,portalRef:V,isTopModal:q,exited:le,hasTransition:pe}=Hz(z({},H,{rootRef:n})),de=z({},H,{exited:le}),ge=iW(de),he={};if(I.props.tabIndex===void 0&&(he.tabIndex="-1"),pe){const{onEnter:qe,onExited:fe}=_();he.onEnter=qe,he.onExited=fe}const Be=(r=(o=X==null?void 0:X.root)!=null?o:S.Root)!=null?r:sW,Ee=(s=(a=X==null?void 0:X.backdrop)!=null?a:S.Backdrop)!=null?s:p,Ce=(c=se==null?void 0:se.root)!=null?c:O.root,Ie=(u=se==null?void 0:se.backdrop)!=null?u:O.backdrop,xe=pr.useSlotProps({elementType:Be,externalSlotProps:Ce,externalForwardedProps:Z,getSlotProps:J,additionalProps:{ref:n,as:v},ownerState:de,className:Ge(C,Ce==null?void 0:Ce.className,ge==null?void 0:ge.root,!de.open&&de.exited&&(ge==null?void 0:ge.hidden))}),ue=pr.useSlotProps({elementType:Ee,externalSlotProps:Ie,additionalProps:h,getSlotProps:qe=>L(z({},qe,{onClick:fe=>{Y&&Y(fe),qe!=null&&qe.onClick&&qe.onClick(fe)}})),className:Ge(Ie==null?void 0:Ie.className,h==null?void 0:h.className,ge==null?void 0:ge.backdrop),ownerState:de});return!$&&!ie&&(!pe||le)?null:g.jsx(La,{ref:V,container:B,disablePortal:k,children:g.jsxs(Be,z({},xe,{children:[!K&&p?g.jsx(Ee,z({},ue)):null,g.jsx(ou,{disableEnforceFocus:R,disableAutoFocus:x,disableRestoreFocus:F,isEnabled:q,open:ie,children:M.cloneElement(I,he)})]}))})});process.env.NODE_ENV!=="production"&&(Ly.propTypes={BackdropComponent:f.elementType,BackdropProps:f.object,children:ws.isRequired,classes:f.object,className:f.string,closeAfterTransition:f.bool,component:f.elementType,components:f.shape({Backdrop:f.elementType,Root:f.elementType}),componentsProps:f.shape({backdrop:f.oneOfType([f.func,f.object]),root:f.oneOfType([f.func,f.object])}),container:f.oneOfType([hi,f.func]),disableAutoFocus:f.bool,disableEnforceFocus:f.bool,disableEscapeKeyDown:f.bool,disablePortal:f.bool,disableRestoreFocus:f.bool,disableScrollLock:f.bool,hideBackdrop:f.bool,keepMounted:f.bool,onBackdropClick:f.func,onClose:f.func,onTransitionEnter:f.func,onTransitionExited:f.func,open:f.bool.isRequired,slotProps:f.shape({backdrop:f.oneOfType([f.func,f.object]),root:f.oneOfType([f.func,f.object])}),slots:f.shape({backdrop:f.elementType,root:f.elementType}),sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object])});const lW=Ly;var Qp={},cW=_u;Object.defineProperty(Qp,"__esModule",{value:!0});var Ny=Qp.default=void 0,uW=cW($u()),AW=g;Ny=Qp.default=(0,uW.default)((0,AW.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z"}),"History");var xp={},dW=_u;Object.defineProperty(xp,"__esModule",{value:!0});var Vy=xp.default=void 0,gW=dW($u()),fW=g;Vy=xp.default=(0,gW.default)((0,fW.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var pW=function(e){var t=e.children,n=e.editor,r=e.preferenceKey,o=e.openButtonLabel,s=o===void 0?"ra.configurable.customize":o,a=e.sx,c="preferences.".concat(r),u=ce.usePreferencesEditor(),A=!!u,p=ce.useTranslate(),h=u||{},C=h.isEnabled,m=h.setEditor,I=h.preferenceKey,B=h.setPreferenceKey,v=c===I,S=Q.useRef(v),O=Q.useRef(null),x=Q.useState(!1),R=x[0],P=x[1];if(Q.useEffect(function(){S.current=v},[v]),Q.useEffect(function(){return function(){S.current&&(B&&B(null),m&&m(null))}},[m,B]),!A)return t;var k=function(){m(Q.cloneElement(n,{preferenceKey:c,key:c})),B(c)},F=function(){P(!0)},G=function(){P(!1)};return M.createElement(ce.PreferenceKeyContextProvider,{value:c},M.createElement(hW,{className:yy(Kr.root,C&&Kr.editMode,v&&Kr.editorActive),sx:a,ref:O,onMouseEnter:C?F:void 0,onMouseLeave:C?G:void 0},t),M.createElement(y.Popover,{open:C&&(R||v),sx:{pointerEvents:"none","& .MuiPaper-root":{pointerEvents:"auto",borderRadius:10,padding:"2px",lineHeight:0,backgroundColor:"warning.light",color:"warning.contrastText","&:hover":{cursor:"pointer"}}},anchorEl:O.current,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"center"},onClose:G,PaperProps:{elevation:1,onMouseEnter:F,onMouseLeave:G,title:p(s),onClick:k},disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,disableScrollLock:!0,marginThreshold:8},M.createElement(Vy,{fontSize:"12px"})))},Sc="RaConfigurable",Kr={root:"".concat(Sc,"-root"),editMode:"".concat(Sc,"-editMode"),editorActive:"".concat(Sc,"-editorActive")},hW=Ae("span",{name:Sc,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={position:"relative",display:"inline-block"},t["&.".concat(Kr.editMode)]={transition:n.transitions.create("outline"),outline:"".concat(y.alpha(n.palette.warning.main,.3)," solid 2px")},t["&.".concat(Kr.editMode,":hover ")]={outline:"".concat(y.alpha(n.palette.warning.main,.5)," solid 2px")},t["&.".concat(Kr.editMode,".").concat(Kr.editorActive," , &.").concat(Kr.editMode,".").concat(Kr.editorActive,":hover ")]={outline:"".concat(n.palette.warning.main," solid 2px")},t}),li=globalThis&&globalThis.__assign||function(){return li=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},li.apply(this,arguments)},CW=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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},mW=function(e){var t=e.title,n=e.defaultTitle,r=e.className,o=CW(e,["title","defaultTitle","className"]),s=ce.usePreference()[0],a=ce.useTranslate(),c=ce.useRecordContext();return s?M.createElement("span",li({className:r},o),a(s,li(li({},c),{_:s}))):M.createElement("span",{className:r},t?typeof t=="string"?M.createElement("span",li({},o),a(t,{_:t})):t:M.createElement("span",li({},o),n))},iu=globalThis&&globalThis.__assign||function(){return iu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},iu.apply(this,arguments)},EW=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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},IW=function(){var e=ce.usePreferenceInput();return M.createElement("form",null,M.createElement(y.TextField,iu({label:"title",variant:"filled",size:"small",fullWidth:!0,sx:{mb:1}},e)))},BW=function(e){var t=e.preferenceKey,n=EW(e,["preferenceKey"]),r=Ct.useLocation().pathname;return M.createElement(pW,{editor:M.createElement(IW,null),preferenceKey:t||"".concat(r,".title"),sx:{"&.RaConfigurable-editMode":{margin:"2px"}}},M.createElement(mW,iu({},n)))},Yg=globalThis&&globalThis.__assign||function(){return Yg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Yg.apply(this,arguments)},vW=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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},Hy=function(e){var t=e.defaultTitle,n=e.title,r=e.preferenceKey,o=vW(e,["defaultTitle","title","preferenceKey"]),s=Q.useState(function(){return typeof document<"u"?document.getElementById("react-admin-title"):null}),a=s[0],c=s[1];return Q.useEffect(function(){c(function(u){var A=typeof document<"u"&&document.body.contains(u);return u&&A?u:typeof document<"u"?document.getElementById("react-admin-title"):null})},[]),a?(ce.warning(!t&&!n,"Missing title prop in <Title> element"),os.createPortal(M.createElement(BW,Yg({title:n,defaultTitle:t,preferenceKey:r},o)),a)):null},zy=f.oneOfType([f.string,f.element]);Hy.propTypes={defaultTitle:f.string,className:f.string,record:f.any,title:zy};var bW=function(e){var t=hs.useLocation().pathname,n=Q.useRef(t);Q.useEffect(function(){t!==n.current&&e()},[t,e])},yW=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),t.length!==n.length||t.some(function(r,o){return!Object.is(r,n[o])})},FI={error:null},QW=function(e){sp(t,e);function t(){for(var r,o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return r=e.call.apply(e,[this].concat(s))||this,r.state=FI,r.resetErrorBoundary=function(){for(var c,u=arguments.length,A=new Array(u),p=0;p<u;p++)A[p]=arguments[p];r.props.onReset==null||(c=r.props).onReset.apply(c,A),r.reset()},r}t.getDerivedStateFromError=function(o){return{error:o}};var n=t.prototype;return n.reset=function(){this.setState(FI)},n.componentDidCatch=function(o,s){var a,c;(a=(c=this.props).onError)==null||a.call(c,o,s)},n.componentDidUpdate=function(o,s){var a=this.state.error,c=this.props.resetKeys;if(a!==null&&s.error!==null&&yW(o.resetKeys,c)){var u,A;(u=(A=this.props).onResetKeysChange)==null||u.call(A,o.resetKeys,c),this.reset()}},n.render=function(){var o=this.state.error,s=this.props,a=s.fallbackRender,c=s.FallbackComponent,u=s.fallback;if(o!==null){var A={error:o,resetErrorBoundary:this.resetErrorBoundary};if(M.isValidElement(u))return u;if(typeof a=="function")return a(A);if(c)return M.createElement(c,A);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(M.Component),Gg=globalThis&&globalThis.__assign||function(){return Gg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Gg.apply(this,arguments)},xW=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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},Wy=function(e){var t=e.className,n=e.loadingPrimary,r=n===void 0?"ra.page.loading":n,o=e.loadingSecondary,s=o===void 0?"ra.message.loading":o,a=xW(e,["className","loadingPrimary","loadingSecondary"]),c=ce.useTimeout(1e3),u=ce.useTranslate();return c?M.createElement(wW,Gg({className:t},a),M.createElement("div",{className:su.message},M.createElement(dp,{className:su.icon}),M.createElement(y.Typography,{variant:"h5",mt:3,color:"text.secondary"},u(r,{_:r})),M.createElement(y.Typography,{variant:"body2"},u(s,{_:s})))):null};Wy.propTypes={className:f.string,loadingPrimary:f.string,loadingSecondary:f.string};var Pc="RaLoading",su={root:"".concat(Pc,"-root"),icon:"".concat(Pc,"-icon"),message:"".concat(Pc,"-message")},wW=Ae("div",{name:Pc,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100%"},t["& .".concat(su.message)]={textAlign:"center",fontFamily:"Roboto, sans-serif",color:n.palette.text.disabled,paddingTop:"1em",paddingBottom:"1em"},t["& .".concat(su.icon)]={width:"9em",height:"9em"},t});function TW(e){return Dt("MuiToolbar",e)}Vt("MuiToolbar",["root","gutters","regular","dense"]);const SW=["className","component","disableGutters","variant"],PW=e=>{const{classes:t,disableGutters:n,variant:r}=e;return nn({root:["root",!n&&"gutters",r]},TW,t)},RW=Ae("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(({theme:e,ownerState:t})=>z({position:"relative",display:"flex",alignItems:"center"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},t.variant==="dense"&&{minHeight:48}),({theme:e,ownerState:t})=>t.variant==="regular"&&e.mixins.toolbar),Uy=M.forwardRef(function(t,n){const r=Ht({props:t,name:"MuiToolbar"}),{className:o,component:s="div",disableGutters:a=!1,variant:c="regular"}=r,u=Ne(r,SW),A=z({},r,{component:s,disableGutters:a,variant:c}),p=PW(A);return g.jsx(RW,z({as:s,className:Ge(p.root,o),ref:n,ownerState:A},u))});process.env.NODE_ENV!=="production"&&(Uy.propTypes={children:f.node,classes:f.object,className:f.string,component:f.elementType,disableGutters:f.bool,sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),variant:f.oneOfType([f.oneOf(["dense","regular"]),f.string])});const OW=Uy;var wp={},jW=_u;Object.defineProperty(wp,"__esModule",{value:!0});var Yy=wp.default=void 0,DW=jW($u()),MW=g;Yy=wp.default=(0,DW.default)((0,MW.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 11h7V4z"}),"Refresh");const kW=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function Kg(e){return`scale(${e}, ${e**2})`}const FW={entering:{opacity:1,transform:Kg(1)},entered:{opacity:1,transform:"none"}},tg=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Tp=M.forwardRef(function(t,n){const{addEndListener:r,appear:o=!0,children:s,easing:a,in:c,onEnter:u,onEntered:A,onEntering:p,onExit:h,onExited:C,onExiting:m,style:I,timeout:B="auto",TransitionComponent:v=ap}=t,S=Ne(t,kW),O=M.useRef(),x=M.useRef(),R=bt(),P=M.useRef(null),k=kn(P,s.ref,n),F=Z=>H=>{if(Z){const J=P.current;H===void 0?Z(J):Z(J,H)}},G=F(p),K=F((Z,H)=>{yp(Z);const{duration:J,delay:L,easing:_}=vs({style:I,timeout:B,easing:a},{mode:"enter"});let V;B==="auto"?(V=R.transitions.getAutoHeightDuration(Z.clientHeight),x.current=V):V=J,Z.style.transition=[R.transitions.create("opacity",{duration:V,delay:L}),R.transitions.create("transform",{duration:tg?V:V*.666,delay:L,easing:_})].join(","),u&&u(Z,H)}),$=F(A),Y=F(m),ie=F(Z=>{const{duration:H,delay:J,easing:L}=vs({style:I,timeout:B,easing:a},{mode:"exit"});let _;B==="auto"?(_=R.transitions.getAutoHeightDuration(Z.clientHeight),x.current=_):_=H,Z.style.transition=[R.transitions.create("opacity",{duration:_,delay:J}),R.transitions.create("transform",{duration:tg?_:_*.666,delay:tg?J:J||_*.333,easing:L})].join(","),Z.style.opacity=0,Z.style.transform=Kg(.75),h&&h(Z)}),se=F(C),X=Z=>{B==="auto"&&(O.current=setTimeout(Z,x.current||0)),r&&r(P.current,Z)};return M.useEffect(()=>()=>{clearTimeout(O.current)},[]),g.jsx(v,z({appear:o,in:c,nodeRef:P,onEnter:K,onEntered:$,onEntering:G,onExit:ie,onExited:se,onExiting:Y,addEndListener:X,timeout:B==="auto"?null:B},S,{children:(Z,H)=>M.cloneElement(s,z({style:z({opacity:0,transform:Kg(.75),visibility:Z==="exited"&&!c?"hidden":void 0},FW[Z],I,s.props.style),ref:k},H))}))});process.env.NODE_ENV!=="production"&&(Tp.propTypes={addEndListener:f.func,appear:f.bool,children:ws.isRequired,easing:f.oneOfType([f.shape({enter:f.string,exit:f.string}),f.string]),in:f.bool,onEnter:f.func,onEntered:f.func,onEntering:f.func,onExit:f.func,onExited:f.func,onExiting:f.func,style:f.object,timeout:f.oneOfType([f.oneOf(["auto"]),f.number,f.shape({appear:f.number,enter:f.number,exit:f.number})])});Tp.muiSupportAuto=!0;const LI=Tp;var Bn="top",ir="bottom",sr="right",vn="left",Sp="auto",tl=[Bn,ir,sr,vn],bs="start",Na="end",LW="clippingParents",Gy="viewport",Aa="popper",NW="reference",NI=tl.reduce(function(e,t){return e.concat([t+"-"+bs,t+"-"+Na])},[]),Ky=[].concat(tl,[Sp]).reduce(function(e,t){return e.concat([t,t+"-"+bs,t+"-"+Na])},[]),VW="beforeRead",HW="read",zW="afterRead",WW="beforeMain",UW="main",YW="afterMain",GW="beforeWrite",KW="write",qW="afterWrite",JW=[VW,HW,zW,WW,UW,YW,GW,KW,qW];function Rr(e){return e?(e.nodeName||"").toLowerCase():null}function Ln(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ei(e){var t=Ln(e).Element;return e instanceof t||e instanceof Element}function tr(e){var t=Ln(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Pp(e){if(typeof ShadowRoot>"u")return!1;var t=Ln(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function XW(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!tr(s)||!Rr(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(a){var c=o[a];c===!1?s.removeAttribute(a):s.setAttribute(a,c===!0?"":c)}))})}function ZW(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 o=t.elements[r],s=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),c=a.reduce(function(u,A){return u[A]="",u},{});!tr(o)||!Rr(o)||(Object.assign(o.style,c),Object.keys(s).forEach(function(u){o.removeAttribute(u)}))})}}const _W={name:"applyStyles",enabled:!0,phase:"write",fn:XW,effect:ZW,requires:["computeStyles"]};function Sr(e){return e.split("-")[0]}var fi=Math.max,au=Math.min,ys=Math.round;function qg(){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 qy(){return!/^((?!chrome|android).)*safari/i.test(qg())}function Qs(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&tr(e)&&(o=e.offsetWidth>0&&ys(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&ys(r.height)/e.offsetHeight||1);var a=Ei(e)?Ln(e):window,c=a.visualViewport,u=!qy()&&n,A=(r.left+(u&&c?c.offsetLeft:0))/o,p=(r.top+(u&&c?c.offsetTop:0))/s,h=r.width/o,C=r.height/s;return{width:h,height:C,top:p,right:A+h,bottom:p+C,left:A,x:A,y:p}}function Rp(e){var t=Qs(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 Jy(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Pp(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function no(e){return Ln(e).getComputedStyle(e)}function $W(e){return["table","td","th"].indexOf(Rr(e))>=0}function Fo(e){return((Ei(e)?e.ownerDocument:e.document)||window.document).documentElement}function eA(e){return Rr(e)==="html"?e:e.assignedSlot||e.parentNode||(Pp(e)?e.host:null)||Fo(e)}function VI(e){return!tr(e)||no(e).position==="fixed"?null:e.offsetParent}function eU(e){var t=/firefox/i.test(qg()),n=/Trident/i.test(qg());if(n&&tr(e)){var r=no(e);if(r.position==="fixed")return null}var o=eA(e);for(Pp(o)&&(o=o.host);tr(o)&&["html","body"].indexOf(Rr(o))<0;){var s=no(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function nl(e){for(var t=Ln(e),n=VI(e);n&&$W(n)&&no(n).position==="static";)n=VI(n);return n&&(Rr(n)==="html"||Rr(n)==="body"&&no(n).position==="static")?t:n||eU(e)||t}function Op(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function wa(e,t,n){return fi(e,au(t,n))}function tU(e,t,n){var r=wa(e,t,n);return r>n?n:r}function Xy(){return{top:0,right:0,bottom:0,left:0}}function Zy(e){return Object.assign({},Xy(),e)}function _y(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var nU=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Zy(typeof t!="number"?t:_y(t,tl))};function rU(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,a=n.modifiersData.popperOffsets,c=Sr(n.placement),u=Op(c),A=[vn,sr].indexOf(c)>=0,p=A?"height":"width";if(!(!s||!a)){var h=nU(o.padding,n),C=Rp(s),m=u==="y"?Bn:vn,I=u==="y"?ir:sr,B=n.rects.reference[p]+n.rects.reference[u]-a[u]-n.rects.popper[p],v=a[u]-n.rects.reference[u],S=nl(s),O=S?u==="y"?S.clientHeight||0:S.clientWidth||0:0,x=B/2-v/2,R=h[m],P=O-C[p]-h[I],k=O/2-C[p]/2+x,F=wa(R,k,P),G=u;n.modifiersData[r]=(t={},t[G]=F,t.centerOffset=F-k,t)}}function oU(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||Jy(t.elements.popper,o)&&(t.elements.arrow=o))}const iU={name:"arrow",enabled:!0,phase:"main",fn:rU,effect:oU,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xs(e){return e.split("-")[1]}var sU={top:"auto",right:"auto",bottom:"auto",left:"auto"};function aU(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:ys(n*o)/o||0,y:ys(r*o)/o||0}}function HI(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,a=e.offsets,c=e.position,u=e.gpuAcceleration,A=e.adaptive,p=e.roundOffsets,h=e.isFixed,C=a.x,m=C===void 0?0:C,I=a.y,B=I===void 0?0:I,v=typeof p=="function"?p({x:m,y:B}):{x:m,y:B};m=v.x,B=v.y;var S=a.hasOwnProperty("x"),O=a.hasOwnProperty("y"),x=vn,R=Bn,P=window;if(A){var k=nl(n),F="clientHeight",G="clientWidth";if(k===Ln(n)&&(k=Fo(n),no(k).position!=="static"&&c==="absolute"&&(F="scrollHeight",G="scrollWidth")),k=k,o===Bn||(o===vn||o===sr)&&s===Na){R=ir;var K=h&&k===P&&P.visualViewport?P.visualViewport.height:k[F];B-=K-r.height,B*=u?1:-1}if(o===vn||(o===Bn||o===ir)&&s===Na){x=sr;var $=h&&k===P&&P.visualViewport?P.visualViewport.width:k[G];m-=$-r.width,m*=u?1:-1}}var Y=Object.assign({position:c},A&&sU),ie=p===!0?aU({x:m,y:B},Ln(n)):{x:m,y:B};if(m=ie.x,B=ie.y,u){var se;return Object.assign({},Y,(se={},se[R]=O?"0":"",se[x]=S?"0":"",se.transform=(P.devicePixelRatio||1)<=1?"translate("+m+"px, "+B+"px)":"translate3d("+m+"px, "+B+"px, 0)",se))}return Object.assign({},Y,(t={},t[R]=O?B+"px":"",t[x]=S?m+"px":"",t.transform="",t))}function lU(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,a=s===void 0?!0:s,c=n.roundOffsets,u=c===void 0?!0:c,A={placement:Sr(t.placement),variation:xs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,HI(Object.assign({},A,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,HI(Object.assign({},A,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const cU={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:lU,data:{}};var pc={passive:!0};function uU(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,a=r.resize,c=a===void 0?!0:a,u=Ln(t.elements.popper),A=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&A.forEach(function(p){p.addEventListener("scroll",n.update,pc)}),c&&u.addEventListener("resize",n.update,pc),function(){s&&A.forEach(function(p){p.removeEventListener("scroll",n.update,pc)}),c&&u.removeEventListener("resize",n.update,pc)}}const AU={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:uU,data:{}};var dU={left:"right",right:"left",bottom:"top",top:"bottom"};function Rc(e){return e.replace(/left|right|bottom|top/g,function(t){return dU[t]})}var gU={start:"end",end:"start"};function zI(e){return e.replace(/start|end/g,function(t){return gU[t]})}function jp(e){var t=Ln(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Dp(e){return Qs(Fo(e)).left+jp(e).scrollLeft}function fU(e,t){var n=Ln(e),r=Fo(e),o=n.visualViewport,s=r.clientWidth,a=r.clientHeight,c=0,u=0;if(o){s=o.width,a=o.height;var A=qy();(A||!A&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}return{width:s,height:a,x:c+Dp(e),y:u}}function pU(e){var t,n=Fo(e),r=jp(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=fi(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=fi(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),c=-r.scrollLeft+Dp(e),u=-r.scrollTop;return no(o||n).direction==="rtl"&&(c+=fi(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:a,x:c,y:u}}function Mp(e){var t=no(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function $y(e){return["html","body","#document"].indexOf(Rr(e))>=0?e.ownerDocument.body:tr(e)&&Mp(e)?e:$y(eA(e))}function Ta(e,t){var n;t===void 0&&(t=[]);var r=$y(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Ln(r),a=o?[s].concat(s.visualViewport||[],Mp(r)?r:[]):r,c=t.concat(a);return o?c:c.concat(Ta(eA(a)))}function Jg(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function hU(e,t){var n=Qs(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 WI(e,t,n){return t===Gy?Jg(fU(e,n)):Ei(t)?hU(t,n):Jg(pU(Fo(e)))}function CU(e){var t=Ta(eA(e)),n=["absolute","fixed"].indexOf(no(e).position)>=0,r=n&&tr(e)?nl(e):e;return Ei(r)?t.filter(function(o){return Ei(o)&&Jy(o,r)&&Rr(o)!=="body"}):[]}function mU(e,t,n,r){var o=t==="clippingParents"?CU(e):[].concat(t),s=[].concat(o,[n]),a=s[0],c=s.reduce(function(u,A){var p=WI(e,A,r);return u.top=fi(p.top,u.top),u.right=au(p.right,u.right),u.bottom=au(p.bottom,u.bottom),u.left=fi(p.left,u.left),u},WI(e,a,r));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function eQ(e){var t=e.reference,n=e.element,r=e.placement,o=r?Sr(r):null,s=r?xs(r):null,a=t.x+t.width/2-n.width/2,c=t.y+t.height/2-n.height/2,u;switch(o){case Bn:u={x:a,y:t.y-n.height};break;case ir:u={x:a,y:t.y+t.height};break;case sr:u={x:t.x+t.width,y:c};break;case vn:u={x:t.x-n.width,y:c};break;default:u={x:t.x,y:t.y}}var A=o?Op(o):null;if(A!=null){var p=A==="y"?"height":"width";switch(s){case bs:u[A]=u[A]-(t[p]/2-n[p]/2);break;case Na:u[A]=u[A]+(t[p]/2-n[p]/2);break}}return u}function Va(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,a=s===void 0?e.strategy:s,c=n.boundary,u=c===void 0?LW:c,A=n.rootBoundary,p=A===void 0?Gy:A,h=n.elementContext,C=h===void 0?Aa:h,m=n.altBoundary,I=m===void 0?!1:m,B=n.padding,v=B===void 0?0:B,S=Zy(typeof v!="number"?v:_y(v,tl)),O=C===Aa?NW:Aa,x=e.rects.popper,R=e.elements[I?O:C],P=mU(Ei(R)?R:R.contextElement||Fo(e.elements.popper),u,p,a),k=Qs(e.elements.reference),F=eQ({reference:k,element:x,strategy:"absolute",placement:o}),G=Jg(Object.assign({},x,F)),K=C===Aa?G:k,$={top:P.top-K.top+S.top,bottom:K.bottom-P.bottom+S.bottom,left:P.left-K.left+S.left,right:K.right-P.right+S.right},Y=e.modifiersData.offset;if(C===Aa&&Y){var ie=Y[o];Object.keys($).forEach(function(se){var X=[sr,ir].indexOf(se)>=0?1:-1,Z=[Bn,ir].indexOf(se)>=0?"y":"x";$[se]+=ie[Z]*X})}return $}function EU(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,a=n.padding,c=n.flipVariations,u=n.allowedAutoPlacements,A=u===void 0?Ky:u,p=xs(r),h=p?c?NI:NI.filter(function(I){return xs(I)===p}):tl,C=h.filter(function(I){return A.indexOf(I)>=0});C.length===0&&(C=h);var m=C.reduce(function(I,B){return I[B]=Va(e,{placement:B,boundary:o,rootBoundary:s,padding:a})[Sr(B)],I},{});return Object.keys(m).sort(function(I,B){return m[I]-m[B]})}function IU(e){if(Sr(e)===Sp)return[];var t=Rc(e);return[zI(e),t,zI(t)]}function BU(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,a=n.altAxis,c=a===void 0?!0:a,u=n.fallbackPlacements,A=n.padding,p=n.boundary,h=n.rootBoundary,C=n.altBoundary,m=n.flipVariations,I=m===void 0?!0:m,B=n.allowedAutoPlacements,v=t.options.placement,S=Sr(v),O=S===v,x=u||(O||!I?[Rc(v)]:IU(v)),R=[v].concat(x).reduce(function(de,ge){return de.concat(Sr(ge)===Sp?EU(t,{placement:ge,boundary:p,rootBoundary:h,padding:A,flipVariations:I,allowedAutoPlacements:B}):ge)},[]),P=t.rects.reference,k=t.rects.popper,F=new Map,G=!0,K=R[0],$=0;$<R.length;$++){var Y=R[$],ie=Sr(Y),se=xs(Y)===bs,X=[Bn,ir].indexOf(ie)>=0,Z=X?"width":"height",H=Va(t,{placement:Y,boundary:p,rootBoundary:h,altBoundary:C,padding:A}),J=X?se?sr:vn:se?ir:Bn;P[Z]>k[Z]&&(J=Rc(J));var L=Rc(J),_=[];if(s&&_.push(H[ie]<=0),c&&_.push(H[J]<=0,H[L]<=0),_.every(function(de){return de})){K=Y,G=!1;break}F.set(Y,_)}if(G)for(var V=I?3:1,q=function(ge){var he=R.find(function(Be){var Ee=F.get(Be);if(Ee)return Ee.slice(0,ge).every(function(Ce){return Ce})});if(he)return K=he,"break"},le=V;le>0;le--){var pe=q(le);if(pe==="break")break}t.placement!==K&&(t.modifiersData[r]._skip=!0,t.placement=K,t.reset=!0)}}const vU={name:"flip",enabled:!0,phase:"main",fn:BU,requiresIfExists:["offset"],data:{_skip:!1}};function UI(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 YI(e){return[Bn,sr,ir,vn].some(function(t){return e[t]>=0})}function bU(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,a=Va(t,{elementContext:"reference"}),c=Va(t,{altBoundary:!0}),u=UI(a,r),A=UI(c,o,s),p=YI(u),h=YI(A);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:A,isReferenceHidden:p,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":h})}const yU={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:bU};function QU(e,t,n){var r=Sr(e),o=[vn,Bn].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=s[0],c=s[1];return a=a||0,c=(c||0)*o,[vn,sr].indexOf(r)>=0?{x:c,y:a}:{x:a,y:c}}function xU(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,a=Ky.reduce(function(p,h){return p[h]=QU(h,t.rects,s),p},{}),c=a[t.placement],u=c.x,A=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=A),t.modifiersData[r]=a}const wU={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:xU};function TU(e){var t=e.state,n=e.name;t.modifiersData[n]=eQ({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const SU={name:"popperOffsets",enabled:!0,phase:"read",fn:TU,data:{}};function PU(e){return e==="x"?"y":"x"}function RU(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,a=n.altAxis,c=a===void 0?!1:a,u=n.boundary,A=n.rootBoundary,p=n.altBoundary,h=n.padding,C=n.tether,m=C===void 0?!0:C,I=n.tetherOffset,B=I===void 0?0:I,v=Va(t,{boundary:u,rootBoundary:A,padding:h,altBoundary:p}),S=Sr(t.placement),O=xs(t.placement),x=!O,R=Op(S),P=PU(R),k=t.modifiersData.popperOffsets,F=t.rects.reference,G=t.rects.popper,K=typeof B=="function"?B(Object.assign({},t.rects,{placement:t.placement})):B,$=typeof K=="number"?{mainAxis:K,altAxis:K}:Object.assign({mainAxis:0,altAxis:0},K),Y=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,ie={x:0,y:0};if(k){if(s){var se,X=R==="y"?Bn:vn,Z=R==="y"?ir:sr,H=R==="y"?"height":"width",J=k[R],L=J+v[X],_=J-v[Z],V=m?-G[H]/2:0,q=O===bs?F[H]:G[H],le=O===bs?-G[H]:-F[H],pe=t.elements.arrow,de=m&&pe?Rp(pe):{width:0,height:0},ge=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Xy(),he=ge[X],Be=ge[Z],Ee=wa(0,F[H],de[H]),Ce=x?F[H]/2-V-Ee-he-$.mainAxis:q-Ee-he-$.mainAxis,Ie=x?-F[H]/2+V+Ee+Be+$.mainAxis:le+Ee+Be+$.mainAxis,xe=t.elements.arrow&&nl(t.elements.arrow),ue=xe?R==="y"?xe.clientTop||0:xe.clientLeft||0:0,qe=(se=Y==null?void 0:Y[R])!=null?se:0,fe=J+Ce-qe-ue,st=J+Ie-qe,zt=wa(m?au(L,fe):L,J,m?fi(_,st):_);k[R]=zt,ie[R]=zt-J}if(c){var ft,yt=R==="x"?Bn:vn,Ir=R==="x"?ir:sr,Et=k[P],pt=P==="y"?"height":"width",ct=Et+v[yt],kt=Et-v[Ir],Ft=[Bn,vn].indexOf(S)!==-1,Se=(ft=Y==null?void 0:Y[P])!=null?ft:0,ke=Ft?ct:Et-F[pt]-G[pt]-Se+$.altAxis,we=Ft?Et+F[pt]+G[pt]-Se-$.altAxis:kt,We=m&&Ft?tU(ke,Et,we):wa(m?ke:ct,Et,m?we:kt);k[P]=We,ie[P]=We-Et}t.modifiersData[r]=ie}}const OU={name:"preventOverflow",enabled:!0,phase:"main",fn:RU,requiresIfExists:["offset"]};function jU(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function DU(e){return e===Ln(e)||!tr(e)?jp(e):jU(e)}function MU(e){var t=e.getBoundingClientRect(),n=ys(t.width)/e.offsetWidth||1,r=ys(t.height)/e.offsetHeight||1;return n!==1||r!==1}function kU(e,t,n){n===void 0&&(n=!1);var r=tr(t),o=tr(t)&&MU(t),s=Fo(t),a=Qs(e,o,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Rr(t)!=="body"||Mp(s))&&(c=DU(t)),tr(t)?(u=Qs(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=Dp(s))),{x:a.left+c.scrollLeft-u.x,y:a.top+c.scrollTop-u.y,width:a.width,height:a.height}}function FU(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(c){if(!n.has(c)){var u=t.get(c);u&&o(u)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function LU(e){var t=FU(e);return JW.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function NU(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function VU(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var GI={placement:"bottom",modifiers:[],strategy:"absolute"};function KI(){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 HU(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?GI:o;return function(c,u,A){A===void 0&&(A=s);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},GI,s),modifiersData:{},elements:{reference:c,popper:u},attributes:{},styles:{}},h=[],C=!1,m={state:p,setOptions:function(S){var O=typeof S=="function"?S(p.options):S;B(),p.options=Object.assign({},s,p.options,O),p.scrollParents={reference:Ei(c)?Ta(c):c.contextElement?Ta(c.contextElement):[],popper:Ta(u)};var x=LU(VU([].concat(r,p.options.modifiers)));return p.orderedModifiers=x.filter(function(R){return R.enabled}),I(),m.update()},forceUpdate:function(){if(!C){var S=p.elements,O=S.reference,x=S.popper;if(KI(O,x)){p.rects={reference:kU(O,nl(x),p.options.strategy==="fixed"),popper:Rp(x)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function($){return p.modifiersData[$.name]=Object.assign({},$.data)});for(var R=0;R<p.orderedModifiers.length;R++){if(p.reset===!0){p.reset=!1,R=-1;continue}var P=p.orderedModifiers[R],k=P.fn,F=P.options,G=F===void 0?{}:F,K=P.name;typeof k=="function"&&(p=k({state:p,options:G,name:K,instance:m})||p)}}}},update:NU(function(){return new Promise(function(v){m.forceUpdate(),v(p)})}),destroy:function(){B(),C=!0}};if(!KI(c,u))return m;m.setOptions(A).then(function(v){!C&&A.onFirstUpdate&&A.onFirstUpdate(v)});function I(){p.orderedModifiers.forEach(function(v){var S=v.name,O=v.options,x=O===void 0?{}:O,R=v.effect;if(typeof R=="function"){var P=R({state:p,name:S,instance:m,options:x}),k=function(){};h.push(P||k)}})}function B(){h.forEach(function(v){return v()}),h=[]}return m}}var zU=[AU,SU,cU,_W,wU,vU,OU,iU,yU],WU=HU({defaultModifiers:zU});function UU(e){return Dt("MuiPopper",e)}Vt("MuiPopper",["root"]);const YU=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],GU=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function KU(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 lu(e){return typeof e=="function"?e():e}function tA(e){return e.nodeType!==void 0}function qU(e){return!tA(e)}const JU=()=>nn({root:["root"]},Tz(UU)),XU={},ZU=M.forwardRef(function(t,n){var r;const{anchorEl:o,children:s,direction:a,disablePortal:c,modifiers:u,open:A,placement:p,popperOptions:h,popperRef:C,slotProps:m={},slots:I={},TransitionProps:B}=t,v=Ne(t,YU),S=M.useRef(null),O=kn(S,n),x=M.useRef(null),R=kn(x,C),P=M.useRef(R);ms(()=>{P.current=R},[R]),M.useImperativeHandle(C,()=>x.current,[]);const k=KU(p,a),[F,G]=M.useState(k),[K,$]=M.useState(lu(o));M.useEffect(()=>{x.current&&x.current.forceUpdate()}),M.useEffect(()=>{o&&$(lu(o))},[o]),ms(()=>{if(!K||!A)return;const Z=L=>{G(L.placement)};if(process.env.NODE_ENV!=="production"&&K&&tA(K)&&K.nodeType===1){const L=K.getBoundingClientRect();process.env.NODE_ENV!=="test"&&L.top===0&&L.left===0&&L.right===0&&L.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(`
|