@applica-software-guru/react-admin 1.1.111 → 1.1.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -199,7 +199,7 @@ function print() { __p += __j.call(arguments, '') }
199
199
  animation: ${0} 1.4s linear infinite;
200
200
  `),e4)),o4=ue("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),i4=ue("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Te(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>U({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&&Ut.css(Am||(Am=vl`
201
201
  animation: ${0} 1.4s ease-in-out infinite;
202
- `),t4)),dm=V.forwardRef(function(t,n){const r=Gt({props:t,name:"MuiCircularProgress"}),{className:i,color:a="primary",disableShrink:l=!1,size:u=40,style:A,thickness:f=3.6,value:p=0,variant:C="indeterminate"}=r,h=Ke(r,$O),m=U({},r,{color:a,disableShrink:l,size:u,thickness:f,value:p,variant:C}),I=n4(m),B={},v={},M={};if(C==="determinate"){const j=2*Math.PI*((oo-f)/2);B.strokeDasharray=j.toFixed(3),M["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*j).toFixed(3)}px`,v.transform="rotate(-90deg)"}return g.jsx(r4,U({className:Xe(I.root,i),style:U({width:u,height:u},v,A),ownerState:m,ref:n,role:"progressbar"},M,h,{children:g.jsx(o4,{className:I.svg,ownerState:m,viewBox:`${oo/2} ${oo/2} ${oo} ${oo}`,children:g.jsx(i4,{className:I.circle,style:B,ownerState:m,cx:oo,cy:oo,r:(oo-f)/2,fill:"none",strokeWidth:f})})}))});process.env.NODE_ENV!=="production"&&(dm.propTypes={classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","primary","secondary","error","info","success","warning"]),c.string]),disableShrink:br(c.bool,e=>e.disableShrink&&e.variant&&e.variant!=="indeterminate"?new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect."):null),size:c.oneOfType([c.number,c.string]),style:c.object,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),thickness:c.number,value:c.number,variant:c.oneOf(["determinate","indeterminate"])});const fm=dm;function s4(e){return Vt("MuiLoadingButton",e)}const Mr=Yt("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),a4=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],l4=e=>{const{loading:t,loadingPosition:n,classes:r}=e,i={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Te(n)}`],endIcon:[t&&`endIconLoading${Te(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Te(n)}`]},a=ur.unstable_composeClasses(i,s4,r);return U({},r,a)},c4=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",u4=ue(ZO,{shouldForwardProp:e=>c4(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Mr.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Mr.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>U({[`& .${Mr.startIconLoadingStart}, & .${Mr.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}),[`&.${Mr.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Mr.startIconLoadingStart}, & .${Mr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Mr.startIconLoadingStart}, & .${Mr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),A4=ue("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Te(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>U({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})),gm=V.forwardRef(function(t,n){const r=Gt({props:t,name:"MuiLoadingButton"}),{children:i,disabled:a=!1,id:l,loading:u=!1,loadingIndicator:A,loadingPosition:f="center",variant:p="text"}=r,C=Ke(r,a4),h=yu(l),m=A??g.jsx(fm,{"aria-labelledby":h,color:"inherit",size:16}),I=U({},r,{disabled:a,loading:u,loadingIndicator:m,loadingPosition:f,variant:p}),B=l4(I),v=u?g.jsx(A4,{className:B.loadingIndicator,ownerState:I,children:m}):null;return g.jsxs(u4,U({disabled:a||u,id:h,ref:n},C,{variant:p,classes:B,ownerState:I,children:[I.loadingPosition==="end"?i:v,I.loadingPosition==="end"?v:i]}))});process.env.NODE_ENV!=="production"&&(gm.propTypes={children:c.node,classes:c.object,disabled:c.bool,id:c.string,loading:c.bool,loadingIndicator:c.node,loadingPosition:br(c.oneOf(["start","end","center"]),e=>e.loadingPosition==="start"&&!e.startIcon?new Error('MUI: The loadingPosition="start" should be used in combination with startIcon.'):e.loadingPosition==="end"&&!e.endIcon?new Error('MUI: The loadingPosition="end" should be used in combination with endIcon.'):null),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["contained","outlined","text"]),c.string])});const d4=gm;function XA({variant:e,theme:t,color:n,loadingPosition:r}){const i=$t(t,n),{lighter:a,main:l,dark:u,contrastText:A}=i,f=`${n}Button`,p=bi(t,f),C={"& .MuiLoadingButton-loadingIndicator":{color:l}},h={...r&&r!=="center"&&{color:l}},m={"&::after":{boxShadow:`0 0 6px 6px ${Ne(l,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${Ne(l,.9)}`},"&:focus-visible":{outline:`2px solid ${u}`,outlineOffset:2}};switch(e){case"contained":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...m};case"light":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...m};case"shadow":return{boxShadow:p,backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{boxShadow:"none",backgroundColor:u,color:A},...m};case"outlined":return{backgroundColor:"transparent",borderColor:l,...h,...C};case"dashed":return{backgroundColor:a,borderColor:l,...h,...C,...m};case"text":default:return{color:l,...C,...m}}}const f4=ue(d4,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:i,loadingPosition:a})=>({"::after":{content:'""',display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:n==="rounded"?"50%":4,opacity:0,transition:"all 0.5s"},":active::after":{position:"absolute",borderRadius:n==="rounded"?"50%":4,left:0,top:0,opacity:1,transition:"0s"},...t==="text"&&{...XA({variant:t,theme:e,color:r,loadingPosition:a}),"&.MuiButton-sizeMedium":{height:36},"&.MuiButton-sizeSmall":{height:30},"&.MuiButton-sizeLarge":{height:44}},...n&&{minWidth:0,"&.MuiButton-sizeMedium":{width:36,height:36},"&.MuiButton-sizeSmall":{width:30,height:30},"&.MuiButton-sizeLarge":{width:44,height:44},...n==="rounded"&&{borderRadius:"50%"}},...t==="outlined"&&{border:"1px solid"},...t==="dashed"&&{border:"1px dashed"},...(t==="contained"||t==="shadow")&&!i&&{color:"#fff"},...t!=="text"&&{...XA({variant:t,theme:e,color:r,loadingPosition:a})},"&.Mui-disabled":{...t!=="text"&&{...XA({variant:t,theme:e,color:r,loadingPosition:a})}}})),ZA=S.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...i},a)=>{const l=xt();return g.jsx(f4,{ref:a,variant:e,shape:t,theme:l,loadingPosition:i.loadingPosition,loading:i.loading,color:r,...i,children:n})});ZA.propTypes={variant:c.string,shape:c.string,children:c.node,color:c.string},ZA.displayName="LoadingButton";function g4({color:e,theme:t,labelColor:n}){const r=$t(t,e),{main:i,contrastText:a}=r;let l=e||"";return["primary","secondary","info","success","warning","error"].includes(l)?{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:i,color:n||a},[`& .${b.tooltipClasses.arrow}`]:{color:i}}:{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:l,color:n||a,boxShadow:t.shadows[1]},[`& .${b.tooltipClasses.arrow}`]:{color:l}}}const p4=ue(({className:e,...t})=>g.jsx(b.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&g4({color:t,theme:e,labelColor:n})}));function pm({children:e,arrow:t,labelColor:n="",...r}){const i=xt();return g.jsx(b.Box,{display:"flex",children:g.jsx(p4,{arrow:t,...r,theme:i,labelColor:n,children:e})})}pm.propTypes={children:c.element,arrow:c.bool,labelColor:c.string,rest:c.array};const io=S.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...i},a)=>{let l={transformOrigin:"0 0 0"};switch(t){case"top-right":l={transformOrigin:"top right"};break;case"top":l={transformOrigin:"top"};break;case"bottom-left":l={transformOrigin:"bottom left"};break;case"bottom-right":l={transformOrigin:"bottom right"};break;case"bottom":l={transformOrigin:"bottom"};break;case"top-left":default:l={transformOrigin:"0 0 0"};break}return g.jsxs(b.Box,{ref:a,children:[n==="grow"&&g.jsx(b.Grow,{...i,timeout:{appear:0,enter:150,exit:150},children:g.jsx(b.Box,{sx:l,children:e})}),n==="collapse"&&g.jsx(b.Collapse,{...i,sx:l,children:e}),n==="fade"&&g.jsx(b.Fade,{...i,timeout:{appear:0,enter:300,exit:150},children:g.jsx(b.Box,{sx:l,children:e})}),n==="slide"&&g.jsx(b.Slide,{...i,timeout:{appear:0,enter:150,exit:150},direction:r,children:g.jsx(b.Box,{sx:l,children:e})}),n==="zoom"&&g.jsx(b.Zoom,{...i,children:g.jsx(b.Box,{sx:l,children:e})})]})});io.propTypes={children:c.node,type:c.oneOf(["grow","fade","collapse","slide","zoom"]),position:c.oneOf(["top-left","top-right","top","bottom-left","bottom-right","bottom"]),direction:c.oneOf(["up","down","left","right"])},S.forwardRef(function(t,n){return g.jsx(b.Zoom,{ref:n,timeout:200,...t})});function hm({value:e,...t}){return g.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[g.jsx(b.CircularProgress,{variant:"determinate",value:e,...t}),g.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(e)}%`})})]})}hm.propTypes={value:c.number};function Cm({value:e,size:t,variant:n,thickness:r,showLabel:i,pathColor:a,sx:l,...u}){return g.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[g.jsx(b.CircularProgress,{variant:"determinate",sx:{color:a||"grey.200"},size:t,thickness:r,...u,value:100}),i&&g.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:e?`${Math.round(e)}%`:"0%"})}),g.jsx(b.CircularProgress,{variant:n,sx:{...l,position:"absolute",left:0,[`& .${b.circularProgressClasses.circle}`]:{strokeLinecap:"round"}},size:t,thickness:r,value:e,...u})]})}Cm.propTypes={value:c.number,size:c.number,variant:c.string,thickness:c.number,showLabel:c.bool,pathColor:c.string,sx:c.array,others:c.array};function Em({icon:e,value:t,...n}){return g.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[g.jsx(b.Box,{sx:{width:"100%",mr:1},children:g.jsx(b.LinearProgress,{variant:"determinate",value:t,...n})}),g.jsx(b.Box,{sx:{minWidth:35},children:e})]})}Em.propTypes={icon:c.node,value:c.number};function mm({value:e,...t}){return g.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[g.jsx(b.Box,{sx:{width:"100%",mr:1},children:g.jsx(b.LinearProgress,{variant:"determinate",value:e,...t})}),g.jsx(b.Box,{sx:{minWidth:35},children:g.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:`${Math.round(e)}%`})})]})}mm.propTypes={value:c.number};const Im=S.createContext({});function h4(e){const{useDefaults:t=!1}=e,n=O.useResourceContext(),r=O.useDataProvider(),{search:i}=vr.useLocation(),a=`${n}/new`,l=S.useCallback(()=>{if(!t||!pt.isFunction(r.get))return Promise.resolve({});const p={};return new URLSearchParams(i??"").forEach((C,h)=>{p[h]=C}),r.get(a,p).then(C=>C.data).then(C=>{const{responseCode:h,value:m}=C;return h==="ok"?m:Promise.reject(C)})},[n,t,i,r]),{data:u,isLoading:A}=cu.useQuery({queryKey:[n,i],queryFn:l}),f=pt.omit(e,["useDefaults"]);return A?g.jsx(b.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:g.jsx(b.CircularProgress,{})}):g.jsx(Im.Provider,{value:u??{},children:g.jsx(O.Create,{...f})})}function C4(){return S.useContext(Im)}const E4=ue(h4,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"& .RaCreate-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaCreate-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),m4=ai(O.Toolbar,{name:"RaApplicaToolbar",slot:"Root"})(({theme:e})=>({...e.mixins.toolbar,backgroundColor:e.palette.background.paper,justifyContent:"flex-end","& .RaToolbar-defaultToolbar":{justifyContent:"right",paddingBottom:e.spacing(2),"& > *":{marginLeft:e.spacing(1)}},"& .MuiButtonBase-root":{marginLeft:e.spacing(1)}})),Dr=e=>g.jsx(m4,{...e});Dr.defaultProps={...O.Toolbar.defaultProps},Dr.propTypes={...O.Toolbar.propTypes};const qA=({children:e,content:t,title:n,subheader:r,secondary:i,toolbar:a,...l})=>{const u=O.useTranslate(),A=O.useResourceContext(),{cardTitle:f,cardSubheader:p}=S.useMemo(()=>{const C=n||`resources.${A}.title`;return{cardTitle:u(C,{_:C}),cardSubheader:r!==null?u(r,{_:r}):null}},[A,r,n,u]);return g.jsx(b.Grid,{item:!0,...l,children:g.jsx(Nn,{content:t,title:f,subheader:p,secondary:i,divider:!0,children:g.jsxs(S.Fragment,{children:[e,a===!0?g.jsx(Dr,{children:g.jsx(O.SaveButton,{})}):a]})})})};qA.defaultProps={...b.Grid.defaultProps,content:!0,subheader:null,title:null,secondary:null,toolbar:!1,item:!0,lg:12,md:12,sm:12,xs:12},qA.propTypes={...b.Grid.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),contained:c.bool,content:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object]),spacing:c.number,toolbar:c.oneOfType([c.node,c.bool])};const I4=ue(O.Form,{name:"RaApplicaCardForm",slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*2),padding:0}})),bl=({children:e,spacing:t,defaultValues:n,...r})=>{const{spacing:i}=Fn();return g.jsx(I4,{defaultValues:n,spacing:t||i,children:g.jsx(b.Grid,{container:!0,...r,spacing:t||i,children:e})})};bl.propTypes={...b.Grid.propTypes,...O.Form.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),spacing:c.number,defaultValues:c.oneOfType([c.object,c.func]),record:c.object,validate:c.func},bl.defaultProps={...b.Stack.defaultProps},bl.Section=qA;const B4=ai(O.SimpleForm,{name:"RaApplicaSimpleForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?2:1)}})),Ql=({title:e,modal:t,content:n,subheader:r,secondary:i,sx:a,...l})=>{const u=Ah(e),A=O.useRecordContext();return g.jsx(Nn,{content:n,title:u,subheader:r,secondary:A!=null&&A.id?i:null,sx:{...a,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!t,divider:!0,children:g.jsx(B4,{toolbar:g.jsx(Dr,{}),...l})})};Ql.defaultProps={modal:!1,content:!1,subheader:null,title:null,toolbar:g.jsx(Dr,{children:g.jsx(O.SaveButton,{type:"button"})}),secondary:g.jsx(fi,{children:g.jsx(O.DeleteWithConfirmButton,{})})},Ql.propTypes={...O.SimpleForm.propTypes,modal:c.bool,content:c.bool,contained:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object])};const xl=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:a,divider:l,...u})=>{const A=Ut.useTheme(),{getCurrentDialog:f}=xo(),{source:p,resource:C,isRequired:h}=u,{getFieldState:m,formState:I}=va.useFormContext(),{error:B}=m(p,I),v=f();return g.jsxs(b.Stack,{spacing:1,sx:{"& .MuiFormHelperText-root":{color:B?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&a!==!1&&g.jsx(b.InputLabel,{error:!!B,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:g.jsx(O.FieldTitle,{label:e,source:p,resource:v||C,isRequired:h})}),S.isValidElement(t)?S.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&g.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:!!B,children:r})]})};xl.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool},xl.defaultProps={display:"label",divider:!1};const y4=ue(O.ArrayInput,{name:"ApplicaArrayInput",slot:"root"})(({theme:e})=>({"& .MuiStack-root > label":{marginTop:e.spacing(2)},"& .MuiInputLabel-shrink":{paddingBottom:0},marginTop:"0 !important","& .RaSimpleFormIterator-line > .RaSimpleFormIterator-form":{paddingBottom:e.spacing(.5),"& > div":{width:"100%"}}})),v4=({label:e,addLabel:t,source:n,helperText:r,divider:i=!0,...a})=>g.jsx(xl,{label:e,addLabel:t,source:n,helperText:r,divider:i,children:g.jsx(y4,{source:n,label:!1,...a})}),$A=({canEdit:e,canDelete:t,canClone:n})=>!e&&!t&&!n?null:g.jsxs(fi,{children:[e&&g.jsx(O.EditButton,{}),t&&g.jsx(O.DeleteWithConfirmButton,{}),n&&g.jsx(O.CloneButton,{})]});$A.defaultProps={canEdit:!0,canDelete:!0,canClone:!1},$A.propTypes={canEdit:c.bool,canDelete:c.bool,canClone:c.bool};const Bm=ue("div",{name:"ApplicaBaseAttachmentField",overridesResolver:(e,t)=>t.root})({display:"inline-block"}),b4=ue("ul")({display:"inline-block"}),ym=e=>{var p;const{className:t,emptyText:n,source:r,title:i,...a}=e,l=be.useRecordContext(e),u=st.get(l,r),A=be.useTranslate();if(!u)return n?g.jsx(b.Typography,{component:"span",variant:"body2",className:t,...a,children:n&&A(n,{_:n})}):g.jsx(Bm,{className:t,...a});if(Array.isArray(u))return g.jsx(b4,{className:t,...a,children:u.map((C,h)=>{var I;const m=i instanceof String?(I=st.get(C,i))==null?void 0:I.toString():i;return g.jsx("li",{children:m},h)})});const f=i instanceof String?(p=st.get(l,i))==null?void 0:p.toString():i;return g.jsx(Bm,{className:t,...a,children:f})};ym.propTypes={className:c.string,emptyText:c.string,source:c.string.isRequired,src:c.string,title:c.oneOfType([c.string,c.element]),target:c.string,download:c.oneOfType([c.bool,c.string]),ping:c.string,rel:c.string};var vm={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(kn,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",l="second",u="minute",A="hour",f="day",p="week",C="month",h="quarter",m="year",I="date",B="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,M=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,j={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(q){var K=["th","st","nd","rd"],z=q%100;return"["+q+(K[(z-20)%10]||K[z]||K[0])+"]"}},x=function(q,K,z){var Z=String(q);return!Z||Z.length>=K?q:""+Array(K+1-Z.length).join(z)+q},T={s:x,z:function(q){var K=-q.utcOffset(),z=Math.abs(K),Z=Math.floor(z/60),F=z%60;return(K<=0?"+":"-")+x(Z,2,"0")+":"+x(F,2,"0")},m:function q(K,z){if(K.date()<z.date())return-q(z,K);var Z=12*(z.year()-K.year())+(z.month()-K.month()),F=K.clone().add(Z,C),te=z-F<0,W=K.clone().add(Z+(te?-1:1),C);return+(-(Z+(z-F)/(te?F-W:W-F))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:C,y:m,w:p,d:f,D:I,h:A,m:u,s:l,ms:a,Q:h}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},P="en",L={};L[P]=j;var k="$isDayjsObject",_=function(q){return q instanceof le||!(!q||!q[k])},J=function q(K,z,Z){var F;if(!K)return P;if(typeof K=="string"){var te=K.toLowerCase();L[te]&&(F=te),z&&(L[te]=z,F=te);var W=K.split("-");if(!F&&W.length>1)return q(W[0])}else{var X=K.name;L[X]=K,F=X}return!Z&&F&&(P=F),F||!Z&&P},Y=function(q,K){if(_(q))return q.clone();var z=typeof K=="object"?K:{};return z.date=q,z.args=arguments,new le(z)},ee=T;ee.l=J,ee.i=_,ee.w=function(q,K){return Y(q,{locale:K.$L,utc:K.$u,x:K.$x,$offset:K.$offset})};var le=function(){function q(z){this.$L=J(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[k]=!0}var K=q.prototype;return K.parse=function(z){this.$d=function(Z){var F=Z.date,te=Z.utc;if(F===null)return new Date(NaN);if(ee.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var W=F.match(v);if(W){var X=W[2]-1||0,de=(W[7]||"0").substring(0,3);return te?new Date(Date.UTC(W[1],X,W[3]||1,W[4]||0,W[5]||0,W[6]||0,de)):new Date(W[1],X,W[3]||1,W[4]||0,W[5]||0,W[6]||0,de)}}return new Date(F)}(z),this.init()},K.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},K.$utils=function(){return ee},K.isValid=function(){return this.$d.toString()!==B},K.isSame=function(z,Z){var F=Y(z);return this.startOf(Z)<=F&&F<=this.endOf(Z)},K.isAfter=function(z,Z){return Y(z)<this.startOf(Z)},K.isBefore=function(z,Z){return this.endOf(Z)<Y(z)},K.$g=function(z,Z,F){return ee.u(z)?this[Z]:this.set(F,z)},K.unix=function(){return Math.floor(this.valueOf()/1e3)},K.valueOf=function(){return this.$d.getTime()},K.startOf=function(z,Z){var F=this,te=!!ee.u(Z)||Z,W=ee.p(z),X=function(he,me){var xe=ee.w(F.$u?Date.UTC(F.$y,me,he):new Date(F.$y,me,he),F);return te?xe:xe.endOf(f)},de=function(he,me){return ee.w(F.toDate()[he].apply(F.toDate("s"),(te?[0,0,0,0]:[23,59,59,999]).slice(me)),F)},ge=this.$W,ce=this.$M,Ae=this.$D,pe="set"+(this.$u?"UTC":"");switch(W){case m:return te?X(1,0):X(31,11);case C:return te?X(1,ce):X(0,ce+1);case p:var Ie=this.$locale().weekStart||0,Ee=(ge<Ie?ge+7:ge)-Ie;return X(te?Ae-Ee:Ae+(6-Ee),ce);case f:case I:return de(pe+"Hours",0);case A:return de(pe+"Minutes",1);case u:return de(pe+"Seconds",2);case l:return de(pe+"Milliseconds",3);default:return this.clone()}},K.endOf=function(z){return this.startOf(z,!1)},K.$set=function(z,Z){var F,te=ee.p(z),W="set"+(this.$u?"UTC":""),X=(F={},F[f]=W+"Date",F[I]=W+"Date",F[C]=W+"Month",F[m]=W+"FullYear",F[A]=W+"Hours",F[u]=W+"Minutes",F[l]=W+"Seconds",F[a]=W+"Milliseconds",F)[te],de=te===f?this.$D+(Z-this.$W):Z;if(te===C||te===m){var ge=this.clone().set(I,1);ge.$d[X](de),ge.init(),this.$d=ge.set(I,Math.min(this.$D,ge.daysInMonth())).$d}else X&&this.$d[X](de);return this.init(),this},K.set=function(z,Z){return this.clone().$set(z,Z)},K.get=function(z){return this[ee.p(z)]()},K.add=function(z,Z){var F,te=this;z=Number(z);var W=ee.p(Z),X=function(ce){var Ae=Y(te);return ee.w(Ae.date(Ae.date()+Math.round(ce*z)),te)};if(W===C)return this.set(C,this.$M+z);if(W===m)return this.set(m,this.$y+z);if(W===f)return X(1);if(W===p)return X(7);var de=(F={},F[u]=r,F[A]=i,F[l]=n,F)[W]||1,ge=this.$d.getTime()+z*de;return ee.w(ge,this)},K.subtract=function(z,Z){return this.add(-1*z,Z)},K.format=function(z){var Z=this,F=this.$locale();if(!this.isValid())return F.invalidDate||B;var te=z||"YYYY-MM-DDTHH:mm:ssZ",W=ee.z(this),X=this.$H,de=this.$m,ge=this.$M,ce=F.weekdays,Ae=F.months,pe=F.meridiem,Ie=function(me,xe,ae,ze){return me&&(me[xe]||me(Z,te))||ae[xe].slice(0,ze)},Ee=function(me){return ee.s(X%12||12,me,"0")},he=pe||function(me,xe,ae){var ze=me<12?"AM":"PM";return ae?ze.toLowerCase():ze};return te.replace(M,function(me,xe){return xe||function(ae){switch(ae){case"YY":return String(Z.$y).slice(-2);case"YYYY":return ee.s(Z.$y,4,"0");case"M":return ge+1;case"MM":return ee.s(ge+1,2,"0");case"MMM":return Ie(F.monthsShort,ge,Ae,3);case"MMMM":return Ie(Ae,ge);case"D":return Z.$D;case"DD":return ee.s(Z.$D,2,"0");case"d":return String(Z.$W);case"dd":return Ie(F.weekdaysMin,Z.$W,ce,2);case"ddd":return Ie(F.weekdaysShort,Z.$W,ce,3);case"dddd":return ce[Z.$W];case"H":return String(X);case"HH":return ee.s(X,2,"0");case"h":return Ee(1);case"hh":return Ee(2);case"a":return he(X,de,!0);case"A":return he(X,de,!1);case"m":return String(de);case"mm":return ee.s(de,2,"0");case"s":return String(Z.$s);case"ss":return ee.s(Z.$s,2,"0");case"SSS":return ee.s(Z.$ms,3,"0");case"Z":return W}return null}(me)||W.replace(":","")})},K.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},K.diff=function(z,Z,F){var te,W=this,X=ee.p(Z),de=Y(z),ge=(de.utcOffset()-this.utcOffset())*r,ce=this-de,Ae=function(){return ee.m(W,de)};switch(X){case m:te=Ae()/12;break;case C:te=Ae();break;case h:te=Ae()/3;break;case p:te=(ce-ge)/6048e5;break;case f:te=(ce-ge)/864e5;break;case A:te=ce/i;break;case u:te=ce/r;break;case l:te=ce/n;break;default:te=ce}return F?te:ee.a(te)},K.daysInMonth=function(){return this.endOf(C).$D},K.$locale=function(){return L[this.$L]},K.locale=function(z,Z){if(!z)return this.$L;var F=this.clone(),te=J(z,Z,!0);return te&&(F.$L=te),F},K.clone=function(){return ee.w(this.$d,this)},K.toDate=function(){return new Date(this.valueOf())},K.toJSON=function(){return this.isValid()?this.toISOString():null},K.toISOString=function(){return this.$d.toISOString()},K.toString=function(){return this.$d.toUTCString()},q}(),se=le.prototype;return Y.prototype=se,[["$ms",a],["$s",l],["$m",u],["$H",A],["$W",f],["$M",C],["$y",m],["$D",I]].forEach(function(q){se[q[1]]=function(K){return this.$g(K,q[0],q[1])}}),Y.extend=function(q,K){return q.$i||(q(K,le,Y),q.$i=!0),Y},Y.locale=J,Y.isDayjs=_,Y.unix=function(q){return Y(1e3*q)},Y.en=L[P],Y.Ls=L,Y.p={},Y})})(vm);var Q4=vm.exports;const Rr=ti(Q4),ed=({entityId:e,property:t,disabled:n,userResource:r="entities/user",...i})=>{const[a,l]=S.useState(null),u=O.useRecordContext(i),A=O.useDataProvider(),f=O.useResourceContext(),p=S.useCallback(async m=>{m.preventDefault(),m.stopPropagation();const I=st.get(u,i==null?void 0:i.source),B=f.replace("entities/",""),v=await A.getFile(`/attachments/${B}/${e||(u==null?void 0:u.id)}/${t||(i==null?void 0:i.source)}/${(I==null?void 0:I.id)||(u==null?void 0:u.id)}`),M=document.createElement("a");M.href=v,M.download=st.get(u,(i==null?void 0:i.title)||(i==null?void 0:i.source)),M.click()},[A,u,e,f,t,i==null?void 0:i.source,i==null?void 0:i.title]),C=S.useMemo(()=>({...u,[i==null?void 0:i.source]:(u==null?void 0:u.src)||st.get(u,i==null?void 0:i.source),[i==null?void 0:i.title]:(u==null?void 0:u.title)||st.get(u,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),[u,i==null?void 0:i.source,i==null?void 0:i.title]),h=O.useTranslate();return S.useEffect(()=>{!u||!(u!=null&&u.userId)||A.getOne(r,{id:u==null?void 0:u.userId}).then(({data:m})=>l(m)).catch(()=>l(null))},[u,A,r]),g.jsx(ym,{...i,disabled:n,record:C,onClick:p,title:g.jsxs(b.Box,{sx:{cursor:"pointer"},children:[g.jsx(b.Typography,{variant:"subtitle1",children:st.get(C,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),g.jsxs(b.Typography,{variant:"caption",color:"secondary",children:[st.get(C,"sizeDescription"),a&&" | ",a&&h("ra.attachment.info",{user:a==null?void 0:a.name,created:Rr(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})};ed.propTypes={...O.FileField.propTypes,source:c.string,title:c.string,disabled:c.bool};const x4=ue(O.ImageField,{name:"RaApplicaImageField",slot:"root"})(()=>({})),Ds=e=>{const t=`_${e==null?void 0:e.source}`;return g.jsx(x4,{...e,source:t})};Ds.propTypes={...O.ImageField.propTypes,source:c.string};const wl=({width:e,height:t,circle:n,justify:r,record:i,...a})=>{const l=S.useMemo(()=>({width:typeof e=="number"?`${e}px !important`:`${e} !important`,height:typeof t=="number"?`${t}px !important`:`${t} !important`,borderRadius:n?"50%":1.5}),[e,t,n]),u=O.useRecordContext(),A=i||u;return g.jsx(Ds,{sx:f=>({margin:0,display:"flex",justifyContent:r,"& img":{margin:"0px !important",border:`1px solid ${f.palette.divider}`,objectFit:"cover !important",...l,minWidth:l.width,minHeight:l.height}}),...a,record:A})};wl.defaultProps={...Ds.defaultProps,width:150,height:150,circle:!1,justify:"flex-start"},wl.propTypes={...Ds.propTypes,width:c.oneOfType([c.number,c.string]),height:c.oneOfType([c.number,c.string]),circle:c.bool,justify:c.oneOf(["flex-start","center","flex-end"])};var bm={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(kn,function(){return function(n,r,i){n=n||{};var a=r.prototype,l={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(f,p,C,h){return a.fromToBase(f,p,C,h)}i.en.relativeTime=l,a.fromToBase=function(f,p,C,h,m){for(var I,B,v,M=C.$locale().relativeTime||l,j=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=j.length,T=0;T<x;T+=1){var P=j[T];P.d&&(I=h?i(f).diff(C,P.d,!0):C.diff(f,P.d,!0));var L=(n.rounding||Math.round)(Math.abs(I));if(v=I>0,L<=P.r||!P.r){L<=1&&T>0&&(P=j[T-1]);var k=M[P.l];m&&(L=m(""+L)),B=typeof k=="string"?k.replace("%d",L):k(L,p,P.l,v);break}}if(p)return B;var _=v?M.future:M.past;return typeof _=="function"?_(B):_.replace("%s",B)},a.to=function(f,p){return u(f,p,this,!0)},a.from=function(f,p){return u(f,p,this)};var A=function(f){return f.$u?i.utc():i()};a.toNow=function(f){return this.to(A(this),f)},a.fromNow=function(f){return this.from(A(this),f)}}})})(bm);var w4=bm.exports;const T4=ti(w4);Rr.extend(T4);const Tl=e=>{const t=O.useRecordContext(e),[n]=O.useLocaleState(),r=S.useMemo(()=>Rr(st.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return g.jsxs(S.Fragment,{children:[g.jsx(O.DateField,{record:t,source:e.source,showTime:!0}),g.jsx("br",{}),g.jsx(b.Typography,{variant:"caption",color:"textSecondary",children:r})]})};Tl.displayName="DateAgoField",Tl.propTypes={source:c.string.isRequired};const Qm=ue(O.DateField,{name:"RaApplicaDateField",slot:"Root"})(()=>({}));Qm.propTypes={...O.DateField.propTypes};const td=e=>g.jsx(Qm,{...e});td.defaultProps={...O.DateField.defaultProps,variant:"body1"},td.propTypes={...O.DateField.propTypes};const xm=ue(O.EmailField,{name:"RaApplicaEmailField",slot:"Root"})(()=>({}));xm.propTypes={...O.EmailField.propTypes};const nd=e=>g.jsx(xm,{...e});nd.defaultProps={...O.EmailField.defaultProps,variant:"body1"},nd.propTypes={...O.EmailField.propTypes};const P4=ue(O.FileField,{name:"RaApplicaFileField",slot:"root"})(()=>({})),rd=({...e})=>{const t=O.useRecordContext(e),n=S.useCallback(r=>{r.preventDefault(),r.stopPropagation();const i=st.get(t,`_${e==null?void 0:e.source}`,st.get(t,e==null?void 0:e.source)),a=st.get(t,(e==null?void 0:e.title)||(e==null?void 0:e.source))||(e==null?void 0:e.title),l=document.createElement("a");l.href=i,l.download=a,l.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return g.jsx(P4,{...e,record:t,onClick:n})};rd.propTypes={...O.FileField.propTypes,source:c.string,title:c.string};const wm=e=>g.jsx(O.FunctionField,{...e});wm.defaultProps={variant:"body1"};const S4=ue("div")(({theme:e})=>({borderBottom:`1px solid ${e.palette.divider}`,paddingTop:e.spacing(1),paddingBottom:e.spacing(1),marginBottom:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",[e.breakpoints.down("sm")]:{whiteSpace:"normal",overflow:"visible",textOverflow:"inherit"}})),od=({source:e,defaultValue:t,...n})=>{const r=O.useRecordContext(n),i=st.get(r,e,t);return g.jsx("span",{dangerouslySetInnerHTML:{__html:i&&i!==null?i:t}})};od.propTypes={defaultValue:c.any,source:c.string,record:c.object},od.defaultProps={defaultValue:"&nbsp;"};const Tm=({title:e,children:t})=>e&&e!==!1?g.jsx(b.Tooltip,{title:e,placement:"top",children:t}):t;Tm.propTypes={title:c.oneOfType([c.string,c.bool]),children:c.oneOfType([c.element,c.arrayOf(c.element)])};const id=({label:e,source:t,defaultValue:n,children:r,tooltip:i,...a})=>{const{getCurrentDialog:l}=xo(),u=O.useRecordContext(a),A=O.useResourceContext(a),f=l(),p=S.useMemo(()=>!i||i===!1?!1:typeof i=="function"?i(u):typeof i=="string"?st.get(u,i,i):i,[u,i]);return g.jsx(Tm,{title:p,children:g.jsxs(S.Fragment,{children:[g.jsx(b.InputLabel,{children:g.jsx(O.FieldTitle,{label:e,source:t,resource:f||A})}),g.jsx(S4,{...a,children:S.cloneElement(r,{source:t,record:u,defaultValue:n,resource:f||A})})]})})};id.propTypes={defaultValue:c.any,tooltip:c.oneOfType([c.string,c.bool,c.func]),source:c.string,label:c.string,name:c.string,children:c.element},id.defaultProps={defaultValue:"&nbsp;",children:g.jsx(od,{})};const O4=ai("div",{name:"RaApplicaReferenceManyField",slot:"root"})(({theme:e,margin:t,border:n})=>({marginLeft:t?0:`-${e.spacing(2.5)}`,marginRight:t?0:`-${e.spacing(2.5)}`,borderBottom:n?`1px solid ${e.palette.divider}`:"none","& form":{padding:e.spacing(2)},"& .MuiCardContent-root":{borderTop:n?`1px solid ${e.palette.divider}`:"none"},"& .MuiToolbar-root":{[e.breakpoints.up("sm")]:{marginTop:`-${e.spacing(2)}`,marginBottom:e.spacing(t?0:1),marginLeft:e.spacing(t?1:2),marginRight:e.spacing(t?1:2),width:t?"auto":`calc(100% - ${e.spacing(5)})`},[e.breakpoints.down("md")]:{marginTop:0}},"& .RaDatagrid-root":{overflowX:"auto",paddingTop:48,[e.breakpoints.down("sm")]:{width:"calc(100vw - 34px)"}},"& .RaDatagrid-table":{borderBottom:`1px solid ${e.palette.divider}`},"& .MuiTablePagination-toolbar":{marginTop:e.spacing(1),marginBottom:0},"& .RaBulkActionsToolbar-collapsed.RaBulkActionsToolbar-toolbar":{minHeight:0},"& .RaBulkActionsToolbar-toolbar":{minHeight:48,bottom:-56,"& h6":{marginTop:e.spacing(.5)},"& .RaBulkActionsToolbar-topToolbar":{marginTop:e.spacing(1)},[e.breakpoints.down("sm")]:{bottom:-48,borderRadius:0}}})),Qi=e=>g.jsx(O4,{children:g.jsx(O.ReferenceManyField,{...e})});Qi.defaultProps={...O.ReferenceManyField.defaultProps,margin:!1,border:!1},Qi.propTypes={...O.ReferenceManyField.propTypes,margin:c.bool,border:c.bool};const Pm=({source:e,...t})=>{const n=O.useRecordContext(t),r=st.get(n,e,0),i=r/1024,a=i/1024,l=a/1024,u=l>1?`${l.toFixed(2)} GB`:a>1?`${a.toFixed(2)} MB`:i>1?`${i.toFixed(2)} KB`:`${r.toFixed(2)} B`;return g.jsx(b.Typography,{component:"span",variant:"body1",...t,children:u})};Pm.propTypes={record:c.object,source:c.string};const Sm=ue(O.TextField,{name:"RaApplicaTextField",slot:"Root"})(()=>({}));Sm.propTypes={...O.TextField.propTypes};const sd=e=>g.jsx(Sm,{...e});sd.defaultProps={...O.TextField.defaultProps,variant:"body1"},sd.propTypes={...O.TextField.propTypes};const at=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:a,divider:l,...u})=>{const A=Ut.useTheme(),{getCurrentDialog:f}=xo(),{source:p,resource:C,isRequired:h}=u,{fieldState:{invalid:m}}=O.useInput(u),I=f();return g.jsxs(b.Stack,{spacing:1,sx:{width:u!=null&&u.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:m?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&a!==!1&&g.jsx(b.InputLabel,{error:m===!0,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:g.jsx(O.FieldTitle,{label:e,source:p,resource:I||C,isRequired:h})}),S.isValidElement(t)?S.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&g.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:m===!0,children:r})]})};at.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool},at.defaultProps={display:"label",divider:!1};const M4=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},D4=ue(O.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({disabled:e,theme:t})=>({"& .previews":{},"& .previews>div":{marginTop:t.spacing(1),padding:t.spacing(1.5),border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:t.palette.action.hover},"& .MuiLink-root":{fontSize:t.typography.body1.fontSize}},...M4(e)})),ad=({children:e,disabled:t,type:n,...r})=>{const i=O.useRecordContext(r),a=r==null?void 0:r.source,l=i==null?void 0:i.id;return O.useInput({source:`__${n}__${r==null?void 0:r.source}`,defaultValue:r==null?void 0:r.source}),g.jsx(at,{...r,children:g.jsx(D4,{disabled:t,children:S.cloneElement(e,{...e.props,entityId:l,property:a})})})};ad.propTypes={...O.FileInput.propTypes,children:c.node,multiple:c.bool,disabled:c.bool},ad.defaultProps={children:g.jsx(ed,{title:"name",source:"path"}),multiple:!0,disabled:!1,type:"attachment"};const R4=ue(O.AutocompleteArrayInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"}})),ld=({...e})=>g.jsx(at,{...e,children:g.jsx(R4,{})});ld.propTypes={...O.AutocompleteArrayInput.propTypes,...at.propTypes},ld.defaultProps={...O.AutocompleteArrayInput.defaultProps,size:"small"};const j4=ue(O.AutocompleteInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},"& .MuiOutlinedInput-root.MuiInputBase-sizeSmall":{paddingTop:"4px"}})),cd=e=>{const{perPage:t,...n}=e;return g.jsx(at,{...n,children:g.jsx(j4,{})})};cd.propTypes={...O.AutocompleteInput.propTypes,...at.propTypes},cd.defaultProps={...O.AutocompleteInput.defaultProps,size:"small"};const k4=ue(O.BooleanInput,{name:"RaApplicaBooleanInput",slot:"Root"})(()=>({})),ud=({horizontal:e,...t})=>{const n=xt();return g.jsx(at,{...t,sx:e?{flexDirection:e?"row":"column",alignItems:e?"center":"flex-start","& .MuiFormGroup-root":{margin:0},"& .MuiFormControlLabel-root":{margin:0,"& .MuiTypography-root":{display:"none",visibility:"hidden"},"& .MuiSwitch-root":{marginRight:`-${n.spacing(.5)}`}}}:{},children:g.jsx(k4,{})})};ud.defaultProps={...O.BooleanInput.defaultProps,...at.defaultProps},ud.propTypes={...O.BooleanInput.propTypes,...at.propTypes,horizontal:c.bool};const F4=ue(O.DateInput,{name:"RaApplicaDateInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Ad=e=>g.jsx(at,{...e,children:g.jsx(F4,{})});Ad.propTypes={...O.DateInput.propTypes,...at.propTypes},Ad.defaultProps={...O.DateInput.defaultProps,...at.defaultProps};const L4=ue(O.DateTimeInput,{name:"RaApplicaDateTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),dd=e=>g.jsx(at,{...e,children:g.jsx(L4,{})});dd.propTypes={...O.DateTimeInput.propTypes,...at.propTypes},dd.defaultProps={...at.defaultProps};const N4=ue(O.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({theme:e})=>({"& .previews":{},"& .previews>div":{marginTop:e.spacing(1),padding:e.spacing(1.5),border:`1px solid ${e.palette.divider}`,borderRadius:e.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:e.palette.action.hover},"& .MuiLink-root":{fontSize:e.typography.body1.fontSize}}})),fd=({children:e,title:t,...n})=>{const r=va.useWatch({name:n.source}),i=O.useRecordContext(n),{source:a}=n,l=S.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const u=st.get(i,a);if(u){const A=u.split("__");return A.length>0?A[A.length-1]:u}return u},[i,a,r]);return g.jsx(at,{...n,children:g.jsx(N4,{children:S.cloneElement(e,{...e.props,title:t||a,source:a,record:{...i,[a]:(r==null?void 0:r.title)||st.get(i,a),[`_${a}`]:(r==null?void 0:r.src)||st.get(i,`_${a}`),[t||a]:l}})})})};fd.propTypes={...O.FileInput.propTypes,source:c.string,title:c.string,children:c.node},fd.defaultProps={children:g.jsx(rd,{})};const gd=({children:e,title:t,...n})=>{const r=va.useWatch({name:n.source}),i=O.useRecordContext(n),{source:a}=n;return O.useInput({source:`__image__${n==null?void 0:n.source}`,defaultValue:n==null?void 0:n.source}),g.jsx(at,{...n,children:g.jsx(O.ImageInput,{accept:"image/*",children:S.cloneElement(e,{...e.props,title:t,source:a,record:{...i,[a]:(r==null?void 0:r.title)||st.get(i,a),[`_${a}`]:(r==null?void 0:r.src)||st.get(i,`_${a}`)}})})})};gd.defaultProps={children:g.jsx(wl,{}),multiple:!1},gd.propTypes={...O.ImageInput.propTypes,source:c.string,title:c.string,children:c.node,multiple:c.bool};const V4=ue(O.NumberInput,{name:"RaApplicaNumberInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),pd=e=>g.jsx(at,{...e,children:g.jsx(V4,{})});pd.propTypes={...O.NumberInput.propTypes,...at.propTypes},pd.defaultProps={...O.NumberInput.defaultProps,...at.defaultProps};const Om=({source:e,minWidth:t=300,children:n})=>{const r=O.useResourceContext(),i=O.useRecordContext(),[a,l]=S.useState(st.get(i,e,"")),[u,A]=S.useState(!1),f=S.useCallback(I=>l(I.target.value),[]),p=O.useDataProvider(),C=S.useCallback(I=>{I.key==="Enter"&&(A(!0),p.update(r,{id:i.id,data:{...i,[e]:a,_changed:e}}).then(()=>A(!1)))},[a,p,r,i,e]),h=S.useCallback(()=>{st.get(i,e)!==a&&(A(!0),p.update(r,{id:i.id,data:{...i,[e]:a,_changed:e}}).then(()=>A(!1)))},[a,p,r,e,i]),m=S.useCallback(I=>{A(!0),p.update(r,{id:i.id,data:{...i,[e]:I,_changed:e}}).then(()=>A(!1))},[p,r,e,i]);return S.useEffect(()=>l(st.get(i,e)),[i,e]),n?S.cloneElement(n,{...n.props,source:e,value:a,onChange:m}):g.jsx(b.TextField,{value:a,disabled:u,onChange:f,onKeyPress:C,onBlur:h,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})};Om.propTypes={source:c.string.isRequired,minWidth:c.number,children:c.element};const hd=({children:e,...t})=>g.jsx(O.ReferenceArrayInput,{...t,children:S.cloneElement(e,{...t,source:e.props.source||t.source})});hd.propTypes={...O.ReferenceArrayInput.propTypes,children:c.element},hd.defaultProps={...O.ReferenceArrayInput.defaultProps};const Cd=({children:e,...t})=>g.jsx(O.ReferenceInput,{...t,children:S.cloneElement(e,{...t,source:e.props.source||t.source})});Cd.propTypes={...O.ReferenceInput.propTypes,children:c.element},Cd.defaultProps={...O.ReferenceInput.defaultProps};const Ed=({reference:e,target:t,children:n,filters:r,actions:i,...a})=>g.jsx(O.ResourceContextProvider,{value:e,children:g.jsx(Qi,{perPage:5,pagination:g.jsx(O.Pagination,{}),...a,reference:e,target:t,children:g.jsxs(S.Fragment,{children:[g.jsx(O.ListToolbar,{filters:r,actions:i}),n]})})});Ed.propTypes={...Qi.propTypes,children:c.node.isRequired,reference:c.string.isRequired,target:c.string.isRequired,filters:c.oneOfType([c.element,c.func,c.element,c.arrayOf(c.node)]),actions:c.oneOfType([c.element,c.func,c.element])},Ed.defaultProps={...Qi.defaultProps};const H4=ue(O.SearchInput,{name:"RaApplicaSearchInput",slot:"root"})(()=>({})),z4=e=>g.jsx(H4,{...e}),Mm=ue(O.SelectArrayInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .RaSelectArrayInput-chips > .RaSelectArrayInput-chip":{marginTop:"-2px",marginBottom:"-2px"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}}));Mm.propTypes={...O.SelectArrayInput.propTypes};const md=e=>g.jsx(at,{...e,children:g.jsx(Mm,{options:{autoWidth:!1}})});md.defaultProps={optionText:"name",optionValue:"id"},md.propTypes={...O.SelectArrayInput.propTypes,...at.propTypes};const W4=ue(O.SelectInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}})),Dm=e=>g.jsx(at,{...e,children:g.jsx(W4,{})});Dm.propTypes={...O.SelectInput.propTypes,...at.propTypes};const Hn=e=>g.jsx(at,{...e,children:g.jsx(O.TextInput,{})});Hn.propTypes={...O.TextInput.propTypes,...at.propTypes};const Pl=({...e})=>{var u,A;const t=O.useTranslate(),n=O.maxLength(e==null?void 0:e.maxLength,"app.input.max_length_error"),r=(A=(u=va.useController({name:e==null?void 0:e.source}))==null?void 0:u.field)==null?void 0:A.value;let i=e.helperText,a=e.validate;a?Array.isArray(a)&&a.indexOf(n)===-1&&a.push(n):a=[n];const l=t("app.input.max_length_info",{count:(r==null?void 0:r.length)||0,max:e==null?void 0:e.maxLength});return e!=null&&e.maxLength&&(i=i&&i.length>0?`${l} - ${t(i)}`:l),g.jsx(Hn,{...e,validate:a,helperText:i,inputProps:{maxLength:e==null?void 0:e.maxLength}})};Pl.displayName="SmartTextInput",Pl.defaultProps={multiline:!1},Pl.propTypes={...Hn.propTypes,maxLength:c.number,multiline:c.bool,rows:c.number};const Rm=e=>{const t=e.split(":");t.length===1&&t.push("00");const n=parseInt(t[0]),r=parseInt(t[1]);return Rr().hour(n).minute(r)};function U4(){let e=new Date().getTime();return window.performance&&typeof window.performance.now=="function"&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)})}const Y4=e=>{if(!e)return"";const t=Rm(e);return t?t.format("HH:mm"):""},G4=e=>e,K4=ue(O.TimeInput,{name:"RaApplicaTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Id=e=>g.jsx(at,{...e,children:g.jsx(K4,{})});Id.defaultProps={...O.TimeInput.defaultProps,format:Y4,parse:G4},Id.propTypes={...O.TimeInput.propTypes,...at.propTypes};const Bd=({onSuccess:e,firstAccess:t})=>{const{spacing:n}=Fn(),[r,i]=S.useState(!1),a=be.useAuthProvider(),l=be.useTranslate(),u=be.useNotify(),A=S.useCallback(f=>{const{oldPassword:p,newPassword:C}=f;i(!0),a==null||a.changePassword(p,C).then(()=>{u("ra.auth.password_changed"),e()}).catch(h=>u(h,{type:"error"})).finally(()=>i(!1))},[a,e]);return g.jsx(be.ResourceContextProvider,{value:"user/change-password",children:g.jsx(be.EditContextProvider,{value:{record:{},resource:"user/change-password",save:A},children:g.jsx(Ql,{onSubmit:A,toolbar:g.jsx(Dr,{children:g.jsx(O.SaveButton,{disabled:r})}),children:g.jsxs(b.Grid,{container:!0,spacing:n,children:[t===!0&&g.jsx(b.Grid,{item:!0,xs:12,children:g.jsxs(b.Alert,{severity:"warning",children:[g.jsx(b.AlertTitle,{children:l("ra.auth.first_access.change_password")}),l("ra.auth.first_access.change_password_helper")]})}),g.jsx(b.Grid,{item:!0,xs:12,children:g.jsx(Hn,{source:"oldPassword",type:"password",validate:be.required()})}),g.jsx(b.Grid,{item:!0,xs:12,children:g.jsx(Hn,{source:"newPassword",type:"password",validate:be.required()})})]})})})})},_4=ue(O.Edit,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaEdit-card":{[e.breakpoints.down("sm")]:{marginBottom:e.spacing(6)}},"& .RaEdi-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaToolbar-mobileToolbar":{borderTop:`1px solid ${e.palette.divider}`},"& .RaEdit-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),J4=ue(b.CardHeader)(({theme:e})=>({marginTop:e.spacing(4),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),X4=ue(b.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`})),yd=({title:e,divider:t,variant:n})=>{const r=O.useTranslate();return g.jsxs(S.Fragment,{children:[g.jsx(J4,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&g.jsx(X4,{})]})};yd.propTypes={title:c.string.isRequired,divider:c.bool,variant:c.oneOf(["h1","h2","h3","h4","h5","h6"])},yd.defaultProps={divider:!0,variant:"h4"};const Sl=c.shape({xl:c.number,lg:c.number,md:c.number,sm:c.number,xs:c.number}),Z4=ue("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Ol=({children:e,visibility:t})=>b.useMediaQuery(r=>r.breakpoints.up(t))?g.jsx(Z4,{children:e}):null;Ol.propTypes={visibility:c.oneOf(["xl","lg","md","sm","xs"]),position:c.oneOf(["top","bottom"]).isRequired,children:c.node.isRequired},Ol.defaultProps={position:"top",visibility:"md"};const q4={display:"none"},Ml=({intent:e,hidden:t,unmountOnExit:n,label:r,icon:i,value:a,syncWithLocation:l,selected:u,onChange:A,children:f,badgeColor:p,badgeContent:C,...h})=>{const m=O.useTranslate(),I=vr.useLocation(),B={component:gt.Link,to:{...I,pathname:a}},v=S.isValidElement(r)?r:m(r,{_:r}),M=S.useCallback(()=>A(a),[A,a]);return e==="header"?(()=>g.jsxs(b.ListItemButton,{selected:u,...l?B:{},onClick:M,children:[i&&g.jsx(b.ListItemIcon,{children:i}),g.jsx(b.ListItemText,{primary:v}),C&&g.jsx(b.ListItemSecondaryAction,{children:g.jsx(b.Avatar,{sx:{width:24,height:24,fontSize:12,backgroundColor:T=>{var P;return(P=T.palette[p])==null?void 0:P.main},color:T=>{var P;return(P=T.palette[p])==null?void 0:P.contrastText}},children:C})})]}))():(()=>n&&t?null:g.jsx(O.FormGroupContextProvider,{name:a.toString(),children:g.jsx(b.Stack,{alignContent:"stretch",style:t?q4:{},id:`tabpanel-${a}`,"aria-labelledby":`tabheader-${a}`,"aria-hidden":t||void 0,...h,children:f})}))()};Ml.propTypes={intent:c.oneOf(["header","content","sidebar"]),className:c.string,contentClassName:c.string,url:c.string,icon:c.element,label:c.oneOfType([c.string,c.element]).isRequired,value:c.oneOfType([c.string,c.number]),syncWithLocation:c.bool,onChange:c.func,selected:c.bool,hidden:c.bool,unmountOnExit:c.bool,children:c.node,badgeColor:c.oneOf(["default","error","info","primary","secondary","success","warning"]),badgeContent:c.oneOfType([c.string,c.number])},Ml.defaultProps={badgeColor:"default",unmountOnExit:!1};const $4=ai(b.List,{name:"RaLongFormTabs",slot:"Root"})(({theme:e})=>({p:0,"& .MuiListItemIcon-root":{minWidth:32,color:e.palette.grey[500]},"& .MuiListItemButton-root.Mui-selected":{borderRight:`2px solid ${e.palette.primary.main}`,marginRight:"-2px"}})),jm=({children:e,syncWithLocation:t,value:n,url:r,onChange:i})=>{const a=vr.useLocation();return g.jsx(Nn,{children:g.jsx($4,{component:"nav",children:S.Children.map(e,(l,u)=>{if(!S.isValidElement(l))return null;const A=e3(l,u),f=t?!!vr.matchPath(`${r}/${A}`,a.pathname):u===n;return S.cloneElement(l,{intent:"header",value:t?A:u,syncWithLocation:t,onChange:i,url:r,selected:f})})})})},e3=(e,t)=>e.props.path!=null?e.props.path:t>0?t.toString():"";jm.propTypes={children:c.node,url:c.string,tabsWithErrors:c.arrayOf(c.string),syncWithLocation:c.bool,onChange:c.func,value:c.oneOfType([c.string,c.number])};var t3=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},km=e=>e.firstChild?e.firstChild.offsetParent===e:!0,n3=(e,t)=>{let n=e,r=0;km(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},r3=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},Rs=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?Rs="sticky":CSS.supports("position","-webkit-sticky")&&(Rs="-webkit-sticky"));var Dl=!1;try{const e=Object.defineProperty({},"passive",{get(){Dl={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var vd=e=>{const{el:t,onChange:n,unsubs:r,measure:i}=e;if(t===window){const a=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),l=i(a()),u=()=>{Object.assign(l,i(a())),n()};return window.addEventListener("resize",u,Dl),r.push(()=>window.removeEventListener("resize",u)),l}else{const a=i(t.getBoundingClientRect()),l=()=>{Object.assign(a,i(t.getBoundingClientRect())),n()},u=new ResizeObserver(l);return u.observe(t),r.push(()=>u.disconnect()),a}},o3=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}},i3=(e,t,n)=>{const{bottom:r,offsetBottom:i,offsetTop:a}=n,l=t3(e);let u=!1;const A=()=>{u||requestAnimationFrame(()=>{const k=C();k!==x&&T(k),u=!1}),u=!0};let f=l===window?window.scrollY:l.scrollTop;const p=k=>{const{offsetTop:_,height:J}=m,{naturalTop:Y}=v,{height:ee}=M;return k+_+J>=Y+ee+j+i},C=()=>{const{height:k}=m,{height:_}=M;return _+a+i<=k?3:p(f)?1:2},h=l!==window&&km(l),m=vd({el:l,onChange:A,unsubs:t,measure:({height:k,top:_})=>({height:k,offsetTop:h?_:0})}),I=r3(e),B=I===window?{top:0,bottom:0}:o3(I),v=vd({el:I,onChange:A,unsubs:t,measure:({height:k})=>({height:k-B.top-B.bottom,naturalTop:I===window?0:n3(I,l)+B.top+m.offsetTop})}),M=vd({el:e,onChange:A,unsubs:t,measure:({height:k})=>({height:k})});let j=0,x=C();const T=k=>{const _=x;if(x=k,_===2&&(j=-1),k===3){e.style.position=Rs,r?e.style.bottom=`${i}px`:e.style.top=`${a}px`;return}const{height:J,offsetTop:Y}=m,{height:ee,naturalTop:le}=v,{height:se}=M;if(k===2)if(e.style.position="relative",j=_===0?Math.max(0,Y+f-le+a):Math.max(0,Y+f+J-(le+se+i)),r){const q=Math.max(0,ee-se-j);e.style.bottom=`${q}px`}else e.style.top=`${j}px`;else e.style.position=Rs,k===1?r?e.style.bottom=`${i}px`:e.style.top=`${J-se-i}px`:r?e.style.bottom=`${J-se-i}px`:e.style.top=`${a}px`};T(x);const P=k=>{if(k===f)return;const _=k-f;if(f=k,x===3)return;const{offsetTop:J,height:Y}=m,{naturalTop:ee,height:le}=v,{height:se}=M;if(_>0)if(x===0){if(k+J+a>ee){const q=Math.max(0,J+f-ee+a);k+J+Y<=ee+se+q+i?T(2):T(1)}}else x===2&&p(k)&&T(1);else if(x===1){if(J+k+Y<ee+le+i){const q=Math.max(0,J+f+Y-(ee+se+i));J+k+a>=ee+q?T(2):T(0)}}else x===2&&J+k+a<ee+j&&T(0)},L=l===window?()=>P(window.scrollY):()=>P(l.scrollTop);l.addEventListener("scroll",L,Dl),l.addEventListener("mousewheel",L,Dl),t.push(()=>l.removeEventListener("scroll",L),()=>l.removeEventListener("mousewheel",L))},s3=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,i]=S.useState(null);return S.useEffect(()=>{if(!r||!Rs)return;const a=[];return i3(r,a,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{a.forEach(l=>l())}},[r,t,e,n]),i},a3=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:i,className:a,style:l}=e,u=s3({offsetTop:t,offsetBottom:n,bottom:r});return g.jsx("div",{className:a,style:l,ref:u,children:i})},l3=a3;const c3=ue(b.Grid,{name:"ApplicaLongFormView",slot:"Root"})(({theme:e})=>({"& .MuiToolbar-root":{position:"initial",marginTop:e.spacing(2),marginLeft:`-${e.spacing(3)}`,marginRight:`-${e.spacing(3)}`,marginBottom:`-${e.spacing(2)}`,borderTop:`1px solid ${e.palette.divider}`,[e.breakpoints.down("sm")]:{position:"initial !important",width:"auto !important"}},"& form > .MuiToolbar-root":{margin:0,marginRight:`-${e.spacing(.5)}`,[e.breakpoints.down("sm")]:{marginRight:e.spacing(.5)}}})),Fm=(e,t)=>e&&e.type===Ol&&e.props.position===t,u3=e=>e&&e.type===Ml,bd=({children:e,formRootPathname:t,syncWithLocation:n,spacing:r,tabs:i,tabsDisposition:a,contentDisposition:l,sticky:u,...A})=>{const[f,p]=S.useState(0),C=vr.useResolvedPath(""),h=O.useResourceContext(A),m=vr.useLocation(),I=S.useMemo(()=>S.Children.toArray(e).find(T=>Fm(T,"top")),[e]),B=S.useMemo(()=>S.Children.toArray(e).find(T=>Fm(T,"bottom")),[e]),v=S.useMemo(()=>S.Children.toArray(e).filter(T=>u3(T)),[e]),M=T=>{n||p(T)},j=()=>S.cloneElement(i,{onChange:M,syncWithLocation:n,url:t,value:f,intent:"header"},v),x=S.useMemo(()=>g.jsxs(S.Fragment,{children:[I,n?g.jsx(vr.Routes,{children:g.jsx(vr.Route,{path:"/*",element:j()})}):j(),B]}),[I,n,j,B]);return g.jsxs(c3,{container:!0,spacing:r*2,children:[g.jsx(b.Grid,{item:!0,...a,children:u?g.jsx(l3,{offsetTop:74,offsetBottom:r*2,children:x}):x}),g.jsx(b.Grid,{item:!0,...l,children:S.Children.map(v,(T,P)=>{if(!T)return null;const L=O.getTabbedFormTabFullPath(T,P),k=n?!vr.matchPath(`${C.pathname}/${L}`,m.pathname):f!==P;return S.isValidElement(T)?S.cloneElement(T,{intent:"content",resource:h,hidden:k,value:n?L:P}):null})})]})};bd.propTypes={children:c.node,spacing:c.number,syncWithLocation:c.bool,tabs:c.element,formRootPathname:c.string,tabsDisposition:Sl,contentDisposition:Sl},bd.defaultProps={tabs:g.jsx(jm,{})};const A3=()=>{const e=gt.useLocation(),t=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/*",":resource/:id/*"];for(const n of t){const r=gt.matchPath(n,e.pathname);if(r)return r.pathnameBase}return""},js=({spacing:e,...t})=>{const n=A3(),{spacing:r}=Fn(),i=e||r;return g.jsx(O.Form,{formRootPathname:n,...t,children:g.jsx(bd,{formRootPathname:n,...t,spacing:i})})};js.propTypes={syncWithLocation:c.bool,spacing:c.number,tabsDisposition:Sl,contentDisposition:Sl,sticky:c.bool},js.defaultProps={syncWithLocation:!1,sticky:!0,spacing:2,tabsDisposition:{xl:3,lg:3,md:4,sm:4,xs:12},contentDisposition:{xl:9,lg:9,md:8,sm:8,xs:12}},js.Tab=Ml,js.Sidebar=Ol;const d3=ue(O.Show,{name:"RaApplicaShow",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaShow-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaShow-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),f3=ue(O.SimpleFormIterator,{name:"ApplicaSimpleFormIterator",root:"root"})(({theme:e})=>({"& .RaSimpleFormIterator-line":{paddingTop:e.spacing(1),paddingBottom:e.spacing(.5)},"& .RaSimpleFormIterator-action":{display:"flex",flexDirection:"row",alignItems:"center",mb:1.5},"& section":{width:"100%","& label":{position:"relative",overflow:"visible",transform:"none",marginLeft:0}}})),Rl=ai(O.TabbedForm,{name:"RaApplicaTabbedForm",slot:"Root"})(()=>({}));Rl.propTypes={...O.TabbedForm.propTypes},Rl.defaultProps={...O.TabbedForm.defaultProps},Rl.Tab=O.TabbedForm.Tab;const Lm=S.createContext(void 0),g3=S.createContext(void 0),p3=()=>S.useContext(Lm),h3=V.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:i=!1,index:a,member:l,resource:u}=e,A=O.useTranslate(),[f,p]=V.useState(!1),{total:C,remove:h}=p3(),m=V.useCallback(()=>{p(!1),h(a)},[a,h]),I=S.useMemo(()=>({index:a,total:C,remove:()=>h(a)}),[a,C,h]);return g.jsxs(g3.Provider,{value:I,children:[S.Children.map(n,(B,v)=>{if(!S.isValidElement(B))return null;const{source:M,...j}=B.props;return g.jsx(b.TableCell,{sx:{border:0,verticalAlign:"top"},children:S.cloneElement(B,{source:M?`${l}.${M}`:l,index:M?void 0:v,resource:u,disabled:r,...j,label:!1})})}),!i&&g.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",border:0,pt:2},children:g.jsx(fi,{horizontal:!0,children:g.jsx(b.Typography,{color:"error",onClick:()=>p(!0),children:A("ra.action.delete")})})}),n.length>0&&g.jsx(O.Confirm,{isOpen:f,title:A("ra.action.remove_item"),content:A("ra.message.remove_item"),onConfirm:m,onClose:()=>p(!1)})]})});var C3=Array.isArray,Qd=C3,E3=typeof kn=="object"&&kn&&kn.Object===Object&&kn,m3=E3,I3=m3,B3=typeof self=="object"&&self&&self.Object===Object&&self,y3=I3||B3||Function("return this")(),xd=y3,v3=xd,b3=v3.Symbol,wd=b3,Nm=wd,Vm=Object.prototype,Q3=Vm.hasOwnProperty,x3=Vm.toString,ks=Nm?Nm.toStringTag:void 0;function w3(e){var t=Q3.call(e,ks),n=e[ks];try{e[ks]=void 0;var r=!0}catch{}var i=x3.call(e);return r&&(t?e[ks]=n:delete e[ks]),i}var T3=w3,P3=Object.prototype,S3=P3.toString;function O3(e){return S3.call(e)}var M3=O3,Hm=wd,D3=T3,R3=M3,j3="[object Null]",k3="[object Undefined]",zm=Hm?Hm.toStringTag:void 0;function F3(e){return e==null?e===void 0?k3:j3:zm&&zm in Object(e)?D3(e):R3(e)}var Wm=F3;function L3(e){return e!=null&&typeof e=="object"}var N3=L3,V3=Wm,H3=N3,z3="[object Symbol]";function W3(e){return typeof e=="symbol"||H3(e)&&V3(e)==z3}var Td=W3,U3=Qd,Y3=Td,G3=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K3=/^\w*$/;function _3(e,t){if(U3(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Y3(e)?!0:K3.test(e)||!G3.test(e)||t!=null&&e in Object(t)}var J3=_3;function X3(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Um=X3,Z3=Wm,q3=Um,$3="[object AsyncFunction]",eM="[object Function]",tM="[object GeneratorFunction]",nM="[object Proxy]";function rM(e){if(!q3(e))return!1;var t=Z3(e);return t==eM||t==tM||t==$3||t==nM}var oM=rM,iM=xd,sM=iM["__core-js_shared__"],aM=sM,Pd=aM,Ym=function(){var e=/[^.]+$/.exec(Pd&&Pd.keys&&Pd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function lM(e){return!!Ym&&Ym in e}var cM=lM,uM=Function.prototype,AM=uM.toString;function dM(e){if(e!=null){try{return AM.call(e)}catch{}try{return e+""}catch{}}return""}var fM=dM,gM=oM,pM=cM,hM=Um,CM=fM,EM=/[\\^$.*+?()[\]{}|]/g,mM=/^\[object .+?Constructor\]$/,IM=Function.prototype,BM=Object.prototype,yM=IM.toString,vM=BM.hasOwnProperty,bM=RegExp("^"+yM.call(vM).replace(EM,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function QM(e){if(!hM(e)||pM(e))return!1;var t=gM(e)?bM:mM;return t.test(CM(e))}var xM=QM;function wM(e,t){return e==null?void 0:e[t]}var TM=wM,PM=xM,SM=TM;function OM(e,t){var n=SM(e,t);return PM(n)?n:void 0}var Gm=OM,MM=Gm,DM=MM(Object,"create"),jl=DM,Km=jl;function RM(){this.__data__=Km?Km(null):{},this.size=0}var jM=RM;function kM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var FM=kM,LM=jl,NM="__lodash_hash_undefined__",VM=Object.prototype,HM=VM.hasOwnProperty;function zM(e){var t=this.__data__;if(LM){var n=t[e];return n===NM?void 0:n}return HM.call(t,e)?t[e]:void 0}var WM=zM,UM=jl,YM=Object.prototype,GM=YM.hasOwnProperty;function KM(e){var t=this.__data__;return UM?t[e]!==void 0:GM.call(t,e)}var _M=KM,JM=jl,XM="__lodash_hash_undefined__";function ZM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=JM&&t===void 0?XM:t,this}var qM=ZM,$M=jM,eD=FM,tD=WM,nD=_M,rD=qM;function xi(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])}}xi.prototype.clear=$M,xi.prototype.delete=eD,xi.prototype.get=tD,xi.prototype.has=nD,xi.prototype.set=rD;var oD=xi;function iD(){this.__data__=[],this.size=0}var sD=iD;function aD(e,t){return e===t||e!==e&&t!==t}var lD=aD,cD=lD;function uD(e,t){for(var n=e.length;n--;)if(cD(e[n][0],t))return n;return-1}var kl=uD,AD=kl,dD=Array.prototype,fD=dD.splice;function gD(e){var t=this.__data__,n=AD(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():fD.call(t,n,1),--this.size,!0}var pD=gD,hD=kl;function CD(e){var t=this.__data__,n=hD(t,e);return n<0?void 0:t[n][1]}var ED=CD,mD=kl;function ID(e){return mD(this.__data__,e)>-1}var BD=ID,yD=kl;function vD(e,t){var n=this.__data__,r=yD(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var bD=vD,QD=sD,xD=pD,wD=ED,TD=BD,PD=bD;function wi(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])}}wi.prototype.clear=QD,wi.prototype.delete=xD,wi.prototype.get=wD,wi.prototype.has=TD,wi.prototype.set=PD;var SD=wi,OD=Gm,MD=xd,DD=OD(MD,"Map"),RD=DD,_m=oD,jD=SD,kD=RD;function FD(){this.size=0,this.__data__={hash:new _m,map:new(kD||jD),string:new _m}}var LD=FD;function ND(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var VD=ND,HD=VD;function zD(e,t){var n=e.__data__;return HD(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Fl=zD,WD=Fl;function UD(e){var t=WD(this,e).delete(e);return this.size-=t?1:0,t}var YD=UD,GD=Fl;function KD(e){return GD(this,e).get(e)}var _D=KD,JD=Fl;function XD(e){return JD(this,e).has(e)}var ZD=XD,qD=Fl;function $D(e,t){var n=qD(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var eR=$D,tR=LD,nR=YD,rR=_D,oR=ZD,iR=eR;function Ti(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])}}Ti.prototype.clear=tR,Ti.prototype.delete=nR,Ti.prototype.get=rR,Ti.prototype.has=oR,Ti.prototype.set=iR;var sR=Ti,Jm=sR,aR="Expected a function";function Sd(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(aR);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var l=e.apply(this,r);return n.cache=a.set(i,l)||a,l};return n.cache=new(Sd.Cache||Jm),n}Sd.Cache=Jm;var lR=Sd,cR=lR,uR=500;function AR(e){var t=cR(e,function(r){return n.size===uR&&n.clear(),r}),n=t.cache;return t}var dR=AR,fR=dR,gR=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pR=/\\(\\)?/g,hR=fR(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(gR,function(n,r,i,a){t.push(i?a.replace(pR,"$1"):r||n)}),t}),CR=hR;function ER(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var mR=ER,Xm=wd,IR=mR,BR=Qd,yR=Td,vR=1/0,Zm=Xm?Xm.prototype:void 0,qm=Zm?Zm.toString:void 0;function $m(e){if(typeof e=="string")return e;if(BR(e))return IR(e,$m)+"";if(yR(e))return qm?qm.call(e):"";var t=e+"";return t=="0"&&1/e==-vR?"-0":t}var bR=$m,QR=bR;function xR(e){return e==null?"":QR(e)}var wR=xR,TR=Qd,PR=J3,SR=CR,OR=wR;function MR(e,t){return TR(e)?e:PR(e,t)?[e]:SR(OR(e))}var DR=MR,RR=Td,jR=1/0;function kR(e){if(typeof e=="string"||RR(e))return e;var t=e+"";return t=="0"&&1/e==-jR?"-0":t}var FR=kR,LR=DR,NR=FR;function VR(e,t){t=LR(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[NR(t[n++])];return n&&n==r?e:void 0}var HR=VR,zR=HR;function WR(e,t,n){var r=e==null?void 0:zR(e,t);return r===void 0?n:r}var UR=WR;const YR=ti(UR),e0=e=>{const{children:t,resource:n,source:r,label:i,disableActions:a=!1,disableAdd:l=!1,disableRemove:u=!1,className:A,empty:f}=e,[p,C]=S.useState(!1),{fields:h,remove:m,replace:I}=O.useArrayInput(e),B=xt(),v=be.useTranslate(),M=be.useRecordContext(e),j=S.useRef({}),x=be.useTranslateLabel(),T=S.useCallback(J=>{m(J)},[m]);if(h.length>0){const{...J}=h[0];j.current=J;for(const Y in j.current)j.current[Y]=null}const P=S.useCallback(()=>{I([]),C(!1)},[I]),L=YR(M,r),k=S.useMemo(()=>({total:h.length,remove:T,source:r}),[h.length,T,r]),_=B.palette.mode==="dark"?B.palette.grey.A400:B.palette.grey.A800;return h?g.jsx(Lm.Provider,{value:k,children:g.jsxs("div",{className:A,children:[g.jsx(t0,{label:i,source:r,disableAdd:l}),g.jsx(b.TableContainer,{component:b.Paper,sx:{mt:2,border:`1px solid ${_}`},children:g.jsxs(b.Table,{children:[g.jsx(b.TableHead,{sx:{borderTop:0,borderBottom:`1px solid ${_}`},children:g.jsxs(b.TableRow,{children:[S.Children.map(t,(J,Y)=>V.isValidElement(J)?g.jsx(b.TableCell,{children:g.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none",children:x({...J.props,resource:n})})},Y):null),!a&&g.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"top"},children:g.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none"})},"actions")]})}),g.jsxs(b.TableBody,{children:[h.length===0&&g.jsx(b.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0}},children:g.jsx(b.TableCell,{colSpan:4+(a?0:1),align:"center",children:f||g.jsx(b.Typography,{variant:"body1",color:"text.secondary",children:"-"})})}),h.length>0&&h.map((J,Y)=>g.jsx(b.TableRow,{sx:{borderBottom:`1px solid ${_}}`},children:g.jsx(h3,{disableRemove:u,disableActions:a,index:Y,member:`${r}.${Y}`,onRemoveField:T,record:L&&L[Y]||{},resource:n,source:r,children:t})},J.id))]})]})}),h.length>0&&g.jsx(O.Confirm,{isOpen:p,title:v("ra.action.clear_array_input"),content:v("ra.message.clear_array_input"),onConfirm:P,onClose:()=>C(!1)})]})}):null},t0=e=>{const{label:t,disableAdd:n}=e,{append:r}=O.useArrayInput(e),i=xt(),a=i.palette.mode==="dark"?i.palette.grey.A400:i.palette.grey.A800,l=i.palette.mode==="light"?"#000000":"#FFFFFF";return g.jsxs(b.Stack,{justifyContent:"space-between",alignItems:"center",flexDirection:"row",children:[g.jsx(b.Typography,{children:t}),!n&&g.jsx(b.IconButton,{size:"small",color:"secondary",sx:{border:`1px solid ${a}`},onClick:()=>r({}),children:g.jsx(et.PlusCircleOutlined,{style:{color:l}})})]})},GR=ue(e0,{name:"RaApplicaTableFormIterator",slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8)})`}}}));t0.propTypes={label:c.string.isRequired,source:c.string.isRequired},e0.propTypes={addButton:c.element,children:c.node,className:c.string,field:c.object,fields:c.array,fieldState:c.object,formState:c.object,record:c.object,source:c.string,label:c.string,resource:c.string,translate:c.func,disableAdd:c.bool,disableRemove:c.oneOfType([c.func,c.bool]),TransitionProps:c.shape({}),empty:c.oneOfType([c.node,c.string])};function KR(e,t){const n=pt.clone(e),{type:r,payload:i}=t;switch(r){case"updateMedia":{const a=pt.chain(n.media).clone().extend(i).value();return pt.extend(n,{media:a})}case"updateDrawer":{const a=pt.chain(n.drawer).clone().extend(i).value();return pt.extend(n,{drawer:a})}case"updateLogo":{const a=pt.chain(n.logo).clone().extend(i).value();return pt.extend(n,{logo:a})}case"updateNotifications":{const a=pt.chain(n.notifications).clone().extend(i).value();return pt.extend(n,{notifications:a})}case"updateTheme":{const a=pt.chain(n.theme).clone().extend(i).value();return pt.extend(n,{theme:a})}default:return n}}const _R={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"}},n0=S.createContext(void 0);function r0(e){var _;const t=be.useGetIdentity(),n=b.useTheme(),r=b.useMediaQuery(n.breakpoints.down("md")),i=b.useMediaQuery(n.breakpoints.down("lg")),a=b.useMediaQuery(n.breakpoints.down("xl")),{miniDrawer:l,isHorizontalLayout:u,menuOrientation:A,drawerWidth:f}=Fn(),p=u(A)&&!i,{drawerOpen:C,openDrawer:h}=Jr(),m=S.useCallback(()=>{h(!C)},[C,h]),[I,B]=S.useState(!1),[v,M]=S.useReducer(KR,pt.chain(_R).clone().merge({drawer:{open:!l||C}}).value()),j=S.useCallback(()=>B(!1),[]),x=S.useMemo(()=>({state:v,dispatch:M}),[v,M]),{logoIcon:T,logoMain:P,enableNotification:L,notification:k}=e;return S.useEffect(()=>{M({type:"updateMedia",payload:{downMd:r,downLg:i,downXl:a,horizontal:p}})},[A,r,i,a]),S.useEffect(()=>{M({type:"updateDrawer",payload:{open:C,width:f,handleDrawerToggle:m}})},[C,f,m]),S.useEffect(()=>{l||h(!a)},[a,l]),S.useEffect(()=>{M({type:"updateLogo",payload:{main:P,icon:T}})},[T,P]),S.useEffect(()=>{M({type:"updateNotifications",payload:{enable:L,resource:k??"entities/notification"}})},[L,k]),S.useEffect(()=>{M({type:"updateTheme",payload:{iconColorOpen:n.palette.mode==="dark"?"grey.200":"grey.300",iconColor:n.palette.mode==="dark"?"background.default":"grey.100"}})},[n.palette.mode]),S.useEffect(()=>{var J;B(((J=t==null?void 0:t.data)==null?void 0:J.needToChangePassword)===!0)},[(_=t==null?void 0:t.data)==null?void 0:_.needToChangePassword]),g.jsxs(n0.Provider,{value:x,children:[g.jsx(b.Dialog,{open:I,maxWidth:"xs",fullWidth:!0,children:g.jsx(Bd,{onSuccess:j,firstAccess:!0})}),e.children]})}function o0(e){return S.forwardRef((t,n)=>{const{logoIcon:r,logoMain:i,enableNotification:a}=t;return g.jsx(r0,{logoIcon:r,logoMain:i,enableNotification:a,children:g.jsx(e,{ref:n,...t})})})}function Od(){const e=S.useContext(n0);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function JR(){return Od().dispatch}function Pi(){return Od().state}function zn(){return Pi().media}function ko(){return Pi().drawer}function i0(){return Pi().logo}function Ll(){return Pi().notifications}function Nl(){return Pi().theme}function s0(){const{iconColor:e,iconColorOpen:t}=Nl(),{open:n,handleDrawerToggle:r}=ko();return g.jsx(ro,{"aria-label":"open drawer",onClick:r,edge:"start",color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:n?t:e,ml:{xs:0,lg:-2}},children:n?g.jsx(et.MenuFoldOutlined,{}):g.jsx(et.MenuUnfoldOutlined,{})})}function a0(e){const t=S.useRef(),n=b.useTheme(),{downLg:r,horizontal:i}=zn(),{open:a,width:l}=ko(),u=r?b.AppBar:dh,A=pi(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:i?"100%":a?`calc(100% - ${l}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),f={position:"fixed",color:"inherit",elevation:0,sx:A};return r||pt.extend(f,{open:a}),g.jsx(u,{ref:t,...f,children:g.jsxs(b.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!i&&g.jsx(s0,{}),e.children]})})}function XR(e){const t=b.useTheme(),{notification:n,onClick:r,selected:i,divider:a}=e,{resource:l}=Ll(),u=be.useNotify(),A=be.useRedirect(),[f]=be.useUpdate(l,{id:n==null?void 0:n.id,data:{...n,readed:Rr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n!=null&&n.resource?n!=null&&n.resource.startsWith("/")?(A(n==null?void 0:n.resource),r()):document.location.href=n==null?void 0:n.resource:r()},onFailure:()=>{u("resources.notifications.messages.readed.error","warning")}}),p=S.useCallback(()=>f(),[f]),[C]=be.useLocaleState(),h=S.useMemo(()=>Rr(n.created).locale(C).fromNow(),[n,C]);return g.jsx(b.ListItem,{disablePadding:!0,divider:a,children:g.jsxs(b.ListItemButton,{selected:i,onClick:p,children:[g.jsx(b.ListItemAvatar,{children:g.jsx(b.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:g.jsx(et.MessageOutlined,{})})}),g.jsx(b.ListItemText,{primary:n.title,secondary:n.content}),g.jsx(b.Box,{flexGrow:1,flexShrink:1,minWidth:t.spacing(2)}),g.jsx(b.ListItemText,{primary:h,primaryTypographyProps:{variant:"caption"}})]})})}const ZR={width:36,height:36,fontSize:"1rem"},qR={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function l0(){const{enable:e}=Ll();return e?g.jsx($R,{}):null}function $R(){const e=b.useTheme(),t=S.useRef(),{resource:n}=Ll(),{downMd:r}=zn(),{iconColor:i,iconColorOpen:a}=Nl(),[l,u]=S.useState(!1),[A,f]=S.useState([]),p=A.filter(B=>B.readed===null).length,C=S.useCallback(()=>u(!l),[l]),h=S.useCallback(()=>{t.current&&t.current.contains(event.target)||u(!1)},[t.current,u]),{data:m,isLoading:I}=be.useGetList(n,{pagination:{page:1,perPage:50},sort:{field:"created",order:"DESC"},filter:{readed:!1}});return S.useEffect(()=>{!I&&m&&f(m??[])},[m,I]),g.jsxs(b.Box,{sx:{flexShrink:0},children:[g.jsx(ro,{color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:l?a:i},"aria-label":"open profile",ref:t,"aria-controls":l?"profile-grow":void 0,"aria-haspopup":"true",onClick:C,children:g.jsx(b.Badge,{badgeContent:p,color:"primary",children:g.jsx(et.BellOutlined,{})})}),g.jsx(b.Popper,{placement:r?"bottom":"bottom-end",open:l,anchorEl:t.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[r?-5:0,9]}}]},children:({TransitionProps:B})=>g.jsx(io,{type:"grow",position:r?"top":"top-right",in:open,...B,children:g.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:"100%",minWidth:285,maxWidth:420,[e.breakpoints.down("md")]:{maxWidth:285}},children:g.jsx(b.ClickAwayListener,{onClickAway:h,children:g.jsx(Nn,{title:"Notification",elevation:0,border:!1,content:!1,secondary:g.jsx(g.Fragment,{children:p>0&&g.jsx(b.Tooltip,{title:"Mark as all read",children:g.jsx(ro,{color:"success",size:"small",children:g.jsx(et.CheckCircleOutlined,{style:{fontSize:"1.15rem"}})})})}),children:g.jsx(b.List,{component:"nav",sx:{p:0,"& .MuiListItemButton-root":{py:.5,"&.Mui-selected":{bgcolor:"grey.50",color:"text.primary"},"& .MuiAvatar-root":ZR,"& .MuiListItemSecondaryAction-root":{...qR,position:"relative"}}},children:A.map((v,M)=>g.jsx(XR,{selected:p>0,notification:v,onClick:h,divider:M<A.length-1},v.id))})})})})})})]})}const ej=()=>{const[e,t]=S.useState(!1),n=S.useCallback(()=>t(!1),[t]),r=S.useCallback(()=>t(!0),[t]),i=be.useTranslate();return g.jsxs(S.Fragment,{children:[g.jsxs(b.ListItemButton,{onClick:r,children:[g.jsx(b.ListItemIcon,{children:g.jsx(jn.Key,{})}),g.jsx(b.ListItemText,{primary:i("ra.auth.change_password")})]}),g.jsx(b.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:g.jsx(Bd,{onSuccess:n})})]})},tj=()=>{const e=be.useLogout(),t=be.useTranslate();return g.jsx(S.Fragment,{children:g.jsxs(b.ListItemButton,{onClick:e,children:[g.jsx(b.ListItemIcon,{children:g.jsx(jn.LogoutOutlined,{})}),g.jsx(b.ListItemText,{primary:t("ra.auth.logout")})]})})},nj=()=>{const e=be.useTranslate(),t=be.useAuthProvider(),n=S.useCallback(()=>t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,i]=S.useState(!1);return S.useEffect(()=>{t.isImpersonating&&t.isImpersonating().then(a=>i(a))},[t,i]),r?g.jsx(S.Fragment,{children:g.jsxs(b.ListItemButton,{onClick:n,children:[g.jsx(b.ListItemIcon,{children:g.jsx(jn.LogoutOutlined,{})}),g.jsx(b.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};c.node,c.any.isRequired,c.any.isRequired;const c0=()=>{var B;const e=b.useTheme(),{identity:t}=O.useGetIdentity(),n=t!==void 0&&t.image&&t.image!==null&&t.image!=="",r=S.useRef(null),[i,a]=S.useState(!1),l=()=>{a(v=>!v)},u=v=>{r.current&&r.current.contains(v.target)||a(!1)},A=e.palette.mode==="dark"?"grey.200":"grey.300",f=O.useLogout(),p=O.useDataProvider(),C=O.useAuthProvider(),h=S.useCallback(()=>{f()},[C,f]),[m,I]=S.useState(null);return S.useEffect(()=>{if(!n)return;async function v(){var M=await p.getFile("/profile/me/image");I(M)}v()},[p,n]),g.jsxs(b.Box,{sx:{flexShrink:0},children:[g.jsx(b.ButtonBase,{sx:{p:.25,bgcolor:i?A:"transparent",borderRadius:1,"&:hover":{bgcolor:e.palette.mode==="dark"?"secondary.light":"secondary.lighter"},"&:focus-visible":{outline:`2px solid ${e.palette.secondary.dark}`,outlineOffset:2}},"aria-label":"open profile",ref:r,"aria-controls":i?"profile-grow":void 0,"aria-haspopup":"true",onClick:l,children:g.jsxs(b.Stack,{direction:"row",spacing:2,alignItems:"center",sx:{p:.5},children:[g.jsx(Cl,{alt:(B=t==null?void 0:t.name)==null?void 0:B.toUpperCase(),src:m,size:"xs"}),g.jsx(b.Typography,{variant:"subtitle1",children:t==null?void 0:t.name})]})}),g.jsx(b.Popper,{placement:"bottom-end",open:i,anchorEl:r.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:v})=>{var M;return g.jsx(io,{type:"grow",position:"top-right",in:i,...v,children:g.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:290,minWidth:240,maxWidth:290,[e.breakpoints.down("md")]:{maxWidth:250}},children:g.jsx(b.ClickAwayListener,{onClickAway:u,children:g.jsxs(Nn,{elevation:0,border:!1,content:!1,children:[g.jsx(b.CardContent,{sx:{px:2.5,pt:3},children:g.jsxs(b.Grid,{container:!0,justifyContent:"space-between",alignItems:"center",children:[g.jsx(b.Grid,{item:!0,children:g.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[g.jsx(Cl,{alt:"profile user",src:m,sx:{width:32,height:32}}),g.jsxs(b.Stack,{children:[g.jsx(b.Typography,{variant:"h6",children:t==null?void 0:t.name}),g.jsx(b.Typography,{variant:"body2",color:"textSecondary",children:(M=t==null?void 0:t.roles)==null?void 0:M.map(j=>j.name.replace("ROLE_","")).join(",")})]})]})}),g.jsx(b.Grid,{item:!0,children:g.jsx(b.Tooltip,{title:"Logout",children:g.jsx(ro,{size:"large",sx:{color:"text.primary"},onClick:h,children:g.jsx(et.LogoutOutlined,{})})})})]})}),g.jsx(b.Grid,{container:!0,children:g.jsx(b.Grid,{item:!0,xs:12,children:g.jsxs(b.List,{component:"nav",sx:{p:0,"& .MuiListItemIcon-root":{minWidth:32}},children:[g.jsx(ej,{}),g.jsx(tj,{}),g.jsx(nj,{})]})})})]})})})})}})]})},u0=e=>{const t=xt(),{downMd:n}=zn(),{iconColor:r,iconColorOpen:i}=Nl(),[a,l]=S.useState(!1),u=S.useRef(null),A=S.useCallback(()=>{l(!a)},[a]),f=S.useCallback(p=>{u.current&&u.current.contains(p.target)||l(!1)},[]);return n?g.jsxs(g.Fragment,{children:[g.jsx(b.Box,{sx:{flexShrink:0},children:g.jsx(ro,{sx:{color:"text.primary",bgcolor:a?i:r},"aria-label":"open more menu",ref:u,"aria-controls":a?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:A,color:"secondary",variant:"light",children:g.jsx(et.MoreOutlined,{})})}),g.jsx(b.Popper,{placement:"bottom-end",open:a,anchorEl:u.current,role:void 0,transition:!0,disablePortal:!0,style:{width:"100%"},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:p})=>g.jsx(io,{type:"fade",in:a,...p,children:g.jsx(b.Paper,{sx:{boxShadow:t.customShadows.z1},children:g.jsx(b.ClickAwayListener,{onClickAway:f,children:g.jsx(b.AppBar,{color:"inherit",children:g.jsx(b.Toolbar,{children:e.children})})})})})})]}):g.jsx(g.Fragment,{children:e.children})};function A0(e){return g.jsx(b.Box,{...e,flex:1})}function Fs(e){const{name:t,version:n}=e;return g.jsx(b.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:"24px 16px 0px",mt:"auto"},children:g.jsxs(b.Typography,{variant:"caption",children:[g.jsx("span",{dangerouslySetInnerHTML:{__html:(e==null?void 0:e.copy)||""}})," ",t," - ",n]})})}Fs.propTypes={name:c.string.isRequired,version:c.string.isRequired,copy:c.string},Fs.defaultProps={copy:"&copy; Applica Software Guru for"};function d0(e){const{width:t}=ko(),{horizontal:n}=zn(),{container:r}=Fn();return g.jsxs(b.Box,{component:"main",sx:{width:`calc(100% - ${t}px)`,flexGrow:1,p:{xs:0,sm:2,lg:1},pt:{lg:2}},children:[g.jsx(b.Toolbar,{sx:{mt:n?8:"inherit"}})," ",g.jsx(b.Container,{maxWidth:r?"xl":!1,sx:{...r&&{px:{xs:0,sm:2}},position:"relative",minHeight:"calc(100vh - 110px)",display:"flex",flexDirection:"column"},children:e.children})]})}const f0=S.forwardRef((e,t)=>{const n=pi(e,{display:"flex",width:"100%"});return g.jsx(b.Box,{ref:t,...e,sx:n,children:e.children})});var g0={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})(g0);var rj=g0.exports,Md={};const oj=Lb(zO);var p0;function ij(){return p0||(p0=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=oj}(Md)),Md}function h0(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=h0(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function sj(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=h0(e))&&(r&&(r+=" "),r+=t);return r}var Dd=globalThis&&globalThis.__assign||function(){return Dd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Dd.apply(this,arguments)},aj=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},C0=function(e){var t=e.className,n=e.sx,r=aj(e,["className","sx"]),i=be.useLoading(),a=xt();return V.createElement(lj,{className:t,sx:n},i?V.createElement(fm,Dd({className:sj("app-loader",Vl.loader),color:"inherit",size:a.spacing(2),thickness:6},r)):V.createElement(Z0,{className:Vl.loadedIcon}))};C0.propTypes={classes:c.object,className:c.string,width:c.string};var Rd="RaLoadingIndicator",Vl={loader:"".concat(Rd,"-loader"),loadedIcon:"".concat(Rd,"-loadedIcon")},lj=ue("div",{name:Rd,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={},t["& .".concat(Vl.loader)]={marginLeft:n.spacing(1.5),marginRight:n.spacing(1.5)},t["& .".concat(Vl.loadedIcon)]={},t});const jd=e=>e.scrollTop;function Si(e,t){var n,r;const{timeout:i,easing:a,style:l={}}=e;return{duration:(n=l.transitionDuration)!=null?n:typeof i=="number"?i:i[t.mode]||0,easing:(r=l.transitionTimingFunction)!=null?r:typeof a=="object"?a[t.mode]:a,delay:l.transitionDelay}}const cj=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function uj(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),a=oi(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const f=a.getComputedStyle(t);l=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("transform")}let u=0,A=0;if(l&&l!=="none"&&typeof l=="string"){const f=l.split("(")[1].split(")")[0].split(",");u=parseInt(f[4],10),A=parseInt(f[5],10)}return e==="left"?i?`translateX(${i.right+u-r.left}px)`:`translateX(${a.innerWidth+u-r.left}px)`:e==="right"?i?`translateX(-${r.right-i.left-u}px)`:`translateX(-${r.left+r.width-u}px)`:e==="up"?i?`translateY(${i.bottom+A-r.top}px)`:`translateY(${a.innerHeight+A-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-A}px)`:`translateY(-${r.top+r.height-A}px)`}function E0(e){return typeof e=="function"?e():e}function Hl(e,t,n){const r=E0(n),i=uj(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const m0=V.forwardRef(function(t,n){const r=xt(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},a={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:u=!0,children:A,container:f,direction:p="down",easing:C=i,in:h,onEnter:m,onEntered:I,onEntering:B,onExit:v,onExited:M,onExiting:j,style:x,timeout:T=a,TransitionComponent:P=UA}=t,L=Ke(t,cj),k=V.useRef(null),_=Bn(A.ref,k,n),J=F=>te=>{F&&(te===void 0?F(k.current):F(k.current,te))},Y=J((F,te)=>{Hl(p,F,f),jd(F),m&&m(F,te)}),ee=J((F,te)=>{const W=Si({timeout:T,style:x,easing:C},{mode:"enter"});F.style.webkitTransition=r.transitions.create("-webkit-transform",U({},W)),F.style.transition=r.transitions.create("transform",U({},W)),F.style.webkitTransform="none",F.style.transform="none",B&&B(F,te)}),le=J(I),se=J(j),q=J(F=>{const te=Si({timeout:T,style:x,easing:C},{mode:"exit"});F.style.webkitTransition=r.transitions.create("-webkit-transform",te),F.style.transition=r.transitions.create("transform",te),Hl(p,F,f),v&&v(F)}),K=J(F=>{F.style.webkitTransition="",F.style.transition="",M&&M(F)}),z=F=>{l&&l(k.current,F)},Z=V.useCallback(()=>{k.current&&Hl(p,k.current,f)},[p,f]);return V.useEffect(()=>{if(h||p==="down"||p==="right")return;const F=Ep(()=>{k.current&&Hl(p,k.current,f)}),te=oi(k.current);return te.addEventListener("resize",F),()=>{F.clear(),te.removeEventListener("resize",F)}},[p,h,f]),V.useEffect(()=>{h||Z()},[h,Z]),g.jsx(P,U({nodeRef:k,onEnter:Y,onEntered:le,onEntering:ee,onExit:q,onExited:K,onExiting:se,addEndListener:z,appear:u,in:h,timeout:T},L,{children:(F,te)=>V.cloneElement(A,U({ref:_,style:U({visibility:F==="exited"&&!h?"hidden":void 0},x,A.props.style)},te))}))});process.env.NODE_ENV!=="production"&&(m0.propTypes={addEndListener:c.func,appear:c.bool,children:ni.isRequired,container:br(c.oneOfType([bo,c.func]),e=>{if(e.open){const t=E0(e.container);if(t&&t.nodeType===1){const n=t.getBoundingClientRect();if(process.env.NODE_ENV!=="test"&&n.top===0&&n.left===0&&n.right===0&&n.bottom===0)return new Error(["MUI: The `container` prop provided to the component is invalid.","The anchor element should be part of the document layout.","Make sure the element is present in the document or that it's not display none."].join(`
202
+ `),t4)),dm=V.forwardRef(function(t,n){const r=Gt({props:t,name:"MuiCircularProgress"}),{className:i,color:a="primary",disableShrink:l=!1,size:u=40,style:A,thickness:f=3.6,value:p=0,variant:C="indeterminate"}=r,h=Ke(r,$O),m=U({},r,{color:a,disableShrink:l,size:u,thickness:f,value:p,variant:C}),I=n4(m),B={},v={},M={};if(C==="determinate"){const j=2*Math.PI*((oo-f)/2);B.strokeDasharray=j.toFixed(3),M["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*j).toFixed(3)}px`,v.transform="rotate(-90deg)"}return g.jsx(r4,U({className:Xe(I.root,i),style:U({width:u,height:u},v,A),ownerState:m,ref:n,role:"progressbar"},M,h,{children:g.jsx(o4,{className:I.svg,ownerState:m,viewBox:`${oo/2} ${oo/2} ${oo} ${oo}`,children:g.jsx(i4,{className:I.circle,style:B,ownerState:m,cx:oo,cy:oo,r:(oo-f)/2,fill:"none",strokeWidth:f})})}))});process.env.NODE_ENV!=="production"&&(dm.propTypes={classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","primary","secondary","error","info","success","warning"]),c.string]),disableShrink:br(c.bool,e=>e.disableShrink&&e.variant&&e.variant!=="indeterminate"?new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect."):null),size:c.oneOfType([c.number,c.string]),style:c.object,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),thickness:c.number,value:c.number,variant:c.oneOf(["determinate","indeterminate"])});const fm=dm;function s4(e){return Vt("MuiLoadingButton",e)}const Mr=Yt("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),a4=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],l4=e=>{const{loading:t,loadingPosition:n,classes:r}=e,i={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Te(n)}`],endIcon:[t&&`endIconLoading${Te(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Te(n)}`]},a=ur.unstable_composeClasses(i,s4,r);return U({},r,a)},c4=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",u4=ue(ZO,{shouldForwardProp:e=>c4(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Mr.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Mr.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>U({[`& .${Mr.startIconLoadingStart}, & .${Mr.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}),[`&.${Mr.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Mr.startIconLoadingStart}, & .${Mr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Mr.startIconLoadingStart}, & .${Mr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),A4=ue("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Te(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>U({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})),gm=V.forwardRef(function(t,n){const r=Gt({props:t,name:"MuiLoadingButton"}),{children:i,disabled:a=!1,id:l,loading:u=!1,loadingIndicator:A,loadingPosition:f="center",variant:p="text"}=r,C=Ke(r,a4),h=yu(l),m=A??g.jsx(fm,{"aria-labelledby":h,color:"inherit",size:16}),I=U({},r,{disabled:a,loading:u,loadingIndicator:m,loadingPosition:f,variant:p}),B=l4(I),v=u?g.jsx(A4,{className:B.loadingIndicator,ownerState:I,children:m}):null;return g.jsxs(u4,U({disabled:a||u,id:h,ref:n},C,{variant:p,classes:B,ownerState:I,children:[I.loadingPosition==="end"?i:v,I.loadingPosition==="end"?v:i]}))});process.env.NODE_ENV!=="production"&&(gm.propTypes={children:c.node,classes:c.object,disabled:c.bool,id:c.string,loading:c.bool,loadingIndicator:c.node,loadingPosition:br(c.oneOf(["start","end","center"]),e=>e.loadingPosition==="start"&&!e.startIcon?new Error('MUI: The loadingPosition="start" should be used in combination with startIcon.'):e.loadingPosition==="end"&&!e.endIcon?new Error('MUI: The loadingPosition="end" should be used in combination with endIcon.'):null),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["contained","outlined","text"]),c.string])});const d4=gm;function XA({variant:e,theme:t,color:n,loadingPosition:r}){const i=$t(t,n),{lighter:a,main:l,dark:u,contrastText:A}=i,f=`${n}Button`,p=bi(t,f),C={"& .MuiLoadingButton-loadingIndicator":{color:l}},h={...r&&r!=="center"&&{color:l}},m={"&::after":{boxShadow:`0 0 6px 6px ${Ne(l,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${Ne(l,.9)}`},"&:focus-visible":{outline:`2px solid ${u}`,outlineOffset:2}};switch(e){case"contained":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...m};case"light":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...m};case"shadow":return{boxShadow:p,backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{boxShadow:"none",backgroundColor:u,color:A},...m};case"outlined":return{backgroundColor:"transparent",borderColor:l,...h,...C};case"dashed":return{backgroundColor:a,borderColor:l,...h,...C,...m};case"text":default:return{color:l,...C,...m}}}const f4=ue(d4,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:i,loadingPosition:a})=>({"::after":{content:'""',display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:n==="rounded"?"50%":4,opacity:0,transition:"all 0.5s"},":active::after":{position:"absolute",borderRadius:n==="rounded"?"50%":4,left:0,top:0,opacity:1,transition:"0s"},...t==="text"&&{...XA({variant:t,theme:e,color:r,loadingPosition:a}),"&.MuiButton-sizeMedium":{height:36},"&.MuiButton-sizeSmall":{height:30},"&.MuiButton-sizeLarge":{height:44}},...n&&{minWidth:0,"&.MuiButton-sizeMedium":{width:36,height:36},"&.MuiButton-sizeSmall":{width:30,height:30},"&.MuiButton-sizeLarge":{width:44,height:44},...n==="rounded"&&{borderRadius:"50%"}},...t==="outlined"&&{border:"1px solid"},...t==="dashed"&&{border:"1px dashed"},...(t==="contained"||t==="shadow")&&!i&&{color:"#fff"},...t!=="text"&&{...XA({variant:t,theme:e,color:r,loadingPosition:a})},"&.Mui-disabled":{...t!=="text"&&{...XA({variant:t,theme:e,color:r,loadingPosition:a})}}})),ZA=S.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...i},a)=>{const l=xt();return g.jsx(f4,{ref:a,variant:e,shape:t,theme:l,loadingPosition:i.loadingPosition,loading:i.loading,color:r,...i,children:n})});ZA.propTypes={variant:c.string,shape:c.string,children:c.node,color:c.string},ZA.displayName="LoadingButton";function g4({color:e,theme:t,labelColor:n}){const r=$t(t,e),{main:i,contrastText:a}=r;let l=e||"";return["primary","secondary","info","success","warning","error"].includes(l)?{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:i,color:n||a},[`& .${b.tooltipClasses.arrow}`]:{color:i}}:{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:l,color:n||a,boxShadow:t.shadows[1]},[`& .${b.tooltipClasses.arrow}`]:{color:l}}}const p4=ue(({className:e,...t})=>g.jsx(b.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&g4({color:t,theme:e,labelColor:n})}));function pm({children:e,arrow:t,labelColor:n="",...r}){const i=xt();return g.jsx(b.Box,{display:"flex",children:g.jsx(p4,{arrow:t,...r,theme:i,labelColor:n,children:e})})}pm.propTypes={children:c.element,arrow:c.bool,labelColor:c.string,rest:c.array};const io=S.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...i},a)=>{let l={transformOrigin:"0 0 0"};switch(t){case"top-right":l={transformOrigin:"top right"};break;case"top":l={transformOrigin:"top"};break;case"bottom-left":l={transformOrigin:"bottom left"};break;case"bottom-right":l={transformOrigin:"bottom right"};break;case"bottom":l={transformOrigin:"bottom"};break;case"top-left":default:l={transformOrigin:"0 0 0"};break}return g.jsxs(b.Box,{ref:a,children:[n==="grow"&&g.jsx(b.Grow,{...i,timeout:{appear:0,enter:150,exit:150},children:g.jsx(b.Box,{sx:l,children:e})}),n==="collapse"&&g.jsx(b.Collapse,{...i,sx:l,children:e}),n==="fade"&&g.jsx(b.Fade,{...i,timeout:{appear:0,enter:300,exit:150},children:g.jsx(b.Box,{sx:l,children:e})}),n==="slide"&&g.jsx(b.Slide,{...i,timeout:{appear:0,enter:150,exit:150},direction:r,children:g.jsx(b.Box,{sx:l,children:e})}),n==="zoom"&&g.jsx(b.Zoom,{...i,children:g.jsx(b.Box,{sx:l,children:e})})]})});io.propTypes={children:c.node,type:c.oneOf(["grow","fade","collapse","slide","zoom"]),position:c.oneOf(["top-left","top-right","top","bottom-left","bottom-right","bottom"]),direction:c.oneOf(["up","down","left","right"])},S.forwardRef(function(t,n){return g.jsx(b.Zoom,{ref:n,timeout:200,...t})});function hm({value:e,...t}){return g.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[g.jsx(b.CircularProgress,{variant:"determinate",value:e,...t}),g.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(e)}%`})})]})}hm.propTypes={value:c.number};function Cm({value:e,size:t,variant:n,thickness:r,showLabel:i,pathColor:a,sx:l,...u}){return g.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[g.jsx(b.CircularProgress,{variant:"determinate",sx:{color:a||"grey.200"},size:t,thickness:r,...u,value:100}),i&&g.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:e?`${Math.round(e)}%`:"0%"})}),g.jsx(b.CircularProgress,{variant:n,sx:{...l,position:"absolute",left:0,[`& .${b.circularProgressClasses.circle}`]:{strokeLinecap:"round"}},size:t,thickness:r,value:e,...u})]})}Cm.propTypes={value:c.number,size:c.number,variant:c.string,thickness:c.number,showLabel:c.bool,pathColor:c.string,sx:c.array,others:c.array};function Em({icon:e,value:t,...n}){return g.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[g.jsx(b.Box,{sx:{width:"100%",mr:1},children:g.jsx(b.LinearProgress,{variant:"determinate",value:t,...n})}),g.jsx(b.Box,{sx:{minWidth:35},children:e})]})}Em.propTypes={icon:c.node,value:c.number};function mm({value:e,...t}){return g.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[g.jsx(b.Box,{sx:{width:"100%",mr:1},children:g.jsx(b.LinearProgress,{variant:"determinate",value:e,...t})}),g.jsx(b.Box,{sx:{minWidth:35},children:g.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:`${Math.round(e)}%`})})]})}mm.propTypes={value:c.number};const Im=S.createContext({});function h4(e){const{useDefaults:t=!1}=e,n=O.useResourceContext(),r=O.useDataProvider(),{search:i}=vr.useLocation(),a=`${n}/new`,l=S.useCallback(()=>{if(!t||!pt.isFunction(r.get))return Promise.resolve({});const p={};return new URLSearchParams(i??"").forEach((C,h)=>{p[h]=C}),r.get(a,p).then(C=>C.data).then(C=>{const{responseCode:h,value:m}=C;return h==="ok"?m:Promise.reject(C)})},[n,t,i,r]),{data:u,isLoading:A}=cu.useQuery({queryKey:[n,i],queryFn:l}),f=pt.omit(e,["useDefaults"]);return A?g.jsx(b.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:g.jsx(b.CircularProgress,{})}):g.jsx(Im.Provider,{value:u??{},children:g.jsx(O.Create,{...f})})}function C4(){return S.useContext(Im)}const E4=ue(h4,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"& .RaCreate-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaCreate-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),m4=ai(O.Toolbar,{name:"RaApplicaToolbar",slot:"Root"})(({theme:e})=>({...e.mixins.toolbar,backgroundColor:e.palette.background.paper,justifyContent:"flex-end","& .RaToolbar-defaultToolbar":{justifyContent:"right",paddingBottom:e.spacing(2),"& > *":{marginLeft:e.spacing(1)}},"& .MuiButtonBase-root":{marginLeft:e.spacing(1)}})),Dr=e=>g.jsx(m4,{...e});Dr.defaultProps={...O.Toolbar.defaultProps},Dr.propTypes={...O.Toolbar.propTypes};const qA=({children:e,content:t,title:n,subheader:r,secondary:i,toolbar:a,...l})=>{const u=O.useTranslate(),A=O.useResourceContext(),{cardTitle:f,cardSubheader:p}=S.useMemo(()=>{const C=n||`resources.${A}.title`;return{cardTitle:u(C,{_:C}),cardSubheader:r!==null?u(r,{_:r}):null}},[A,r,n,u]);return g.jsx(b.Grid,{item:!0,...l,children:g.jsx(Nn,{content:t,title:f,subheader:p,secondary:i,divider:!0,children:g.jsxs(S.Fragment,{children:[e,a===!0?g.jsx(Dr,{children:g.jsx(O.SaveButton,{})}):a]})})})};qA.defaultProps={...b.Grid.defaultProps,content:!0,subheader:null,title:null,secondary:null,toolbar:!1,item:!0,lg:12,md:12,sm:12,xs:12},qA.propTypes={...b.Grid.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),contained:c.bool,content:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object]),spacing:c.number,toolbar:c.oneOfType([c.node,c.bool])};const I4=ue(O.Form,{name:"RaApplicaCardForm",slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*2),padding:0}})),bl=({children:e,spacing:t,defaultValues:n,...r})=>{const{spacing:i}=Fn();return g.jsx(I4,{defaultValues:n,spacing:t||i,children:g.jsx(b.Grid,{container:!0,...r,spacing:t||i,children:e})})};bl.propTypes={...b.Grid.propTypes,...O.Form.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),spacing:c.number,defaultValues:c.oneOfType([c.object,c.func]),record:c.object,validate:c.func},bl.defaultProps={...b.Stack.defaultProps},bl.Section=qA;const B4=ai(O.SimpleForm,{name:"RaApplicaSimpleForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?2:1)}})),Ql=({title:e,modal:t,content:n,subheader:r,secondary:i,sx:a,...l})=>{const u=Ah(e),A=O.useRecordContext();return g.jsx(Nn,{content:n,title:u,subheader:r,secondary:A!=null&&A.id?i:null,sx:{...a,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!t,divider:!0,children:g.jsx(B4,{toolbar:g.jsx(Dr,{}),...l})})};Ql.defaultProps={modal:!1,content:!1,subheader:null,title:null,toolbar:g.jsx(Dr,{children:g.jsx(O.SaveButton,{type:"button"})}),secondary:g.jsx(fi,{children:g.jsx(O.DeleteWithConfirmButton,{})})},Ql.propTypes={...O.SimpleForm.propTypes,modal:c.bool,content:c.bool,contained:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object])};const xl=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:a,divider:l,...u})=>{const A=Ut.useTheme(),{getCurrentDialog:f}=xo(),{source:p,resource:C,isRequired:h}=u,{getFieldState:m,formState:I}=va.useFormContext(),{error:B}=m(p,I),v=f();return g.jsxs(b.Stack,{spacing:1,sx:{"& .MuiFormHelperText-root":{color:B?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&a!==!1&&g.jsx(b.InputLabel,{error:!!B,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:g.jsx(O.FieldTitle,{label:e,source:p,resource:v||C,isRequired:h})}),S.isValidElement(t)?S.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&g.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:!!B,children:r})]})};xl.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool},xl.defaultProps={display:"label",divider:!1};const y4=ue(O.ArrayInput,{name:"ApplicaArrayInput",slot:"root"})(({theme:e})=>({"& .MuiStack-root > label":{marginTop:e.spacing(2)},"& .MuiInputLabel-shrink":{paddingBottom:0},marginTop:"0 !important","& .RaSimpleFormIterator-line > .RaSimpleFormIterator-form":{paddingBottom:e.spacing(.5),"& > div":{width:"100%"}}})),v4=({label:e,addLabel:t,source:n,helperText:r,divider:i=!0,...a})=>g.jsx(xl,{label:e,addLabel:t,source:n,helperText:r,divider:i,children:g.jsx(y4,{source:n,label:!1,...a})}),$A=({canEdit:e,canDelete:t,canClone:n})=>!e&&!t&&!n?null:g.jsxs(fi,{children:[e&&g.jsx(O.EditButton,{}),t&&g.jsx(O.DeleteWithConfirmButton,{}),n&&g.jsx(O.CloneButton,{})]});$A.defaultProps={canEdit:!0,canDelete:!0,canClone:!1},$A.propTypes={canEdit:c.bool,canDelete:c.bool,canClone:c.bool};const Bm=ue("div",{name:"ApplicaBaseAttachmentField",overridesResolver:(e,t)=>t.root})({display:"inline-block"}),b4=ue("ul")({display:"inline-block"}),ym=e=>{var p;const{className:t,emptyText:n,source:r,title:i,...a}=e,l=be.useRecordContext(e),u=st.get(l,r),A=be.useTranslate();if(!u)return n?g.jsx(b.Typography,{component:"span",variant:"body2",className:t,...a,children:n&&A(n,{_:n})}):g.jsx(Bm,{className:t,...a});if(Array.isArray(u))return g.jsx(b4,{className:t,...a,children:u.map((C,h)=>{var I;const m=i instanceof String?(I=st.get(C,i))==null?void 0:I.toString():i;return g.jsx("li",{children:m},h)})});const f=i instanceof String?(p=st.get(l,i))==null?void 0:p.toString():i;return g.jsx(Bm,{className:t,...a,children:f})};ym.propTypes={className:c.string,emptyText:c.string,source:c.string.isRequired,src:c.string,title:c.oneOfType([c.string,c.element]),target:c.string,download:c.oneOfType([c.bool,c.string]),ping:c.string,rel:c.string};var vm={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(kn,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",l="second",u="minute",A="hour",f="day",p="week",C="month",h="quarter",m="year",I="date",B="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,M=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,j={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(q){var K=["th","st","nd","rd"],z=q%100;return"["+q+(K[(z-20)%10]||K[z]||K[0])+"]"}},x=function(q,K,z){var Z=String(q);return!Z||Z.length>=K?q:""+Array(K+1-Z.length).join(z)+q},T={s:x,z:function(q){var K=-q.utcOffset(),z=Math.abs(K),Z=Math.floor(z/60),F=z%60;return(K<=0?"+":"-")+x(Z,2,"0")+":"+x(F,2,"0")},m:function q(K,z){if(K.date()<z.date())return-q(z,K);var Z=12*(z.year()-K.year())+(z.month()-K.month()),F=K.clone().add(Z,C),te=z-F<0,W=K.clone().add(Z+(te?-1:1),C);return+(-(Z+(z-F)/(te?F-W:W-F))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:C,y:m,w:p,d:f,D:I,h:A,m:u,s:l,ms:a,Q:h}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},P="en",L={};L[P]=j;var k="$isDayjsObject",_=function(q){return q instanceof le||!(!q||!q[k])},J=function q(K,z,Z){var F;if(!K)return P;if(typeof K=="string"){var te=K.toLowerCase();L[te]&&(F=te),z&&(L[te]=z,F=te);var W=K.split("-");if(!F&&W.length>1)return q(W[0])}else{var X=K.name;L[X]=K,F=X}return!Z&&F&&(P=F),F||!Z&&P},Y=function(q,K){if(_(q))return q.clone();var z=typeof K=="object"?K:{};return z.date=q,z.args=arguments,new le(z)},ee=T;ee.l=J,ee.i=_,ee.w=function(q,K){return Y(q,{locale:K.$L,utc:K.$u,x:K.$x,$offset:K.$offset})};var le=function(){function q(z){this.$L=J(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[k]=!0}var K=q.prototype;return K.parse=function(z){this.$d=function(Z){var F=Z.date,te=Z.utc;if(F===null)return new Date(NaN);if(ee.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var W=F.match(v);if(W){var X=W[2]-1||0,de=(W[7]||"0").substring(0,3);return te?new Date(Date.UTC(W[1],X,W[3]||1,W[4]||0,W[5]||0,W[6]||0,de)):new Date(W[1],X,W[3]||1,W[4]||0,W[5]||0,W[6]||0,de)}}return new Date(F)}(z),this.init()},K.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},K.$utils=function(){return ee},K.isValid=function(){return this.$d.toString()!==B},K.isSame=function(z,Z){var F=Y(z);return this.startOf(Z)<=F&&F<=this.endOf(Z)},K.isAfter=function(z,Z){return Y(z)<this.startOf(Z)},K.isBefore=function(z,Z){return this.endOf(Z)<Y(z)},K.$g=function(z,Z,F){return ee.u(z)?this[Z]:this.set(F,z)},K.unix=function(){return Math.floor(this.valueOf()/1e3)},K.valueOf=function(){return this.$d.getTime()},K.startOf=function(z,Z){var F=this,te=!!ee.u(Z)||Z,W=ee.p(z),X=function(he,me){var xe=ee.w(F.$u?Date.UTC(F.$y,me,he):new Date(F.$y,me,he),F);return te?xe:xe.endOf(f)},de=function(he,me){return ee.w(F.toDate()[he].apply(F.toDate("s"),(te?[0,0,0,0]:[23,59,59,999]).slice(me)),F)},ge=this.$W,ce=this.$M,Ae=this.$D,pe="set"+(this.$u?"UTC":"");switch(W){case m:return te?X(1,0):X(31,11);case C:return te?X(1,ce):X(0,ce+1);case p:var Ie=this.$locale().weekStart||0,Ee=(ge<Ie?ge+7:ge)-Ie;return X(te?Ae-Ee:Ae+(6-Ee),ce);case f:case I:return de(pe+"Hours",0);case A:return de(pe+"Minutes",1);case u:return de(pe+"Seconds",2);case l:return de(pe+"Milliseconds",3);default:return this.clone()}},K.endOf=function(z){return this.startOf(z,!1)},K.$set=function(z,Z){var F,te=ee.p(z),W="set"+(this.$u?"UTC":""),X=(F={},F[f]=W+"Date",F[I]=W+"Date",F[C]=W+"Month",F[m]=W+"FullYear",F[A]=W+"Hours",F[u]=W+"Minutes",F[l]=W+"Seconds",F[a]=W+"Milliseconds",F)[te],de=te===f?this.$D+(Z-this.$W):Z;if(te===C||te===m){var ge=this.clone().set(I,1);ge.$d[X](de),ge.init(),this.$d=ge.set(I,Math.min(this.$D,ge.daysInMonth())).$d}else X&&this.$d[X](de);return this.init(),this},K.set=function(z,Z){return this.clone().$set(z,Z)},K.get=function(z){return this[ee.p(z)]()},K.add=function(z,Z){var F,te=this;z=Number(z);var W=ee.p(Z),X=function(ce){var Ae=Y(te);return ee.w(Ae.date(Ae.date()+Math.round(ce*z)),te)};if(W===C)return this.set(C,this.$M+z);if(W===m)return this.set(m,this.$y+z);if(W===f)return X(1);if(W===p)return X(7);var de=(F={},F[u]=r,F[A]=i,F[l]=n,F)[W]||1,ge=this.$d.getTime()+z*de;return ee.w(ge,this)},K.subtract=function(z,Z){return this.add(-1*z,Z)},K.format=function(z){var Z=this,F=this.$locale();if(!this.isValid())return F.invalidDate||B;var te=z||"YYYY-MM-DDTHH:mm:ssZ",W=ee.z(this),X=this.$H,de=this.$m,ge=this.$M,ce=F.weekdays,Ae=F.months,pe=F.meridiem,Ie=function(me,xe,ae,ze){return me&&(me[xe]||me(Z,te))||ae[xe].slice(0,ze)},Ee=function(me){return ee.s(X%12||12,me,"0")},he=pe||function(me,xe,ae){var ze=me<12?"AM":"PM";return ae?ze.toLowerCase():ze};return te.replace(M,function(me,xe){return xe||function(ae){switch(ae){case"YY":return String(Z.$y).slice(-2);case"YYYY":return ee.s(Z.$y,4,"0");case"M":return ge+1;case"MM":return ee.s(ge+1,2,"0");case"MMM":return Ie(F.monthsShort,ge,Ae,3);case"MMMM":return Ie(Ae,ge);case"D":return Z.$D;case"DD":return ee.s(Z.$D,2,"0");case"d":return String(Z.$W);case"dd":return Ie(F.weekdaysMin,Z.$W,ce,2);case"ddd":return Ie(F.weekdaysShort,Z.$W,ce,3);case"dddd":return ce[Z.$W];case"H":return String(X);case"HH":return ee.s(X,2,"0");case"h":return Ee(1);case"hh":return Ee(2);case"a":return he(X,de,!0);case"A":return he(X,de,!1);case"m":return String(de);case"mm":return ee.s(de,2,"0");case"s":return String(Z.$s);case"ss":return ee.s(Z.$s,2,"0");case"SSS":return ee.s(Z.$ms,3,"0");case"Z":return W}return null}(me)||W.replace(":","")})},K.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},K.diff=function(z,Z,F){var te,W=this,X=ee.p(Z),de=Y(z),ge=(de.utcOffset()-this.utcOffset())*r,ce=this-de,Ae=function(){return ee.m(W,de)};switch(X){case m:te=Ae()/12;break;case C:te=Ae();break;case h:te=Ae()/3;break;case p:te=(ce-ge)/6048e5;break;case f:te=(ce-ge)/864e5;break;case A:te=ce/i;break;case u:te=ce/r;break;case l:te=ce/n;break;default:te=ce}return F?te:ee.a(te)},K.daysInMonth=function(){return this.endOf(C).$D},K.$locale=function(){return L[this.$L]},K.locale=function(z,Z){if(!z)return this.$L;var F=this.clone(),te=J(z,Z,!0);return te&&(F.$L=te),F},K.clone=function(){return ee.w(this.$d,this)},K.toDate=function(){return new Date(this.valueOf())},K.toJSON=function(){return this.isValid()?this.toISOString():null},K.toISOString=function(){return this.$d.toISOString()},K.toString=function(){return this.$d.toUTCString()},q}(),se=le.prototype;return Y.prototype=se,[["$ms",a],["$s",l],["$m",u],["$H",A],["$W",f],["$M",C],["$y",m],["$D",I]].forEach(function(q){se[q[1]]=function(K){return this.$g(K,q[0],q[1])}}),Y.extend=function(q,K){return q.$i||(q(K,le,Y),q.$i=!0),Y},Y.locale=J,Y.isDayjs=_,Y.unix=function(q){return Y(1e3*q)},Y.en=L[P],Y.Ls=L,Y.p={},Y})})(vm);var Q4=vm.exports;const Rr=ti(Q4),ed=({entityId:e,property:t,disabled:n,userResource:r="entities/user",...i})=>{const[a,l]=S.useState(null),u=O.useRecordContext(i),A=O.useDataProvider(),f=O.useResourceContext(),p=S.useCallback(async m=>{m.preventDefault(),m.stopPropagation();const I=st.get(u,i==null?void 0:i.source),B=f.replace("entities/",""),v=await A.getFile(`/attachments/${B}/${e||(u==null?void 0:u.id)}/${t||(i==null?void 0:i.source)}/${(I==null?void 0:I.id)||(u==null?void 0:u.id)}`),M=document.createElement("a");M.href=v,M.download=st.get(u,(i==null?void 0:i.title)||(i==null?void 0:i.source)),M.click()},[A,u,e,f,t,i==null?void 0:i.source,i==null?void 0:i.title]),C=S.useMemo(()=>({...u,[i==null?void 0:i.source]:(u==null?void 0:u.src)||st.get(u,i==null?void 0:i.source),[i==null?void 0:i.title]:(u==null?void 0:u.title)||st.get(u,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),[u,i==null?void 0:i.source,i==null?void 0:i.title]),h=O.useTranslate();return S.useEffect(()=>{!u||!(u!=null&&u.userId)||A.getOne(r,{id:u==null?void 0:u.userId}).then(({data:m})=>l(m)).catch(()=>l(null))},[u,A,r]),g.jsx(ym,{...i,disabled:n,record:C,onClick:p,title:g.jsxs(b.Box,{sx:{cursor:"pointer"},children:[g.jsx(b.Typography,{variant:"subtitle1",children:st.get(C,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),g.jsxs(b.Typography,{variant:"caption",color:"secondary",children:[st.get(C,"sizeDescription"),a&&" | ",a&&h("ra.attachment.info",{user:a==null?void 0:a.name,created:Rr(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})};ed.propTypes={...O.FileField.propTypes,source:c.string,title:c.string,disabled:c.bool};const x4=ue(O.ImageField,{name:"RaApplicaImageField",slot:"root"})(()=>({})),Ds=e=>{const t=`_${e==null?void 0:e.source}`;return g.jsx(x4,{...e,source:t})};Ds.propTypes={...O.ImageField.propTypes,source:c.string};const wl=({width:e,height:t,circle:n,justify:r,record:i,...a})=>{const l=S.useMemo(()=>({width:typeof e=="number"?`${e}px !important`:`${e} !important`,height:typeof t=="number"?`${t}px !important`:`${t} !important`,borderRadius:n?"50%":1.5}),[e,t,n]),u=O.useRecordContext(),A=i||u;return g.jsx(Ds,{sx:f=>({margin:0,display:"flex",justifyContent:r,"& img":{margin:"0px !important",border:`1px solid ${f.palette.divider}`,objectFit:"cover !important",...l,minWidth:l.width,minHeight:l.height}}),...a,record:A})};wl.defaultProps={...Ds.defaultProps,width:150,height:150,circle:!1,justify:"flex-start"},wl.propTypes={...Ds.propTypes,width:c.oneOfType([c.number,c.string]),height:c.oneOfType([c.number,c.string]),circle:c.bool,justify:c.oneOf(["flex-start","center","flex-end"])};var bm={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(kn,function(){return function(n,r,i){n=n||{};var a=r.prototype,l={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(f,p,C,h){return a.fromToBase(f,p,C,h)}i.en.relativeTime=l,a.fromToBase=function(f,p,C,h,m){for(var I,B,v,M=C.$locale().relativeTime||l,j=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=j.length,T=0;T<x;T+=1){var P=j[T];P.d&&(I=h?i(f).diff(C,P.d,!0):C.diff(f,P.d,!0));var L=(n.rounding||Math.round)(Math.abs(I));if(v=I>0,L<=P.r||!P.r){L<=1&&T>0&&(P=j[T-1]);var k=M[P.l];m&&(L=m(""+L)),B=typeof k=="string"?k.replace("%d",L):k(L,p,P.l,v);break}}if(p)return B;var _=v?M.future:M.past;return typeof _=="function"?_(B):_.replace("%s",B)},a.to=function(f,p){return u(f,p,this,!0)},a.from=function(f,p){return u(f,p,this)};var A=function(f){return f.$u?i.utc():i()};a.toNow=function(f){return this.to(A(this),f)},a.fromNow=function(f){return this.from(A(this),f)}}})})(bm);var w4=bm.exports;const T4=ti(w4);Rr.extend(T4);const Tl=e=>{const t=O.useRecordContext(e),[n]=O.useLocaleState(),r=S.useMemo(()=>Rr(st.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return g.jsxs(S.Fragment,{children:[g.jsx(O.DateField,{record:t,source:e.source,showTime:!0}),g.jsx("br",{}),g.jsx(b.Typography,{variant:"caption",color:"textSecondary",children:r})]})};Tl.displayName="DateAgoField",Tl.propTypes={source:c.string.isRequired};const Qm=ue(O.DateField,{name:"RaApplicaDateField",slot:"Root"})(()=>({}));Qm.propTypes={...O.DateField.propTypes};const td=e=>g.jsx(Qm,{...e});td.defaultProps={...O.DateField.defaultProps,variant:"body1"},td.propTypes={...O.DateField.propTypes};const xm=ue(O.EmailField,{name:"RaApplicaEmailField",slot:"Root"})(()=>({}));xm.propTypes={...O.EmailField.propTypes};const nd=e=>g.jsx(xm,{...e});nd.defaultProps={...O.EmailField.defaultProps,variant:"body1"},nd.propTypes={...O.EmailField.propTypes};const P4=ue(O.FileField,{name:"RaApplicaFileField",slot:"root"})(()=>({})),rd=({...e})=>{const t=O.useRecordContext(e),n=S.useCallback(r=>{r.preventDefault(),r.stopPropagation();const i=st.get(t,`_${e==null?void 0:e.source}`,st.get(t,e==null?void 0:e.source)),a=st.get(t,(e==null?void 0:e.title)||(e==null?void 0:e.source))||(e==null?void 0:e.title),l=document.createElement("a");l.href=i,l.download=a,l.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return g.jsx(P4,{...e,record:t,onClick:n})};rd.propTypes={...O.FileField.propTypes,source:c.string,title:c.string};const wm=e=>g.jsx(O.FunctionField,{...e});wm.defaultProps={variant:"body1"};const S4=ue("div")(({theme:e})=>({borderBottom:`1px solid ${e.palette.divider}`,paddingTop:e.spacing(1),paddingBottom:e.spacing(1),marginBottom:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",[e.breakpoints.down("sm")]:{whiteSpace:"normal",overflow:"visible",textOverflow:"inherit"}})),od=({source:e,defaultValue:t,...n})=>{const r=O.useRecordContext(n),i=st.get(r,e,t);return g.jsx("span",{dangerouslySetInnerHTML:{__html:i&&i!==null?i:t}})};od.propTypes={defaultValue:c.any,source:c.string,record:c.object},od.defaultProps={defaultValue:"&nbsp;"};const Tm=({title:e,children:t})=>e&&e!==!1?g.jsx(b.Tooltip,{title:e,placement:"top",children:t}):t;Tm.propTypes={title:c.oneOfType([c.string,c.bool]),children:c.oneOfType([c.element,c.arrayOf(c.element)])};const id=({label:e,source:t,defaultValue:n,children:r,tooltip:i,...a})=>{const{getCurrentDialog:l}=xo(),u=O.useRecordContext(a),A=O.useResourceContext(a),f=l(),p=S.useMemo(()=>!i||i===!1?!1:typeof i=="function"?i(u):typeof i=="string"?st.get(u,i,i):i,[u,i]);return g.jsx(Tm,{title:p,children:g.jsxs(S.Fragment,{children:[g.jsx(b.InputLabel,{children:g.jsx(O.FieldTitle,{label:e,source:t,resource:f||A})}),g.jsx(S4,{...a,children:S.cloneElement(r,{source:t,record:u,defaultValue:n,resource:f||A})})]})})};id.propTypes={defaultValue:c.any,tooltip:c.oneOfType([c.string,c.bool,c.func]),source:c.string,label:c.string,name:c.string,children:c.element},id.defaultProps={defaultValue:"&nbsp;",children:g.jsx(od,{})};const O4=ai("div",{name:"RaApplicaReferenceManyField",slot:"root"})(({theme:e,margin:t,border:n})=>({marginLeft:t?0:`-${e.spacing(2.5)}`,marginRight:t?0:`-${e.spacing(2.5)}`,borderBottom:n?`1px solid ${e.palette.divider}`:"none","& form":{padding:e.spacing(2)},"& .MuiCardContent-root":{borderTop:n?`1px solid ${e.palette.divider}`:"none"},"& .MuiToolbar-root":{[e.breakpoints.up("sm")]:{marginTop:`-${e.spacing(2)}`,marginBottom:e.spacing(t?0:1),marginLeft:e.spacing(t?1:2),marginRight:e.spacing(t?1:2),width:t?"auto":`calc(100% - ${e.spacing(5)})`},[e.breakpoints.down("md")]:{marginTop:0}},"& .RaDatagrid-root":{overflowX:"auto",paddingTop:48,[e.breakpoints.down("sm")]:{width:"calc(100vw - 34px)"}},"& .RaDatagrid-table":{borderBottom:`1px solid ${e.palette.divider}`},"& .MuiTablePagination-toolbar":{marginTop:e.spacing(1),marginBottom:0},"& .RaBulkActionsToolbar-collapsed.RaBulkActionsToolbar-toolbar":{minHeight:0},"& .RaBulkActionsToolbar-toolbar":{minHeight:48,bottom:-56,"& h6":{marginTop:e.spacing(.5)},"& .RaBulkActionsToolbar-topToolbar":{marginTop:e.spacing(1)},[e.breakpoints.down("sm")]:{bottom:-48,borderRadius:0}}})),Qi=e=>g.jsx(O4,{children:g.jsx(O.ReferenceManyField,{pagination:g.jsx(O.Pagination,{}),...e})});Qi.defaultProps={...O.ReferenceManyField.defaultProps,margin:!1,border:!1},Qi.propTypes={...O.ReferenceManyField.propTypes,margin:c.bool,border:c.bool};const Pm=({source:e,...t})=>{const n=O.useRecordContext(t),r=st.get(n,e,0),i=r/1024,a=i/1024,l=a/1024,u=l>1?`${l.toFixed(2)} GB`:a>1?`${a.toFixed(2)} MB`:i>1?`${i.toFixed(2)} KB`:`${r.toFixed(2)} B`;return g.jsx(b.Typography,{component:"span",variant:"body1",...t,children:u})};Pm.propTypes={record:c.object,source:c.string};const Sm=ue(O.TextField,{name:"RaApplicaTextField",slot:"Root"})(()=>({}));Sm.propTypes={...O.TextField.propTypes};const sd=e=>g.jsx(Sm,{...e});sd.defaultProps={...O.TextField.defaultProps,variant:"body1"},sd.propTypes={...O.TextField.propTypes};const at=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:a,divider:l,...u})=>{const A=Ut.useTheme(),{getCurrentDialog:f}=xo(),{source:p,resource:C,isRequired:h}=u,{fieldState:{invalid:m}}=O.useInput(u),I=f();return g.jsxs(b.Stack,{spacing:1,sx:{width:u!=null&&u.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:m?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&a!==!1&&g.jsx(b.InputLabel,{error:m===!0,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:g.jsx(O.FieldTitle,{label:e,source:p,resource:I||C,isRequired:h})}),S.isValidElement(t)?S.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&g.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:m===!0,children:r})]})};at.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool},at.defaultProps={display:"label",divider:!1};const M4=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},D4=ue(O.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({disabled:e,theme:t})=>({"& .previews":{},"& .previews>div":{marginTop:t.spacing(1),padding:t.spacing(1.5),border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:t.palette.action.hover},"& .MuiLink-root":{fontSize:t.typography.body1.fontSize}},...M4(e)})),ad=({children:e,disabled:t,type:n,...r})=>{const i=O.useRecordContext(r),a=r==null?void 0:r.source,l=i==null?void 0:i.id;return O.useInput({source:`__${n}__${r==null?void 0:r.source}`,defaultValue:r==null?void 0:r.source}),g.jsx(at,{...r,children:g.jsx(D4,{disabled:t,children:S.cloneElement(e,{...e.props,entityId:l,property:a})})})};ad.propTypes={...O.FileInput.propTypes,children:c.node,multiple:c.bool,disabled:c.bool},ad.defaultProps={children:g.jsx(ed,{title:"name",source:"path"}),multiple:!0,disabled:!1,type:"attachment"};const R4=ue(O.AutocompleteArrayInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"}})),ld=({...e})=>g.jsx(at,{...e,children:g.jsx(R4,{})});ld.propTypes={...O.AutocompleteArrayInput.propTypes,...at.propTypes},ld.defaultProps={...O.AutocompleteArrayInput.defaultProps,size:"small"};const j4=ue(O.AutocompleteInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},"& .MuiOutlinedInput-root.MuiInputBase-sizeSmall":{paddingTop:"4px"}})),cd=e=>{const{perPage:t,...n}=e;return g.jsx(at,{...n,children:g.jsx(j4,{})})};cd.propTypes={...O.AutocompleteInput.propTypes,...at.propTypes},cd.defaultProps={...O.AutocompleteInput.defaultProps,size:"small"};const k4=ue(O.BooleanInput,{name:"RaApplicaBooleanInput",slot:"Root"})(()=>({})),ud=({horizontal:e,...t})=>{const n=xt();return g.jsx(at,{...t,sx:e?{flexDirection:e?"row":"column",alignItems:e?"center":"flex-start","& .MuiFormGroup-root":{margin:0},"& .MuiFormControlLabel-root":{margin:0,"& .MuiTypography-root":{display:"none",visibility:"hidden"},"& .MuiSwitch-root":{marginRight:`-${n.spacing(.5)}`}}}:{},children:g.jsx(k4,{})})};ud.defaultProps={...O.BooleanInput.defaultProps,...at.defaultProps},ud.propTypes={...O.BooleanInput.propTypes,...at.propTypes,horizontal:c.bool};const F4=ue(O.DateInput,{name:"RaApplicaDateInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Ad=e=>g.jsx(at,{...e,children:g.jsx(F4,{})});Ad.propTypes={...O.DateInput.propTypes,...at.propTypes},Ad.defaultProps={...O.DateInput.defaultProps,...at.defaultProps};const L4=ue(O.DateTimeInput,{name:"RaApplicaDateTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),dd=e=>g.jsx(at,{...e,children:g.jsx(L4,{})});dd.propTypes={...O.DateTimeInput.propTypes,...at.propTypes},dd.defaultProps={...at.defaultProps};const N4=ue(O.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({theme:e})=>({"& .previews":{},"& .previews>div":{marginTop:e.spacing(1),padding:e.spacing(1.5),border:`1px solid ${e.palette.divider}`,borderRadius:e.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:e.palette.action.hover},"& .MuiLink-root":{fontSize:e.typography.body1.fontSize}}})),fd=({children:e,title:t,...n})=>{const r=va.useWatch({name:n.source}),i=O.useRecordContext(n),{source:a}=n,l=S.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const u=st.get(i,a);if(u){const A=u.split("__");return A.length>0?A[A.length-1]:u}return u},[i,a,r]);return g.jsx(at,{...n,children:g.jsx(N4,{children:S.cloneElement(e,{...e.props,title:t||a,source:a,record:{...i,[a]:(r==null?void 0:r.title)||st.get(i,a),[`_${a}`]:(r==null?void 0:r.src)||st.get(i,`_${a}`),[t||a]:l}})})})};fd.propTypes={...O.FileInput.propTypes,source:c.string,title:c.string,children:c.node},fd.defaultProps={children:g.jsx(rd,{})};const gd=({children:e,title:t,...n})=>{const r=va.useWatch({name:n.source}),i=O.useRecordContext(n),{source:a}=n;return O.useInput({source:`__image__${n==null?void 0:n.source}`,defaultValue:n==null?void 0:n.source}),g.jsx(at,{...n,children:g.jsx(O.ImageInput,{accept:"image/*",children:S.cloneElement(e,{...e.props,title:t,source:a,record:{...i,[a]:(r==null?void 0:r.title)||st.get(i,a),[`_${a}`]:(r==null?void 0:r.src)||st.get(i,`_${a}`)}})})})};gd.defaultProps={children:g.jsx(wl,{}),multiple:!1},gd.propTypes={...O.ImageInput.propTypes,source:c.string,title:c.string,children:c.node,multiple:c.bool};const V4=ue(O.NumberInput,{name:"RaApplicaNumberInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),pd=e=>g.jsx(at,{...e,children:g.jsx(V4,{})});pd.propTypes={...O.NumberInput.propTypes,...at.propTypes},pd.defaultProps={...O.NumberInput.defaultProps,...at.defaultProps};const Om=({source:e,minWidth:t=300,children:n})=>{const r=O.useResourceContext(),i=O.useRecordContext(),[a,l]=S.useState(st.get(i,e,"")),[u,A]=S.useState(!1),f=S.useCallback(I=>l(I.target.value),[]),p=O.useDataProvider(),C=S.useCallback(I=>{I.key==="Enter"&&(A(!0),p.update(r,{id:i.id,data:{...i,[e]:a,_changed:e}}).then(()=>A(!1)))},[a,p,r,i,e]),h=S.useCallback(()=>{st.get(i,e)!==a&&(A(!0),p.update(r,{id:i.id,data:{...i,[e]:a,_changed:e}}).then(()=>A(!1)))},[a,p,r,e,i]),m=S.useCallback(I=>{A(!0),p.update(r,{id:i.id,data:{...i,[e]:I,_changed:e}}).then(()=>A(!1))},[p,r,e,i]);return S.useEffect(()=>l(st.get(i,e)),[i,e]),n?S.cloneElement(n,{...n.props,source:e,value:a,onChange:m}):g.jsx(b.TextField,{value:a,disabled:u,onChange:f,onKeyPress:C,onBlur:h,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})};Om.propTypes={source:c.string.isRequired,minWidth:c.number,children:c.element};const hd=({children:e,...t})=>g.jsx(O.ReferenceArrayInput,{...t,children:S.cloneElement(e,{...t,source:e.props.source||t.source})});hd.propTypes={...O.ReferenceArrayInput.propTypes,children:c.element},hd.defaultProps={...O.ReferenceArrayInput.defaultProps};const Cd=({children:e,...t})=>g.jsx(O.ReferenceInput,{...t,children:S.cloneElement(e,{...t,source:e.props.source||t.source})});Cd.propTypes={...O.ReferenceInput.propTypes,children:c.element},Cd.defaultProps={...O.ReferenceInput.defaultProps};const Ed=({reference:e,target:t,children:n,filters:r,actions:i,...a})=>g.jsx(O.ResourceContextProvider,{value:e,children:g.jsx(Qi,{perPage:5,pagination:g.jsx(O.Pagination,{}),...a,reference:e,target:t,children:g.jsxs(S.Fragment,{children:[g.jsx(O.ListToolbar,{filters:r,actions:i}),n]})})});Ed.propTypes={...Qi.propTypes,children:c.node.isRequired,reference:c.string.isRequired,target:c.string.isRequired,filters:c.oneOfType([c.element,c.func,c.element,c.arrayOf(c.node)]),actions:c.oneOfType([c.element,c.func,c.element])},Ed.defaultProps={...Qi.defaultProps};const H4=ue(O.SearchInput,{name:"RaApplicaSearchInput",slot:"root"})(()=>({})),z4=e=>g.jsx(H4,{...e}),Mm=ue(O.SelectArrayInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .RaSelectArrayInput-chips > .RaSelectArrayInput-chip":{marginTop:"-2px",marginBottom:"-2px"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}}));Mm.propTypes={...O.SelectArrayInput.propTypes};const md=e=>g.jsx(at,{...e,children:g.jsx(Mm,{options:{autoWidth:!1}})});md.defaultProps={optionText:"name",optionValue:"id"},md.propTypes={...O.SelectArrayInput.propTypes,...at.propTypes};const W4=ue(O.SelectInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}})),Dm=e=>g.jsx(at,{...e,children:g.jsx(W4,{})});Dm.propTypes={...O.SelectInput.propTypes,...at.propTypes};const Hn=e=>g.jsx(at,{...e,children:g.jsx(O.TextInput,{})});Hn.propTypes={...O.TextInput.propTypes,...at.propTypes};const Pl=({...e})=>{var u,A;const t=O.useTranslate(),n=O.maxLength(e==null?void 0:e.maxLength,"app.input.max_length_error"),r=(A=(u=va.useController({name:e==null?void 0:e.source}))==null?void 0:u.field)==null?void 0:A.value;let i=e.helperText,a=e.validate;a?Array.isArray(a)&&a.indexOf(n)===-1&&a.push(n):a=[n];const l=t("app.input.max_length_info",{count:(r==null?void 0:r.length)||0,max:e==null?void 0:e.maxLength});return e!=null&&e.maxLength&&(i=i&&i.length>0?`${l} - ${t(i)}`:l),g.jsx(Hn,{...e,validate:a,helperText:i,inputProps:{maxLength:e==null?void 0:e.maxLength}})};Pl.displayName="SmartTextInput",Pl.defaultProps={multiline:!1},Pl.propTypes={...Hn.propTypes,maxLength:c.number,multiline:c.bool,rows:c.number};const Rm=e=>{const t=e.split(":");t.length===1&&t.push("00");const n=parseInt(t[0]),r=parseInt(t[1]);return Rr().hour(n).minute(r)};function U4(){let e=new Date().getTime();return window.performance&&typeof window.performance.now=="function"&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)})}const Y4=e=>{if(!e)return"";const t=Rm(e);return t?t.format("HH:mm"):""},G4=e=>e,K4=ue(O.TimeInput,{name:"RaApplicaTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Id=e=>g.jsx(at,{...e,children:g.jsx(K4,{})});Id.defaultProps={...O.TimeInput.defaultProps,format:Y4,parse:G4},Id.propTypes={...O.TimeInput.propTypes,...at.propTypes};const Bd=({onSuccess:e,firstAccess:t})=>{const{spacing:n}=Fn(),[r,i]=S.useState(!1),a=be.useAuthProvider(),l=be.useTranslate(),u=be.useNotify(),A=S.useCallback(f=>{const{oldPassword:p,newPassword:C}=f;i(!0),a==null||a.changePassword(p,C).then(()=>{u("ra.auth.password_changed"),e()}).catch(h=>u(h,{type:"error"})).finally(()=>i(!1))},[a,e]);return g.jsx(be.ResourceContextProvider,{value:"user/change-password",children:g.jsx(be.EditContextProvider,{value:{record:{},resource:"user/change-password",save:A},children:g.jsx(Ql,{onSubmit:A,toolbar:g.jsx(Dr,{children:g.jsx(O.SaveButton,{disabled:r})}),children:g.jsxs(b.Grid,{container:!0,spacing:n,children:[t===!0&&g.jsx(b.Grid,{item:!0,xs:12,children:g.jsxs(b.Alert,{severity:"warning",children:[g.jsx(b.AlertTitle,{children:l("ra.auth.first_access.change_password")}),l("ra.auth.first_access.change_password_helper")]})}),g.jsx(b.Grid,{item:!0,xs:12,children:g.jsx(Hn,{source:"oldPassword",type:"password",validate:be.required()})}),g.jsx(b.Grid,{item:!0,xs:12,children:g.jsx(Hn,{source:"newPassword",type:"password",validate:be.required()})})]})})})})},_4=ue(O.Edit,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaEdit-card":{[e.breakpoints.down("sm")]:{marginBottom:e.spacing(6)}},"& .RaEdi-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaToolbar-mobileToolbar":{borderTop:`1px solid ${e.palette.divider}`},"& .RaEdit-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),J4=ue(b.CardHeader)(({theme:e})=>({marginTop:e.spacing(4),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),X4=ue(b.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`})),yd=({title:e,divider:t,variant:n})=>{const r=O.useTranslate();return g.jsxs(S.Fragment,{children:[g.jsx(J4,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&g.jsx(X4,{})]})};yd.propTypes={title:c.string.isRequired,divider:c.bool,variant:c.oneOf(["h1","h2","h3","h4","h5","h6"])},yd.defaultProps={divider:!0,variant:"h4"};const Sl=c.shape({xl:c.number,lg:c.number,md:c.number,sm:c.number,xs:c.number}),Z4=ue("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Ol=({children:e,visibility:t})=>b.useMediaQuery(r=>r.breakpoints.up(t))?g.jsx(Z4,{children:e}):null;Ol.propTypes={visibility:c.oneOf(["xl","lg","md","sm","xs"]),position:c.oneOf(["top","bottom"]).isRequired,children:c.node.isRequired},Ol.defaultProps={position:"top",visibility:"md"};const q4={display:"none"},Ml=({intent:e,hidden:t,unmountOnExit:n,label:r,icon:i,value:a,syncWithLocation:l,selected:u,onChange:A,children:f,badgeColor:p,badgeContent:C,...h})=>{const m=O.useTranslate(),I=vr.useLocation(),B={component:gt.Link,to:{...I,pathname:a}},v=S.isValidElement(r)?r:m(r,{_:r}),M=S.useCallback(()=>A(a),[A,a]);return e==="header"?(()=>g.jsxs(b.ListItemButton,{selected:u,...l?B:{},onClick:M,children:[i&&g.jsx(b.ListItemIcon,{children:i}),g.jsx(b.ListItemText,{primary:v}),C&&g.jsx(b.ListItemSecondaryAction,{children:g.jsx(b.Avatar,{sx:{width:24,height:24,fontSize:12,backgroundColor:T=>{var P;return(P=T.palette[p])==null?void 0:P.main},color:T=>{var P;return(P=T.palette[p])==null?void 0:P.contrastText}},children:C})})]}))():(()=>n&&t?null:g.jsx(O.FormGroupContextProvider,{name:a.toString(),children:g.jsx(b.Stack,{alignContent:"stretch",style:t?q4:{},id:`tabpanel-${a}`,"aria-labelledby":`tabheader-${a}`,"aria-hidden":t||void 0,...h,children:f})}))()};Ml.propTypes={intent:c.oneOf(["header","content","sidebar"]),className:c.string,contentClassName:c.string,url:c.string,icon:c.element,label:c.oneOfType([c.string,c.element]).isRequired,value:c.oneOfType([c.string,c.number]),syncWithLocation:c.bool,onChange:c.func,selected:c.bool,hidden:c.bool,unmountOnExit:c.bool,children:c.node,badgeColor:c.oneOf(["default","error","info","primary","secondary","success","warning"]),badgeContent:c.oneOfType([c.string,c.number])},Ml.defaultProps={badgeColor:"default",unmountOnExit:!1};const $4=ai(b.List,{name:"RaLongFormTabs",slot:"Root"})(({theme:e})=>({p:0,"& .MuiListItemIcon-root":{minWidth:32,color:e.palette.grey[500]},"& .MuiListItemButton-root.Mui-selected":{borderRight:`2px solid ${e.palette.primary.main}`,marginRight:"-2px"}})),jm=({children:e,syncWithLocation:t,value:n,url:r,onChange:i})=>{const a=vr.useLocation();return g.jsx(Nn,{children:g.jsx($4,{component:"nav",children:S.Children.map(e,(l,u)=>{if(!S.isValidElement(l))return null;const A=e3(l,u),f=t?!!vr.matchPath(`${r}/${A}`,a.pathname):u===n;return S.cloneElement(l,{intent:"header",value:t?A:u,syncWithLocation:t,onChange:i,url:r,selected:f})})})})},e3=(e,t)=>e.props.path!=null?e.props.path:t>0?t.toString():"";jm.propTypes={children:c.node,url:c.string,tabsWithErrors:c.arrayOf(c.string),syncWithLocation:c.bool,onChange:c.func,value:c.oneOfType([c.string,c.number])};var t3=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},km=e=>e.firstChild?e.firstChild.offsetParent===e:!0,n3=(e,t)=>{let n=e,r=0;km(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},r3=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},Rs=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?Rs="sticky":CSS.supports("position","-webkit-sticky")&&(Rs="-webkit-sticky"));var Dl=!1;try{const e=Object.defineProperty({},"passive",{get(){Dl={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var vd=e=>{const{el:t,onChange:n,unsubs:r,measure:i}=e;if(t===window){const a=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),l=i(a()),u=()=>{Object.assign(l,i(a())),n()};return window.addEventListener("resize",u,Dl),r.push(()=>window.removeEventListener("resize",u)),l}else{const a=i(t.getBoundingClientRect()),l=()=>{Object.assign(a,i(t.getBoundingClientRect())),n()},u=new ResizeObserver(l);return u.observe(t),r.push(()=>u.disconnect()),a}},o3=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}},i3=(e,t,n)=>{const{bottom:r,offsetBottom:i,offsetTop:a}=n,l=t3(e);let u=!1;const A=()=>{u||requestAnimationFrame(()=>{const k=C();k!==x&&T(k),u=!1}),u=!0};let f=l===window?window.scrollY:l.scrollTop;const p=k=>{const{offsetTop:_,height:J}=m,{naturalTop:Y}=v,{height:ee}=M;return k+_+J>=Y+ee+j+i},C=()=>{const{height:k}=m,{height:_}=M;return _+a+i<=k?3:p(f)?1:2},h=l!==window&&km(l),m=vd({el:l,onChange:A,unsubs:t,measure:({height:k,top:_})=>({height:k,offsetTop:h?_:0})}),I=r3(e),B=I===window?{top:0,bottom:0}:o3(I),v=vd({el:I,onChange:A,unsubs:t,measure:({height:k})=>({height:k-B.top-B.bottom,naturalTop:I===window?0:n3(I,l)+B.top+m.offsetTop})}),M=vd({el:e,onChange:A,unsubs:t,measure:({height:k})=>({height:k})});let j=0,x=C();const T=k=>{const _=x;if(x=k,_===2&&(j=-1),k===3){e.style.position=Rs,r?e.style.bottom=`${i}px`:e.style.top=`${a}px`;return}const{height:J,offsetTop:Y}=m,{height:ee,naturalTop:le}=v,{height:se}=M;if(k===2)if(e.style.position="relative",j=_===0?Math.max(0,Y+f-le+a):Math.max(0,Y+f+J-(le+se+i)),r){const q=Math.max(0,ee-se-j);e.style.bottom=`${q}px`}else e.style.top=`${j}px`;else e.style.position=Rs,k===1?r?e.style.bottom=`${i}px`:e.style.top=`${J-se-i}px`:r?e.style.bottom=`${J-se-i}px`:e.style.top=`${a}px`};T(x);const P=k=>{if(k===f)return;const _=k-f;if(f=k,x===3)return;const{offsetTop:J,height:Y}=m,{naturalTop:ee,height:le}=v,{height:se}=M;if(_>0)if(x===0){if(k+J+a>ee){const q=Math.max(0,J+f-ee+a);k+J+Y<=ee+se+q+i?T(2):T(1)}}else x===2&&p(k)&&T(1);else if(x===1){if(J+k+Y<ee+le+i){const q=Math.max(0,J+f+Y-(ee+se+i));J+k+a>=ee+q?T(2):T(0)}}else x===2&&J+k+a<ee+j&&T(0)},L=l===window?()=>P(window.scrollY):()=>P(l.scrollTop);l.addEventListener("scroll",L,Dl),l.addEventListener("mousewheel",L,Dl),t.push(()=>l.removeEventListener("scroll",L),()=>l.removeEventListener("mousewheel",L))},s3=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,i]=S.useState(null);return S.useEffect(()=>{if(!r||!Rs)return;const a=[];return i3(r,a,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{a.forEach(l=>l())}},[r,t,e,n]),i},a3=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:i,className:a,style:l}=e,u=s3({offsetTop:t,offsetBottom:n,bottom:r});return g.jsx("div",{className:a,style:l,ref:u,children:i})},l3=a3;const c3=ue(b.Grid,{name:"ApplicaLongFormView",slot:"Root"})(({theme:e})=>({"& .MuiToolbar-root":{position:"initial",marginTop:e.spacing(2),marginLeft:`-${e.spacing(3)}`,marginRight:`-${e.spacing(3)}`,marginBottom:`-${e.spacing(2)}`,borderTop:`1px solid ${e.palette.divider}`,[e.breakpoints.down("sm")]:{position:"initial !important",width:"auto !important"}},"& form > .MuiToolbar-root":{margin:0,marginRight:`-${e.spacing(.5)}`,[e.breakpoints.down("sm")]:{marginRight:e.spacing(.5)}}})),Fm=(e,t)=>e&&e.type===Ol&&e.props.position===t,u3=e=>e&&e.type===Ml,bd=({children:e,formRootPathname:t,syncWithLocation:n,spacing:r,tabs:i,tabsDisposition:a,contentDisposition:l,sticky:u,...A})=>{const[f,p]=S.useState(0),C=vr.useResolvedPath(""),h=O.useResourceContext(A),m=vr.useLocation(),I=S.useMemo(()=>S.Children.toArray(e).find(T=>Fm(T,"top")),[e]),B=S.useMemo(()=>S.Children.toArray(e).find(T=>Fm(T,"bottom")),[e]),v=S.useMemo(()=>S.Children.toArray(e).filter(T=>u3(T)),[e]),M=T=>{n||p(T)},j=()=>S.cloneElement(i,{onChange:M,syncWithLocation:n,url:t,value:f,intent:"header"},v),x=S.useMemo(()=>g.jsxs(S.Fragment,{children:[I,n?g.jsx(vr.Routes,{children:g.jsx(vr.Route,{path:"/*",element:j()})}):j(),B]}),[I,n,j,B]);return g.jsxs(c3,{container:!0,spacing:r*2,children:[g.jsx(b.Grid,{item:!0,...a,children:u?g.jsx(l3,{offsetTop:74,offsetBottom:r*2,children:x}):x}),g.jsx(b.Grid,{item:!0,...l,children:S.Children.map(v,(T,P)=>{if(!T)return null;const L=O.getTabbedFormTabFullPath(T,P),k=n?!vr.matchPath(`${C.pathname}/${L}`,m.pathname):f!==P;return S.isValidElement(T)?S.cloneElement(T,{intent:"content",resource:h,hidden:k,value:n?L:P}):null})})]})};bd.propTypes={children:c.node,spacing:c.number,syncWithLocation:c.bool,tabs:c.element,formRootPathname:c.string,tabsDisposition:Sl,contentDisposition:Sl},bd.defaultProps={tabs:g.jsx(jm,{})};const A3=()=>{const e=gt.useLocation(),t=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/*",":resource/:id/*"];for(const n of t){const r=gt.matchPath(n,e.pathname);if(r)return r.pathnameBase}return""},js=({spacing:e,...t})=>{const n=A3(),{spacing:r}=Fn(),i=e||r;return g.jsx(O.Form,{formRootPathname:n,...t,children:g.jsx(bd,{formRootPathname:n,...t,spacing:i})})};js.propTypes={syncWithLocation:c.bool,spacing:c.number,tabsDisposition:Sl,contentDisposition:Sl,sticky:c.bool},js.defaultProps={syncWithLocation:!1,sticky:!0,spacing:2,tabsDisposition:{xl:3,lg:3,md:4,sm:4,xs:12},contentDisposition:{xl:9,lg:9,md:8,sm:8,xs:12}},js.Tab=Ml,js.Sidebar=Ol;const d3=ue(O.Show,{name:"RaApplicaShow",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaShow-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaShow-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),f3=ue(O.SimpleFormIterator,{name:"ApplicaSimpleFormIterator",root:"root"})(({theme:e})=>({"& .RaSimpleFormIterator-line":{paddingTop:e.spacing(1),paddingBottom:e.spacing(.5)},"& .RaSimpleFormIterator-action":{display:"flex",flexDirection:"row",alignItems:"center",mb:1.5},"& section":{width:"100%","& label":{position:"relative",overflow:"visible",transform:"none",marginLeft:0}}})),Rl=ai(O.TabbedForm,{name:"RaApplicaTabbedForm",slot:"Root"})(()=>({}));Rl.propTypes={...O.TabbedForm.propTypes},Rl.defaultProps={...O.TabbedForm.defaultProps},Rl.Tab=O.TabbedForm.Tab;const Lm=S.createContext(void 0),g3=S.createContext(void 0),p3=()=>S.useContext(Lm),h3=V.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:i=!1,index:a,member:l,resource:u}=e,A=O.useTranslate(),[f,p]=V.useState(!1),{total:C,remove:h}=p3(),m=V.useCallback(()=>{p(!1),h(a)},[a,h]),I=S.useMemo(()=>({index:a,total:C,remove:()=>h(a)}),[a,C,h]);return g.jsxs(g3.Provider,{value:I,children:[S.Children.map(n,(B,v)=>{if(!S.isValidElement(B))return null;const{source:M,...j}=B.props;return g.jsx(b.TableCell,{sx:{border:0,verticalAlign:"top"},children:S.cloneElement(B,{source:M?`${l}.${M}`:l,index:M?void 0:v,resource:u,disabled:r,...j,label:!1})})}),!i&&g.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",border:0,pt:2},children:g.jsx(fi,{horizontal:!0,children:g.jsx(b.Typography,{color:"error",onClick:()=>p(!0),children:A("ra.action.delete")})})}),n.length>0&&g.jsx(O.Confirm,{isOpen:f,title:A("ra.action.remove_item"),content:A("ra.message.remove_item"),onConfirm:m,onClose:()=>p(!1)})]})});var C3=Array.isArray,Qd=C3,E3=typeof kn=="object"&&kn&&kn.Object===Object&&kn,m3=E3,I3=m3,B3=typeof self=="object"&&self&&self.Object===Object&&self,y3=I3||B3||Function("return this")(),xd=y3,v3=xd,b3=v3.Symbol,wd=b3,Nm=wd,Vm=Object.prototype,Q3=Vm.hasOwnProperty,x3=Vm.toString,ks=Nm?Nm.toStringTag:void 0;function w3(e){var t=Q3.call(e,ks),n=e[ks];try{e[ks]=void 0;var r=!0}catch{}var i=x3.call(e);return r&&(t?e[ks]=n:delete e[ks]),i}var T3=w3,P3=Object.prototype,S3=P3.toString;function O3(e){return S3.call(e)}var M3=O3,Hm=wd,D3=T3,R3=M3,j3="[object Null]",k3="[object Undefined]",zm=Hm?Hm.toStringTag:void 0;function F3(e){return e==null?e===void 0?k3:j3:zm&&zm in Object(e)?D3(e):R3(e)}var Wm=F3;function L3(e){return e!=null&&typeof e=="object"}var N3=L3,V3=Wm,H3=N3,z3="[object Symbol]";function W3(e){return typeof e=="symbol"||H3(e)&&V3(e)==z3}var Td=W3,U3=Qd,Y3=Td,G3=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K3=/^\w*$/;function _3(e,t){if(U3(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Y3(e)?!0:K3.test(e)||!G3.test(e)||t!=null&&e in Object(t)}var J3=_3;function X3(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Um=X3,Z3=Wm,q3=Um,$3="[object AsyncFunction]",eM="[object Function]",tM="[object GeneratorFunction]",nM="[object Proxy]";function rM(e){if(!q3(e))return!1;var t=Z3(e);return t==eM||t==tM||t==$3||t==nM}var oM=rM,iM=xd,sM=iM["__core-js_shared__"],aM=sM,Pd=aM,Ym=function(){var e=/[^.]+$/.exec(Pd&&Pd.keys&&Pd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function lM(e){return!!Ym&&Ym in e}var cM=lM,uM=Function.prototype,AM=uM.toString;function dM(e){if(e!=null){try{return AM.call(e)}catch{}try{return e+""}catch{}}return""}var fM=dM,gM=oM,pM=cM,hM=Um,CM=fM,EM=/[\\^$.*+?()[\]{}|]/g,mM=/^\[object .+?Constructor\]$/,IM=Function.prototype,BM=Object.prototype,yM=IM.toString,vM=BM.hasOwnProperty,bM=RegExp("^"+yM.call(vM).replace(EM,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function QM(e){if(!hM(e)||pM(e))return!1;var t=gM(e)?bM:mM;return t.test(CM(e))}var xM=QM;function wM(e,t){return e==null?void 0:e[t]}var TM=wM,PM=xM,SM=TM;function OM(e,t){var n=SM(e,t);return PM(n)?n:void 0}var Gm=OM,MM=Gm,DM=MM(Object,"create"),jl=DM,Km=jl;function RM(){this.__data__=Km?Km(null):{},this.size=0}var jM=RM;function kM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var FM=kM,LM=jl,NM="__lodash_hash_undefined__",VM=Object.prototype,HM=VM.hasOwnProperty;function zM(e){var t=this.__data__;if(LM){var n=t[e];return n===NM?void 0:n}return HM.call(t,e)?t[e]:void 0}var WM=zM,UM=jl,YM=Object.prototype,GM=YM.hasOwnProperty;function KM(e){var t=this.__data__;return UM?t[e]!==void 0:GM.call(t,e)}var _M=KM,JM=jl,XM="__lodash_hash_undefined__";function ZM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=JM&&t===void 0?XM:t,this}var qM=ZM,$M=jM,eD=FM,tD=WM,nD=_M,rD=qM;function xi(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])}}xi.prototype.clear=$M,xi.prototype.delete=eD,xi.prototype.get=tD,xi.prototype.has=nD,xi.prototype.set=rD;var oD=xi;function iD(){this.__data__=[],this.size=0}var sD=iD;function aD(e,t){return e===t||e!==e&&t!==t}var lD=aD,cD=lD;function uD(e,t){for(var n=e.length;n--;)if(cD(e[n][0],t))return n;return-1}var kl=uD,AD=kl,dD=Array.prototype,fD=dD.splice;function gD(e){var t=this.__data__,n=AD(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():fD.call(t,n,1),--this.size,!0}var pD=gD,hD=kl;function CD(e){var t=this.__data__,n=hD(t,e);return n<0?void 0:t[n][1]}var ED=CD,mD=kl;function ID(e){return mD(this.__data__,e)>-1}var BD=ID,yD=kl;function vD(e,t){var n=this.__data__,r=yD(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var bD=vD,QD=sD,xD=pD,wD=ED,TD=BD,PD=bD;function wi(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])}}wi.prototype.clear=QD,wi.prototype.delete=xD,wi.prototype.get=wD,wi.prototype.has=TD,wi.prototype.set=PD;var SD=wi,OD=Gm,MD=xd,DD=OD(MD,"Map"),RD=DD,_m=oD,jD=SD,kD=RD;function FD(){this.size=0,this.__data__={hash:new _m,map:new(kD||jD),string:new _m}}var LD=FD;function ND(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var VD=ND,HD=VD;function zD(e,t){var n=e.__data__;return HD(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Fl=zD,WD=Fl;function UD(e){var t=WD(this,e).delete(e);return this.size-=t?1:0,t}var YD=UD,GD=Fl;function KD(e){return GD(this,e).get(e)}var _D=KD,JD=Fl;function XD(e){return JD(this,e).has(e)}var ZD=XD,qD=Fl;function $D(e,t){var n=qD(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var eR=$D,tR=LD,nR=YD,rR=_D,oR=ZD,iR=eR;function Ti(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])}}Ti.prototype.clear=tR,Ti.prototype.delete=nR,Ti.prototype.get=rR,Ti.prototype.has=oR,Ti.prototype.set=iR;var sR=Ti,Jm=sR,aR="Expected a function";function Sd(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(aR);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var l=e.apply(this,r);return n.cache=a.set(i,l)||a,l};return n.cache=new(Sd.Cache||Jm),n}Sd.Cache=Jm;var lR=Sd,cR=lR,uR=500;function AR(e){var t=cR(e,function(r){return n.size===uR&&n.clear(),r}),n=t.cache;return t}var dR=AR,fR=dR,gR=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pR=/\\(\\)?/g,hR=fR(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(gR,function(n,r,i,a){t.push(i?a.replace(pR,"$1"):r||n)}),t}),CR=hR;function ER(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var mR=ER,Xm=wd,IR=mR,BR=Qd,yR=Td,vR=1/0,Zm=Xm?Xm.prototype:void 0,qm=Zm?Zm.toString:void 0;function $m(e){if(typeof e=="string")return e;if(BR(e))return IR(e,$m)+"";if(yR(e))return qm?qm.call(e):"";var t=e+"";return t=="0"&&1/e==-vR?"-0":t}var bR=$m,QR=bR;function xR(e){return e==null?"":QR(e)}var wR=xR,TR=Qd,PR=J3,SR=CR,OR=wR;function MR(e,t){return TR(e)?e:PR(e,t)?[e]:SR(OR(e))}var DR=MR,RR=Td,jR=1/0;function kR(e){if(typeof e=="string"||RR(e))return e;var t=e+"";return t=="0"&&1/e==-jR?"-0":t}var FR=kR,LR=DR,NR=FR;function VR(e,t){t=LR(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[NR(t[n++])];return n&&n==r?e:void 0}var HR=VR,zR=HR;function WR(e,t,n){var r=e==null?void 0:zR(e,t);return r===void 0?n:r}var UR=WR;const YR=ti(UR),e0=e=>{const{children:t,resource:n,source:r,label:i,disableActions:a=!1,disableAdd:l=!1,disableRemove:u=!1,className:A,empty:f}=e,[p,C]=S.useState(!1),{fields:h,remove:m,replace:I}=O.useArrayInput(e),B=xt(),v=be.useTranslate(),M=be.useRecordContext(e),j=S.useRef({}),x=be.useTranslateLabel(),T=S.useCallback(J=>{m(J)},[m]);if(h.length>0){const{...J}=h[0];j.current=J;for(const Y in j.current)j.current[Y]=null}const P=S.useCallback(()=>{I([]),C(!1)},[I]),L=YR(M,r),k=S.useMemo(()=>({total:h.length,remove:T,source:r}),[h.length,T,r]),_=B.palette.mode==="dark"?B.palette.grey.A400:B.palette.grey.A800;return h?g.jsx(Lm.Provider,{value:k,children:g.jsxs("div",{className:A,children:[g.jsx(t0,{label:i,source:r,disableAdd:l}),g.jsx(b.TableContainer,{component:b.Paper,sx:{mt:2,border:`1px solid ${_}`},children:g.jsxs(b.Table,{children:[g.jsx(b.TableHead,{sx:{borderTop:0,borderBottom:`1px solid ${_}`},children:g.jsxs(b.TableRow,{children:[S.Children.map(t,(J,Y)=>V.isValidElement(J)?g.jsx(b.TableCell,{children:g.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none",children:x({...J.props,resource:n})})},Y):null),!a&&g.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"top"},children:g.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none"})},"actions")]})}),g.jsxs(b.TableBody,{children:[h.length===0&&g.jsx(b.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0}},children:g.jsx(b.TableCell,{colSpan:4+(a?0:1),align:"center",children:f||g.jsx(b.Typography,{variant:"body1",color:"text.secondary",children:"-"})})}),h.length>0&&h.map((J,Y)=>g.jsx(b.TableRow,{sx:{borderBottom:`1px solid ${_}}`},children:g.jsx(h3,{disableRemove:u,disableActions:a,index:Y,member:`${r}.${Y}`,onRemoveField:T,record:L&&L[Y]||{},resource:n,source:r,children:t})},J.id))]})]})}),h.length>0&&g.jsx(O.Confirm,{isOpen:p,title:v("ra.action.clear_array_input"),content:v("ra.message.clear_array_input"),onConfirm:P,onClose:()=>C(!1)})]})}):null},t0=e=>{const{label:t,disableAdd:n}=e,{append:r}=O.useArrayInput(e),i=xt(),a=i.palette.mode==="dark"?i.palette.grey.A400:i.palette.grey.A800,l=i.palette.mode==="light"?"#000000":"#FFFFFF";return g.jsxs(b.Stack,{justifyContent:"space-between",alignItems:"center",flexDirection:"row",children:[g.jsx(b.Typography,{children:t}),!n&&g.jsx(b.IconButton,{size:"small",color:"secondary",sx:{border:`1px solid ${a}`},onClick:()=>r({}),children:g.jsx(et.PlusCircleOutlined,{style:{color:l}})})]})},GR=ue(e0,{name:"RaApplicaTableFormIterator",slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8)})`}}}));t0.propTypes={label:c.string.isRequired,source:c.string.isRequired},e0.propTypes={addButton:c.element,children:c.node,className:c.string,field:c.object,fields:c.array,fieldState:c.object,formState:c.object,record:c.object,source:c.string,label:c.string,resource:c.string,translate:c.func,disableAdd:c.bool,disableRemove:c.oneOfType([c.func,c.bool]),TransitionProps:c.shape({}),empty:c.oneOfType([c.node,c.string])};function KR(e,t){const n=pt.clone(e),{type:r,payload:i}=t;switch(r){case"updateMedia":{const a=pt.chain(n.media).clone().extend(i).value();return pt.extend(n,{media:a})}case"updateDrawer":{const a=pt.chain(n.drawer).clone().extend(i).value();return pt.extend(n,{drawer:a})}case"updateLogo":{const a=pt.chain(n.logo).clone().extend(i).value();return pt.extend(n,{logo:a})}case"updateNotifications":{const a=pt.chain(n.notifications).clone().extend(i).value();return pt.extend(n,{notifications:a})}case"updateTheme":{const a=pt.chain(n.theme).clone().extend(i).value();return pt.extend(n,{theme:a})}default:return n}}const _R={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"}},n0=S.createContext(void 0);function r0(e){var _;const t=be.useGetIdentity(),n=b.useTheme(),r=b.useMediaQuery(n.breakpoints.down("md")),i=b.useMediaQuery(n.breakpoints.down("lg")),a=b.useMediaQuery(n.breakpoints.down("xl")),{miniDrawer:l,isHorizontalLayout:u,menuOrientation:A,drawerWidth:f}=Fn(),p=u(A)&&!i,{drawerOpen:C,openDrawer:h}=Jr(),m=S.useCallback(()=>{h(!C)},[C,h]),[I,B]=S.useState(!1),[v,M]=S.useReducer(KR,pt.chain(_R).clone().merge({drawer:{open:!l||C}}).value()),j=S.useCallback(()=>B(!1),[]),x=S.useMemo(()=>({state:v,dispatch:M}),[v,M]),{logoIcon:T,logoMain:P,enableNotification:L,notification:k}=e;return S.useEffect(()=>{M({type:"updateMedia",payload:{downMd:r,downLg:i,downXl:a,horizontal:p}})},[A,r,i,a]),S.useEffect(()=>{M({type:"updateDrawer",payload:{open:C,width:f,handleDrawerToggle:m}})},[C,f,m]),S.useEffect(()=>{l||h(!a)},[a,l]),S.useEffect(()=>{M({type:"updateLogo",payload:{main:P,icon:T}})},[T,P]),S.useEffect(()=>{M({type:"updateNotifications",payload:{enable:L,resource:k??"entities/notification"}})},[L,k]),S.useEffect(()=>{M({type:"updateTheme",payload:{iconColorOpen:n.palette.mode==="dark"?"grey.200":"grey.300",iconColor:n.palette.mode==="dark"?"background.default":"grey.100"}})},[n.palette.mode]),S.useEffect(()=>{var J;B(((J=t==null?void 0:t.data)==null?void 0:J.needToChangePassword)===!0)},[(_=t==null?void 0:t.data)==null?void 0:_.needToChangePassword]),g.jsxs(n0.Provider,{value:x,children:[g.jsx(b.Dialog,{open:I,maxWidth:"xs",fullWidth:!0,children:g.jsx(Bd,{onSuccess:j,firstAccess:!0})}),e.children]})}function o0(e){return S.forwardRef((t,n)=>{const{logoIcon:r,logoMain:i,enableNotification:a}=t;return g.jsx(r0,{logoIcon:r,logoMain:i,enableNotification:a,children:g.jsx(e,{ref:n,...t})})})}function Od(){const e=S.useContext(n0);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function JR(){return Od().dispatch}function Pi(){return Od().state}function zn(){return Pi().media}function ko(){return Pi().drawer}function i0(){return Pi().logo}function Ll(){return Pi().notifications}function Nl(){return Pi().theme}function s0(){const{iconColor:e,iconColorOpen:t}=Nl(),{open:n,handleDrawerToggle:r}=ko();return g.jsx(ro,{"aria-label":"open drawer",onClick:r,edge:"start",color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:n?t:e,ml:{xs:0,lg:-2}},children:n?g.jsx(et.MenuFoldOutlined,{}):g.jsx(et.MenuUnfoldOutlined,{})})}function a0(e){const t=S.useRef(),n=b.useTheme(),{downLg:r,horizontal:i}=zn(),{open:a,width:l}=ko(),u=r?b.AppBar:dh,A=pi(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:i?"100%":a?`calc(100% - ${l}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),f={position:"fixed",color:"inherit",elevation:0,sx:A};return r||pt.extend(f,{open:a}),g.jsx(u,{ref:t,...f,children:g.jsxs(b.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!i&&g.jsx(s0,{}),e.children]})})}function XR(e){const t=b.useTheme(),{notification:n,onClick:r,selected:i,divider:a}=e,{resource:l}=Ll(),u=be.useNotify(),A=be.useRedirect(),[f]=be.useUpdate(l,{id:n==null?void 0:n.id,data:{...n,readed:Rr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n!=null&&n.resource?n!=null&&n.resource.startsWith("/")?(A(n==null?void 0:n.resource),r()):document.location.href=n==null?void 0:n.resource:r()},onFailure:()=>{u("resources.notifications.messages.readed.error","warning")}}),p=S.useCallback(()=>f(),[f]),[C]=be.useLocaleState(),h=S.useMemo(()=>Rr(n.created).locale(C).fromNow(),[n,C]);return g.jsx(b.ListItem,{disablePadding:!0,divider:a,children:g.jsxs(b.ListItemButton,{selected:i,onClick:p,children:[g.jsx(b.ListItemAvatar,{children:g.jsx(b.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:g.jsx(et.MessageOutlined,{})})}),g.jsx(b.ListItemText,{primary:n.title,secondary:n.content}),g.jsx(b.Box,{flexGrow:1,flexShrink:1,minWidth:t.spacing(2)}),g.jsx(b.ListItemText,{primary:h,primaryTypographyProps:{variant:"caption"}})]})})}const ZR={width:36,height:36,fontSize:"1rem"},qR={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function l0(){const{enable:e}=Ll();return e?g.jsx($R,{}):null}function $R(){const e=b.useTheme(),t=S.useRef(),{resource:n}=Ll(),{downMd:r}=zn(),{iconColor:i,iconColorOpen:a}=Nl(),[l,u]=S.useState(!1),[A,f]=S.useState([]),p=A.filter(B=>B.readed===null).length,C=S.useCallback(()=>u(!l),[l]),h=S.useCallback(()=>{t.current&&t.current.contains(event.target)||u(!1)},[t.current,u]),{data:m,isLoading:I}=be.useGetList(n,{pagination:{page:1,perPage:50},sort:{field:"created",order:"DESC"},filter:{readed:!1}});return S.useEffect(()=>{!I&&m&&f(m??[])},[m,I]),g.jsxs(b.Box,{sx:{flexShrink:0},children:[g.jsx(ro,{color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:l?a:i},"aria-label":"open profile",ref:t,"aria-controls":l?"profile-grow":void 0,"aria-haspopup":"true",onClick:C,children:g.jsx(b.Badge,{badgeContent:p,color:"primary",children:g.jsx(et.BellOutlined,{})})}),g.jsx(b.Popper,{placement:r?"bottom":"bottom-end",open:l,anchorEl:t.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[r?-5:0,9]}}]},children:({TransitionProps:B})=>g.jsx(io,{type:"grow",position:r?"top":"top-right",in:open,...B,children:g.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:"100%",minWidth:285,maxWidth:420,[e.breakpoints.down("md")]:{maxWidth:285}},children:g.jsx(b.ClickAwayListener,{onClickAway:h,children:g.jsx(Nn,{title:"Notification",elevation:0,border:!1,content:!1,secondary:g.jsx(g.Fragment,{children:p>0&&g.jsx(b.Tooltip,{title:"Mark as all read",children:g.jsx(ro,{color:"success",size:"small",children:g.jsx(et.CheckCircleOutlined,{style:{fontSize:"1.15rem"}})})})}),children:g.jsx(b.List,{component:"nav",sx:{p:0,"& .MuiListItemButton-root":{py:.5,"&.Mui-selected":{bgcolor:"grey.50",color:"text.primary"},"& .MuiAvatar-root":ZR,"& .MuiListItemSecondaryAction-root":{...qR,position:"relative"}}},children:A.map((v,M)=>g.jsx(XR,{selected:p>0,notification:v,onClick:h,divider:M<A.length-1},v.id))})})})})})})]})}const ej=()=>{const[e,t]=S.useState(!1),n=S.useCallback(()=>t(!1),[t]),r=S.useCallback(()=>t(!0),[t]),i=be.useTranslate();return g.jsxs(S.Fragment,{children:[g.jsxs(b.ListItemButton,{onClick:r,children:[g.jsx(b.ListItemIcon,{children:g.jsx(jn.Key,{})}),g.jsx(b.ListItemText,{primary:i("ra.auth.change_password")})]}),g.jsx(b.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:g.jsx(Bd,{onSuccess:n})})]})},tj=()=>{const e=be.useLogout(),t=be.useTranslate();return g.jsx(S.Fragment,{children:g.jsxs(b.ListItemButton,{onClick:e,children:[g.jsx(b.ListItemIcon,{children:g.jsx(jn.LogoutOutlined,{})}),g.jsx(b.ListItemText,{primary:t("ra.auth.logout")})]})})},nj=()=>{const e=be.useTranslate(),t=be.useAuthProvider(),n=S.useCallback(()=>t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,i]=S.useState(!1);return S.useEffect(()=>{t.isImpersonating&&t.isImpersonating().then(a=>i(a))},[t,i]),r?g.jsx(S.Fragment,{children:g.jsxs(b.ListItemButton,{onClick:n,children:[g.jsx(b.ListItemIcon,{children:g.jsx(jn.LogoutOutlined,{})}),g.jsx(b.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};c.node,c.any.isRequired,c.any.isRequired;const c0=()=>{var B;const e=b.useTheme(),{identity:t}=O.useGetIdentity(),n=t!==void 0&&t.image&&t.image!==null&&t.image!=="",r=S.useRef(null),[i,a]=S.useState(!1),l=()=>{a(v=>!v)},u=v=>{r.current&&r.current.contains(v.target)||a(!1)},A=e.palette.mode==="dark"?"grey.200":"grey.300",f=O.useLogout(),p=O.useDataProvider(),C=O.useAuthProvider(),h=S.useCallback(()=>{f()},[C,f]),[m,I]=S.useState(null);return S.useEffect(()=>{if(!n)return;async function v(){var M=await p.getFile("/profile/me/image");I(M)}v()},[p,n]),g.jsxs(b.Box,{sx:{flexShrink:0},children:[g.jsx(b.ButtonBase,{sx:{p:.25,bgcolor:i?A:"transparent",borderRadius:1,"&:hover":{bgcolor:e.palette.mode==="dark"?"secondary.light":"secondary.lighter"},"&:focus-visible":{outline:`2px solid ${e.palette.secondary.dark}`,outlineOffset:2}},"aria-label":"open profile",ref:r,"aria-controls":i?"profile-grow":void 0,"aria-haspopup":"true",onClick:l,children:g.jsxs(b.Stack,{direction:"row",spacing:2,alignItems:"center",sx:{p:.5},children:[g.jsx(Cl,{alt:(B=t==null?void 0:t.name)==null?void 0:B.toUpperCase(),src:m,size:"xs"}),g.jsx(b.Typography,{variant:"subtitle1",children:t==null?void 0:t.name})]})}),g.jsx(b.Popper,{placement:"bottom-end",open:i,anchorEl:r.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:v})=>{var M;return g.jsx(io,{type:"grow",position:"top-right",in:i,...v,children:g.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:290,minWidth:240,maxWidth:290,[e.breakpoints.down("md")]:{maxWidth:250}},children:g.jsx(b.ClickAwayListener,{onClickAway:u,children:g.jsxs(Nn,{elevation:0,border:!1,content:!1,children:[g.jsx(b.CardContent,{sx:{px:2.5,pt:3},children:g.jsxs(b.Grid,{container:!0,justifyContent:"space-between",alignItems:"center",children:[g.jsx(b.Grid,{item:!0,children:g.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[g.jsx(Cl,{alt:"profile user",src:m,sx:{width:32,height:32}}),g.jsxs(b.Stack,{children:[g.jsx(b.Typography,{variant:"h6",children:t==null?void 0:t.name}),g.jsx(b.Typography,{variant:"body2",color:"textSecondary",children:(M=t==null?void 0:t.roles)==null?void 0:M.map(j=>j.name.replace("ROLE_","")).join(",")})]})]})}),g.jsx(b.Grid,{item:!0,children:g.jsx(b.Tooltip,{title:"Logout",children:g.jsx(ro,{size:"large",sx:{color:"text.primary"},onClick:h,children:g.jsx(et.LogoutOutlined,{})})})})]})}),g.jsx(b.Grid,{container:!0,children:g.jsx(b.Grid,{item:!0,xs:12,children:g.jsxs(b.List,{component:"nav",sx:{p:0,"& .MuiListItemIcon-root":{minWidth:32}},children:[g.jsx(ej,{}),g.jsx(tj,{}),g.jsx(nj,{})]})})})]})})})})}})]})},u0=e=>{const t=xt(),{downMd:n}=zn(),{iconColor:r,iconColorOpen:i}=Nl(),[a,l]=S.useState(!1),u=S.useRef(null),A=S.useCallback(()=>{l(!a)},[a]),f=S.useCallback(p=>{u.current&&u.current.contains(p.target)||l(!1)},[]);return n?g.jsxs(g.Fragment,{children:[g.jsx(b.Box,{sx:{flexShrink:0},children:g.jsx(ro,{sx:{color:"text.primary",bgcolor:a?i:r},"aria-label":"open more menu",ref:u,"aria-controls":a?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:A,color:"secondary",variant:"light",children:g.jsx(et.MoreOutlined,{})})}),g.jsx(b.Popper,{placement:"bottom-end",open:a,anchorEl:u.current,role:void 0,transition:!0,disablePortal:!0,style:{width:"100%"},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:p})=>g.jsx(io,{type:"fade",in:a,...p,children:g.jsx(b.Paper,{sx:{boxShadow:t.customShadows.z1},children:g.jsx(b.ClickAwayListener,{onClickAway:f,children:g.jsx(b.AppBar,{color:"inherit",children:g.jsx(b.Toolbar,{children:e.children})})})})})})]}):g.jsx(g.Fragment,{children:e.children})};function A0(e){return g.jsx(b.Box,{...e,flex:1})}function Fs(e){const{name:t,version:n}=e;return g.jsx(b.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:"24px 16px 0px",mt:"auto"},children:g.jsxs(b.Typography,{variant:"caption",children:[g.jsx("span",{dangerouslySetInnerHTML:{__html:(e==null?void 0:e.copy)||""}})," ",t," - ",n]})})}Fs.propTypes={name:c.string.isRequired,version:c.string.isRequired,copy:c.string},Fs.defaultProps={copy:"&copy; Applica Software Guru for"};function d0(e){const{width:t}=ko(),{horizontal:n}=zn(),{container:r}=Fn();return g.jsxs(b.Box,{component:"main",sx:{width:`calc(100% - ${t}px)`,flexGrow:1,p:{xs:0,sm:2,lg:1},pt:{lg:2}},children:[g.jsx(b.Toolbar,{sx:{mt:n?8:"inherit"}})," ",g.jsx(b.Container,{maxWidth:r?"xl":!1,sx:{...r&&{px:{xs:0,sm:2}},position:"relative",minHeight:"calc(100vh - 110px)",display:"flex",flexDirection:"column"},children:e.children})]})}const f0=S.forwardRef((e,t)=>{const n=pi(e,{display:"flex",width:"100%"});return g.jsx(b.Box,{ref:t,...e,sx:n,children:e.children})});var g0={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})(g0);var rj=g0.exports,Md={};const oj=Lb(zO);var p0;function ij(){return p0||(p0=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=oj}(Md)),Md}function h0(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=h0(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function sj(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=h0(e))&&(r&&(r+=" "),r+=t);return r}var Dd=globalThis&&globalThis.__assign||function(){return Dd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Dd.apply(this,arguments)},aj=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},C0=function(e){var t=e.className,n=e.sx,r=aj(e,["className","sx"]),i=be.useLoading(),a=xt();return V.createElement(lj,{className:t,sx:n},i?V.createElement(fm,Dd({className:sj("app-loader",Vl.loader),color:"inherit",size:a.spacing(2),thickness:6},r)):V.createElement(Z0,{className:Vl.loadedIcon}))};C0.propTypes={classes:c.object,className:c.string,width:c.string};var Rd="RaLoadingIndicator",Vl={loader:"".concat(Rd,"-loader"),loadedIcon:"".concat(Rd,"-loadedIcon")},lj=ue("div",{name:Rd,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={},t["& .".concat(Vl.loader)]={marginLeft:n.spacing(1.5),marginRight:n.spacing(1.5)},t["& .".concat(Vl.loadedIcon)]={},t});const jd=e=>e.scrollTop;function Si(e,t){var n,r;const{timeout:i,easing:a,style:l={}}=e;return{duration:(n=l.transitionDuration)!=null?n:typeof i=="number"?i:i[t.mode]||0,easing:(r=l.transitionTimingFunction)!=null?r:typeof a=="object"?a[t.mode]:a,delay:l.transitionDelay}}const cj=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function uj(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),a=oi(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const f=a.getComputedStyle(t);l=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("transform")}let u=0,A=0;if(l&&l!=="none"&&typeof l=="string"){const f=l.split("(")[1].split(")")[0].split(",");u=parseInt(f[4],10),A=parseInt(f[5],10)}return e==="left"?i?`translateX(${i.right+u-r.left}px)`:`translateX(${a.innerWidth+u-r.left}px)`:e==="right"?i?`translateX(-${r.right-i.left-u}px)`:`translateX(-${r.left+r.width-u}px)`:e==="up"?i?`translateY(${i.bottom+A-r.top}px)`:`translateY(${a.innerHeight+A-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-A}px)`:`translateY(-${r.top+r.height-A}px)`}function E0(e){return typeof e=="function"?e():e}function Hl(e,t,n){const r=E0(n),i=uj(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const m0=V.forwardRef(function(t,n){const r=xt(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},a={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:u=!0,children:A,container:f,direction:p="down",easing:C=i,in:h,onEnter:m,onEntered:I,onEntering:B,onExit:v,onExited:M,onExiting:j,style:x,timeout:T=a,TransitionComponent:P=UA}=t,L=Ke(t,cj),k=V.useRef(null),_=Bn(A.ref,k,n),J=F=>te=>{F&&(te===void 0?F(k.current):F(k.current,te))},Y=J((F,te)=>{Hl(p,F,f),jd(F),m&&m(F,te)}),ee=J((F,te)=>{const W=Si({timeout:T,style:x,easing:C},{mode:"enter"});F.style.webkitTransition=r.transitions.create("-webkit-transform",U({},W)),F.style.transition=r.transitions.create("transform",U({},W)),F.style.webkitTransform="none",F.style.transform="none",B&&B(F,te)}),le=J(I),se=J(j),q=J(F=>{const te=Si({timeout:T,style:x,easing:C},{mode:"exit"});F.style.webkitTransition=r.transitions.create("-webkit-transform",te),F.style.transition=r.transitions.create("transform",te),Hl(p,F,f),v&&v(F)}),K=J(F=>{F.style.webkitTransition="",F.style.transition="",M&&M(F)}),z=F=>{l&&l(k.current,F)},Z=V.useCallback(()=>{k.current&&Hl(p,k.current,f)},[p,f]);return V.useEffect(()=>{if(h||p==="down"||p==="right")return;const F=Ep(()=>{k.current&&Hl(p,k.current,f)}),te=oi(k.current);return te.addEventListener("resize",F),()=>{F.clear(),te.removeEventListener("resize",F)}},[p,h,f]),V.useEffect(()=>{h||Z()},[h,Z]),g.jsx(P,U({nodeRef:k,onEnter:Y,onEntered:le,onEntering:ee,onExit:q,onExited:K,onExiting:se,addEndListener:z,appear:u,in:h,timeout:T},L,{children:(F,te)=>V.cloneElement(A,U({ref:_,style:U({visibility:F==="exited"&&!h?"hidden":void 0},x,A.props.style)},te))}))});process.env.NODE_ENV!=="production"&&(m0.propTypes={addEndListener:c.func,appear:c.bool,children:ni.isRequired,container:br(c.oneOfType([bo,c.func]),e=>{if(e.open){const t=E0(e.container);if(t&&t.nodeType===1){const n=t.getBoundingClientRect();if(process.env.NODE_ENV!=="test"&&n.top===0&&n.left===0&&n.right===0&&n.bottom===0)return new Error(["MUI: The `container` prop provided to the component is invalid.","The anchor element should be part of the document layout.","Make sure the element is present in the document or that it's not display none."].join(`
203
203
  `))}else if(!t||typeof t.getBoundingClientRect!="function"||t.contextElement!=null&&t.contextElement.nodeType!==1)return new Error(["MUI: The `container` prop provided to the component is invalid.","It should be an HTML element instance."].join(`
204
204
  `))}return null}),direction:c.oneOf(["down","left","right","up"]),easing:c.oneOfType([c.shape({enter:c.string,exit:c.string}),c.string]),in:c.bool,onEnter:c.func,onEntered:c.func,onEntering:c.func,onExit:c.func,onExited:c.func,onExiting:c.func,style:c.object,timeout:c.oneOfType([c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});const Aj=m0;function dj(e){return typeof e=="string"}function fj(e,t,n){return e===void 0||dj(e)?t:U({},t,{ownerState:U({},t.ownerState,n)})}const gj={disableDefaultClasses:!1},pj=V.createContext(gj);function hj(e){const{disableDefaultClasses:t}=V.useContext(pj);return n=>t?"":e(n)}function I0(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 Cj(e,t,n){return typeof e=="function"?e(t,n):e}function B0(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 Ej(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:a}=e;if(!t){const m=Xe(i==null?void 0:i.className,r==null?void 0:r.className,a,n==null?void 0:n.className),I=U({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),B=U({},n,i,r);return m.length>0&&(B.className=m),Object.keys(I).length>0&&(B.style=I),{props:B,internalRef:void 0}}const l=I0(U({},i,r)),u=B0(r),A=B0(i),f=t(l),p=Xe(f==null?void 0:f.className,n==null?void 0:n.className,a,i==null?void 0:i.className,r==null?void 0:r.className),C=U({},f==null?void 0:f.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),h=U({},f,n,A,u);return p.length>0&&(h.className=p),Object.keys(C).length>0&&(h.style=C),{props:h,internalRef:f.ref}}const mj=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Ij(e){var t;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:a=!1}=e,l=Ke(e,mj),u=a?{}:Cj(r,i),{props:A,internalRef:f}=Ej(U({},l,{externalSlotProps:u})),p=Bn(f,u==null?void 0:u.ref,(t=e.additionalProps)==null?void 0:t.ref);return fj(n,U({},A,{ref:p}),i)}function Bj(e){const t=rr(e);return t.body===e?oi(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Ls(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function y0(e){return parseInt(oi(e).getComputedStyle(e).paddingRight,10)||0}function yj(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 v0(e,t,n,r,i){const a=[t,n,...r];[].forEach.call(e.children,l=>{const u=a.indexOf(l)===-1,A=!yj(l);u&&A&&Ls(l,i)})}function kd(e,t){let n=-1;return e.some((r,i)=>t(r)?(n=i,!0):!1),n}function vj(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(Bj(r)){const l=pQ(rr(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${y0(r)+l}px`;const u=rr(r).querySelectorAll(".mui-fixed");[].forEach.call(u,A=>{n.push({value:A.style.paddingRight,property:"padding-right",el:A}),A.style.paddingRight=`${y0(A)+l}px`})}let a;if(r.parentNode instanceof DocumentFragment)a=rr(r).body;else{const l=r.parentElement,u=oi(r);a=(l==null?void 0:l.nodeName)==="HTML"&&u.getComputedStyle(l).overflowY==="scroll"?l:r}n.push({value:a.style.overflow,property:"overflow",el:a},{value:a.style.overflowX,property:"overflow-x",el:a},{value:a.style.overflowY,property:"overflow-y",el:a}),a.style.overflow="hidden"}return()=>{n.forEach(({value:a,el:l,property:u})=>{a?l.style.setProperty(u,a):l.style.removeProperty(u)})}}function bj(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class Qj{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&&Ls(t.modalRef,!1);const i=bj(n);v0(n,t.mount,t.modalRef,i,!0);const a=kd(this.containers,l=>l.container===n);return a!==-1?(this.containers[a].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:i}),r)}mount(t,n){const r=kd(this.containers,a=>a.modals.indexOf(t)!==-1),i=this.containers[r];i.restore||(i.restore=vj(i,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const i=kd(this.containers,l=>l.modals.indexOf(t)!==-1),a=this.containers[i];if(a.modals.splice(a.modals.indexOf(t),1),this.modals.splice(r,1),a.modals.length===0)a.restore&&a.restore(),t.modalRef&&Ls(t.modalRef,n),v0(a.container,t.mount,t.modalRef,a.hiddenSiblings,!1),this.containers.splice(i,1);else{const l=a.modals[a.modals.length-1];l.modalRef&&Ls(l.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function xj(e){return typeof e=="function"?e():e}function wj(e){return e?e.props.hasOwnProperty("in"):!1}const Tj=new Qj;function Pj(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=Tj,closeAfterTransition:a=!1,onTransitionEnter:l,onTransitionExited:u,children:A,onClose:f,open:p,rootRef:C}=e,h=V.useRef({}),m=V.useRef(null),I=V.useRef(null),B=Bn(I,C),[v,M]=V.useState(!p),j=wj(A);let x=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(x=!1);const T=()=>rr(m.current),P=()=>(h.current.modalRef=I.current,h.current.mount=m.current,h.current),L=()=>{i.mount(P(),{disableScrollLock:r}),I.current&&(I.current.scrollTop=0)},k=Kr(()=>{const z=xj(t)||T().body;i.add(P(),z),I.current&&L()}),_=V.useCallback(()=>i.isTopModal(P()),[i]),J=Kr(z=>{m.current=z,z&&(p&&_()?L():I.current&&Ls(I.current,x))}),Y=V.useCallback(()=>{i.remove(P(),x)},[x,i]);V.useEffect(()=>()=>{Y()},[Y]),V.useEffect(()=>{p?k():(!j||!a)&&Y()},[p,Y,j,a,k]);const ee=z=>Z=>{var F;(F=z.onKeyDown)==null||F.call(z,Z),!(Z.key!=="Escape"||!_())&&(n||(Z.stopPropagation(),f&&f(Z,"escapeKeyDown")))},le=z=>Z=>{var F;(F=z.onClick)==null||F.call(z,Z),Z.target===Z.currentTarget&&f&&f(Z,"backdropClick")};return{getRootProps:(z={})=>{const Z=I0(e);delete Z.onTransitionEnter,delete Z.onTransitionExited;const F=U({},Z,z);return U({role:"presentation"},F,{onKeyDown:ee(F),ref:B})},getBackdropProps:(z={})=>{const Z=z;return U({"aria-hidden":!0},Z,{onClick:le(Z),open:p})},getTransitionProps:()=>{const z=()=>{M(!1),l&&l()},Z=()=>{M(!0),u&&u(),a&&Y()};return{onEnter:Bu(z,A==null?void 0:A.props.onEnter),onExited:Bu(Z,A==null?void 0:A.props.onExited)}},rootRef:B,portalRef:J,isTopModal:_,exited:v,hasTransition:j}}const Sj=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Oj(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 Mj(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 Dj(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||Mj(e))}function Rj(e){const t=[],n=[];return Array.from(e.querySelectorAll(Sj)).forEach((r,i)=>{const a=Oj(r);a===-1||!Dj(r)||(a===0?t.push(r):n.push({documentOrder:i,tabIndex:a,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(t)}function jj(){return!0}function zl(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:a=Rj,isEnabled:l=jj,open:u}=e,A=V.useRef(!1),f=V.useRef(null),p=V.useRef(null),C=V.useRef(null),h=V.useRef(null),m=V.useRef(!1),I=V.useRef(null),B=Bn(t.ref,I),v=V.useRef(null);V.useEffect(()=>{!u||!I.current||(m.current=!n)},[n,u]),V.useEffect(()=>{if(!u||!I.current)return;const x=rr(I.current);return I.current.contains(x.activeElement)||(I.current.hasAttribute("tabIndex")||(process.env.NODE_ENV!=="production"&&console.error(["MUI: The modal content node does not accept focus.",'For the benefit of assistive technologies, the tabIndex of the node is being set to "-1".'].join(`
205
205
  `)),I.current.setAttribute("tabIndex","-1")),m.current&&I.current.focus()),()=>{i||(C.current&&C.current.focus&&(A.current=!0,C.current.focus()),C.current=null)}},[u]),V.useEffect(()=>{if(!u||!I.current)return;const x=rr(I.current),T=k=>{v.current=k,!(r||!l()||k.key!=="Tab")&&x.activeElement===I.current&&k.shiftKey&&(A.current=!0,p.current&&p.current.focus())},P=()=>{const k=I.current;if(k===null)return;if(!x.hasFocus()||!l()||A.current){A.current=!1;return}if(k.contains(x.activeElement)||r&&x.activeElement!==f.current&&x.activeElement!==p.current)return;if(x.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!m.current)return;let _=[];if((x.activeElement===f.current||x.activeElement===p.current)&&(_=a(I.current)),_.length>0){var J,Y;const ee=!!((J=v.current)!=null&&J.shiftKey&&((Y=v.current)==null?void 0:Y.key)==="Tab"),le=_[0],se=_[_.length-1];typeof le!="string"&&typeof se!="string"&&(ee?se.focus():le.focus())}else k.focus()};x.addEventListener("focusin",P),x.addEventListener("keydown",T,!0);const L=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&P()},50);return()=>{clearInterval(L),x.removeEventListener("focusin",P),x.removeEventListener("keydown",T,!0)}},[n,r,i,l,u,a]);const M=x=>{C.current===null&&(C.current=x.relatedTarget),m.current=!0,h.current=x.target;const T=t.props.onFocus;T&&T(x)},j=x=>{C.current===null&&(C.current=x.relatedTarget),m.current=!0};return g.jsxs(V.Fragment,{children:[g.jsx("div",{tabIndex:u?0:-1,onFocus:j,ref:f,"data-testid":"sentinelStart"}),V.cloneElement(t,{ref:B,onFocus:M}),g.jsx("div",{tabIndex:u?0:-1,onFocus:j,ref:p,"data-testid":"sentinelEnd"})]})}process.env.NODE_ENV!=="production"&&(zl.propTypes={children:ni,disableAutoFocus:c.bool,disableEnforceFocus:c.bool,disableRestoreFocus:c.bool,getTabbable:c.func,isEnabled:c.func,open:c.bool.isRequired}),process.env.NODE_ENV!=="production"&&(zl["propTypes"]=Qa(zl.propTypes));function kj(e){return typeof e=="function"?e():e}const Ns=V.forwardRef(function(t,n){const{children:r,container:i,disablePortal:a=!1}=t,[l,u]=V.useState(null),A=Bn(V.isValidElement(r)?r.ref:null,n);if(ii(()=>{a||u(kj(i)||document.body)},[i,a]),ii(()=>{if(l&&!a)return xa(n,l),()=>{xa(n,null)}},[n,l,a]),a){if(V.isValidElement(r)){const f={ref:A};return V.cloneElement(r,f)}return g.jsx(V.Fragment,{children:r})}return g.jsx(V.Fragment,{children:l&&Fb.createPortal(r,l)})});process.env.NODE_ENV!=="production"&&(Ns.propTypes={children:c.node,container:c.oneOfType([bo,c.func]),disablePortal:c.bool}),process.env.NODE_ENV!=="production"&&(Ns["propTypes"]=Qa(Ns.propTypes));const Fj=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],Lj={entering:{opacity:1},entered:{opacity:1}},b0=V.forwardRef(function(t,n){const r=xt(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:l=!0,children:u,easing:A,in:f,onEnter:p,onEntered:C,onEntering:h,onExit:m,onExited:I,onExiting:B,style:v,timeout:M=i,TransitionComponent:j=UA}=t,x=Ke(t,Fj),T=V.useRef(null),P=Bn(T,u.ref,n),L=q=>K=>{if(q){const z=T.current;K===void 0?q(z):q(z,K)}},k=L(h),_=L((q,K)=>{jd(q);const z=Si({style:v,timeout:M,easing:A},{mode:"enter"});q.style.webkitTransition=r.transitions.create("opacity",z),q.style.transition=r.transitions.create("opacity",z),p&&p(q,K)}),J=L(C),Y=L(B),ee=L(q=>{const K=Si({style:v,timeout:M,easing:A},{mode:"exit"});q.style.webkitTransition=r.transitions.create("opacity",K),q.style.transition=r.transitions.create("opacity",K),m&&m(q)}),le=L(I),se=q=>{a&&a(T.current,q)};return g.jsx(j,U({appear:l,in:f,nodeRef:T,onEnter:_,onEntered:J,onEntering:k,onExit:ee,onExited:le,onExiting:Y,addEndListener:se,timeout:M},x,{children:(q,K)=>V.cloneElement(u,U({style:U({opacity:0,visibility:q==="exited"&&!f?"hidden":void 0},Lj[q],v,u.props.style),ref:P},K))}))});process.env.NODE_ENV!=="production"&&(b0.propTypes={addEndListener:c.func,appear:c.bool,children:ni.isRequired,easing:c.oneOfType([c.shape({enter:c.string,exit:c.string}),c.string]),in:c.bool,onEnter:c.func,onEntered:c.func,onEntering:c.func,onExit:c.func,onExited:c.func,onExiting:c.func,style:c.object,timeout:c.oneOfType([c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});const Nj=b0;function Vj(e){return Vt("MuiBackdrop",e)}Yt("MuiBackdrop",["root","invisible"]);const Hj=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],zj=e=>{const{classes:t,invisible:n}=e;return un({root:["root",n&&"invisible"]},Vj,t)},Wj=ue("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>U({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"})),Q0=V.forwardRef(function(t,n){var r,i,a;const l=Gt({props:t,name:"MuiBackdrop"}),{children:u,className:A,component:f="div",components:p={},componentsProps:C={},invisible:h=!1,open:m,slotProps:I={},slots:B={},TransitionComponent:v=Nj,transitionDuration:M}=l,j=Ke(l,Hj),x=U({},l,{component:f,invisible:h}),T=zj(x),P=(r=I.root)!=null?r:C.root;return g.jsx(v,U({in:m,timeout:M},j,{children:g.jsx(Wj,U({"aria-hidden":!0},P,{as:(i=(a=B.root)!=null?a:p.Root)!=null?i:f,className:Xe(T.root,A,P==null?void 0:P.className),ownerState:U({},x,P==null?void 0:P.ownerState),classes:T,ref:n,children:u}))}))});process.env.NODE_ENV!=="production"&&(Q0.propTypes={children:c.node,classes:c.object,className:c.string,component:c.elementType,components:c.shape({Root:c.elementType}),componentsProps:c.shape({root:c.object}),invisible:c.bool,open:c.bool.isRequired,slotProps:c.shape({root:c.object}),slots:c.shape({root:c.elementType}),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),TransitionComponent:c.elementType,transitionDuration:c.oneOfType([c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});const Uj=Q0;function Yj(e){return Vt("MuiModal",e)}Yt("MuiModal",["root","hidden","backdrop"]);const Gj=["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"],Kj=e=>{const{open:t,exited:n,classes:r}=e;return un({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},Yj,r)},_j=ue("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})=>U({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),Jj=ue(Uj,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),x0=V.forwardRef(function(t,n){var r,i,a,l,u,A;const f=Gt({name:"MuiModal",props:t}),{BackdropComponent:p=Jj,BackdropProps:C,className:h,closeAfterTransition:m=!1,children:I,container:B,component:v,components:M={},componentsProps:j={},disableAutoFocus:x=!1,disableEnforceFocus:T=!1,disableEscapeKeyDown:P=!1,disablePortal:L=!1,disableRestoreFocus:k=!1,disableScrollLock:_=!1,hideBackdrop:J=!1,keepMounted:Y=!1,onBackdropClick:ee,open:le,slotProps:se,slots:q}=f,K=Ke(f,Gj),z=U({},f,{closeAfterTransition:m,disableAutoFocus:x,disableEnforceFocus:T,disableEscapeKeyDown:P,disablePortal:L,disableRestoreFocus:k,disableScrollLock:_,hideBackdrop:J,keepMounted:Y}),{getRootProps:Z,getBackdropProps:F,getTransitionProps:te,portalRef:W,isTopModal:X,exited:de,hasTransition:ge}=Pj(U({},z,{rootRef:n})),ce=U({},z,{exited:de}),Ae=Kj(ce),pe={};if(I.props.tabIndex===void 0&&(pe.tabIndex="-1"),ge){const{onEnter:ze,onExited:fe}=te();pe.onEnter=ze,pe.onExited=fe}const Ie=(r=(i=q==null?void 0:q.root)!=null?i:M.Root)!=null?r:_j,Ee=(a=(l=q==null?void 0:q.backdrop)!=null?l:M.Backdrop)!=null?a:p,he=(u=se==null?void 0:se.root)!=null?u:j.root,me=(A=se==null?void 0:se.backdrop)!=null?A:j.backdrop,xe=ur.useSlotProps({elementType:Ie,externalSlotProps:he,externalForwardedProps:K,getSlotProps:Z,additionalProps:{ref:n,as:v},ownerState:ce,className:Xe(h,he==null?void 0:he.className,Ae==null?void 0:Ae.root,!ce.open&&ce.exited&&(Ae==null?void 0:Ae.hidden))}),ae=ur.useSlotProps({elementType:Ee,externalSlotProps:me,additionalProps:C,getSlotProps:ze=>F(U({},ze,{onClick:fe=>{ee&&ee(fe),ze!=null&&ze.onClick&&ze.onClick(fe)}})),className:Xe(me==null?void 0:me.className,C==null?void 0:C.className,Ae==null?void 0:Ae.backdrop),ownerState:ce});return!Y&&!le&&(!ge||de)?null:g.jsx(Ns,{ref:W,container:B,disablePortal:L,children:g.jsxs(Ie,U({},xe,{children:[!J&&p?g.jsx(Ee,U({},ae)):null,g.jsx(zl,{disableEnforceFocus:T,disableAutoFocus:x,disableRestoreFocus:k,isEnabled:X,open:le,children:V.cloneElement(I,pe)})]}))})});process.env.NODE_ENV!=="production"&&(x0.propTypes={BackdropComponent:c.elementType,BackdropProps:c.object,children:ni.isRequired,classes:c.object,className:c.string,closeAfterTransition:c.bool,component:c.elementType,components:c.shape({Backdrop:c.elementType,Root:c.elementType}),componentsProps:c.shape({backdrop:c.oneOfType([c.func,c.object]),root:c.oneOfType([c.func,c.object])}),container:c.oneOfType([bo,c.func]),disableAutoFocus:c.bool,disableEnforceFocus:c.bool,disableEscapeKeyDown:c.bool,disablePortal:c.bool,disableRestoreFocus:c.bool,disableScrollLock:c.bool,hideBackdrop:c.bool,keepMounted:c.bool,onBackdropClick:c.func,onClose:c.func,onTransitionEnter:c.func,onTransitionExited:c.func,open:c.bool.isRequired,slotProps:c.shape({backdrop:c.oneOfType([c.func,c.object]),root:c.oneOfType([c.func,c.object])}),slots:c.shape({backdrop:c.elementType,root:c.elementType}),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object])});const Xj=x0;var Fd={},Zj=rj;Object.defineProperty(Fd,"__esModule",{value:!0});var w0=Fd.default=void 0,qj=Zj(ij()),$j=g,ek=(0,qj.default)((0,$j.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");w0=Fd.default=ek;const tk=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function Ld(e){return`scale(${e}, ${e**2})`}const nk={entering:{opacity:1,transform:Ld(1)},entered:{opacity:1,transform:"none"}},Nd=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Vd=V.forwardRef(function(t,n){const{addEndListener:r,appear:i=!0,children:a,easing:l,in:u,onEnter:A,onEntered:f,onEntering:p,onExit:C,onExited:h,onExiting:m,style:I,timeout:B="auto",TransitionComponent:v=UA}=t,M=Ke(t,tk),j=V.useRef(),x=V.useRef(),T=xt(),P=V.useRef(null),L=Bn(P,a.ref,n),k=K=>z=>{if(K){const Z=P.current;z===void 0?K(Z):K(Z,z)}},_=k(p),J=k((K,z)=>{jd(K);const{duration:Z,delay:F,easing:te}=Si({style:I,timeout:B,easing:l},{mode:"enter"});let W;B==="auto"?(W=T.transitions.getAutoHeightDuration(K.clientHeight),x.current=W):W=Z,K.style.transition=[T.transitions.create("opacity",{duration:W,delay:F}),T.transitions.create("transform",{duration:Nd?W:W*.666,delay:F,easing:te})].join(","),A&&A(K,z)}),Y=k(f),ee=k(m),le=k(K=>{const{duration:z,delay:Z,easing:F}=Si({style:I,timeout:B,easing:l},{mode:"exit"});let te;B==="auto"?(te=T.transitions.getAutoHeightDuration(K.clientHeight),x.current=te):te=z,K.style.transition=[T.transitions.create("opacity",{duration:te,delay:Z}),T.transitions.create("transform",{duration:Nd?te:te*.666,delay:Nd?Z:Z||te*.333,easing:F})].join(","),K.style.opacity=0,K.style.transform=Ld(.75),C&&C(K)}),se=k(h),q=K=>{B==="auto"&&(j.current=setTimeout(K,x.current||0)),r&&r(P.current,K)};return V.useEffect(()=>()=>{clearTimeout(j.current)},[]),g.jsx(v,U({appear:i,in:u,nodeRef:P,onEnter:J,onEntered:Y,onEntering:_,onExit:le,onExited:se,onExiting:ee,addEndListener:q,timeout:B==="auto"?null:B},M,{children:(K,z)=>V.cloneElement(a,U({style:U({opacity:0,transform:Ld(.75),visibility:K==="exited"&&!u?"hidden":void 0},nk[K],I,a.props.style),ref:L},z))}))});process.env.NODE_ENV!=="production"&&(Vd.propTypes={addEndListener:c.func,appear:c.bool,children:ni.isRequired,easing:c.oneOfType([c.shape({enter:c.string,exit:c.string}),c.string]),in:c.bool,onEnter:c.func,onEntered:c.func,onEntering:c.func,onExit:c.func,onExited:c.func,onExiting:c.func,style:c.object,timeout:c.oneOfType([c.oneOf(["auto"]),c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])}),Vd.muiSupportAuto=!0;const T0=Vd;var dn="top",Wn="bottom",Un="right",fn="left",Hd="auto",Vs=[dn,Wn,Un,fn],Oi="start",Hs="end",rk="clippingParents",P0="viewport",zs="popper",ok="reference",S0=Vs.reduce(function(e,t){return e.concat([t+"-"+Oi,t+"-"+Hs])},[]),O0=[].concat(Vs,[Hd]).reduce(function(e,t){return e.concat([t,t+"-"+Oi,t+"-"+Hs])},[]),ik="beforeRead",sk="read",ak="afterRead",lk="beforeMain",ck="main",uk="afterMain",Ak="beforeWrite",dk="write",fk="afterWrite",gk=[ik,sk,ak,lk,ck,uk,Ak,dk,fk];function pr(e){return e?(e.nodeName||"").toLowerCase():null}function bn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Fo(e){var t=bn(e).Element;return e instanceof t||e instanceof Element}function Yn(e){var t=bn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function zd(e){if(typeof ShadowRoot>"u")return!1;var t=bn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function pk(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},a=t.elements[n];!Yn(a)||!pr(a)||(Object.assign(a.style,r),Object.keys(i).forEach(function(l){var u=i[l];u===!1?a.removeAttribute(l):a.setAttribute(l,u===!0?"":u)}))})}function hk(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],a=t.attributes[r]||{},l=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=l.reduce(function(A,f){return A[f]="",A},{});!Yn(i)||!pr(i)||(Object.assign(i.style,u),Object.keys(a).forEach(function(A){i.removeAttribute(A)}))})}}const Ck={name:"applyStyles",enabled:!0,phase:"write",fn:pk,effect:hk,requires:["computeStyles"]};function hr(e){return e.split("-")[0]}var Lo=Math.max,Wl=Math.min,Mi=Math.round;function Wd(){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 M0(){return!/^((?!chrome|android).)*safari/i.test(Wd())}function Di(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&Yn(e)&&(i=e.offsetWidth>0&&Mi(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Mi(r.height)/e.offsetHeight||1);var l=Fo(e)?bn(e):window,u=l.visualViewport,A=!M0()&&n,f=(r.left+(A&&u?u.offsetLeft:0))/i,p=(r.top+(A&&u?u.offsetTop:0))/a,C=r.width/i,h=r.height/a;return{width:C,height:h,top:p,right:f+C,bottom:p+h,left:f,x:f,y:p}}function Ud(e){var t=Di(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 D0(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&zd(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function jr(e){return bn(e).getComputedStyle(e)}function Ek(e){return["table","td","th"].indexOf(pr(e))>=0}function so(e){return((Fo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ul(e){return pr(e)==="html"?e:e.assignedSlot||e.parentNode||(zd(e)?e.host:null)||so(e)}function R0(e){return!Yn(e)||jr(e).position==="fixed"?null:e.offsetParent}function mk(e){var t=/firefox/i.test(Wd()),n=/Trident/i.test(Wd());if(n&&Yn(e)){var r=jr(e);if(r.position==="fixed")return null}var i=Ul(e);for(zd(i)&&(i=i.host);Yn(i)&&["html","body"].indexOf(pr(i))<0;){var a=jr(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function Ws(e){for(var t=bn(e),n=R0(e);n&&Ek(n)&&jr(n).position==="static";)n=R0(n);return n&&(pr(n)==="html"||pr(n)==="body"&&jr(n).position==="static")?t:n||mk(e)||t}function Yd(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Us(e,t,n){return Lo(e,Wl(t,n))}function Ik(e,t,n){var r=Us(e,t,n);return r>n?n:r}function j0(){return{top:0,right:0,bottom:0,left:0}}function k0(e){return Object.assign({},j0(),e)}function F0(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Bk=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,k0(typeof t!="number"?t:F0(t,Vs))};function yk(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,l=n.modifiersData.popperOffsets,u=hr(n.placement),A=Yd(u),f=[fn,Un].indexOf(u)>=0,p=f?"height":"width";if(!(!a||!l)){var C=Bk(i.padding,n),h=Ud(a),m=A==="y"?dn:fn,I=A==="y"?Wn:Un,B=n.rects.reference[p]+n.rects.reference[A]-l[A]-n.rects.popper[p],v=l[A]-n.rects.reference[A],M=Ws(a),j=M?A==="y"?M.clientHeight||0:M.clientWidth||0:0,x=B/2-v/2,T=C[m],P=j-h[p]-C[I],L=j/2-h[p]/2+x,k=Us(T,L,P),_=A;n.modifiersData[r]=(t={},t[_]=k,t.centerOffset=k-L,t)}}function vk(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||D0(t.elements.popper,i)&&(t.elements.arrow=i))}const bk={name:"arrow",enabled:!0,phase:"main",fn:yk,effect:vk,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ri(e){return e.split("-")[1]}var Qk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function xk(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Mi(n*i)/i||0,y:Mi(r*i)/i||0}}function L0(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,l=e.offsets,u=e.position,A=e.gpuAcceleration,f=e.adaptive,p=e.roundOffsets,C=e.isFixed,h=l.x,m=h===void 0?0:h,I=l.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 M=l.hasOwnProperty("x"),j=l.hasOwnProperty("y"),x=fn,T=dn,P=window;if(f){var L=Ws(n),k="clientHeight",_="clientWidth";if(L===bn(n)&&(L=so(n),jr(L).position!=="static"&&u==="absolute"&&(k="scrollHeight",_="scrollWidth")),L=L,i===dn||(i===fn||i===Un)&&a===Hs){T=Wn;var J=C&&L===P&&P.visualViewport?P.visualViewport.height:L[k];B-=J-r.height,B*=A?1:-1}if(i===fn||(i===dn||i===Wn)&&a===Hs){x=Un;var Y=C&&L===P&&P.visualViewport?P.visualViewport.width:L[_];m-=Y-r.width,m*=A?1:-1}}var ee=Object.assign({position:u},f&&Qk),le=p===!0?xk({x:m,y:B},bn(n)):{x:m,y:B};if(m=le.x,B=le.y,A){var se;return Object.assign({},ee,(se={},se[T]=j?"0":"",se[x]=M?"0":"",se.transform=(P.devicePixelRatio||1)<=1?"translate("+m+"px, "+B+"px)":"translate3d("+m+"px, "+B+"px, 0)",se))}return Object.assign({},ee,(t={},t[T]=j?B+"px":"",t[x]=M?m+"px":"",t.transform="",t))}function wk(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,l=a===void 0?!0:a,u=n.roundOffsets,A=u===void 0?!0:u,f={placement:hr(t.placement),variation:Ri(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,L0(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:A})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,L0(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Tk={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:wk,data:{}};var Yl={passive:!0};function Pk(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,l=r.resize,u=l===void 0?!0:l,A=bn(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&f.forEach(function(p){p.addEventListener("scroll",n.update,Yl)}),u&&A.addEventListener("resize",n.update,Yl),function(){a&&f.forEach(function(p){p.removeEventListener("scroll",n.update,Yl)}),u&&A.removeEventListener("resize",n.update,Yl)}}const Sk={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Pk,data:{}};var Ok={left:"right",right:"left",bottom:"top",top:"bottom"};function Gl(e){return e.replace(/left|right|bottom|top/g,function(t){return Ok[t]})}var Mk={start:"end",end:"start"};function N0(e){return e.replace(/start|end/g,function(t){return Mk[t]})}function Gd(e){var t=bn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Kd(e){return Di(so(e)).left+Gd(e).scrollLeft}function Dk(e,t){var n=bn(e),r=so(e),i=n.visualViewport,a=r.clientWidth,l=r.clientHeight,u=0,A=0;if(i){a=i.width,l=i.height;var f=M0();(f||!f&&t==="fixed")&&(u=i.offsetLeft,A=i.offsetTop)}return{width:a,height:l,x:u+Kd(e),y:A}}function Rk(e){var t,n=so(e),r=Gd(e),i=(t=e.ownerDocument)==null?void 0:t.body,a=Lo(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),l=Lo(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+Kd(e),A=-r.scrollTop;return jr(i||n).direction==="rtl"&&(u+=Lo(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:l,x:u,y:A}}function _d(e){var t=jr(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function V0(e){return["html","body","#document"].indexOf(pr(e))>=0?e.ownerDocument.body:Yn(e)&&_d(e)?e:V0(Ul(e))}function Ys(e,t){var n;t===void 0&&(t=[]);var r=V0(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=bn(r),l=i?[a].concat(a.visualViewport||[],_d(r)?r:[]):r,u=t.concat(l);return i?u:u.concat(Ys(Ul(l)))}function Jd(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function jk(e,t){var n=Di(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 H0(e,t,n){return t===P0?Jd(Dk(e,n)):Fo(t)?jk(t,n):Jd(Rk(so(e)))}function kk(e){var t=Ys(Ul(e)),n=["absolute","fixed"].indexOf(jr(e).position)>=0,r=n&&Yn(e)?Ws(e):e;return Fo(r)?t.filter(function(i){return Fo(i)&&D0(i,r)&&pr(i)!=="body"}):[]}function Fk(e,t,n,r){var i=t==="clippingParents"?kk(e):[].concat(t),a=[].concat(i,[n]),l=a[0],u=a.reduce(function(A,f){var p=H0(e,f,r);return A.top=Lo(p.top,A.top),A.right=Wl(p.right,A.right),A.bottom=Wl(p.bottom,A.bottom),A.left=Lo(p.left,A.left),A},H0(e,l,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function z0(e){var t=e.reference,n=e.element,r=e.placement,i=r?hr(r):null,a=r?Ri(r):null,l=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,A;switch(i){case dn:A={x:l,y:t.y-n.height};break;case Wn:A={x:l,y:t.y+t.height};break;case Un:A={x:t.x+t.width,y:u};break;case fn:A={x:t.x-n.width,y:u};break;default:A={x:t.x,y:t.y}}var f=i?Yd(i):null;if(f!=null){var p=f==="y"?"height":"width";switch(a){case Oi:A[f]=A[f]-(t[p]/2-n[p]/2);break;case Hs:A[f]=A[f]+(t[p]/2-n[p]/2);break}}return A}function Gs(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,l=a===void 0?e.strategy:a,u=n.boundary,A=u===void 0?rk:u,f=n.rootBoundary,p=f===void 0?P0:f,C=n.elementContext,h=C===void 0?zs:C,m=n.altBoundary,I=m===void 0?!1:m,B=n.padding,v=B===void 0?0:B,M=k0(typeof v!="number"?v:F0(v,Vs)),j=h===zs?ok:zs,x=e.rects.popper,T=e.elements[I?j:h],P=Fk(Fo(T)?T:T.contextElement||so(e.elements.popper),A,p,l),L=Di(e.elements.reference),k=z0({reference:L,element:x,strategy:"absolute",placement:i}),_=Jd(Object.assign({},x,k)),J=h===zs?_:L,Y={top:P.top-J.top+M.top,bottom:J.bottom-P.bottom+M.bottom,left:P.left-J.left+M.left,right:J.right-P.right+M.right},ee=e.modifiersData.offset;if(h===zs&&ee){var le=ee[i];Object.keys(Y).forEach(function(se){var q=[Un,Wn].indexOf(se)>=0?1:-1,K=[dn,Wn].indexOf(se)>=0?"y":"x";Y[se]+=le[K]*q})}return Y}function Lk(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,l=n.padding,u=n.flipVariations,A=n.allowedAutoPlacements,f=A===void 0?O0:A,p=Ri(r),C=p?u?S0:S0.filter(function(I){return Ri(I)===p}):Vs,h=C.filter(function(I){return f.indexOf(I)>=0});h.length===0&&(h=C);var m=h.reduce(function(I,B){return I[B]=Gs(e,{placement:B,boundary:i,rootBoundary:a,padding:l})[hr(B)],I},{});return Object.keys(m).sort(function(I,B){return m[I]-m[B]})}function Nk(e){if(hr(e)===Hd)return[];var t=Gl(e);return[N0(e),t,N0(t)]}function Vk(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0?!0:i,l=n.altAxis,u=l===void 0?!0:l,A=n.fallbackPlacements,f=n.padding,p=n.boundary,C=n.rootBoundary,h=n.altBoundary,m=n.flipVariations,I=m===void 0?!0:m,B=n.allowedAutoPlacements,v=t.options.placement,M=hr(v),j=M===v,x=A||(j||!I?[Gl(v)]:Nk(v)),T=[v].concat(x).reduce(function(ce,Ae){return ce.concat(hr(Ae)===Hd?Lk(t,{placement:Ae,boundary:p,rootBoundary:C,padding:f,flipVariations:I,allowedAutoPlacements:B}):Ae)},[]),P=t.rects.reference,L=t.rects.popper,k=new Map,_=!0,J=T[0],Y=0;Y<T.length;Y++){var ee=T[Y],le=hr(ee),se=Ri(ee)===Oi,q=[dn,Wn].indexOf(le)>=0,K=q?"width":"height",z=Gs(t,{placement:ee,boundary:p,rootBoundary:C,altBoundary:h,padding:f}),Z=q?se?Un:fn:se?Wn:dn;P[K]>L[K]&&(Z=Gl(Z));var F=Gl(Z),te=[];if(a&&te.push(z[le]<=0),u&&te.push(z[Z]<=0,z[F]<=0),te.every(function(ce){return ce})){J=ee,_=!1;break}k.set(ee,te)}if(_)for(var W=I?3:1,X=function(Ae){var pe=T.find(function(Ie){var Ee=k.get(Ie);if(Ee)return Ee.slice(0,Ae).every(function(he){return he})});if(pe)return J=pe,"break"},de=W;de>0;de--){var ge=X(de);if(ge==="break")break}t.placement!==J&&(t.modifiersData[r]._skip=!0,t.placement=J,t.reset=!0)}}const Hk={name:"flip",enabled:!0,phase:"main",fn:Vk,requiresIfExists:["offset"],data:{_skip:!1}};function W0(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 U0(e){return[dn,Un,Wn,fn].some(function(t){return e[t]>=0})}function zk(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,l=Gs(t,{elementContext:"reference"}),u=Gs(t,{altBoundary:!0}),A=W0(l,r),f=W0(u,i,a),p=U0(A),C=U0(f);t.modifiersData[n]={referenceClippingOffsets:A,popperEscapeOffsets:f,isReferenceHidden:p,hasPopperEscaped:C},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":C})}const Wk={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zk};function Uk(e,t,n){var r=hr(e),i=[fn,dn].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,l=a[0],u=a[1];return l=l||0,u=(u||0)*i,[fn,Un].indexOf(r)>=0?{x:u,y:l}:{x:l,y:u}}function Yk(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,l=O0.reduce(function(p,C){return p[C]=Uk(C,t.rects,a),p},{}),u=l[t.placement],A=u.x,f=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=A,t.modifiersData.popperOffsets.y+=f),t.modifiersData[r]=l}const Gk={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Yk};function Kk(e){var t=e.state,n=e.name;t.modifiersData[n]=z0({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const _k={name:"popperOffsets",enabled:!0,phase:"read",fn:Kk,data:{}};function Jk(e){return e==="x"?"y":"x"}function Xk(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,l=n.altAxis,u=l===void 0?!1:l,A=n.boundary,f=n.rootBoundary,p=n.altBoundary,C=n.padding,h=n.tether,m=h===void 0?!0:h,I=n.tetherOffset,B=I===void 0?0:I,v=Gs(t,{boundary:A,rootBoundary:f,padding:C,altBoundary:p}),M=hr(t.placement),j=Ri(t.placement),x=!j,T=Yd(M),P=Jk(T),L=t.modifiersData.popperOffsets,k=t.rects.reference,_=t.rects.popper,J=typeof B=="function"?B(Object.assign({},t.rects,{placement:t.placement})):B,Y=typeof J=="number"?{mainAxis:J,altAxis:J}:Object.assign({mainAxis:0,altAxis:0},J),ee=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,le={x:0,y:0};if(L){if(a){var se,q=T==="y"?dn:fn,K=T==="y"?Wn:Un,z=T==="y"?"height":"width",Z=L[T],F=Z+v[q],te=Z-v[K],W=m?-_[z]/2:0,X=j===Oi?k[z]:_[z],de=j===Oi?-_[z]:-k[z],ge=t.elements.arrow,ce=m&&ge?Ud(ge):{width:0,height:0},Ae=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:j0(),pe=Ae[q],Ie=Ae[K],Ee=Us(0,k[z],ce[z]),he=x?k[z]/2-W-Ee-pe-Y.mainAxis:X-Ee-pe-Y.mainAxis,me=x?-k[z]/2+W+Ee+Ie+Y.mainAxis:de+Ee+Ie+Y.mainAxis,xe=t.elements.arrow&&Ws(t.elements.arrow),ae=xe?T==="y"?xe.clientTop||0:xe.clientLeft||0:0,ze=(se=ee==null?void 0:ee[T])!=null?se:0,fe=Z+he-ze-ae,ct=Z+me-ze,Ht=Us(m?Wl(F,fe):F,Z,m?Lo(te,ct):te);L[T]=Ht,le[T]=Ht-Z}if(u){var mt,Tt=T==="x"?dn:fn,Er=T==="x"?Wn:Un,bt=L[P],It=P==="y"?"height":"width",At=bt+v[Tt],Ft=bt-v[Er],Lt=[dn,fn].indexOf(M)!==-1,Se=(mt=ee==null?void 0:ee[P])!=null?mt:0,ke=Lt?At:bt-k[It]-_[It]-Se+Y.altAxis,we=Lt?bt+k[It]+_[It]-Se-Y.altAxis:Ft,We=m&&Lt?Ik(ke,bt,we):Us(m?ke:At,bt,m?we:Ft);L[P]=We,le[P]=We-bt}t.modifiersData[r]=le}}const Zk={name:"preventOverflow",enabled:!0,phase:"main",fn:Xk,requiresIfExists:["offset"]};function qk(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function $k(e){return e===bn(e)||!Yn(e)?Gd(e):qk(e)}function e5(e){var t=e.getBoundingClientRect(),n=Mi(t.width)/e.offsetWidth||1,r=Mi(t.height)/e.offsetHeight||1;return n!==1||r!==1}function t5(e,t,n){n===void 0&&(n=!1);var r=Yn(t),i=Yn(t)&&e5(t),a=so(t),l=Di(e,i,n),u={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(r||!r&&!n)&&((pr(t)!=="body"||_d(a))&&(u=$k(t)),Yn(t)?(A=Di(t,!0),A.x+=t.clientLeft,A.y+=t.clientTop):a&&(A.x=Kd(a))),{x:l.left+u.scrollLeft-A.x,y:l.top+u.scrollTop-A.y,width:l.width,height:l.height}}function n5(e){var t=new Map,n=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function i(a){n.add(a.name);var l=[].concat(a.requires||[],a.requiresIfExists||[]);l.forEach(function(u){if(!n.has(u)){var A=t.get(u);A&&i(A)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||i(a)}),r}function r5(e){var t=n5(e);return gk.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function o5(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function i5(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Y0={placement:"bottom",modifiers:[],strategy:"absolute"};function G0(){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 s5(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?Y0:i;return function(u,A,f){f===void 0&&(f=a);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},Y0,a),modifiersData:{},elements:{reference:u,popper:A},attributes:{},styles:{}},C=[],h=!1,m={state:p,setOptions:function(M){var j=typeof M=="function"?M(p.options):M;B(),p.options=Object.assign({},a,p.options,j),p.scrollParents={reference:Fo(u)?Ys(u):u.contextElement?Ys(u.contextElement):[],popper:Ys(A)};var x=r5(i5([].concat(r,p.options.modifiers)));return p.orderedModifiers=x.filter(function(T){return T.enabled}),I(),m.update()},forceUpdate:function(){if(!h){var M=p.elements,j=M.reference,x=M.popper;if(G0(j,x)){p.rects={reference:t5(j,Ws(x),p.options.strategy==="fixed"),popper:Ud(x)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(Y){return p.modifiersData[Y.name]=Object.assign({},Y.data)});for(var T=0;T<p.orderedModifiers.length;T++){if(p.reset===!0){p.reset=!1,T=-1;continue}var P=p.orderedModifiers[T],L=P.fn,k=P.options,_=k===void 0?{}:k,J=P.name;typeof L=="function"&&(p=L({state:p,options:_,name:J,instance:m})||p)}}}},update:o5(function(){return new Promise(function(v){m.forceUpdate(),v(p)})}),destroy:function(){B(),h=!0}};if(!G0(u,A))return m;m.setOptions(f).then(function(v){!h&&f.onFirstUpdate&&f.onFirstUpdate(v)});function I(){p.orderedModifiers.forEach(function(v){var M=v.name,j=v.options,x=j===void 0?{}:j,T=v.effect;if(typeof T=="function"){var P=T({state:p,name:M,instance:m,options:x}),L=function(){};C.push(P||L)}})}function B(){C.forEach(function(v){return v()}),C=[]}return m}}var a5=[Sk,_k,Tk,Ck,Gk,Hk,Zk,bk,Wk],l5=s5({defaultModifiers:a5});function c5(e){return Vt("MuiPopper",e)}Yt("MuiPopper",["root"]);const u5=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],A5=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function d5(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 Kl(e){return typeof e=="function"?e():e}function _l(e){return e.nodeType!==void 0}function f5(e){return!_l(e)}const g5=()=>un({root:["root"]},hj(c5)),p5={},h5=V.forwardRef(function(t,n){var r;const{anchorEl:i,children:a,direction:l,disablePortal:u,modifiers:A,open:f,placement:p,popperOptions:C,popperRef:h,slotProps:m={},slots:I={},TransitionProps:B}=t,v=Ke(t,u5),M=V.useRef(null),j=Bn(M,n),x=V.useRef(null),T=Bn(x,h),P=V.useRef(T);ii(()=>{P.current=T},[T]),V.useImperativeHandle(h,()=>x.current,[]);const L=d5(p,l),[k,_]=V.useState(L),[J,Y]=V.useState(Kl(i));V.useEffect(()=>{x.current&&x.current.forceUpdate()}),V.useEffect(()=>{i&&Y(Kl(i))},[i]),ii(()=>{if(!J||!f)return;const K=F=>{_(F.placement)};if(process.env.NODE_ENV!=="production"&&J&&_l(J)&&J.nodeType===1){const F=J.getBoundingClientRect();process.env.NODE_ENV!=="test"&&F.top===0&&F.left===0&&F.right===0&&F.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(`