@applica-software-guru/react-admin 1.3.127 → 1.3.128

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
  `),q5)),_5=le("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),$5=le("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Pe(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>z({stroke:"currentColor"},e.variant==="determinate"&&{transition:t.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&Xt.css(JI||(JI=su`
201
201
  animation: ${0} 1.4s ease-in-out infinite;
202
- `),J5)),uv=D.forwardRef(function(t,n){const r=Yt({props:t,name:"MuiCircularProgress"}),{className:i,color:s="primary",disableShrink:l=!1,size:u=40,style:A,thickness:g=3.6,value:p=0,variant:C="indeterminate"}=r,h=Ke(r,K5),I=z({},r,{color:s,disableShrink:l,size:u,thickness:g,value:p,variant:C}),E=X5(I),B={},y={},R={};if(C==="determinate"){const M=2*Math.PI*((ro-g)/2);B.strokeDasharray=M.toFixed(3),R["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*M).toFixed(3)}px`,y.transform="rotate(-90deg)"}return f.jsx(Z5,z({className:Je(E.root,i),style:z({width:u,height:u},y,A),ownerState:I,ref:n,role:"progressbar"},R,h,{children:f.jsx(_5,{className:E.svg,ownerState:I,viewBox:`${ro/2} ${ro/2} ${ro} ${ro}`,children:f.jsx($5,{className:E.circle,style:B,ownerState:I,cx:ro,cy:ro,r:(ro-g)/2,fill:"none",strokeWidth:g})})}))});process.env.NODE_ENV!=="production"&&(uv.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 gf=uv;function e8(e){return Vt("MuiLoadingButton",e)}const t8=Ut("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),Dr=t8,n8=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],r8=e=>{const{loading:t,loadingPosition:n,classes:r}=e,i={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Pe(n)}`],endIcon:[t&&`endIconLoading${Pe(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Pe(n)}`]},s=Ir.unstable_composeClasses(i,e8,r);return z({},r,s)},o8=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",i8=le(Y5,{shouldForwardProp:e=>o8(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Dr.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Dr.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>z({[`& .${Dr.startIconLoadingStart}, & .${Dr.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}),[`&.${Dr.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Dr.startIconLoadingStart}, & .${Dr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Dr.startIconLoadingStart}, & .${Dr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),s8=le("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Pe(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>z({position:"absolute",visibility:"visible",display:"flex"},t.loadingPosition==="start"&&(t.variant==="outlined"||t.variant==="contained")&&{left:t.size==="small"?10:14},t.loadingPosition==="start"&&t.variant==="text"&&{left:6},t.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},t.loadingPosition==="end"&&(t.variant==="outlined"||t.variant==="contained")&&{right:t.size==="small"?10:14},t.loadingPosition==="end"&&t.variant==="text"&&{right:6},t.loadingPosition==="start"&&t.fullWidth&&{position:"relative",left:-10},t.loadingPosition==="end"&&t.fullWidth&&{position:"relative",right:-10})),Av=D.forwardRef(function(t,n){const r=Yt({props:t,name:"MuiLoadingButton"}),{children:i,disabled:s=!1,id:l,loading:u=!1,loadingIndicator:A,loadingPosition:g="center",variant:p="text"}=r,C=Ke(r,n8),h=mg(l),I=A??f.jsx(gf,{"aria-labelledby":h,color:"inherit",size:16}),E=z({},r,{disabled:s,loading:u,loadingIndicator:I,loadingPosition:g,variant:p}),B=r8(E),y=u?f.jsx(s8,{className:B.loadingIndicator,ownerState:E,children:I}):null;return f.jsxs(i8,z({disabled:s||u,id:h,ref:n},C,{variant:p,classes:B,ownerState:E,children:[E.loadingPosition==="end"?i:y,E.loadingPosition==="end"?y:i]}))});process.env.NODE_ENV!=="production"&&(Av.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 a8=Av;function fd({variant:e,theme:t,color:n,loadingPosition:r}){const i=rn(t,n),{lighter:s,main:l,dark:u,contrastText:A}=i,g=`${n}Button`,p=ss(t,g),C={"& .MuiLoadingButton-loadingIndicator":{color:l}},h={...r&&r!=="center"&&{color:l}},I={"&::after":{boxShadow:`0 0 6px 6px ${He(l,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${He(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},...I};case"light":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...I};case"shadow":return{boxShadow:p,backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{boxShadow:"none",backgroundColor:u,color:A},...I};case"outlined":return{backgroundColor:"transparent",borderColor:l,...h,...C};case"dashed":return{backgroundColor:s,borderColor:l,...h,...C,...I};case"text":default:return{color:l,...C,...I}}}const l8=le(a8,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:i,loadingPosition:s})=>({"::after":{content:'""',display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:n==="rounded"?"50%":4,opacity:0,transition:"all 0.5s"},":active::after":{position:"absolute",borderRadius:n==="rounded"?"50%":4,left:0,top:0,opacity:1,transition:"0s"},...t==="text"&&{...fd({variant:t,theme:e,color:r,loadingPosition:s}),"&.MuiButton-sizeMedium":{height:36},"&.MuiButton-sizeSmall":{height:30},"&.MuiButton-sizeLarge":{height:44}},...n&&{minWidth:0,"&.MuiButton-sizeMedium":{width:36,height:36},"&.MuiButton-sizeSmall":{width:30,height:30},"&.MuiButton-sizeLarge":{width:44,height:44},...n==="rounded"&&{borderRadius:"50%"}},...t==="outlined"&&{border:"1px solid"},...t==="dashed"&&{border:"1px dashed"},...(t==="contained"||t==="shadow")&&!i&&{color:"#fff"},...t!=="text"&&{...fd({variant:t,theme:e,color:r,loadingPosition:s})},"&.Mui-disabled":{...t!=="text"&&{...fd({variant:t,theme:e,color:r,loadingPosition:s})}}})),ff=T.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...i},s)=>{const l=Tt();return f.jsx(l8,{ref:s,variant:e,shape:t,theme:l,loadingPosition:i.loadingPosition,loading:i.loading,color:r,...i,children:n})});ff.propTypes={variant:c.string,shape:c.string,children:c.node,color:c.string};ff.displayName="LoadingButton";function c8({color:e,theme:t,labelColor:n}){const r=rn(t,e),{main:i,contrastText:s}=r;let l=e||"";return["primary","secondary","info","success","warning","error"].includes(l)?{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:i,color:n||s},[`& .${b.tooltipClasses.arrow}`]:{color:i}}:{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:l,color:n||s,boxShadow:t.shadows[1]},[`& .${b.tooltipClasses.arrow}`]:{color:l}}}const u8=le(({className:e,...t})=>f.jsx(b.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&c8({color:t,theme:e,labelColor:n})}));function dv({children:e,arrow:t,labelColor:n="",...r}){const i=Tt();return f.jsx(b.Box,{display:"flex",children:f.jsx(u8,{arrow:t,...r,theme:i,labelColor:n,children:e})})}dv.propTypes={children:c.element,arrow:c.bool,labelColor:c.string,rest:c.array};const Eo=T.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...i},s)=>{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 f.jsxs(b.Box,{ref:s,children:[n==="grow"&&f.jsx(b.Grow,{...i,timeout:{appear:0,enter:150,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="collapse"&&f.jsx(b.Collapse,{...i,sx:l,children:e}),n==="fade"&&f.jsx(b.Fade,{...i,timeout:{appear:0,enter:300,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="slide"&&f.jsx(b.Slide,{...i,timeout:{appear:0,enter:150,exit:150},direction:r,children:f.jsx(b.Box,{sx:l,children:e})}),n==="zoom"&&f.jsx(b.Zoom,{...i,children:f.jsx(b.Box,{sx:l,children:e})})]})});Eo.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"])};T.forwardRef(function(t,n){return f.jsx(b.Zoom,{ref:n,timeout:200,...t})});function gv({value:e,...t}){return f.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[f.jsx(b.CircularProgress,{variant:"determinate",value:e,...t}),f.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(e)}%`})})]})}gv.propTypes={value:c.number};function fv({value:e,size:t,variant:n,thickness:r,showLabel:i,pathColor:s,sx:l,...u}){return f.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[f.jsx(b.CircularProgress,{variant:"determinate",sx:{color:s||"grey.200"},size:t,thickness:r,...u,value:100}),i&&f.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:e?`${Math.round(e)}%`:"0%"})}),f.jsx(b.CircularProgress,{variant:n,sx:{...l,position:"absolute",left:0,[`& .${b.circularProgressClasses.circle}`]:{strokeLinecap:"round"}},size:t,thickness:r,value:e,...u})]})}fv.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 pv({icon:e,value:t,...n}){return f.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(b.Box,{sx:{width:"100%",mr:1},children:f.jsx(b.LinearProgress,{variant:"determinate",value:t,...n})}),f.jsx(b.Box,{sx:{minWidth:35},children:e})]})}pv.propTypes={icon:c.node,value:c.number};function hv({value:e,...t}){return f.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(b.Box,{sx:{width:"100%",mr:1},children:f.jsx(b.LinearProgress,{variant:"determinate",value:e,...t})}),f.jsx(b.Box,{sx:{minWidth:35},children:f.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:`${Math.round(e)}%`})})]})}hv.propTypes={value:c.number};const Cv=T.createContext({});function A8(e){const{useDefaults:t=!1,queryOptions:n={}}=e,r=O.useResourceContext(),i=O.useDataProvider(),{search:s}=ia.useLocation(),l=`${r}/new`,u=T.useCallback(()=>{if(!t||!Ce.isFunction(i.get))return Promise.resolve({});const h={};return new URLSearchParams(s??"").forEach((I,E)=>{h[E]=I}),i.get(l,h).then(I=>I.data).then(I=>{const{responseCode:E,value:B}=I;return E==="ok"?B:Promise.reject(I)})},[r,t,s,i]),A=T.useMemo(()=>Ce.chain(n).extend({queryKey:[r,s],queryFn:u}).value(),[r,s,u,n]),{data:g,isLoading:p}=pg.useQuery(A),C=Ce.omit(e,["useDefaults"]);return p?f.jsx(b.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:f.jsx(b.CircularProgress,{})}):f.jsx(Cv.Provider,{value:g??{},children:f.jsx(O.Create,{...C})})}function d8(){return T.useContext(Cv)}const g8=le(A8,{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"}})),f8=ba(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)}})),Kr=e=>f.jsx(f8,{...e});Kr.defaultProps={...O.Toolbar.defaultProps};Kr.propTypes={...O.Toolbar.propTypes};const pf=({children:e,content:t,title:n,subheader:r,secondary:i,toolbar:s,...l})=>{const u=O.useTranslate(),A=O.useResourceContext(),{cardTitle:g,cardSubheader:p}=T.useMemo(()=>{const C=n||`resources.${A}.title`;return{cardTitle:u(C,{_:C}),cardSubheader:r!==null?u(r,{_:r}):null}},[A,r,n,u]);return f.jsx(b.Grid,{item:!0,...l,children:f.jsx(ur,{content:t,title:g,subheader:p,secondary:i,divider:!0,children:f.jsxs(T.Fragment,{children:[e,s===!0?f.jsx(Kr,{children:f.jsx(O.SaveButton,{})}):s]})})})};pf.defaultProps={...b.Grid.defaultProps,content:!0,subheader:null,title:null,secondary:null,toolbar:!1,item:!0,lg:12,md:12,sm:12,xs:12};pf.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 p8=le(O.Form,{name:"RaApplicaCardForm",slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*2),padding:0}})),au=({children:e,spacing:t,defaultValues:n,...r})=>{const{spacing:i}=Dn();return f.jsx(p8,{defaultValues:n,spacing:t||i,children:f.jsx(b.Grid,{container:!0,...r,spacing:t||i,children:e})})};au.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};au.defaultProps={...b.Stack.defaultProps};au.Section=pf;const h8=ba(O.SimpleForm,{name:"RaApplicaSimpleForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:1)},[e.breakpoints.down("sm")]:{paddingBottom:0}})),lu=({title:e,modal:t,content:n,subheader:r,secondary:i,sx:s,...l})=>{const u=w0(e),A=O.useRecordContext();return f.jsx(ur,{content:n,title:u,subheader:r,secondary:A!=null&&A.id?i:null,sx:{...s,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!t,divider:!0,children:f.jsx(h8,{toolbar:f.jsx(Kr,{}),...l})})};lu.defaultProps={modal:!1,content:!1,subheader:null,title:null,toolbar:f.jsx(Kr,{children:f.jsx(O.SaveButton,{type:"button"})}),secondary:f.jsx(os,{children:f.jsx(O.DeleteWithConfirmButton,{})})};lu.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 cu=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:s,divider:l,...u})=>{const A=Xt.useTheme(),{getCurrentDialog:g}=ni(),{source:p,resource:C,isRequired:h}=u,{getFieldState:I,formState:E}=Ba.useFormContext(),{error:B}=I(p,E),y=g();return f.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&&s!==!1&&f.jsx(b.InputLabel,{error:!!B,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(O.FieldTitle,{label:e,source:p,resource:y||C,isRequired:h})}),T.isValidElement(t)?T.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&f.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:!!B,children:r})]})};cu.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};cu.defaultProps={display:"label",divider:!1};const C8=le(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%"}}})),m8=({label:e,addLabel:t,source:n,helperText:r,divider:i=!0,...s})=>f.jsx(cu,{label:e,addLabel:t,source:n,helperText:r,divider:i,children:f.jsx(C8,{source:n,label:!1,...s})}),hf=({canEdit:e,canDelete:t,canClone:n})=>!e&&!t&&!n?null:f.jsxs(os,{children:[e&&f.jsx(O.EditButton,{}),t&&f.jsx(O.DeleteWithConfirmButton,{}),n&&f.jsx(O.CloneButton,{})]});hf.defaultProps={canEdit:!0,canDelete:!0,canClone:!1};hf.propTypes={canEdit:c.bool,canDelete:c.bool,canClone:c.bool};const XI=le("div",{name:"ApplicaBaseAttachmentField",overridesResolver:(e,t)=>t.root})({display:"inline-block"}),I8=le("ul")({display:"inline-block"}),mv=e=>{var p;const{className:t,emptyText:n,source:r,title:i,...s}=e,l=me.useRecordContext(e),u=ut.get(l,r),A=me.useTranslate();if(!u)return n?f.jsx(b.Typography,{component:"span",variant:"body2",className:t,...s,children:n&&A(n,{_:n})}):f.jsx(XI,{className:t,...s});if(Array.isArray(u))return f.jsx(I8,{className:t,...s,children:u.map((C,h)=>{var E;const I=i instanceof String?(E=ut.get(C,i))==null?void 0:E.toString():i;return f.jsx("li",{children:I},h)})});const g=i instanceof String?(p=ut.get(l,i))==null?void 0:p.toString():i;return f.jsx(XI,{className:t,...s,children:g})};mv.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 Iv={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Kn,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",l="second",u="minute",A="hour",g="day",p="week",C="month",h="quarter",I="year",E="date",B="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Z){var K=["th","st","nd","rd"],V=Z%100;return"["+Z+(K[(V-20)%10]||K[V]||K[0])+"]"}},x=function(Z,K,V){var G=String(Z);return!G||G.length>=K?Z:""+Array(K+1-G.length).join(V)+Z},S={s:x,z:function(Z){var K=-Z.utcOffset(),V=Math.abs(K),G=Math.floor(V/60),F=V%60;return(K<=0?"+":"-")+x(G,2,"0")+":"+x(F,2,"0")},m:function Z(K,V){if(K.date()<V.date())return-Z(V,K);var G=12*(V.year()-K.year())+(V.month()-K.month()),F=K.clone().add(G,C),$=V-F<0,W=K.clone().add(G+($?-1:1),C);return+(-(G+(V-F)/($?F-W:W-F))||0)},a:function(Z){return Z<0?Math.ceil(Z)||0:Math.floor(Z)},p:function(Z){return{M:C,y:I,w:p,d:g,D:E,h:A,m:u,s:l,ms:s,Q:h}[Z]||String(Z||"").toLowerCase().replace(/s$/,"")},u:function(Z){return Z===void 0}},P="en",L={};L[P]=M;var k="$isDayjsObject",q=function(Z){return Z instanceof ae||!(!Z||!Z[k])},J=function Z(K,V,G){var F;if(!K)return P;if(typeof K=="string"){var $=K.toLowerCase();L[$]&&(F=$),V&&(L[$]=V,F=$);var W=K.split("-");if(!F&&W.length>1)return Z(W[0])}else{var X=K.name;L[X]=K,F=X}return!G&&F&&(P=F),F||!G&&P},Y=function(Z,K){if(q(Z))return Z.clone();var V=typeof K=="object"?K:{};return V.date=Z,V.args=arguments,new ae(V)},ee=S;ee.l=J,ee.i=q,ee.w=function(Z,K){return Y(Z,{locale:K.$L,utc:K.$u,x:K.$x,$offset:K.$offset})};var ae=function(){function Z(V){this.$L=J(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[k]=!0}var K=Z.prototype;return K.parse=function(V){this.$d=function(G){var F=G.date,$=G.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(y);if(W){var X=W[2]-1||0,Ae=(W[7]||"0").substring(0,3);return $?new Date(Date.UTC(W[1],X,W[3]||1,W[4]||0,W[5]||0,W[6]||0,Ae)):new Date(W[1],X,W[3]||1,W[4]||0,W[5]||0,W[6]||0,Ae)}}return new Date(F)}(V),this.init()},K.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},K.$utils=function(){return ee},K.isValid=function(){return this.$d.toString()!==B},K.isSame=function(V,G){var F=Y(V);return this.startOf(G)<=F&&F<=this.endOf(G)},K.isAfter=function(V,G){return Y(V)<this.startOf(G)},K.isBefore=function(V,G){return this.endOf(G)<Y(V)},K.$g=function(V,G,F){return ee.u(V)?this[G]:this.set(F,V)},K.unix=function(){return Math.floor(this.valueOf()/1e3)},K.valueOf=function(){return this.$d.getTime()},K.startOf=function(V,G){var F=this,$=!!ee.u(G)||G,W=ee.p(V),X=function(pe,Ee){var xe=ee.w(F.$u?Date.UTC(F.$y,Ee,pe):new Date(F.$y,Ee,pe),F);return $?xe:xe.endOf(g)},Ae=function(pe,Ee){return ee.w(F.toDate()[pe].apply(F.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(Ee)),F)},ge=this.$W,ce=this.$M,ue=this.$D,fe="set"+(this.$u?"UTC":"");switch(W){case I:return $?X(1,0):X(31,11);case C:return $?X(1,ce):X(0,ce+1);case p:var Be=this.$locale().weekStart||0,Ie=(ge<Be?ge+7:ge)-Be;return X($?ue-Ie:ue+(6-Ie),ce);case g:case E:return Ae(fe+"Hours",0);case A:return Ae(fe+"Minutes",1);case u:return Ae(fe+"Seconds",2);case l:return Ae(fe+"Milliseconds",3);default:return this.clone()}},K.endOf=function(V){return this.startOf(V,!1)},K.$set=function(V,G){var F,$=ee.p(V),W="set"+(this.$u?"UTC":""),X=(F={},F[g]=W+"Date",F[E]=W+"Date",F[C]=W+"Month",F[I]=W+"FullYear",F[A]=W+"Hours",F[u]=W+"Minutes",F[l]=W+"Seconds",F[s]=W+"Milliseconds",F)[$],Ae=$===g?this.$D+(G-this.$W):G;if($===C||$===I){var ge=this.clone().set(E,1);ge.$d[X](Ae),ge.init(),this.$d=ge.set(E,Math.min(this.$D,ge.daysInMonth())).$d}else X&&this.$d[X](Ae);return this.init(),this},K.set=function(V,G){return this.clone().$set(V,G)},K.get=function(V){return this[ee.p(V)]()},K.add=function(V,G){var F,$=this;V=Number(V);var W=ee.p(G),X=function(ce){var ue=Y($);return ee.w(ue.date(ue.date()+Math.round(ce*V)),$)};if(W===C)return this.set(C,this.$M+V);if(W===I)return this.set(I,this.$y+V);if(W===g)return X(1);if(W===p)return X(7);var Ae=(F={},F[u]=r,F[A]=i,F[l]=n,F)[W]||1,ge=this.$d.getTime()+V*Ae;return ee.w(ge,this)},K.subtract=function(V,G){return this.add(-1*V,G)},K.format=function(V){var G=this,F=this.$locale();if(!this.isValid())return F.invalidDate||B;var $=V||"YYYY-MM-DDTHH:mm:ssZ",W=ee.z(this),X=this.$H,Ae=this.$m,ge=this.$M,ce=F.weekdays,ue=F.months,fe=F.meridiem,Be=function(Ee,xe,se,We){return Ee&&(Ee[xe]||Ee(G,$))||se[xe].slice(0,We)},Ie=function(Ee){return ee.s(X%12||12,Ee,"0")},pe=fe||function(Ee,xe,se){var We=Ee<12?"AM":"PM";return se?We.toLowerCase():We};return $.replace(R,function(Ee,xe){return xe||function(se){switch(se){case"YY":return String(G.$y).slice(-2);case"YYYY":return ee.s(G.$y,4,"0");case"M":return ge+1;case"MM":return ee.s(ge+1,2,"0");case"MMM":return Be(F.monthsShort,ge,ue,3);case"MMMM":return Be(ue,ge);case"D":return G.$D;case"DD":return ee.s(G.$D,2,"0");case"d":return String(G.$W);case"dd":return Be(F.weekdaysMin,G.$W,ce,2);case"ddd":return Be(F.weekdaysShort,G.$W,ce,3);case"dddd":return ce[G.$W];case"H":return String(X);case"HH":return ee.s(X,2,"0");case"h":return Ie(1);case"hh":return Ie(2);case"a":return pe(X,Ae,!0);case"A":return pe(X,Ae,!1);case"m":return String(Ae);case"mm":return ee.s(Ae,2,"0");case"s":return String(G.$s);case"ss":return ee.s(G.$s,2,"0");case"SSS":return ee.s(G.$ms,3,"0");case"Z":return W}return null}(Ee)||W.replace(":","")})},K.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},K.diff=function(V,G,F){var $,W=this,X=ee.p(G),Ae=Y(V),ge=(Ae.utcOffset()-this.utcOffset())*r,ce=this-Ae,ue=function(){return ee.m(W,Ae)};switch(X){case I:$=ue()/12;break;case C:$=ue();break;case h:$=ue()/3;break;case p:$=(ce-ge)/6048e5;break;case g:$=(ce-ge)/864e5;break;case A:$=ce/i;break;case u:$=ce/r;break;case l:$=ce/n;break;default:$=ce}return F?$:ee.a($)},K.daysInMonth=function(){return this.endOf(C).$D},K.$locale=function(){return L[this.$L]},K.locale=function(V,G){if(!V)return this.$L;var F=this.clone(),$=J(V,G,!0);return $&&(F.$L=$),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()},Z}(),oe=ae.prototype;return Y.prototype=oe,[["$ms",s],["$s",l],["$m",u],["$H",A],["$W",g],["$M",C],["$y",I],["$D",E]].forEach(function(Z){oe[Z[1]]=function(K){return this.$g(K,Z[0],Z[1])}}),Y.extend=function(Z,K){return Z.$i||(Z(K,ae,Y),Z.$i=!0),Y},Y.locale=J,Y.isDayjs=q,Y.unix=function(Z){return Y(1e3*Z)},Y.en=L[P],Y.Ls=L,Y.p={},Y})})(Iv);var E8=Iv.exports;const Ur=ts(E8),Cf=({entityId:e,property:t,disabled:n,userResource:r="entities/user",...i})=>{const[s,l]=T.useState(null),u=O.useRecordContext(i),A=O.useDataProvider(),g=O.useResourceContext(),p=T.useCallback(async I=>{I.preventDefault(),I.stopPropagation();const E=ut.get(u,i==null?void 0:i.source),B=g.replace("entities/",""),y=await A.getFile(`/attachments/${B}/${e||(u==null?void 0:u.id)}/${t||(i==null?void 0:i.source)}/${(E==null?void 0:E.id)||(u==null?void 0:u.id)}`),R=document.createElement("a");R.href=y,R.download=ut.get(u,(i==null?void 0:i.title)||(i==null?void 0:i.source)),R.click()},[A,u,e,g,t,i==null?void 0:i.source,i==null?void 0:i.title]),C=T.useMemo(()=>({...u,[i==null?void 0:i.source]:(u==null?void 0:u.src)||ut.get(u,i==null?void 0:i.source),[i==null?void 0:i.title]:(u==null?void 0:u.title)||ut.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 T.useEffect(()=>{!u||!(u!=null&&u.userId)||A.getOne(r,{id:u==null?void 0:u.userId}).then(({data:I})=>l(I)).catch(()=>l(null))},[u,A,r]),f.jsx(mv,{...i,disabled:n,record:C,onClick:p,title:f.jsxs(b.Box,{sx:{cursor:"pointer"},children:[f.jsx(b.Typography,{variant:"subtitle1",children:ut.get(C,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),f.jsxs(b.Typography,{variant:"caption",color:"secondary",children:[ut.get(C,"sizeDescription"),s&&" | ",s&&h("ra.attachment.info",{user:s==null?void 0:s.name,created:Ur(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})};Cf.propTypes={...O.FileField.propTypes,source:c.string,title:c.string,disabled:c.bool};const B8=le(O.ImageField,{name:"RaApplicaImageField",slot:"root"})(()=>({})),Sa=e=>{const t=`_${e==null?void 0:e.source}`;return f.jsx(B8,{...e,source:t})};Sa.propTypes={...O.ImageField.propTypes,source:c.string};const uu=({width:e,height:t,circle:n,justify:r,record:i,...s})=>{const l=T.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 f.jsx(Sa,{sx:g=>({margin:0,display:"flex",justifyContent:r,"& img":{margin:"0px !important",border:`1px solid ${g.palette.divider}`,objectFit:"cover !important",...l,minWidth:l.width,minHeight:l.height}}),...s,record:A})};uu.defaultProps={...Sa.defaultProps,width:150,height:150,circle:!1,justify:"flex-start"};uu.propTypes={...Sa.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 Ev={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Kn,function(){return function(n,r,i){n=n||{};var s=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(g,p,C,h){return s.fromToBase(g,p,C,h)}i.en.relativeTime=l,s.fromToBase=function(g,p,C,h,I){for(var E,B,y,R=C.$locale().relativeTime||l,M=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],x=M.length,S=0;S<x;S+=1){var P=M[S];P.d&&(E=h?i(g).diff(C,P.d,!0):C.diff(g,P.d,!0));var L=(n.rounding||Math.round)(Math.abs(E));if(y=E>0,L<=P.r||!P.r){L<=1&&S>0&&(P=M[S-1]);var k=R[P.l];I&&(L=I(""+L)),B=typeof k=="string"?k.replace("%d",L):k(L,p,P.l,y);break}}if(p)return B;var q=y?R.future:R.past;return typeof q=="function"?q(B):q.replace("%s",B)},s.to=function(g,p){return u(g,p,this,!0)},s.from=function(g,p){return u(g,p,this)};var A=function(g){return g.$u?i.utc():i()};s.toNow=function(g){return this.to(A(this),g)},s.fromNow=function(g){return this.from(A(this),g)}}})})(Ev);var v8=Ev.exports;const y8=ts(v8);Ur.extend(y8);const Au=e=>{const t=O.useRecordContext(e),[n]=O.useLocaleState(),r=T.useMemo(()=>Ur(ut.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return f.jsxs(T.Fragment,{children:[f.jsx(O.DateField,{record:t,source:e.source,showTime:!0}),f.jsx("br",{}),f.jsx(b.Typography,{variant:"caption",color:"textSecondary",children:r})]})};Au.displayName="DateAgoField";Au.propTypes={source:c.string.isRequired};const Bv=le(O.DateField,{name:"RaApplicaDateField",slot:"Root"})(()=>({}));Bv.propTypes={...O.DateField.propTypes};const mf=e=>f.jsx(Bv,{...e});mf.defaultProps={...O.DateField.defaultProps,variant:"body1"};mf.propTypes={...O.DateField.propTypes};const vv=le(O.EmailField,{name:"RaApplicaEmailField",slot:"Root"})(()=>({}));vv.propTypes={...O.EmailField.propTypes};const If=e=>f.jsx(vv,{...e});If.defaultProps={...O.EmailField.defaultProps,variant:"body1"};If.propTypes={...O.EmailField.propTypes};const b8=le(O.FileField,{name:"RaApplicaFileField",slot:"root"})(()=>({})),Ef=({...e})=>{const t=O.useRecordContext(e),n=T.useCallback(r=>{r.preventDefault(),r.stopPropagation();const i=ut.get(t,`_${e==null?void 0:e.source}`,ut.get(t,e==null?void 0:e.source)),s=ut.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=s,l.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return f.jsx(b8,{...e,record:t,onClick:n})};Ef.propTypes={...O.FileField.propTypes,source:c.string,title:c.string};const yv=e=>f.jsx(O.FunctionField,{...e});yv.defaultProps={variant:"body1"};const Q8=le("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"}})),Bf=({source:e,defaultValue:t,...n})=>{const r=O.useRecordContext(n),i=ut.get(r,e,t);return f.jsx("span",{dangerouslySetInnerHTML:{__html:i&&i!==null?i:t}})};Bf.propTypes={defaultValue:c.any,source:c.string,record:c.object};Bf.defaultProps={defaultValue:"&nbsp;"};const bv=({title:e,children:t})=>e&&e!==!1?f.jsx(b.Tooltip,{title:e,placement:"top",children:t}):t;bv.propTypes={title:c.oneOfType([c.string,c.bool]),children:c.oneOfType([c.element,c.arrayOf(c.element)])};const vf=({label:e,source:t,defaultValue:n,children:r,tooltip:i,...s})=>{const{getCurrentDialog:l}=ni(),u=O.useRecordContext(s),A=O.useResourceContext(s),g=l(),p=T.useMemo(()=>!i||i===!1?!1:typeof i=="function"?i(u):typeof i=="string"?ut.get(u,i,i):i,[u,i]);return f.jsx(bv,{title:p,children:f.jsxs(T.Fragment,{children:[f.jsx(b.InputLabel,{children:f.jsx(O.FieldTitle,{label:e,source:t,resource:g||A})}),f.jsx(Q8,{...s,children:T.cloneElement(r,{source:t,record:u,defaultValue:n,resource:g||A})})]})})};vf.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};vf.defaultProps={defaultValue:"&nbsp;",children:f.jsx(Bf,{})};const x8=ba("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}}})),as=e=>f.jsx(x8,{children:f.jsx(O.ReferenceManyField,{pagination:f.jsx(O.Pagination,{}),...e})});as.defaultProps={...O.ReferenceManyField.defaultProps,margin:!1,border:!1};as.propTypes={...O.ReferenceManyField.propTypes,margin:c.bool,border:c.bool};const Qv=({source:e,...t})=>{const n=O.useRecordContext(t),r=ut.get(n,e,0),i=r/1024,s=i/1024,l=s/1024,u=l>1?`${l.toFixed(2)} GB`:s>1?`${s.toFixed(2)} MB`:i>1?`${i.toFixed(2)} KB`:`${r.toFixed(2)} B`;return f.jsx(b.Typography,{component:"span",variant:"body1",...t,children:u})};Qv.propTypes={record:c.object,source:c.string};const xv=le(O.TextField,{name:"RaApplicaTextField",slot:"Root"})(()=>({}));xv.propTypes={...O.TextField.propTypes};const yf=e=>f.jsx(xv,{...e});yf.defaultProps={...O.TextField.defaultProps,variant:"body1"};yf.propTypes={...O.TextField.propTypes};const at=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:s,divider:l,...u})=>{const A=Xt.useTheme(),{getCurrentDialog:g}=ni(),{source:p,resource:C,isRequired:h}=u,{fieldState:{invalid:I}}=O.useInput(u),E=g();return f.jsxs(b.Stack,{spacing:1,sx:{width:u!=null&&u.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:I?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:I===!0,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(O.FieldTitle,{label:e,source:p,resource:E||C,isRequired:h})}),T.isValidElement(t)?T.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&f.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:I===!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 w8=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},T8=le(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}},...w8(e)})),bf=({children:e,disabled:t,type:n,...r})=>{const i=O.useRecordContext(r),s=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}),f.jsx(at,{...r,children:f.jsx(T8,{disabled:t,children:T.cloneElement(e,{...e.props,entityId:l,property:s})})})};bf.propTypes={...O.FileInput.propTypes,children:c.node,multiple:c.bool,disabled:c.bool};bf.defaultProps={children:f.jsx(Cf,{title:"name",source:"path"}),multiple:!0,disabled:!1,type:"attachment"};const P8=le(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"}})),Qf=({...e})=>f.jsx(at,{...e,children:f.jsx(P8,{})});Qf.propTypes={...O.AutocompleteArrayInput.propTypes,...at.propTypes};Qf.defaultProps={...O.AutocompleteArrayInput.defaultProps,size:"small"};const S8=le(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"}})),xf=e=>{const{perPage:t,...n}=e;return f.jsx(at,{...n,children:f.jsx(S8,{})})};xf.propTypes={...O.AutocompleteInput.propTypes,...at.propTypes};xf.defaultProps={...O.AutocompleteInput.defaultProps,size:"small"};const R8=le(O.BooleanInput,{name:"RaApplicaBooleanInput",slot:"Root"})(()=>({})),wf=({horizontal:e,...t})=>{const n=Tt();return f.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:f.jsx(R8,{})})};wf.defaultProps={...O.BooleanInput.defaultProps,...at.defaultProps};wf.propTypes={...O.BooleanInput.propTypes,...at.propTypes,horizontal:c.bool};const O8=le(O.DateInput,{name:"RaApplicaDateInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Tf=e=>f.jsx(at,{...e,children:f.jsx(O8,{})});Tf.propTypes={...O.DateInput.propTypes,...at.propTypes};Tf.defaultProps={...O.DateInput.defaultProps,...at.defaultProps};const j8=le(O.DateTimeInput,{name:"RaApplicaDateTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Pf=e=>f.jsx(at,{...e,children:f.jsx(j8,{})});Pf.propTypes={...O.DateTimeInput.propTypes,...at.propTypes};Pf.defaultProps={...at.defaultProps};const M8=le(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}}})),Sf=({children:e,title:t,...n})=>{const r=Ba.useWatch({name:n.source}),i=O.useRecordContext(n),{source:s}=n,l=T.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const u=ut.get(i,s);if(u){const A=u.split("__");return A.length>0?A[A.length-1]:u}return u},[i,s,r]);return f.jsx(at,{...n,children:f.jsx(M8,{children:T.cloneElement(e,{...e.props,title:t||s,source:s,record:{...i,[s]:(r==null?void 0:r.title)||ut.get(i,s),[`_${s}`]:(r==null?void 0:r.src)||ut.get(i,`_${s}`),[t||s]:l}})})})};Sf.propTypes={...O.FileInput.propTypes,source:c.string,title:c.string,children:c.node};Sf.defaultProps={children:f.jsx(Ef,{})};const Rf=({children:e,title:t,...n})=>{const r=Ba.useWatch({name:n.source}),i=O.useRecordContext(n),{source:s}=n;return O.useInput({source:`__image__${n==null?void 0:n.source}`,defaultValue:n==null?void 0:n.source}),f.jsx(at,{...n,children:f.jsx(O.ImageInput,{accept:"image/*",children:T.cloneElement(e,{...e.props,title:t,source:s,record:{...i,[s]:(r==null?void 0:r.title)||ut.get(i,s),[`_${s}`]:(r==null?void 0:r.src)||ut.get(i,`_${s}`)}})})})};Rf.defaultProps={children:f.jsx(uu,{}),multiple:!1};Rf.propTypes={...O.ImageInput.propTypes,source:c.string,title:c.string,children:c.node,multiple:c.bool};const D8=le(O.NumberInput,{name:"RaApplicaNumberInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Of=e=>f.jsx(at,{...e,children:f.jsx(D8,{})});Of.propTypes={...O.NumberInput.propTypes,...at.propTypes};Of.defaultProps={...O.NumberInput.defaultProps,...at.defaultProps};const wv=({source:e,minWidth:t=300,children:n})=>{const r=O.useResourceContext(),i=O.useRecordContext(),[s,l]=T.useState(ut.get(i,e,"")),[u,A]=T.useState(!1),g=T.useCallback(E=>l(E.target.value),[]),p=O.useDataProvider(),C=T.useCallback(E=>{E.key==="Enter"&&(A(!0),p.update(r,{id:i.id,data:{...i,[e]:s,_changed:e}}).then(()=>A(!1)))},[s,p,r,i,e]),h=T.useCallback(()=>{ut.get(i,e)!==s&&(A(!0),p.update(r,{id:i.id,data:{...i,[e]:s,_changed:e}}).then(()=>A(!1)))},[s,p,r,e,i]),I=T.useCallback(E=>{A(!0),p.update(r,{id:i.id,data:{...i,[e]:E,_changed:e}}).then(()=>A(!1))},[p,r,e,i]);return T.useEffect(()=>l(ut.get(i,e)),[i,e]),n?T.cloneElement(n,{...n.props,source:e,value:s,onChange:I}):f.jsx(b.TextField,{value:s,disabled:u,onChange:g,onKeyPress:C,onBlur:h,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})};wv.propTypes={source:c.string.isRequired,minWidth:c.number,children:c.element};const jf=({children:e,...t})=>f.jsx(O.ReferenceArrayInput,{...t,children:T.cloneElement(e,{...t,source:e.props.source||t.source})});jf.propTypes={...O.ReferenceArrayInput.propTypes,children:c.element};jf.defaultProps={...O.ReferenceArrayInput.defaultProps};const Mf=({children:e,...t})=>f.jsx(O.ReferenceInput,{...t,children:T.cloneElement(e,{...t,source:e.props.source||t.source})});Mf.propTypes={...O.ReferenceInput.propTypes,children:c.element};Mf.defaultProps={...O.ReferenceInput.defaultProps};const Df=({reference:e,target:t,children:n,filters:r,actions:i,...s})=>f.jsx(O.ResourceContextProvider,{value:e,children:f.jsx(as,{perPage:5,pagination:f.jsx(O.Pagination,{}),...s,reference:e,target:t,children:f.jsxs(T.Fragment,{children:[f.jsx(O.ListToolbar,{filters:r,actions:i}),n]})})});Df.propTypes={...as.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])};Df.defaultProps={...as.defaultProps};const k8=le(O.SearchInput,{name:"RaApplicaSearchInput",slot:"root"})(()=>({})),F8=e=>f.jsx(k8,{...e}),Tv=le(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"}}));Tv.propTypes={...O.SelectArrayInput.propTypes};const kf=e=>f.jsx(at,{...e,children:f.jsx(Tv,{options:{autoWidth:!1}})});kf.defaultProps={optionText:"name",optionValue:"id"};kf.propTypes={...O.SelectArrayInput.propTypes,...at.propTypes};const L8=le(O.SelectInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}})),Pv=e=>f.jsx(at,{...e,children:f.jsx(L8,{})});Pv.propTypes={...O.SelectInput.propTypes,...at.propTypes};const qn=e=>f.jsx(at,{...e,children:f.jsx(O.TextInput,{})});qn.propTypes={...O.TextInput.propTypes,...at.propTypes};const du=({...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=Ba.useController({name:e==null?void 0:e.source}))==null?void 0:u.field)==null?void 0:A.value;let i=e.helperText,s=e.validate;s?Array.isArray(s)&&s.indexOf(n)===-1&&s.push(n):s=[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),f.jsx(qn,{...e,validate:s,helperText:i,inputProps:{maxLength:e==null?void 0:e.maxLength}})};du.displayName="SmartTextInput";du.defaultProps={multiline:!1};du.propTypes={...qn.propTypes,maxLength:c.number,multiline:c.bool,rows:c.number};const Sv=e=>{const t=e.split(":");t.length===1&&t.push("00");const n=parseInt(t[0]),r=parseInt(t[1]);return Ur().hour(n).minute(r)};function N8(){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 V8=e=>{if(!e)return"";const t=Sv(e);return t?t.format("HH:mm"):""},H8=e=>e,W8=le(O.TimeInput,{name:"RaApplicaTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Ff=e=>f.jsx(at,{...e,children:f.jsx(W8,{})});Ff.defaultProps={...O.TimeInput.defaultProps,format:V8,parse:H8};Ff.propTypes={...O.TimeInput.propTypes,...at.propTypes};const Lf=({onSuccess:e,firstAccess:t})=>{const{spacing:n}=Dn(),[r,i]=T.useState(!1),s=me.useAuthProvider(),l=me.useTranslate(),u=me.useNotify(),A=T.useCallback(g=>{const{oldPassword:p,newPassword:C}=g;i(!0),s==null||s.changePassword(p,C).then(()=>{u("ra.auth.password_changed"),e()}).catch(h=>u(h,{type:"error"})).finally(()=>i(!1))},[s,e]);return f.jsx(me.ResourceContextProvider,{value:"user/change-password",children:f.jsx(me.EditContextProvider,{value:{record:{},resource:"user/change-password",save:A},children:f.jsx(lu,{onSubmit:A,toolbar:f.jsx(Kr,{children:f.jsx(O.SaveButton,{disabled:r})}),children:f.jsxs(b.Grid,{container:!0,spacing:n,children:[t===!0&&f.jsx(b.Grid,{item:!0,xs:12,children:f.jsxs(b.Alert,{severity:"warning",children:[f.jsx(b.AlertTitle,{children:l("ra.auth.first_access.change_password")}),l("ra.auth.first_access.change_password_helper")]})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(qn,{source:"oldPassword",type:"password",validate:me.required()})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(qn,{source:"newPassword",type:"password",validate:me.required()})})]})})})})},z8=le(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"}})),U8=le(b.CardHeader)(({theme:e})=>({marginTop:e.spacing(4),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),Y8=le(b.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`})),Nf=({title:e,divider:t,variant:n})=>{const r=O.useTranslate();return f.jsxs(T.Fragment,{children:[f.jsx(U8,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&f.jsx(Y8,{})]})};Nf.propTypes={title:c.string.isRequired,divider:c.bool,variant:c.oneOf(["h1","h2","h3","h4","h5","h6"])};Nf.defaultProps={divider:!0,variant:"h4"};const G8=le(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)}}}));function Rv(e){const{spacing:t}=Dn(),{spacing:n=t}=e,r=Ce.omit(e,["spacing"]);return f.jsx(O.Form,{...r,children:f.jsx(G8,{container:!0,spacing:n*2,children:e.children})})}function tg(e){return e.id??e.label}function Ov(e,t){return t.match(new RegExp(`^${e}`))!==null}function K8(e){return Ce.map(e,"id")}function Qc(e){const t=e.match(new RegExp("[^.]+","g"));return t===null?0:t.length}function jv(e,t){const n=e!==void 0?Qc(e):0;return Ce.chain(t).filter(i=>e!==void 0?Ov(e,i.id):!0).filter(i=>Qc(i.id)===n+1).value()}function q8(e,t){var s;const n=Ce.clone(e),{type:r,payload:i}=t;switch(r){case"setFormRootPath":return Ce.extend(n,{formRootPath:i});case"setSyncWithLocation":return Ce.extend(n,{syncWithLocation:i});case"setActiveItem":return Ce.includes(K8(e.items),i)?Ce.extend(n,{activeItem:i}):n;case"addItem":{const l=i.id,u=Ce.chain(n.items).clone().reject(A=>A.id===l).concat([i]).orderBy(A=>A.index).value();return Ce.extend(n,{items:u}),n.activeItem===void 0&&Ce.extend(n,{activeItem:i.id}),n}case"removeItem":{const l=Ce.isString(i)?i:i.id,u=Ce.chain(n.items).clone().reject(A=>A.id===l).value();return Ce.extend(n,{items:u}),n.activeItem===l&&Ce.extend(n,{activeItem:((s=Ce.first(u))==null?void 0:s.id)??void 0}),n}default:return n}}const J8={syncWithLocation:!0,items:[],activeItem:void 0},Mv=T.createContext(void 0);function Dv(e){const t=!!(e.syncWithLocation??!0),{rootMatchString:n}=e,{pathname:r}=ia.useLocation(),[i,s]=T.useReducer(q8,Ce.cloneDeep(J8)),{formRootPath:l,items:u}=i,A=T.useMemo(()=>({state:i,dispatch:s}),[i,s]);return T.useEffect(()=>{const g=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/show/*",":resource/:id/show/*","entities/:resource/:id/*",":resource/:id/*"];n!==void 0&&g.push(n);const p=Ce.chain(g).map(h=>ia.matchPath(h,r)).reject(h=>h===null).first().value(),C=p==null?void 0:p.pathnameBase;C!==void 0&&C!==l&&s({type:"setFormRootPath",payload:C})},[r,l,n]),T.useEffect(()=>{s({type:"setSyncWithLocation",payload:!!t})},[t,s]),T.useEffect(()=>{var g;if(t&&l!==void 0){let p=r.replace(l,"").replace(new RegExp(/^\/?/),"");Ce.isEmpty(p)&&(p=((g=Ce.chain(u).filter(C=>jv(C.id,u).length===0).orderBy([C=>Qc(C.id),C=>C.index]).first().value())==null?void 0:g.id)??void 0),s({type:"setActiveItem",payload:p})}},[s,l,r,u]),f.jsx(Mv.Provider,{value:A,children:e.children})}function kv(){const e=T.useContext(Mv);if(e===void 0)throw new Error("[LongForm] useFormContext: context undefined. Please provide a valid Context using LongForm.Provider");return e}function gu(){return kv().state}function Vf(){return kv().dispatch}function Fv(){return gu().formRootPath}function Lv(){return gu().activeItem}function Nv(){return gu().items}function Vv(){return gu().syncWithLocation}function Hv(){const e=Vf();return T.useCallback(n=>{e({type:"setActiveItem",payload:n})},[e])}function Wv(){const e=Vf();return T.useCallback(n=>{e({type:"addItem",payload:n})},[e])}function zv(){const e=Vf();return T.useCallback(n=>{e({type:"removeItem",payload:n})},[e])}var X8=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},Uv=e=>e.firstChild?e.firstChild.offsetParent===e:!0,Z8=(e,t)=>{let n=e,r=0;Uv(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},_8=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},ga=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?ga="sticky":CSS.supports("position","-webkit-sticky")&&(ga="-webkit-sticky"));var xc=!1;try{const e=Object.defineProperty({},"passive",{get(){xc={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var pd=e=>{const{el:t,onChange:n,unsubs:r,measure:i}=e;if(t===window){const s=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),l=i(s()),u=()=>{Object.assign(l,i(s())),n()};return window.addEventListener("resize",u,xc),r.push(()=>window.removeEventListener("resize",u)),l}else{const s=i(t.getBoundingClientRect()),l=()=>{Object.assign(s,i(t.getBoundingClientRect())),n()},u=new ResizeObserver(l);return u.observe(t),r.push(()=>u.disconnect()),s}},$8=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}},e6=(e,t,n)=>{const{bottom:r,offsetBottom:i,offsetTop:s}=n,l=X8(e);let u=!1;const A=()=>{u||requestAnimationFrame(()=>{const k=C();k!==x&&S(k),u=!1}),u=!0};let g=l===window?window.scrollY:l.scrollTop;const p=k=>{const{offsetTop:q,height:J}=I,{naturalTop:Y}=y,{height:ee}=R;return k+q+J>=Y+ee+M+i},C=()=>{const{height:k}=I,{height:q}=R;return q+s+i<=k?3:p(g)?1:2},h=l!==window&&Uv(l),I=pd({el:l,onChange:A,unsubs:t,measure:({height:k,top:q})=>({height:k,offsetTop:h?q:0})}),E=_8(e),B=E===window?{top:0,bottom:0}:$8(E),y=pd({el:E,onChange:A,unsubs:t,measure:({height:k})=>({height:k-B.top-B.bottom,naturalTop:E===window?0:Z8(E,l)+B.top+I.offsetTop})}),R=pd({el:e,onChange:A,unsubs:t,measure:({height:k})=>({height:k})});let M=0,x=C();const S=k=>{const q=x;if(x=k,q===2&&(M=-1),k===3){e.style.position=ga,r?e.style.bottom=`${i}px`:e.style.top=`${s}px`;return}const{height:J,offsetTop:Y}=I,{height:ee,naturalTop:ae}=y,{height:oe}=R;if(k===2)if(e.style.position="relative",M=q===0?Math.max(0,Y+g-ae+s):Math.max(0,Y+g+J-(ae+oe+i)),r){const Z=Math.max(0,ee-oe-M);e.style.bottom=`${Z}px`}else e.style.top=`${M}px`;else e.style.position=ga,k===1?r?e.style.bottom=`${i}px`:e.style.top=`${J-oe-i}px`:r?e.style.bottom=`${J-oe-i}px`:e.style.top=`${s}px`};S(x);const P=k=>{if(k===g)return;const q=k-g;if(g=k,x===3)return;const{offsetTop:J,height:Y}=I,{naturalTop:ee,height:ae}=y,{height:oe}=R;if(q>0)if(x===0){if(k+J+s>ee){const Z=Math.max(0,J+g-ee+s);k+J+Y<=ee+oe+Z+i?S(2):S(1)}}else x===2&&p(k)&&S(1);else if(x===1){if(J+k+Y<ee+ae+i){const Z=Math.max(0,J+g+Y-(ee+oe+i));J+k+s>=ee+Z?S(2):S(0)}}else x===2&&J+k+s<ee+M&&S(0)},L=l===window?()=>P(window.scrollY):()=>P(l.scrollTop);l.addEventListener("scroll",L,xc),l.addEventListener("mousewheel",L,xc),t.push(()=>l.removeEventListener("scroll",L),()=>l.removeEventListener("mousewheel",L))},t6=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,i]=T.useState(null);return T.useEffect(()=>{if(!r||!ga)return;const s=[];return e6(r,s,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{s.forEach(l=>l())}},[r,t,e,n]),i},n6=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:i,className:s,style:l}=e,u=t6({offsetTop:t,offsetBottom:n,bottom:r});return f.jsx("div",{className:s,style:l,ref:u,children:i})},r6=n6,Yv=(e=>(e.TOP="top",e.BOTTOM="bottom",e))(Yv||{});function Gv(e){const{sticky:t=!0,disposition:n={xl:3,lg:3,md:4,sm:4,xs:12},spacing:r=2}=e,i=Ce.omit(e,["sticky","disposition","spacing"]),s=t?r6:b.Box,l=T.useMemo(()=>t?{offsetTop:74,offsetBottom:r*2}:{},[t,r]);return f.jsx(b.Grid,{...i,item:!0,...n,children:f.jsx(s,{...l,children:f.jsx(b.Stack,{spacing:r,children:e.children})})})}function Kv(e){return f.jsx(f.Fragment,{children:e.children})}function qv(e){const{children:t}=e;return T.useMemo(()=>{const r={top:[],bottom:[]};return T.Children.forEach(t,i=>{if(T.isValidElement(i)&&(i==null?void 0:i.type)===Kv){const{position:s}=i.props;switch(s){case"top":r.top.push(i);break;case"bottom":r.bottom.push(i);break}}}),r},[t])}function Jv(e){const{disposition:t={xl:9,lg:9,md:8,sm:8,xs:12}}=e,n=Ce.omit(e,["disposition"]);return f.jsx(b.Grid,{...n,item:!0,...t,children:e.children})}function Xv(e){const t=Lv();return Ov(e,t??"")}function Zv(e){const t=Nv();return T.useMemo(()=>jv(e,t),[t,e])}function o6(){const e=Fv(),t=ia.useNavigate();return T.useCallback(r=>{t(`${e}/${r}`)},[e,t])}function _v(){const e=Zv();return f.jsx(b.Card,{variant:"outlined",children:f.jsx(b.List,{sx:{"& .MuiListItemButton-root.Mui-selected":{borderColor:"palette.primary.main",borderRightStyle:"solid",borderRightWidth:2},"& .MuiListItemAvatar-root":{minWidth:24}},children:Ce.map(e,(t,n)=>f.jsx(Hf,{...t},n))})})}function Hf(e){const t=me.useTranslate()??Ce.identity,n=$v(e),{selected:r,label:i,icon:s,onClick:l,badge:u,items:A,isGroup:g,level:p}=n,{spacing:C}=Dn(),[h,I]=T.useState(r),E=T.useCallback(R=>{I(!h),l(R)},[l,h]),B=s!==void 0,y=Ce.omit(e,["label","icon","selected","badge"]);return f.jsxs(f.Fragment,{children:[f.jsx(b.ListItem,{...y,disablePadding:!0,children:f.jsxs(b.ListItemButton,{selected:r&&!g,onClick:E,sx:{pl:C*p},children:[B&&f.jsx(b.ListItemIcon,{children:s}),f.jsx(b.ListItemText,{inset:!B,primary:t(i)}),u&&f.jsx(b.ListItemAvatar,{children:f.jsx(da,{type:"filled",size:"xs",color:u.color??"default",children:u.content})}),g&&(h?f.jsx(In.ExpandLess,{}):f.jsx(In.ExpandMore,{}))]})}),g&&f.jsx(b.Collapse,{in:h,timeout:"auto",children:f.jsx(b.List,{children:Ce.map(A,(R,M)=>f.jsx(Hf,{...R},M))})})]})}function $v(e){const{id:t}=e,n=Xv(t),r=Qc(t),i=o6(),s=Vv(),l=Hv(),u=Zv(t),A=!Ce.isEmpty(u),g=T.useCallback(C=>{A||(s?i(e.id):l(e.id)),Ce.isFunction(e.onClick)&&e.onClick(C)},[l,i,e,s,A]);return T.useMemo(()=>({...e,selected:n,onClick:g,items:u,isGroup:A,level:r}),[e,n,g,u,A])}function ey(e){const{label:t,icon:n,badge:r,index:i=0}=e,s=tg(e),l=Wv(),u=zv(),A=Xv(s);return T.useEffect(()=>(l({id:s,index:i,label:t,icon:n,badge:r}),()=>{u(s)}),[l,u,t,n,s,r,i]),f.jsx(b.Box,{display:A?"unset":"none",children:e.children})}function ty(e){const t=Wf(e),n=tg(e);return f.jsx(ey,{...e,id:n,children:T.Children.map(t,r=>{const i=tg(r.props);return T.cloneElement(r,{id:`${n}.${i}`})})})}function ny(e){return f.jsx(ey,{...e})}function Wf(e){const{children:t}=e;return T.useMemo(()=>Ce.chain(T.Children.toArray(t)).filter(r=>T.isValidElement(r)&&((r==null?void 0:r.type)===ny||(r==null?void 0:r.type)===ty)).map((r,i)=>T.cloneElement(r,{index:i})).value(),[t])}function i6(e){const{tabsDisposition:t,contentDisposition:n,spacing:r=2}=e,i=Ce.pick(e,["syncWithLocation"]),s=Ce.omit(e,["tabsDisposition","contentDisposition","syncWithLocation"]),{top:l,bottom:u}=qv(e),A=Wf(e);return f.jsx(Dv,{...i,children:f.jsxs(Rv,{...s,spacing:r,children:[f.jsxs(Gv,{disposition:t,spacing:r,children:[l,f.jsx(_v,{}),u]}),f.jsx(Jv,{disposition:n,children:A})]})})}const Dt=i6;Dt.BaseForm=Rv;Dt.Content=Jv;Dt.Provider=Dv;Dt.useItems=Nv;Dt.useSyncWithLocation=Vv;Dt.useFormRootPath=Fv;Dt.useActiveItem=Lv;Dt.useSetActiveItem=Hv;Dt.useAddItem=Wv;Dt.useRemoveItem=zv;Dt.Sidebar=Gv;Dt.SidebarSection=Kv;Dt.SidebarSectionPosition=Yv;Dt.useSidebarChildren=qv;Dt.NavMenu=_v;Dt.NavMenuItem=Hf;Dt.useNavMenuItem=$v;Dt.Tab=ny;Dt.Group=ty;Dt.useBaseItemChildren=Wf;const s6=le(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"}})),a6=le(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}}})),fu=ba(O.TabbedForm,{name:"RaApplicaTabbedForm",slot:"Root"})(()=>({}));fu.propTypes={...O.TabbedForm.propTypes};fu.defaultProps={...O.TabbedForm.defaultProps};fu.Tab=O.TabbedForm.Tab;const ry=T.createContext(void 0),l6=T.createContext(void 0),c6=()=>T.useContext(ry),u6=D.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:i=!1,index:s,member:l,resource:u}=e,A=O.useTranslate(),[g,p]=D.useState(!1),{total:C,remove:h}=c6(),I=D.useCallback(()=>{p(!1),h(s)},[s,h]),E=T.useMemo(()=>({index:s,total:C,remove:()=>h(s)}),[s,C,h]);return f.jsxs(l6.Provider,{value:E,children:[T.Children.map(n,(B,y)=>{if(!T.isValidElement(B))return null;const{source:R,...M}=B.props;return f.jsx(b.TableCell,{sx:{border:0,verticalAlign:"top"},children:T.cloneElement(B,{source:R?`${l}.${R}`:l,index:R?void 0:y,resource:u,disabled:r,...M,label:""})})}),!i&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",border:0,pt:2.5},children:f.jsx(os,{horizontal:!0,children:f.jsx(b.Typography,{color:"error",onClick:()=>p(!0),children:A("ra.action.delete")})})}),n.length>0&&f.jsx(O.Confirm,{isOpen:g,title:A("ra.action.remove_item"),content:A("ra.message.remove_item"),onConfirm:I,onClose:()=>p(!1)})]})});var A6=Array.isArray,zf=A6,d6=typeof Kn=="object"&&Kn&&Kn.Object===Object&&Kn,g6=d6,f6=g6,p6=typeof self=="object"&&self&&self.Object===Object&&self,h6=f6||p6||Function("return this")(),Uf=h6,C6=Uf,m6=C6.Symbol,Yf=m6,ZI=Yf,oy=Object.prototype,I6=oy.hasOwnProperty,E6=oy.toString,Ns=ZI?ZI.toStringTag:void 0;function B6(e){var t=I6.call(e,Ns),n=e[Ns];try{e[Ns]=void 0;var r=!0}catch{}var i=E6.call(e);return r&&(t?e[Ns]=n:delete e[Ns]),i}var v6=B6,y6=Object.prototype,b6=y6.toString;function Q6(e){return b6.call(e)}var x6=Q6,_I=Yf,w6=v6,T6=x6,P6="[object Null]",S6="[object Undefined]",$I=_I?_I.toStringTag:void 0;function R6(e){return e==null?e===void 0?S6:P6:$I&&$I in Object(e)?w6(e):T6(e)}var iy=R6;function O6(e){return e!=null&&typeof e=="object"}var j6=O6,M6=iy,D6=j6,k6="[object Symbol]";function F6(e){return typeof e=="symbol"||D6(e)&&M6(e)==k6}var Gf=F6,L6=zf,N6=Gf,V6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H6=/^\w*$/;function W6(e,t){if(L6(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||N6(e)?!0:H6.test(e)||!V6.test(e)||t!=null&&e in Object(t)}var z6=W6;function U6(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var sy=U6,Y6=iy,G6=sy,K6="[object AsyncFunction]",q6="[object Function]",J6="[object GeneratorFunction]",X6="[object Proxy]";function Z6(e){if(!G6(e))return!1;var t=Y6(e);return t==q6||t==J6||t==K6||t==X6}var _6=Z6,$6=Uf,eF=$6["__core-js_shared__"],tF=eF,hd=tF,eE=function(){var e=/[^.]+$/.exec(hd&&hd.keys&&hd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function nF(e){return!!eE&&eE in e}var rF=nF,oF=Function.prototype,iF=oF.toString;function sF(e){if(e!=null){try{return iF.call(e)}catch{}try{return e+""}catch{}}return""}var aF=sF,lF=_6,cF=rF,uF=sy,AF=aF,dF=/[\\^$.*+?()[\]{}|]/g,gF=/^\[object .+?Constructor\]$/,fF=Function.prototype,pF=Object.prototype,hF=fF.toString,CF=pF.hasOwnProperty,mF=RegExp("^"+hF.call(CF).replace(dF,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function IF(e){if(!uF(e)||cF(e))return!1;var t=lF(e)?mF:gF;return t.test(AF(e))}var EF=IF;function BF(e,t){return e==null?void 0:e[t]}var vF=BF,yF=EF,bF=vF;function QF(e,t){var n=bF(e,t);return yF(n)?n:void 0}var ay=QF,xF=ay,wF=xF(Object,"create"),pu=wF,tE=pu;function TF(){this.__data__=tE?tE(null):{},this.size=0}var PF=TF;function SF(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var RF=SF,OF=pu,jF="__lodash_hash_undefined__",MF=Object.prototype,DF=MF.hasOwnProperty;function kF(e){var t=this.__data__;if(OF){var n=t[e];return n===jF?void 0:n}return DF.call(t,e)?t[e]:void 0}var FF=kF,LF=pu,NF=Object.prototype,VF=NF.hasOwnProperty;function HF(e){var t=this.__data__;return LF?t[e]!==void 0:VF.call(t,e)}var WF=HF,zF=pu,UF="__lodash_hash_undefined__";function YF(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=zF&&t===void 0?UF:t,this}var GF=YF,KF=PF,qF=RF,JF=FF,XF=WF,ZF=GF;function ls(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])}}ls.prototype.clear=KF;ls.prototype.delete=qF;ls.prototype.get=JF;ls.prototype.has=XF;ls.prototype.set=ZF;var _F=ls;function $F(){this.__data__=[],this.size=0}var e9=$F;function t9(e,t){return e===t||e!==e&&t!==t}var n9=t9,r9=n9;function o9(e,t){for(var n=e.length;n--;)if(r9(e[n][0],t))return n;return-1}var hu=o9,i9=hu,s9=Array.prototype,a9=s9.splice;function l9(e){var t=this.__data__,n=i9(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():a9.call(t,n,1),--this.size,!0}var c9=l9,u9=hu;function A9(e){var t=this.__data__,n=u9(t,e);return n<0?void 0:t[n][1]}var d9=A9,g9=hu;function f9(e){return g9(this.__data__,e)>-1}var p9=f9,h9=hu;function C9(e,t){var n=this.__data__,r=h9(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var m9=C9,I9=e9,E9=c9,B9=d9,v9=p9,y9=m9;function cs(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])}}cs.prototype.clear=I9;cs.prototype.delete=E9;cs.prototype.get=B9;cs.prototype.has=v9;cs.prototype.set=y9;var b9=cs,Q9=ay,x9=Uf,w9=Q9(x9,"Map"),T9=w9,nE=_F,P9=b9,S9=T9;function R9(){this.size=0,this.__data__={hash:new nE,map:new(S9||P9),string:new nE}}var O9=R9;function j9(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var M9=j9,D9=M9;function k9(e,t){var n=e.__data__;return D9(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Cu=k9,F9=Cu;function L9(e){var t=F9(this,e).delete(e);return this.size-=t?1:0,t}var N9=L9,V9=Cu;function H9(e){return V9(this,e).get(e)}var W9=H9,z9=Cu;function U9(e){return z9(this,e).has(e)}var Y9=U9,G9=Cu;function K9(e,t){var n=G9(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var q9=K9,J9=O9,X9=N9,Z9=W9,_9=Y9,$9=q9;function us(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])}}us.prototype.clear=J9;us.prototype.delete=X9;us.prototype.get=Z9;us.prototype.has=_9;us.prototype.set=$9;var eL=us,ly=eL,tL="Expected a function";function Kf(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(tL);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var l=e.apply(this,r);return n.cache=s.set(i,l)||s,l};return n.cache=new(Kf.Cache||ly),n}Kf.Cache=ly;var nL=Kf,rL=nL,oL=500;function iL(e){var t=rL(e,function(r){return n.size===oL&&n.clear(),r}),n=t.cache;return t}var sL=iL,aL=sL,lL=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cL=/\\(\\)?/g,uL=aL(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(lL,function(n,r,i,s){t.push(i?s.replace(cL,"$1"):r||n)}),t}),AL=uL;function dL(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 gL=dL,rE=Yf,fL=gL,pL=zf,hL=Gf,CL=1/0,oE=rE?rE.prototype:void 0,iE=oE?oE.toString:void 0;function cy(e){if(typeof e=="string")return e;if(pL(e))return fL(e,cy)+"";if(hL(e))return iE?iE.call(e):"";var t=e+"";return t=="0"&&1/e==-CL?"-0":t}var mL=cy,IL=mL;function EL(e){return e==null?"":IL(e)}var BL=EL,vL=zf,yL=z6,bL=AL,QL=BL;function xL(e,t){return vL(e)?e:yL(e,t)?[e]:bL(QL(e))}var wL=xL,TL=Gf,PL=1/0;function SL(e){if(typeof e=="string"||TL(e))return e;var t=e+"";return t=="0"&&1/e==-PL?"-0":t}var RL=SL,OL=wL,jL=RL;function ML(e,t){t=OL(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[jL(t[n++])];return n&&n==r?e:void 0}var DL=ML,kL=DL;function FL(e,t,n){var r=e==null?void 0:kL(e,t);return r===void 0?n:r}var LL=FL;const NL=ts(LL),uy=e=>{var Z,K;const{children:t,resource:n,source:r,label:i,disableActions:s=!1,disableAdd:l=!1,disableRemove:u=!1,className:A,empty:g,template:p={}}=e,[C,h]=T.useState(!1),{fields:I,remove:E,replace:B,append:y}=O.useArrayInput(e),{resetField:R}=Ba.useFormContext(),M=Tt(),x=me.useTranslate(),S=me.useRecordContext(e),P=T.useRef(p||{}),L=me.useTranslateLabel(),k=T.useCallback(V=>{E(V)},[E]);if(I.length>0){const{...V}=I[0];P.current=V;for(const G in P.current)P.current[G]=null}const q=T.useCallback((V=void 0)=>{let G=V;V==null&&(G=P.current,T.Children.count(t)===1&&D.isValidElement(T.Children.only(t))&&!T.Children.only(t).props.source&&T.Children.map(t,$=>D.isValidElement($)&&$.type!==me.FormDataConsumer).some(Boolean)?G="":(G=G||{},T.Children.forEach(t,$=>{D.isValidElement($)&&$.type!==me.FormDataConsumer&&$.props.source&&(G[$.props.source]=$.props.defaultValue??null)})));const F={...G,...p};y(F),R(`${r}.${I.length}`,{defaultValue:G})},[y,t,R,r,I.length,p]),J=V=>G=>{q(),V&&V(G)},Y=T.useCallback(()=>{B([]),h(!1)},[B]),ee=NL(S,r),ae=T.useMemo(()=>({total:I.length,remove:k,source:r}),[I.length,k,r]),oe=M.palette.mode==="dark"?M.palette.grey.A400:M.palette.grey.A800;return I?f.jsx(ry.Provider,{value:ae,children:f.jsxs("div",{className:A,children:[D.cloneElement(f.jsx(Ay,{}),{label:i,source:r,disableAdd:l,template:p,onClick:J((K=(Z=e==null?void 0:e.addButton)==null?void 0:Z.props)==null?void 0:K.onClick)}),f.jsx(b.TableContainer,{component:b.Paper,sx:{mt:2,border:`1px solid ${oe}`},children:f.jsxs(b.Table,{children:[f.jsx(b.TableHead,{sx:{borderTop:0,borderBottom:`1px solid ${oe}`},children:f.jsxs(b.TableRow,{children:[T.Children.map(t,(V,G)=>D.isValidElement(V)?f.jsx(b.TableCell,{children:f.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none",children:L({...V.props,resource:n})})},G):null),!s&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"top"},children:f.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none"})},"actions")]})}),f.jsxs(b.TableBody,{children:[I.length===0&&f.jsx(b.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0}},children:f.jsx(b.TableCell,{colSpan:4+(s?0:1),align:"center",children:g||f.jsx(b.Typography,{variant:"body1",color:"text.secondary",children:"-"})})}),I.length>0&&I.map((V,G)=>f.jsx(b.TableRow,{sx:{borderBottom:`1px solid ${oe}}`},children:f.jsx(u6,{disableRemove:u,disableActions:s,index:G,member:`${r}.${G}`,onRemoveField:k,record:ee&&ee[G]||{},resource:n,source:r,children:t})},V.id))]})]})}),I.length>0&&f.jsx(O.Confirm,{isOpen:C,title:x("ra.action.clear_array_input"),content:x("ra.message.clear_array_input"),onConfirm:Y,onClose:()=>h(!1)})]})}):null},Ay=e=>{const{label:t,disableAdd:n,onClick:r}=e,i=Tt(),s=i.palette.mode==="dark"?i.palette.grey.A400:i.palette.grey.A800,l=i.palette.mode==="light"?"#000000":"#FFFFFF";return f.jsxs(b.Stack,{justifyContent:"space-between",alignItems:"center",flexDirection:"row",children:[t!==!1&&f.jsx(b.Typography,{children:t}),!n&&(D.isValidElement(e==null?void 0:e.addButton)?D.cloneElement(e==null?void 0:e.addButton,{onClick:r}):f.jsx(b.IconButton,{size:"small",color:"secondary",sx:{border:`1px solid ${s}`},onClick:r,children:f.jsx(it.PlusCircleOutlined,{style:{color:l}})}))]})},VL=le(uy,{name:"RaApplicaTableFormIterator",slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8)})`}}}));Ay.propTypes={label:c.oneOfType([c.string,c.bool]),source:c.string,defaultValue:c.any};uy.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.oneOfType([c.string,c.bool]),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]),template:c.object};function HL(e,t){const n=Ce.clone(e),{type:r,payload:i}=t;switch(r){case"updateMedia":{const s=Ce.chain(n.media).clone().extend(i).value();return Ce.extend(n,{media:s})}case"updateDrawer":{const s=Ce.chain(n.drawer).clone().extend(i).value();return Ce.extend(n,{drawer:s})}case"updateLogo":{const s=Ce.chain(n.logo).clone().extend(i).value();return Ce.extend(n,{logo:s})}case"updateNotifications":{const s=Ce.chain(n.notifications).clone().extend(i).value();return Ce.extend(n,{notifications:s})}case"updateTheme":{const s=Ce.chain(n.theme).clone().extend(i).value();return Ce.extend(n,{theme:s})}default:return n}}const WL={drawer:{open:!0,width:260,handleDrawerToggle:()=>{}},media:{downMd:!1,downLg:!1,downXl:!1,horizontal:!1},logo:{},notifications:{enable:!0,resource:"entities/notification"},theme:{iconColor:"grey.300",iconColorOpen:"grey.100"}},dy=T.createContext(void 0);function gy(e){var q;const t=me.useGetIdentity(),n=b.useTheme(),r=b.useMediaQuery(n.breakpoints.down("md")),i=b.useMediaQuery(n.breakpoints.down("lg")),s=b.useMediaQuery(n.breakpoints.down("xl")),{miniDrawer:l,isHorizontalLayout:u,menuOrientation:A,drawerWidth:g}=Dn(),p=u(A)&&!i,{drawerOpen:C,openDrawer:h}=ho(),I=T.useCallback(()=>{h(!C)},[C,h]),[E,B]=T.useState(!1),[y,R]=T.useReducer(HL,Ce.chain(WL).clone().merge({drawer:{open:!l||C}}).value()),M=T.useCallback(()=>B(!1),[]),x=T.useMemo(()=>({state:y,dispatch:R}),[y,R]),{logoIcon:S,logoMain:P,enableNotification:L,notification:k}=e;return T.useEffect(()=>{R({type:"updateMedia",payload:{downMd:r,downLg:i,downXl:s,horizontal:p}})},[A,r,i,s]),T.useEffect(()=>{R({type:"updateDrawer",payload:{open:C,width:g,handleDrawerToggle:I}})},[C,g,I]),T.useEffect(()=>{l||h(!s)},[s,l]),T.useEffect(()=>{R({type:"updateLogo",payload:{main:P,icon:S}})},[S,P]),T.useEffect(()=>{R({type:"updateNotifications",payload:{enable:L,resource:k??"entities/notification"}})},[L,k]),T.useEffect(()=>{R({type:"updateTheme",payload:{iconColorOpen:n.palette.mode==="dark"?"grey.200":"grey.300",iconColor:n.palette.mode==="dark"?"background.default":"grey.100"}})},[n.palette.mode]),T.useEffect(()=>{var J;B(((J=t==null?void 0:t.data)==null?void 0:J.needToChangePassword)===!0)},[(q=t==null?void 0:t.data)==null?void 0:q.needToChangePassword]),f.jsxs(dy.Provider,{value:x,children:[f.jsx(b.Dialog,{open:E,maxWidth:"xs",fullWidth:!0,children:f.jsx(Lf,{onSuccess:M,firstAccess:!0})}),e.children]})}function fy(e){return T.forwardRef((t,n)=>{const{logoIcon:r,logoMain:i,enableNotification:s}=t;return f.jsx(gy,{logoIcon:r,logoMain:i,enableNotification:s,children:f.jsx(e,{ref:n,...t})})})}function qf(){const e=T.useContext(dy);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function zL(){return qf().dispatch}function As(){return qf().state}function $n(){return As().media}function ii(){return As().drawer}function py(){return As().logo}function mu(){return As().notifications}function Iu(){return As().theme}function hy(){const{iconColor:e,iconColorOpen:t}=Iu(),{open:n,handleDrawerToggle:r}=ii();return f.jsx(Io,{"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?f.jsx(it.MenuFoldOutlined,{}):f.jsx(it.MenuUnfoldOutlined,{})})}function Cy(e){const t=T.useRef(),n=b.useTheme(),{downLg:r,horizontal:i}=$n(),{open:s,width:l}=ii(),u=r?b.AppBar:P0,A=is(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:i?"100%":s?`calc(100% - ${l}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),g={position:"fixed",color:"inherit",elevation:0,sx:A};return r||Ce.extend(g,{open:s}),f.jsx(u,{ref:t,...g,children:f.jsxs(b.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!i&&f.jsx(hy,{}),e.children]})})}function UL(e){const t=b.useTheme(),{notification:n,onClick:r,selected:i,divider:s}=e,{resource:l}=mu(),u=me.useNotify(),A=me.useRedirect(),[g]=me.useUpdate(l,{id:n==null?void 0:n.id,data:{...n,readed:Ur().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=T.useCallback(()=>g(),[g]),[C]=me.useLocaleState(),h=T.useMemo(()=>Ur(n.created).locale(C).fromNow(),[n,C]);return f.jsx(b.ListItem,{disablePadding:!0,divider:s,children:f.jsxs(b.ListItemButton,{selected:i,onClick:p,children:[f.jsx(b.ListItemAvatar,{children:f.jsx(b.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:f.jsx(it.MessageOutlined,{})})}),f.jsx(b.ListItemText,{primary:n.title,secondary:n.content}),f.jsx(b.Box,{flexGrow:1,flexShrink:1,minWidth:t.spacing(2)}),f.jsx(b.ListItemText,{primary:h,primaryTypographyProps:{variant:"caption"}})]})})}const YL={width:36,height:36,fontSize:"1rem"},GL={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function my(){const{enable:e}=mu();return e?f.jsx(KL,{}):null}function KL(){const e=b.useTheme(),t=T.useRef(),{resource:n}=mu(),{downMd:r}=$n(),{iconColor:i,iconColorOpen:s}=Iu(),[l,u]=T.useState(!1),[A,g]=T.useState([]),p=A.filter(B=>B.readed===null).length,C=T.useCallback(()=>u(!l),[l]),h=T.useCallback(()=>{t.current&&t.current.contains(event.target)||u(!1)},[t.current,u]),{data:I,isLoading:E}=me.useGetList(n,{pagination:{page:1,perPage:50},sort:{field:"created",order:"DESC"},filter:{readed:!1}});return T.useEffect(()=>{!E&&I&&g(I??[])},[I,E]),f.jsxs(b.Box,{sx:{flexShrink:0},children:[f.jsx(Io,{color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:l?s:i},"aria-label":"open profile",ref:t,"aria-controls":l?"profile-grow":void 0,"aria-haspopup":"true",onClick:C,children:f.jsx(b.Badge,{badgeContent:p,color:"primary",children:f.jsx(it.BellOutlined,{})})}),f.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})=>f.jsx(Eo,{type:"grow",position:r?"top":"top-right",in:open,...B,children:f.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:"100%",minWidth:285,maxWidth:420,[e.breakpoints.down("md")]:{maxWidth:285}},children:f.jsx(b.ClickAwayListener,{onClickAway:h,children:f.jsx(ur,{title:"Notification",elevation:0,border:!1,content:!1,secondary:f.jsx(f.Fragment,{children:p>0&&f.jsx(b.Tooltip,{title:"Mark as all read",children:f.jsx(Io,{color:"success",size:"small",children:f.jsx(it.CheckCircleOutlined,{style:{fontSize:"1.15rem"}})})})}),children:f.jsx(b.List,{component:"nav",sx:{p:0,"& .MuiListItemButton-root":{py:.5,"&.Mui-selected":{bgcolor:"grey.50",color:"text.primary"},"& .MuiAvatar-root":YL,"& .MuiListItemSecondaryAction-root":{...GL,position:"relative"}}},children:A.map((y,R)=>f.jsx(UL,{selected:p>0,notification:y,onClick:h,divider:R<A.length-1},y.id))})})})})})})]})}const qL=()=>{const[e,t]=T.useState(!1),n=T.useCallback(()=>t(!1),[t]),r=T.useCallback(()=>t(!0),[t]),i=me.useTranslate();return f.jsxs(T.Fragment,{children:[f.jsxs(b.ListItemButton,{onClick:r,children:[f.jsx(b.ListItemIcon,{children:f.jsx(In.Key,{})}),f.jsx(b.ListItemText,{primary:i("ra.auth.change_password")})]}),f.jsx(b.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:f.jsx(Lf,{onSuccess:n})})]})},JL=()=>{const e=me.useLogout(),t=me.useTranslate();return f.jsx(T.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:e,children:[f.jsx(b.ListItemIcon,{children:f.jsx(In.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:t("ra.auth.logout")})]})})},XL=()=>{const e=me.useTranslate(),t=me.useAuthProvider(),n=T.useCallback(()=>t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,i]=T.useState(!1);return T.useEffect(()=>{t.isImpersonating&&t.isImpersonating().then(s=>i(s))},[t,i]),r?f.jsx(T.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:n,children:[f.jsx(b.ListItemIcon,{children:f.jsx(In.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};c.node,c.any.isRequired,c.any.isRequired;const Iy=()=>{var B;const e=b.useTheme(),{identity:t}=O.useGetIdentity(),n=t!==void 0&&t.image&&t.image!==null&&t.image!=="",r=T.useRef(null),[i,s]=T.useState(!1),l=()=>{s(y=>!y)},u=y=>{r.current&&r.current.contains(y.target)||s(!1)},A=e.palette.mode==="dark"?"grey.200":"grey.300",g=O.useLogout(),p=O.useDataProvider(),C=O.useAuthProvider(),h=T.useCallback(()=>{g()},[C,g]),[I,E]=T.useState(null);return T.useEffect(()=>{if(!n)return;async function y(){var R=await p.getFile("/profile/me/image");E(R)}y()},[p,n]),f.jsxs(b.Box,{sx:{flexShrink:0},children:[f.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:f.jsxs(b.Stack,{direction:"row",spacing:2,alignItems:"center",sx:{p:.5},children:[f.jsx(da,{alt:(B=t==null?void 0:t.name)==null?void 0:B.toUpperCase(),src:I,size:"xs"}),f.jsx(b.Typography,{variant:"subtitle1",children:t==null?void 0:t.name})]})}),f.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:y})=>{var R;return f.jsx(Eo,{type:"grow",position:"top-right",in:i,...y,children:f.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:290,minWidth:240,maxWidth:290,[e.breakpoints.down("md")]:{maxWidth:250}},children:f.jsx(b.ClickAwayListener,{onClickAway:u,children:f.jsxs(ur,{elevation:0,border:!1,content:!1,children:[f.jsx(b.CardContent,{sx:{px:2.5,pt:3},children:f.jsxs(b.Grid,{container:!0,justifyContent:"space-between",alignItems:"center",children:[f.jsx(b.Grid,{item:!0,children:f.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[f.jsx(da,{alt:"profile user",src:I,sx:{width:32,height:32}}),f.jsxs(b.Stack,{children:[f.jsx(b.Typography,{variant:"h6",children:t==null?void 0:t.name}),f.jsx(b.Typography,{variant:"body2",color:"textSecondary",children:(R=t==null?void 0:t.roles)==null?void 0:R.map(M=>M.name.replace("ROLE_","")).join(",")})]})]})}),f.jsx(b.Grid,{item:!0,children:f.jsx(b.Tooltip,{title:"Logout",children:f.jsx(Io,{size:"large",sx:{color:"text.primary"},onClick:h,children:f.jsx(it.LogoutOutlined,{})})})})]})}),f.jsx(b.Grid,{container:!0,children:f.jsx(b.Grid,{item:!0,xs:12,children:f.jsxs(b.List,{component:"nav",sx:{p:0,"& .MuiListItemIcon-root":{minWidth:32}},children:[f.jsx(qL,{}),f.jsx(JL,{}),f.jsx(XL,{})]})})})]})})})})}})]})},Ey=e=>{const t=Tt(),{downMd:n}=$n(),{iconColor:r,iconColorOpen:i}=Iu(),[s,l]=T.useState(!1),u=T.useRef(null),A=T.useCallback(()=>{l(!s)},[s]),g=T.useCallback(p=>{u.current&&u.current.contains(p.target)||l(!1)},[]);return n?f.jsxs(f.Fragment,{children:[f.jsx(b.Box,{sx:{flexShrink:0},children:f.jsx(Io,{sx:{color:"text.primary",bgcolor:s?i:r},"aria-label":"open more menu",ref:u,"aria-controls":s?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:A,color:"secondary",variant:"light",children:f.jsx(it.MoreOutlined,{})})}),f.jsx(b.Popper,{placement:"bottom-end",open:s,anchorEl:u.current,role:void 0,transition:!0,disablePortal:!0,style:{width:"100%"},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:p})=>f.jsx(Eo,{type:"fade",in:s,...p,children:f.jsx(b.Paper,{sx:{boxShadow:t.customShadows.z1},children:f.jsx(b.ClickAwayListener,{onClickAway:g,children:f.jsx(b.AppBar,{color:"inherit",children:f.jsx(b.Toolbar,{children:e.children})})})})})})]}):f.jsx(f.Fragment,{children:e.children})};function By(e){return f.jsx(b.Box,{...e,flex:1})}function Ra(e){const{name:t,version:n}=e;return f.jsx(b.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:"24px 16px 0px",mt:"auto"},children:f.jsxs(b.Typography,{variant:"caption",children:[f.jsx("span",{dangerouslySetInnerHTML:{__html:(e==null?void 0:e.copy)||""}})," ",t," - ",n]})})}Ra.propTypes={name:c.string.isRequired,version:c.string.isRequired,copy:c.string};Ra.defaultProps={copy:"&copy; Applica Software Guru for"};var vy={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(vy);var Jf=vy.exports,Cd={};const ZL=eR(D5);var sE;function Xf(){return sE||(sE=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=ZL}(Cd)),Cd}function yy(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=yy(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function by(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=yy(e))&&(r&&(r+=" "),r+=t);return r}var ng=globalThis&&globalThis.__assign||function(){return ng=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},ng.apply(this,arguments)},_L=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Qy=function(e){var t=e.className,n=e.sx,r=_L(e,["className","sx"]),i=me.useLoading(),s=Tt();return D.createElement($L,{className:t,sx:n},i?D.createElement(gf,ng({className:by("app-loader",wc.loader),color:"inherit",size:s.spacing(2),thickness:6},r)):D.createElement(Zy,{className:wc.loadedIcon}))};Qy.propTypes={classes:c.object,className:c.string,width:c.string};var rg="RaLoadingIndicator",wc={loader:"".concat(rg,"-loader"),loadedIcon:"".concat(rg,"-loadedIcon")},$L=le("div",{name:rg,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={},t["& .".concat(wc.loader)]={marginLeft:n.spacing(1.5),marginRight:n.spacing(1.5)},t["& .".concat(wc.loadedIcon)]={},t});const Zf=e=>e.scrollTop;function Xi(e,t){var n,r;const{timeout:i,easing:s,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 s=="object"?s[t.mode]:s,delay:l.transitionDelay}}const eN=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function tN(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),s=rs(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const g=s.getComputedStyle(t);l=g.getPropertyValue("-webkit-transform")||g.getPropertyValue("transform")}let u=0,A=0;if(l&&l!=="none"&&typeof l=="string"){const g=l.split("(")[1].split(")")[0].split(",");u=parseInt(g[4],10),A=parseInt(g[5],10)}return e==="left"?i?`translateX(${i.right+u-r.left}px)`:`translateX(${s.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(${s.innerHeight+A-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-A}px)`:`translateY(-${r.top+r.height-A}px)`}function xy(e){return typeof e=="function"?e():e}function Wl(e,t,n){const r=xy(n),i=tN(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const wy=D.forwardRef(function(t,n){const r=Tt(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:u=!0,children:A,container:g,direction:p="down",easing:C=i,in:h,onEnter:I,onEntered:E,onEntering:B,onExit:y,onExited:R,onExiting:M,style:x,timeout:S=s,TransitionComponent:P=cf}=t,L=Ke(t,eN),k=D.useRef(null),q=On(A.ref,k,n),J=F=>$=>{F&&($===void 0?F(k.current):F(k.current,$))},Y=J((F,$)=>{Wl(p,F,g),Zf(F),I&&I(F,$)}),ee=J((F,$)=>{const W=Xi({timeout:S,style:x,easing:C},{mode:"enter"});F.style.webkitTransition=r.transitions.create("-webkit-transform",z({},W)),F.style.transition=r.transitions.create("transform",z({},W)),F.style.webkitTransform="none",F.style.transform="none",B&&B(F,$)}),ae=J(E),oe=J(M),Z=J(F=>{const $=Xi({timeout:S,style:x,easing:C},{mode:"exit"});F.style.webkitTransition=r.transitions.create("-webkit-transform",$),F.style.transition=r.transitions.create("transform",$),Wl(p,F,g),y&&y(F)}),K=J(F=>{F.style.webkitTransition="",F.style.transition="",R&&R(F)}),V=F=>{l&&l(k.current,F)},G=D.useCallback(()=>{k.current&&Wl(p,k.current,g)},[p,g]);return D.useEffect(()=>{if(h||p==="down"||p==="right")return;const F=t0(()=>{k.current&&Wl(p,k.current,g)}),$=rs(k.current);return $.addEventListener("resize",F),()=>{F.clear(),$.removeEventListener("resize",F)}},[p,h,g]),D.useEffect(()=>{h||G()},[h,G]),f.jsx(P,z({nodeRef:k,onEnter:Y,onEntered:ae,onEntering:ee,onExit:Z,onExited:K,onExiting:oe,addEndListener:V,appear:u,in:h,timeout:S},L,{children:(F,$)=>D.cloneElement(A,z({ref:q,style:z({visibility:F==="exited"&&!h?"hidden":void 0},x,A.props.style)},$))}))});process.env.NODE_ENV!=="production"&&(wy.propTypes={addEndListener:c.func,appear:c.bool,children:ns.isRequired,container:br(c.oneOfType([$o,c.func]),e=>{if(e.open){const t=xy(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
+ `),J5)),uv=D.forwardRef(function(t,n){const r=Yt({props:t,name:"MuiCircularProgress"}),{className:i,color:s="primary",disableShrink:l=!1,size:u=40,style:A,thickness:g=3.6,value:p=0,variant:C="indeterminate"}=r,h=Ke(r,K5),I=z({},r,{color:s,disableShrink:l,size:u,thickness:g,value:p,variant:C}),E=X5(I),B={},y={},R={};if(C==="determinate"){const M=2*Math.PI*((ro-g)/2);B.strokeDasharray=M.toFixed(3),R["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*M).toFixed(3)}px`,y.transform="rotate(-90deg)"}return f.jsx(Z5,z({className:Je(E.root,i),style:z({width:u,height:u},y,A),ownerState:I,ref:n,role:"progressbar"},R,h,{children:f.jsx(_5,{className:E.svg,ownerState:I,viewBox:`${ro/2} ${ro/2} ${ro} ${ro}`,children:f.jsx($5,{className:E.circle,style:B,ownerState:I,cx:ro,cy:ro,r:(ro-g)/2,fill:"none",strokeWidth:g})})}))});process.env.NODE_ENV!=="production"&&(uv.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 gf=uv;function e8(e){return Vt("MuiLoadingButton",e)}const t8=Ut("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),Dr=t8,n8=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],r8=e=>{const{loading:t,loadingPosition:n,classes:r}=e,i={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Pe(n)}`],endIcon:[t&&`endIconLoading${Pe(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Pe(n)}`]},s=Ir.unstable_composeClasses(i,e8,r);return z({},r,s)},o8=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",i8=le(Y5,{shouldForwardProp:e=>o8(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Dr.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Dr.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>z({[`& .${Dr.startIconLoadingStart}, & .${Dr.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}),[`&.${Dr.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Dr.startIconLoadingStart}, & .${Dr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Dr.startIconLoadingStart}, & .${Dr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),s8=le("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Pe(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>z({position:"absolute",visibility:"visible",display:"flex"},t.loadingPosition==="start"&&(t.variant==="outlined"||t.variant==="contained")&&{left:t.size==="small"?10:14},t.loadingPosition==="start"&&t.variant==="text"&&{left:6},t.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},t.loadingPosition==="end"&&(t.variant==="outlined"||t.variant==="contained")&&{right:t.size==="small"?10:14},t.loadingPosition==="end"&&t.variant==="text"&&{right:6},t.loadingPosition==="start"&&t.fullWidth&&{position:"relative",left:-10},t.loadingPosition==="end"&&t.fullWidth&&{position:"relative",right:-10})),Av=D.forwardRef(function(t,n){const r=Yt({props:t,name:"MuiLoadingButton"}),{children:i,disabled:s=!1,id:l,loading:u=!1,loadingIndicator:A,loadingPosition:g="center",variant:p="text"}=r,C=Ke(r,n8),h=mg(l),I=A??f.jsx(gf,{"aria-labelledby":h,color:"inherit",size:16}),E=z({},r,{disabled:s,loading:u,loadingIndicator:I,loadingPosition:g,variant:p}),B=r8(E),y=u?f.jsx(s8,{className:B.loadingIndicator,ownerState:E,children:I}):null;return f.jsxs(i8,z({disabled:s||u,id:h,ref:n},C,{variant:p,classes:B,ownerState:E,children:[E.loadingPosition==="end"?i:y,E.loadingPosition==="end"?y:i]}))});process.env.NODE_ENV!=="production"&&(Av.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 a8=Av;function fd({variant:e,theme:t,color:n,loadingPosition:r}){const i=rn(t,n),{lighter:s,main:l,dark:u,contrastText:A}=i,g=`${n}Button`,p=ss(t,g),C={"& .MuiLoadingButton-loadingIndicator":{color:l}},h={...r&&r!=="center"&&{color:l}},I={"&::after":{boxShadow:`0 0 6px 6px ${He(l,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${He(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},...I};case"light":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...I};case"shadow":return{boxShadow:p,backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{boxShadow:"none",backgroundColor:u,color:A},...I};case"outlined":return{backgroundColor:"transparent",borderColor:l,...h,...C};case"dashed":return{backgroundColor:s,borderColor:l,...h,...C,...I};case"text":default:return{color:l,...C,...I}}}const l8=le(a8,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:i,loadingPosition:s})=>({"::after":{content:'""',display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:n==="rounded"?"50%":4,opacity:0,transition:"all 0.5s"},":active::after":{position:"absolute",borderRadius:n==="rounded"?"50%":4,left:0,top:0,opacity:1,transition:"0s"},...t==="text"&&{...fd({variant:t,theme:e,color:r,loadingPosition:s}),"&.MuiButton-sizeMedium":{height:36},"&.MuiButton-sizeSmall":{height:30},"&.MuiButton-sizeLarge":{height:44}},...n&&{minWidth:0,"&.MuiButton-sizeMedium":{width:36,height:36},"&.MuiButton-sizeSmall":{width:30,height:30},"&.MuiButton-sizeLarge":{width:44,height:44},...n==="rounded"&&{borderRadius:"50%"}},...t==="outlined"&&{border:"1px solid"},...t==="dashed"&&{border:"1px dashed"},...(t==="contained"||t==="shadow")&&!i&&{color:"#fff"},...t!=="text"&&{...fd({variant:t,theme:e,color:r,loadingPosition:s})},"&.Mui-disabled":{...t!=="text"&&{...fd({variant:t,theme:e,color:r,loadingPosition:s})}}})),ff=T.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...i},s)=>{const l=Tt();return f.jsx(l8,{ref:s,variant:e,shape:t,theme:l,loadingPosition:i.loadingPosition,loading:i.loading,color:r,...i,children:n})});ff.propTypes={variant:c.string,shape:c.string,children:c.node,color:c.string};ff.displayName="LoadingButton";function c8({color:e,theme:t,labelColor:n}){const r=rn(t,e),{main:i,contrastText:s}=r;let l=e||"";return["primary","secondary","info","success","warning","error"].includes(l)?{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:i,color:n||s},[`& .${b.tooltipClasses.arrow}`]:{color:i}}:{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:l,color:n||s,boxShadow:t.shadows[1]},[`& .${b.tooltipClasses.arrow}`]:{color:l}}}const u8=le(({className:e,...t})=>f.jsx(b.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&c8({color:t,theme:e,labelColor:n})}));function dv({children:e,arrow:t,labelColor:n="",...r}){const i=Tt();return f.jsx(b.Box,{display:"flex",children:f.jsx(u8,{arrow:t,...r,theme:i,labelColor:n,children:e})})}dv.propTypes={children:c.element,arrow:c.bool,labelColor:c.string,rest:c.array};const Eo=T.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...i},s)=>{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 f.jsxs(b.Box,{ref:s,children:[n==="grow"&&f.jsx(b.Grow,{...i,timeout:{appear:0,enter:150,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="collapse"&&f.jsx(b.Collapse,{...i,sx:l,children:e}),n==="fade"&&f.jsx(b.Fade,{...i,timeout:{appear:0,enter:300,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="slide"&&f.jsx(b.Slide,{...i,timeout:{appear:0,enter:150,exit:150},direction:r,children:f.jsx(b.Box,{sx:l,children:e})}),n==="zoom"&&f.jsx(b.Zoom,{...i,children:f.jsx(b.Box,{sx:l,children:e})})]})});Eo.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"])};T.forwardRef(function(t,n){return f.jsx(b.Zoom,{ref:n,timeout:200,...t})});function gv({value:e,...t}){return f.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[f.jsx(b.CircularProgress,{variant:"determinate",value:e,...t}),f.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(e)}%`})})]})}gv.propTypes={value:c.number};function fv({value:e,size:t,variant:n,thickness:r,showLabel:i,pathColor:s,sx:l,...u}){return f.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[f.jsx(b.CircularProgress,{variant:"determinate",sx:{color:s||"grey.200"},size:t,thickness:r,...u,value:100}),i&&f.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:e?`${Math.round(e)}%`:"0%"})}),f.jsx(b.CircularProgress,{variant:n,sx:{...l,position:"absolute",left:0,[`& .${b.circularProgressClasses.circle}`]:{strokeLinecap:"round"}},size:t,thickness:r,value:e,...u})]})}fv.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 pv({icon:e,value:t,...n}){return f.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(b.Box,{sx:{width:"100%",mr:1},children:f.jsx(b.LinearProgress,{variant:"determinate",value:t,...n})}),f.jsx(b.Box,{sx:{minWidth:35},children:e})]})}pv.propTypes={icon:c.node,value:c.number};function hv({value:e,...t}){return f.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(b.Box,{sx:{width:"100%",mr:1},children:f.jsx(b.LinearProgress,{variant:"determinate",value:e,...t})}),f.jsx(b.Box,{sx:{minWidth:35},children:f.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:`${Math.round(e)}%`})})]})}hv.propTypes={value:c.number};const Cv=T.createContext({});function A8(e){const{useDefaults:t=!1,queryOptions:n={}}=e,r=O.useResourceContext(),i=O.useDataProvider(),{search:s}=ia.useLocation(),l=`${r}/new`,u=T.useCallback(()=>{if(!t||!Ce.isFunction(i.get))return Promise.resolve({});const h={};return new URLSearchParams(s??"").forEach((I,E)=>{h[E]=I}),i.get(l,h).then(I=>I.data).then(I=>{const{responseCode:E,value:B}=I;return E==="ok"?B:Promise.reject(I)})},[r,t,s,i]),A=T.useMemo(()=>Ce.chain(n).extend({queryKey:[r,s],queryFn:u}).value(),[r,s,u,n]),{data:g,isLoading:p}=pg.useQuery(A),C=Ce.omit(e,["useDefaults"]);return p?f.jsx(b.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:f.jsx(b.CircularProgress,{})}):f.jsx(Cv.Provider,{value:g??{},children:f.jsx(O.Create,{...C})})}function d8(){return T.useContext(Cv)}const g8=le(A8,{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"}})),f8=ba(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)}})),Kr=e=>f.jsx(f8,{...e});Kr.defaultProps={...O.Toolbar.defaultProps};Kr.propTypes={...O.Toolbar.propTypes};const pf=({children:e,content:t,title:n,subheader:r,secondary:i,toolbar:s,...l})=>{const u=O.useTranslate(),A=O.useResourceContext(),{cardTitle:g,cardSubheader:p}=T.useMemo(()=>{const C=n||`resources.${A}.title`;return{cardTitle:u(C,{_:C}),cardSubheader:r!==null?u(r,{_:r}):null}},[A,r,n,u]);return f.jsx(b.Grid,{item:!0,...l,children:f.jsx(ur,{content:t,title:g,subheader:p,secondary:i,divider:!0,children:f.jsxs(T.Fragment,{children:[e,s===!0?f.jsx(Kr,{children:f.jsx(O.SaveButton,{})}):s]})})})};pf.defaultProps={...b.Grid.defaultProps,content:!0,subheader:null,title:null,secondary:null,toolbar:!1,item:!0,lg:12,md:12,sm:12,xs:12};pf.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 p8=le(O.Form,{name:"RaApplicaCardForm",slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*2),padding:0}})),au=({children:e,spacing:t,defaultValues:n,...r})=>{const{spacing:i}=Dn();return f.jsx(p8,{defaultValues:n,spacing:t||i,children:f.jsx(b.Grid,{container:!0,...r,spacing:t||i,children:e})})};au.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};au.defaultProps={...b.Stack.defaultProps};au.Section=pf;const h8=ba(O.SimpleForm,{name:"RaApplicaSimpleForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:1)},[e.breakpoints.down("sm")]:{paddingBottom:0}})),lu=({title:e,modal:t,content:n,subheader:r,secondary:i,sx:s,...l})=>{const u=w0(e),A=O.useRecordContext();return f.jsx(ur,{content:n,title:u,subheader:r,secondary:A!=null&&A.id?i:null,sx:{...s,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!t,divider:!0,children:f.jsx(h8,{toolbar:f.jsx(Kr,{}),...l})})};lu.defaultProps={modal:!1,content:!1,subheader:null,title:null,toolbar:f.jsx(Kr,{children:f.jsx(O.SaveButton,{type:"button"})}),secondary:f.jsx(os,{children:f.jsx(O.DeleteWithConfirmButton,{})})};lu.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 cu=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:s,divider:l,...u})=>{const A=Xt.useTheme(),{getCurrentDialog:g}=ni(),{source:p,resource:C,isRequired:h}=u,{getFieldState:I,formState:E}=Ba.useFormContext(),{error:B}=I(p,E),y=g();return f.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&&s!==!1&&f.jsx(b.InputLabel,{error:!!B,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(O.FieldTitle,{label:e,source:p,resource:y||C,isRequired:h})}),T.isValidElement(t)?T.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&f.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:!!B,children:r})]})};cu.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};cu.defaultProps={display:"label",divider:!1};const C8=le(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%"}}})),m8=({label:e,addLabel:t,source:n,helperText:r,divider:i=!0,...s})=>f.jsx(cu,{label:e,addLabel:t,source:n,helperText:r,divider:i,children:f.jsx(C8,{source:n,label:!1,...s})}),hf=({canEdit:e,canDelete:t,canClone:n})=>!e&&!t&&!n?null:f.jsxs(os,{children:[e&&f.jsx(O.EditButton,{}),t&&f.jsx(O.DeleteWithConfirmButton,{}),n&&f.jsx(O.CloneButton,{})]});hf.defaultProps={canEdit:!0,canDelete:!0,canClone:!1};hf.propTypes={canEdit:c.bool,canDelete:c.bool,canClone:c.bool};const XI=le("div",{name:"ApplicaBaseAttachmentField",overridesResolver:(e,t)=>t.root})({display:"inline-block"}),I8=le("ul")({display:"inline-block"}),mv=e=>{var p;const{className:t,emptyText:n,source:r,title:i,...s}=e,l=me.useRecordContext(e),u=ut.get(l,r),A=me.useTranslate();if(!u)return n?f.jsx(b.Typography,{component:"span",variant:"body2",className:t,...s,children:n&&A(n,{_:n})}):f.jsx(XI,{className:t,...s});if(Array.isArray(u))return f.jsx(I8,{className:t,...s,children:u.map((C,h)=>{var E;const I=i instanceof String?(E=ut.get(C,i))==null?void 0:E.toString():i;return f.jsx("li",{children:I},h)})});const g=i instanceof String?(p=ut.get(l,i))==null?void 0:p.toString():i;return f.jsx(XI,{className:t,...s,children:g})};mv.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 Iv={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Kn,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",l="second",u="minute",A="hour",g="day",p="week",C="month",h="quarter",I="year",E="date",B="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Z){var K=["th","st","nd","rd"],V=Z%100;return"["+Z+(K[(V-20)%10]||K[V]||K[0])+"]"}},x=function(Z,K,V){var G=String(Z);return!G||G.length>=K?Z:""+Array(K+1-G.length).join(V)+Z},S={s:x,z:function(Z){var K=-Z.utcOffset(),V=Math.abs(K),G=Math.floor(V/60),F=V%60;return(K<=0?"+":"-")+x(G,2,"0")+":"+x(F,2,"0")},m:function Z(K,V){if(K.date()<V.date())return-Z(V,K);var G=12*(V.year()-K.year())+(V.month()-K.month()),F=K.clone().add(G,C),$=V-F<0,W=K.clone().add(G+($?-1:1),C);return+(-(G+(V-F)/($?F-W:W-F))||0)},a:function(Z){return Z<0?Math.ceil(Z)||0:Math.floor(Z)},p:function(Z){return{M:C,y:I,w:p,d:g,D:E,h:A,m:u,s:l,ms:s,Q:h}[Z]||String(Z||"").toLowerCase().replace(/s$/,"")},u:function(Z){return Z===void 0}},P="en",L={};L[P]=M;var k="$isDayjsObject",q=function(Z){return Z instanceof ae||!(!Z||!Z[k])},J=function Z(K,V,G){var F;if(!K)return P;if(typeof K=="string"){var $=K.toLowerCase();L[$]&&(F=$),V&&(L[$]=V,F=$);var W=K.split("-");if(!F&&W.length>1)return Z(W[0])}else{var X=K.name;L[X]=K,F=X}return!G&&F&&(P=F),F||!G&&P},Y=function(Z,K){if(q(Z))return Z.clone();var V=typeof K=="object"?K:{};return V.date=Z,V.args=arguments,new ae(V)},ee=S;ee.l=J,ee.i=q,ee.w=function(Z,K){return Y(Z,{locale:K.$L,utc:K.$u,x:K.$x,$offset:K.$offset})};var ae=function(){function Z(V){this.$L=J(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[k]=!0}var K=Z.prototype;return K.parse=function(V){this.$d=function(G){var F=G.date,$=G.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(y);if(W){var X=W[2]-1||0,Ae=(W[7]||"0").substring(0,3);return $?new Date(Date.UTC(W[1],X,W[3]||1,W[4]||0,W[5]||0,W[6]||0,Ae)):new Date(W[1],X,W[3]||1,W[4]||0,W[5]||0,W[6]||0,Ae)}}return new Date(F)}(V),this.init()},K.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},K.$utils=function(){return ee},K.isValid=function(){return this.$d.toString()!==B},K.isSame=function(V,G){var F=Y(V);return this.startOf(G)<=F&&F<=this.endOf(G)},K.isAfter=function(V,G){return Y(V)<this.startOf(G)},K.isBefore=function(V,G){return this.endOf(G)<Y(V)},K.$g=function(V,G,F){return ee.u(V)?this[G]:this.set(F,V)},K.unix=function(){return Math.floor(this.valueOf()/1e3)},K.valueOf=function(){return this.$d.getTime()},K.startOf=function(V,G){var F=this,$=!!ee.u(G)||G,W=ee.p(V),X=function(pe,Ee){var xe=ee.w(F.$u?Date.UTC(F.$y,Ee,pe):new Date(F.$y,Ee,pe),F);return $?xe:xe.endOf(g)},Ae=function(pe,Ee){return ee.w(F.toDate()[pe].apply(F.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(Ee)),F)},ge=this.$W,ce=this.$M,ue=this.$D,fe="set"+(this.$u?"UTC":"");switch(W){case I:return $?X(1,0):X(31,11);case C:return $?X(1,ce):X(0,ce+1);case p:var Be=this.$locale().weekStart||0,Ie=(ge<Be?ge+7:ge)-Be;return X($?ue-Ie:ue+(6-Ie),ce);case g:case E:return Ae(fe+"Hours",0);case A:return Ae(fe+"Minutes",1);case u:return Ae(fe+"Seconds",2);case l:return Ae(fe+"Milliseconds",3);default:return this.clone()}},K.endOf=function(V){return this.startOf(V,!1)},K.$set=function(V,G){var F,$=ee.p(V),W="set"+(this.$u?"UTC":""),X=(F={},F[g]=W+"Date",F[E]=W+"Date",F[C]=W+"Month",F[I]=W+"FullYear",F[A]=W+"Hours",F[u]=W+"Minutes",F[l]=W+"Seconds",F[s]=W+"Milliseconds",F)[$],Ae=$===g?this.$D+(G-this.$W):G;if($===C||$===I){var ge=this.clone().set(E,1);ge.$d[X](Ae),ge.init(),this.$d=ge.set(E,Math.min(this.$D,ge.daysInMonth())).$d}else X&&this.$d[X](Ae);return this.init(),this},K.set=function(V,G){return this.clone().$set(V,G)},K.get=function(V){return this[ee.p(V)]()},K.add=function(V,G){var F,$=this;V=Number(V);var W=ee.p(G),X=function(ce){var ue=Y($);return ee.w(ue.date(ue.date()+Math.round(ce*V)),$)};if(W===C)return this.set(C,this.$M+V);if(W===I)return this.set(I,this.$y+V);if(W===g)return X(1);if(W===p)return X(7);var Ae=(F={},F[u]=r,F[A]=i,F[l]=n,F)[W]||1,ge=this.$d.getTime()+V*Ae;return ee.w(ge,this)},K.subtract=function(V,G){return this.add(-1*V,G)},K.format=function(V){var G=this,F=this.$locale();if(!this.isValid())return F.invalidDate||B;var $=V||"YYYY-MM-DDTHH:mm:ssZ",W=ee.z(this),X=this.$H,Ae=this.$m,ge=this.$M,ce=F.weekdays,ue=F.months,fe=F.meridiem,Be=function(Ee,xe,se,We){return Ee&&(Ee[xe]||Ee(G,$))||se[xe].slice(0,We)},Ie=function(Ee){return ee.s(X%12||12,Ee,"0")},pe=fe||function(Ee,xe,se){var We=Ee<12?"AM":"PM";return se?We.toLowerCase():We};return $.replace(R,function(Ee,xe){return xe||function(se){switch(se){case"YY":return String(G.$y).slice(-2);case"YYYY":return ee.s(G.$y,4,"0");case"M":return ge+1;case"MM":return ee.s(ge+1,2,"0");case"MMM":return Be(F.monthsShort,ge,ue,3);case"MMMM":return Be(ue,ge);case"D":return G.$D;case"DD":return ee.s(G.$D,2,"0");case"d":return String(G.$W);case"dd":return Be(F.weekdaysMin,G.$W,ce,2);case"ddd":return Be(F.weekdaysShort,G.$W,ce,3);case"dddd":return ce[G.$W];case"H":return String(X);case"HH":return ee.s(X,2,"0");case"h":return Ie(1);case"hh":return Ie(2);case"a":return pe(X,Ae,!0);case"A":return pe(X,Ae,!1);case"m":return String(Ae);case"mm":return ee.s(Ae,2,"0");case"s":return String(G.$s);case"ss":return ee.s(G.$s,2,"0");case"SSS":return ee.s(G.$ms,3,"0");case"Z":return W}return null}(Ee)||W.replace(":","")})},K.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},K.diff=function(V,G,F){var $,W=this,X=ee.p(G),Ae=Y(V),ge=(Ae.utcOffset()-this.utcOffset())*r,ce=this-Ae,ue=function(){return ee.m(W,Ae)};switch(X){case I:$=ue()/12;break;case C:$=ue();break;case h:$=ue()/3;break;case p:$=(ce-ge)/6048e5;break;case g:$=(ce-ge)/864e5;break;case A:$=ce/i;break;case u:$=ce/r;break;case l:$=ce/n;break;default:$=ce}return F?$:ee.a($)},K.daysInMonth=function(){return this.endOf(C).$D},K.$locale=function(){return L[this.$L]},K.locale=function(V,G){if(!V)return this.$L;var F=this.clone(),$=J(V,G,!0);return $&&(F.$L=$),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()},Z}(),oe=ae.prototype;return Y.prototype=oe,[["$ms",s],["$s",l],["$m",u],["$H",A],["$W",g],["$M",C],["$y",I],["$D",E]].forEach(function(Z){oe[Z[1]]=function(K){return this.$g(K,Z[0],Z[1])}}),Y.extend=function(Z,K){return Z.$i||(Z(K,ae,Y),Z.$i=!0),Y},Y.locale=J,Y.isDayjs=q,Y.unix=function(Z){return Y(1e3*Z)},Y.en=L[P],Y.Ls=L,Y.p={},Y})})(Iv);var E8=Iv.exports;const Ur=ts(E8),Cf=({entityId:e,property:t,disabled:n,userResource:r="entities/user",...i})=>{const[s,l]=T.useState(null),u=O.useRecordContext(i),A=O.useDataProvider(),g=O.useResourceContext(),p=T.useCallback(async I=>{I.preventDefault(),I.stopPropagation();const E=ut.get(u,i==null?void 0:i.source),B=g.replace("entities/",""),y=await A.getFile(`/attachments/${B}/${e||(u==null?void 0:u.id)}/${t||(i==null?void 0:i.source)}/${(E==null?void 0:E.id)||(u==null?void 0:u.id)}`),R=document.createElement("a");R.href=y,R.download=ut.get(u,(i==null?void 0:i.title)||(i==null?void 0:i.source)),R.click()},[A,u,e,g,t,i==null?void 0:i.source,i==null?void 0:i.title]),C=T.useMemo(()=>({...u,[i==null?void 0:i.source]:(u==null?void 0:u.src)||ut.get(u,i==null?void 0:i.source),[i==null?void 0:i.title]:(u==null?void 0:u.title)||ut.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 T.useEffect(()=>{!u||!(u!=null&&u.userId)||A.getOne(r,{id:u==null?void 0:u.userId}).then(({data:I})=>l(I)).catch(()=>l(null))},[u,A,r]),f.jsx(mv,{...i,disabled:n,record:C,onClick:p,title:f.jsxs(b.Box,{sx:{cursor:"pointer"},children:[f.jsx(b.Typography,{variant:"subtitle1",children:ut.get(C,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),f.jsxs(b.Typography,{variant:"caption",color:"secondary",children:[ut.get(C,"sizeDescription"),s&&" | ",s&&h("ra.attachment.info",{user:s==null?void 0:s.name,created:Ur(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})};Cf.propTypes={...O.FileField.propTypes,source:c.string,title:c.string,disabled:c.bool};const B8=le(O.ImageField,{name:"RaApplicaImageField",slot:"root"})(()=>({})),Sa=e=>{const t=`_${e==null?void 0:e.source}`;return f.jsx(B8,{...e,source:t})};Sa.propTypes={...O.ImageField.propTypes,source:c.string};const uu=({width:e,height:t,circle:n,justify:r,record:i,...s})=>{const l=T.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 f.jsx(Sa,{sx:g=>({margin:0,display:"flex",justifyContent:r,"& img":{margin:"0px !important",border:`1px solid ${g.palette.divider}`,objectFit:"cover !important",...l,minWidth:l.width,minHeight:l.height}}),...s,record:A})};uu.defaultProps={...Sa.defaultProps,width:150,height:150,circle:!1,justify:"flex-start"};uu.propTypes={...Sa.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 Ev={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Kn,function(){return function(n,r,i){n=n||{};var s=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(g,p,C,h){return s.fromToBase(g,p,C,h)}i.en.relativeTime=l,s.fromToBase=function(g,p,C,h,I){for(var E,B,y,R=C.$locale().relativeTime||l,M=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],x=M.length,S=0;S<x;S+=1){var P=M[S];P.d&&(E=h?i(g).diff(C,P.d,!0):C.diff(g,P.d,!0));var L=(n.rounding||Math.round)(Math.abs(E));if(y=E>0,L<=P.r||!P.r){L<=1&&S>0&&(P=M[S-1]);var k=R[P.l];I&&(L=I(""+L)),B=typeof k=="string"?k.replace("%d",L):k(L,p,P.l,y);break}}if(p)return B;var q=y?R.future:R.past;return typeof q=="function"?q(B):q.replace("%s",B)},s.to=function(g,p){return u(g,p,this,!0)},s.from=function(g,p){return u(g,p,this)};var A=function(g){return g.$u?i.utc():i()};s.toNow=function(g){return this.to(A(this),g)},s.fromNow=function(g){return this.from(A(this),g)}}})})(Ev);var v8=Ev.exports;const y8=ts(v8);Ur.extend(y8);const Au=e=>{const t=O.useRecordContext(e),[n]=O.useLocaleState(),r=T.useMemo(()=>Ur(ut.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return f.jsxs(T.Fragment,{children:[f.jsx(O.DateField,{record:t,source:e.source,showTime:!0}),f.jsx("br",{}),f.jsx(b.Typography,{variant:"caption",color:"textSecondary",children:r})]})};Au.displayName="DateAgoField";Au.propTypes={source:c.string.isRequired};const Bv=le(O.DateField,{name:"RaApplicaDateField",slot:"Root"})(()=>({}));Bv.propTypes={...O.DateField.propTypes};const mf=e=>f.jsx(Bv,{...e});mf.defaultProps={...O.DateField.defaultProps,variant:"body1"};mf.propTypes={...O.DateField.propTypes};const vv=le(O.EmailField,{name:"RaApplicaEmailField",slot:"Root"})(()=>({}));vv.propTypes={...O.EmailField.propTypes};const If=e=>f.jsx(vv,{...e});If.defaultProps={...O.EmailField.defaultProps,variant:"body1"};If.propTypes={...O.EmailField.propTypes};const b8=le(O.FileField,{name:"RaApplicaFileField",slot:"root"})(()=>({})),Ef=({...e})=>{const t=O.useRecordContext(e),n=T.useCallback(r=>{r.preventDefault(),r.stopPropagation();const i=ut.get(t,`_${e==null?void 0:e.source}`,ut.get(t,e==null?void 0:e.source)),s=ut.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=s,l.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return f.jsx(b8,{...e,record:t,onClick:n})};Ef.propTypes={...O.FileField.propTypes,source:c.string,title:c.string};const yv=e=>f.jsx(O.FunctionField,{...e});yv.defaultProps={variant:"body1"};const Q8=le("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"}})),Bf=({source:e,defaultValue:t,...n})=>{const r=O.useRecordContext(n),i=ut.get(r,e,t);return f.jsx("span",{dangerouslySetInnerHTML:{__html:i&&i!==null?i:t}})};Bf.propTypes={defaultValue:c.any,source:c.string,record:c.object};Bf.defaultProps={defaultValue:"&nbsp;"};const bv=({title:e,children:t})=>e&&e!==!1?f.jsx(b.Tooltip,{title:e,placement:"top",children:t}):t;bv.propTypes={title:c.oneOfType([c.string,c.bool]),children:c.oneOfType([c.element,c.arrayOf(c.element)])};const vf=({label:e,source:t,defaultValue:n,children:r,tooltip:i,...s})=>{const{getCurrentDialog:l}=ni(),u=O.useRecordContext(s),A=O.useResourceContext(s),g=l(),p=T.useMemo(()=>!i||i===!1?!1:typeof i=="function"?i(u):typeof i=="string"?ut.get(u,i,i):i,[u,i]);return f.jsx(bv,{title:p,children:f.jsxs(T.Fragment,{children:[f.jsx(b.InputLabel,{children:f.jsx(O.FieldTitle,{label:e,source:t,resource:g||A})}),f.jsx(Q8,{...s,children:T.cloneElement(r,{source:t,record:u,defaultValue:n,resource:g||A})})]})})};vf.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};vf.defaultProps={defaultValue:"&nbsp;",children:f.jsx(Bf,{})};const x8=ba("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}}})),as=e=>f.jsx(x8,{children:f.jsx(O.ReferenceManyField,{pagination:f.jsx(O.Pagination,{}),...e})});as.defaultProps={...O.ReferenceManyField.defaultProps,margin:!1,border:!1};as.propTypes={...O.ReferenceManyField.propTypes,margin:c.bool,border:c.bool};const Qv=({source:e,...t})=>{const n=O.useRecordContext(t),r=ut.get(n,e,0),i=r/1024,s=i/1024,l=s/1024,u=l>1?`${l.toFixed(2)} GB`:s>1?`${s.toFixed(2)} MB`:i>1?`${i.toFixed(2)} KB`:`${r.toFixed(2)} B`;return f.jsx(b.Typography,{component:"span",variant:"body1",...t,children:u})};Qv.propTypes={record:c.object,source:c.string};const xv=le(O.TextField,{name:"RaApplicaTextField",slot:"Root"})(()=>({}));xv.propTypes={...O.TextField.propTypes};const yf=e=>f.jsx(xv,{...e});yf.defaultProps={...O.TextField.defaultProps,variant:"body1"};yf.propTypes={...O.TextField.propTypes};const at=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:s,divider:l,...u})=>{const A=Xt.useTheme(),{getCurrentDialog:g}=ni(),{source:p,resource:C,isRequired:h}=u,{fieldState:{invalid:I}}=O.useInput(u),E=g();return f.jsxs(b.Stack,{spacing:1,sx:{width:u!=null&&u.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:I?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:I===!0,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(O.FieldTitle,{label:e,source:p,resource:E||C,isRequired:h})}),T.isValidElement(t)?T.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&f.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:I===!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 w8=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},T8=le(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}},...w8(e)})),bf=({children:e,disabled:t,type:n,...r})=>{const i=O.useRecordContext(r),s=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}),f.jsx(at,{...r,children:f.jsx(T8,{disabled:t,children:T.cloneElement(e,{...e.props,entityId:l,property:s})})})};bf.propTypes={...O.FileInput.propTypes,children:c.node,multiple:c.bool,disabled:c.bool};bf.defaultProps={children:f.jsx(Cf,{title:"name",source:"path"}),multiple:!0,disabled:!1,type:"attachment"};const P8=le(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"}})),Qf=({...e})=>f.jsx(at,{...e,children:f.jsx(P8,{})});Qf.propTypes={...O.AutocompleteArrayInput.propTypes,...at.propTypes};Qf.defaultProps={...O.AutocompleteArrayInput.defaultProps,size:"small"};const S8=le(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"}})),xf=e=>{const{perPage:t,...n}=e;return f.jsx(at,{...n,children:f.jsx(S8,{})})};xf.propTypes={...O.AutocompleteInput.propTypes,...at.propTypes};xf.defaultProps={...O.AutocompleteInput.defaultProps,size:"small"};const R8=le(O.BooleanInput,{name:"RaApplicaBooleanInput",slot:"Root"})(()=>({})),wf=({horizontal:e,...t})=>{const n=Tt();return f.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:f.jsx(R8,{})})};wf.defaultProps={...O.BooleanInput.defaultProps,...at.defaultProps};wf.propTypes={...O.BooleanInput.propTypes,...at.propTypes,horizontal:c.bool};const O8=le(O.DateInput,{name:"RaApplicaDateInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Tf=e=>f.jsx(at,{...e,children:f.jsx(O8,{})});Tf.propTypes={...O.DateInput.propTypes,...at.propTypes};Tf.defaultProps={...O.DateInput.defaultProps,...at.defaultProps};const j8=le(O.DateTimeInput,{name:"RaApplicaDateTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Pf=e=>f.jsx(at,{...e,children:f.jsx(j8,{})});Pf.propTypes={...O.DateTimeInput.propTypes,...at.propTypes};Pf.defaultProps={...at.defaultProps};const M8=le(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}}})),Sf=({children:e,title:t,...n})=>{const r=Ba.useWatch({name:n.source}),i=O.useRecordContext(n),{source:s}=n,l=T.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const u=ut.get(i,s);if(u){const A=u.split("__");return A.length>0?A[A.length-1]:u}return u},[i,s,r]);return f.jsx(at,{...n,children:f.jsx(M8,{children:T.cloneElement(e,{...e.props,title:t||s,source:s,record:{...i,[s]:(r==null?void 0:r.title)||ut.get(i,s),[`_${s}`]:(r==null?void 0:r.src)||ut.get(i,`_${s}`),[t||s]:l}})})})};Sf.propTypes={...O.FileInput.propTypes,source:c.string,title:c.string,children:c.node};Sf.defaultProps={children:f.jsx(Ef,{})};const Rf=({children:e,title:t,...n})=>{const r=Ba.useWatch({name:n.source}),i=O.useRecordContext(n),{source:s}=n;return O.useInput({source:`__image__${n==null?void 0:n.source}`,defaultValue:n==null?void 0:n.source}),f.jsx(at,{...n,children:f.jsx(O.ImageInput,{accept:"image/*",children:T.cloneElement(e,{...e.props,title:t,source:s,record:{...i,[s]:(r==null?void 0:r.title)||ut.get(i,s),[`_${s}`]:(r==null?void 0:r.src)||ut.get(i,`_${s}`)}})})})};Rf.defaultProps={children:f.jsx(uu,{}),multiple:!1};Rf.propTypes={...O.ImageInput.propTypes,source:c.string,title:c.string,children:c.node,multiple:c.bool};const D8=le(O.NumberInput,{name:"RaApplicaNumberInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Of=e=>f.jsx(at,{...e,children:f.jsx(D8,{})});Of.propTypes={...O.NumberInput.propTypes,...at.propTypes};Of.defaultProps={...O.NumberInput.defaultProps,...at.defaultProps};const wv=({source:e,minWidth:t=300,children:n})=>{const r=O.useResourceContext(),i=O.useRecordContext(),[s,l]=T.useState(ut.get(i,e,"")),[u,A]=T.useState(!1),g=T.useCallback(E=>l(E.target.value),[]),p=O.useDataProvider(),C=T.useCallback(E=>{E.key==="Enter"&&(A(!0),p.update(r,{id:i.id,data:{...i,[e]:s,_changed:e}}).then(()=>A(!1)))},[s,p,r,i,e]),h=T.useCallback(()=>{ut.get(i,e)!==s&&(A(!0),p.update(r,{id:i.id,data:{...i,[e]:s,_changed:e}}).then(()=>A(!1)))},[s,p,r,e,i]),I=T.useCallback(E=>{A(!0),p.update(r,{id:i.id,data:{...i,[e]:E,_changed:e}}).then(()=>A(!1))},[p,r,e,i]);return T.useEffect(()=>l(ut.get(i,e)),[i,e]),n?T.cloneElement(n,{...n.props,source:e,value:s,onChange:I}):f.jsx(b.TextField,{value:s,disabled:u,onChange:g,onKeyPress:C,onBlur:h,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})};wv.propTypes={source:c.string.isRequired,minWidth:c.number,children:c.element};const jf=({children:e,...t})=>f.jsx(O.ReferenceArrayInput,{...t,children:T.cloneElement(e,{...t,source:e.props.source||t.source})});jf.propTypes={...O.ReferenceArrayInput.propTypes,children:c.element};jf.defaultProps={...O.ReferenceArrayInput.defaultProps};const Mf=({children:e,...t})=>f.jsx(O.ReferenceInput,{...t,children:T.cloneElement(e,{...t,source:e.props.source||t.source})});Mf.propTypes={...O.ReferenceInput.propTypes,children:c.element};Mf.defaultProps={...O.ReferenceInput.defaultProps};const Df=({reference:e,target:t,children:n,filters:r,actions:i,...s})=>f.jsx(O.ResourceContextProvider,{value:e,children:f.jsx(as,{perPage:5,pagination:f.jsx(O.Pagination,{}),...s,reference:e,target:t,children:f.jsxs(T.Fragment,{children:[f.jsx(O.ListToolbar,{filters:r,actions:i}),n]})})});Df.propTypes={...as.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])};Df.defaultProps={...as.defaultProps};const k8=le(O.SearchInput,{name:"RaApplicaSearchInput",slot:"root"})(()=>({})),F8=e=>f.jsx(k8,{...e}),Tv=le(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"}}));Tv.propTypes={...O.SelectArrayInput.propTypes};const kf=e=>f.jsx(at,{...e,children:f.jsx(Tv,{options:{autoWidth:!1}})});kf.defaultProps={optionText:"name",optionValue:"id"};kf.propTypes={...O.SelectArrayInput.propTypes,...at.propTypes};const L8=le(O.SelectInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}})),Pv=e=>f.jsx(at,{...e,children:f.jsx(L8,{})});Pv.propTypes={...O.SelectInput.propTypes,...at.propTypes};const qn=e=>f.jsx(at,{...e,children:f.jsx(O.TextInput,{})});qn.propTypes={...O.TextInput.propTypes,...at.propTypes};const du=({...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=Ba.useController({name:e==null?void 0:e.source}))==null?void 0:u.field)==null?void 0:A.value;let i=e.helperText,s=e.validate;s?Array.isArray(s)&&s.indexOf(n)===-1&&s.push(n):s=[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),f.jsx(qn,{...e,validate:s,helperText:i,inputProps:{maxLength:e==null?void 0:e.maxLength}})};du.displayName="SmartTextInput";du.defaultProps={multiline:!1};du.propTypes={...qn.propTypes,maxLength:c.number,multiline:c.bool,rows:c.number};const Sv=e=>{const t=e.split(":");t.length===1&&t.push("00");const n=parseInt(t[0]),r=parseInt(t[1]);return Ur().hour(n).minute(r)};function N8(){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 V8=e=>{if(!e)return"";const t=Sv(e);return t?t.format("HH:mm"):""},H8=e=>e,W8=le(O.TimeInput,{name:"RaApplicaTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Ff=e=>f.jsx(at,{...e,children:f.jsx(W8,{})});Ff.defaultProps={...O.TimeInput.defaultProps,format:V8,parse:H8};Ff.propTypes={...O.TimeInput.propTypes,...at.propTypes};const Lf=({onSuccess:e,firstAccess:t})=>{const{spacing:n}=Dn(),[r,i]=T.useState(!1),s=me.useAuthProvider(),l=me.useTranslate(),u=me.useNotify(),A=T.useCallback(g=>{const{oldPassword:p,newPassword:C}=g;i(!0),s==null||s.changePassword(p,C).then(()=>{u("ra.auth.password_changed"),e()}).catch(h=>u(h,{type:"error"})).finally(()=>i(!1))},[s,e]);return f.jsx(me.ResourceContextProvider,{value:"user/change-password",children:f.jsx(me.EditContextProvider,{value:{record:{},resource:"user/change-password",save:A},children:f.jsx(lu,{onSubmit:A,toolbar:f.jsx(Kr,{children:f.jsx(O.SaveButton,{disabled:r})}),children:f.jsxs(b.Grid,{container:!0,spacing:n,children:[t===!0&&f.jsx(b.Grid,{item:!0,xs:12,children:f.jsxs(b.Alert,{severity:"warning",children:[f.jsx(b.AlertTitle,{children:l("ra.auth.first_access.change_password")}),l("ra.auth.first_access.change_password_helper")]})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(qn,{source:"oldPassword",type:"password",validate:me.required()})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(qn,{source:"newPassword",type:"password",validate:me.required()})})]})})})})},z8=le(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"}})),U8=le(b.CardHeader)(({theme:e})=>({marginTop:e.spacing(4),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),Y8=le(b.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`})),Nf=({title:e,divider:t,variant:n})=>{const r=O.useTranslate();return f.jsxs(T.Fragment,{children:[f.jsx(U8,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&f.jsx(Y8,{})]})};Nf.propTypes={title:c.string.isRequired,divider:c.bool,variant:c.oneOf(["h1","h2","h3","h4","h5","h6"])};Nf.defaultProps={divider:!0,variant:"h4"};const G8=le(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)}}}));function Rv(e){const{spacing:t}=Dn(),{spacing:n=t}=e,r=Ce.omit(e,["spacing"]);return f.jsx(O.Form,{...r,children:f.jsx(G8,{container:!0,spacing:n*2,children:e.children})})}function tg(e){return e.id??e.label}function Ov(e,t){const n=`^${e}.`.replaceAll(".","\\."),r=new RegExp(n,"g");return t.match(r)!==null}function K8(e){return Ce.map(e,"id")}function Qc(e){const t=e.match(new RegExp("[^.]+","g"));return t===null?0:t.length}function jv(e,t){const n=e!==void 0?Qc(e):0;return Ce.chain(t).filter(i=>e!==void 0?Ov(e,i.id):!0).filter(i=>Qc(i.id)===n+1).value()}function q8(e,t){var s;const n=Ce.clone(e),{type:r,payload:i}=t;switch(r){case"setFormRootPath":return Ce.extend(n,{formRootPath:i});case"setSyncWithLocation":return Ce.extend(n,{syncWithLocation:i});case"setActiveItem":return Ce.includes(K8(e.items),i)?Ce.extend(n,{activeItem:i}):n;case"addItem":{const l=i.id,u=Ce.chain(n.items).clone().reject(A=>A.id===l).concat([i]).orderBy(A=>A.index).value();return Ce.extend(n,{items:u}),n.activeItem===void 0&&Ce.extend(n,{activeItem:i.id}),n}case"removeItem":{const l=Ce.isString(i)?i:i.id,u=Ce.chain(n.items).clone().reject(A=>A.id===l).value();return Ce.extend(n,{items:u}),n.activeItem===l&&Ce.extend(n,{activeItem:((s=Ce.first(u))==null?void 0:s.id)??void 0}),n}default:return n}}const J8={syncWithLocation:!0,items:[],activeItem:void 0},Mv=T.createContext(void 0);function Dv(e){const t=!!(e.syncWithLocation??!0),{rootMatchString:n}=e,{pathname:r}=ia.useLocation(),[i,s]=T.useReducer(q8,Ce.cloneDeep(J8)),{formRootPath:l,items:u}=i,A=T.useMemo(()=>({state:i,dispatch:s}),[i,s]);return T.useEffect(()=>{const g=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/show/*",":resource/:id/show/*","entities/:resource/:id/*",":resource/:id/*"];n!==void 0&&g.push(n);const p=Ce.chain(g).map(h=>ia.matchPath(h,r)).reject(h=>h===null).first().value(),C=p==null?void 0:p.pathnameBase;C!==void 0&&C!==l&&s({type:"setFormRootPath",payload:C})},[r,l,n]),T.useEffect(()=>{s({type:"setSyncWithLocation",payload:!!t})},[t,s]),T.useEffect(()=>{var g;if(t&&l!==void 0){let p=r.replace(l,"").replace(new RegExp(/^\/?/),"");Ce.isEmpty(p)&&(p=((g=Ce.chain(u).filter(C=>jv(C.id,u).length===0).orderBy([C=>Qc(C.id),C=>C.index]).first().value())==null?void 0:g.id)??void 0),s({type:"setActiveItem",payload:p})}},[s,l,r,u]),f.jsx(Mv.Provider,{value:A,children:e.children})}function kv(){const e=T.useContext(Mv);if(e===void 0)throw new Error("[LongForm] useFormContext: context undefined. Please provide a valid Context using LongForm.Provider");return e}function gu(){return kv().state}function Vf(){return kv().dispatch}function Fv(){return gu().formRootPath}function Lv(){return gu().activeItem}function Nv(){return gu().items}function Vv(){return gu().syncWithLocation}function Hv(){const e=Vf();return T.useCallback(n=>{e({type:"setActiveItem",payload:n})},[e])}function Wv(){const e=Vf();return T.useCallback(n=>{e({type:"addItem",payload:n})},[e])}function zv(){const e=Vf();return T.useCallback(n=>{e({type:"removeItem",payload:n})},[e])}var X8=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},Uv=e=>e.firstChild?e.firstChild.offsetParent===e:!0,Z8=(e,t)=>{let n=e,r=0;Uv(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},_8=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},ga=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?ga="sticky":CSS.supports("position","-webkit-sticky")&&(ga="-webkit-sticky"));var xc=!1;try{const e=Object.defineProperty({},"passive",{get(){xc={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var pd=e=>{const{el:t,onChange:n,unsubs:r,measure:i}=e;if(t===window){const s=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),l=i(s()),u=()=>{Object.assign(l,i(s())),n()};return window.addEventListener("resize",u,xc),r.push(()=>window.removeEventListener("resize",u)),l}else{const s=i(t.getBoundingClientRect()),l=()=>{Object.assign(s,i(t.getBoundingClientRect())),n()},u=new ResizeObserver(l);return u.observe(t),r.push(()=>u.disconnect()),s}},$8=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}},e6=(e,t,n)=>{const{bottom:r,offsetBottom:i,offsetTop:s}=n,l=X8(e);let u=!1;const A=()=>{u||requestAnimationFrame(()=>{const k=C();k!==x&&S(k),u=!1}),u=!0};let g=l===window?window.scrollY:l.scrollTop;const p=k=>{const{offsetTop:q,height:J}=I,{naturalTop:Y}=y,{height:ee}=R;return k+q+J>=Y+ee+M+i},C=()=>{const{height:k}=I,{height:q}=R;return q+s+i<=k?3:p(g)?1:2},h=l!==window&&Uv(l),I=pd({el:l,onChange:A,unsubs:t,measure:({height:k,top:q})=>({height:k,offsetTop:h?q:0})}),E=_8(e),B=E===window?{top:0,bottom:0}:$8(E),y=pd({el:E,onChange:A,unsubs:t,measure:({height:k})=>({height:k-B.top-B.bottom,naturalTop:E===window?0:Z8(E,l)+B.top+I.offsetTop})}),R=pd({el:e,onChange:A,unsubs:t,measure:({height:k})=>({height:k})});let M=0,x=C();const S=k=>{const q=x;if(x=k,q===2&&(M=-1),k===3){e.style.position=ga,r?e.style.bottom=`${i}px`:e.style.top=`${s}px`;return}const{height:J,offsetTop:Y}=I,{height:ee,naturalTop:ae}=y,{height:oe}=R;if(k===2)if(e.style.position="relative",M=q===0?Math.max(0,Y+g-ae+s):Math.max(0,Y+g+J-(ae+oe+i)),r){const Z=Math.max(0,ee-oe-M);e.style.bottom=`${Z}px`}else e.style.top=`${M}px`;else e.style.position=ga,k===1?r?e.style.bottom=`${i}px`:e.style.top=`${J-oe-i}px`:r?e.style.bottom=`${J-oe-i}px`:e.style.top=`${s}px`};S(x);const P=k=>{if(k===g)return;const q=k-g;if(g=k,x===3)return;const{offsetTop:J,height:Y}=I,{naturalTop:ee,height:ae}=y,{height:oe}=R;if(q>0)if(x===0){if(k+J+s>ee){const Z=Math.max(0,J+g-ee+s);k+J+Y<=ee+oe+Z+i?S(2):S(1)}}else x===2&&p(k)&&S(1);else if(x===1){if(J+k+Y<ee+ae+i){const Z=Math.max(0,J+g+Y-(ee+oe+i));J+k+s>=ee+Z?S(2):S(0)}}else x===2&&J+k+s<ee+M&&S(0)},L=l===window?()=>P(window.scrollY):()=>P(l.scrollTop);l.addEventListener("scroll",L,xc),l.addEventListener("mousewheel",L,xc),t.push(()=>l.removeEventListener("scroll",L),()=>l.removeEventListener("mousewheel",L))},t6=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,i]=T.useState(null);return T.useEffect(()=>{if(!r||!ga)return;const s=[];return e6(r,s,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{s.forEach(l=>l())}},[r,t,e,n]),i},n6=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:i,className:s,style:l}=e,u=t6({offsetTop:t,offsetBottom:n,bottom:r});return f.jsx("div",{className:s,style:l,ref:u,children:i})},r6=n6,Yv=(e=>(e.TOP="top",e.BOTTOM="bottom",e))(Yv||{});function Gv(e){const{sticky:t=!0,disposition:n={xl:3,lg:3,md:4,sm:4,xs:12},spacing:r=2}=e,i=Ce.omit(e,["sticky","disposition","spacing"]),s=t?r6:b.Box,l=T.useMemo(()=>t?{offsetTop:74,offsetBottom:r*2}:{},[t,r]);return f.jsx(b.Grid,{...i,item:!0,...n,children:f.jsx(s,{...l,children:f.jsx(b.Stack,{spacing:r,children:e.children})})})}function Kv(e){return f.jsx(f.Fragment,{children:e.children})}function qv(e){const{children:t}=e;return T.useMemo(()=>{const r={top:[],bottom:[]};return T.Children.forEach(t,i=>{if(T.isValidElement(i)&&(i==null?void 0:i.type)===Kv){const{position:s}=i.props;switch(s){case"top":r.top.push(i);break;case"bottom":r.bottom.push(i);break}}}),r},[t])}function Jv(e){const{disposition:t={xl:9,lg:9,md:8,sm:8,xs:12}}=e,n=Ce.omit(e,["disposition"]);return f.jsx(b.Grid,{...n,item:!0,...t,children:e.children})}function Xv(e){const t=Lv();return e===t||Ov(e,t??"")}function Zv(e){const t=Nv();return T.useMemo(()=>jv(e,t),[t,e])}function o6(){const e=Fv(),t=ia.useNavigate();return T.useCallback(r=>{t(`${e}/${r}`)},[e,t])}function _v(){const e=Zv();return f.jsx(b.Card,{variant:"outlined",children:f.jsx(b.List,{sx:{"& .MuiListItemButton-root.Mui-selected":{borderColor:"palette.primary.main",borderRightStyle:"solid",borderRightWidth:2},"& .MuiListItemAvatar-root":{minWidth:24}},children:Ce.map(e,(t,n)=>f.jsx(Hf,{...t},n))})})}function Hf(e){const t=me.useTranslate()??Ce.identity,n=$v(e),{selected:r,label:i,icon:s,onClick:l,badge:u,items:A,isGroup:g,level:p}=n,{spacing:C}=Dn(),[h,I]=T.useState(r),E=T.useCallback(R=>{I(!h),l(R)},[l,h]),B=s!==void 0,y=Ce.omit(e,["label","icon","selected","badge"]);return f.jsxs(f.Fragment,{children:[f.jsx(b.ListItem,{...y,disablePadding:!0,children:f.jsxs(b.ListItemButton,{selected:r&&!g,onClick:E,sx:{pl:C*p},children:[B&&f.jsx(b.ListItemIcon,{children:s}),f.jsx(b.ListItemText,{inset:!B,primary:t(i)}),u&&f.jsx(b.ListItemAvatar,{children:f.jsx(da,{type:"filled",size:"xs",color:u.color??"default",children:u.content})}),g&&(h?f.jsx(In.ExpandLess,{}):f.jsx(In.ExpandMore,{}))]})}),g&&f.jsx(b.Collapse,{in:h,timeout:"auto",children:f.jsx(b.List,{children:Ce.map(A,(R,M)=>f.jsx(Hf,{...R},M))})})]})}function $v(e){const{id:t}=e,n=Xv(t),r=Qc(t),i=o6(),s=Vv(),l=Hv(),u=Zv(t),A=!Ce.isEmpty(u),g=T.useCallback(C=>{A||(s?i(e.id):l(e.id)),Ce.isFunction(e.onClick)&&e.onClick(C)},[l,i,e,s,A]);return T.useMemo(()=>({...e,selected:n,onClick:g,items:u,isGroup:A,level:r}),[e,n,g,u,A])}function ey(e){const{label:t,icon:n,badge:r,index:i=0}=e,s=tg(e),l=Wv(),u=zv(),A=Xv(s);return T.useEffect(()=>(l({id:s,index:i,label:t,icon:n,badge:r}),()=>{u(s)}),[l,u,t,n,s,r,i]),f.jsx(b.Box,{display:A?"unset":"none",children:e.children})}function ty(e){const t=Wf(e),n=tg(e);return f.jsx(ey,{...e,id:n,children:T.Children.map(t,r=>{const i=tg(r.props);return T.cloneElement(r,{id:`${n}.${i}`})})})}function ny(e){return f.jsx(ey,{...e})}function Wf(e){const{children:t}=e;return T.useMemo(()=>Ce.chain(T.Children.toArray(t)).filter(r=>T.isValidElement(r)&&((r==null?void 0:r.type)===ny||(r==null?void 0:r.type)===ty)).map((r,i)=>T.cloneElement(r,{index:i})).value(),[t])}function i6(e){const{tabsDisposition:t,contentDisposition:n,spacing:r=2}=e,i=Ce.pick(e,["syncWithLocation"]),s=Ce.omit(e,["tabsDisposition","contentDisposition","syncWithLocation"]),{top:l,bottom:u}=qv(e),A=Wf(e);return f.jsx(Dv,{...i,children:f.jsxs(Rv,{...s,spacing:r,children:[f.jsxs(Gv,{disposition:t,spacing:r,children:[l,f.jsx(_v,{}),u]}),f.jsx(Jv,{disposition:n,children:A})]})})}const Dt=i6;Dt.BaseForm=Rv;Dt.Content=Jv;Dt.Provider=Dv;Dt.useItems=Nv;Dt.useSyncWithLocation=Vv;Dt.useFormRootPath=Fv;Dt.useActiveItem=Lv;Dt.useSetActiveItem=Hv;Dt.useAddItem=Wv;Dt.useRemoveItem=zv;Dt.Sidebar=Gv;Dt.SidebarSection=Kv;Dt.SidebarSectionPosition=Yv;Dt.useSidebarChildren=qv;Dt.NavMenu=_v;Dt.NavMenuItem=Hf;Dt.useNavMenuItem=$v;Dt.Tab=ny;Dt.Group=ty;Dt.useBaseItemChildren=Wf;const s6=le(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"}})),a6=le(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}}})),fu=ba(O.TabbedForm,{name:"RaApplicaTabbedForm",slot:"Root"})(()=>({}));fu.propTypes={...O.TabbedForm.propTypes};fu.defaultProps={...O.TabbedForm.defaultProps};fu.Tab=O.TabbedForm.Tab;const ry=T.createContext(void 0),l6=T.createContext(void 0),c6=()=>T.useContext(ry),u6=D.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:i=!1,index:s,member:l,resource:u}=e,A=O.useTranslate(),[g,p]=D.useState(!1),{total:C,remove:h}=c6(),I=D.useCallback(()=>{p(!1),h(s)},[s,h]),E=T.useMemo(()=>({index:s,total:C,remove:()=>h(s)}),[s,C,h]);return f.jsxs(l6.Provider,{value:E,children:[T.Children.map(n,(B,y)=>{if(!T.isValidElement(B))return null;const{source:R,...M}=B.props;return f.jsx(b.TableCell,{sx:{border:0,verticalAlign:"top"},children:T.cloneElement(B,{source:R?`${l}.${R}`:l,index:R?void 0:y,resource:u,disabled:r,...M,label:""})})}),!i&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",border:0,pt:2.5},children:f.jsx(os,{horizontal:!0,children:f.jsx(b.Typography,{color:"error",onClick:()=>p(!0),children:A("ra.action.delete")})})}),n.length>0&&f.jsx(O.Confirm,{isOpen:g,title:A("ra.action.remove_item"),content:A("ra.message.remove_item"),onConfirm:I,onClose:()=>p(!1)})]})});var A6=Array.isArray,zf=A6,d6=typeof Kn=="object"&&Kn&&Kn.Object===Object&&Kn,g6=d6,f6=g6,p6=typeof self=="object"&&self&&self.Object===Object&&self,h6=f6||p6||Function("return this")(),Uf=h6,C6=Uf,m6=C6.Symbol,Yf=m6,ZI=Yf,oy=Object.prototype,I6=oy.hasOwnProperty,E6=oy.toString,Ns=ZI?ZI.toStringTag:void 0;function B6(e){var t=I6.call(e,Ns),n=e[Ns];try{e[Ns]=void 0;var r=!0}catch{}var i=E6.call(e);return r&&(t?e[Ns]=n:delete e[Ns]),i}var v6=B6,y6=Object.prototype,b6=y6.toString;function Q6(e){return b6.call(e)}var x6=Q6,_I=Yf,w6=v6,T6=x6,P6="[object Null]",S6="[object Undefined]",$I=_I?_I.toStringTag:void 0;function R6(e){return e==null?e===void 0?S6:P6:$I&&$I in Object(e)?w6(e):T6(e)}var iy=R6;function O6(e){return e!=null&&typeof e=="object"}var j6=O6,M6=iy,D6=j6,k6="[object Symbol]";function F6(e){return typeof e=="symbol"||D6(e)&&M6(e)==k6}var Gf=F6,L6=zf,N6=Gf,V6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H6=/^\w*$/;function W6(e,t){if(L6(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||N6(e)?!0:H6.test(e)||!V6.test(e)||t!=null&&e in Object(t)}var z6=W6;function U6(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var sy=U6,Y6=iy,G6=sy,K6="[object AsyncFunction]",q6="[object Function]",J6="[object GeneratorFunction]",X6="[object Proxy]";function Z6(e){if(!G6(e))return!1;var t=Y6(e);return t==q6||t==J6||t==K6||t==X6}var _6=Z6,$6=Uf,eF=$6["__core-js_shared__"],tF=eF,hd=tF,eE=function(){var e=/[^.]+$/.exec(hd&&hd.keys&&hd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function nF(e){return!!eE&&eE in e}var rF=nF,oF=Function.prototype,iF=oF.toString;function sF(e){if(e!=null){try{return iF.call(e)}catch{}try{return e+""}catch{}}return""}var aF=sF,lF=_6,cF=rF,uF=sy,AF=aF,dF=/[\\^$.*+?()[\]{}|]/g,gF=/^\[object .+?Constructor\]$/,fF=Function.prototype,pF=Object.prototype,hF=fF.toString,CF=pF.hasOwnProperty,mF=RegExp("^"+hF.call(CF).replace(dF,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function IF(e){if(!uF(e)||cF(e))return!1;var t=lF(e)?mF:gF;return t.test(AF(e))}var EF=IF;function BF(e,t){return e==null?void 0:e[t]}var vF=BF,yF=EF,bF=vF;function QF(e,t){var n=bF(e,t);return yF(n)?n:void 0}var ay=QF,xF=ay,wF=xF(Object,"create"),pu=wF,tE=pu;function TF(){this.__data__=tE?tE(null):{},this.size=0}var PF=TF;function SF(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var RF=SF,OF=pu,jF="__lodash_hash_undefined__",MF=Object.prototype,DF=MF.hasOwnProperty;function kF(e){var t=this.__data__;if(OF){var n=t[e];return n===jF?void 0:n}return DF.call(t,e)?t[e]:void 0}var FF=kF,LF=pu,NF=Object.prototype,VF=NF.hasOwnProperty;function HF(e){var t=this.__data__;return LF?t[e]!==void 0:VF.call(t,e)}var WF=HF,zF=pu,UF="__lodash_hash_undefined__";function YF(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=zF&&t===void 0?UF:t,this}var GF=YF,KF=PF,qF=RF,JF=FF,XF=WF,ZF=GF;function ls(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])}}ls.prototype.clear=KF;ls.prototype.delete=qF;ls.prototype.get=JF;ls.prototype.has=XF;ls.prototype.set=ZF;var _F=ls;function $F(){this.__data__=[],this.size=0}var e9=$F;function t9(e,t){return e===t||e!==e&&t!==t}var n9=t9,r9=n9;function o9(e,t){for(var n=e.length;n--;)if(r9(e[n][0],t))return n;return-1}var hu=o9,i9=hu,s9=Array.prototype,a9=s9.splice;function l9(e){var t=this.__data__,n=i9(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():a9.call(t,n,1),--this.size,!0}var c9=l9,u9=hu;function A9(e){var t=this.__data__,n=u9(t,e);return n<0?void 0:t[n][1]}var d9=A9,g9=hu;function f9(e){return g9(this.__data__,e)>-1}var p9=f9,h9=hu;function C9(e,t){var n=this.__data__,r=h9(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var m9=C9,I9=e9,E9=c9,B9=d9,v9=p9,y9=m9;function cs(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])}}cs.prototype.clear=I9;cs.prototype.delete=E9;cs.prototype.get=B9;cs.prototype.has=v9;cs.prototype.set=y9;var b9=cs,Q9=ay,x9=Uf,w9=Q9(x9,"Map"),T9=w9,nE=_F,P9=b9,S9=T9;function R9(){this.size=0,this.__data__={hash:new nE,map:new(S9||P9),string:new nE}}var O9=R9;function j9(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var M9=j9,D9=M9;function k9(e,t){var n=e.__data__;return D9(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Cu=k9,F9=Cu;function L9(e){var t=F9(this,e).delete(e);return this.size-=t?1:0,t}var N9=L9,V9=Cu;function H9(e){return V9(this,e).get(e)}var W9=H9,z9=Cu;function U9(e){return z9(this,e).has(e)}var Y9=U9,G9=Cu;function K9(e,t){var n=G9(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var q9=K9,J9=O9,X9=N9,Z9=W9,_9=Y9,$9=q9;function us(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])}}us.prototype.clear=J9;us.prototype.delete=X9;us.prototype.get=Z9;us.prototype.has=_9;us.prototype.set=$9;var eL=us,ly=eL,tL="Expected a function";function Kf(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(tL);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var l=e.apply(this,r);return n.cache=s.set(i,l)||s,l};return n.cache=new(Kf.Cache||ly),n}Kf.Cache=ly;var nL=Kf,rL=nL,oL=500;function iL(e){var t=rL(e,function(r){return n.size===oL&&n.clear(),r}),n=t.cache;return t}var sL=iL,aL=sL,lL=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cL=/\\(\\)?/g,uL=aL(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(lL,function(n,r,i,s){t.push(i?s.replace(cL,"$1"):r||n)}),t}),AL=uL;function dL(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 gL=dL,rE=Yf,fL=gL,pL=zf,hL=Gf,CL=1/0,oE=rE?rE.prototype:void 0,iE=oE?oE.toString:void 0;function cy(e){if(typeof e=="string")return e;if(pL(e))return fL(e,cy)+"";if(hL(e))return iE?iE.call(e):"";var t=e+"";return t=="0"&&1/e==-CL?"-0":t}var mL=cy,IL=mL;function EL(e){return e==null?"":IL(e)}var BL=EL,vL=zf,yL=z6,bL=AL,QL=BL;function xL(e,t){return vL(e)?e:yL(e,t)?[e]:bL(QL(e))}var wL=xL,TL=Gf,PL=1/0;function SL(e){if(typeof e=="string"||TL(e))return e;var t=e+"";return t=="0"&&1/e==-PL?"-0":t}var RL=SL,OL=wL,jL=RL;function ML(e,t){t=OL(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[jL(t[n++])];return n&&n==r?e:void 0}var DL=ML,kL=DL;function FL(e,t,n){var r=e==null?void 0:kL(e,t);return r===void 0?n:r}var LL=FL;const NL=ts(LL),uy=e=>{var Z,K;const{children:t,resource:n,source:r,label:i,disableActions:s=!1,disableAdd:l=!1,disableRemove:u=!1,className:A,empty:g,template:p={}}=e,[C,h]=T.useState(!1),{fields:I,remove:E,replace:B,append:y}=O.useArrayInput(e),{resetField:R}=Ba.useFormContext(),M=Tt(),x=me.useTranslate(),S=me.useRecordContext(e),P=T.useRef(p||{}),L=me.useTranslateLabel(),k=T.useCallback(V=>{E(V)},[E]);if(I.length>0){const{...V}=I[0];P.current=V;for(const G in P.current)P.current[G]=null}const q=T.useCallback((V=void 0)=>{let G=V;V==null&&(G=P.current,T.Children.count(t)===1&&D.isValidElement(T.Children.only(t))&&!T.Children.only(t).props.source&&T.Children.map(t,$=>D.isValidElement($)&&$.type!==me.FormDataConsumer).some(Boolean)?G="":(G=G||{},T.Children.forEach(t,$=>{D.isValidElement($)&&$.type!==me.FormDataConsumer&&$.props.source&&(G[$.props.source]=$.props.defaultValue??null)})));const F={...G,...p};y(F),R(`${r}.${I.length}`,{defaultValue:G})},[y,t,R,r,I.length,p]),J=V=>G=>{q(),V&&V(G)},Y=T.useCallback(()=>{B([]),h(!1)},[B]),ee=NL(S,r),ae=T.useMemo(()=>({total:I.length,remove:k,source:r}),[I.length,k,r]),oe=M.palette.mode==="dark"?M.palette.grey.A400:M.palette.grey.A800;return I?f.jsx(ry.Provider,{value:ae,children:f.jsxs("div",{className:A,children:[D.cloneElement(f.jsx(Ay,{}),{label:i,source:r,disableAdd:l,template:p,onClick:J((K=(Z=e==null?void 0:e.addButton)==null?void 0:Z.props)==null?void 0:K.onClick)}),f.jsx(b.TableContainer,{component:b.Paper,sx:{mt:2,border:`1px solid ${oe}`},children:f.jsxs(b.Table,{children:[f.jsx(b.TableHead,{sx:{borderTop:0,borderBottom:`1px solid ${oe}`},children:f.jsxs(b.TableRow,{children:[T.Children.map(t,(V,G)=>D.isValidElement(V)?f.jsx(b.TableCell,{children:f.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none",children:L({...V.props,resource:n})})},G):null),!s&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"top"},children:f.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none"})},"actions")]})}),f.jsxs(b.TableBody,{children:[I.length===0&&f.jsx(b.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0}},children:f.jsx(b.TableCell,{colSpan:4+(s?0:1),align:"center",children:g||f.jsx(b.Typography,{variant:"body1",color:"text.secondary",children:"-"})})}),I.length>0&&I.map((V,G)=>f.jsx(b.TableRow,{sx:{borderBottom:`1px solid ${oe}}`},children:f.jsx(u6,{disableRemove:u,disableActions:s,index:G,member:`${r}.${G}`,onRemoveField:k,record:ee&&ee[G]||{},resource:n,source:r,children:t})},V.id))]})]})}),I.length>0&&f.jsx(O.Confirm,{isOpen:C,title:x("ra.action.clear_array_input"),content:x("ra.message.clear_array_input"),onConfirm:Y,onClose:()=>h(!1)})]})}):null},Ay=e=>{const{label:t,disableAdd:n,onClick:r}=e,i=Tt(),s=i.palette.mode==="dark"?i.palette.grey.A400:i.palette.grey.A800,l=i.palette.mode==="light"?"#000000":"#FFFFFF";return f.jsxs(b.Stack,{justifyContent:"space-between",alignItems:"center",flexDirection:"row",children:[t!==!1&&f.jsx(b.Typography,{children:t}),!n&&(D.isValidElement(e==null?void 0:e.addButton)?D.cloneElement(e==null?void 0:e.addButton,{onClick:r}):f.jsx(b.IconButton,{size:"small",color:"secondary",sx:{border:`1px solid ${s}`},onClick:r,children:f.jsx(it.PlusCircleOutlined,{style:{color:l}})}))]})},VL=le(uy,{name:"RaApplicaTableFormIterator",slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8)})`}}}));Ay.propTypes={label:c.oneOfType([c.string,c.bool]),source:c.string,defaultValue:c.any};uy.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.oneOfType([c.string,c.bool]),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]),template:c.object};function HL(e,t){const n=Ce.clone(e),{type:r,payload:i}=t;switch(r){case"updateMedia":{const s=Ce.chain(n.media).clone().extend(i).value();return Ce.extend(n,{media:s})}case"updateDrawer":{const s=Ce.chain(n.drawer).clone().extend(i).value();return Ce.extend(n,{drawer:s})}case"updateLogo":{const s=Ce.chain(n.logo).clone().extend(i).value();return Ce.extend(n,{logo:s})}case"updateNotifications":{const s=Ce.chain(n.notifications).clone().extend(i).value();return Ce.extend(n,{notifications:s})}case"updateTheme":{const s=Ce.chain(n.theme).clone().extend(i).value();return Ce.extend(n,{theme:s})}default:return n}}const WL={drawer:{open:!0,width:260,handleDrawerToggle:()=>{}},media:{downMd:!1,downLg:!1,downXl:!1,horizontal:!1},logo:{},notifications:{enable:!0,resource:"entities/notification"},theme:{iconColor:"grey.300",iconColorOpen:"grey.100"}},dy=T.createContext(void 0);function gy(e){var q;const t=me.useGetIdentity(),n=b.useTheme(),r=b.useMediaQuery(n.breakpoints.down("md")),i=b.useMediaQuery(n.breakpoints.down("lg")),s=b.useMediaQuery(n.breakpoints.down("xl")),{miniDrawer:l,isHorizontalLayout:u,menuOrientation:A,drawerWidth:g}=Dn(),p=u(A)&&!i,{drawerOpen:C,openDrawer:h}=ho(),I=T.useCallback(()=>{h(!C)},[C,h]),[E,B]=T.useState(!1),[y,R]=T.useReducer(HL,Ce.chain(WL).clone().merge({drawer:{open:!l||C}}).value()),M=T.useCallback(()=>B(!1),[]),x=T.useMemo(()=>({state:y,dispatch:R}),[y,R]),{logoIcon:S,logoMain:P,enableNotification:L,notification:k}=e;return T.useEffect(()=>{R({type:"updateMedia",payload:{downMd:r,downLg:i,downXl:s,horizontal:p}})},[A,r,i,s]),T.useEffect(()=>{R({type:"updateDrawer",payload:{open:C,width:g,handleDrawerToggle:I}})},[C,g,I]),T.useEffect(()=>{l||h(!s)},[s,l]),T.useEffect(()=>{R({type:"updateLogo",payload:{main:P,icon:S}})},[S,P]),T.useEffect(()=>{R({type:"updateNotifications",payload:{enable:L,resource:k??"entities/notification"}})},[L,k]),T.useEffect(()=>{R({type:"updateTheme",payload:{iconColorOpen:n.palette.mode==="dark"?"grey.200":"grey.300",iconColor:n.palette.mode==="dark"?"background.default":"grey.100"}})},[n.palette.mode]),T.useEffect(()=>{var J;B(((J=t==null?void 0:t.data)==null?void 0:J.needToChangePassword)===!0)},[(q=t==null?void 0:t.data)==null?void 0:q.needToChangePassword]),f.jsxs(dy.Provider,{value:x,children:[f.jsx(b.Dialog,{open:E,maxWidth:"xs",fullWidth:!0,children:f.jsx(Lf,{onSuccess:M,firstAccess:!0})}),e.children]})}function fy(e){return T.forwardRef((t,n)=>{const{logoIcon:r,logoMain:i,enableNotification:s}=t;return f.jsx(gy,{logoIcon:r,logoMain:i,enableNotification:s,children:f.jsx(e,{ref:n,...t})})})}function qf(){const e=T.useContext(dy);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function zL(){return qf().dispatch}function As(){return qf().state}function $n(){return As().media}function ii(){return As().drawer}function py(){return As().logo}function mu(){return As().notifications}function Iu(){return As().theme}function hy(){const{iconColor:e,iconColorOpen:t}=Iu(),{open:n,handleDrawerToggle:r}=ii();return f.jsx(Io,{"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?f.jsx(it.MenuFoldOutlined,{}):f.jsx(it.MenuUnfoldOutlined,{})})}function Cy(e){const t=T.useRef(),n=b.useTheme(),{downLg:r,horizontal:i}=$n(),{open:s,width:l}=ii(),u=r?b.AppBar:P0,A=is(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:i?"100%":s?`calc(100% - ${l}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),g={position:"fixed",color:"inherit",elevation:0,sx:A};return r||Ce.extend(g,{open:s}),f.jsx(u,{ref:t,...g,children:f.jsxs(b.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!i&&f.jsx(hy,{}),e.children]})})}function UL(e){const t=b.useTheme(),{notification:n,onClick:r,selected:i,divider:s}=e,{resource:l}=mu(),u=me.useNotify(),A=me.useRedirect(),[g]=me.useUpdate(l,{id:n==null?void 0:n.id,data:{...n,readed:Ur().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=T.useCallback(()=>g(),[g]),[C]=me.useLocaleState(),h=T.useMemo(()=>Ur(n.created).locale(C).fromNow(),[n,C]);return f.jsx(b.ListItem,{disablePadding:!0,divider:s,children:f.jsxs(b.ListItemButton,{selected:i,onClick:p,children:[f.jsx(b.ListItemAvatar,{children:f.jsx(b.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:f.jsx(it.MessageOutlined,{})})}),f.jsx(b.ListItemText,{primary:n.title,secondary:n.content}),f.jsx(b.Box,{flexGrow:1,flexShrink:1,minWidth:t.spacing(2)}),f.jsx(b.ListItemText,{primary:h,primaryTypographyProps:{variant:"caption"}})]})})}const YL={width:36,height:36,fontSize:"1rem"},GL={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function my(){const{enable:e}=mu();return e?f.jsx(KL,{}):null}function KL(){const e=b.useTheme(),t=T.useRef(),{resource:n}=mu(),{downMd:r}=$n(),{iconColor:i,iconColorOpen:s}=Iu(),[l,u]=T.useState(!1),[A,g]=T.useState([]),p=A.filter(B=>B.readed===null).length,C=T.useCallback(()=>u(!l),[l]),h=T.useCallback(()=>{t.current&&t.current.contains(event.target)||u(!1)},[t.current,u]),{data:I,isLoading:E}=me.useGetList(n,{pagination:{page:1,perPage:50},sort:{field:"created",order:"DESC"},filter:{readed:!1}});return T.useEffect(()=>{!E&&I&&g(I??[])},[I,E]),f.jsxs(b.Box,{sx:{flexShrink:0},children:[f.jsx(Io,{color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:l?s:i},"aria-label":"open profile",ref:t,"aria-controls":l?"profile-grow":void 0,"aria-haspopup":"true",onClick:C,children:f.jsx(b.Badge,{badgeContent:p,color:"primary",children:f.jsx(it.BellOutlined,{})})}),f.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})=>f.jsx(Eo,{type:"grow",position:r?"top":"top-right",in:open,...B,children:f.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:"100%",minWidth:285,maxWidth:420,[e.breakpoints.down("md")]:{maxWidth:285}},children:f.jsx(b.ClickAwayListener,{onClickAway:h,children:f.jsx(ur,{title:"Notification",elevation:0,border:!1,content:!1,secondary:f.jsx(f.Fragment,{children:p>0&&f.jsx(b.Tooltip,{title:"Mark as all read",children:f.jsx(Io,{color:"success",size:"small",children:f.jsx(it.CheckCircleOutlined,{style:{fontSize:"1.15rem"}})})})}),children:f.jsx(b.List,{component:"nav",sx:{p:0,"& .MuiListItemButton-root":{py:.5,"&.Mui-selected":{bgcolor:"grey.50",color:"text.primary"},"& .MuiAvatar-root":YL,"& .MuiListItemSecondaryAction-root":{...GL,position:"relative"}}},children:A.map((y,R)=>f.jsx(UL,{selected:p>0,notification:y,onClick:h,divider:R<A.length-1},y.id))})})})})})})]})}const qL=()=>{const[e,t]=T.useState(!1),n=T.useCallback(()=>t(!1),[t]),r=T.useCallback(()=>t(!0),[t]),i=me.useTranslate();return f.jsxs(T.Fragment,{children:[f.jsxs(b.ListItemButton,{onClick:r,children:[f.jsx(b.ListItemIcon,{children:f.jsx(In.Key,{})}),f.jsx(b.ListItemText,{primary:i("ra.auth.change_password")})]}),f.jsx(b.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:f.jsx(Lf,{onSuccess:n})})]})},JL=()=>{const e=me.useLogout(),t=me.useTranslate();return f.jsx(T.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:e,children:[f.jsx(b.ListItemIcon,{children:f.jsx(In.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:t("ra.auth.logout")})]})})},XL=()=>{const e=me.useTranslate(),t=me.useAuthProvider(),n=T.useCallback(()=>t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,i]=T.useState(!1);return T.useEffect(()=>{t.isImpersonating&&t.isImpersonating().then(s=>i(s))},[t,i]),r?f.jsx(T.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:n,children:[f.jsx(b.ListItemIcon,{children:f.jsx(In.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};c.node,c.any.isRequired,c.any.isRequired;const Iy=()=>{var B;const e=b.useTheme(),{identity:t}=O.useGetIdentity(),n=t!==void 0&&t.image&&t.image!==null&&t.image!=="",r=T.useRef(null),[i,s]=T.useState(!1),l=()=>{s(y=>!y)},u=y=>{r.current&&r.current.contains(y.target)||s(!1)},A=e.palette.mode==="dark"?"grey.200":"grey.300",g=O.useLogout(),p=O.useDataProvider(),C=O.useAuthProvider(),h=T.useCallback(()=>{g()},[C,g]),[I,E]=T.useState(null);return T.useEffect(()=>{if(!n)return;async function y(){var R=await p.getFile("/profile/me/image");E(R)}y()},[p,n]),f.jsxs(b.Box,{sx:{flexShrink:0},children:[f.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:f.jsxs(b.Stack,{direction:"row",spacing:2,alignItems:"center",sx:{p:.5},children:[f.jsx(da,{alt:(B=t==null?void 0:t.name)==null?void 0:B.toUpperCase(),src:I,size:"xs"}),f.jsx(b.Typography,{variant:"subtitle1",children:t==null?void 0:t.name})]})}),f.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:y})=>{var R;return f.jsx(Eo,{type:"grow",position:"top-right",in:i,...y,children:f.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:290,minWidth:240,maxWidth:290,[e.breakpoints.down("md")]:{maxWidth:250}},children:f.jsx(b.ClickAwayListener,{onClickAway:u,children:f.jsxs(ur,{elevation:0,border:!1,content:!1,children:[f.jsx(b.CardContent,{sx:{px:2.5,pt:3},children:f.jsxs(b.Grid,{container:!0,justifyContent:"space-between",alignItems:"center",children:[f.jsx(b.Grid,{item:!0,children:f.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[f.jsx(da,{alt:"profile user",src:I,sx:{width:32,height:32}}),f.jsxs(b.Stack,{children:[f.jsx(b.Typography,{variant:"h6",children:t==null?void 0:t.name}),f.jsx(b.Typography,{variant:"body2",color:"textSecondary",children:(R=t==null?void 0:t.roles)==null?void 0:R.map(M=>M.name.replace("ROLE_","")).join(",")})]})]})}),f.jsx(b.Grid,{item:!0,children:f.jsx(b.Tooltip,{title:"Logout",children:f.jsx(Io,{size:"large",sx:{color:"text.primary"},onClick:h,children:f.jsx(it.LogoutOutlined,{})})})})]})}),f.jsx(b.Grid,{container:!0,children:f.jsx(b.Grid,{item:!0,xs:12,children:f.jsxs(b.List,{component:"nav",sx:{p:0,"& .MuiListItemIcon-root":{minWidth:32}},children:[f.jsx(qL,{}),f.jsx(JL,{}),f.jsx(XL,{})]})})})]})})})})}})]})},Ey=e=>{const t=Tt(),{downMd:n}=$n(),{iconColor:r,iconColorOpen:i}=Iu(),[s,l]=T.useState(!1),u=T.useRef(null),A=T.useCallback(()=>{l(!s)},[s]),g=T.useCallback(p=>{u.current&&u.current.contains(p.target)||l(!1)},[]);return n?f.jsxs(f.Fragment,{children:[f.jsx(b.Box,{sx:{flexShrink:0},children:f.jsx(Io,{sx:{color:"text.primary",bgcolor:s?i:r},"aria-label":"open more menu",ref:u,"aria-controls":s?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:A,color:"secondary",variant:"light",children:f.jsx(it.MoreOutlined,{})})}),f.jsx(b.Popper,{placement:"bottom-end",open:s,anchorEl:u.current,role:void 0,transition:!0,disablePortal:!0,style:{width:"100%"},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:p})=>f.jsx(Eo,{type:"fade",in:s,...p,children:f.jsx(b.Paper,{sx:{boxShadow:t.customShadows.z1},children:f.jsx(b.ClickAwayListener,{onClickAway:g,children:f.jsx(b.AppBar,{color:"inherit",children:f.jsx(b.Toolbar,{children:e.children})})})})})})]}):f.jsx(f.Fragment,{children:e.children})};function By(e){return f.jsx(b.Box,{...e,flex:1})}function Ra(e){const{name:t,version:n}=e;return f.jsx(b.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:"24px 16px 0px",mt:"auto"},children:f.jsxs(b.Typography,{variant:"caption",children:[f.jsx("span",{dangerouslySetInnerHTML:{__html:(e==null?void 0:e.copy)||""}})," ",t," - ",n]})})}Ra.propTypes={name:c.string.isRequired,version:c.string.isRequired,copy:c.string};Ra.defaultProps={copy:"&copy; Applica Software Guru for"};var vy={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(vy);var Jf=vy.exports,Cd={};const ZL=eR(D5);var sE;function Xf(){return sE||(sE=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=ZL}(Cd)),Cd}function yy(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=yy(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function by(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=yy(e))&&(r&&(r+=" "),r+=t);return r}var ng=globalThis&&globalThis.__assign||function(){return ng=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},ng.apply(this,arguments)},_L=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Qy=function(e){var t=e.className,n=e.sx,r=_L(e,["className","sx"]),i=me.useLoading(),s=Tt();return D.createElement($L,{className:t,sx:n},i?D.createElement(gf,ng({className:by("app-loader",wc.loader),color:"inherit",size:s.spacing(2),thickness:6},r)):D.createElement(Zy,{className:wc.loadedIcon}))};Qy.propTypes={classes:c.object,className:c.string,width:c.string};var rg="RaLoadingIndicator",wc={loader:"".concat(rg,"-loader"),loadedIcon:"".concat(rg,"-loadedIcon")},$L=le("div",{name:rg,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={},t["& .".concat(wc.loader)]={marginLeft:n.spacing(1.5),marginRight:n.spacing(1.5)},t["& .".concat(wc.loadedIcon)]={},t});const Zf=e=>e.scrollTop;function Xi(e,t){var n,r;const{timeout:i,easing:s,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 s=="object"?s[t.mode]:s,delay:l.transitionDelay}}const eN=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function tN(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),s=rs(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const g=s.getComputedStyle(t);l=g.getPropertyValue("-webkit-transform")||g.getPropertyValue("transform")}let u=0,A=0;if(l&&l!=="none"&&typeof l=="string"){const g=l.split("(")[1].split(")")[0].split(",");u=parseInt(g[4],10),A=parseInt(g[5],10)}return e==="left"?i?`translateX(${i.right+u-r.left}px)`:`translateX(${s.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(${s.innerHeight+A-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-A}px)`:`translateY(-${r.top+r.height-A}px)`}function xy(e){return typeof e=="function"?e():e}function Wl(e,t,n){const r=xy(n),i=tN(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const wy=D.forwardRef(function(t,n){const r=Tt(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:u=!0,children:A,container:g,direction:p="down",easing:C=i,in:h,onEnter:I,onEntered:E,onEntering:B,onExit:y,onExited:R,onExiting:M,style:x,timeout:S=s,TransitionComponent:P=cf}=t,L=Ke(t,eN),k=D.useRef(null),q=On(A.ref,k,n),J=F=>$=>{F&&($===void 0?F(k.current):F(k.current,$))},Y=J((F,$)=>{Wl(p,F,g),Zf(F),I&&I(F,$)}),ee=J((F,$)=>{const W=Xi({timeout:S,style:x,easing:C},{mode:"enter"});F.style.webkitTransition=r.transitions.create("-webkit-transform",z({},W)),F.style.transition=r.transitions.create("transform",z({},W)),F.style.webkitTransform="none",F.style.transform="none",B&&B(F,$)}),ae=J(E),oe=J(M),Z=J(F=>{const $=Xi({timeout:S,style:x,easing:C},{mode:"exit"});F.style.webkitTransition=r.transitions.create("-webkit-transform",$),F.style.transition=r.transitions.create("transform",$),Wl(p,F,g),y&&y(F)}),K=J(F=>{F.style.webkitTransition="",F.style.transition="",R&&R(F)}),V=F=>{l&&l(k.current,F)},G=D.useCallback(()=>{k.current&&Wl(p,k.current,g)},[p,g]);return D.useEffect(()=>{if(h||p==="down"||p==="right")return;const F=t0(()=>{k.current&&Wl(p,k.current,g)}),$=rs(k.current);return $.addEventListener("resize",F),()=>{F.clear(),$.removeEventListener("resize",F)}},[p,h,g]),D.useEffect(()=>{h||G()},[h,G]),f.jsx(P,z({nodeRef:k,onEnter:Y,onEntered:ae,onEntering:ee,onExit:Z,onExited:K,onExiting:oe,addEndListener:V,appear:u,in:h,timeout:S},L,{children:(F,$)=>D.cloneElement(A,z({ref:q,style:z({visibility:F==="exited"&&!h?"hidden":void 0},x,A.props.style)},$))}))});process.env.NODE_ENV!=="production"&&(wy.propTypes={addEndListener:c.func,appear:c.bool,children:ns.isRequired,container:br(c.oneOfType([$o,c.func]),e=>{if(e.open){const t=xy(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 nN=wy;function rN(e){return typeof e=="string"}function oN(e,t,n){return e===void 0||rN(e)?t:z({},t,{ownerState:z({},t.ownerState,n)})}const iN={disableDefaultClasses:!1},sN=D.createContext(iN);function aN(e){const{disableDefaultClasses:t}=D.useContext(sN);return n=>t?"":e(n)}function Ty(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 lN(e,t,n){return typeof e=="function"?e(t,n):e}function aE(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 cN(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:s}=e;if(!t){const I=Je(i==null?void 0:i.className,r==null?void 0:r.className,s,n==null?void 0:n.className),E=z({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),B=z({},n,i,r);return I.length>0&&(B.className=I),Object.keys(E).length>0&&(B.style=E),{props:B,internalRef:void 0}}const l=Ty(z({},i,r)),u=aE(r),A=aE(i),g=t(l),p=Je(g==null?void 0:g.className,n==null?void 0:n.className,s,i==null?void 0:i.className,r==null?void 0:r.className),C=z({},g==null?void 0:g.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),h=z({},g,n,A,u);return p.length>0&&(h.className=p),Object.keys(C).length>0&&(h.style=C),{props:h,internalRef:g.ref}}const uN=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function AN(e){var t;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:s=!1}=e,l=Ke(e,uN),u=s?{}:lN(r,i),{props:A,internalRef:g}=cN(z({},l,{externalSlotProps:u})),p=On(g,u==null?void 0:u.ref,(t=e.additionalProps)==null?void 0:t.ref);return oN(n,z({},A,{ref:p}),i)}function dN(e){const t=cr(e);return t.body===e?rs(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function $s(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function lE(e){return parseInt(rs(e).getComputedStyle(e).paddingRight,10)||0}function gN(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 cE(e,t,n,r,i){const s=[t,n,...r];[].forEach.call(e.children,l=>{const u=s.indexOf(l)===-1,A=!gN(l);u&&A&&$s(l,i)})}function md(e,t){let n=-1;return e.some((r,i)=>t(r)?(n=i,!0):!1),n}function fN(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(dN(r)){const l=jR(cr(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${lE(r)+l}px`;const u=cr(r).querySelectorAll(".mui-fixed");[].forEach.call(u,A=>{n.push({value:A.style.paddingRight,property:"padding-right",el:A}),A.style.paddingRight=`${lE(A)+l}px`})}let s;if(r.parentNode instanceof DocumentFragment)s=cr(r).body;else{const l=r.parentElement,u=rs(r);s=(l==null?void 0:l.nodeName)==="HTML"&&u.getComputedStyle(l).overflowY==="scroll"?l:r}n.push({value:s.style.overflow,property:"overflow",el:s},{value:s.style.overflowX,property:"overflow-x",el:s},{value:s.style.overflowY,property:"overflow-y",el:s}),s.style.overflow="hidden"}return()=>{n.forEach(({value:s,el:l,property:u})=>{s?l.style.setProperty(u,s):l.style.removeProperty(u)})}}function pN(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class hN{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&&$s(t.modalRef,!1);const i=pN(n);cE(n,t.mount,t.modalRef,i,!0);const s=md(this.containers,l=>l.container===n);return s!==-1?(this.containers[s].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:i}),r)}mount(t,n){const r=md(this.containers,s=>s.modals.indexOf(t)!==-1),i=this.containers[r];i.restore||(i.restore=fN(i,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const i=md(this.containers,l=>l.modals.indexOf(t)!==-1),s=this.containers[i];if(s.modals.splice(s.modals.indexOf(t),1),this.modals.splice(r,1),s.modals.length===0)s.restore&&s.restore(),t.modalRef&&$s(t.modalRef,n),cE(s.container,t.mount,t.modalRef,s.hiddenSiblings,!1),this.containers.splice(i,1);else{const l=s.modals[s.modals.length-1];l.modalRef&&$s(l.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function CN(e){return typeof e=="function"?e():e}function mN(e){return e?e.props.hasOwnProperty("in"):!1}const IN=new hN;function EN(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=IN,closeAfterTransition:s=!1,onTransitionEnter:l,onTransitionExited:u,children:A,onClose:g,open:p,rootRef:C}=e,h=D.useRef({}),I=D.useRef(null),E=D.useRef(null),B=On(E,C),[y,R]=D.useState(!p),M=mN(A);let x=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(x=!1);const S=()=>cr(I.current),P=()=>(h.current.modalRef=E.current,h.current.mount=I.current,h.current),L=()=>{i.mount(P(),{disableScrollLock:r}),E.current&&(E.current.scrollTop=0)},k=co(()=>{const V=CN(t)||S().body;i.add(P(),V),E.current&&L()}),q=D.useCallback(()=>i.isTopModal(P()),[i]),J=co(V=>{I.current=V,V&&(p&&q()?L():E.current&&$s(E.current,x))}),Y=D.useCallback(()=>{i.remove(P(),x)},[x,i]);D.useEffect(()=>()=>{Y()},[Y]),D.useEffect(()=>{p?k():(!M||!s)&&Y()},[p,Y,M,s,k]);const ee=V=>G=>{var F;(F=V.onKeyDown)==null||F.call(V,G),!(G.key!=="Escape"||!q())&&(n||(G.stopPropagation(),g&&g(G,"escapeKeyDown")))},ae=V=>G=>{var F;(F=V.onClick)==null||F.call(V,G),G.target===G.currentTarget&&g&&g(G,"backdropClick")};return{getRootProps:(V={})=>{const G=Ty(e);delete G.onTransitionEnter,delete G.onTransitionExited;const F=z({},G,V);return z({role:"presentation"},F,{onKeyDown:ee(F),ref:B})},getBackdropProps:(V={})=>{const G=V;return z({"aria-hidden":!0},G,{onClick:ae(G),open:p})},getTransitionProps:()=>{const V=()=>{R(!1),l&&l()},G=()=>{R(!0),u&&u(),s&&Y()};return{onEnter:Md(V,A==null?void 0:A.props.onEnter),onExited:Md(G,A==null?void 0:A.props.onExited)}},rootRef:B,portalRef:J,isTopModal:q,exited:y,hasTransition:M}}const BN=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function vN(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 yN(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 bN(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||yN(e))}function QN(e){const t=[],n=[];return Array.from(e.querySelectorAll(BN)).forEach((r,i)=>{const s=vN(r);s===-1||!bN(r)||(s===0?t.push(r):n.push({documentOrder:i,tabIndex:s,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 xN(){return!0}function Tc(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:s=QN,isEnabled:l=xN,open:u}=e,A=D.useRef(!1),g=D.useRef(null),p=D.useRef(null),C=D.useRef(null),h=D.useRef(null),I=D.useRef(!1),E=D.useRef(null),B=On(t.ref,E),y=D.useRef(null);D.useEffect(()=>{!u||!E.current||(I.current=!n)},[n,u]),D.useEffect(()=>{if(!u||!E.current)return;const x=cr(E.current);return E.current.contains(x.activeElement)||(E.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
  `)),E.current.setAttribute("tabIndex","-1")),I.current&&E.current.focus()),()=>{i||(C.current&&C.current.focus&&(A.current=!0,C.current.focus()),C.current=null)}},[u]),D.useEffect(()=>{if(!u||!E.current)return;const x=cr(E.current),S=k=>{y.current=k,!(r||!l()||k.key!=="Tab")&&x.activeElement===E.current&&k.shiftKey&&(A.current=!0,p.current&&p.current.focus())},P=()=>{const k=E.current;if(k===null)return;if(!x.hasFocus()||!l()||A.current){A.current=!1;return}if(k.contains(x.activeElement)||r&&x.activeElement!==g.current&&x.activeElement!==p.current)return;if(x.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!I.current)return;let q=[];if((x.activeElement===g.current||x.activeElement===p.current)&&(q=s(E.current)),q.length>0){var J,Y;const ee=!!((J=y.current)!=null&&J.shiftKey&&((Y=y.current)==null?void 0:Y.key)==="Tab"),ae=q[0],oe=q[q.length-1];typeof ae!="string"&&typeof oe!="string"&&(ee?oe.focus():ae.focus())}else k.focus()};x.addEventListener("focusin",P),x.addEventListener("keydown",S,!0);const L=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&P()},50);return()=>{clearInterval(L),x.removeEventListener("focusin",P),x.removeEventListener("keydown",S,!0)}},[n,r,i,l,u,s]);const R=x=>{C.current===null&&(C.current=x.relatedTarget),I.current=!0,h.current=x.target;const S=t.props.onFocus;S&&S(x)},M=x=>{C.current===null&&(C.current=x.relatedTarget),I.current=!0};return f.jsxs(D.Fragment,{children:[f.jsx("div",{tabIndex:u?0:-1,onFocus:M,ref:g,"data-testid":"sentinelStart"}),D.cloneElement(t,{ref:B,onFocus:R}),f.jsx("div",{tabIndex:u?0:-1,onFocus:M,ref:p,"data-testid":"sentinelEnd"})]})}process.env.NODE_ENV!=="production"&&(Tc.propTypes={children:ns,disableAutoFocus:c.bool,disableEnforceFocus:c.bool,disableRestoreFocus:c.bool,getTabbable:c.func,isEnabled:c.func,open:c.bool.isRequired});process.env.NODE_ENV!=="production"&&(Tc["propTypes"]=Fc(Tc.propTypes));function wN(e){return typeof e=="function"?e():e}const fa=D.forwardRef(function(t,n){const{children:r,container:i,disablePortal:s=!1}=t,[l,u]=D.useState(null),A=On(D.isValidElement(r)?r.ref:null,n);if(Gi(()=>{s||u(wN(i)||document.body)},[i,s]),Gi(()=>{if(l&&!s)return lc(n,l),()=>{lc(n,null)}},[n,l,s]),s){if(D.isValidElement(r)){const g={ref:A};return D.cloneElement(r,g)}return f.jsx(D.Fragment,{children:r})}return f.jsx(D.Fragment,{children:l&&$S.createPortal(r,l)})});process.env.NODE_ENV!=="production"&&(fa.propTypes={children:c.node,container:c.oneOfType([$o,c.func]),disablePortal:c.bool});process.env.NODE_ENV!=="production"&&(fa["propTypes"]=Fc(fa.propTypes));const TN=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],PN={entering:{opacity:1},entered:{opacity:1}},Py=D.forwardRef(function(t,n){const r=Tt(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:l=!0,children:u,easing:A,in:g,onEnter:p,onEntered:C,onEntering:h,onExit:I,onExited:E,onExiting:B,style:y,timeout:R=i,TransitionComponent:M=cf}=t,x=Ke(t,TN),S=D.useRef(null),P=On(S,u.ref,n),L=Z=>K=>{if(Z){const V=S.current;K===void 0?Z(V):Z(V,K)}},k=L(h),q=L((Z,K)=>{Zf(Z);const V=Xi({style:y,timeout:R,easing:A},{mode:"enter"});Z.style.webkitTransition=r.transitions.create("opacity",V),Z.style.transition=r.transitions.create("opacity",V),p&&p(Z,K)}),J=L(C),Y=L(B),ee=L(Z=>{const K=Xi({style:y,timeout:R,easing:A},{mode:"exit"});Z.style.webkitTransition=r.transitions.create("opacity",K),Z.style.transition=r.transitions.create("opacity",K),I&&I(Z)}),ae=L(E),oe=Z=>{s&&s(S.current,Z)};return f.jsx(M,z({appear:l,in:g,nodeRef:S,onEnter:q,onEntered:J,onEntering:k,onExit:ee,onExited:ae,onExiting:Y,addEndListener:oe,timeout:R},x,{children:(Z,K)=>D.cloneElement(u,z({style:z({opacity:0,visibility:Z==="exited"&&!g?"hidden":void 0},PN[Z],y,u.props.style),ref:P},K))}))});process.env.NODE_ENV!=="production"&&(Py.propTypes={addEndListener:c.func,appear:c.bool,children:ns.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 SN=Py;function RN(e){return Vt("MuiBackdrop",e)}Ut("MuiBackdrop",["root","invisible"]);const ON=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],jN=e=>{const{classes:t,invisible:n}=e;return un({root:["root",n&&"invisible"]},RN,t)},MN=le("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>z({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),Sy=D.forwardRef(function(t,n){var r,i,s;const l=Yt({props:t,name:"MuiBackdrop"}),{children:u,className:A,component:g="div",components:p={},componentsProps:C={},invisible:h=!1,open:I,slotProps:E={},slots:B={},TransitionComponent:y=SN,transitionDuration:R}=l,M=Ke(l,ON),x=z({},l,{component:g,invisible:h}),S=jN(x),P=(r=E.root)!=null?r:C.root;return f.jsx(y,z({in:I,timeout:R},M,{children:f.jsx(MN,z({"aria-hidden":!0},P,{as:(i=(s=B.root)!=null?s:p.Root)!=null?i:g,className:Je(S.root,A,P==null?void 0:P.className),ownerState:z({},x,P==null?void 0:P.ownerState),classes:S,ref:n,children:u}))}))});process.env.NODE_ENV!=="production"&&(Sy.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 DN=Sy;function kN(e){return Vt("MuiModal",e)}Ut("MuiModal",["root","hidden","backdrop"]);const FN=["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"],LN=e=>{const{open:t,exited:n,classes:r}=e;return un({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},kN,r)},NN=le("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(({theme:e,ownerState:t})=>z({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),VN=le(DN,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),Ry=D.forwardRef(function(t,n){var r,i,s,l,u,A;const g=Yt({name:"MuiModal",props:t}),{BackdropComponent:p=VN,BackdropProps:C,className:h,closeAfterTransition:I=!1,children:E,container:B,component:y,components:R={},componentsProps:M={},disableAutoFocus:x=!1,disableEnforceFocus:S=!1,disableEscapeKeyDown:P=!1,disablePortal:L=!1,disableRestoreFocus:k=!1,disableScrollLock:q=!1,hideBackdrop:J=!1,keepMounted:Y=!1,onBackdropClick:ee,open:ae,slotProps:oe,slots:Z}=g,K=Ke(g,FN),V=z({},g,{closeAfterTransition:I,disableAutoFocus:x,disableEnforceFocus:S,disableEscapeKeyDown:P,disablePortal:L,disableRestoreFocus:k,disableScrollLock:q,hideBackdrop:J,keepMounted:Y}),{getRootProps:G,getBackdropProps:F,getTransitionProps:$,portalRef:W,isTopModal:X,exited:Ae,hasTransition:ge}=EN(z({},V,{rootRef:n})),ce=z({},V,{exited:Ae}),ue=LN(ce),fe={};if(E.props.tabIndex===void 0&&(fe.tabIndex="-1"),ge){const{onEnter:We,onExited:de}=$();fe.onEnter=We,fe.onExited=de}const Be=(r=(i=Z==null?void 0:Z.root)!=null?i:R.Root)!=null?r:NN,Ie=(s=(l=Z==null?void 0:Z.backdrop)!=null?l:R.Backdrop)!=null?s:p,pe=(u=oe==null?void 0:oe.root)!=null?u:M.root,Ee=(A=oe==null?void 0:oe.backdrop)!=null?A:M.backdrop,xe=Ir.useSlotProps({elementType:Be,externalSlotProps:pe,externalForwardedProps:K,getSlotProps:G,additionalProps:{ref:n,as:y},ownerState:ce,className:Je(h,pe==null?void 0:pe.className,ue==null?void 0:ue.root,!ce.open&&ce.exited&&(ue==null?void 0:ue.hidden))}),se=Ir.useSlotProps({elementType:Ie,externalSlotProps:Ee,additionalProps:C,getSlotProps:We=>F(z({},We,{onClick:de=>{ee&&ee(de),We!=null&&We.onClick&&We.onClick(de)}})),className:Je(Ee==null?void 0:Ee.className,C==null?void 0:C.className,ue==null?void 0:ue.backdrop),ownerState:ce});return!Y&&!ae&&(!ge||Ae)?null:f.jsx(fa,{ref:W,container:B,disablePortal:L,children:f.jsxs(Be,z({},xe,{children:[!J&&p?f.jsx(Ie,z({},se)):null,f.jsx(Tc,{disableEnforceFocus:S,disableAutoFocus:x,disableRestoreFocus:k,isEnabled:X,open:ae,children:D.cloneElement(E,fe)})]}))})});process.env.NODE_ENV!=="production"&&(Ry.propTypes={BackdropComponent:c.elementType,BackdropProps:c.object,children:ns.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([$o,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 HN=Ry;var _f={},WN=Jf;Object.defineProperty(_f,"__esModule",{value:!0});var Oy=_f.default=void 0,zN=WN(Xf()),UN=f,YN=(0,zN.default)((0,UN.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}),"History");Oy=_f.default=YN;var $f={},GN=Jf;Object.defineProperty($f,"__esModule",{value:!0});var jy=$f.default=void 0,KN=GN(Xf()),qN=f,JN=(0,KN.default)((0,qN.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");jy=$f.default=JN;var XN=function(e){var t=e.children,n=e.editor,r=e.preferenceKey,i=e.openButtonLabel,s=i===void 0?"ra.configurable.customize":i,l=e.sx,u="preferences.".concat(r),A=me.usePreferencesEditor(),g=!!A,p=me.useTranslate(),C=A||{},h=C.isEnabled,I=C.setEditor,E=C.preferenceKey,B=C.setPreferenceKey,y=u===E,R=T.useRef(y),M=T.useRef(null),x=T.useState(!1),S=x[0],P=x[1];if(T.useEffect(function(){R.current=y},[y]),T.useEffect(function(){return function(){R.current&&(B&&B(null),I&&I(null))}},[I,B]),!g)return t;var L=function(){I(T.cloneElement(n,{preferenceKey:u,key:u})),B(u)},k=function(){P(!0)},q=function(){P(!1)};return D.createElement(me.PreferenceKeyContextProvider,{value:u},D.createElement(ZN,{className:by(Fr.root,h&&Fr.editMode,y&&Fr.editorActive),sx:l,ref:M,onMouseEnter:h?k:void 0,onMouseLeave:h?q:void 0},t),D.createElement(b.Popover,{open:h&&(S||y),sx:{pointerEvents:"none","& .MuiPaper-root":{pointerEvents:"auto",borderRadius:10,padding:"2px",lineHeight:0,backgroundColor:"warning.light",color:"warning.contrastText","&:hover":{cursor:"pointer"}}},anchorEl:M.current,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"center"},onClose:q,PaperProps:{elevation:1,onMouseEnter:k,onMouseLeave:q,title:p(s),onClick:L},disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,disableScrollLock:!0,marginThreshold:8},D.createElement(jy,{fontSize:"12px"})))},tc="RaConfigurable",Fr={root:"".concat(tc,"-root"),editMode:"".concat(tc,"-editMode"),editorActive:"".concat(tc,"-editorActive")},ZN=le("span",{name:tc,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={position:"relative",display:"inline-block"},t["&.".concat(Fr.editMode)]={transition:n.transitions.create("outline"),outline:"".concat(b.alpha(n.palette.warning.main,.3)," solid 2px")},t["&.".concat(Fr.editMode,":hover ")]={outline:"".concat(b.alpha(n.palette.warning.main,.5)," solid 2px")},t["&.".concat(Fr.editMode,".").concat(Fr.editorActive," , &.").concat(Fr.editMode,".").concat(Fr.editorActive,":hover ")]={outline:"".concat(n.palette.warning.main," solid 2px")},t}),qo=globalThis&&globalThis.__assign||function(){return qo=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},qo.apply(this,arguments)},_N=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},$N=function(e){var t=e.title,n=e.defaultTitle,r=e.className,i=_N(e,["title","defaultTitle","className"]),s=me.usePreference()[0],l=me.useTranslate(),u=me.useRecordContext();return s?D.createElement("span",qo({className:r},i),l(s,qo(qo({},u),{_:s}))):D.createElement("span",{className:r},t?typeof t=="string"?D.createElement("span",qo({},i),l(t,{_:t})):t:D.createElement("span",qo({},i),n))},Pc=globalThis&&globalThis.__assign||function(){return Pc=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},Pc.apply(this,arguments)},e7=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},t7=function(){var e=me.usePreferenceInput();return D.createElement("form",null,D.createElement(b.TextField,Pc({label:"title",variant:"filled",size:"small",fullWidth:!0,sx:{mb:1}},e)))},n7=function(e){var t=e.preferenceKey,n=e7(e,["preferenceKey"]),r=bt.useLocation().pathname;return D.createElement(XN,{editor:D.createElement(t7,null),preferenceKey:t||"".concat(r,".title"),sx:{"&.RaConfigurable-editMode":{margin:"2px"}}},D.createElement($N,Pc({},n)))},og=globalThis&&globalThis.__assign||function(){return og=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},og.apply(this,arguments)},r7=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},My=function(e){var t=e.defaultTitle,n=e.title,r=e.preferenceKey,i=r7(e,["defaultTitle","title","preferenceKey"]),s=T.useState(function(){return typeof document<"u"?document.getElementById("react-admin-title"):null}),l=s[0],u=s[1];return T.useEffect(function(){u(function(A){var g=typeof document<"u"&&document.body.contains(A);return A&&g?A:typeof document<"u"?document.getElementById("react-admin-title"):null})},[]),l?(me.warning(!t&&!n,"Missing title prop in <Title> element"),Di.createPortal(D.createElement(n7,og({title:n,defaultTitle:t,preferenceKey:r},i)),l)):null},Dy=c.oneOfType([c.string,c.element]);My.propTypes={defaultTitle:c.string,className:c.string,record:c.any,title:Dy};var o7=function(e){var t=ia.useLocation().pathname,n=T.useRef(t);T.useEffect(function(){t!==n.current&&e()},[t,e])},i7=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),t.length!==n.length||t.some(function(r,i){return!Object.is(r,n[i])})},uE={error:null},s7=function(e){lf(t,e);function t(){for(var r,i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return r=e.call.apply(e,[this].concat(s))||this,r.state=uE,r.resetErrorBoundary=function(){for(var u,A=arguments.length,g=new Array(A),p=0;p<A;p++)g[p]=arguments[p];r.props.onReset==null||(u=r.props).onReset.apply(u,g),r.reset()},r}t.getDerivedStateFromError=function(i){return{error:i}};var n=t.prototype;return n.reset=function(){this.setState(uE)},n.componentDidCatch=function(i,s){var l,u;(l=(u=this.props).onError)==null||l.call(u,i,s)},n.componentDidUpdate=function(i,s){var l=this.state.error,u=this.props.resetKeys;if(l!==null&&s.error!==null&&i7(i.resetKeys,u)){var A,g;(A=(g=this.props).onResetKeysChange)==null||A.call(g,i.resetKeys,u),this.reset()}},n.render=function(){var i=this.state.error,s=this.props,l=s.fallbackRender,u=s.FallbackComponent,A=s.fallback;if(i!==null){var g={error:i,resetErrorBoundary:this.resetErrorBoundary};if(D.isValidElement(A))return A;if(typeof l=="function")return l(g);if(u)return D.createElement(u,g);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(D.Component),ig=globalThis&&globalThis.__assign||function(){return ig=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},ig.apply(this,arguments)},a7=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},ky=function(e){var t=e.className,n=e.loadingPrimary,r=n===void 0?"ra.page.loading":n,i=e.loadingSecondary,s=i===void 0?"ra.message.loading":i,l=a7(e,["className","loadingPrimary","loadingSecondary"]),u=me.useTimeout(1e3),A=me.useTranslate();return u?D.createElement(l7,ig({className:t},l),D.createElement("div",{className:Sc.message},D.createElement(gf,{className:Sc.icon}),D.createElement(b.Typography,{variant:"h5",mt:3,color:"text.secondary"},A(r,{_:r})),D.createElement(b.Typography,{variant:"body2"},A(s,{_:s})))):null};ky.propTypes={className:c.string,loadingPrimary:c.string,loadingSecondary:c.string};var nc="RaLoading",Sc={root:"".concat(nc,"-root"),icon:"".concat(nc,"-icon"),message:"".concat(nc,"-message")},l7=le("div",{name:nc,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100%"},t["& .".concat(Sc.message)]={textAlign:"center",fontFamily:"Roboto, sans-serif",color:n.palette.text.disabled,paddingTop:"1em",paddingBottom:"1em"},t["& .".concat(Sc.icon)]={width:"9em",height:"9em"},t}),ep={},c7=Jf;Object.defineProperty(ep,"__esModule",{value:!0});var Fy=ep.default=void 0,u7=c7(Xf()),A7=f,d7=(0,u7.default)((0,A7.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");Fy=ep.default=d7;const g7=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function sg(e){return`scale(${e}, ${e**2})`}const f7={entering:{opacity:1,transform:sg(1)},entered:{opacity:1,transform:"none"}},Id=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),tp=D.forwardRef(function(t,n){const{addEndListener:r,appear:i=!0,children:s,easing:l,in:u,onEnter:A,onEntered:g,onEntering:p,onExit:C,onExited:h,onExiting:I,style:E,timeout:B="auto",TransitionComponent:y=cf}=t,R=Ke(t,g7),M=D.useRef(),x=D.useRef(),S=Tt(),P=D.useRef(null),L=On(P,s.ref,n),k=K=>V=>{if(K){const G=P.current;V===void 0?K(G):K(G,V)}},q=k(p),J=k((K,V)=>{Zf(K);const{duration:G,delay:F,easing:$}=Xi({style:E,timeout:B,easing:l},{mode:"enter"});let W;B==="auto"?(W=S.transitions.getAutoHeightDuration(K.clientHeight),x.current=W):W=G,K.style.transition=[S.transitions.create("opacity",{duration:W,delay:F}),S.transitions.create("transform",{duration:Id?W:W*.666,delay:F,easing:$})].join(","),A&&A(K,V)}),Y=k(g),ee=k(I),ae=k(K=>{const{duration:V,delay:G,easing:F}=Xi({style:E,timeout:B,easing:l},{mode:"exit"});let $;B==="auto"?($=S.transitions.getAutoHeightDuration(K.clientHeight),x.current=$):$=V,K.style.transition=[S.transitions.create("opacity",{duration:$,delay:G}),S.transitions.create("transform",{duration:Id?$:$*.666,delay:Id?G:G||$*.333,easing:F})].join(","),K.style.opacity=0,K.style.transform=sg(.75),C&&C(K)}),oe=k(h),Z=K=>{B==="auto"&&(M.current=setTimeout(K,x.current||0)),r&&r(P.current,K)};return D.useEffect(()=>()=>{clearTimeout(M.current)},[]),f.jsx(y,z({appear:i,in:u,nodeRef:P,onEnter:J,onEntered:Y,onEntering:q,onExit:ae,onExited:oe,onExiting:ee,addEndListener:Z,timeout:B==="auto"?null:B},R,{children:(K,V)=>D.cloneElement(s,z({style:z({opacity:0,transform:sg(.75),visibility:K==="exited"&&!u?"hidden":void 0},f7[K],E,s.props.style),ref:L},V))}))});process.env.NODE_ENV!=="production"&&(tp.propTypes={addEndListener:c.func,appear:c.bool,children:ns.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})])});tp.muiSupportAuto=!0;const AE=tp;var Cn="top",Zn="bottom",_n="right",mn="left",np="auto",Oa=[Cn,Zn,_n,mn],Zi="start",pa="end",p7="clippingParents",Ly="viewport",Vs="popper",h7="reference",dE=Oa.reduce(function(e,t){return e.concat([t+"-"+Zi,t+"-"+pa])},[]),Ny=[].concat(Oa,[np]).reduce(function(e,t){return e.concat([t,t+"-"+Zi,t+"-"+pa])},[]),C7="beforeRead",m7="read",I7="afterRead",E7="beforeMain",B7="main",v7="afterMain",y7="beforeWrite",b7="write",Q7="afterWrite",x7=[C7,m7,I7,E7,B7,v7,y7,b7,Q7];function yr(e){return e?(e.nodeName||"").toLowerCase():null}function Mn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ti(e){var t=Mn(e).Element;return e instanceof t||e instanceof Element}function Jn(e){var t=Mn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function rp(e){if(typeof ShadowRoot>"u")return!1;var t=Mn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function w7(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},s=t.elements[n];!Jn(s)||!yr(s)||(Object.assign(s.style,r),Object.keys(i).forEach(function(l){var u=i[l];u===!1?s.removeAttribute(l):s.setAttribute(l,u===!0?"":u)}))})}function T7(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],s=t.attributes[r]||{},l=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=l.reduce(function(A,g){return A[g]="",A},{});!Jn(i)||!yr(i)||(Object.assign(i.style,u),Object.keys(s).forEach(function(A){i.removeAttribute(A)}))})}}const P7={name:"applyStyles",enabled:!0,phase:"write",fn:w7,effect:T7,requires:["computeStyles"]};function Br(e){return e.split("-")[0]}var _o=Math.max,Rc=Math.min,_i=Math.round;function ag(){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 Vy(){return!/^((?!chrome|android).)*safari/i.test(ag())}function $i(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,s=1;t&&Jn(e)&&(i=e.offsetWidth>0&&_i(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&_i(r.height)/e.offsetHeight||1);var l=ti(e)?Mn(e):window,u=l.visualViewport,A=!Vy()&&n,g=(r.left+(A&&u?u.offsetLeft:0))/i,p=(r.top+(A&&u?u.offsetTop:0))/s,C=r.width/i,h=r.height/s;return{width:C,height:h,top:p,right:g+C,bottom:p+h,left:g,x:g,y:p}}function op(e){var t=$i(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 Hy(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&rp(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Yr(e){return Mn(e).getComputedStyle(e)}function S7(e){return["table","td","th"].indexOf(yr(e))>=0}function yo(e){return((ti(e)?e.ownerDocument:e.document)||window.document).documentElement}function Eu(e){return yr(e)==="html"?e:e.assignedSlot||e.parentNode||(rp(e)?e.host:null)||yo(e)}function gE(e){return!Jn(e)||Yr(e).position==="fixed"?null:e.offsetParent}function R7(e){var t=/firefox/i.test(ag()),n=/Trident/i.test(ag());if(n&&Jn(e)){var r=Yr(e);if(r.position==="fixed")return null}var i=Eu(e);for(rp(i)&&(i=i.host);Jn(i)&&["html","body"].indexOf(yr(i))<0;){var s=Yr(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function ja(e){for(var t=Mn(e),n=gE(e);n&&S7(n)&&Yr(n).position==="static";)n=gE(n);return n&&(yr(n)==="html"||yr(n)==="body"&&Yr(n).position==="static")?t:n||R7(e)||t}function ip(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ea(e,t,n){return _o(e,Rc(t,n))}function O7(e,t,n){var r=ea(e,t,n);return r>n?n:r}function Wy(){return{top:0,right:0,bottom:0,left:0}}function zy(e){return Object.assign({},Wy(),e)}function Uy(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var j7=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,zy(typeof t!="number"?t:Uy(t,Oa))};function M7(e){var t,n=e.state,r=e.name,i=e.options,s=n.elements.arrow,l=n.modifiersData.popperOffsets,u=Br(n.placement),A=ip(u),g=[mn,_n].indexOf(u)>=0,p=g?"height":"width";if(!(!s||!l)){var C=j7(i.padding,n),h=op(s),I=A==="y"?Cn:mn,E=A==="y"?Zn:_n,B=n.rects.reference[p]+n.rects.reference[A]-l[A]-n.rects.popper[p],y=l[A]-n.rects.reference[A],R=ja(s),M=R?A==="y"?R.clientHeight||0:R.clientWidth||0:0,x=B/2-y/2,S=C[I],P=M-h[p]-C[E],L=M/2-h[p]/2+x,k=ea(S,L,P),q=A;n.modifiersData[r]=(t={},t[q]=k,t.centerOffset=k-L,t)}}function D7(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)||Hy(t.elements.popper,i)&&(t.elements.arrow=i))}const k7={name:"arrow",enabled:!0,phase:"main",fn:M7,effect:D7,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function es(e){return e.split("-")[1]}var F7={top:"auto",right:"auto",bottom:"auto",left:"auto"};function L7(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:_i(n*i)/i||0,y:_i(r*i)/i||0}}function fE(e){var t,n=e.popper,r=e.popperRect,i=e.placement,s=e.variation,l=e.offsets,u=e.position,A=e.gpuAcceleration,g=e.adaptive,p=e.roundOffsets,C=e.isFixed,h=l.x,I=h===void 0?0:h,E=l.y,B=E===void 0?0:E,y=typeof p=="function"?p({x:I,y:B}):{x:I,y:B};I=y.x,B=y.y;var R=l.hasOwnProperty("x"),M=l.hasOwnProperty("y"),x=mn,S=Cn,P=window;if(g){var L=ja(n),k="clientHeight",q="clientWidth";if(L===Mn(n)&&(L=yo(n),Yr(L).position!=="static"&&u==="absolute"&&(k="scrollHeight",q="scrollWidth")),L=L,i===Cn||(i===mn||i===_n)&&s===pa){S=Zn;var J=C&&L===P&&P.visualViewport?P.visualViewport.height:L[k];B-=J-r.height,B*=A?1:-1}if(i===mn||(i===Cn||i===Zn)&&s===pa){x=_n;var Y=C&&L===P&&P.visualViewport?P.visualViewport.width:L[q];I-=Y-r.width,I*=A?1:-1}}var ee=Object.assign({position:u},g&&F7),ae=p===!0?L7({x:I,y:B},Mn(n)):{x:I,y:B};if(I=ae.x,B=ae.y,A){var oe;return Object.assign({},ee,(oe={},oe[S]=M?"0":"",oe[x]=R?"0":"",oe.transform=(P.devicePixelRatio||1)<=1?"translate("+I+"px, "+B+"px)":"translate3d("+I+"px, "+B+"px, 0)",oe))}return Object.assign({},ee,(t={},t[S]=M?B+"px":"",t[x]=R?I+"px":"",t.transform="",t))}function N7(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,s=n.adaptive,l=s===void 0?!0:s,u=n.roundOffsets,A=u===void 0?!0:u,g={placement:Br(t.placement),variation:es(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,fE(Object.assign({},g,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:A})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,fE(Object.assign({},g,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const V7={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:N7,data:{}};var zl={passive:!0};function H7(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,s=i===void 0?!0:i,l=r.resize,u=l===void 0?!0:l,A=Mn(t.elements.popper),g=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&g.forEach(function(p){p.addEventListener("scroll",n.update,zl)}),u&&A.addEventListener("resize",n.update,zl),function(){s&&g.forEach(function(p){p.removeEventListener("scroll",n.update,zl)}),u&&A.removeEventListener("resize",n.update,zl)}}const W7={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:H7,data:{}};var z7={left:"right",right:"left",bottom:"top",top:"bottom"};function rc(e){return e.replace(/left|right|bottom|top/g,function(t){return z7[t]})}var U7={start:"end",end:"start"};function pE(e){return e.replace(/start|end/g,function(t){return U7[t]})}function sp(e){var t=Mn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function ap(e){return $i(yo(e)).left+sp(e).scrollLeft}function Y7(e,t){var n=Mn(e),r=yo(e),i=n.visualViewport,s=r.clientWidth,l=r.clientHeight,u=0,A=0;if(i){s=i.width,l=i.height;var g=Vy();(g||!g&&t==="fixed")&&(u=i.offsetLeft,A=i.offsetTop)}return{width:s,height:l,x:u+ap(e),y:A}}function G7(e){var t,n=yo(e),r=sp(e),i=(t=e.ownerDocument)==null?void 0:t.body,s=_o(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),l=_o(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+ap(e),A=-r.scrollTop;return Yr(i||n).direction==="rtl"&&(u+=_o(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:l,x:u,y:A}}function lp(e){var t=Yr(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Yy(e){return["html","body","#document"].indexOf(yr(e))>=0?e.ownerDocument.body:Jn(e)&&lp(e)?e:Yy(Eu(e))}function ta(e,t){var n;t===void 0&&(t=[]);var r=Yy(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),s=Mn(r),l=i?[s].concat(s.visualViewport||[],lp(r)?r:[]):r,u=t.concat(l);return i?u:u.concat(ta(Eu(l)))}function lg(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function K7(e,t){var n=$i(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 hE(e,t,n){return t===Ly?lg(Y7(e,n)):ti(t)?K7(t,n):lg(G7(yo(e)))}function q7(e){var t=ta(Eu(e)),n=["absolute","fixed"].indexOf(Yr(e).position)>=0,r=n&&Jn(e)?ja(e):e;return ti(r)?t.filter(function(i){return ti(i)&&Hy(i,r)&&yr(i)!=="body"}):[]}function J7(e,t,n,r){var i=t==="clippingParents"?q7(e):[].concat(t),s=[].concat(i,[n]),l=s[0],u=s.reduce(function(A,g){var p=hE(e,g,r);return A.top=_o(p.top,A.top),A.right=Rc(p.right,A.right),A.bottom=Rc(p.bottom,A.bottom),A.left=_o(p.left,A.left),A},hE(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 Gy(e){var t=e.reference,n=e.element,r=e.placement,i=r?Br(r):null,s=r?es(r):null,l=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,A;switch(i){case Cn:A={x:l,y:t.y-n.height};break;case Zn:A={x:l,y:t.y+t.height};break;case _n:A={x:t.x+t.width,y:u};break;case mn:A={x:t.x-n.width,y:u};break;default:A={x:t.x,y:t.y}}var g=i?ip(i):null;if(g!=null){var p=g==="y"?"height":"width";switch(s){case Zi:A[g]=A[g]-(t[p]/2-n[p]/2);break;case pa:A[g]=A[g]+(t[p]/2-n[p]/2);break}}return A}function ha(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,s=n.strategy,l=s===void 0?e.strategy:s,u=n.boundary,A=u===void 0?p7:u,g=n.rootBoundary,p=g===void 0?Ly:g,C=n.elementContext,h=C===void 0?Vs:C,I=n.altBoundary,E=I===void 0?!1:I,B=n.padding,y=B===void 0?0:B,R=zy(typeof y!="number"?y:Uy(y,Oa)),M=h===Vs?h7:Vs,x=e.rects.popper,S=e.elements[E?M:h],P=J7(ti(S)?S:S.contextElement||yo(e.elements.popper),A,p,l),L=$i(e.elements.reference),k=Gy({reference:L,element:x,strategy:"absolute",placement:i}),q=lg(Object.assign({},x,k)),J=h===Vs?q:L,Y={top:P.top-J.top+R.top,bottom:J.bottom-P.bottom+R.bottom,left:P.left-J.left+R.left,right:J.right-P.right+R.right},ee=e.modifiersData.offset;if(h===Vs&&ee){var ae=ee[i];Object.keys(Y).forEach(function(oe){var Z=[_n,Zn].indexOf(oe)>=0?1:-1,K=[Cn,Zn].indexOf(oe)>=0?"y":"x";Y[oe]+=ae[K]*Z})}return Y}function X7(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,s=n.rootBoundary,l=n.padding,u=n.flipVariations,A=n.allowedAutoPlacements,g=A===void 0?Ny:A,p=es(r),C=p?u?dE:dE.filter(function(E){return es(E)===p}):Oa,h=C.filter(function(E){return g.indexOf(E)>=0});h.length===0&&(h=C);var I=h.reduce(function(E,B){return E[B]=ha(e,{placement:B,boundary:i,rootBoundary:s,padding:l})[Br(B)],E},{});return Object.keys(I).sort(function(E,B){return I[E]-I[B]})}function Z7(e){if(Br(e)===np)return[];var t=rc(e);return[pE(e),t,pE(t)]}function _7(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,s=i===void 0?!0:i,l=n.altAxis,u=l===void 0?!0:l,A=n.fallbackPlacements,g=n.padding,p=n.boundary,C=n.rootBoundary,h=n.altBoundary,I=n.flipVariations,E=I===void 0?!0:I,B=n.allowedAutoPlacements,y=t.options.placement,R=Br(y),M=R===y,x=A||(M||!E?[rc(y)]:Z7(y)),S=[y].concat(x).reduce(function(ce,ue){return ce.concat(Br(ue)===np?X7(t,{placement:ue,boundary:p,rootBoundary:C,padding:g,flipVariations:E,allowedAutoPlacements:B}):ue)},[]),P=t.rects.reference,L=t.rects.popper,k=new Map,q=!0,J=S[0],Y=0;Y<S.length;Y++){var ee=S[Y],ae=Br(ee),oe=es(ee)===Zi,Z=[Cn,Zn].indexOf(ae)>=0,K=Z?"width":"height",V=ha(t,{placement:ee,boundary:p,rootBoundary:C,altBoundary:h,padding:g}),G=Z?oe?_n:mn:oe?Zn:Cn;P[K]>L[K]&&(G=rc(G));var F=rc(G),$=[];if(s&&$.push(V[ae]<=0),u&&$.push(V[G]<=0,V[F]<=0),$.every(function(ce){return ce})){J=ee,q=!1;break}k.set(ee,$)}if(q)for(var W=E?3:1,X=function(ue){var fe=S.find(function(Be){var Ie=k.get(Be);if(Ie)return Ie.slice(0,ue).every(function(pe){return pe})});if(fe)return J=fe,"break"},Ae=W;Ae>0;Ae--){var ge=X(Ae);if(ge==="break")break}t.placement!==J&&(t.modifiersData[r]._skip=!0,t.placement=J,t.reset=!0)}}const $7={name:"flip",enabled:!0,phase:"main",fn:_7,requiresIfExists:["offset"],data:{_skip:!1}};function CE(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 mE(e){return[Cn,_n,Zn,mn].some(function(t){return e[t]>=0})}function eV(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,s=t.modifiersData.preventOverflow,l=ha(t,{elementContext:"reference"}),u=ha(t,{altBoundary:!0}),A=CE(l,r),g=CE(u,i,s),p=mE(A),C=mE(g);t.modifiersData[n]={referenceClippingOffsets:A,popperEscapeOffsets:g,isReferenceHidden:p,hasPopperEscaped:C},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":C})}const tV={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:eV};function nV(e,t,n){var r=Br(e),i=[mn,Cn].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,l=s[0],u=s[1];return l=l||0,u=(u||0)*i,[mn,_n].indexOf(r)>=0?{x:u,y:l}:{x:l,y:u}}function rV(e){var t=e.state,n=e.options,r=e.name,i=n.offset,s=i===void 0?[0,0]:i,l=Ny.reduce(function(p,C){return p[C]=nV(C,t.rects,s),p},{}),u=l[t.placement],A=u.x,g=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=A,t.modifiersData.popperOffsets.y+=g),t.modifiersData[r]=l}const oV={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:rV};function iV(e){var t=e.state,n=e.name;t.modifiersData[n]=Gy({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const sV={name:"popperOffsets",enabled:!0,phase:"read",fn:iV,data:{}};function aV(e){return e==="x"?"y":"x"}function lV(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,s=i===void 0?!0:i,l=n.altAxis,u=l===void 0?!1:l,A=n.boundary,g=n.rootBoundary,p=n.altBoundary,C=n.padding,h=n.tether,I=h===void 0?!0:h,E=n.tetherOffset,B=E===void 0?0:E,y=ha(t,{boundary:A,rootBoundary:g,padding:C,altBoundary:p}),R=Br(t.placement),M=es(t.placement),x=!M,S=ip(R),P=aV(S),L=t.modifiersData.popperOffsets,k=t.rects.reference,q=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,ae={x:0,y:0};if(L){if(s){var oe,Z=S==="y"?Cn:mn,K=S==="y"?Zn:_n,V=S==="y"?"height":"width",G=L[S],F=G+y[Z],$=G-y[K],W=I?-q[V]/2:0,X=M===Zi?k[V]:q[V],Ae=M===Zi?-q[V]:-k[V],ge=t.elements.arrow,ce=I&&ge?op(ge):{width:0,height:0},ue=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Wy(),fe=ue[Z],Be=ue[K],Ie=ea(0,k[V],ce[V]),pe=x?k[V]/2-W-Ie-fe-Y.mainAxis:X-Ie-fe-Y.mainAxis,Ee=x?-k[V]/2+W+Ie+Be+Y.mainAxis:Ae+Ie+Be+Y.mainAxis,xe=t.elements.arrow&&ja(t.elements.arrow),se=xe?S==="y"?xe.clientTop||0:xe.clientLeft||0:0,We=(oe=ee==null?void 0:ee[S])!=null?oe:0,de=G+pe-We-se,lt=G+Ee-We,Ht=ea(I?Rc(F,de):F,G,I?_o($,lt):$);L[S]=Ht,ae[S]=Ht-G}if(u){var ht,Qt=S==="x"?Cn:mn,Ar=S==="x"?Zn:_n,Et=L[P],Ct=P==="y"?"height":"width",At=Et+y[Qt],kt=Et-y[Ar],Ft=[Cn,mn].indexOf(R)!==-1,Se=(ht=ee==null?void 0:ee[P])!=null?ht:0,ke=Ft?At:Et-k[Ct]-q[Ct]-Se+Y.altAxis,we=Ft?Et+k[Ct]+q[Ct]-Se-Y.altAxis:kt,ze=I&&Ft?O7(ke,Et,we):ea(I?ke:At,Et,I?we:kt);L[P]=ze,ae[P]=ze-Et}t.modifiersData[r]=ae}}const cV={name:"preventOverflow",enabled:!0,phase:"main",fn:lV,requiresIfExists:["offset"]};function uV(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function AV(e){return e===Mn(e)||!Jn(e)?sp(e):uV(e)}function dV(e){var t=e.getBoundingClientRect(),n=_i(t.width)/e.offsetWidth||1,r=_i(t.height)/e.offsetHeight||1;return n!==1||r!==1}function gV(e,t,n){n===void 0&&(n=!1);var r=Jn(t),i=Jn(t)&&dV(t),s=yo(t),l=$i(e,i,n),u={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(r||!r&&!n)&&((yr(t)!=="body"||lp(s))&&(u=AV(t)),Jn(t)?(A=$i(t,!0),A.x+=t.clientLeft,A.y+=t.clientTop):s&&(A.x=ap(s))),{x:l.left+u.scrollLeft-A.x,y:l.top+u.scrollTop-A.y,width:l.width,height:l.height}}function fV(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function i(s){n.add(s.name);var l=[].concat(s.requires||[],s.requiresIfExists||[]);l.forEach(function(u){if(!n.has(u)){var A=t.get(u);A&&i(A)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||i(s)}),r}function pV(e){var t=fV(e);return x7.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function hV(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function CV(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 IE={placement:"bottom",modifiers:[],strategy:"absolute"};function EE(){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 mV(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,s=i===void 0?IE:i;return function(u,A,g){g===void 0&&(g=s);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},IE,s),modifiersData:{},elements:{reference:u,popper:A},attributes:{},styles:{}},C=[],h=!1,I={state:p,setOptions:function(R){var M=typeof R=="function"?R(p.options):R;B(),p.options=Object.assign({},s,p.options,M),p.scrollParents={reference:ti(u)?ta(u):u.contextElement?ta(u.contextElement):[],popper:ta(A)};var x=pV(CV([].concat(r,p.options.modifiers)));return p.orderedModifiers=x.filter(function(S){return S.enabled}),E(),I.update()},forceUpdate:function(){if(!h){var R=p.elements,M=R.reference,x=R.popper;if(EE(M,x)){p.rects={reference:gV(M,ja(x),p.options.strategy==="fixed"),popper:op(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 S=0;S<p.orderedModifiers.length;S++){if(p.reset===!0){p.reset=!1,S=-1;continue}var P=p.orderedModifiers[S],L=P.fn,k=P.options,q=k===void 0?{}:k,J=P.name;typeof L=="function"&&(p=L({state:p,options:q,name:J,instance:I})||p)}}}},update:hV(function(){return new Promise(function(y){I.forceUpdate(),y(p)})}),destroy:function(){B(),h=!0}};if(!EE(u,A))return I;I.setOptions(g).then(function(y){!h&&g.onFirstUpdate&&g.onFirstUpdate(y)});function E(){p.orderedModifiers.forEach(function(y){var R=y.name,M=y.options,x=M===void 0?{}:M,S=y.effect;if(typeof S=="function"){var P=S({state:p,name:R,instance:I,options:x}),L=function(){};C.push(P||L)}})}function B(){C.forEach(function(y){return y()}),C=[]}return I}}var IV=[W7,sV,V7,P7,oV,$7,cV,k7,tV],EV=mV({defaultModifiers:IV});function BV(e){return Vt("MuiPopper",e)}Ut("MuiPopper",["root"]);const vV=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],yV=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function bV(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 Oc(e){return typeof e=="function"?e():e}function Bu(e){return e.nodeType!==void 0}function QV(e){return!Bu(e)}const xV=()=>un({root:["root"]},aN(BV)),wV={},TV=D.forwardRef(function(t,n){var r;const{anchorEl:i,children:s,direction:l,disablePortal:u,modifiers:A,open:g,placement:p,popperOptions:C,popperRef:h,slotProps:I={},slots:E={},TransitionProps:B}=t,y=Ke(t,vV),R=D.useRef(null),M=On(R,n),x=D.useRef(null),S=On(x,h),P=D.useRef(S);Gi(()=>{P.current=S},[S]),D.useImperativeHandle(h,()=>x.current,[]);const L=bV(p,l),[k,q]=D.useState(L),[J,Y]=D.useState(Oc(i));D.useEffect(()=>{x.current&&x.current.forceUpdate()}),D.useEffect(()=>{i&&Y(Oc(i))},[i]),Gi(()=>{if(!J||!g)return;const K=F=>{q(F.placement)};if(process.env.NODE_ENV!=="production"&&J&&Bu(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(`