@bygd/nc-report-ui 0.1.22 → 0.1.24

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.
@@ -210,7 +210,7 @@ var _BYGD_NC_REPORT_UI=function(){"use strict";function e(e,t){return t.forEach(
210
210
  &::after {
211
211
  animation: ${wk} 2s linear 0.5s infinite;
212
212
  }
213
- `:null,Ck=pg("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!1!==n.animation&&t[n.animation],n.hasChildren&&t.withChildren,n.hasChildren&&!n.width&&t.fitContent,n.hasChildren&&!n.height&&t.heightAuto]}})(vg(({theme:e})=>{const t=(n=e.shape.borderRadius,String(n).match(/[\d.\-+]*\s*(.*)/)[1]||""||"px");var n;const r=function(e){return parseFloat(e)}(e.shape.borderRadius);return{display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:e.alpha(e.palette.text.primary,"light"===e.palette.mode?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${r}${t}/${Math.round(r/.6*10)/10}${t}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:({ownerState:e})=>e.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:e})=>e.hasChildren&&!e.width,style:{maxWidth:"fit-content"}},{props:({ownerState:e})=>e.hasChildren&&!e.height,style:{height:"auto"}},{props:{animation:"pulse"},style:xk||{animation:`${yk} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient(\n 90deg,\n transparent,\n ${(e.vars||e).palette.action.hover},\n transparent\n )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:Sk||{"&::after":{animation:`${wk} 2s linear 0.5s infinite`}}}]}})),kk=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiSkeleton"}),{animation:r="pulse",className:o,component:i="span",height:a,style:l,variant:s="text",width:c,...u}=n,d={...n,animation:r,component:i,variant:s,hasChildren:Boolean(u.children)},p=(e=>{const{classes:t,variant:n,animation:r,hasChildren:o,width:i,height:a}=e;return wm({root:["root",n,r,o&&"withChildren",o&&!i&&"fitContent",o&&!a&&"heightAuto"]},bk,t)})(d);return Xp.jsx(Ck,{as:i,ref:t,className:mg(p.root,o),ownerState:d,...u,style:{width:c,height:a,...l}})});function Ek(e){return Ph("MuiSnackbarContent",e)}Mh("MuiSnackbarContent",["root","message","action"]);const Rk=pg(qg,{name:"MuiSnackbarContent",slot:"Root"})(vg(({theme:e})=>{const t="light"===e.palette.mode?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(lm(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:lm(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),Pk=pg("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),Mk=pg("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),Tk=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiSnackbarContent"}),{action:r,className:o,message:i,role:a="alert",...l}=n,s=n,c=(e=>{const{classes:t}=e;return wm({root:["root"],action:["action"],message:["message"]},Ek,t)})(s);return Xp.jsxs(Rk,{role:a,elevation:6,className:mg(c.root,o),ownerState:s,ref:t,...l,children:[Xp.jsx(Pk,{className:c.message,ownerState:s,children:i}),r?Xp.jsx(Mk,{className:c.action,ownerState:s,children:r}):null]})});function Ik(e){return Ph("MuiSnackbar",e)}Mh("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const Ok=pg("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${xf(n.anchorOrigin.vertical)}${xf(n.anchorOrigin.horizontal)}`]]}})(vg(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:e})=>"top"===e.anchorOrigin.vertical,style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:e})=>"top"!==e.anchorOrigin.vertical,style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:e})=>"left"===e.anchorOrigin.horizontal,style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:e})=>"right"===e.anchorOrigin.horizontal,style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:e})=>"center"===e.anchorOrigin.horizontal,style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),Dk=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiSnackbar"}),r=sg(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{action:i,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:d,ClickAwayListenerProps:p,ContentProps:f,disableWindowBlurListener:h=!1,message:m,onBlur:g,onClose:v,onFocus:b,onMouseEnter:y,onMouseLeave:w,open:x,resumeHideDuration:S,slots:C={},slotProps:k={},TransitionComponent:E,transitionDuration:R=o,TransitionProps:{onEnter:P,onExited:M,...T}={},...I}=n,O={...n,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:c,disableWindowBlurListener:h,TransitionComponent:E,transitionDuration:R},D=(e=>{const{classes:t,anchorOrigin:n}=e;return wm({root:["root",`anchorOrigin${xf(n.vertical)}${xf(n.horizontal)}`]},Ik,t)})(O),{getRootProps:F,onClickAway:L}=function(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:o,resumeHideDuration:i}=e,a=Ng();s.useEffect(()=>{if(o)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){e.defaultPrevented||"Escape"===e.key&&r?.(e,"escapeKeyDown")}},[o,r]);const l=Mg((e,t)=>{r?.(e,t)}),c=Mg(e=>{r&&null!=e&&a.start(e,()=>{l(null,"timeout")})});s.useEffect(()=>(o&&c(t),a.clear),[o,t,c,a]);const u=a.clear,d=s.useCallback(()=>{null!=t&&c(null!=i?i:.5*t)},[t,i,c]),p=e=>t=>{const n=e.onFocus;n?.(t),u()},f=e=>t=>{const n=e.onMouseEnter;n?.(t),u()},h=e=>t=>{const n=e.onMouseLeave;n?.(t),d()};return s.useEffect(()=>{if(!n&&o)return window.addEventListener("focus",d),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",d),window.removeEventListener("blur",u)}},[n,o,d,u]),{getRootProps:(t={})=>{const n={...Hg(e),...Hg(t)};return{role:"presentation",...t,...n,onBlur:(r=n,e=>{const t=r.onBlur;t?.(e),d()}),onFocus:p(n),onMouseEnter:f(n),onMouseLeave:h(n)};var r},onClickAway:e=>{r?.(e,"clickaway")}}}(O),[A,N]=s.useState(!0),$={slots:{transition:E,...C},slotProps:{content:f,clickAwayListener:p,transition:T,...k}},[z,j]=Ug("root",{ref:t,className:[D.root,d],elementType:Ok,getSlotProps:F,externalForwardedProps:{...$,...I},ownerState:O}),[B,{ownerState:_,...H}]=Ug("clickAwayListener",{elementType:px,externalForwardedProps:$,getSlotProps:e=>({onClickAway:(...t)=>{const n=t[0];e.onClickAway?.(...t),n?.defaultMuiPrevented||L(...t)}}),ownerState:O}),[V,W]=Ug("content",{elementType:Tk,shouldForwardComponentProp:!0,externalForwardedProps:$,additionalProps:{message:m,action:i},ownerState:O}),[U,G]=Ug("transition",{elementType:PS,externalForwardedProps:$,getSlotProps:e=>({onEnter:(...t)=>{e.onEnter?.(...t),((e,t)=>{N(!1),P&&P(e,t)})(...t)},onExited:(...t)=>{e.onExited?.(...t),(e=>{N(!0),M&&M(e)})(...t)}}),additionalProps:{appear:!0,in:x,timeout:R,direction:"top"===a?"down":"up"},ownerState:O});return!x&&A?null:Xp.jsx(B,{...H,...C.clickAwayListener&&{ownerState:_},children:Xp.jsx(z,{...j,children:Xp.jsx(U,{...G,children:u||Xp.jsx(V,{...W})})})})});function Fk(e){return Ph("MuiTooltip",e)}const Lk=Mh("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);const Ak=pg(My,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(vg(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:e})=>!e.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:e})=>!e,style:{pointerEvents:"none"}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${Lk.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Lk.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Lk.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Lk.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${Lk.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${Lk.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${Lk.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${Lk.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),Nk=pg("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${xf(n.placement.split("-")[0])}`]]}})(vg(({theme:e})=>{return{backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${Lk.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Lk.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Lk.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Lk.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:e})=>e.arrow,style:{position:"relative",margin:0}},{props:({ownerState:e})=>e.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:(t=16/14,Math.round(1e5*t)/1e5)+"em",fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:e})=>!e.isRtl,style:{[`.${Lk.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Lk.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${Lk.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Lk.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${Lk.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Lk.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${Lk.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Lk.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${Lk.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${Lk.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]};var t})),$k=pg("span",{name:"MuiTooltip",slot:"Arrow"})(vg(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let zk=!1;const jk=new Ag;let Bk={x:0,y:0};function _k(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const Hk=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTooltip"}),{arrow:r=!1,children:o,classes:i,components:a={},componentsProps:l={},describeChild:c=!1,disableFocusListener:u=!1,disableHoverListener:d=!1,disableInteractive:p=!1,disableTouchListener:f=!1,enterDelay:h=100,enterNextDelay:m=0,enterTouchDelay:g=700,followCursor:v=!1,id:b,leaveDelay:y=0,leaveTouchDelay:w=1500,onClose:x,onOpen:S,open:C,placement:k="bottom",PopperComponent:E,PopperProps:R={},slotProps:P={},slots:M={},title:T,TransitionComponent:I,TransitionProps:O,...D}=n,F=s.isValidElement(o)?o:Xp.jsx("span",{children:o}),L=sg(),A=um(),[N,$]=s.useState(),[z,j]=s.useState(null),B=s.useRef(!1),_=p||v,H=Ng(),V=Ng(),W=Ng(),U=Ng(),[G,K]=Pg({controlled:C,default:!1,name:"Tooltip",state:"open"});let q=G;const Y=mm(b),X=s.useRef(),Q=Mg(()=>{void 0!==X.current&&(document.body.style.WebkitUserSelect=X.current,X.current=void 0),U.clear()});s.useEffect(()=>Q,[Q]);const Z=e=>{jk.clear(),zk=!0,K(!0),S&&!q&&S(e)},J=Mg(e=>{jk.start(800+y,()=>{zk=!1}),K(!1),x&&q&&x(e),H.start(L.transitions.duration.shortest,()=>{B.current=!1})}),ee=e=>{B.current&&"touchstart"!==e.type||(N&&N.removeAttribute("title"),V.clear(),W.clear(),h||zk&&m?V.start(zk?m:h,()=>{Z(e)}):Z(e))},te=e=>{V.clear(),W.start(y,()=>{J(e)})},[,ne]=s.useState(!1),re=e=>{Xg(e.target)||(ne(!1),te(e))},oe=e=>{N||$(e.currentTarget),Xg(e.target)&&(ne(!0),ee(e))},ie=e=>{B.current=!0;const t=F.props;t.onTouchStart&&t.onTouchStart(e)},ae=e=>{ie(e),W.clear(),H.clear(),Q(),X.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",U.start(g,()=>{document.body.style.WebkitUserSelect=X.current,ee(e)})},le=e=>{F.props.onTouchEnd&&F.props.onTouchEnd(e),Q(),W.start(w,()=>{J(e)})};s.useEffect(()=>{if(q)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){"Escape"===e.key&&J(e)}},[J,q]);const se=Tg(wy(F),$,t);T||0===T||(q=!1);const ce=s.useRef(),ue={},de="string"==typeof T;c?(ue.title=q||!de||d?null:T,ue["aria-describedby"]=q?Y:null):(ue["aria-label"]=de?T:null,ue["aria-labelledby"]=q&&!de?Y:null);const pe={...ue,...D,...F.props,className:mg(D.className,F.props.className),onTouchStart:ie,ref:se,...v?{onMouseMove:e=>{const t=F.props;t.onMouseMove&&t.onMouseMove(e),Bk={x:e.clientX,y:e.clientY},ce.current&&ce.current.update()}}:{}},fe={};f||(pe.onTouchStart=ae,pe.onTouchEnd=le),d||(pe.onMouseOver=_k(ee,pe.onMouseOver),pe.onMouseLeave=_k(te,pe.onMouseLeave),_||(fe.onMouseOver=ee,fe.onMouseLeave=te)),u||(pe.onFocus=_k(oe,pe.onFocus),pe.onBlur=_k(re,pe.onBlur),_||(fe.onFocus=oe,fe.onBlur=re));const he={...n,isRtl:A,arrow:r,disableInteractive:_,placement:k,PopperComponentProp:E,touch:B.current},me="function"==typeof P.popper?P.popper(he):P.popper,ge=s.useMemo(()=>{let e=[{name:"arrow",enabled:Boolean(z),options:{element:z,padding:4}}];return R.popperOptions?.modifiers&&(e=e.concat(R.popperOptions.modifiers)),me?.popperOptions?.modifiers&&(e=e.concat(me.popperOptions.modifiers)),{...R.popperOptions,...me?.popperOptions,modifiers:e}},[z,R.popperOptions,me?.popperOptions]),ve=(e=>{const{classes:t,disableInteractive:n,arrow:r,touch:o,placement:i}=e;return wm({popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",o&&"touch",`tooltipPlacement${xf(i.split("-")[0])}`],arrow:["arrow"]},Fk,t)})(he),be="function"==typeof P.transition?P.transition(he):P.transition,ye={slots:{popper:a.Popper,transition:a.Transition??I,tooltip:a.Tooltip,arrow:a.Arrow,...M},slotProps:{arrow:P.arrow??l.arrow,popper:{...R,...me??l.popper},tooltip:P.tooltip??l.tooltip,transition:{...O,...be??l.transition}}},[we,xe]=Ug("popper",{elementType:Ak,externalForwardedProps:ye,ownerState:he,className:mg(ve.popper,R?.className)}),[Se,Ce]=Ug("transition",{elementType:PS,externalForwardedProps:ye,ownerState:he}),[ke,Ee]=Ug("tooltip",{elementType:Nk,className:ve.tooltip,externalForwardedProps:ye,ownerState:he}),[Re,Pe]=Ug("arrow",{elementType:$k,className:ve.arrow,externalForwardedProps:ye,ownerState:he,ref:j});return Xp.jsxs(s.Fragment,{children:[s.cloneElement(F,pe),Xp.jsx(we,{as:E??My,placement:k,anchorEl:v?{getBoundingClientRect:()=>({top:Bk.y,left:Bk.x,right:Bk.x,bottom:Bk.y,width:0,height:0})}:N,popperRef:ce,open:!!N&&q,id:Y,transition:!0,...fe,...xe,popperOptions:ge,children:({TransitionProps:e})=>Xp.jsx(Se,{timeout:L.transitions.duration.shorter,...e,...Ce,children:Xp.jsxs(ke,{...Ee,children:[T,r?Xp.jsx(Re,{...Pe}):null]})})})]})});function Vk(e){return Ph("MuiSwitch",e)}const Wk=Mh("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),Uk=pg("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${xf(n.edge)}`],t[`size${xf(n.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${Wk.thumb}`]:{width:16,height:16},[`& .${Wk.switchBase}`]:{padding:4,[`&.${Wk.checked}`]:{transform:"translateX(16px)"}}}}]}),Gk=pg(ex,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${Wk.input}`]:t.input},"default"!==n.color&&t[`color${xf(n.color)}`]]}})(vg(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${"light"===e.palette.mode?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${Wk.checked}`]:{transform:"translateX(20px)"},[`&.${Wk.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${"light"===e.palette.mode?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${Wk.checked} + .${Wk.track}`]:{opacity:.5},[`&.${Wk.disabled} + .${Wk.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:""+("light"===e.palette.mode?.12:.2)},[`& .${Wk.input}`]:{left:"-100%",width:"300%"}})),vg(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(uv(["light"])).map(([t])=>({props:{color:t},style:{[`&.${Wk.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Wk.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${"light"===e.palette.mode?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.55)}`}},[`&.${Wk.checked} + .${Wk.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),Kk=pg("span",{name:"MuiSwitch",slot:"Track"})(vg(({theme:e})=>({height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${"light"===e.palette.mode?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:""+("light"===e.palette.mode?.38:.3)}))),qk=pg("span",{name:"MuiSwitch",slot:"Thumb"})(vg(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),Yk=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiSwitch"}),{className:r,color:o="primary",edge:i=!1,size:a="medium",sx:l,slots:s={},slotProps:c={},...u}=n,d={...n,color:o,edge:i,size:a},p=(e=>{const{classes:t,edge:n,size:r,color:o,checked:i,disabled:a}=e,l=wm({root:["root",n&&`edge${xf(n)}`,`size${xf(r)}`],switchBase:["switchBase",`color${xf(o)}`,i&&"checked",a&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},Vk,t);return{...t,...l}})(d),f={slots:s,slotProps:c},[h,m]=Ug("root",{className:mg(p.root,r),elementType:Uk,externalForwardedProps:f,ownerState:d,additionalProps:{sx:l}}),[g,v]=Ug("thumb",{className:p.thumb,elementType:qk,externalForwardedProps:f,ownerState:d}),b=Xp.jsx(g,{...v}),[y,w]=Ug("track",{className:p.track,elementType:Kk,externalForwardedProps:f,ownerState:d});return Xp.jsxs(h,{...m,children:[Xp.jsx(Gk,{type:"checkbox",icon:b,checkedIcon:b,ref:t,ownerState:d,...u,classes:{...p,root:p.switchBase},slots:{...s.switchBase&&{root:s.switchBase},...s.input&&{input:s.input}},slotProps:{...c.switchBase&&{root:"function"==typeof c.switchBase?c.switchBase(d):c.switchBase},input:{role:"switch"},...c.input&&{input:"function"==typeof c.input?c.input(d):c.input}}}),Xp.jsx(y,{...w})]})});function Xk(e){return Ph("MuiTab",e)}const Qk=Mh("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),Zk=pg(sv,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${xf(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${Qk.iconWrapper}`]:t.iconWrapper},{[`& .${Qk.icon}`]:t.icon}]}})(vg(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&("top"===e.iconPosition||"bottom"===e.iconPosition),style:{flexDirection:"column"}},{props:({ownerState:e})=>e.label&&"top"!==e.iconPosition&&"bottom"!==e.iconPosition,style:{flexDirection:"row"}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"top"===t,style:{[`& > .${Qk.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"bottom"===t,style:{[`& > .${Qk.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"start"===t,style:{[`& > .${Qk.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"end"===t,style:{[`& > .${Qk.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${Qk.selected}`]:{opacity:1},[`&.${Qk.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${Qk.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${Qk.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${Qk.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${Qk.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),Jk=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTab"}),{className:r,disabled:o=!1,disableFocusRipple:i=!1,fullWidth:a,icon:l,iconPosition:c="top",indicator:u,label:d,onChange:p,onClick:f,onFocus:h,selected:m,selectionFollowsFocus:g,textColor:v="inherit",value:b,wrapped:y=!1,...w}=n,x={...n,disabled:o,disableFocusRipple:i,selected:m,icon:!!l,iconPosition:c,label:!!d,fullWidth:a,textColor:v,wrapped:y},S=(e=>{const{classes:t,textColor:n,fullWidth:r,wrapped:o,icon:i,label:a,selected:l,disabled:s}=e;return wm({root:["root",i&&a&&"labelIcon",`textColor${xf(n)}`,r&&"fullWidth",o&&"wrapped",l&&"selected",s&&"disabled"],icon:["iconWrapper","icon"]},Xk,t)})(x),C=l&&d&&s.isValidElement(l)?s.cloneElement(l,{className:mg(S.icon,l.props.className)}):l;return Xp.jsxs(Zk,{focusRipple:!i,className:mg(S.root,r),ref:t,role:"tab","aria-selected":m,disabled:o,onClick:e=>{!m&&p&&p(e,b),f&&f(e)},onFocus:e=>{g&&!m&&p&&p(e,b),h&&h(e)},ownerState:x,tabIndex:m?0:-1,...w,children:["top"===c||"start"===c?Xp.jsxs(s.Fragment,{children:[C,d]}):Xp.jsxs(s.Fragment,{children:[d,C]}),u]})}),eE=s.createContext(),tE=s.createContext();function nE(e){return Ph("MuiTableCell",e)}const rE=Mh("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),oE=pg("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${xf(n.size)}`],"normal"!==n.padding&&t[`padding${xf(n.padding)}`],"inherit"!==n.align&&t[`align${xf(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(vg(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid\n ${"light"===e.palette.mode?e.lighten(e.alpha(e.palette.divider,1),.88):e.darken(e.alpha(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${rE.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:e})=>e.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),iE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTableCell"}),{align:r="inherit",className:o,component:i,padding:a,scope:l,size:c,sortDirection:u,variant:d,...p}=n,f=s.useContext(eE),h=s.useContext(tE),m=h&&"head"===h.variant;let g;g=i||(m?"th":"td");let v=l;"td"===g?v=void 0:!v&&m&&(v="col");const b=d||h&&h.variant,y={...n,align:r,component:g,padding:a||(f&&f.padding?f.padding:"normal"),size:c||(f&&f.size?f.size:"medium"),sortDirection:u,stickyHeader:"head"===b&&f&&f.stickyHeader,variant:b},w=(e=>{const{classes:t,variant:n,align:r,padding:o,size:i,stickyHeader:a}=e;return wm({root:["root",n,a&&"stickyHeader","inherit"!==r&&`align${xf(r)}`,"normal"!==o&&`padding${xf(o)}`,`size${xf(i)}`]},nE,t)})(y);let x=null;return u&&(x="asc"===u?"ascending":"descending"),Xp.jsx(oE,{as:g,ref:t,className:mg(w.root,o),"aria-sort":x,scope:v,ownerState:y,...p})});function aE(e){return Ph("MuiToolbar",e)}Mh("MuiToolbar",["root","gutters","regular","dense"]);const lE=pg("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(vg(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),sE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiToolbar"}),{className:r,component:o="div",disableGutters:i=!1,variant:a="regular",...l}=n,s={...n,component:o,disableGutters:i,variant:a},c=(e=>{const{classes:t,disableGutters:n,variant:r}=e;return wm({root:["root",!n&&"gutters",r]},aE,t)})(s);return Xp.jsx(lE,{as:o,className:mg(c.root,r),ref:t,ownerState:s,...l})});var cE=Sg(Xp.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),uE=Sg(Xp.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}));function dE(e){return Ph("MuiTablePaginationActions",e)}Mh("MuiTablePaginationActions",["root"]);const pE=pg("div",{name:"MuiTablePaginationActions",slot:"Root"})({}),fE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTablePaginationActions"}),{backIconButtonProps:r,className:o,count:i,disabled:a=!1,getItemAriaLabel:l,nextIconButtonProps:s,onPageChange:c,page:u,rowsPerPage:d,showFirstButton:p,showLastButton:f,slots:h={},slotProps:m={},...g}=n,v=um(),b=(e=>{const{classes:t}=e;return wm({root:["root"]},dE,t)})(n),y=h.firstButton??Mv,w=h.lastButton??Mv,x=h.nextButton??Mv,S=h.previousButton??Mv,C=h.firstButtonIcon??nk,k=h.lastButtonIcon??rk,E=h.nextButtonIcon??uE,R=h.previousButtonIcon??cE,P=v?w:y,M=v?x:S,T=v?S:x,I=v?y:w,O=v?m.lastButton:m.firstButton,D=v?m.nextButton:m.previousButton,F=v?m.previousButton:m.nextButton,L=v?m.firstButton:m.lastButton;return Xp.jsxs(pE,{ref:t,className:mg(b.root,o),...g,children:[p&&Xp.jsx(P,{onClick:e=>{c(e,0)},disabled:a||0===u,"aria-label":l("first",u),title:l("first",u),...O,children:v?Xp.jsx(k,{...m.lastButtonIcon}):Xp.jsx(C,{...m.firstButtonIcon})}),Xp.jsx(M,{onClick:e=>{c(e,u-1)},disabled:a||0===u,color:"inherit","aria-label":l("previous",u),title:l("previous",u),...D??r,children:v?Xp.jsx(E,{...m.nextButtonIcon}):Xp.jsx(R,{...m.previousButtonIcon})}),Xp.jsx(T,{onClick:e=>{c(e,u+1)},disabled:a||-1!==i&&u>=Math.ceil(i/d)-1,color:"inherit","aria-label":l("next",u),title:l("next",u),...F??s,children:v?Xp.jsx(R,{...m.previousButtonIcon}):Xp.jsx(E,{...m.nextButtonIcon})}),f&&Xp.jsx(I,{onClick:e=>{c(e,Math.max(0,Math.ceil(i/d)-1))},disabled:a||u>=Math.ceil(i/d)-1,"aria-label":l("last",u),title:l("last",u),...L,children:v?Xp.jsx(C,{...m.firstButtonIcon}):Xp.jsx(k,{...m.lastButtonIcon})})]})});function hE(e){return Ph("MuiTablePagination",e)}const mE=Mh("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var gE;const vE=pg(iE,{name:"MuiTablePagination",slot:"Root"})(vg(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),bE=pg(sE,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${mE.actions}`]:t.actions,...t.toolbar})})(vg(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${mE.actions}`]:{flexShrink:0,marginLeft:20}}))),yE=pg("div",{name:"MuiTablePagination",slot:"Spacer"})({flex:"1 1 100%"}),wE=pg("p",{name:"MuiTablePagination",slot:"SelectLabel"})(vg(({theme:e})=>({...e.typography.body2,flexShrink:0}))),xE=pg(vk,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${mE.selectIcon}`]:t.selectIcon,[`& .${mE.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${mE.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),SE=pg(_C,{name:"MuiTablePagination",slot:"MenuItem"})({}),CE=pg("p",{name:"MuiTablePagination",slot:"DisplayedRows"})(vg(({theme:e})=>({...e.typography.body2,flexShrink:0})));function kE({from:e,to:t,count:n}){return`${e}–${t} of ${-1!==n?n:`more than ${t}`}`}function EE(e){return`Go to ${e} page`}const RE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTablePagination"}),{ActionsComponent:r=fE,backIconButtonProps:o,colSpan:i,component:a=iE,count:l,disabled:c=!1,getItemAriaLabel:u=EE,labelDisplayedRows:d=kE,labelRowsPerPage:p="Rows per page:",nextIconButtonProps:f,onPageChange:h,onRowsPerPageChange:m,page:g,rowsPerPage:v,rowsPerPageOptions:b=[10,25,50,100],SelectProps:y={},showFirstButton:w=!1,showLastButton:x=!1,slotProps:S={},slots:C={},...k}=n,E=n,R=(e=>{const{classes:t}=e;return wm({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},hE,t)})(E),P=S?.select??y,M=P.native?"option":SE;let T;a!==iE&&"td"!==a||(T=i||1e3);const I=mm(P.id),O=mm(P.labelId),D={slots:C,slotProps:S},[F,L]=Ug("root",{ref:t,className:R.root,elementType:vE,externalForwardedProps:{...D,component:a,...k},ownerState:E,additionalProps:{colSpan:T}}),[A,N]=Ug("toolbar",{className:R.toolbar,elementType:bE,externalForwardedProps:D,ownerState:E}),[$,z]=Ug("spacer",{className:R.spacer,elementType:yE,externalForwardedProps:D,ownerState:E}),[j,B]=Ug("selectLabel",{className:R.selectLabel,elementType:wE,externalForwardedProps:D,ownerState:E,additionalProps:{id:O}}),[_,H]=Ug("select",{className:R.select,elementType:xE,externalForwardedProps:D,ownerState:E}),[V,W]=Ug("menuItem",{className:R.menuItem,elementType:M,externalForwardedProps:D,ownerState:E}),[U,G]=Ug("displayedRows",{className:R.displayedRows,elementType:CE,externalForwardedProps:D,ownerState:E});return Xp.jsx(F,{...L,children:Xp.jsxs(A,{...N,children:[Xp.jsx($,{...z}),b.length>1&&Xp.jsx(j,{...B,children:p}),b.length>1&&Xp.jsx(_,{variant:"standard",...!P.variant&&{input:gE||(gE=Xp.jsx(nw,{}))},value:v,onChange:m,id:I,labelId:O,...P,classes:{...P.classes,root:mg(R.input,R.selectRoot,(P.classes||{}).root),select:mg(R.select,(P.classes||{}).select),icon:mg(R.selectIcon,(P.classes||{}).icon)},disabled:c,...H,children:b.map(e=>s.createElement(V,{...W,key:e.label?e.label:e,value:e.value?e.value:e},e.label?e.label:e))}),Xp.jsx(U,{...G,children:d({from:0===l?0:g*v+1,to:-1===l?(g+1)*v:-1===v?l:Math.min(l,(g+1)*v),count:-1===l?-1:l,page:g})}),Xp.jsx(r,{className:R.actions,backIconButtonProps:o,count:l,nextIconButtonProps:f,onPageChange:h,page:g,rowsPerPage:v,showFirstButton:w,showLastButton:x,slotProps:S.actions,slots:C.actions,getItemAriaLabel:u,disabled:c})]})})});function PE(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}const ME={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function TE(e){return Ph("MuiTabScrollButton",e)}const IE=Mh("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),OE=pg(sv,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${IE.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),DE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTabScrollButton"}),{className:r,slots:o={},slotProps:i={},direction:a,orientation:l,disabled:s,...c}=n,u=um(),d={isRtl:u,...n},p=(e=>{const{classes:t,orientation:n,disabled:r}=e;return wm({root:["root",n,r&&"disabled"]},TE,t)})(d),f=o.StartScrollButtonIcon??cE,h=o.EndScrollButtonIcon??uE,m=yy({elementType:f,externalSlotProps:i.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),g=yy({elementType:h,externalSlotProps:i.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return Xp.jsx(OE,{component:"div",className:mg(p.root,r),ref:t,role:null,ownerState:d,tabIndex:null,...c,style:{...c.style,..."vertical"===l&&{"--TabScrollButton-svgRotate":`rotate(${u?-90:90}deg)`}},children:"left"===a?Xp.jsx(f,{...m}):Xp.jsx(h,{...g})})});function FE(e){return Ph("MuiTabs",e)}const LE=Mh("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),AE=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,NE=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,$E=(e,t,n)=>{let r=!1,o=n(e,t);for(;o;){if(o===e.firstChild){if(r)return;r=!0}const t=o.disabled||"true"===o.getAttribute("aria-disabled");if(o.hasAttribute("tabindex")&&!t)return void o.focus();o=n(e,o)}},zE=pg("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${LE.scrollButtons}`]:t.scrollButtons},{[`& .${LE.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(vg(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${LE.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),jE=pg("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),BE=pg("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),_E=pg("span",{name:"MuiTabs",slot:"Indicator"})(vg(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:"100%",width:2,right:0}}]}))),HE=pg(function(e){const{onChange:t,...n}=e,r=s.useRef(),o=s.useRef(null),i=()=>{r.current=o.current.offsetHeight-o.current.clientHeight};return Wh(()=>{const e=Cg(()=>{const e=r.current;i(),e!==r.current&&t(r.current)}),n=Eg(o.current);return n.addEventListener("resize",e),()=>{e.clear(),n.removeEventListener("resize",e)}},[t]),s.useEffect(()=>{i(),t(r.current)},[t]),Xp.jsx("div",{style:ME,...n,ref:o})})({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),VE={},WE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTabs"}),r=sg(),o=um(),{"aria-label":i,"aria-labelledby":a,action:l,centered:c=!1,children:u,className:d,component:p="div",allowScrollButtonsMobile:f=!1,indicatorColor:h="primary",onChange:m,orientation:g="horizontal",ScrollButtonComponent:v,scrollButtons:b="auto",selectionFollowsFocus:y,slots:w={},slotProps:x={},TabIndicatorProps:S={},TabScrollButtonProps:C={},textColor:k="primary",value:E,variant:R="standard",visibleScrollbar:P=!1,...M}=n,T="scrollable"===R,I="vertical"===g,O=I?"scrollTop":"scrollLeft",D=I?"top":"left",F=I?"bottom":"right",L=I?"clientHeight":"clientWidth",A=I?"height":"width",N={...n,component:p,allowScrollButtonsMobile:f,indicatorColor:h,orientation:g,vertical:I,scrollButtons:b,textColor:k,variant:R,visibleScrollbar:P,fixed:!T,hideScrollbar:T&&!P,scrollableX:T&&!I,scrollableY:T&&I,centered:c&&!T,scrollButtonsHideMobile:!f},$=(e=>{const{vertical:t,fixed:n,hideScrollbar:r,scrollableX:o,scrollableY:i,centered:a,scrollButtonsHideMobile:l,classes:s}=e;return wm({root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",o&&"scrollableX",i&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",l&&"scrollButtonsHideMobile"],scrollableX:[o&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},FE,s)})(N),z=yy({elementType:w.StartScrollButtonIcon,externalSlotProps:x.startScrollButtonIcon,ownerState:N}),j=yy({elementType:w.EndScrollButtonIcon,externalSlotProps:x.endScrollButtonIcon,ownerState:N}),[B,_]=s.useState(!1),[H,V]=s.useState(VE),[W,U]=s.useState(!1),[G,K]=s.useState(!1),[q,Y]=s.useState(!1),[X,Q]=s.useState({overflow:"hidden",scrollbarWidth:0}),Z=new Map,J=s.useRef(null),ee=s.useRef(null),te={slots:w,slotProps:{indicator:S,scrollButton:C,...x}},ne=()=>{const e=J.current;let t,n;if(e){const n=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}if(e&&!1!==E){const e=ee.current.children;if(e.length>0){const t=e[Z.get(E)];n=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:n}},re=Mg(()=>{const{tabsMeta:e,tabMeta:t}=ne();let n,r=0;I?(n="top",t&&e&&(r=t.top-e.top+e.scrollTop)):(n=o?"right":"left",t&&e&&(r=(o?-1:1)*(t[n]-e[n]+e.scrollLeft)));const i={[n]:r,[A]:t?t[A]:0};if("number"!=typeof H[n]||"number"!=typeof H[A])V(i);else{const e=Math.abs(H[n]-i[n]),t=Math.abs(H[A]-i[A]);(e>=1||t>=1)&&V(i)}}),oe=(e,{animation:t=!0}={})=>{t?function(e,t,n,r={},o=()=>{}){const{ease:i=PE,duration:a=300}=r;let l=null;const s=t[e];let c=!1;const u=()=>{c=!0},d=r=>{if(c)return void o(new Error("Animation cancelled"));null===l&&(l=r);const u=Math.min(1,(r-l)/a);t[e]=i(u)*(n-s)+s,u>=1?requestAnimationFrame(()=>{o(null)}):requestAnimationFrame(d)};s===n?o(new Error("Element already at target position")):requestAnimationFrame(d)}(O,J.current,e,{duration:r.transitions.duration.standard}):J.current[O]=e},ie=e=>{let t=J.current[O];t+=I?e:e*(o?-1:1),oe(t)},ae=()=>{const e=J.current[L];let t=0;const n=Array.from(ee.current.children);for(let r=0;r<n.length;r+=1){const o=n[r];if(t+o[L]>e){0===r&&(t=e);break}t+=o[L]}return t},le=()=>{ie(-1*ae())},se=()=>{ie(ae())},[ce,{onChange:ue,...de}]=Ug("scrollbar",{className:mg($.scrollableX,$.hideScrollbar),elementType:HE,shouldForwardComponentProp:!0,externalForwardedProps:te,ownerState:N}),pe=s.useCallback(e=>{ue?.(e),Q({overflow:null,scrollbarWidth:e})},[ue]),[fe,he]=Ug("scrollButtons",{className:mg($.scrollButtons,C.className),elementType:DE,externalForwardedProps:te,ownerState:N,additionalProps:{orientation:g,slots:{StartScrollButtonIcon:w.startScrollButtonIcon||w.StartScrollButtonIcon,EndScrollButtonIcon:w.endScrollButtonIcon||w.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:z,endScrollButtonIcon:j}}}),me=Mg(e=>{const{tabsMeta:t,tabMeta:n}=ne();if(n&&t)if(n[D]<t[D]){const r=t[O]+(n[D]-t[D]);oe(r,{animation:e})}else if(n[F]>t[F]){const r=t[O]+(n[F]-t[F]);oe(r,{animation:e})}}),ge=Mg(()=>{T&&!1!==b&&Y(!q)});s.useEffect(()=>{const e=Cg(()=>{J.current&&re()});let t;const n=n=>{n.forEach(e=>{e.removedNodes.forEach(e=>{t?.unobserve(e)}),e.addedNodes.forEach(e=>{t?.observe(e)})}),e(),ge()},r=Eg(J.current);let o;return r.addEventListener("resize",e),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(e),Array.from(ee.current.children).forEach(e=>{t.observe(e)})),"undefined"!=typeof MutationObserver&&(o=new MutationObserver(n),o.observe(ee.current,{childList:!0})),()=>{e.clear(),r.removeEventListener("resize",e),o?.disconnect(),t?.disconnect()}},[re,ge]),s.useEffect(()=>{const e=Array.from(ee.current.children),t=e.length;if("undefined"!=typeof IntersectionObserver&&t>0&&T&&!1!==b){const n=e[0],r=e[t-1],o={root:J.current,threshold:.99},i=new IntersectionObserver(e=>{U(!e[0].isIntersecting)},o);i.observe(n);const a=new IntersectionObserver(e=>{K(!e[0].isIntersecting)},o);return a.observe(r),()=>{i.disconnect(),a.disconnect()}}},[T,b,q,u?.length]),s.useEffect(()=>{_(!0)},[]),s.useEffect(()=>{re()}),s.useEffect(()=>{me(VE!==H)},[me,H]),s.useImperativeHandle(l,()=>({updateIndicator:re,updateScrollButtons:ge}),[re,ge]);const[ve,be]=Ug("indicator",{className:mg($.indicator,S.className),elementType:_E,externalForwardedProps:te,ownerState:N,additionalProps:{style:H}}),ye=Xp.jsx(ve,{...be});let we=0;const xe=s.Children.map(u,e=>{if(!s.isValidElement(e))return null;const t=void 0===e.props.value?we:e.props.value;Z.set(t,we);const n=t===E;return we+=1,s.cloneElement(e,{fullWidth:"fullWidth"===R,indicator:n&&!B&&ye,selected:n,selectionFollowsFocus:y,onChange:m,textColor:k,value:t,...1!==we||!1!==E||e.props.tabIndex?{}:{tabIndex:0}})}),Se=(()=>{const e={};e.scrollbarSizeListener=T?Xp.jsx(ce,{...de,onChange:pe}):null;const t=T&&("auto"===b&&(W||G)||!0===b);return e.scrollButtonStart=t?Xp.jsx(fe,{direction:o?"right":"left",onClick:le,disabled:!W,...he}):null,e.scrollButtonEnd=t?Xp.jsx(fe,{direction:o?"left":"right",onClick:se,disabled:!G,...he}):null,e})(),[Ce,ke]=Ug("root",{ref:t,className:mg($.root,d),elementType:zE,externalForwardedProps:{...te,...M,component:p},ownerState:N}),[Ee,Re]=Ug("scroller",{ref:J,className:$.scroller,elementType:jE,externalForwardedProps:te,ownerState:N,additionalProps:{style:{overflow:X.overflow,[I?"margin"+(o?"Left":"Right"):"marginBottom"]:P?void 0:-X.scrollbarWidth}}}),[Pe,Me]=Ug("list",{ref:ee,className:mg($.list,$.flexContainer),elementType:BE,externalForwardedProps:te,ownerState:N,getSlotProps:e=>({...e,onKeyDown:t=>{(e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;const t=ee.current,n=yx(kg(t)),r=n?.getAttribute("role");if("tab"!==r)return;let i="horizontal"===g?"ArrowLeft":"ArrowUp",a="horizontal"===g?"ArrowRight":"ArrowDown";switch("horizontal"===g&&o&&(i="ArrowRight",a="ArrowLeft"),e.key){case i:e.preventDefault(),$E(t,n,NE);break;case a:e.preventDefault(),$E(t,n,AE);break;case"Home":e.preventDefault(),$E(t,null,AE);break;case"End":e.preventDefault(),$E(t,null,NE)}})(t),e.onKeyDown?.(t)}})});return Xp.jsxs(Ce,{...ke,children:[Se.scrollButtonStart,Se.scrollbarSizeListener,Xp.jsxs(Ee,{...Re,children:[Xp.jsx(Pe,{"aria-label":i,"aria-labelledby":a,"aria-orientation":"vertical"===g?"vertical":null,role:"tablist",...Me,children:xe}),B&&ye]}),Se.scrollButtonEnd]})});function UE(e){return Ph("MuiTextField",e)}Mh("MuiTextField",["root"]);const GE={standard:IS,filled:iS,outlined:tk},KE=pg(sS,{name:"MuiTextField",slot:"Root"})({}),qE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTextField"}),{autoComplete:r,autoFocus:o=!1,children:i,className:a,color:l="primary",defaultValue:s,disabled:c=!1,error:u=!1,FormHelperTextProps:d,fullWidth:p=!1,helperText:f,id:h,InputLabelProps:m,inputProps:g,InputProps:v,inputRef:b,label:y,maxRows:w,minRows:x,multiline:S=!1,name:C,onBlur:k,onChange:E,onFocus:R,placeholder:P,required:M=!1,rows:T,select:I=!1,SelectProps:O,slots:D={},slotProps:F={},type:L,value:A,variant:N="outlined",...$}=n,z={...n,autoFocus:o,color:l,disabled:c,error:u,fullWidth:p,multiline:S,required:M,select:I,variant:N},j=(e=>{const{classes:t}=e;return wm({root:["root"]},UE,t)})(z),B=mm(h),_=f&&B?`${B}-helper-text`:void 0,H=y&&B?`${B}-label`:void 0,V=GE[N],W={slots:D,slotProps:{input:v,inputLabel:m,htmlInput:g,formHelperText:d,select:O,...F}},U={},G=W.slotProps.inputLabel;"outlined"===N&&(G&&void 0!==G.shrink&&(U.notched=G.shrink),U.label=y),I&&(O&&O.native||(U.id=void 0),U["aria-describedby"]=void 0);const[K,q]=Ug("root",{elementType:KE,shouldForwardComponentProp:!0,externalForwardedProps:{...W,...$},ownerState:z,className:mg(j.root,a),ref:t,additionalProps:{disabled:c,error:u,fullWidth:p,required:M,color:l,variant:N}}),[Y,X]=Ug("input",{elementType:V,externalForwardedProps:W,additionalProps:U,ownerState:z}),[Q,Z]=Ug("inputLabel",{elementType:zS,externalForwardedProps:W,ownerState:z}),[J,ee]=Ug("htmlInput",{elementType:"input",externalForwardedProps:W,ownerState:z}),[te,ne]=Ug("formHelperText",{elementType:bS,externalForwardedProps:W,ownerState:z}),[re,oe]=Ug("select",{elementType:vk,externalForwardedProps:W,ownerState:z}),ie=Xp.jsx(Y,{"aria-describedby":_,autoComplete:r,autoFocus:o,defaultValue:s,fullWidth:p,multiline:S,name:C,rows:T,maxRows:w,minRows:x,type:L,value:A,id:B,inputRef:b,onBlur:k,onChange:E,onFocus:R,placeholder:P,inputProps:ee,slots:{input:D.htmlInput?J:void 0},...X});return Xp.jsxs(K,{...q,children:[null!=y&&""!==y&&Xp.jsx(Q,{htmlFor:B,id:H,...Z,children:y}),I?Xp.jsx(re,{"aria-describedby":_,id:B,labelId:H,value:A,input:ie,...oe,children:i}):ie,f&&Xp.jsx(te,{id:_,...ne,children:f})]})});function YE(e){return Ph("MuiToggleButton",e)}const XE=Mh("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),QE=s.createContext({}),ZE=s.createContext(void 0);function JE(e,t){return void 0!==t&&void 0!==e&&(Array.isArray(t)?t.includes(e):e===t)}const eR=pg(sv,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`size${xf(n.size)}`]]}})(vg(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${XE.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${XE.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter(uv()).map(([t])=>({props:{color:t},style:{[`&.${XE.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),tR=s.forwardRef(function(e,t){const{value:n,...r}=s.useContext(QE),o=s.useContext(ZE),i=bg({props:Hh({...r,selected:JE(e.value,n)},e),name:"MuiToggleButton"}),{children:a,className:l,color:c="standard",disabled:u=!1,disableFocusRipple:d=!1,fullWidth:p=!1,onChange:f,onClick:h,selected:m,size:g="medium",value:v,...b}=i,y={...i,color:c,disabled:u,disableFocusRipple:d,fullWidth:p,size:g},w=(e=>{const{classes:t,fullWidth:n,selected:r,disabled:o,size:i,color:a}=e;return wm({root:["root",r&&"selected",o&&"disabled",n&&"fullWidth",`size${xf(i)}`,a]},YE,t)})(y),x=o||"";return Xp.jsx(eR,{className:mg(r.className,w.root,l,x),disabled:u,focusRipple:!d,ref:t,onClick:e=>{h&&(h(e,v),e.defaultPrevented)||f&&f(e,v)},onChange:f,value:v,ownerState:y,"aria-pressed":m,...b,children:a})}),nR=qh({themeId:od}),rR=Number("7");var oR=Sg(Xp.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"})),iR=Sg(Xp.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2m-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}));const aR=s.createElement(oR,{fontSize:"small"}),lR=s.createElement(iR,{fontSize:"small"});function sR({items:e,selectedKeys:t,defaultSelectedKeys:n,onChange:r,inputValue:o,defaultInputValue:i,onInputChange:a,debounceMs:l=300,label:c,placeholder:u,loading:d,disabled:p,size:f="small",error:h,helperText:m,limitTags:g=3,disableClearable:v,id:b,textFieldProps:y}){const w=s.useMemo(()=>Array.isArray(e)?e:[],[e]),x=Array.isArray(t),[S,C]=s.useState(Array.isArray(n)?n:[]),k=x?t:S,E=s.useMemo(()=>{const e=new Map;for(const t of w)e.set(t&&t.key,t);return e},[w]),R=s.useMemo(()=>(Array.isArray(k)?k:[]).map(e=>E.get(e)).filter(Boolean),[k,E]),P="string"==typeof o,[M,T]=s.useState("string"==typeof i?i:""),I=P?o:M,O=function(e,t=300){const n=s.useRef(e),r=s.useRef(null);return n.current=e,s.useEffect(()=>()=>{r.current&&window.clearTimeout(r.current)},[]),s.useCallback((...e)=>{n.current&&(r.current&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>{n.current&&n.current(...e)},t))},[t])}(e=>{a&&a(e)},l),D=R;return s.createElement(sS,{fullWidth:!0,error:h,disabled:p},s.createElement(Ew,{openOnFocus:!0,forcePopupIcon:!0,id:b,multiple:!0,disableCloseOnSelect:!0,options:w,value:D,inputValue:I,getOptionLabel:e=>e&&"object"==typeof e?e.value??"":"",isOptionEqualToValue:(e,t)=>e&&t&&e.key===t.key,loading:d,limitTags:g,disableClearable:v,onChange:(e,t)=>{const n=Array.isArray(t)?t.map(e=>e&&e.key):[];x||C(n),r&&r(n,Array.isArray(t)?t:[])},onInputChange:(e,t,n)=>{P||T(t??""),"input"===n?O(t??""):"clear"===n&&O("")},renderOption:(e,t,{selected:n})=>s.createElement("li",Xr({},e,{key:t&&t.key||Math.random().toString(36)}),s.createElement(ux,{icon:aR,checkedIcon:lR,style:{marginRight:8},checked:!!n}),t&&t.value),renderTags:(e,t)=>(Array.isArray(e)?e:[]).map((e,n)=>s.createElement(zy,Xr({},t({index:n}),{key:e&&e.key||n,label:e&&e.value||""}))),renderInput:e=>s.createElement(qE,Xr({},e,{label:c,placeholder:u,InputProps:{...e.InputProps,endAdornment:s.createElement(s.Fragment,null,d?s.createElement(Cv,{size:18}):null,e.InputProps.endAdornment)},size:f},y))}),m?s.createElement(bS,null,m):null)}const cR=({filter:e,channel:t,query:n})=>{const[r,o]=s.useState([]),[i,a]=s.useState([]),[l,u]=s.useState(!1),[d,p]=s.useState("");return s.useEffect(()=>{a(n?.filter?.[e?.filter]||[])},[n]),s.useEffect(()=>{(async()=>{u(!0);const t=await async function(e,t){return t?.source?(await jc.runReport({id:t.source})).map(e=>({key:e[t.field],value:e[t.field]})):[]}(0,e);o(t),u(!1)})()},[d]),c.createElement("div",{style:{display:"flex"}},c.createElement("div",{style:{maxWidth:640,minWidth:200}},c.createElement(sR,{id:e?.title,label:e?.title,placeholder:"Type to search…",items:r,selectedKeys:i,onChange:(n,r)=>{a(n),t.emit("filterChanged",e,{[e.filter]:n})},onInputChange:e=>{p(e)},loading:l,debounceMs:300,helperText:i.length?`${i.length} selected`:""})))};function uR({items:e,value:t,label:n,onChange:r,sx:o={width:"100%"},disabled:i=!1}){const a=e.some(e=>e.key===t)?t:"";return c.createElement(jw,{sx:o},c.createElement(sS,{fullWidth:!0},c.createElement(zS,{id:"demo-simple-select-label"},n),c.createElement(vk,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:a,label:n,onChange:r,disabled:i,MenuProps:{style:{maxHeight:"300px"}},size:"small"},e.map(e=>{const{key:t,value:n,disabled:r}=e;return c.createElement(_C,{key:t,value:t,disabled:r},n)}))))}const dR=({filter:e,channel:t,query:n})=>{const[r,o]=s.useState([]),[i,a]=s.useState("");return s.useEffect(()=>{a(n?.date_range?.name)},[n]),s.useEffect(()=>{(async()=>{const t=(await jc.getDateRanges()).filter(t=>!(e.allowedOptions.length>0)||e.allowedOptions.some(e=>e===t.name)).map(e=>({key:e.name,value:e.title}));o(t)})()},[]),c.createElement("div",{style:{minWidth:"200px",maxWidth:"640px"}},c.createElement(uR,{items:r,value:i,label:e?.title,onChange:(n,r)=>{const o=n.target.value;a(o),t.emit("filterChanged",e,{date_range:{name:o}})}}))},pR=({filters:e=[],channel:t,query:n})=>c.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"}},e.map(e=>"multi-select"===e.type?c.createElement(cR,{key:e.title,channel:t,filter:e,query:n}):"date-range"===e.type?c.createElement(dR,{key:e.title,channel:t,filter:e,query:n}):null));var fR,hR={exports:{}};var mR=(fR||(fR=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var l=new o(r,i||e,a),s=n?n+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],l]:e._events[s].push(l):(e._events[s]=l,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),l.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},l.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o<i;o++)a[o]=r[o].fn;return a},l.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},l.prototype.emit=function(e,t,r,o,i,a){var l=n?n+e:e;if(!this._events[l])return!1;var s,c,u=this._events[l],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,i),!0;case 6:return u.fn.call(u.context,t,r,o,i,a),!0}for(c=1,s=new Array(d-1);c<d;c++)s[c-1]=arguments[c];u.fn.apply(u.context,s)}else{var p,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,o);break;default:if(!s)for(p=1,s=new Array(d-1);p<d;p++)s[p-1]=arguments[p];u[c].fn.apply(u[c].context,s)}}return!0},l.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},l.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},l.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var l=this._events[i];if(l.fn)l.fn!==t||o&&!l.once||r&&l.context!==r||a(this,i);else{for(var s=0,c=[],u=l.length;s<u;s++)(l[s].fn!==t||o&&!l[s].once||r&&l[s].context!==r)&&c.push(l[s]);c.length?this._events[i]=1===c.length?c[0]:c:a(this,i)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l}(hR)),hR.exports),gR=t(mR),vR=e=>c.useRef(e||new gR).current,bR=e=>{const t=c.useState({}),n=c.useCallback((n,r)=>{let o={...t.current,...r};for(var i in t.current=o,o)"date_range"===i||o[i].length||delete o[i];e?.emit("mergedFilterChanged",{value:o})},[e]);c.useEffect(()=>(e?.on("filterChanged",n),()=>{e?.off("filterChanged",n)}),[e])},yR=({id:e,cache:t,dashboard:n,channel:r,...o})=>{const[i,a]=c.useState(),[l,u]=c.useState(),[d,p]=c.useState(),[f,h]=c.useState(),[m,g]=c.useState(vu()),[v,b]=c.useState(),[y,w]=c.useState(0),[x,S]=c.useState(!1),[C,k]=c.useState(),[E,R]=c.useState(!1),P=c.useRef({value:o?.filter}),[M,T]=c.useState({}),{ref:I,inView:O}=function({threshold:e,delay:t,trackVisibility:n,rootMargin:r,root:o,triggerOnce:i,skip:a,initialInView:l,fallbackInView:c,onChange:u}={}){var d;const[p,f]=s.useState(null),h=s.useRef(u),m=s.useRef(l),[g,v]=s.useState({inView:!!l,entry:void 0});h.current=u,s.useEffect(()=>{if(void 0===m.current&&(m.current=l),a||!p)return;let s;return s=Su(p,(e,t)=>{const n=m.current;m.current=e,(void 0!==n||e)&&(v({inView:e,entry:t}),h.current&&h.current(e,t),t.isIntersecting&&i&&s&&(s(),s=void 0))},{root:o,rootMargin:r,threshold:e,trackVisibility:n,delay:t},c),()=>{s&&s()}},[Array.isArray(e)?e.toString():e,p,o,r,i,a,n,c,t]);const b=null==(d=g.entry)?void 0:d.target,y=s.useRef(void 0);p||!b||i||a||y.current===b||(y.current=b,v({inView:!!l,entry:void 0}),m.current=l);const w=[f,g.inView,g.entry];return w.ref=w[0],w.inView=w[1],w.entry=w[2],w}({threshold:.1,delay:1e3}),D=vR(r);bR(D);const F=c.useCallback(e=>{const t=e.target.value;w(t),b(i.doc.view[t])},[i]);c.useEffect(()=>{e&&(async()=>{const n=e,r=t?.[n]||await jc.getChart({id:n}),i=r.doc.source?.id,l=i?t?.[i]||await jc.getReport({id:i}):void 0,s=t?.[`schema_${i}`]||o?.schema||await jc.getReportSchema({id:i}),c=r.doc?.view?.[0];w(0),u(l),a(r),b(c),p(s),R(!0)})().catch(e=>{console.error(e.message)})},[e]),c.useEffect(()=>{i&&f&&(!i?.doc?.source?.id||l)&&d&&(async()=>{g(vu(i.doc.chart?.component,{view:v,source:f,chart:i,report:l,schema:d,dashboard:n,query:M}))})().catch(e=>{console.error(e.message)})},[i,f,v,l,d]);const L=e=>{const t={...l?.doc.query.filter||{},...o?.filter,...e?.value},n=t.date_range||l?.doc.query.date_range;if(delete t.date_range,R(!1),k(),S(!0),"context"===i?.doc?.source?.type)return h({filter:t}),void S(!1);const r={filter:t,date_range:n,parameters:o?.params};T(r),jc.runReport({id:l.id,query:r}).then(e=>{h(i.doc.source.reverse?e.reverse():e)}).catch(e=>{h([])}).finally(()=>{S(!1)})},A=e=>{P.current=e,O?L(e):(k(e),R(!0))};return c.useEffect(()=>(D?.on("mergedFilterChanged",A),()=>{D?.off("mergedFilterChanged",A)}),[D,l,i,O]),c.useEffect(()=>{O&&E&&L(C)},[O,E]),c.useEffect(()=>{R(!0)},[o.params]),c.createElement(Yr,{ref:I,elevation:0,style:{borderRadius:12,padding:20,border:"1px solid #e5e5e5",background:"#fff",display:"flex",flexDirection:"column",gap:"12px",height:"100%"}},i&&c.createElement("div",{style:{display:"flex",alignItems:"center",lineHeight:0}},c.createElement(si,{variant:"subtitle2",style:{fontWeight:600,color:"#252525"}},o?.title||i.doc.name," ")),x?c.createElement(Wa,{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"100%"}}):c.createElement(c.Fragment,null,c.createElement("div",{style:{display:"flex"}},c.createElement("div",{style:{flexGrow:1}}),c.createElement("div",null,i?.doc?.view?.length>1&&c.createElement(Vi,null,c.createElement(Ha,{labelId:"date-range-select-label",id:"date-range-select",value:y,onChange:F,style:{fontSize:"12px"},disableUnderline:!0},i.doc.view.map((e,t)=>c.createElement(Ea,{key:t,value:t},e.title)))))),c.createElement("div",{style:{position:"relative",flexGrow:n?void 0:1,display:"flex",flexDirection:"column"}},c.createElement(pR,{filters:i?.doc?.filters,channel:D,query:M}),m)))};const wR=s.createContext(void 0),xR=({defaultParameters:e={},defaultApi:t={},children:n})=>{const[r,o]=s.useState(e),[i,a]=s.useState(t),l={parameters:r,setParameters:o,api:i,setApi:a,setReportingContext:({parameters:e,api:t})=>{void 0!==e&&o(e),void 0!==t&&a(t)}};return c.createElement(wR.Provider,{value:l},n)},SR=()=>s.useContext(wR);const CR=s.createContext(),kR=({children:e})=>{const[t,n]=s.useState({open:!1,message:"",severity:"info",duration:6e3}),r=(e,t="info",r=6e3)=>{n({open:!0,message:e,severity:t,duration:r})},o=(e,t)=>{"clickaway"!==t&&n(e=>({...e,open:!1}))},i={success:(e,t)=>r(e,"success",t),error:(e,t)=>r(e,"error",t),warning:(e,t)=>r(e,"warning",t),info:(e,t)=>r(e,"info",t)};return c.createElement(CR.Provider,{value:i},e,c.createElement(Dk,{open:t.open,autoHideDuration:t.duration,onClose:o,anchorOrigin:{vertical:"top",horizontal:"right"}},c.createElement(jv,{onClose:o,severity:t.severity,variant:"filled",sx:{width:"100%"}},t.message)))},ER=()=>{const e=s.useContext(CR);if(!e)throw new Error("useNotify must be used within a NotifyProvider");return e};function RR(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=RR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function PR(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=RR(e))&&(r&&(r+=" "),r+=t);return r}var MR=parseInt(s.version,10);const TR=e=>{if(MR>=19){const t=t=>e(t,t.ref??null);return t.displayName=e.displayName??e.name,t}return s.forwardRef(e)},IR=Sg,OR=IR(Xp.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"})),DR=IR(Xp.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"})),FR=IR(Xp.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),LR=IR(Xp.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),AR=IR(Xp.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})),NR=IR(Xp.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"})),$R=IR(Xp.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));IR(Xp.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"})),IR(Xp.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}));const zR=IR(Xp.jsx("path",{d:"M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z"})),jR=IR(Xp.jsx("rect",{width:"1",height:"24",x:"11.5",rx:"0.5"})),BR=IR(Xp.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"})),_R=IR(Xp.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"})),HR=IR(Xp.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"})),VR=IR(Xp.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),WR=IR(Xp.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),UR=IR(Xp.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),GR=IR(Xp.jsx("path",{d:"M19 13H5v-2h14v2z"})),KR=IR(Xp.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"})),qR=IR(Xp.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),YR=IR(Xp.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),XR=IR(Xp.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),QR=IR(Xp.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"})),ZR=IR(Xp.jsx("g",{children:Xp.jsx("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})})),JR=IR(Xp.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}));IR(Xp.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}));const eP=IR(Xp.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"})),tP=IR(Xp.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"})),nP=s.createContext(void 0),rP=()=>{const e=s.useContext(nP);if(!e)throw new Error("MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e},oP=["sortingOrder"],iP=s.memo(function(e){const{sortingOrder:t}=e,n=d(e,oP),r=rP(),[o]=t,i="asc"===o?r.slots.columnSortedAscendingIcon:r.slots.columnSortedDescendingIcon;return i?Xp.jsx(i,f({},n)):null}),aP=s.createContext(void 0);function lP(){const e=s.useContext(aP);if(void 0===e)throw new Error(["MUI X: Could not find the Data Grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join("\n"));return e}const sP=new TextEncoder;let cP=2048,uP=new ArrayBuffer(cP),dP=new Uint8Array(uP),pP=new Int32Array(uP);const fP=function(e){const t=2*e.length;t>cP&&(cP=t+(4-t%4),uP=new ArrayBuffer(cP),dP=new Uint8Array(uP),pP=new Int32Array(uP));const n=sP.encodeInto(e,dP).written,r=0|n;let o=0,i=374761393+(0+r|0)|0;if(r<16)for(;(o+3|0)<r;o=o+4|0)i=Math.imul(0|hP(i+Math.imul(0|pP[o],3266489917)|0,17),668265263);else{let e=606290984,t=-2048144777,n=0,a=1640531535;for(;(o+15|0)<r;o=o+16|0)e=Math.imul(0|hP(e+Math.imul(0|pP[o+0|0],2246822519)|0,13),2654435761),t=Math.imul(0|hP(t+Math.imul(0|pP[o+4|0],2246822519)|0,13),2654435761),n=Math.imul(0|hP(n+Math.imul(0|pP[o+8|0],2246822519)|0,13),2654435761),a=Math.imul(0|hP(a+Math.imul(0|pP[o+12|0],2246822519)|0,13),2654435761);for(i=(((hP(e,1)|0+hP(t,7)|0)+hP(n,12)|0)+hP(a,18)|0)+r|0;(o+3|0)<r;o=o+4|0)i=Math.imul(0|hP(i+Math.imul(0|pP[o],3266489917)|0,17),668265263)}for(;o<r;o=o+1|0)i=Math.imul(0|hP(i+Math.imul(0|dP[o],374761393)|0,11),2654435761);return i=Math.imul(i^i>>>15,2246822519),i=Math.imul(i^i>>>13,3266489917),((i^i>>>16)>>>0).toString()};function hP(e,t){return e<<t|e>>>32-t}const mP={values:{xs:0,sm:600,md:900,lg:1200,xl:1536},up:e=>{const t=mP.values;return`@media (min-width:${"number"==typeof t[e]?t[e]:e}px)`}},gP={spacingUnit:"--DataGrid-t-spacing-unit",colors:{border:{base:"--DataGrid-t-color-border-base"},foreground:{base:"--DataGrid-t-color-foreground-base",muted:"--DataGrid-t-color-foreground-muted",accent:"--DataGrid-t-color-foreground-accent",disabled:"--DataGrid-t-color-foreground-disabled",error:"--DataGrid-t-color-foreground-error"},background:{base:"--DataGrid-t-color-background-base",overlay:"--DataGrid-t-color-background-overlay",backdrop:"--DataGrid-t-color-background-backdrop"},interactive:{hover:"--DataGrid-t-color-interactive-hover",hoverOpacity:"--DataGrid-t-color-interactive-hover-opacity",focus:"--DataGrid-t-color-interactive-focus",focusOpacity:"--DataGrid-t-color-interactive-focus-opacity",disabled:"--DataGrid-t-color-interactive-disabled",disabledOpacity:"--DataGrid-t-color-interactive-disabled-opacity",selected:"--DataGrid-t-color-interactive-selected",selectedOpacity:"--DataGrid-t-color-interactive-selected-opacity"}},header:{background:{base:"--DataGrid-t-header-background-base"}},cell:{background:{pinned:"--DataGrid-t-cell-background-pinned"}},radius:{base:"--DataGrid-t-radius-base"},typography:{font:{body:"--DataGrid-t-typography-font-body",small:"--DataGrid-t-typography-font-small",large:"--DataGrid-t-typography-font-large"},fontFamily:{base:"--DataGrid-t-typography-font-family-base"},fontWeight:{light:"--DataGrid-t-typography-font-weight-light",regular:"--DataGrid-t-typography-font-weight-regular",medium:"--DataGrid-t-typography-font-weight-medium",bold:"--DataGrid-t-typography-font-weight-bold"}},transitions:{easing:{easeIn:"--DataGrid-t-transition-easing-ease-in",easeOut:"--DataGrid-t-transition-easing-ease-out",easeInOut:"--DataGrid-t-transition-easing-ease-in-out"},duration:{short:"--DataGrid-t-transition-duration-short",base:"--DataGrid-t-transition-duration-base",long:"--DataGrid-t-transition-duration-long"}},shadows:{base:"--DataGrid-t-shadow-base",overlay:"--DataGrid-t-shadow-overlay"},zIndex:{panel:"--DataGrid-t-z-index-panel",menu:"--DataGrid-t-z-index-menu"}},vP=function e(t){if("string"==typeof t)return`var(${t})`;const n={};for(const r in t)Object.hasOwn(t,r)&&(n[r]=e(t[r]));return n}(gP),bP=f({breakpoints:mP,spacing:function(e,t,n,r){if(void 0===e)return yP(1);if(void 0===t)return yP(e);if(void 0===n)return yP(e)+" "+yP(t);if(void 0===r)return yP(e)+" "+yP(t)+" "+yP(n);return yP(e)+" "+yP(t)+" "+yP(n)+" "+yP(r)},transition:function(e,t){const{duration:n=bP.transitions.duration.base,easing:r=bP.transitions.easing.easeInOut,delay:o=0}=t??{};return e.map(e=>`${e} ${n} ${r} ${o}ms`).join(", ")},keys:gP},vP);function yP(e){return 0===e?"0":`calc(var(--DataGrid-t-spacing-unit) * ${e})`}function wP(e){return function(e,t){return`rgba(from ${e} r g b / ${t})`}(e,1)}function xP(e){if(!e)return;const t="number"==typeof e.fontSize?`${e.fontSize}px`:e.fontSize;return`${e.fontWeight} ${t} / ${e.lineHeight} ${e.fontFamily}`}const SP=["id","label","labelId","material","disabled","slotProps","onChange","onKeyDown","onOpen","onClose","size","style","fullWidth"],CP=["onRowsPerPageChange","material","disabled"],kP=["material"],EP=["autoFocus","label","fullWidth","slotProps","className","material"],RP=["material"],PP=["material"],MP=["material"],TP=["material"],IP=["material"],OP=["material"],DP=["material"],FP=["material"],LP=["material"],AP=["material","label","className"],NP=["material"],$P=["inert","iconStart","iconEnd","children","material"],zP=["slotProps","material"],jP=["id","multiple","freeSolo","options","getOptionLabel","isOptionEqualToValue","value","onChange","label","placeholder","slotProps","material"],BP=["key"],_P=["inputProps","InputProps","InputLabelProps"],HP=["slotProps","material"],VP=["ref","open","children","className","clickAwayTouchEvent","clickAwayMouseEvent","flip","focusTrap","onExited","onClickAway","onDidShow","onDidHide","id","target","transition","placement","material"],WP=["native"],UP=["children","value","active"],GP=["items","value","material"],KP=pg(AS)(({theme:e})=>({[`&.${DS.positionEnd} .${Ev.sizeSmall}`]:{marginRight:e.spacing(-.75)}})),qP=pg(fS,{shouldForwardProp:e=>"fullWidth"!==e})(({theme:e})=>({gap:e.spacing(.5),margin:0,overflow:"hidden",[`& .${uS.label}`]:{fontSize:e.typography.pxToRem(14),overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),YP=pg(ux,{shouldForwardProp:e=>"density"!==e})(({theme:e})=>({variants:[{props:{density:"compact"},style:{padding:e.spacing(.5)}}]})),XP=pg(vC)({[`& .${mC.primary}`]:{overflowX:"clip",textOverflow:"ellipsis",maxWidth:"300px"}}),QP=TR(function(e,t){const{id:n,label:r,labelId:o,material:i,disabled:a,slotProps:l,onChange:s,onKeyDown:c,onOpen:u,onClose:p,size:h,style:m,fullWidth:g}=e,v=d(e,SP),b={PaperProps:{onKeyDown:c}};return p&&(b.onClose=p),Xp.jsxs(sS,{size:h,fullWidth:g,style:m,disabled:a,ref:t,children:[Xp.jsx(zS,{id:o,htmlFor:n,shrink:!0,variant:"outlined",children:r}),Xp.jsx(vk,f({id:n,labelId:o,label:r,displayEmpty:!0,onChange:s,variant:"outlined"},v,{notched:!0,inputProps:l?.htmlInput,onOpen:u,MenuProps:b,size:h},i))]})}),ZP=pg(RE)(({theme:e})=>({[`& .${mE.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${mE.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),JP=TR(function(e,t){const{onRowsPerPageChange:n,material:r,disabled:o}=e,i=d(e,CP),a=s.useMemo(()=>{if(o)return{backIconButtonProps:{disabled:!0},nextIconButtonProps:{disabled:!0}}},[o]),l=lP(),c=rP(),{estimatedRowCount:u}=c;return Xp.jsx(ZP,f({component:"div",onRowsPerPageChange:Mg(e=>{n?.(Number(e.target.value))}),labelRowsPerPage:l.current.getLocaleText("paginationRowsPerPage"),labelDisplayedRows:e=>l.current.getLocaleText("paginationDisplayedRows")(f({},e,{estimated:u})),getItemAriaLabel:l.current.getLocaleText("paginationItemAriaLabel")},a,i,r,{ref:t}))}),eM=TR(function(e,t){const{material:n}=e,r=d(e,kP);return Xp.jsx(Nw,f({},r,n,{ref:t}))}),tM=TR(function(e,t){const{autoFocus:n,label:r,fullWidth:o,slotProps:i,className:a,material:l}=e,c=d(e,EP),u=s.useRef(null),p=Tg(u,t),h=s.useRef(null);return s.useEffect(()=>{if(n){const e=u.current?.querySelector("input");e?.focus({preventScroll:!0})}else!1===n&&h.current&&h.current.stop({})},[n]),r?Xp.jsx(qP,{className:a,control:Xp.jsx(YP,f({},c,l,{inputProps:i?.htmlInput,ref:p,touchRippleRef:h})),label:r,fullWidth:o}):Xp.jsx(YP,f({},c,l,{className:PR(a,l?.className),inputProps:i?.htmlInput,ref:p,touchRippleRef:h}))}),nM=TR(function(e,t){const{material:n}=e,r=d(e,RP);return Xp.jsx(Cv,f({},r,n,{ref:t}))}),rM=TR(function(e,t){const{material:n}=e,r=d(e,PP);return Xp.jsx(nS,f({},r,n,{ref:t}))}),oM=TR(function(e,t){const{material:n}=e,r=d(e,MP);return Xp.jsx(QS,f({},r,n,{ref:t}))}),iM=TR(function(e,t){const{material:n}=e,r=d(e,TP);return Xp.jsx(Xw,f({},r,n,{ref:t}))}),aM=pg(tR)(({theme:e})=>({gap:e.spacing(1),border:0})),lM=TR(function(e,t){const{material:n}=e,r=d(e,IP);return Xp.jsx(aM,f({size:"small",color:"primary"},r,n,{ref:t}))}),sM=TR(function(e,t){const{material:n}=e,r=d(e,OP);return Xp.jsx(zy,f({},r,n,{ref:t}))}),cM=TR(function(e,t){const{material:n}=e,r=d(e,DP);return Xp.jsx(Mv,f({},r,n,{ref:t}))}),uM=TR(function(e,t){const{material:n}=e,r=d(e,FP);return Xp.jsx(Hk,f({},r,n,{ref:t}))}),dM=TR(function(e,t){const{material:n}=e,r=d(e,LP);return Xp.jsx(kk,f({},r,n,{ref:t}))}),pM=TR(function(e,t){const{material:n,label:r,className:o}=e,i=d(e,AP);return r?Xp.jsx(qP,{className:o,control:Xp.jsx(Yk,f({},i,n,{ref:t})),label:r}):Xp.jsx(Yk,f({},i,n,{className:o,ref:t}))}),fM=TR(function(e,t){const{material:n}=e,r=d(e,NP);return Xp.jsx(SC,f({},r,n,{ref:t}))});function hM(e,t=!0){if(!e)return;const{slotProps:n,material:r}=e,o=d(e,HP);t&&(o.startAdornment&&(o.startAdornment=Xp.jsx(KP,{position:"start",children:o.startAdornment})),o.endAdornment&&(o.endAdornment=Xp.jsx(KP,{position:"end",children:o.endAdornment})));for(const e in r)Object.hasOwn(r,e)&&(o[e]=r[e]);return n?.htmlInput&&(o.inputProps?o.inputProps=f({},o.inputProps,n?.htmlInput):o.inputProps=n?.htmlInput),o}const mM={"bottom-start":"top left","bottom-end":"top right"};function gM(e,t){return function(e,t){if(void 0===e.focusTrap)return t;return Xp.jsx(Cx,{open:!0,disableEnforceFocus:!0,disableAutoFocus:!0,children:Xp.jsx("div",{tabIndex:-1,children:t})})}(e,function(e,t){if(void 0===e.onClickAway)return t;return Xp.jsx(px,{onClickAway:e.onClickAway,touchEvent:e.clickAwayTouchEvent,mouseEvent:e.clickAwayMouseEvent,children:t})}(e,t))}const vM=pg(WE,{name:"MuiDataGrid",slot:"Tabs"})(({theme:e})=>({borderBottom:`1px solid ${e.palette.divider}`})),bM=pg(Jk,{name:"MuiDataGrid",slot:"Tab"})({flex:1,minWidth:"fit-content"}),yM=pg("div",{name:"MuiDataGrid",slot:"TabPanel"})({flex:1,display:"flex",flexDirection:"column",overflow:"hidden"});function wM(e){const{children:t,active:n}=e,r=d(e,UP);return Xp.jsx(yM,f({role:"tabpanel",style:{display:n?"flex":"none"}},r,{children:t}))}const xM={baseAutocomplete:function(e){const t=rP(),{id:n,multiple:r,freeSolo:o,options:i,getOptionLabel:a,isOptionEqualToValue:l,value:s,onChange:c,label:u,placeholder:p,slotProps:h,material:m}=e,g=d(e,jP);return Xp.jsx(Ew,f({id:n,multiple:r,freeSolo:o,options:i,getOptionLabel:a,isOptionEqualToValue:l,value:s,onChange:c,renderTags:(e,t)=>e.map((e,n)=>{const r=t({index:n}),{key:o}=r,i=d(r,BP);return Xp.jsx(zy,f({variant:"outlined",size:"small",label:"string"==typeof e?e:a?.(e)},i),o)}),renderInput:e=>{const{inputProps:n,InputProps:r,InputLabelProps:o}=e,i=d(e,_P);return Xp.jsx(qE,f({},i,{label:u,placeholder:p,inputProps:n,InputProps:hM(r,!1),InputLabelProps:f({shrink:!0},o)},h?.textField,t.slotProps?.baseTextField))}},g,m))},baseBadge:eM,baseCheckbox:tM,baseChip:sM,baseCircularProgress:nM,baseDivider:rM,baseInput:function(e){return Xp.jsx(nw,f({},hM(e)))},baseLinearProgress:oM,baseMenuList:fM,baseMenuItem:function(e){const{inert:t,iconStart:n,iconEnd:r,children:o,material:i}=e,a=d(e,$P);return t&&(a.disableRipple=!0),s.createElement(_C,f({},a,i),[n&&Xp.jsx(fC,{children:n},"1"),Xp.jsx(XP,{children:o},"2"),r&&Xp.jsx(fC,{children:r},"3")])},baseTextField:function(e){const{slotProps:t,material:n}=e,r=d(e,zP);return Xp.jsx(qE,f({variant:"outlined"},r,n,{inputProps:t?.htmlInput,InputProps:hM(t?.input),InputLabelProps:f({shrink:!0},t?.inputLabel)}))},baseButton:iM,baseIconButton:cM,baseToggleButton:lM,baseTooltip:uM,baseTabs:function(e){let{items:t,value:n,material:r}=e,o=d(e,GP);const i=mm(),a=`${i}-tab-${n}`,l=`${i}-tabpanel-${n}`;return Xp.jsxs(s.Fragment,{children:[Xp.jsx(vM,f({},o,{value:n,variant:"scrollable",scrollButtons:"auto"},r,{children:t.map(e=>Xp.jsx(bM,{value:e.value,label:e.label,id:a,"aria-controls":l},e.value))})),t.map(e=>Xp.jsx(wM,{value:e.value,active:n===e.value,id:l,"aria-labelledby":a,children:e.children},e.value))]})},basePagination:JP,basePopper:function(e){const{open:t,children:n,className:r,flip:o,onExited:i,onDidShow:a,onDidHide:l,id:c,target:u,transition:p,placement:h,material:m}=e,g=d(e,VP),v=s.useMemo(()=>{const e=[{name:"preventOverflow",options:{padding:8}}];return o&&e.push({name:"flip",enabled:!0}),(a||l)&&e.push({name:"isPlaced",enabled:!0,phase:"main",fn:()=>{a?.()},effect:()=>()=>{l?.()}}),e},[o,a,l]);let b;if(p){const t=e=>t=>{e&&e(),i&&i(t)};b=r=>gM(e,Xp.jsx(PS,f({},r.TransitionProps,{style:{transformOrigin:mM[r.placement]},onExited:t(r.TransitionProps?.onExited),children:Xp.jsx(qg,{children:n})})))}else b=gM(e,n);return Xp.jsx(My,f({id:c,className:r,open:t,anchorEl:u,transition:p,placement:h,modifiers:v},g,m,{children:b}))},baseSelect:QP,baseSelectOption:function(e){let{native:t}=e,n=d(e,WP);return t?Xp.jsx("option",f({},n)):Xp.jsx(_C,f({},n))},baseSkeleton:dM,baseSwitch:pM},SM=f({},xM,{booleanCellTrueIcon:YR,booleanCellFalseIcon:WR,columnMenuIcon:VR,openFilterButtonIcon:AR,filterPanelDeleteIcon:WR,columnFilteredIcon:NR,columnSelectorIcon:zR,columnUnsortedIcon:iP,columnSortedAscendingIcon:OR,columnSortedDescendingIcon:DR,columnResizeIcon:jR,densityCompactIcon:BR,densityStandardIcon:_R,densityComfortableIcon:HR,exportIcon:tP,moreActionsIcon:XR,treeDataCollapseIcon:LR,treeDataExpandIcon:FR,groupingCriteriaCollapseIcon:LR,groupingCriteriaExpandIcon:FR,detailPanelExpandIcon:UR,detailPanelCollapseIcon:GR,rowReorderIcon:qR,quickFilterIcon:$R,quickFilterClearIcon:JR,columnMenuHideIcon:QR,columnMenuSortAscendingIcon:OR,columnMenuSortDescendingIcon:DR,columnMenuUnsortIcon:null,columnMenuFilterIcon:NR,columnMenuManageColumnsIcon:ZR,columnMenuClearIcon:JR,loadIcon:KR,filterPanelAddIcon:UR,filterPanelRemoveAllIcon:eP,columnReorderIcon:qR,menuItemCheckIcon:YR});var CM=Symbol("NOT_FOUND");var kM=e=>Array.isArray(e)?e:[e];function EM(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){const n=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}var RM=(e,t)=>e===t;function PM(e,t){const n="object"==typeof t?t:{equalityCheck:t},{equalityCheck:r=RM,maxSize:o=1,resultEqualityCheck:i}=n,a=function(e){return function(t,n){if(null===t||null===n||t.length!==n.length)return!1;const{length:r}=t;for(let o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}}(r);let l=0;const s=o<=1?function(e){let t;return{get:n=>t&&e(t.key,n)?t.value:CM,put(e,n){t={key:e,value:n}},getEntries:()=>t?[t]:[],clear(){t=void 0}}}(a):function(e,t){let n=[];function r(e){const r=n.findIndex(n=>t(e,n.key));if(r>-1){const e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return CM}return{get:r,put:function(t,o){r(t)===CM&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(o,a);function c(){let t=s.get(arguments);if(t===CM){if(t=e.apply(null,arguments),l++,i){const e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,0!==l&&l--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>l,c.resetResultsCount=()=>{l=0},c}var MM="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function TM(){return{s:0,v:void 0,o:null,p:null}}function IM(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,i=0;function a(){let t=n;const{length:a}=arguments;for(let e=0,n=a;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=TM(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=TM(),e.set(n,t)):t=r}}const l=t;let s;if(1===t.s)s=t.v;else if(s=e.apply(null,arguments),i++,r){const e=o?.deref?.()??o;null!=e&&r(e,s)&&(s=e,0!==i&&i--);o="object"==typeof s&&null!==s||"function"==typeof s?new MM(s):s}return l.s=1,l.v=s,s}return a.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function OM(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,i={},a=e.pop();"object"==typeof a&&(i=a,a=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const l={...n,...i},{memoize:s,memoizeOptions:c=[],argsMemoize:u=IM,argsMemoizeOptions:d=[]}=l,p=kM(c),f=kM(d),h=EM(e),m=s(function(){return r++,a.apply(null,arguments)},...p),g=u(function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}(h,arguments);return t=m.apply(null,e),t},...f);return Object.assign(g,{resultFunc:a,memoizedResultFunc:m,dependencies:h,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:s,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var DM=OM(IM),FM=Object.assign((e,t=DM)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e),r=n.map(t=>e[t]),o=t(r,(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}));return o},{withTypes:()=>FM});const LM=OM({memoize:PM,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),AM=(e,t,n,r,o,i,a,l,...s)=>{if(s.length>0)throw new Error("Unsupported number of selectors");let c;if(e&&t&&n&&r&&o&&i&&a&&l)c=(s,c,u,d)=>{const p=e(s,c,u,d),f=t(s,c,u,d),h=n(s,c,u,d),m=r(s,c,u,d),g=o(s,c,u,d),v=i(s,c,u,d),b=a(s,c,u,d);return l(p,f,h,m,g,v,b,c,u,d)};else if(e&&t&&n&&r&&o&&i&&a)c=(l,s,c,u)=>{const d=e(l,s,c,u),p=t(l,s,c,u),f=n(l,s,c,u),h=r(l,s,c,u),m=o(l,s,c,u),g=i(l,s,c,u);return a(d,p,f,h,m,g,s,c,u)};else if(e&&t&&n&&r&&o&&i)c=(a,l,s,c)=>{const u=e(a,l,s,c),d=t(a,l,s,c),p=n(a,l,s,c),f=r(a,l,s,c),h=o(a,l,s,c);return i(u,d,p,f,h,l,s,c)};else if(e&&t&&n&&r&&o)c=(i,a,l,s)=>{const c=e(i,a,l,s),u=t(i,a,l,s),d=n(i,a,l,s),p=r(i,a,l,s);return o(c,u,d,p,a,l,s)};else if(e&&t&&n&&r)c=(o,i,a,l)=>{const s=e(o,i,a,l),c=t(o,i,a,l),u=n(o,i,a,l);return r(s,c,u,i,a,l)};else if(e&&t&&n)c=(r,o,i,a)=>{const l=e(r,o,i,a),s=t(r,o,i,a);return n(l,s,o,i,a)};else if(e&&t)c=(n,r,o,i)=>{const a=e(n,r,o,i);return t(a,r,o,i)};else{if(!e)throw new Error("Missing arguments");c=e}return c},NM=(...e)=>{const t=new WeakMap;let n=1;const r=e[e.length-1],o=e.length-1||1,i=Math.max(r.length-o,0);if(i>3)throw new Error("Unsupported number of arguments");return(o,a,l,s)=>{let c=o.__cacheKey__;c||(c={id:n},o.__cacheKey__=c,n+=1);let u=t.get(c);if(!u){const n=1===e.length?[e=>e,r]:e;let o=e;const a=[void 0,void 0,void 0];switch(i){case 0:break;case 1:o=[...n.slice(0,-1),()=>a[0],r];break;case 2:o=[...n.slice(0,-1),()=>a[0],()=>a[1],r];break;case 3:o=[...n.slice(0,-1),()=>a[0],()=>a[1],()=>a[2],r];break;default:throw new Error("Unsupported number of arguments")}u=LM(...o),u.selectorArgs=a,t.set(c,u)}switch(i){case 3:u.selectorArgs[2]=s;case 2:u.selectorArgs[1]=l;case 1:u.selectorArgs[0]=a}switch(i){case 0:return u(o);case 1:return u(o,a);case 2:return u(o,a,l);case 3:return u(o,a,l,s);default:throw new Error("unreachable")}}};var $M,zM,jM={exports:{}},BM={};function _M(){return zM||(zM=1,jM.exports=function(){if($M)return BM;$M=1;var e=l(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function a(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var l=t(),s=n({inst:{value:l,getSnapshot:t}}),c=s[0].inst,u=s[1];return o(function(){c.value=l,c.getSnapshot=t,a(c)&&u({inst:c})},[e,l,t]),r(function(){return a(c)&&u({inst:c}),e(function(){a(c)&&u({inst:c})})},[e]),i(l),l};return BM.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,BM}()),jM.exports}var HM,VM,WM=_M(),UM={exports:{}},GM={};var KM=(VM||(VM=1,UM.exports=function(){if(HM)return GM;HM=1;var e=l(),t=_M(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,s=e.useDebugValue;return GM.useSyncExternalStoreWithSelector=function(e,t,l,c,u){var d=o(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=a(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var a=c(e);return void 0!==u&&u(t,a)?(r=e,t):(r=e,o=a)}var r,o,i=!1,a=void 0===l?null:l;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]},[t,l,c,u]);var f=r(e,d[0],d[1]);return i(function(){p.hasValue=!0,p.value=f},[f]),s(f),f},GM}()),UM.exports);const qM=MR>=19?function(e,t,n,r,o){const i=s.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return WM.useSyncExternalStore(e.subscribe,i,i)}:function(e,t,n,r,o){return KM.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,o))};function YM(e,t,n,r,o){return qM(e,t,n,r,o)}const XM=()=>{};function QM(e,t,n){const r=Dg(ZM,{store:e,selector:t}).current;r.effect=n,Lg(r.onMount)}function ZM(e){const{store:t,selector:n}=e;let r=n(t.state);const o={effect:XM,dispose:null,subscribe:()=>{o.dispose??=t.subscribe(e=>{const t=n(e);if(!Object.is(r,t)){const e=r;r=t,o.effect(e,t)}})},onMount:()=>(o.subscribe(),()=>{o.dispose?.(),o.dispose=null})};return o.subscribe(),o}class JM{static create(e){return new JM(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){this.state=e,this.updateTick+=1;const t=this.updateTick,n=this.listeners.values();let r;for(;r=n.next(),!r.done;){if(t!==this.updateTick)return;(0,r.value)(e)}}update(e){for(const t in e)if(!Object.is(this.state[t],e[t]))return void this.setState(f({},this.state,e))}set(e,t){Object.is(this.state[e],t)||this.setState(f({},this.state,{[e]:t}))}use=(()=>(e,t,n,r)=>YM(this,e,t,n,r))()}const eT=(...e)=>{const t=AM(...e);return(e,n,r,o)=>t(rT(e),n,r,o)},tT=(...e)=>{const t=NM(...e);return(e,n,r,o)=>t(rT(e),n,r,o)},nT=e=>(t,n)=>e(rT(t),n);function rT(e){return"current"in e?e.current.state:e}const oT=nT(e=>e.dimensions),iT=eT(oT,e=>e.columnsTotalWidth),aT=eT(oT,e=>e.rowHeight);eT(oT,e=>e.contentSize.height);const lT=eT(oT,e=>e.hasScrollX),sT=eT(oT,e=>e.hasScrollY),cT=eT(oT,e=>e.columnsTotalWidth<e.viewportOuterSize.width),uT=eT(oT,e=>e.headerHeight),dT=eT(oT,e=>e.groupHeaderHeight);eT(oT,e=>e.headerFilterHeight);const pT=eT(oT,e=>e.hasScrollX?e.scrollbarSize:0),fT=eT(oT,e=>e.hasScrollY?e.scrollbarSize:0),hT=eT(oT,pT,(e,t)=>{const n=e.viewportOuterSize.height-e.minimumSize.height>0;return!(0===t&&!n)}),mT=nT(e=>e.rowsMeta),gT=nT(e=>e.rows),vT=eT(gT,e=>e.totalRowCount),bT=eT(gT,e=>e.loading),yT=eT(gT,e=>e.totalTopLevelRowCount),wT=eT(gT,e=>e.dataRowIdToModelLookup);eT(wT,(e,t)=>e[t]);const xT=eT(gT,e=>e.tree),ST=eT(xT,(e,t)=>e[t]),CT=eT(gT,e=>e.groupsToFetch),kT=eT(gT,e=>e.groupingName),ET=eT(gT,e=>e.treeDepths),RT=tT(gT,e=>{const t=Object.entries(e.treeDepths);return 0===t.length?1:(t.filter(([,e])=>e>0).map(([e])=>Number(e)).sort((e,t)=>t-e)[0]??0)+1}),PT=eT(gT,e=>e.dataRowIds),MT=tT(PT,wT,(e,t)=>e.reduce((e,n)=>t[n]?(e.push(t[n]),e):e,[])),TT=tT(eT(gT,e=>e?.additionalRowGroups),e=>{const t=e?.pinnedRows;return{bottom:t?.bottom?.map(e=>({id:e.id,model:e.model??{}}))??[],top:t?.top?.map(e=>({id:e.id,model:e.model??{}}))??[]}}),IT=eT(TT,e=>(e?.top?.length||0)+(e?.bottom?.length||0)),OT="auto-generated-group-node-root",DT=Symbol("mui.id_autogenerated");const FT=(e,t,n)=>{const r=t?t(e):e.id;return function(e,t,n="A row was provided without id in the rows prop:"){if(null==e)throw new Error(["MUI X: The Data Grid component requires all rows to have a unique `id` property.","Alternatively, you can use the `getRowId` prop to specify a custom id for each row.",n,JSON.stringify(t)].join("\n"))}(r,e,n),r},LT=(e,t,n)=>{const r=t.field;if(!t||!t.valueGetter)return e[r];const o=e[t.field];return t.valueGetter(o,e,t,n)},AT=({rows:e,getRowId:t,loading:n,rowCount:r})=>{const o={type:"full",rows:[]},i={};for(let n=0;n<e.length;n+=1){const r=e[n],a=FT(r,t);i[a]=r,o.rows.push(a)}return{rowsBeforePartialUpdates:e,loadingPropBeforePartialUpdates:n,rowCountPropBeforePartialUpdates:r,updates:o,dataRowIdToModelLookup:i}},NT=({tree:e,rowCountProp:t=0})=>{const n=e[OT];return Math.max(t,n.children.length+(null==n.footerId?0:1))},$T=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:r,previousTreeDepths:o,previousGroupsToFetch:i})=>{const a=e.current.caches.rows,{tree:l,treeDepths:s,dataRowIds:c,groupingName:u,groupsToFetch:d=[]}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:r,previousTreeDepths:o,updates:a.updates,dataRowIdToModelLookup:a.dataRowIdToModelLookup,previousGroupsToFetch:i}),p=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:l,treeDepths:s,dataRowIds:c,dataRowIdToModelLookup:a.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},f({},p,{totalRowCount:Math.max(t,p.dataRowIds.length),totalTopLevelRowCount:NT({tree:p.tree,rowCountProp:t}),groupingName:u,loading:n,groupsToFetch:d})},zT=e=>DT in e,jT=e=>"skeletonRow"===e.type||"footer"===e.type||"group"===e.type&&e.isAutoGenerated||"pinnedRow"===e.type&&e.isAutoGenerated,BT=(e,t,n,r)=>{const o=e[t];if("group"!==o.type)return[];const i=[];for(let t=0;t<o.children.length;t+=1){const a=o.children[t];if(n&&jT(e[a])||i.push(a),r)continue;const l=BT(e,a,n,r);for(let e=0;e<l.length;e+=1)i.push(l[e])}return n||null==o.footerId||i.push(o.footerId),i},_T=({previousCache:e,getRowId:t,updates:n,groupKeys:r})=>{if("full"===e.updates.type)throw new Error("MUI X: Unable to prepare a partial update if a full update is not applied yet.");const o=new Map;n.forEach(e=>{const n=FT(e,t,"A row was provided without id when calling updateRows():");o.has(n)?o.set(n,f({},o.get(n),e)):o.set(n,e)});const i={type:"partial",actions:{insert:[...e.updates.actions.insert??[]],modify:[...e.updates.actions.modify??[]],remove:[...e.updates.actions.remove??[]]},idToActionLookup:f({},e.updates.idToActionLookup),groupKeys:r},a=f({},e.dataRowIdToModelLookup),l={insert:{},modify:{},remove:{}};o.forEach((e,t)=>{const n=i.idToActionLookup[t];if("delete"===e._action){if("remove"===n||!a[t])return;return null!=n&&(l[n][t]=!0),i.actions.remove.push(t),void delete a[t]}const r=a[t];if(r)return"remove"===n?(l.remove[t]=!0,i.actions.modify.push(t)):null==n&&i.actions.modify.push(t),void(a[t]=f({},r,e));"remove"===n?(l.remove[t]=!0,i.actions.insert.push(t)):null==n&&i.actions.insert.push(t),a[t]=e});const s=Object.keys(l);for(let e=0;e<s.length;e+=1){const t=s[e],n=l[t];Object.keys(n).length>0&&(i.actions[t]=i.actions[t].filter(e=>!n[e]))}return{dataRowIdToModelLookup:a,updates:i,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}},HT="var(--DataGrid-overlayHeight, calc(var(--height) * 2))";function VT(e,t,n){const r=[];return t.forEach(t=>{const o=FT(t,n,"A row was provided without id when calling updateRows():"),i=ST(e,o);if("pinnedRow"===i?.type){const n=e.current.caches.pinnedRows,r=n.idLookup[o];r&&(n.idLookup[o]=f({},r,t))}else r.push(t)}),r}const WT=(e,t,n)=>"number"==typeof e&&e>0?e:t,UT=Object.is;function GT(e,t){if(e===t)return!0;if(!(e instanceof Object&&t instanceof Object))return!1;let n=0,r=0;for(const r in e){if(n+=1,!UT(e[r],t[r]))return!1;if(!(r in t))return!1}for(const e in t)r+=1;return n===r}function KT(e){return s.memo(e,GT)}const qT={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",noColumnsOverlayLabel:"No columns",noColumnsOverlayManageColumns:"Manage columns",emptyPivotOverlayLabel:"Add fields to rows, columns, and values to create a pivot table",toolbarDensity:"Density",toolbarDensityLabel:"Density",toolbarDensityCompact:"Compact",toolbarDensityStandard:"Standard",toolbarDensityComfortable:"Comfortable",toolbarColumns:"Columns",toolbarColumnsLabel:"Select columns",toolbarFilters:"Filters",toolbarFiltersLabel:"Show filters",toolbarFiltersTooltipHide:"Hide filters",toolbarFiltersTooltipShow:"Show filters",toolbarFiltersTooltipActive:e=>1!==e?`${e} active filters`:`${e} active filter`,toolbarQuickFilterPlaceholder:"Search…",toolbarQuickFilterLabel:"Search",toolbarQuickFilterDeleteIconLabel:"Clear",toolbarExport:"Export",toolbarExportLabel:"Export",toolbarExportCSV:"Download as CSV",toolbarExportPrint:"Print",toolbarExportExcel:"Download as Excel",toolbarPivot:"Pivot",toolbarCharts:"Charts",toolbarAssistant:"AI Assistant",columnsManagementSearchTitle:"Search",columnsManagementNoColumns:"No columns",columnsManagementShowHideAllText:"Show/Hide All",columnsManagementReset:"Reset",columnsManagementDeleteIconLabel:"Clear",filterPanelAddFilter:"Add filter",filterPanelRemoveAll:"Remove all",filterPanelDeleteIconLabel:"Delete",filterPanelLogicOperator:"Logic operator",filterPanelOperator:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorDoesNotContain:"does not contain",filterOperatorEquals:"equals",filterOperatorDoesNotEqual:"does not equal",filterOperatorStartsWith:"starts with",filterOperatorEndsWith:"ends with",filterOperatorIs:"is",filterOperatorNot:"is not",filterOperatorAfter:"is after",filterOperatorOnOrAfter:"is on or after",filterOperatorBefore:"is before",filterOperatorOnOrBefore:"is on or before",filterOperatorIsEmpty:"is empty",filterOperatorIsNotEmpty:"is not empty",filterOperatorIsAnyOf:"is any of","filterOperator=":"=","filterOperator!=":"!=","filterOperator>":">","filterOperator>=":">=","filterOperator<":"<","filterOperator<=":"<=",headerFilterOperatorContains:"Contains",headerFilterOperatorDoesNotContain:"Does not contain",headerFilterOperatorEquals:"Equals",headerFilterOperatorDoesNotEqual:"Does not equal",headerFilterOperatorStartsWith:"Starts with",headerFilterOperatorEndsWith:"Ends with",headerFilterOperatorIs:"Is",headerFilterOperatorNot:"Is not",headerFilterOperatorAfter:"Is after",headerFilterOperatorOnOrAfter:"Is on or after",headerFilterOperatorBefore:"Is before",headerFilterOperatorOnOrBefore:"Is on or before",headerFilterOperatorIsEmpty:"Is empty",headerFilterOperatorIsNotEmpty:"Is not empty",headerFilterOperatorIsAnyOf:"Is any of","headerFilterOperator=":"Equals","headerFilterOperator!=":"Not equals","headerFilterOperator>":"Greater than","headerFilterOperator>=":"Greater than or equal to","headerFilterOperator<":"Less than","headerFilterOperator<=":"Less than or equal to",headerFilterClear:"Clear filter",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuAriaLabel:e=>`${e} column menu`,columnMenuShowColumns:"Show columns",columnMenuManageColumns:"Manage columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide column",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnMenuManagePivot:"Manage pivot",columnMenuManageCharts:"Manage charts",columnHeaderFiltersTooltipActive:e=>1!==e?`${e} active filters`:`${e} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:e=>1!==e?`${e.toLocaleString()} rows selected`:`${e.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(e,t)=>`${e.toLocaleString()} of ${t.toLocaleString()}`,checkboxSelectionHeaderName:"Checkbox selection",checkboxSelectionSelectAllRows:"Select all rows",checkboxSelectionUnselectAllRows:"Unselect all rows",checkboxSelectionSelectRow:"Select row",checkboxSelectionUnselectRow:"Unselect row",booleanCellTrueLabel:"yes",booleanCellFalseLabel:"no",actionsCellMore:"more",pinToLeft:"Pin to left",pinToRight:"Pin to right",unpin:"Unpin",treeDataGroupingHeaderName:"Group",treeDataExpand:"see children",treeDataCollapse:"hide children",groupingColumnHeaderName:"Group",groupColumn:e=>`Group by ${e}`,unGroupColumn:e=>`Stop grouping by ${e}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",paginationRowsPerPage:"Rows per page:",paginationDisplayedRows:({from:e,to:t,count:n,estimated:r})=>{if(!r)return`${e}–${t} of ${-1!==n?n:`more than ${t}`}`;return`${e}–${t} of ${-1!==n?n:r&&r>t?`around ${r}`:`more than ${t}`}`},paginationItemAriaLabel:e=>"first"===e?"Go to first page":"last"===e?"Go to last page":"next"===e?"Go to next page":"Go to previous page",rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelNone:"none",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size",pivotToggleLabel:"Pivot",pivotRows:"Rows",pivotColumns:"Columns",pivotValues:"Values",pivotCloseButton:"Close pivot settings",pivotSearchButton:"Search fields",pivotSearchControlPlaceholder:"Search fields",pivotSearchControlLabel:"Search fields",pivotSearchControlClear:"Clear search",pivotNoFields:"No fields",pivotMenuMoveUp:"Move up",pivotMenuMoveDown:"Move down",pivotMenuMoveToTop:"Move to top",pivotMenuMoveToBottom:"Move to bottom",pivotMenuRows:"Rows",pivotMenuColumns:"Columns",pivotMenuValues:"Values",pivotMenuOptions:"Field options",pivotMenuAddToRows:"Add to Rows",pivotMenuAddToColumns:"Add to Columns",pivotMenuAddToValues:"Add to Values",pivotMenuRemove:"Remove",pivotDragToRows:"Drag here to create rows",pivotDragToColumns:"Drag here to create columns",pivotDragToValues:"Drag here to create values",pivotYearColumnHeaderName:"(Year)",pivotQuarterColumnHeaderName:"(Quarter)",chartsNoCharts:"There are no charts available",chartsChartNotSelected:"Select a chart type to configure its options",chartsTabChart:"Chart",chartsTabFields:"Fields",chartsTabCustomize:"Customize",chartsCloseButton:"Close charts configuration",chartsSyncButtonLabel:"Sync chart",chartsSearchPlaceholder:"Search fields",chartsSearchLabel:"Search fields",chartsSearchClear:"Clear search",chartsNoFields:"No fields",chartsFieldBlocked:"This field cannot be added to any section",chartsCategories:"Categories",chartsSeries:"Series",chartsMenuAddToDimensions:e=>`Add to ${e}`,chartsMenuAddToValues:e=>`Add to ${e}`,chartsMenuMoveUp:"Move up",chartsMenuMoveDown:"Move down",chartsMenuMoveToTop:"Move to top",chartsMenuMoveToBottom:"Move to bottom",chartsMenuOptions:"Field options",chartsMenuRemove:"Remove",chartsDragToDimensions:e=>`Drag here to use column as ${e}`,chartsDragToValues:e=>`Drag here to use column as ${e}`,aiAssistantPanelTitle:"AI Assistant",aiAssistantPanelClose:"Close AI Assistant",aiAssistantPanelNewConversation:"New conversation",aiAssistantPanelConversationHistory:"Conversation history",aiAssistantPanelEmptyConversation:"No prompt history",aiAssistantSuggestions:"Suggestions",promptFieldLabel:"Prompt",promptFieldPlaceholder:"Type a prompt…",promptFieldPlaceholderWithRecording:"Type or record a prompt…",promptFieldPlaceholderListening:"Listening for prompt…",promptFieldSpeechRecognitionNotSupported:"Speech recognition is not supported in this browser",promptFieldSend:"Send",promptFieldRecord:"Record",promptFieldStopRecording:"Stop recording",promptRerun:"Run again",promptProcessing:"Processing…",promptAppliedChanges:"Applied changes",promptChangeGroupDescription:e=>`Group by ${e}`,promptChangeAggregationLabel:(e,t)=>`${e} (${t})`,promptChangeAggregationDescription:(e,t)=>`Aggregate ${e} (${t})`,promptChangeFilterLabel:(e,t,n)=>"is any of"===t?`${e} is any of: ${n}`:`${e} ${t} ${n}`,promptChangeFilterDescription:(e,t,n)=>"is any of"===t?`Filter where ${e} is any of: ${n}`:`Filter where ${e} ${t} ${n}`,promptChangeSortDescription:(e,t)=>`Sort by ${e} (${t})`,promptChangePivotEnableLabel:"Pivot",promptChangePivotEnableDescription:"Enable pivot",promptChangePivotColumnsLabel:e=>`Columns (${e})`,promptChangePivotColumnsDescription:(e,t)=>`${e}${t?` (${t})`:""}`,promptChangePivotRowsLabel:e=>`Rows (${e})`,promptChangePivotValuesLabel:e=>`Values (${e})`,promptChangePivotValuesDescription:(e,t)=>`${e} (${t})`,promptChangeChartsLabel:(e,t)=>`Dimensions (${e}), Values (${t})`};function YT(e){return Ph("MuiDataGrid",e)}const XT=Mh("MuiDataGrid",["aiAssistantPanel","aiAssistantPanelHeader","aiAssistantPanelTitleContainer","aiAssistantPanelTitle","aiAssistantPanelBody","aiAssistantPanelEmptyText","aiAssistantPanelFooter","aiAssistantPanelConversation","aiAssistantPanelConversationList","aiAssistantPanelConversationTitle","aiAssistantPanelSuggestions","aiAssistantPanelSuggestionsList","aiAssistantPanelSuggestionsItem","aiAssistantPanelSuggestionsLabel","actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","aggregationColumnHeaderLabel","aggregationRowOverlayWrapper","autoHeight","autosizing","mainContent","withSidePanel","booleanCell","cell--editable","cell--editing","cell--flex","cell--textCenter","cell--textLeft","cell--textRight","cell--rangeTop","cell--rangeBottom","cell--rangeLeft","cell--rangeRight","cell--pinnedLeft","cell--pinnedRight","cell--selectionMode","cell","cellCheckbox","cellEmpty","cellSkeleton","cellOffsetLeft","checkboxInput","collapsible","collapsibleTrigger","collapsibleIcon","collapsiblePanel","columnHeader","columnHeader--alignCenter","columnHeader--alignLeft","columnHeader--alignRight","columnHeader--dragging","columnHeader--moving","columnHeader--numeric","columnHeader--sortable","columnHeader--sorted","columnHeader--filtered","columnHeader--pinnedLeft","columnHeader--pinnedRight","columnHeader--last","columnHeader--siblingFocused","columnHeader--filter","columnHeaderFilterInput","columnHeaderFilterOperatorLabel","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeaders","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsManagement","columnsManagementRow","columnsManagementHeader","columnsManagementSearchInput","columnsManagementFooter","columnsManagementScrollArea","columnsManagementEmptyText","container--top","container--bottom","detailPanel","detailPanelToggleCell","detailPanelToggleCell--expanded","footerCell","panel","panelHeader","panelWrapper","panelContent","panelFooter","paper","editBooleanCell","editInputCell","filler","filler--borderBottom","filler--pinnedLeft","filler--pinnedRight","filterForm","filterFormDeleteIcon","filterFormLogicOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","headerFilterRow","iconButtonContainer","iconSeparator","main","main--hasPinnedRight","main--hiddenContent","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","overlayWrapper","overlayWrapperInner","root","root--densityStandard","root--densityComfortable","root--densityCompact","root--disableUserSelection","root--noToolbar","row","row--editable","row--editing","row--firstVisible","row--lastVisible","row--dragging","row--beingDragged","row--dynamicHeight","row--detailPanelExpanded","row--borderBottom","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","rowReorderIcon","rowSkeleton","scrollArea--left","scrollArea--right","scrollArea--up","scrollArea--down","scrollArea","scrollbar","scrollbar--vertical","scrollbar--horizontal","scrollbarFiller","scrollbarFiller--pinnedRight","scrollShadow","scrollShadow--vertical","scrollShadow--horizontal","selectedRowCount","sortButton","sortIcon","shadowScrollArea","sidebar","sidebarHeader","toolbarContainer","toolbar","toolbarLabel","toolbarDivider","toolbarFilterList","toolbarQuickFilter","toolbarQuickFilterTrigger","toolbarQuickFilterControl","virtualScroller","virtualScroller--hasScrollX","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","withVerticalBorder","withBorderColor","cell--withRightBorder","cell--withLeftBorder","columnHeader--withRightBorder","columnHeader--withLeftBorder","treeDataGroupingCell","treeDataGroupingCellToggle","treeDataGroupingCellLoadingContainer","groupingCriteriaCell","groupingCriteriaCellToggle","groupingCriteriaCellLoadingContainer","pinnedRows","pinnedRows--top","pinnedRows--bottom","pivotPanelAvailableFields","pivotPanelField","pivotPanelField--sorted","pivotPanelFieldActionContainer","pivotPanelFieldCheckbox","pivotPanelFieldDragIcon","pivotPanelFieldList","pivotPanelFieldName","pivotPanelHeader","pivotPanelPlaceholder","pivotPanelScrollArea","pivotPanelSearchContainer","pivotPanelSection","pivotPanelSectionTitle","pivotPanelSections","pivotPanelSwitch","pivotPanelSwitchLabel","prompt","promptContent","promptText","promptFeedback","promptChangeList","promptChangesToggle","promptChangesToggleIcon","promptIcon","promptIconContainer","promptError","promptAction"]);let QT=function(e){return e.DataGrid="DataGrid",e.DataGridPro="DataGridPro",e.DataGridPremium="DataGridPremium",e}({});class ZT{timeouts=(()=>new Map)();cleanupTimeout=1e3;constructor(e=1e3){this.cleanupTimeout=e}register(e,t,n){this.timeouts||(this.timeouts=new Map);const r=setTimeout(()=>{"function"==typeof t&&t(),this.timeouts.delete(n.cleanupToken)},this.cleanupTimeout);this.timeouts.set(n.cleanupToken,r)}unregister(e){const t=this.timeouts.get(e.cleanupToken);t&&(this.timeouts.delete(e.cleanupToken),clearTimeout(t))}reset(){this.timeouts&&(this.timeouts.forEach((e,t)=>{this.unregister({cleanupToken:t})}),this.timeouts=void 0)}}class JT{registry=(()=>new FinalizationRegistry(e=>{"function"==typeof e&&e()}))();register(e,t,n){this.registry.register(e,t,n)}unregister(e){this.registry.unregister(e)}reset(){}}class eI{static create(){return new eI}}const tI={current:"undefined"!=typeof FinalizationRegistry?new JT:new ZT};let nI=0;function rI(e,t,n,r){const o=s.useState(eI.create)[0],i=s.useRef(null),a=s.useRef(null);a.current=n;const l=s.useRef(null);if(!i.current&&a.current){const n=(e,t,n)=>{t&&!t.defaultMuiPrevented&&a.current?.(e,t,n)};i.current=e.current.subscribeEvent(t,n,r),nI+=1,l.current={cleanupToken:nI},tI.current.register(o,()=>{i.current?.(),i.current=null,l.current=null},l.current)}else!a.current&&i.current&&(i.current(),i.current=null,l.current&&(tI.current.unregister(l.current),l.current=null));s.useEffect(()=>{if(!i.current&&a.current){const n=(e,t,n)=>{t&&!t.defaultMuiPrevented&&a.current?.(e,t,n)};i.current=e.current.subscribeEvent(t,n,r)}return l.current&&tI.current&&(tI.current.unregister(l.current),l.current=null),()=>{i.current?.(),i.current=null}},[e,t,r])}const oI={isFirst:!0};function iI(e,t,n){rI(e,t,n,oI)}const aI=Object.is,lI=GT,sI=(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>e===t[n]),cI=()=>({state:null,equals:null,selector:null,args:void 0}),uI=[],dI=()=>null;function pI(e,t,n=void 0,r=aI){e.current.state;const o=Dg(cI),i=null!==o.current.selector,[a,l]=s.useState(i?null:t(e,n));o.current.state=a,o.current.equals=r,o.current.selector=t;const c=o.current.args;if(o.current.args=n,i&&!((e,t)=>{let n=Object.is;return t instanceof Array?n=sI:t instanceof Object&&(n=lI),n(e,t)})(c,n)){const t=o.current.selector(e,o.current.args);o.current.equals(o.current.state,t)||(o.current.state=t,l(t))}const u=s.useCallback(()=>(o.current.subscription||(o.current.subscription=e.current.store.subscribe(()=>{const t=o.current.selector(e,o.current.args);o.current.equals(o.current.state,t)||(o.current.state=t,l(t))})),null),uI),d=s.useCallback(()=>(o.current.subscription||u(),()=>{o.current.subscription&&(o.current.subscription(),o.current.subscription=void 0)}),uI);return WM.useSyncExternalStore(d,u,dI),a}const fI={compact:.7,comfortable:1.3,standard:1},hI=nT(e=>e.density),mI=eT(hI,e=>fI[e]);function gI(e){throw new Error("Failed assertion: should not be rendered")}const vI=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange","slotProps"],bI=pg(gI,{name:"MuiDataGrid",slot:"EditInputCell"})({font:bP.typography.font.body,padding:"1px 0","& input":{padding:"0 16px",height:"100%"}}),yI=TR((e,t)=>{const n=rP(),{id:r,value:o,field:i,colDef:a,hasFocus:l,debounceMs:c=200,isProcessingProps:u,onValueChange:p,slotProps:h}=e,m=d(e,vI),g=lP(),v=s.useRef(null),[b,y]=s.useState(o),w=(e=>{const{classes:t}=e;return wm({root:["editInputCell"]},YT,t)})(n),x=s.useCallback(async e=>{const t=e.target.value,n=g.current.getColumn(i);let o=t;n.valueParser&&(o=n.valueParser(t,g.current.getRow(r),n,g)),y(o),g.current.setEditCellValue({id:r,field:i,value:o,debounceMs:c,unstable_skipValueParser:!0},e),p&&await p(e,t)},[g,c,i,r,p]),S=g.current.unstable_getEditCellMeta(r,i);return s.useEffect(()=>{"debouncedSetEditCellValue"!==S?.changeReason&&y(o)},[S,o]),Wh(()=>{l&&v.current.focus()},[l]),Xp.jsx(bI,f({as:n.slots.baseInput,inputRef:v,className:w.root,ownerState:n,fullWidth:!0,type:"number"===a.type?a.type:"text",value:b??"",onChange:x,endAdornment:u?Xp.jsx(n.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},m,h?.root,{ref:t}))}),wI=(e,t)=>t&&e.length>1?[e[0]]:e,xI=(e,t)=>n=>f({},n,{sorting:f({},n.sorting,{sortModel:wI(e,t)})}),SI=(e,t)=>{const n=e.map(e=>((e,t)=>{const n=t.current.getColumn(e.field);if(!n||null===e.sort)return null;let r;return r=n.getSortComparator?n.getSortComparator(e.sort):"desc"===e.sort?(...e)=>-1*n.sortComparator(...e):n.sortComparator,r?{getSortCellParams:e=>({id:e,field:n.field,rowNode:ST(t,e),value:t.current.getCellValue(e,n.field),api:t.current}),comparator:r}:null})(e,t)).filter(e=>!!e);return 0===n.length?null:e=>e.map(e=>({node:e,params:n.map(t=>t.getSortCellParams(e.id))})).sort((e,t)=>{return r=e,o=t,n.reduce((e,t,n)=>{if(0!==e)return e;const i=r.params[n],a=o.params[n];return t.comparator(i.value,a.value,i,a)},0);var r,o}).map(e=>e.node.id)},CI=(e,t)=>{const n=e.indexOf(t);return t&&-1!==n&&n+1!==e.length?e[n+1]:e[0]},kI=(e,t)=>null==e&&null!=t?-1:null==t&&null!=e?1:null==e&&null==t?0:null,EI=new Intl.Collator,RI=(e,t)=>{const n=kI(e,t);return null!==n?n:Number(e)-Number(t)},PI=(e,t)=>{const n=kI(e,t);return null!==n?n:e>t?1:e<t?-1:0},MI=["item","applyValue","type","apiRef","focusElementRef","tabIndex","disabled","isFilterActive","slotProps","clearButton","headerFilterMenu"];function TI(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,tabIndex:a,disabled:l,slotProps:c,clearButton:u,headerFilterMenu:p}=e,h=d(e,MI),m=c?.root,g=Ng(),[v,b]=s.useState(II(t.value)),[y,w]=s.useState(!1),x=mm(),S=rP(),C=s.useCallback(e=>{const o=II(e.target.value);b(o),w(!0),g.start(S.filterDebounceMs,()=>{const e=f({},t,{value:"number"!==r||Number.isNaN(Number(o))?o:Number(o),fromInput:x});n(e),w(!1)})},[g,S.filterDebounceMs,t,r,x,n]);return s.useEffect(()=>{t.fromInput===x&&null!=t.value||b(II(t.value))},[x,t]),Xp.jsxs(s.Fragment,{children:[Xp.jsx(S.slots.baseTextField,f({id:x,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),value:v??"",onChange:C,type:r||"text",disabled:l,slotProps:f({},m?.slotProps,{input:f({endAdornment:y?Xp.jsx(S.slots.loadIcon,{fontSize:"small",color:"action"}):null},m?.slotProps?.input),htmlInput:f({tabIndex:a},m?.slotProps?.htmlInput)}),inputRef:i},S.slotProps?.baseTextField,h,m)),p,u]})}function II(e){if(null!=e&&""!==e)return String(e)}function OI(e){return"object"==typeof e&&null!==e}function DI(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const FI=(e,t,n)=>Math.max(t,Math.min(n,e));function LI(e){return"function"==typeof structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e))}const AI=(e,t)=>n=>{e&&t(n)};function NI(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,slotProps:a}=e,l=mm(),[c,u]=s.useState([]),[d,p]=s.useState(t.value||[]),h=rP();s.useEffect(()=>{const e=t.value??[];p(e.map(String))},[t.value]);const m=s.useCallback((e,o)=>{p(o.map(String)),n(f({},t,{value:[...o.map(e=>"number"===r?Number(e):e)]}))},[n,t,r]),g=s.useCallback((e,t)=>{u(""===t?[]:[t])},[u]),v=h.slots.baseAutocomplete;return Xp.jsx(v,f({multiple:!0,freeSolo:!0,options:c,id:l,value:d,onChange:m,onInputChange:g,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),slotProps:{textField:{type:r||"text",inputRef:i}}},a?.root))}var $I=function(e){return e.Cell="cell",e.Row="row",e}($I||{}),zI=function(e){return e.Edit="edit",e.View="view",e}(zI||{}),jI=function(e){return e.Edit="edit",e.View="view",e}(jI||{}),BI=function(e){return e.And="and",e.Or="or",e}(BI||{});class _I{constructor(e){this.data=e.ids}has(e){return this.data.has(e)}select(e){this.data.add(e)}unselect(e){this.data.delete(e)}}class HI{constructor(e){this.data=e.ids}has(e){return!this.data.has(e)}select(e){this.data.delete(e)}unselect(e){this.data.add(e)}}const VI=e=>"include"===e.type?new _I(e):new HI(e);var WI=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e.pasteKeyDown="pasteKeyDown",e}(WI||{}),UI=function(e){return e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(UI||{}),GI=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e}(GI||{}),KI=function(e){return e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(KI||{});function qI(e){return void 0!==e.field}const YI={filteredRowsLookup:{},filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}},XI=()=>({items:[],logicOperator:BI.And,quickFilterValues:[],quickFilterLogicOperator:BI.And});function QI(e){return{current:e.current.getPublicApi()}}let ZI=function(e){return e.LEFT="left",e.RIGHT="right",e}({});const JI={left:[],right:[]},eO=nT(e=>e.isRtl),tO=nT(e=>e.props.listView??!1),nO=nT(e=>e.listViewColumn),rO=nT(e=>e.columns),oO=eT(rO,e=>e.orderedFields),iO=eT(rO,e=>e.lookup),aO=tT(oO,iO,(e,t)=>e.map(e=>t[e])),lO=eT(rO,e=>e.columnVisibilityModel),sO=eT(rO,e=>e.initialColumnVisibilityModel),cO=tT(aO,lO,tO,nO,(e,t,n,r)=>n&&r?[r]:e.filter(e=>!1!==t[e.field])),uO=tT(cO,e=>e.map(e=>e.field)),dO=nT(e=>e.pinnedColumns);tT(dO,oO,eO,(e,t,n)=>fO(e,t,n));const pO=tT(rO,dO,uO,eO,tO,(e,t,n,r,o)=>{if(o)return JI;const i=fO(t,n,r);return{left:i.left.map(t=>e.lookup[t]),right:i.right.map(t=>e.lookup[t])}});function fO(e,t,n){if(!Array.isArray(e.left)&&!Array.isArray(e.right))return JI;if(0===e.left?.length&&0===e.right?.length)return JI;const r=(e,t)=>Array.isArray(e)?e.filter(e=>t.includes(e)):[],o=r(e.left,t),i=t.filter(e=>!o.includes(e)),a=r(e.right,i);return n?{left:a,right:o}:{left:o,right:a}}const hO=tT(cO,e=>{const t=[];let n=0;for(let r=0;r<e.length;r+=1)t.push(n),n+=e[r].computedWidth;return t}),mO=tT(aO,e=>e.filter(e=>e.filterable)),gO=tT(aO,e=>e.reduce((e,t)=>(t.filterable&&(e[t.field]=t),e),{})),vO=tT(aO,e=>e.some(e=>void 0!==e.colSpan));let bO;const yO=(e,t)=>{const n=f({},e);if(null==n.id&&(n.id=Math.round(1e5*Math.random())),null==n.operator){const e=iO(t)[n.field];n.operator=e&&e.filterOperators[0].value}return n},wO=(e,t,n)=>{const r=e.items.length>1;let o;o=r&&t?[e.items[0]]:e.items;const i=r&&o.some(e=>null==e.id);return o.some(e=>null==e.operator)||i?f({},e,{items:o.map(e=>yO(e,n))}):e.items!==o?f({},e,{items:o}):e},xO=(e,t,n)=>r=>f({},r,{filterModel:wO(e,t,n)}),SO=e=>"string"==typeof e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,CO=(e,t,n)=>{if(!e.field||!e.operator)return null;const r=n.current.getColumn(e.field);if(!r)return null;let o;if(r.valueParser){const t=r.valueParser;o=Array.isArray(e.value)?e.value?.map(e=>t(e,void 0,r,n)):t(e.value,void 0,r,n)}else o=e.value;const{ignoreDiacritics:i}=n.current.rootProps;i&&(o=SO(o));const a=f({},e,{value:o}),l=r.filterOperators;if(!l?.length)throw new Error(`MUI X: No filter operators found for column '${r.field}'.`);const s=l.find(e=>e.value===a.operator);if(!s)throw new Error(`MUI X: No filter operator found for column '${r.field}' and operator value '${a.operator}'.`);const c=QI(n),u=s.getApplyFilterFn(a,r);return"function"!=typeof u?null:{item:a,fn:e=>{let n=t(e,r);return i&&(n=SO(n)),u(n,e,r,c)}}};let kO=1;const EO=(e,t,n,r)=>{const{items:o}=e,i=o.map(e=>CO(e,t,n)).filter(e=>!!e);if(0===i.length)return null;if(r||!function(){if(void 0!==bO)return bO;try{bO=new Function("return true")()}catch(e){bO=!1}return bO}())return(e,t)=>{const n={};for(let r=0;r<i.length;r+=1){const o=i[r];t&&!t(o.item.field)||(n[o.item.id]=o.fn(e))}return n};const a=new Function("appliers","row","shouldApplyFilter",`"use strict";\n${i.map((e,t)=>`const shouldApply${t} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(e.item.field)});`).join("\n")}\n\nconst result$$ = {\n${i.map((e,t)=>` ${JSON.stringify(String(e.item.id))}: !shouldApply${t} ? false : appliers[${t}].fn(row),`).join("\n")}\n};\n\nreturn result$$;`.replaceAll("$$",String(kO)));kO+=1;return(e,t)=>a(i,e,t)},RO=e=>e.quickFilterExcludeHiddenColumns??!0,PO=(e,t,n,r)=>{const o=EO(e,t,n,r),i=((e,t,n)=>{const r=e.quickFilterValues?.filter(Boolean)??[];if(0===r.length)return null;const o=oO(n),i=lO(n);let a;a=RO(e)?o.filter(e=>!1!==i[e]):o;const l=[],{ignoreDiacritics:s}=n.current.rootProps,c=QI(n);return a.forEach(e=>{const t=n.current.getColumn(e),o=t?.getApplyQuickFilterFn;o&&l.push({column:t,appliers:r.map(e=>{const n=s?SO(e):e;return{fn:o(n,t,c)}})})}),function(e,n){const o={};e:for(let i=0;i<r.length;i+=1){const a=r[i];for(let r=0;r<l.length;r+=1){const{column:u,appliers:d}=l[r],{field:p}=u;if(n&&!n(p))continue;const f=d[i];let h=t(e,u);if(null!==f.fn&&(s&&(h=SO(h)),f.fn(h,e,u,c))){o[a]=!0;continue e}}o[a]=!1}return o}})(e,t,n);return function(e,t,n){n.passingFilterItems=o?.(e,t)??null,n.passingQuickFilterValues=i?.(e,t)??null}},MO=e=>null!=e,TO=(e,t,n,r,o,i)=>{const a=((e,t,n,r)=>(e.cleanedFilterItems||(e.cleanedFilterItems=r.filter(e=>null!==CO(e,t,n))),e.cleanedFilterItems))(i,r,o,n.items),l=e.filter(MO),s=t.filter(MO);if(l.length>0){const e=e=>l.some(t=>t[e.id]);if((n.logicOperator??XI().logicOperator)===BI.And){if(!a.every(e))return!1}else{if(!a.some(e))return!1}}if(s.length>0&&null!=n.quickFilterValues){const e=e=>s.some(t=>t[e]);if((n.quickFilterLogicOperator??XI().quickFilterLogicOperator)===BI.And){if(!n.quickFilterValues.every(e))return!1}else{if(!n.quickFilterValues.some(e))return!1}}return!0},IO=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),o=new RegExp(DI(r),"i");return e=>{if(null==e)return t;const n=o.test(String(e));return t?!n:n}},OO=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),o=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return e=>{if(null==e)return t;const n=0===o.compare(r,e.toString());return t?!n:n}},DO=e=>()=>t=>{const n=""===t||null==t;return e?!n:n},FO={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,chartable:!0,editable:!1,sortComparator:(e,t)=>{const n=kI(e,t);return null!==n?n:"string"==typeof e?EI.compare(e.toString(),t.toString()):e-t},type:"string",align:"left",filterOperators:((e=!1)=>[{value:"contains",getApplyFilterFn:IO(e,!1),InputComponent:TI},{value:"doesNotContain",getApplyFilterFn:IO(e,!0),InputComponent:TI},{value:"equals",getApplyFilterFn:OO(e,!1),InputComponent:TI},{value:"doesNotEqual",getApplyFilterFn:OO(e,!0),InputComponent:TI},{value:"startsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`^${DI(n)}.*$`,"i");return e=>null!=e&&r.test(e.toString())},InputComponent:TI},{value:"endsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`.*${DI(n)}$`,"i");return e=>null!=e&&r.test(e.toString())},InputComponent:TI},{value:"isEmpty",getApplyFilterFn:DO(!1),requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:DO(!0),requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:t=>{if(!Array.isArray(t.value)||0===t.value.length)return null;const n=e?t.value:t.value.map(e=>e.trim()),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return e=>null!=e&&n.some(t=>0===r.compare(t,e.toString()||""))},InputComponent:NI}])(),renderEditCell:e=>Xp.jsx(yI,f({},e)),getApplyQuickFilterFn:e=>{if(!e)return null;const t=new RegExp(DI(e),"i");return(e,n,r,o)=>{let i=o.current.getRowFormattedValue(n,r);return o.current.ignoreDiacritics&&(i=SO(i)),null!=i&&t.test(i.toString())}}};function LO(e){return 1===e.key.length&&!e.ctrlKey&&!e.metaKey}const AO=e=>0===e.indexOf("Arrow")||0===e.indexOf("Page")||" "===e||"Home"===e||"End"===e,NO=e=>"Tab"===e||"Escape"===e;function $O(e){return(e.ctrlKey||e.metaKey)&&"V"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey}const zO=s.createContext(void 0),jO=()=>{const e=s.useContext(zO);if(void 0===e)throw new Error(["MUI X: Could not find the Data Grid configuration context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join("\n"));return e},BO=s.createContext({className:"unset",tag:Xp.jsx("style",{href:"/unset"})});function _O(){return s.useContext(BO).className}function HO(e){const t=jO(),n=rP(),r=t.hooks.useCSSVariables(),o=s.useMemo(()=>{const e=`MuiDataGridVariables-${r.id}`,t=`.${e}{${function(e){let t="";for(const n in e)Object.hasOwn(e,n)&&void 0!==e[n]&&(t+=`${n}:${e[n]};`);return t}(r.variables)}}`;return{className:e,tag:Xp.jsx("style",{href:`/${e}`,nonce:n.nonce,children:t})}},[n.nonce,r]);return Xp.jsx(BO.Provider,{value:o,children:e.children})}const VO=["open","target","onClose","children","position","className","onExited"],WO=pg(gI,{name:"MuiDataGrid",slot:"Menu"})({zIndex:bP.zIndex.menu,[`& .${XT.menuList}`]:{outline:0}});function UO(e){const{open:t,target:n,onClose:r,children:o,position:i,className:a,onExited:l}=e,c=d(e,VO),u=lP(),p=rP(),h=(e=>{const{classes:t}=e;return wm({root:["menu"]},YT,t)})(p),m=_O(),g=s.useRef(null);Wh(()=>{t?g.current=document.activeElement instanceof HTMLElement?document.activeElement:null:(g.current?.focus?.(),g.current=null)},[t]),s.useEffect(()=>{const e=t?"menuOpen":"menuClose";u.current.publishEvent(e,{target:n})},[u,t,n]);return Xp.jsx(WO,f({as:p.slots.basePopper,className:PR(h.root,a,m),ownerState:p,open:t,target:n,transition:!0,placement:i,onClickAway:e=>{e.target&&(n===e.target||n?.contains(e.target))||r(e)},onExited:l,clickAwayMouseEvent:"onMouseDown",onKeyDown:e=>{NO(e.key)&&r(e)}},c,p.slotProps?.basePopper,{children:o}))}const GO=["label","icon","showInMenu","onClick"],KO=["label","icon","showInMenu","onClick","closeMenuOnClick","closeMenu"],qO=TR((e,t)=>{const n=rP();if(!e.showInMenu){const{label:r,icon:o,onClick:i}=e,a=d(e,GO),l=e=>{i?.(e)};return Xp.jsx(n.slots.baseIconButton,f({size:"small",role:"menuitem","aria-label":r},a,{onClick:l},n.slotProps?.baseIconButton,{ref:t,children:s.cloneElement(o,{fontSize:"small"})}))}const{label:r,icon:o,onClick:i,closeMenuOnClick:a=!0,closeMenu:l}=e,c=d(e,KO);return Xp.jsx(n.slots.baseMenuItem,f({ref:t},c,{onClick:e=>{i?.(e),a&&l?.()},iconStart:o,children:r}))}),YO=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","children","suppressChildrenValidation"];function XO(e){const{hasFocus:t,tabIndex:n,position:r="bottom-end",children:o,suppressChildrenValidation:i}=e,a=d(e,YO),[l,c]=s.useState(-1),[u,p]=s.useState(!1),h=lP(),m=s.useRef(null),g=s.useRef(null),v=s.useRef(!1),b=s.useRef({}),y=um(),w=mm(),x=mm(),S=rP(),C=[];s.Children.forEach(o,e=>{s.isValidElement(e)&&(e.type===s.Fragment?s.Children.forEach(e.props.children,e=>{s.isValidElement(e)&&C.push(e)}):e.type===qO||i?C.push(e):"function"==typeof e.type?e.type.name:e.type)});const k=C.filter(e=>!e.props.showInMenu),E=C.filter(e=>e.props.showInMenu),R=k.length+(E.length?1:0);s.useLayoutEffect(()=>{t||Object.entries(b.current).forEach(([e,t])=>{t?.stop({},()=>{delete b.current[e]})})},[t]),s.useEffect(()=>{if(l<0||!m.current)return;if(l>=m.current.children.length)return;m.current.children[l].focus({preventScroll:!0})},[l]);const P=C.findIndex(e=>!e.props.disabled);s.useEffect(()=>{t&&-1===l&&c(P),t||(c(-1),v.current=!1)},[t,l,P]),s.useEffect(()=>{l>=R&&c(R-1)},[l,R]);const M=()=>{p(!1)},T=e=>t=>{b.current[e]=t},I=(e,t)=>n=>{c(e),v.current=!0,t&&t(n)},O=R>0?{role:"menu",onKeyDown:e=>{if(R<=1)return;const t=(e,n)=>{if(e<0||e>C.length)return e;const r=("left"===n?-1:1)*(y?-1:1);return C[e+r]?.props.disabled?t(e+r,n):e+r};let n=l;"ArrowRight"===e.key?n=t(l,"right"):"ArrowLeft"===e.key&&(n=t(l,"left")),n<0||n>=R||n!==l&&(e.preventDefault(),e.stopPropagation(),c(n))}}:void 0;return Xp.jsxs("div",f({ref:m,tabIndex:-1,className:XT.actionsCell},O,a,{children:[k.map((e,t)=>s.cloneElement(e,{key:t,touchRippleRef:T(t),onClick:I(t,e.props.onClick),tabIndex:l===t?n:-1})),E.length>0&&x&&Xp.jsx(S.slots.baseIconButton,f({ref:g,id:x,"aria-label":h.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":u,"aria-controls":u?w:void 0,role:"menuitem",size:"small",onClick:e=>{e.stopPropagation(),e.preventDefault(),u?M():(p(!0),c(R-1),v.current=!0)},touchRippleRef:T(x),tabIndex:l===k.length?n:-1},S.slotProps?.baseIconButton,{children:Xp.jsx(S.slots.moreActionsIcon,{fontSize:"small"})})),E.length>0&&Xp.jsx(UO,{open:u,target:g.current,position:r,onClose:M,children:Xp.jsx(S.slots.baseMenuList,{id:w,className:XT.menuList,"aria-labelledby":x,autoFocusItem:!0,children:E.map((e,t)=>s.cloneElement(e,{key:t,closeMenu:M}))})})]}))}function QO(e){const{colDef:t,id:n}=e,r=lP();if(!(e=>"function"==typeof e.getActions)(t))throw new Error("MUI X: Missing the `getActions` property in the `GridColDef`.");const o=t.getActions(r.current.getRowParams(n));return Xp.jsx(XO,f({suppressChildrenValidation:!0},e,{children:o}))}const ZO="actions",JO=f({},FO,{sortable:!1,filterable:!1,aggregable:!1,chartable:!1,width:100,display:"flex",align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:e=>Xp.jsx(QO,f({},e)),getApplyQuickFilterFn:()=>null}),eD="__row_group_by_columns_group__",tD="__detail_panel_toggle__";let nD=function(e){return e[e.NONE=0]="NONE",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.VIRTUAL=3]="VIRTUAL",e}({});const rD=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","hideDescendantCount"];function oD(e){const{value:t,rowNode:n}=e,r=d(e,rD),o=lP(),i=rP(),a=(e=>{const{classes:t}=e;return wm({root:["booleanCell"]},YT,t)})({classes:i.classes}),l=pI(o,RT)>0&&"group"===n.type&&!1===i.treeData,c=s.useMemo(()=>t?i.slots.booleanCellTrueIcon:i.slots.booleanCellFalseIcon,[i.slots.booleanCellFalseIcon,i.slots.booleanCellTrueIcon,t]);return l&&void 0===t?null:Xp.jsx(c,f({fontSize:"small",className:a.root,titleAccess:o.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":Boolean(t)},r))}const iD=s.memo(oD),aD=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"];function lD(e){const{id:t,value:n,field:r,className:o,hasFocus:i,onValueChange:a}=e,l=d(e,aD),c=lP(),u=s.useRef(null),p=mm(),[h,m]=s.useState(n),g=rP(),v=(e=>{const{classes:t}=e;return wm({root:["editBooleanCell"]},YT,t)})({classes:g.classes}),b=s.useCallback(async e=>{const n=e.target.checked;a&&await a(e,n),m(n),await c.current.setEditCellValue({id:t,field:r,value:n},e)},[c,r,t,a]);return s.useEffect(()=>{m(n)},[n]),Wh(()=>{i&&u.current.focus()},[i]),Xp.jsx("label",f({htmlFor:p,className:PR(v.root,o)},l,{children:Xp.jsx(g.slots.baseCheckbox,f({id:p,inputRef:u,checked:Boolean(h),onChange:b,size:"small"},g.slotProps?.baseCheckbox))}))}const sD=["item","applyValue","apiRef","focusElementRef","isFilterActive","headerFilterMenu","clearButton","tabIndex","slotProps"];function cD(e){const{item:t,applyValue:n,apiRef:r,focusElementRef:o,headerFilterMenu:i,clearButton:a,tabIndex:l,slotProps:c}=e,u=d(e,sD),[p,h]=s.useState(uD(t.value)),m=rP(),g=mm(),v=mm(),b=m.slotProps?.baseSelect||{},y=b.native??!1,w=m.slotProps?.baseSelectOption||{},x=s.useCallback(e=>{const r=uD(e.target.value);h(r),n(f({},t,{value:r}))},[n,t]);s.useEffect(()=>{h(uD(t.value))},[t.value]);const S=c?.root.label??r.current.getLocaleText("filterPanelInputLabel"),C=c?.root.slotProps;return Xp.jsxs(s.Fragment,{children:[Xp.jsxs(m.slots.baseSelect,f({fullWidth:!0,labelId:g,id:v,label:S,value:void 0===p?"":String(p),onChange:x,native:y,slotProps:{htmlInput:f({ref:o,tabIndex:l},C?.htmlInput)}},b,u,c?.root,{children:[Xp.jsx(m.slots.baseSelectOption,f({},w,{native:y,value:"",children:r.current.getLocaleText("filterValueAny")})),Xp.jsx(m.slots.baseSelectOption,f({},w,{native:y,value:"true",children:r.current.getLocaleText("filterValueTrue")})),Xp.jsx(m.slots.baseSelectOption,f({},w,{native:y,value:"false",children:r.current.getLocaleText("filterValueFalse")}))]})),i,a]})}function uD(e){return"true"===String(e).toLowerCase()||"false"!==String(e).toLowerCase()&&void 0}const dD=f({},FO,{type:"boolean",display:"flex",align:"center",headerAlign:"center",renderCell:e=>e.field!==eD&&jT(e.rowNode)?"":Xp.jsx(iD,f({},e)),renderEditCell:e=>Xp.jsx(lD,f({},e)),sortComparator:RI,valueFormatter:(e,t,n,r)=>e?r.current.getLocaleText("booleanCellTrueLabel"):r.current.getLocaleText("booleanCellFalseLabel"),filterOperators:[{value:"is",getApplyFilterFn:e=>{const t=uD(e.value);return void 0===t?null:e=>Boolean(e)===t},InputComponent:cD}],getApplyQuickFilterFn:()=>null,aggregable:!1,chartable:!1,pastedValueParser:e=>(e=>{switch(e.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case"null":case"undefined":return!1;default:return}})(e)});function pD(e){for(const t in e)return!1;return!0}const fD=nT(e=>e.sorting),hD=eT(fD,e=>e.sortedRows),mD=tT(hD,wT,xT,(e,t,n)=>e.reduce((e,r)=>{const o=t[r];if(o)e.push({id:r,model:o});else{const t=n[r];t&&jT(t)&&e.push({id:r,model:{[DT]:r}})}return e},[])),gD=eT(fD,e=>e.sortModel),vD=tT(gD,e=>{const t=e.reduce((t,n,r)=>(t[n.field]={sortDirection:n.sort,sortIndex:e.length>1?r+1:void 0},t),{});return t});tT(hD,e=>e.reduce((e,t,n)=>(e[t]=n,e),Object.create(null)));const bD=nT(e=>e.filter),yD=eT(bD,e=>e.filterModel),wD=eT(yD,e=>e.quickFilterValues),xD=nT(e=>e.visibleRowsLookup),SD=eT(bD,e=>e.filteredRowsLookup);eT(bD,e=>e.filteredChildrenCountLookup),eT(bD,e=>e.filteredDescendantCountLookup);const CD=tT(xD,mD,(e,t)=>pD(e)?t:t.filter(t=>!1!==e[t.id])),kD=tT(CD,e=>e.map(e=>e.id)),ED=tT(SD,mD,(e,t)=>pD(e)?t:t.filter(t=>!1!==e[t.id])),RD=tT(ED,e=>e.map(e=>e.id));tT(kD,xT,(e,t)=>{const n={};let r=0;return e.reduce((e,o)=>{const i=t[o];return n[i.depth]||(n[i.depth]=0),i.depth>r&&(n[i.depth]=0),r=i.depth,n[i.depth]+=1,e[o]=n[i.depth],e},{})});const PD=eT(tT(ED,xT,RT,(e,t,n)=>n<2?[e]:e.reduce((e,n)=>{const r=t[n.id]?.depth;return void 0===r||(e[r]||(e[r]=[]),e[r].push(n)),e},[[]])),e=>e[0]??[]),MD=eT(CD,e=>e.length),TD=eT(PD,e=>e.length),ID=eT(ED,e=>e.length);eT(ID,TD,(e,t)=>e-t);const OD=tT(yD,iO,(e,t)=>e.items?.filter(e=>{if(!e.field)return!1;const n=t[e.field];if(!n?.filterOperators||0===n?.filterOperators?.length)return!1;const r=n.filterOperators.find(t=>t.value===e.operator);return!!r&&(!r.InputComponent||null!=e.value&&""!==e.value?.toString())})),DD=tT(OD,e=>{const t=e.reduce((e,t)=>(e[t.field]?e[t.field].push(t):e[t.field]=[t],e),{});return t}),FD=tT(kD,e=>e.reduce((e,t,n)=>(e[t]=n,e),Object.create(null))),LD=nT(e=>e.rowSelection),AD=tT(LD,VI),ND=eT(LD,ID,(e,t)=>"include"===e.type?e.ids.size:t-e.ids.size),$D=tT(LD,wT,PT,(e,t,n)=>{const r=new Map;if("include"===e.type)for(const n of e.ids)r.set(n,t[n]);else for(let o=0;o<n.length;o+=1){const i=n[o];e.ids.has(i)||r.set(i,t[i])}return r}),zD=nT((e,t)=>DT in t?t[DT]:e.props.getRowId?e.props.getRowId(t):t.id),jD=nT(e=>e.props.isRowSelectable);function BD(e,t){const n=xT(e),r=hD(e),o=SD(e),i=n[t];if(!i||"group"!==i.type)return[];const a=[];for(let l=r.findIndex(e=>e===t)+1;l<r.length&&n[r[l]]?.depth>i.depth;l+=1){const t=r[l];!1!==o[t]&&e.current.isRowSelectable(t)&&a.push(t)}return a}const _D=eT(aO,xT,SD,AD,wT,jD,(e,t,n,r,o,i,{groupId:a,autoSelectParents:l})=>{const s=t[a],c={id:a,row:o[a],columns:e};let u=!0;if("function"==typeof i&&(u=i(c)),!s||"group"!==s.type||r.has(a))return{isIndeterminate:!1,isChecked:r.has(a),isSelectable:u};let d=!1,p=!1;const f=e=>{if(!1===n[e]||d&&p)return;const o=t[e];"group"===o?.type&&o.children.forEach(f),r.has(e)?d=!0:p=!0};return f(a),{isIndeterminate:d&&p,isChecked:!!l&&(d&&!p),isSelectable:u}});function HD(e){return e.signature===QT.DataGrid?e.checkboxSelection&&!0!==e.disableMultipleRowSelection:!e.disableMultipleRowSelection}const VD=(e,t,n,r,o,i,a=AD(e))=>{const l=SD(e),s=new Set([]);if((r||o)&&!1!==l[n]){if(r){const r=t[n];if("group"===r?.type){BD(e,n).forEach(e=>{i(e),s.add(e)})}}if(o){const r=e=>{if(!a.has(e)&&!s.has(e))return!1;const n=t[e];return!!n&&("group"!==n.type||n.children.every(r))},o=n=>{const a=((e,t,n)=>{const r=e[n];if(!r)return[];const o=r.parent;return null==o?[]:e[o].children.filter(e=>e!==n&&!1!==t[e])})(t,l,n);if(0===a.length||a.every(r)){const r=t[n],a=r?.parent;null!=a&&a!==OT&&e.current.isRowSelectable(a)&&(i(a),s.add(a),o(a))}},c=t[n];if(!c||c.parent===OT)return;o(n)}}},WD=(e,t,n,r,o,i)=>{const a=AD(e);if(o||r){if(o){const e=((e,t)=>{const n=[];let r=t;for(;null!=r&&r!==OT;){const t=e[r];if(!t)return n;n.push(r),r=t.parent}return n})(t,n);e.forEach(e=>{a.has(e)&&i(e)})}if(r){const r=t[n];if("group"===r?.type){BD(e,n).forEach(e=>{i(e)})}}}},UD=["field","id","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],GD=TR(function(e,t){const{field:n,id:r,rowNode:o,tabIndex:i}=e,a=d(e,UD),l=lP(),c=rP(),u=(e=>{const{classes:t}=e;return wm({root:["checkboxInput"]},YT,t)})({classes:c.classes}),{isIndeterminate:p,isChecked:h,isSelectable:m}=pI(l,_D,{groupId:r,autoSelectParents:c.rowSelectionPropagation?.parents??!1}),g=!m;s.useLayoutEffect(()=>{if(0===i){const e=l.current.getCellElement(r,n);e&&(e.tabIndex=-1)}},[l,i,r,n]);const v=Mg(e=>{" "===e.key&&e.stopPropagation()}),b=Mg(e=>{g&&e.preventDefault()}),y=Mg(()=>{});if("footer"===o.type||"pinnedRow"===o.type)return null;const w=l.current.getLocaleText(h&&!p?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return Xp.jsx(c.slots.baseCheckbox,f({tabIndex:i,checked:h&&!p,onChange:e=>{if(g)return;const t={value:e.target.checked,id:r};l.current.publishEvent("rowSelectionCheckboxChange",t,e)},onClick:b,onMouseDown:y,className:PR(u.root,g&&"Mui-disabled"),material:{disableRipple:g},slotProps:{htmlInput:{"aria-disabled":g||void 0,"aria-label":w,name:"select_row"}},onKeyDown:v,indeterminate:p},c.slotProps?.baseCheckbox,a,{ref:t}))}),KD=GD,qD=nT(e=>e.focus),YD=eT(qD,e=>e.cell),XD=eT(qD,e=>e.columnHeader);eT(qD,e=>e.columnHeaderFilter);const QD=eT(qD,e=>e.columnGroupHeader),ZD=nT(e=>e.tabIndex),JD=eT(ZD,e=>e.cell),eF=eT(ZD,e=>e.columnHeader);eT(ZD,e=>e.columnHeaderFilter);const tF=eT(ZD,e=>e.columnGroupHeader),nF=(e,t,n)=>t>0&&e>0?Math.ceil(e/t):-1===e?n+2:0,rF=e=>({page:0,pageSize:e?0:100}),oF=(e,t)=>{if(t===QT.DataGrid&&e>100)throw new Error(["MUI X: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join("\n"))},iF=nT(e=>e.pagination),aF=eT(iF,e=>e.enabled&&"client"===e.paginationMode),lF=eT(iF,e=>e.paginationModel),sF=eT(iF,e=>e.rowCount),cF=eT(iF,e=>e.meta),uF=eT(lF,e=>e.page),dF=eT(lF,e=>e.pageSize),pF=eT(lF,sF,(e,t)=>nF(t,e.pageSize,e.page)),fF=tT(aF,lF,xT,RT,CD,PD,(e,t,n,r,o,i)=>{if(!e)return null;const a=i.length,l=Math.min(t.pageSize*t.page,a-1),s=-1===t.pageSize?a-1:Math.min(l+t.pageSize-1,a-1);if(-1===l||-1===s)return null;if(r<2)return{firstRowIndex:l,lastRowIndex:s};const c=i[l],u=s-l+1,d=o.findIndex(e=>e.id===c.id);let p=d,f=0;for(;p<o.length&&f<=u;){const e=o[p],t=n[e.id]?.depth;void 0===t?p+=1:((f<u||t>0)&&(p+=1),0===t&&(f+=1))}return{firstRowIndex:d,lastRowIndex:p-1}}),hF=tT(CD,fF,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),mF=tT(kD,fF,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),gF=tT(aF,fF,hF,CD,(e,t,n,r)=>e?{rows:n,range:t,rowIdToIndexMap:n.reduce((e,t,n)=>(e.set(t.id,n),e),new Map)}:{rows:r,range:0===r.length?null:{firstRowIndex:0,lastRowIndex:r.length-1},rowIdToIndexMap:r.reduce((e,t,n)=>(e.set(t.id,n),e),new Map)}),vF=["field","colDef"],bF=TR(function(e,t){const n=d(e,vF),[,r]=s.useState(!1),o=lP(),i=rP(),a=(e=>{const{classes:t}=e;return wm({root:["checkboxInput"]},YT,t)})({classes:i.classes}),l=pI(o,eF),c=pI(o,LD),u=pI(o,kD),p=pI(o,mF),h=s.useMemo(()=>{const e=i.isRowSelectable;if("function"!=typeof e)return c;if("exclude"===c.type)return c;const t={type:"include",ids:new Set};for(const n of c.ids)i.keepNonExistentRowsSelected&&t.ids.add(n),o.current.getRow(n)&&e(o.current.getRowParams(n))&&t.ids.add(n);return t},[o,i.isRowSelectable,i.keepNonExistentRowsSelected,c]),m=s.useMemo(()=>{const e=i.pagination&&i.checkboxSelectionVisibleOnly&&"server"!==i.paginationMode?p:u,t=new Set;for(let n=0;n<e.length;n+=1){const r=e[n];o.current.getRow(r)&&(o.current.isRowSelectable(r)&&t.add(r))}return t},[o,i.pagination,i.paginationMode,i.checkboxSelectionVisibleOnly,p,u]),g=s.useMemo(()=>{const e=VI(h);let t=0;for(const n of m)e.has(n)&&(t+=1);return t},[h,m]),v=s.useMemo(()=>{if(0===g)return!1;const e=VI(h);for(const t of m)if(!e.has(t))return!0;return!1},[g,h,m]),b=g>0,y=null!==l&&l.field===e.field?0:-1;s.useLayoutEffect(()=>{const t=o.current.getColumnHeaderElement(e.field);0===y&&t&&(t.tabIndex=-1)},[y,o,e.field]);const w=s.useCallback(e=>{" "===e.key&&o.current.publishEvent("headerSelectionCheckboxChange",{value:!b})},[o,b]),x=s.useCallback(()=>{r(e=>!e)},[]);s.useEffect(()=>o.current.subscribeEvent("rowSelectionChange",x),[o,x]);const S=o.current.getLocaleText(b&&!v?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return Xp.jsx(i.slots.baseCheckbox,f({indeterminate:v,checked:b&&!v,onChange:e=>{const t={value:e.target.checked};o.current.publishEvent("headerSelectionCheckboxChange",t)},className:a.root,slotProps:{htmlInput:{"aria-label":S,name:"select_all_rows"}},tabIndex:y,onKeyDown:w,disabled:!HD(i)},i.slotProps?.baseCheckbox,n,{ref:t}))}),yF="__check__",wF=f({},dD,{type:"custom",field:yF,width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,chartable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:()=>null,display:"flex",valueGetter:(e,t,n,r)=>{const o=zD(r,t);return r.current.isRowSelected(o)},rowSpanValueGetter:(e,t,n,r)=>zD(r,t),renderHeader:e=>Xp.jsx(bF,f({},e)),renderCell:e=>Xp.jsx(KD,f({},e))}),xF=["item","applyValue","type","apiRef","focusElementRef","slotProps","isFilterActive","headerFilterMenu","clearButton","tabIndex","disabled"];function SF(e,t){if(null==e)return"";const n=new Date(e);return Number.isNaN(n.getTime())?"":"date"===t?n.toISOString().substring(0,10):"datetime-local"===t?(n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n.toISOString().substring(0,19)):n.toISOString().substring(0,10)}function CF(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,slotProps:a,headerFilterMenu:l,clearButton:c,tabIndex:u,disabled:p}=e,h=d(e,xF),m=a?.root.slotProps,g=Ng(),[v,b]=s.useState(()=>SF(t.value,r)),[y,w]=s.useState(!1),x=mm(),S=rP(),C=s.useCallback(e=>{g.clear();const r=e.target.value;b(r),w(!0),g.start(S.filterDebounceMs,()=>{const e=new Date(r);n(f({},t,{value:Number.isNaN(e.getTime())?void 0:e})),w(!1)})},[n,t,S.filterDebounceMs,g]);return s.useEffect(()=>{const e=SF(t.value,r);b(e)},[t.value,r]),Xp.jsxs(s.Fragment,{children:[Xp.jsx(S.slots.baseTextField,f({fullWidth:!0,id:x,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),value:v,onChange:C,type:r||"text",disabled:p,inputRef:i,slotProps:f({},m,{input:f({endAdornment:y?Xp.jsx(S.slots.loadIcon,{fontSize:"small",color:"action"}):null},m?.input),htmlInput:f({max:"datetime-local"===r?"9999-12-31T23:59":"9999-12-31",tabIndex:u},m?.htmlInput)})},S.slotProps?.baseTextField,h,a?.root)),l,c]})}function kF(e,t,n,r){if(!e.value)return null;const o=new Date(e.value);n?o.setSeconds(0,0):(o.setMinutes(o.getMinutes()+o.getTimezoneOffset()),o.setHours(0,0,0,0));const i=o.getTime();return e=>{if(!e)return!1;if(r)return t(e.getTime(),i);const o=new Date(e);return n?o.setSeconds(0,0):o.setHours(0,0,0,0),t(o.getTime(),i)}}const EF=e=>[{value:"is",getApplyFilterFn:t=>kF(t,(e,t)=>e===t,e),InputComponent:CF,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFn:t=>kF(t,(e,t)=>e!==t,e),InputComponent:CF,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFn:t=>kF(t,(e,t)=>e>t,e),InputComponent:CF,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:t=>kF(t,(e,t)=>e>=t,e),InputComponent:CF,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFn:t=>kF(t,(e,t)=>e<t,e,!e),InputComponent:CF,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrBefore",getApplyFilterFn:t=>kF(t,(e,t)=>e<=t,e),InputComponent:CF,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>e=>null==e,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>null!=e,requiresFilterValue:!1}],RF=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange","slotProps"],PF=pg(gI)({fontSize:"inherit"});function MF(e){const{id:t,value:n,field:r,colDef:o,hasFocus:i,onValueChange:a,slotProps:l}=e,c=d(e,RF),u="dateTime"===o.type,p=lP(),h=s.useRef(null),m=s.useMemo(()=>{let e,t;if(e=null==n?null:n instanceof Date?n:new Date((n??"").toString()),null==e||Number.isNaN(e.getTime()))t="";else{t=new Date(e.getTime()-60*e.getTimezoneOffset()*1e3).toISOString().substr(0,u?16:10)}return{parsed:e,formatted:t}},[n,u]),[g,v]=s.useState(m),b=rP(),y=(e=>{const{classes:t}=e;return wm({root:["editInputCell"]},YT,t)})({classes:b.classes}),w=s.useCallback(e=>{if(""===e)return null;const[t,n]=e.split("T"),[r,o,i]=t.split("-"),a=new Date;if(a.setFullYear(Number(r),Number(o)-1,Number(i)),a.setHours(0,0,0,0),n){const[e,t]=n.split(":");a.setHours(Number(e),Number(t),0,0)}return a},[]),x=s.useCallback(async e=>{const n=e.target.value,o=w(n);a&&await a(e,o),v({parsed:o,formatted:n}),p.current.setEditCellValue({id:t,field:r,value:o},e)},[p,r,t,a,w]);return s.useEffect(()=>{v(e=>m.parsed!==e.parsed&&m.parsed?.getTime()!==e.parsed?.getTime()?m:e)},[m]),Wh(()=>{i&&h.current.focus()},[i]),Xp.jsx(PF,f({as:b.slots.baseInput,inputRef:h,fullWidth:!0,className:y.root,type:u?"datetime-local":"date",value:g.formatted,onChange:x},c,l?.root,{slotProps:{htmlInput:f({max:u?"9999-12-31T23:59":"9999-12-31"},l?.root?.slotProps?.htmlInput)}}))}const TF=e=>Xp.jsx(MF,f({},e));function IF({value:e,columnType:t,rowId:n,field:r}){if(!(e instanceof Date))throw new Error([`MUI X: \`${t}\` column type only accepts \`Date\` objects as values.`,"Use `valueGetter` to transform the value into a `Date` object.",`Row ID: ${n}, field: "${r}".`].join("\n"))}const OF=f({},FO,{type:"date",sortComparator:PI,valueFormatter:(e,t,n,r)=>{if(!e)return"";const o=zD(r,t);return!zT(t)||e instanceof Date?(IF({value:e,columnType:"date",rowId:o,field:n.field}),e.toLocaleDateString()):e},filterOperators:EF(),renderEditCell:TF,pastedValueParser:e=>new Date(e)}),DF=f({},FO,{type:"dateTime",sortComparator:PI,valueFormatter:(e,t,n,r)=>{if(!e)return"";const o=zD(r,t);return!zT(t)||e instanceof Date?(IF({value:e,columnType:"dateTime",rowId:o,field:n.field}),e.toLocaleString()):e},filterOperators:EF(!0),renderEditCell:TF,pastedValueParser:e=>new Date(e)}),FF=e=>null==e?null:Number(e),LF=f({},FO,{type:"number",align:"right",headerAlign:"right",sortComparator:RI,valueParser:e=>""===e?null:Number(e),valueFormatter:e=>function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)?e.toLocaleString():e||"",filterOperators:[{value:"=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>FF(t)===e.value,InputComponent:TI,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>FF(t)!==e.value,InputComponent:TI,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&FF(t)>e.value,InputComponent:TI,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&FF(t)>=e.value,InputComponent:TI,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&FF(t)<e.value,InputComponent:TI,InputComponentProps:{type:"number"}},{value:"<=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&FF(t)<=e.value,InputComponent:TI,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFn:()=>e=>null==e,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>null!=e,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:e=>Array.isArray(e.value)&&0!==e.value.length?t=>null!=t&&e.value.includes(Number(t)):null,InputComponent:NI,InputComponentProps:{type:"number"}}],getApplyQuickFilterFn:e=>null==e||Number.isNaN(e)||""===e?null:t=>FF(t)===FF(e)});function AF(e){return"singleSelect"===e?.type}function NF(e,t){if(e)return"function"==typeof e.valueOptions?e.valueOptions(f({field:e.field},t)):e.valueOptions}function $F(e,t,n){if(void 0===t)return;const r=t.find(t=>{const r=n(t);return String(r)===String(e)});return n(r)}const zF=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen","slotProps"];function jF(e){const t=rP(),{id:n,value:r,field:o,row:i,colDef:a,hasFocus:l,error:c,onValueChange:u,initialOpen:p=t.editMode===$I.Cell,slotProps:h}=e,m=d(e,zF),g=lP(),v=s.useRef(null),b=s.useRef(null),[y,w]=s.useState(p),x=(t.slotProps?.baseSelect||{}).native??!1;if(Wh(()=>{l&&b.current?.focus()},[l]),!AF(a))return null;const S=NF(a,{id:n,row:i});if(!S)return null;const C=a.getOptionValue,k=a.getOptionLabel;return S&&a?Xp.jsx(t.slots.baseSelect,f({ref:v,value:r,onChange:async e=>{if(!AF(a)||!S)return;w(!1);const t=$F(e.target.value,S,C);u&&await u(e,t),await g.current.setEditCellValue({id:n,field:o,value:t},e)},open:y,onOpen:e=>{(function(e){return"key"in e&&!!e.key})(e)&&"Enter"===e.key||w(!0)},onClose:(e,r)=>{if(t.editMode!==$I.Row){if("backdropClick"===r||"Escape"===e.key){const t=g.current.getCellParams(n,o);g.current.publishEvent("cellEditStop",f({},t,{reason:"Escape"===e.key?UI.escapeKeyDown:UI.cellFocusOut}))}}else w(!1)},error:c,native:x,fullWidth:!0,slotProps:{htmlInput:{ref:b}}},m,h?.root,t.slotProps?.baseSelect,{children:S.map(e=>{const n=C(e);return s.createElement(t.slots.baseSelectOption,f({},t.slotProps?.baseSelectOption||{},{native:x,key:n,value:n}),k(e))})})):null}const BF=["item","applyValue","type","apiRef","focusElementRef","tabIndex","isFilterActive","clearButton","headerFilterMenu","slotProps"],_F=({column:e,OptionComponent:t,getOptionLabel:n,getOptionValue:r,isSelectNative:o,baseSelectOptionProps:i})=>["",...NF(e)||[]].map(e=>{const a=r(e);let l=n(e);return""===l&&(l=" "),s.createElement(t,f({},i,{native:o,key:a,value:a}),l)});function HF(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,tabIndex:a,clearButton:l,headerFilterMenu:c,slotProps:u}=e,p=d(e,BF),h=t.value??"",m=mm(),g=mm(),v=rP(),b=v.slotProps?.baseSelect?.native??!1,y=o.current.getColumn(t.field),w=y.getOptionValue,x=y.getOptionLabel,S=s.useMemo(()=>NF(y),[y]),C=s.useCallback(e=>{let r=e.target.value;r=$F(r,S,w),n(f({},t,{value:r}))},[S,w,n,t]);if(!y||!AF(y))return null;const k=u?.root.label??o.current.getLocaleText("filterPanelInputLabel");return Xp.jsxs(s.Fragment,{children:[Xp.jsx(v.slots.baseSelect,f({fullWidth:!0,id:m,label:k,labelId:g,value:h,onChange:C,slotProps:{htmlInput:f({tabIndex:a,ref:i,type:r||"text",placeholder:u?.root.placeholder??o.current.getLocaleText("filterPanelInputPlaceholder")},u?.root.slotProps?.htmlInput)},native:b},v.slotProps?.baseSelect,p,u?.root,{children:_F({column:y,OptionComponent:v.slots.baseSelectOption,getOptionLabel:x,getOptionValue:w,isSelectNative:b,baseSelectOptionProps:v.slotProps?.baseSelectOption})})),c,l]})}const VF=["item","applyValue","type","apiRef","focusElementRef","slotProps"];function WF(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,slotProps:a}=e,l=d(e,VF),c=mm(),u=rP(),p=o.current.getColumn(t.field),h=p.getOptionValue,m=p.getOptionLabel,g=s.useCallback((e,t)=>h(e)===h(t),[h]),v=s.useMemo(()=>NF(p)||[],[p]),b=s.useMemo(()=>Array.isArray(t.value)?t.value.reduce((e,t)=>{const n=v.find(e=>h(e)===t);return null!=n&&e.push(n),e},[]):[],[h,t.value,v]),y=s.useCallback((e,r)=>{n(f({},t,{value:r.map(h)}))},[n,t,h]);if(!p||!AF(p))return null;const w=u.slots.baseAutocomplete;return Xp.jsx(w,f({multiple:!0,options:v,isOptionEqualToValue:g,id:c,value:b,onChange:y,getOptionLabel:m,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),slotProps:{textField:{type:r||"text",inputRef:i}}},l,a?.root))}const UF=e=>null!=e&&OI(e)?e.value:e,GF=f({},FO,{type:"singleSelect",getOptionLabel:e=>OI(e)?e.label:String(e),getOptionValue:e=>OI(e)?e.value:e,valueFormatter(e,t,n,r){const o=zD(r,t);if(!AF(n))return"";const i=NF(n,{id:o,row:t});if(null==e)return"";if(!i)return e;if("object"!=typeof i[0])return n.getOptionLabel(e);const a=i.find(t=>n.getOptionValue(t)===e);return a?n.getOptionLabel(a):""},renderEditCell:e=>Xp.jsx(jF,f({},e)),filterOperators:[{value:"is",getApplyFilterFn:e=>null==e.value||""===e.value?null:t=>UF(t)===UF(e.value),InputComponent:HF},{value:"not",getApplyFilterFn:e=>null==e.value||""===e.value?null:t=>UF(t)!==UF(e.value),InputComponent:HF},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||0===e.value.length)return null;const t=e.value.map(UF);return e=>t.includes(UF(e))},InputComponent:WF}],pastedValueParser:(e,t,n)=>{const r=n,o=NF(r)||[],i=r.getOptionValue;if(o.find(t=>i(t)===e))return e}}),KF=nT(e=>e.headerFiltering),qF=eT(KF,e=>e?.enabled??!1),YF=eT(KF,e=>e.editing),XF=eT(KF,e=>e.menuOpen),QF=nT(e=>e.columnGrouping),ZF=tT(QF,e=>e?.unwrappedGroupingModel??{}),JF=tT(QF,e=>e?.lookup??{}),eL=tT(QF,e=>e?.headerStructure??[]),tL=eT(QF,e=>e?.maxDepth??0),nL=["maxWidth","minWidth","width","flex"],rL={string:FO,number:LF,date:OF,dateTime:DF,boolean:dD,singleSelect:GF,[ZO]:JO,custom:FO};const oL=(e,t)=>{const n={};let r=0,o=0;const i=[];e.orderedFields.forEach(t=>{let a=e.lookup[t],l=0,s=!1;!1!==e.columnVisibilityModel[t]&&(a.flex&&a.flex>0?(r+=a.flex,s=!0):l=FI(a.width||FO.width,a.minWidth||FO.minWidth,a.maxWidth||FO.maxWidth),o+=l),a.computedWidth!==l&&(a=f({},a,{computedWidth:l})),s&&i.push(a),n[t]=a});const a=void 0===t?0:t.viewportOuterSize.width-(t.hasScrollY?t.scrollbarSize:0),l=Math.max(a-o,0);if(r>0&&a>0){const e=function({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const r=new Set(n.map(e=>e.field)),o={all:{},frozenFields:[],freeze:e=>{const t=o.all[e];t&&!0!==t.frozen&&(o.all[e].frozen=!0,o.frozenFields.push(e))}};return function i(){if(o.frozenFields.length===r.size)return;const a={min:{},max:{}};let l=e,s=t,c=0;o.frozenFields.forEach(e=>{l-=o.all[e].computedWidth,s-=o.all[e].flex});for(let e=0;e<n.length;e+=1){const t=n[e];if(o.all[t.field]&&!0===o.all[t.field].frozen)continue;let r=l/s*t.flex;r<t.minWidth?(c+=t.minWidth-r,r=t.minWidth,a.min[t.field]=!0):r>t.maxWidth&&(c+=t.maxWidth-r,r=t.maxWidth,a.max[t.field]=!0),o.all[t.field]={frozen:!1,computedWidth:r,flex:t.flex}}c<0?Object.keys(a.max).forEach(e=>{o.freeze(e)}):c>0?Object.keys(a.min).forEach(e=>{o.freeze(e)}):n.forEach(({field:e})=>{o.freeze(e)}),i()}(),o.all}({initialFreeSpace:l,totalFlexUnits:r,flexColumns:i});Object.keys(e).forEach(t=>{n[t]=f({},n[t],{computedWidth:e[t].computedWidth})})}return f({},e,{lookup:n})};function iL(e){let t=rL.string;return e&&rL[e]&&(t=rL[e]),t}const aL=({apiRef:e,columnsToUpsert:t,initialState:n,columnVisibilityModel:r=lO(e),keepOnlyColumnsToUpsert:o=!1,updateInitialVisibilityModel:i=!1})=>{const a=!e.current.state.columns;let l;if(a)l={orderedFields:[],lookup:{},columnVisibilityModel:r,initialColumnVisibilityModel:r};else{const t=rO(e);l={orderedFields:o?[]:[...t.orderedFields],lookup:f({},t.lookup),columnVisibilityModel:r,initialColumnVisibilityModel:i?r:t.initialColumnVisibilityModel}}const s={};if(o&&!a)for(const e in l.lookup)Object.prototype.hasOwnProperty.call(l.lookup,e)&&(s[e]=!1);t.forEach(e=>{const{field:t}=e;s[t]=!0;let n=l.lookup[t];null==n?(n=f({},iL(e.type),{field:t,hasBeenResized:!1}),l.orderedFields.push(t)):o&&l.orderedFields.push(t),n&&n.type!==e.type&&(n=f({},iL(e.type),{field:t}));let r=n.hasBeenResized;nL.forEach(t=>{void 0!==e[t]&&(r=!0,-1===e[t]&&(e[t]=1/0))}),l.lookup[t]=Hh(n,f({},iL(e.type),e,{hasBeenResized:r}))}),o&&!a&&Object.keys(l.lookup).forEach(e=>{s[e]||delete l.lookup[e]});const c=((e,t)=>{if(!t)return e;const{orderedFields:n=[],dimensions:r={}}=t,o=Object.keys(r);if(0===o.length&&0===n.length)return e;const i={},a=[];for(let t=0;t<n.length;t+=1){const r=n[t];e.lookup[r]&&(i[r]=!0,a.push(r))}const l=0===a.length?e.orderedFields:[...a,...e.orderedFields.filter(e=>!i[e])],s=f({},e.lookup);for(let e=0;e<o.length;e+=1){const t=o[e],n=f({},s[t],{hasBeenResized:!0});Object.entries(r[t]).forEach(([e,t])=>{n[e]=-1===t?1/0:t}),s[t]=n}return f({},e,{orderedFields:l,lookup:s})})(e.current.unstable_applyPipeProcessors("hydrateColumns",l),n);return oL(c,e.current.getRootDimensions?.()??void 0)};function lL(e,t){if(t.listView)return 0;const n=mI(e),r=tL(e),o=qF(e);return Math.floor(t.columnHeaderHeight*n)+Math.floor((t.columnGroupHeaderHeight??t.columnHeaderHeight)*n)*r+(o?Math.floor((t.headerFilterHeight??t.columnHeaderHeight)*n):0)}const sL=jh("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${XT["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${XT["scrollArea--right"]}`]:t["scrollArea--right"]},{[`&.${XT["scrollArea--up"]}`]:t["scrollArea--up"]},{[`&.${XT["scrollArea--down"]}`]:t["scrollArea--down"]},t.scrollArea]})(()=>({position:"absolute",zIndex:101,[`&.${XT["scrollArea--left"]}`]:{top:0,left:0,width:20,bottom:0},[`&.${XT["scrollArea--right"]}`]:{top:0,right:0,width:20,bottom:0},[`&.${XT["scrollArea--up"]}`]:{top:0,left:0,right:0,height:20},[`&.${XT["scrollArea--down"]}`]:{bottom:0,left:0,right:0,height:20}})),cL=eT(oT,(e,t)=>"left"===t?e.leftPinnedWidth:"right"===t?e.rightPinnedWidth+(e.hasScrollX?e.scrollbarSize:0):0);function uL(e){const{scrollDirection:t,scrollPosition:n}=e,r=s.useRef(null),o=lP(),i=Ng(),a=pI(o,mI),l=pI(o,iT),c=pI(o,cL,t),u=rP(),d=lL(o,u),p=Math.floor(u.columnHeaderHeight*a),h=f({height:p,top:d-p},"left"===t?{left:c}:{},"right"===t?{right:c}:{}),m=Mg(e=>{let a;if(e.preventDefault(),"left"===t)a=e.clientX-r.current.getBoundingClientRect().right;else{if("right"!==t)throw new Error("MUI X: Wrong drag direction");a=Math.max(1,e.clientX-r.current.getBoundingClientRect().left)}a=1.5*(a-1)+1,i.start(0,()=>{o.current.scroll({left:n.current.left+a,top:n.current.top})})});return Xp.jsx(pL,f({},e,{ref:r,getCanScrollMore:()=>{const e=oT(o);if("left"===t)return n.current.left>0;if("right"===t){const t=l-e.viewportInnerSize.width;return n.current.left<t}return!1},style:h,handleDragOver:m}))}function dL(e){const{scrollDirection:t,scrollPosition:n}=e,r=s.useRef(null),o=lP(),i=Ng(),a=pI(o,mT),l=rP(),c=lL(o,l),u={top:"up"===t?c:void 0,bottom:"down"===t?0:void 0},d=Mg(e=>{let a;if(e.preventDefault(),"up"===t)a=e.clientY-r.current.getBoundingClientRect().bottom;else{if("down"!==t)throw new Error("MUI X: Wrong drag direction");a=Math.max(1,e.clientY-r.current.getBoundingClientRect().top)}a=1.5*(a-1)+1,i.start(0,()=>{o.current.scroll({left:n.current.left,top:n.current.top+a})})});return Xp.jsx(pL,f({},e,{ref:r,getCanScrollMore:()=>{const e=oT(o);if("up"===t)return n.current.top>0;if("down"===t){const t=(a.currentPageTotalHeight||0)-e.viewportInnerSize.height-(e.hasScrollX?e.scrollbarSize:0);return n.current.top<t}return!1},style:u,handleDragOver:d}))}const pL=TR(function(e,t){const{scrollDirection:n,getCanScrollMore:r,style:o,handleDragOver:i}=e,a=lP(),[l,c]=s.useState(r),u=f({},rP(),{scrollDirection:n}),d=(e=>{const{scrollDirection:t,classes:n}=e;return wm({root:["scrollArea",`scrollArea--${t}`]},YT,n)})(u);return rI(a,"scrollPositionChange",()=>{c(r)}),l?Xp.jsx(sL,{ref:t,className:d.root,ownerState:u,onDragOver:i,style:o}):null}),fL=KT(function(e){const t=lP(),[n,r]=s.useState("none");return rI(t,"columnHeaderDragStart",()=>r("horizontal")),rI(t,"columnHeaderDragEnd",()=>r("none")),rI(t,"rowDragStart",()=>r("vertical")),rI(t,"rowDragEnd",()=>r("none")),"none"===n?null:"horizontal"===n?Xp.jsx(uL,f({},e)):Xp.jsx(dL,f({},e))}),hL=s.createContext(void 0);function mL(){const e=s.useContext(hL);if(void 0===e)throw new Error(["MUI X: Could not find the Data Grid private context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join("\n"));return e}const gL=()=>{};function vL(e,t,n){const r=s.useRef(!0);Wh(()=>{r.current=!1,e.current.register(n,t)},[e,n,t]),r.current&&e.current.register(n,t)}function bL(e,t){const n=s.useRef(null);if(n.current)return n.current;const r=e.current.getLogger(t);return n.current=r,r}const yL=(e,t,n,r,o)=>{const i=bL(e,"useNativeEventListener");iI(e,"rootMount",()=>{const e=t();if(e&&n)return i.debug(`Binding native ${n} event`),e.addEventListener(n,r,o),()=>{i.debug(`Clearing native ${n} event`),e.removeEventListener(n,r,o)}})};function wL(e){const t=s.useRef(!0);t.current&&(t.current=!1,e())}const xL=nT(e=>e.pivoting),SL=eT(xL,e=>e?.active),CL=new Map,kL=eT(xL,e=>e?.initialColumns||CL),EL=(e,t)=>{const n=pI(e,vT),r=pI(e,MD),o=pI(e,IT),i=pI(e,cO),a=0===n&&0===o,l=pI(e,bT),s=pI(e,SL),c=!l&&a,u=!l&&n>0&&0===r;let d=null,p=null;return c&&(d="noRowsOverlay"),!l&&0===i.length&&(d="noColumnsOverlay"),c&&s&&(d="emptyPivotOverlay"),u&&(d="noResultsOverlay"),l&&(d="loadingOverlay",p=t.slotProps?.loadingOverlay?.[a?"noRowsVariant":"variant"]??(a?"skeleton":"linear-progress")),{overlayType:d,loadingOverlayVariant:p}},RL=nT(e=>e.columnMenu);const PL=KT(function(){const e=mL(),t=rP(),n=pI(e,cO),r=pI(e,DD),o=pI(e,vD),i=pI(e,eF),a=pI(e,()=>null===JD(e)),l=pI(e,tF),s=pI(e,XD),c=pI(e,QD),u=pI(e,tL),d=pI(e,RL),p=pI(e,lO),h=pI(e,eL),m=!(null===l&&null===i&&a),g=e.current.columnHeadersContainerRef;return Xp.jsx(t.slots.columnHeaders,f({ref:g,visibleColumns:n,filterColumnLookup:r,sortColumnLookup:o,columnHeaderTabIndexState:i,columnGroupHeaderTabIndexState:l,columnHeaderFocus:s,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:d,columnVisibility:p,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:m},t.slotProps?.columnHeaders))}),ML=jh("div")({position:"absolute",top:"var(--DataGrid-headersTotalHeight)",left:0,width:"calc(100% - (var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))"}),TL=jh("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>{const{ownerState:n,loadingOverlayVariant:r,overlayType:o}=e,i="skeleton"===r||"noColumnsOverlay"===o;return[t.main,n.hasPinnedRight&&t["main--hasPinnedRight"],i&&t["main--hiddenContent"]]}})({flexGrow:1,position:"relative",overflow:"hidden",display:"flex",flexDirection:"column"}),IL=TR((e,t)=>{const{ownerState:n}=e,r=rP(),o=jO().hooks.useGridAriaAttributes();return Xp.jsxs(TL,f({ownerState:n,className:e.className,tabIndex:-1},o,r.slotProps?.main,{ref:t,children:[Xp.jsx(ML,{role:"presentation","data-id":"gridPanelAnchor"}),e.children]}))}),OL=jh("div")({position:"sticky",zIndex:40,top:0});function DL(e){const t=wm({root:["topContainer"]},YT,{});return Xp.jsx(OL,f({},e,{className:PR(t.root,XT["container--top"]),role:"presentation"}))}const FL=jh("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScrollerContent,n.overflowedContent&&t["virtualScrollerContent--overflowed"]]}})({}),LL=TR(function(e,t){const n=rP(),r=!n.autoHeight&&"auto"===e.style?.minHeight,o=((e,t)=>{const{classes:n}=e;return wm({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},YT,n)})(n,r),i={classes:n.classes,overflowedContent:r};return Xp.jsx(FL,f({},e,{ownerState:i,className:PR(o.root,e.className),ref:t}))}),AL=jh("div")({display:"flex",flexDirection:"row",width:"var(--DataGrid-rowWidth)",boxSizing:"border-box"}),NL=jh("div")({position:"sticky",height:"100%",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",backgroundColor:bP.cell.background.pinned}),$L=jh(NL)({left:0}),zL=jh(NL)({right:0}),jL=jh("div")({flexGrow:1,borderTop:"1px solid var(--rowBorderColor)"});const BL=KT(function({rowsLength:e}){const t=lP(),{viewportOuterSize:n,minimumSize:r,hasScrollX:o,hasScrollY:i,scrollbarSize:a,leftPinnedWidth:l,rightPinnedWidth:s}=pI(t,oT),c=o?a:0,u=n.height-r.height>0;return 0!==c||u?Xp.jsxs(AL,{className:XT.filler,role:"presentation",style:{height:c,"--rowBorderColor":0===e?"transparent":"var(--DataGrid-rowBorderColor)"},children:[l>0&&Xp.jsx($L,{className:XT["filler--pinnedLeft"],style:{width:l}}),Xp.jsx(jL,{}),s>0&&Xp.jsx(zL,{className:XT["filler--pinnedRight"],style:{width:s+(i?a:0)}})]}):null}),_L=jh("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone"})({position:"absolute",display:"flex",flexDirection:"column"}),HL=TR(function(e,t){const n=rP(),r=(e=>{const{classes:t}=e;return wm({root:["virtualScrollerRenderZone"]},YT,t)})(n);return Xp.jsx(_L,f({ownerState:n},e,{className:PR(r.root,e.className),ref:t}))}),VL={includeHeaders:!0,includeOutliers:!1,outliersFactor:1.5,expand:!1,disableColumnVirtualization:!0},WL=nT(e=>e.editRows),UL=eT(WL,(e,{rowId:t,editMode:n})=>n===$I.Row&&Boolean(e[t])),GL=eT(WL,(e,{rowId:t,field:n})=>e[t]?.[n]??null),KL=nT(e=>e.preferencePanel),qL=eT(KL,(e,t)=>!(!e.open||e.labelId!==t));var YL=function(e){return e.filters="filters",e.columns="columns",e.aiAssistant="aiAssistant",e}(YL||{});const XL={initialize:function(e){return{colspanMap:new Map}},use:function(e,t,n){const r=t.colspan?.getColspan,o=Mg(r?(t,n,o,i)=>{for(let a=n;a<o;a+=1){const l=QL(e.state.colspanMap,a,t,n,o,i,r);l.colSpan>1&&(a+=l.colSpan-1)}}:()=>{});return n.calculateColSpan=o,{resetColSpan:()=>{e.state.colspanMap=new Map},getCellColSpanInfo:(t,n)=>e.state.colspanMap.get(t)?.[n],calculateColSpan:o}},selectors:{}};function QL(e,t,n,r,o,i,a){const l=i.length,s=i[t],c=a(n,s,t);if(!c||1===c)return ZL(e,n,t,{spannedByColSpan:!1,cellProps:{colSpan:1,width:s.computedWidth}}),{colSpan:1};let u=s.computedWidth;for(let a=1;a<c;a+=1){const s=t+a;if(s>=r&&s<o){u+=i[s].computedWidth,ZL(e,n,t+a,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(t+c,l-1),leftVisibleCellIndex:t})}ZL(e,n,t,{spannedByColSpan:!1,cellProps:{colSpan:c,width:u}})}return{colSpan:c}}function ZL(e,t,n,r){let o=e.get(t);o||(o={},e.set(t,o)),o[n]=r}function JL(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r+=1)if(!JL(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;const n=Array.from(e.entries());for(let e=0;e<n.length;e+=1)if(!t.has(n[e][0]))return!1;for(let e=0;e<n.length;e+=1){const r=n[e];if(!JL(r[1],t.get(r[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;const n=Array.from(e.entries());for(let e=0;e<n.length;e+=1)if(!t.has(n[e][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r+=1)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;for(let e=0;e<r;e+=1)if(!Object.prototype.hasOwnProperty.call(t,n[e]))return!1;for(let o=0;o<r;o+=1){const r=n[o];if(!JL(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function eA(e,t){return Math.round(e*10**t)/10**t}const tA={EMPTY:{width:0,height:0},equals:(e,t)=>e.width===t.width&&e.height===t.height},nA={EMPTY:{top:[],bottom:[]}},rA={EMPTY:{left:[],right:[]}},oA={EMPTY:{top:0,left:0}};let iA=function(e){return e[e.NONE=0]="NONE",e[e.UP=1]="UP",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e[e.RIGHT=4]="RIGHT",e}({});(iA||(iA={})).forDelta=function(e,t){return 0===e&&0===t?iA.NONE:Math.abs(t)>=Math.abs(e)?t>0?iA.DOWN:iA.UP:e>0?iA.RIGHT:iA.LEFT};const aA={isReady:!1,root:tA.EMPTY,viewportOuterSize:tA.EMPTY,viewportInnerSize:tA.EMPTY,contentSize:tA.EMPTY,minimumSize:tA.EMPTY,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,topContainerHeight:0,bottomContainerHeight:0,autoHeight:!1,minimalContentHeight:void 0},lA={rootSize:e=>e.rootSize,dimensions:e=>e.dimensions,rowHeight:e=>e.dimensions.rowHeight,columnsTotalWidth:e=>e.dimensions.columnsTotalWidth,contentHeight:e=>e.dimensions.contentSize.height,autoHeight:e=>e.dimensions.autoHeight,minimalContentHeight:e=>e.dimensions.minimalContentHeight,rowsMeta:e=>e.rowsMeta,rowPositions:e=>e.rowsMeta.positions,columnPositions:NM((e,t)=>{const n=[];let r=0;for(let e=0;e<t.length;e+=1)n.push(r),r+=t[e].computedWidth;return n}),needsHorizontalScrollbar:e=>e.dimensions.viewportOuterSize.width>0&&e.dimensions.columnsTotalWidth>e.dimensions.viewportOuterSize.width},sA={initialize:function(e){const t=f({},aA,e.dimensions,{autoHeight:e.dimensions.autoHeight,minimalContentHeight:e.dimensions.minimalContentHeight}),{rowCount:n}=e,{rowHeight:r}=t,o={currentPageTotalHeight:n*r,positions:Array.from({length:n},(e,t)=>t*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0},i=new Map;return{rootSize:tA.EMPTY,dimensions:t,rowsMeta:o,rowHeights:i}},use:function(e,t,n){const r=s.useRef(!0),{layout:o,dimensions:{rowHeight:i,columnsTotalWidth:a,leftPinnedWidth:l,rightPinnedWidth:c,topPinnedHeight:u,bottomPinnedHeight:d},onResize:p}=t,h=s.useCallback(n=>{if(n&&(r.current=!1),r.current)return;const s=o.refs.container.current,f=lA.rootSize(e.state),h=lA.rowsMeta(e.state),m=function(e,t){if(void 0!==t)return t;if(null===e)return 0;const n=cA.get(e);if(void 0!==n)return n;const r=kg(e).createElement("div");r.style.width="99px",r.style.height="99px",r.style.position="absolute",r.style.overflow="scroll",r.className="scrollDiv",e.appendChild(r);const o=r.offsetWidth-r.clientWidth;return e.removeChild(r),cA.set(e,o),o}(s,t.dimensions.scrollbarSize),g=u+h.pinnedTopRowsTotalHeight,v=d+h.pinnedBottomRowsTotalHeight,b={width:a,height:eA(h.currentPageTotalHeight,1)};let y,w,x=!1,S=!1;if(t.dimensions.autoHeight)S=!1,x=Math.round(a)>Math.round(f.width),y={width:f.width,height:g+v+b.height},w={width:Math.max(0,y.width-(S?m:0)),height:Math.max(0,y.height-(x?m:0))};else{y={width:f.width,height:f.height},w={width:Math.max(0,y.width),height:Math.max(0,y.height-g-v)};const e=b,t=w,n=e.width>t.width,r=e.height>t.height;(n||r)&&(S=r,x=e.width+(S?m:0)>t.width,x&&(S=e.height+m>t.height)),S&&(w.width-=m),x&&(w.height-=m)}t.disableHorizontalScroll&&(x=!1),t.disableVerticalScroll&&(S=!1);const C=Math.max(y.width,a+(S?m:0)),k={isReady:!0,root:f,viewportOuterSize:y,viewportInnerSize:w,contentSize:b,minimumSize:{width:a,height:g+b.height+v},hasScrollX:x,hasScrollY:S,scrollbarSize:m,rowWidth:C,rowHeight:i,columnsTotalWidth:a,leftPinnedWidth:l,rightPinnedWidth:c,topContainerHeight:g,bottomContainerHeight:v,autoHeight:t.dimensions.autoHeight,minimalContentHeight:t.dimensions.minimalContentHeight};JL(e.state.dimensions,k)||(e.update({dimensions:k}),p?.(k.root))},[e,o.refs.container,t.dimensions.scrollbarSize,t.dimensions.autoHeight,t.dimensions.minimalContentHeight,t.disableHorizontalScroll,t.disableVerticalScroll,p,i,a,l,c,u,d]),{resizeThrottleMs:m}=t,g=Mg(h),v=s.useMemo(()=>m>0?function(e,t=166){let n,r;const o=()=>{n=void 0,e(...r)};function i(...e){r=e,void 0===n&&(n=setTimeout(o,t))}return i.clear=()=>{clearTimeout(n),n=void 0},i}(g,m):void 0,[m,g]);s.useEffect(()=>v?.clear,[v]),Wh(h,[h]),Wh(()=>{e.update({dimensions:f({},e.state.dimensions,{autoHeight:t.dimensions.autoHeight,minimalContentHeight:t.dimensions.minimalContentHeight})})},[e,t.dimensions.autoHeight,t.dimensions.minimalContentHeight]);const b=function(e,t,n){const r=e.state.rowHeights,{rows:o,getRowHeight:i,getRowSpacing:a,getEstimatedRowHeight:l}=t,c=s.useRef(-1),u=s.useRef(!1),d=s.useRef(!1),p=t.pinnedRows,f=YM(e,lA.rowHeight),h=Mg(t=>{let n=r.get(t);return void 0===n&&(n={content:e.state.dimensions.rowHeight,spacingTop:0,spacingBottom:0,detail:0,autoHeight:!1,needsFirstMeasurement:!0},r.set(t,n)),n}),{applyRowHeight:m}=t,g=s.useCallback(t=>{const n=lA.dimensions(e.state),r=n.rowHeight,o=h(t.id);if(i){const e=i(t);if("auto"===e){if(o.needsFirstMeasurement){const e=l?l(t):r;o.content=e??r}u.current=!0,o.autoHeight=!0}else o.content=e??n.rowHeight,o.needsFirstMeasurement=!1,o.autoHeight=!1}else o.content=r,o.needsFirstMeasurement=!1;if(a){const e=a(t);o.spacingTop=e.top??0,o.spacingBottom=e.bottom??0}else o.spacingTop=0,o.spacingBottom=0;return m?.(o,t),o},[e,i,h,l,f,a,m]),v=s.useCallback(()=>{u.current=!1;const t=p?.top.reduce((e,t)=>{const n=g(t);return e+n.content+n.spacingTop+n.spacingBottom+n.detail},0)??0,r=p?.bottom.reduce((e,t)=>{const n=g(t);return e+n.content+n.spacingTop+n.spacingBottom+n.detail},0)??0,i=[],a=o.reduce((e,t)=>{i.push(e);const n=g(t);return e+(n.content+n.spacingTop+n.spacingBottom+n.detail)},0);u.current||(c.current=1/0);const l=t!==e.state.rowsMeta.pinnedTopRowsTotalHeight||r!==e.state.rowsMeta.pinnedBottomRowsTotalHeight||a!==e.state.rowsMeta.currentPageTotalHeight,s={currentPageTotalHeight:a,positions:i,pinnedTopRowsTotalHeight:t,pinnedBottomRowsTotalHeight:r};e.set("rowsMeta",s),l&&n(),d.current=!0},[e,p,o,g,n]),b=Mg(v),y=t=>r.get(t)?.content??lA.rowHeight(e.state),w=(e,t)=>{const n=h(e),r=n.content!==t;n.needsFirstMeasurement=!1,n.content=t,d.current&&=!r},x=e=>r.get(e)?.autoHeight??!1,S=()=>c.current,C=e=>{u.current&&e>c.current&&(c.current=e)},k=()=>{r.clear(),v()},E=Dg(()=>"undefined"==typeof ResizeObserver?void 0:new ResizeObserver(e=>{for(let n=0;n<e.length;n+=1){const r=e[n],o=r.borderBoxSize&&r.borderBoxSize.length>0?r.borderBoxSize[0].blockSize:r.contentRect.height,i=r.target.__mui_id,a=t.focusedVirtualCell?.()?.id;if(a===i&&0===o)return;w(i,o)}d.current||requestAnimationFrame(()=>{b()})})).current,R=(e,t)=>(e.__mui_id=t,E?.observe(e),()=>E?.unobserve(e));return Wh(()=>{v()},[v]),{getRowHeight:y,setLastMeasuredRowIndex:C,storeRowHeightMeasurement:w,hydrateRowsMeta:v,observeRowHeight:R,rowHasAutoHeight:x,getRowHeightEntry:h,getLastMeasuredRowIndex:S,resetRowHeights:k}}(e,t,h);return{updateDimensions:h,debouncedUpdateDimensions:v,rowsMeta:b}},selectors:lA};const cA=new WeakMap;const uA=("undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"empty").includes("firefox"),dA="undefined"!=typeof window&&/jsdom|HappyDOM/.test(window.navigator.userAgent),pA=(e,t,n)=>Math.max(t,Math.min(n,e)),fA={top:0,left:0},hA=Object.freeze(new Map),mA={firstRowIndex:0,lastRowIndex:0,firstColumnIndex:0,lastColumnIndex:0},gA=(()=>{const e=AM(e=>e.virtualization.renderContext.firstRowIndex);return{store:AM(e=>e.virtualization),renderContext:AM(e=>e.virtualization.renderContext),enabledForRows:AM(e=>e.virtualization.enabledForRows),enabledForColumns:AM(e=>e.virtualization.enabledForColumns),offsetTop:AM(sA.selectors.rowPositions,e,(e,t)=>e[t]??0),context:AM(e=>e.virtualization.context),scrollPosition:AM(e=>e.virtualization.scrollPosition)}})(),vA={initialize:function(e){const t={virtualization:f({enabled:!dA,enabledForRows:!dA,enabledForColumns:!dA,renderContext:mA,props:e.layout.constructor.elements.reduce((e,t)=>(e[t],e),{}),context:{},scrollPosition:{current:oA.EMPTY}},e.initialState?.virtualization),getters:null};return t},use:function(e,t,n){const{layout:r,dimensions:{rowHeight:o,columnsTotalWidth:i=0},virtualization:{isRtl:a=!1,rowBufferPx:l=150,columnBufferPx:c=150},colspan:u,initialState:d,rows:p,range:h,columns:m,pinnedRows:g=nA.EMPTY,pinnedColumns:v=rA.EMPTY,onWheel:b,onTouchMove:y,onRenderContextChange:w,onScrollChange:x,scrollReset:S,renderRow:C,renderInfiniteLoadingTrigger:k}=t,E=g.bottom.length>0,[R,P]=s.useState(hA),M=s.useRef(!1),T=s.useRef(!1),I=YM(e,gA.renderContext),O=YM(e,gA.enabledForRows),D=YM(e,gA.enabledForColumns),F=YM(e,sA.selectors.contentHeight),L=s.useRef(d?.scroll??fA),A=s.useRef(!1),N=s.useRef(fA),$=s.useRef(mA),z=Ng(),j=s.useRef(void 0),B=Dg(()=>function(e,t,n,r,o){return{direction:iA.NONE,buffer:RA(e,iA.NONE,t,n,r,o)}}(a,l,c,15*o,300)).current,_=s.useCallback(t=>{kA(t,e.state.virtualization.renderContext)||e.set("virtualization",f({},e.state.virtualization,{renderContext:t,scrollPosition:{current:f({},L.current)}}));const n=sA.selectors.dimensions(e.state).isReady,r=t.firstRowIndex!==$.current.firstRowIndex||t.lastRowIndex!==$.current.lastRowIndex;n&&r&&($.current=t,w?.(t)),N.current=L.current},[e,w]),H=Mg(()=>{const i=r.refs.scroller.current;if(!i)return;const s=sA.selectors.dimensions(e.state),u=Math.ceil(s.contentSize.height-s.viewportInnerSize.height),d=Math.ceil(s.contentSize.width-s.viewportInnerSize.width),p={top:pA(i.scrollTop,0,u),left:a?pA(i.scrollLeft,-Math.abs(d),0):pA(i.scrollLeft,0,d)},h=p.left-L.current.left,m=p.top-L.current.top,g=0!==h||0!==m;L.current=p;const v=g?iA.forDelta(h,m):iA.NONE,b=Math.abs(L.current.top-N.current.top),y=Math.abs(L.current.left-N.current.left),w=b>=o||y>=50,x=B.direction!==v;if(!(w||x))return e.set("virtualization",f({},e.state.virtualization,{scrollPosition:{current:f({},L.current)}})),I;if(x)switch(v){case iA.NONE:case iA.LEFT:case iA.RIGHT:j.current=void 0;break;default:j.current=I}B.direction=v,B.buffer=RA(a,v,l,c,15*o,300);const S=wA(yA(e,t,n,O,D),L.current,B);return kA(S,I)||(So.flushSync(()=>{_(S)}),z.start(1e3,H)),S}),V=()=>{if(!sA.selectors.dimensions(e.state).isReady&&(O||D))return;const r=wA(yA(e,t,n,O,D),L.current,B);j.current=void 0,_(r)},W=Mg(V);QM(e,sA.selectors.dimensions,(e,t)=>{t.isReady&&V()}),Wh(()=>{M.current&&(V(),M.current=!1)});const U=Mg(()=>{if(A.current)return void(A.current=!1);const e=H();e&&x?.(L.current,e)}),G=s.useRef(null);Wh(()=>{T.current&&W()},[D,O,W]),Wh(()=>{r.refs.scroller.current&&(r.refs.scroller.current.scrollLeft=0)},[r.refs.scroller,S]),((e,t)=>{const n=s.useRef(!1);Wh(()=>n.current||!e?gL:(n.current=!0,t()),[n.current||e])})(I!==mA,()=>{if(x?.(L.current,I),T.current=!0,d?.scroll&&r.refs.scroller.current){const e=r.refs.scroller.current,{top:t,left:n}=d.scroll,o={top:!(t>0),left:!(n>0)};!o.left&&i&&(e.scrollLeft=n,o.left=!0,A.current=!0),!o.top&&F&&(e.scrollTop=t,A.current=!0),o.top&&o.left||(G.current=(r,i)=>{!o.left&&r&&(e.scrollLeft=n,o.left=!0,A.current=!0),!o.top&&i&&(e.scrollTop=t,o.top=!0,A.current=!0),o.left&&o.top&&(G.current=null)})}}),QM(e,sA.selectors.dimensions,V),Wh(()=>{r.refs.scroller&&G.current?.(i,F)},[r.refs.scroller,i,F]);const K=s.useRef(!0),q=bA(t=>{r.refs.container.current=t;const o=function(e,t,n){if(!e)return;const r=e.getBoundingClientRect(),o={width:eA(r.width,1),height:eA(r.height,1)};if(t.state.rootSize!==tA.EMPTY&&tA.equals(o,t.state.rootSize)||n(o),"undefined"==typeof ResizeObserver)return;const i=new ResizeObserver(([e])=>{if(!e)return;const r={width:eA(e.contentRect.width,1),height:eA(e.contentRect.height,1)};tA.equals(r,t.state.rootSize)||n(r)});return i.observe(e),()=>{i.disconnect()}}(t,e,t=>{0===t.width&&0===t.height&&0!==e.state.rootSize.height&&0!==e.state.rootSize.width||(e.state.rootSize=t,K.current||!n.debouncedUpdateDimensions?(n.updateDimensions(K.current),K.current=!1):n.debouncedUpdateDimensions())});return()=>{o?.(),r.refs.container.current=null}}),Y=bA(e=>{r.refs.scroller.current=e;const t={passive:!0};return e.addEventListener("scroll",U,t),e.addEventListener("wheel",b,t),e.addEventListener("touchmove",y,t),()=>{e.removeEventListener("scroll",U,t),e.removeEventListener("wheel",b,t),e.removeEventListener("touchmove",y,t),r.refs.scroller.current=null}}),X={containerRef:q,scrollerRef:Y},Q=r.use(e,t,n,X),Z=f({setPanels:P,getRows:(r={},o)=>{if(!r.rows&&!h)return[];let a=I;r.renderContext&&(a=r.renderContext,a.firstColumnIndex=I.firstColumnIndex,a.lastColumnIndex=I.lastColumnIndex);const l=!E&&void 0===r.position||E&&"bottom"===r.position,s=void 0!==r.position;let c;switch(r.position){case"top":c=0;break;case"bottom":c=g.top.length+p.length;break;default:c=g.top.length}const d=r.rows??p,f=a.firstRowIndex,b=Math.min(a.lastRowIndex,d.length),y=r.rows?PA(0,r.rows.length):PA(f,b);let w=-1;const x=t.focusedVirtualCell?.();!s&&x&&(x.rowIndex<f&&(y.unshift(x.rowIndex),w=x.rowIndex),x.rowIndex>b&&(y.push(x.rowIndex),w=x.rowIndex));const S=[],P=sA.selectors.columnPositions(e.state,m);return y.forEach(e=>{const{id:t,model:f}=d[e];if(o&&!o[t])return;const g=(h?.firstRowIndex||0)+c+e;if(u?.enabled){const e=v.left.length,r=m.length-v.right.length;n.calculateColSpan(t,e,r,m),v.left.length>0&&n.calculateColSpan(t,0,v.left.length,m),v.right.length>0&&n.calculateColSpan(t,m.length-v.right.length,m.length,m)}const b=n.rowsMeta.rowHasAutoHeight(t)?"auto":n.rowsMeta.getRowHeight(t);let y=!1;void 0===r.position&&(y=0===e);let E=!1;const M=e===d.length-1;l&&(s?E=M:e===p.length-1&&(E=!0));let T=a;j.current&&e>=j.current.firstRowIndex&&e<j.current.lastRowIndex&&(T=j.current);const I=e===w,O=x?.rowIndex===g,D=EA(P,T,v.left.length),F=M&&"top"===r.position,L=T.firstColumnIndex,A=T.lastColumnIndex;if(S.push(C({id:t,model:f,rowIndex:g,offsetLeft:D,columnsTotalWidth:i,baseRowHeight:b,firstColumnIndex:L,lastColumnIndex:A,focusedColumnIndex:O?x.columnIndex:void 0,isFirstVisible:y,isLastVisible:E,isVirtualFocusRow:I,showBottomBorder:F})),I)return;const N=R.get(t);N&&S.push(N),void 0===r.position&&M&&k&&S.push(k(t))}),S},rows:t.rows},Q);return f({getters:Z,setPanels:P,forceUpdateRenderContext:V,scheduleUpdateRenderContext:()=>{M.current=!0}},{getCellColSpanInfo:()=>{throw new Error("Unimplemented: colspan feature is required")},calculateColSpan:()=>{throw new Error("Unimplemented: colspan feature is required")},getHiddenCellsOrigin:()=>{throw new Error("Unimplemented: rowspan feature is required")}})},selectors:gA};function bA(e){const t=s.useRef(void 0),n=Mg(n=>{if(n)return t.current=e(n),MR>=19?t.current:void 0;t.current?.()});return n}function yA(e,t,n,r,o){const i=sA.selectors.dimensions(e.state),a=t.rows,l=t.range,s=t.columns,c=n.getHiddenCellsOrigin(),u=t.rows.at(-1)?.id,d=s.at(-1);return{api:n,enabledForRows:r,enabledForColumns:o,autoHeight:i.autoHeight,rowBufferPx:t.virtualization.rowBufferPx,columnBufferPx:t.virtualization.columnBufferPx,leftPinnedWidth:i.leftPinnedWidth,columnsTotalWidth:i.columnsTotalWidth,viewportInnerWidth:i.viewportInnerSize.width,viewportInnerHeight:i.viewportInnerSize.height,lastRowHeight:void 0!==u?n.rowsMeta.getRowHeight(u):0,lastColumnWidth:d?.computedWidth??0,rowsMeta:sA.selectors.rowsMeta(e.state),columnPositions:sA.selectors.columnPositions(e.state,t.columns),rows:a,range:l,pinnedColumns:t.pinnedColumns,columns:s,hiddenCellsOriginMap:c,virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight}}function wA(e,t,n){const r={firstRowIndex:0,lastRowIndex:e.rows.length,firstColumnIndex:0,lastColumnIndex:e.columns.length},{top:o,left:i}=t,a=Math.abs(i)+e.leftPinnedWidth;if(e.enabledForRows){let t=Math.min(xA(e,o,{atStart:!0,lastPosition:e.rowsMeta.positions[e.rowsMeta.positions.length-1]+e.lastRowHeight}),e.rowsMeta.positions.length-1);const n=e.hiddenCellsOriginMap[t];if(n){const e=Math.min(...Object.values(n));t=Math.min(t,e)}const i=e.autoHeight?t+e.rows.length:xA(e,o+e.viewportInnerHeight);r.firstRowIndex=t,r.lastRowIndex=i}if(e.enabledForColumns){let t=0,o=e.columnPositions.length,i=!1;const[l,s]=CA({firstIndex:r.firstRowIndex,lastIndex:r.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight});if(!e.virtualizeColumnsWithAutoRowHeight)for(let t=l;t<s&&!i;t+=1){const n=e.rows[t];i=e.api.rowsMeta.rowHasAutoHeight(n.id)}i&&!e.virtualizeColumnsWithAutoRowHeight||(t=SA(a,e.columnPositions,{atStart:!0,lastPosition:e.columnsTotalWidth}),o=SA(a+e.viewportInnerWidth,e.columnPositions)),r.firstColumnIndex=t,r.lastColumnIndex=o}const l=function(e,t,n){const[r,o]=CA({firstIndex:t.firstRowIndex,lastIndex:t.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight}),[i,a]=CA({firstIndex:t.firstColumnIndex,lastIndex:t.lastColumnIndex,minFirstIndex:e.pinnedColumns?.left.length??0,maxLastIndex:e.columns.length-(e.pinnedColumns?.right.length??0),bufferBefore:n.buffer.columnBefore,bufferAfter:n.buffer.columnAfter,positions:e.columnPositions,lastSize:e.lastColumnWidth}),l=function({api:e,firstColumnToRender:t,firstRowToRender:n,lastRowToRender:r,visibleRows:o}){let i=t,a=!1;for(;!a&&i>=0;){a=!0;for(let t=n;t<r;t+=1){if(o[t]){const n=o[t].id,r=e.getCellColSpanInfo(n,i);if(r&&r.spannedByColSpan&&r.leftVisibleCellIndex<i){i=r.leftVisibleCellIndex,a=!1;break}}}}return i}({api:e.api,firstColumnToRender:i,firstRowToRender:r,lastRowToRender:o,visibleRows:e.rows});return{firstRowIndex:r,lastRowIndex:o,firstColumnIndex:l,lastColumnIndex:a}}(e,r,n);return l}function xA(e,t,n){const r=e.api.rowsMeta.getLastMeasuredRowIndex();let o=r===1/0;e.range?.lastRowIndex&&!o&&(o=r>=e.range.lastRowIndex);const i=pA(r-(e.range?.firstRowIndex||0),0,e.rowsMeta.positions.length);return o||e.rowsMeta.positions[i]>=t?SA(t,e.rowsMeta.positions,n):function(e,t,n,r){let o=1;for(;n<t.length&&Math.abs(t[n])<e;)n+=o,o*=2;return SA(e,t,r,Math.floor(n/2),Math.min(n,t.length))}(t,e.rowsMeta.positions,i,n)}function SA(e,t,n=void 0,r=0,o=t.length){if(t.length<=0)return-1;if(r>=o)return r;const i=r+Math.floor((o-r)/2),a=t[i];let l;if(n?.atStart){l=e-((i===t.length-1?n.lastPosition:t[i+1])-a)<a}else l=e<=a;return l?SA(e,t,n,r,i):SA(e,t,n,i+1,o)}function CA({firstIndex:e,lastIndex:t,bufferBefore:n,bufferAfter:r,minFirstIndex:o,maxLastIndex:i,positions:a,lastSize:l}){const s=a[e]-n,c=a[t]+r,u=SA(s,a,{atStart:!0,lastPosition:a[a.length-1]+l}),d=SA(c,a);return[pA(u,o,i),pA(d,o,i)]}function kA(e,t){return e===t||e.firstRowIndex===t.firstRowIndex&&e.lastRowIndex===t.lastRowIndex&&e.firstColumnIndex===t.firstColumnIndex&&e.lastColumnIndex===t.lastColumnIndex}function EA(e,t,n){const r=(e[t.firstColumnIndex]??0)-(e[n]??0);return Math.abs(r)}function RA(e,t,n,r,o,i){if(e)switch(t){case iA.LEFT:t=iA.RIGHT;break;case iA.RIGHT:t=iA.LEFT}switch(t){case iA.NONE:return{rowAfter:n,rowBefore:n,columnAfter:r,columnBefore:r};case iA.LEFT:return{rowAfter:0,rowBefore:0,columnAfter:0,columnBefore:i};case iA.RIGHT:return{rowAfter:0,rowBefore:0,columnAfter:i,columnBefore:0};case iA.UP:return{rowAfter:0,rowBefore:o,columnAfter:0,columnBefore:0};case iA.DOWN:return{rowAfter:o,rowBefore:0,columnAfter:0,columnBefore:0};default:throw new Error("unreachable")}}function PA(e,t){return Array.from({length:t-e}).map((t,n)=>e+n)}class MA{static elements=["scroller","container"];constructor(e){this.refs=e}refSetter(e){return t=>{t&&this.refs[e].current!==t&&(this.refs[e].current=t)}}}class TA extends MA{static elements=["scroller","container","content","positioner","scrollbarVertical","scrollbarHorizontal"];use(e,t,n,r){const{scrollerRef:o,containerRef:i}=r,a=Mg(this.refSetter("scrollbarVertical")),l=Mg(this.refSetter("scrollbarHorizontal"));e.state.virtualization.context={scrollerRef:o,containerRef:i,scrollbarVerticalRef:a,scrollbarHorizontalRef:l}}static selectors=(()=>({containerProps:NM(vA.selectors.context,e=>({ref:e.containerRef})),scrollerProps:NM(vA.selectors.context,sA.selectors.autoHeight,sA.selectors.needsHorizontalScrollbar,(e,t,n)=>({ref:e.scrollerRef,style:{overflowX:n?void 0:"hidden",overflowY:t?"hidden":void 0},role:"presentation",tabIndex:uA?-1:void 0})),contentProps:NM(sA.selectors.contentHeight,sA.selectors.minimalContentHeight,sA.selectors.columnsTotalWidth,sA.selectors.needsHorizontalScrollbar,(e,t,n,r)=>({style:{width:r?n:"auto",flexBasis:0===e?t:e,flexShrink:0},role:"presentation"})),positionerProps:NM(vA.selectors.offsetTop,e=>({style:{transform:`translate3d(0, ${e}px, 0)`}})),scrollbarHorizontalProps:NM(vA.selectors.context,vA.selectors.scrollPosition,(e,t)=>({ref:e.scrollbarHorizontalRef,scrollPosition:t})),scrollbarVerticalProps:NM(vA.selectors.context,vA.selectors.scrollPosition,(e,t)=>({ref:e.scrollbarVerticalRef,scrollPosition:t})),scrollAreaProps:NM(vA.selectors.scrollPosition,e=>({scrollPosition:e}))}))()}class IA extends TA{use(e,t,n,r){super.use(e,t,n,r);const o=e.use(TA.selectors.containerProps),i=e.use(TA.selectors.scrollerProps),a=e.use(TA.selectors.contentProps),l=e.use(TA.selectors.positionerProps),s=e.use(TA.selectors.scrollbarVerticalProps),c=e.use(TA.selectors.scrollbarHorizontalProps),u=e.use(TA.selectors.scrollAreaProps);return{getContainerProps:()=>o,getScrollerProps:()=>i,getContentProps:()=>a,getPositionerProps:()=>l,getScrollbarVerticalProps:()=>s,getScrollbarHorizontalProps:()=>c,getScrollAreaProps:()=>u}}}NM(vA.selectors.context,sA.selectors.autoHeight,sA.selectors.needsHorizontalScrollbar,(e,t,n)=>({ref:e.mergedRef,style:{overflowX:n?void 0:"hidden",overflowY:t?"hidden":void 0,position:"relative"},role:"presentation",tabIndex:uA?-1:void 0})),NM(sA.selectors.contentHeight,e=>({style:{position:"absolute",display:"inline-block",width:"100%",height:e,top:0,left:0,zIndex:-1},role:"presentation"})),NM(vA.selectors.offsetTop,e=>({style:{height:e}}));const OA={initialize:function(e){return{}},use:function(e,t,n){return{getViewportPageSize:()=>{const n=sA.selectors.dimensions(e.state);if(!n.isReady)return 0;if(t.getRowHeight){const n=vA.selectors.renderContext(e.state),r=n.lastRowIndex-n.firstRowIndex;return Math.min(r-1,t.rows.length)}const r=Math.floor(n.viewportInnerSize.height/n.rowHeight);return Math.min(r,t.rows.length)}}},selectors:{}};const DA={firstRowIndex:0,lastRowIndex:0},FA={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},LA={state:e=>e.rowSpanning,hiddenCells:e=>e.rowSpanning.caches.hiddenCells,spannedCells:e=>e.rowSpanning.caches.spannedCells,hiddenCellsOriginMap:e=>e.rowSpanning.caches.hiddenCellOriginMap},AA={initialize:function(e){return{rowSpanning:e.initialState?.rowSpanning??{caches:FA,processedRange:DA}}},use:function(e,t,n){return{getHiddenCellsOrigin:()=>LA.hiddenCellsOriginMap(e.state)}},selectors:LA};const NA={resizeThrottleMs:100,columns:[{field:"DEFAULT_COLUMN"}],dimensions:{autoHeight:!1,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,topPinnedHeight:0,bottomPinnedHeight:0},virtualization:{isRtl:!1,rowBufferPx:150,columnBufferPx:150}},$A=[sA,vA,XL,AA,OA],zA=e=>{const t=jA(e,NA),n=Dg(()=>new JM($A.map(e=>e.initialize(t)).reduce((e,t)=>Object.assign(e,t),{}))).current,r={};for(const e of $A)Object.assign(r,e.use(n,t,r));return{store:n,api:r}};function jA(e,t){const n=f({},e);for(const r in t)if(Object.hasOwn(t,r)){const o=t[r];null===o||"object"!=typeof o||Array.isArray(o)?n[r]=e[r]??o:n[r]=jA(e[r]??{},o)}return n}const BA=!("undefined"!=typeof window&&/jsdom|HappyDOM/.test(window.navigator.userAgent)),_A=(e,t)=>{const{disableVirtualization:n,autoHeight:r}=t;return f({},e,{virtualization:{enabled:!n&&BA,enabledForColumns:!n&&BA,enabledForRows:!n&&!r&&BA,renderContext:mA}})};const HA=nT(e=>e.virtualization);eT(HA,e=>e.enabled);const VA=eT(HA,e=>e.enabledForColumns);eT(HA,e=>e.enabledForRows);const WA=eT(HA,e=>e.renderContext),UA=tT(nT(e=>e.virtualization.renderContext.firstColumnIndex),nT(e=>e.virtualization.renderContext.lastColumnIndex),(e,t)=>({firstColumnIndex:e,lastColumnIndex:t}));function GA(e){return JSON.stringify([e.filterModel,e.sortModel,e.start,e.end])}class KA{constructor({ttl:e=3e5,getKey:t=GA}){this.cache={},this.ttl=e,this.getKey=t}set(e,t){const n=this.getKey(e),r=Date.now()+this.ttl;this.cache[n]={value:t,expiry:r}}get(e){const t=this.getKey(e),n=this.cache[t];if(n){if(!(Date.now()>n.expiry))return n.value;delete this.cache[t]}}clear(){this.cache={}}}class qA extends Error{constructor(e){super(e.message),this.name="GridGetRowsError",this.params=e.params,this.cause=e.cause}}class YA extends Error{constructor(e){super(e.message),this.name="GridUpdateRowError",this.params=e.params,this.cause=e.cause}}const XA="calc(max(var(--DataGrid-scrollbarSize), 14px))",QA=jh("div")({position:"absolute",display:"inline-block",zIndex:60,"&:hover":{zIndex:70},"--size":XA}),ZA=jh(QA)({width:"var(--size)",height:"calc(var(--DataGrid-hasScrollY) * (100% - var(--DataGrid-headersTotalHeight) - var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize)))",overflowY:"auto",overflowX:"hidden",outline:0,"& > div":{width:"var(--size)"},top:"var(--DataGrid-headersTotalHeight)",right:0}),JA=jh(QA)({width:"calc(var(--DataGrid-hasScrollX) * (100% - var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))",height:"var(--size)",overflowY:"hidden",overflowX:"auto",outline:0,"& > div":{height:"var(--size)"},bottom:0}),eN=jh(QA)({width:"var(--size)",height:"var(--size)",right:0,bottom:0,overflow:"scroll","@media print":{display:"none"}}),tN=TR(function(e,t){const n=mL(),r=rP(),o=s.useRef(!1),i=s.useRef(0),a=s.useRef(null),l=((e,t)=>{const{classes:n}=e;return wm({root:["scrollbar",`scrollbar--${t}`],content:["scrollbarContent"]},YT,n)})(r,e.position),c=pI(n,oT),u="vertical"===e.position?"height":"width",d="vertical"===e.position?"scrollTop":"scrollLeft",p="vertical"===e.position?"top":"left",f="horizontal"===e.position?c.minimumSize.width:c.minimumSize.height-c.headersTotalHeight,h=Mg(()=>{const t=a.current,n=e.scrollPosition.current;t&&n[p]!==i.current&&(i.current=n[p],o.current?o.current=!1:(o.current=!0,t[d]=e.scrollPosition.current[p]))}),m=Mg(()=>{const e=n.current.virtualScrollerRef.current,t=a.current;t&&(o.current?o.current=!1:(o.current=!0,e[d]=t[d]))});Lg(()=>{const e=n.current.virtualScrollerRef.current,t=a.current,r={passive:!0};return e.addEventListener("scroll",h,r),t.addEventListener("scroll",m,r),()=>{e.removeEventListener("scroll",h,r),t.removeEventListener("scroll",m,r)}});const g="vertical"===e.position?ZA:JA,v=s.useMemo(()=>({[u]:`${f}px`}),[u,f]);return Xp.jsx(g,{ref:Tg(t,a),className:l.root,tabIndex:-1,"aria-hidden":"true",onFocus:e=>{e.target.blur()},children:Xp.jsx("div",{className:l.content,style:v})})}),nN=jh("div",{name:"MuiDataGrid",slot:"ScrollShadow",overridesResolver:(e,t)=>[t.root,t[e.position]]})(({theme:e})=>({position:"absolute",inset:0,pointerEvents:"none",transition:bP.transition(["box-shadow"],{duration:bP.transitions.duration.short}),"--length":"dark"===e.palette.mode?"8px":"6px","--length-inverse":"calc(var(--length) * -1)","--opacity":"dark"===e.palette.mode?"0.7":"0.18","--blur":"var(--length)","--spread":"calc(var(--length) * -1)","--color":"0, 0, 0","--color-start":"rgba(var(--color), calc(var(--hasScrollStart) * var(--opacity)))","--color-end":"rgba(var(--color), calc(var(--hasScrollEnd) * var(--opacity)))",variants:[{props:{position:"vertical"},style:{top:"var(--DataGrid-topContainerHeight)",bottom:"calc(var(--DataGrid-bottomContainerHeight) + var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))",boxShadow:"inset 0 var(--length) var(--blur) var(--spread) var(--color-start), inset 0 var(--length-inverse) var(--blur) var(--spread) var(--color-end)"}},{props:{position:"horizontal"},style:{left:"var(--DataGrid-leftPinnedWidth)",right:"calc(var(--DataGrid-rightPinnedWidth) + var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",boxShadow:"inset var(--length) 0 var(--blur) var(--spread) var(--color-start), inset var(--length-inverse) 0 var(--blur) var(--spread) var(--color-end)"}}]}));function rN(e){const{position:t}=e,n={classes:rP().classes,position:t},r=(e=>{const{classes:t,position:n}=e;return wm({root:["scrollShadow",`scrollShadow--${n}`]},YT,t)})(n),o=s.useRef(null),i=mL(),a=pI(i,lT),l=pI(i,sT),c=pI(i,TT),u=pI(i,dO),d="vertical"===t?l&&c?.bottom?.length>0:a&&void 0!==u?.right?.length&&u?.right?.length>0,p=um(),f=s.useCallback(e=>{if(!o.current)return;const n=Math.abs(Math.round(e)),r=oT(i),a=Math.round(r.contentSize["vertical"===t?"height":"width"]-r.viewportInnerSize["vertical"===t?"height":"width"]),l="vertical"===t?c?.top?.length>0:void 0!==u?.left?.length&&u?.left?.length>0,s="vertical"===t?c?.bottom?.length>0:void 0!==u?.right?.length&&u?.right?.length>0,d=p?n<a:n>0,f=p?n>0:n<a;o.current.style.setProperty("--hasScrollStart",l&&d?"1":"0"),o.current.style.setProperty("--hasScrollEnd",s&&f?"1":"0")},[c,u,p,t,i]);return rI(i,"scrollPositionChange",e=>{f(e["vertical"===t?"top":"left"])}),rI(i,"columnResizeStop",()=>{"horizontal"===t&&f(i.current.virtualScrollerRef?.current?.scrollLeft||0)}),s.useEffect(()=>{f(("horizontal"===t?i.current.virtualScrollerRef?.current?.scrollLeft:i.current.virtualScrollerRef?.current?.scrollTop)??0)},[f,i,t]),Xp.jsx(nN,{className:r.root,ownerState:n,ref:o,style:{"--hasScrollStart":0,"--hasScrollEnd":d?"1":"0"}})}const oN=jh("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>"overlayType"!==e&&"loadingOverlayVariant"!==e&&"right"!==e})(({overlayType:e,loadingOverlayVariant:t,right:n})=>"skeleton"!==t?{position:"sticky",top:"var(--DataGrid-headersTotalHeight)",left:0,right:`${n}px`,width:0,height:0,zIndex:"loadingOverlay"===e?5:4}:{}),iN=jh("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>"overlayType"!==e&&"loadingOverlayVariant"!==e})({});function aN(e){const t=lP(),n=rP(),r=pI(t,oT);let o=Math.max(r.viewportOuterSize.height-r.topContainerHeight-r.bottomContainerHeight-(r.hasScrollX?r.scrollbarSize:0),0);0===o&&(o=HT);const i=(e=>{const{classes:t}=e;return wm({root:["overlayWrapper"],inner:["overlayWrapperInner"]},YT,t)})(f({},e,{classes:n.classes}));return Xp.jsx(oN,f({className:i.root},e,{right:r.columnsTotalWidth-r.viewportOuterSize.width,children:Xp.jsx(iN,f({className:i.inner,style:{height:o,width:r.viewportOuterSize.width}},e))}))}const lN=(e,t)=>gF(e),sN=(e,t)=>pI(e,gF),cN=eT(YD,WA,gF,cO,(e,t,n,r)=>{if(!e)return!1;const o=n.rowIdToIndexMap.get(e.id),i=r.slice(t.firstColumnIndex,t.lastColumnIndex).findIndex(t=>t.field===e.field);return!(void 0!==o&&-1!==i&&o>=t.firstRowIndex&&o<=t.lastRowIndex)}),uN=tT(cN,cO,gF,YD,(e,t,n,r)=>{if(!e)return null;const o=n.rowIdToIndexMap.get(r.id);if(void 0===o)return null;const i=t.findIndex(e=>e.field===r.field);return-1===i?null:f({},r,{rowIndex:o,columnIndex:i})}),dN={autoHeight:!1,autoPageSize:!1,autosizeOnMount:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,clipboardCopyCellDelimiter:"\t",columnBufferPx:150,columnFilterDebounceMs:150,columnHeaderHeight:56,disableAutosize:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnReorder:!1,disableColumnResize:!1,disableColumnSelector:!1,disableColumnSorting:!1,disableDensitySelector:!1,disableEval:!1,disableMultipleColumnsFiltering:!1,disableMultipleColumnsSorting:!1,disableMultipleRowSelection:!1,disableRowSelectionOnClick:!1,disableRowSelectionExcludeModel:!1,disableVirtualization:!1,editMode:$I.Cell,filterDebounceMs:150,filterMode:"client",hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,ignoreValueFormatterDuringExport:!1,keepColumnPositionIfDraggedOutside:!1,keepNonExistentRowsSelected:!1,loading:!1,logger:console,logLevel:"error",pageSizeOptions:[25,50,100],pagination:!1,paginationMode:"client",resizeThrottleMs:60,rowBufferPx:150,rowHeight:52,rows:[],rowSelection:!0,rowSpacingType:"margin",rowSpanning:!1,showCellVerticalBorder:!1,showColumnVerticalBorder:!1,showToolbar:!1,sortingMode:"client",sortingOrder:["asc","desc",null],throttleRowsMs:0,virtualizeColumnsWithAutoRowHeight:!1,tabNavigation:"none"},pN=(e,t,n,r=!0)=>{const o=s.useRef(null),i=s.useRef(`mui-${Math.round(1e9*Math.random())}`),a=s.useCallback(()=>{o.current=e.current.registerPipeProcessor(t,i.current,n)},[e,n,t]);wL(()=>{r&&a()});const l=s.useRef(!0);s.useEffect(()=>(l.current?l.current=!1:r&&a(),()=>{o.current&&(o.current(),o.current=null)}),[a,r])},fN=(e,t,n)=>{const r=s.useRef(null),o=s.useRef(`mui-${Math.round(1e9*Math.random())}`),i=s.useCallback(()=>{r.current=e.current.registerPipeApplier(t,o.current,n)},[e,n,t]);wL(()=>{i()});const a=s.useRef(!0);s.useEffect(()=>(a.current?a.current=!1:i(),()=>{r.current&&(r.current(),r.current=null)}),[i])},hN=(e,t,n)=>{const r=aT(n),o=vT(n),i=iF(n),a=Math.min(i.enabled?i.paginationModel.pageSize:o,o);return f({},e,{rowsMeta:{currentPageTotalHeight:a*r,positions:Array.from({length:a},(e,t)=>t*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0}})},mN=eT(cO,hO,(e,t)=>{const n=e.length;return 0===n?0:eA(t[n-1]+e[n-1].computedWidth,1)}),gN=()=>PM((e,t,n,r,o)=>f({},e,{headerHeight:t,groupHeaderHeight:n,headerFilterHeight:r,headersTotalHeight:o}),{maxSize:1});function vN(){const e=um(),t=rP(),n=mL(),{listView:r}=t,o=pI(n,cO),i=pI(n,TT),a=pO(n),l=pI(n,AD),c=s.useCallback(e=>l.has(e)&&n.current.isRowSelectable(e),[l,n]),u=sN(n),d=pI(n,vO),p=pI(n,fT),h=pI(n,cT),{autoHeight:m}=t,g=r,v=pI(n,mI),b=WT(t.rowHeight,dN.rowHeight),y=Math.floor(b*v),w=Math.floor(t.columnHeaderHeight*v),x=Math.floor((t.columnGroupHeaderHeight??t.columnHeaderHeight)*v),S=Math.floor((t.headerFilterHeight??t.columnHeaderHeight)*v),C=pI(n,mN),k=lL(n,t),E=a.left.reduce((e,t)=>e+t.computedWidth,0),R=a.right.reduce((e,t)=>e+t.computedWidth,0),P=EL(n,t),M={rowHeight:y,headerHeight:w,columnsTotalWidth:C,leftPinnedWidth:E,rightPinnedWidth:R,topPinnedHeight:k,bottomPinnedHeight:0,autoHeight:m,minimalContentHeight:HT,scrollbarSize:t.scrollbarSize},T=Dg(gN).current,I=pI(n,vT),O=pI(n,iF),D=Math.min(O.enabled?O.paginationModel.pageSize:I,I),{getRowHeight:F,getEstimatedRowHeight:L,getRowSpacing:A}=t,N=t.slots.row,$=t.slotProps?.row;pI(n,uN);const z=Dg(()=>new IA({container:n.current.mainElementRef,scroller:n.current.virtualScrollerRef,scrollbarVertical:n.current.virtualScrollbarVerticalRef,scrollbarHorizontal:n.current.virtualScrollbarHorizontalRef})).current,j=zA({layout:z,dimensions:M,virtualization:{isRtl:e,rowBufferPx:t.rowBufferPx,columnBufferPx:t.columnBufferPx},colspan:{enabled:d,getColspan:s.useCallback((e,t)=>{if("function"==typeof t.colSpan){const r=n.current.getRow(e),o=n.current.getRowValue(r,t);return t.colSpan(o,r,t,n)??0}return t.colSpan??1},[n])},initialState:{scroll:t.initialState?.scroll,rowSpanning:n.current.state.rowSpanning,virtualization:n.current.state.virtualization},rows:u.rows,range:u.range,rowCount:D,columns:o,pinnedRows:i,pinnedColumns:a,disableHorizontalScroll:r,disableVerticalScroll:"noColumnsOverlay"===P.overlayType||"skeleton"===P.loadingOverlayVariant,getRowHeight:s.useMemo(()=>{if(F)return e=>F(f({},e,{densityFactor:v}))},[F,v]),getEstimatedRowHeight:s.useMemo(()=>L?e=>L(f({},e,{densityFactor:v})):void 0,[L,v]),getRowSpacing:s.useMemo(()=>A?e=>{const t=u.rowIdToIndexMap.get(e.id)??-1,r={isFirstVisible:0===t,isLastVisible:t===u.rows.length-1,indexRelativeToCurrentPage:t};return A(f({},e,r,{indexRelativeToCurrentPage:n.current.getRowIndexRelativeToVisibleRows(e.id)}))}:void 0,[n,A,u.rows,u.rowIdToIndexMap]),applyRowHeight:Mg((e,t)=>n.current.unstable_applyPipeProcessors("rowHeight",e,t)),virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight,focusedVirtualCell:Mg(()=>uN(n)),resizeThrottleMs:t.resizeThrottleMs,onResize:Mg(e=>n.current.publishEvent("resize",e)),onWheel:Mg(e=>{n.current.publishEvent("virtualScrollerWheel",{},e)}),onTouchMove:Mg(e=>{n.current.publishEvent("virtualScrollerTouchMove",{},e)}),onRenderContextChange:Mg(e=>{n.current.publishEvent("renderedRowsIntervalChange",e)}),onScrollChange:s.useCallback((e,t)=>{n.current.publishEvent("scrollPositionChange",{top:e.top,left:e.left,renderContext:t})},[n]),scrollReset:g,renderRow:s.useCallback(e=>Xp.jsx(N,f({row:e.model,rowId:e.id,index:e.rowIndex,selected:c(e.id),offsetLeft:e.offsetLeft,columnsTotalWidth:C,rowHeight:e.baseRowHeight,pinnedColumns:a,visibleColumns:o,firstColumnIndex:e.firstColumnIndex,lastColumnIndex:e.lastColumnIndex,focusedColumnIndex:e.focusedColumnIndex,isFirstVisible:e.isFirstVisible,isLastVisible:e.isLastVisible,isNotVisible:e.isVirtualFocusRow,showBottomBorder:e.showBottomBorder,scrollbarWidth:p,gridHasFiller:h},$),e.id),[C,h,c,a,N,$,p,o]),renderInfiniteLoadingTrigger:s.useCallback(e=>n.current.getInfiniteLoadingTriggerElement?.({lastRowId:e}),[n])});return wL(()=>{n.current.store.state.dimensions=T(j.store.state.dimensions,w,x,S,k),n.current.store.state.rowsMeta=j.store.state.rowsMeta,n.current.store.state.virtualization=j.store.state.virtualization}),QM(j.store,sA.selectors.dimensions,(e,t)=>{t.isReady&&n.current.setState(e=>f({},e,{dimensions:T(t,w,x,S,k)}))}),QM(j.store,sA.selectors.rowsMeta,(e,t)=>{t!==n.current.state.rowsMeta&&n.current.setState(e=>f({},e,{rowsMeta:t}))}),QM(j.store,vA.selectors.store,(e,t)=>{t.renderContext!==mA&&t!==n.current.state.virtualization&&n.current.setState(e=>f({},e,{virtualization:t}))}),n.current.register("private",{virtualizer:j}),(e=>{const t=e.current.virtualizer,{getRowHeight:n,setLastMeasuredRowIndex:r,storeRowHeightMeasurement:o,resetRowHeights:i,hydrateRowsMeta:a,observeRowHeight:l,rowHasAutoHeight:s,getRowHeightEntry:c,getLastMeasuredRowIndex:u}=t.api.rowsMeta;fN(e,"rowHeight",a);const d={hydrateRowsMeta:a,observeRowHeight:l,rowHasAutoHeight:s,getRowHeightEntry:c,getLastMeasuredRowIndex:u};vL(e,{unstable_getRowHeight:n,unstable_setLastMeasuredRowIndex:r,unstable_storeRowHeightMeasurement:o,resetRowHeights:i},"public"),vL(e,d,"private")})(n),j}const bN=jh("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScroller,n.hasScrollX&&t["virtualScroller--hasScrollX"]]}})({position:"relative",height:"100%",flexGrow:1,overflow:"scroll",scrollbarWidth:"none",display:"flex",flexDirection:"column","&::-webkit-scrollbar":{display:"none"},"@media print":{overflow:"hidden"},zIndex:0}),yN=e=>e.current.state.dimensions.rightPinnedWidth>0;function wN(e){const t=mL(),n=rP(),r=pI(t,sT),o=pI(t,lT),i=pI(t,yN),a=pI(t,hT),{overlayType:l,loadingOverlayVariant:c}=EL(t,n),u=n.slots?.[l],d={classes:n.classes,hasScrollX:o,hasPinnedRight:i,overlayType:l,loadingOverlayVariant:c},p=(e=>{const{classes:t,hasScrollX:n,hasPinnedRight:r,loadingOverlayVariant:o,overlayType:i}=e;return wm({root:["main",r&&"main--hasPinnedRight",("skeleton"===o||"noColumnsOverlay"===i)&&"main--hiddenContent"],scroller:["virtualScroller",n&&"virtualScroller--hasScrollX"]},YT,t)})(d),h=vN().api.getters,{getContainerProps:m,getScrollerProps:g,getContentProps:v,getPositionerProps:b,getScrollbarVerticalProps:y,getScrollbarHorizontalProps:w,getRows:x,getScrollAreaProps:S}=h,C=x(void 0,xT(t));return Xp.jsxs(IL,f({className:p.root},m(),{ownerState:d,children:[Xp.jsx(fL,f({scrollDirection:"left"},S())),Xp.jsx(fL,f({scrollDirection:"right"},S())),Xp.jsx(fL,f({scrollDirection:"up"},S())),Xp.jsx(fL,f({scrollDirection:"down"},S())),Xp.jsxs(bN,f({className:p.scroller},g(),{ownerState:d,children:[Xp.jsxs(DL,{children:[!n.listView&&Xp.jsx(PL,{}),Xp.jsx(n.slots.pinnedRows,{position:"top",virtualScroller:h})]}),l&&Xp.jsx(aN,{overlayType:l,loadingOverlayVariant:c,children:Xp.jsx(u,f({},n.slotProps?.[l]))}),Xp.jsx(LL,f({},v(),{children:Xp.jsxs(HL,f({role:"rowgroup"},b(),{children:[C,Xp.jsx(n.slots.detailPanels,{virtualScroller:h})]}))})),a&&Xp.jsx(BL,{rowsLength:C.length}),Xp.jsx(n.slots.bottomContainer,{children:Xp.jsx(n.slots.pinnedRows,{position:"bottom",virtualScroller:h})})]})),o&&Xp.jsxs(s.Fragment,{children:[n.pinnedColumnsSectionSeparator?.endsWith("shadow")&&Xp.jsx(rN,{position:"horizontal"}),Xp.jsx(tN,f({position:"horizontal"},w()))]}),r&&Xp.jsxs(s.Fragment,{children:[n.pinnedRowsSectionSeparator?.endsWith("shadow")&&Xp.jsx(rN,{position:"vertical"}),Xp.jsx(tN,f({position:"vertical"},y()))]}),o&&r&&Xp.jsx(eN,{"aria-hidden":"true"}),e.children]}))}function xN(){const e=rP();return e.hideFooter?null:Xp.jsx(e.slots.footer,f({},e.slotProps?.footer))}let SN;function CN(){return void 0===SN&&document.createElement("div").focus({get preventScroll(){return SN=!0,!1}}),SN}const kN=(e,t)=>{if(e)if(t){if(e===nD.LEFT)return"right";if(e===nD.RIGHT)return"left"}else{if(e===nD.LEFT)return"left";if(e===nD.RIGHT)return"right"}};function EN(e,t,n,r){const o=kN(n,t);return o&&void 0!==r?(e[o]=r,e):e}const RN=["column","row","rowId","rowNode","align","children","colIndex","width","className","style","colSpan","disableDragEvents","isNotVisible","pinnedOffset","pinnedPosition","showRightBorder","showLeftBorder","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver"],PN=["changeReason","unstable_updateValueOnRender"];nD.LEFT,ZI.LEFT,nD.RIGHT,ZI.RIGHT,nD.NONE,nD.VIRTUAL;const MN=TR(function(e,t){const{column:n,row:r,rowId:o,rowNode:i,align:a,colIndex:l,width:c,className:u,style:p,colSpan:h,disableDragEvents:m,isNotVisible:g,pinnedOffset:v,pinnedPosition:b,showRightBorder:y,showLeftBorder:w,onClick:x,onDoubleClick:S,onMouseDown:C,onMouseUp:k,onMouseOver:E,onKeyDown:R,onKeyUp:P,onDragEnter:M,onDragOver:T}=e,I=d(e,RN),O=mL(),D=rP(),F=um(),L=n.field,A=pI(O,GL,{rowId:o,field:L}),N=jO().hooks.useCellAggregationResult(o,L),$=A?zI.Edit:zI.View,{value:z,formattedValue:j}=N||{},B=O.current.getCellParamsForRow(o,L,r,{colDef:n,cellMode:$,rowNode:i,tabIndex:pI(O,()=>{const e=JD(O);return e&&e.field===L&&e.id===o?0:-1}),hasFocus:pI(O,()=>{const e=YD(O);return e?.id===o&&e.field===L}),value:z,formattedValue:j});B.api=O.current,pI(O,()=>O.current.isCellEditable(B));const _=pI(O,()=>O.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:o,field:L})),H=O.current.virtualizer.store,V=YM(H,AA.selectors.hiddenCells),W=YM(H,AA.selectors.spannedCells),{hasFocus:U,isEditable:G=!1,value:K}=B,q="view"!==$&&G||"actions"===n.type?-1:B.tabIndex,{classes:Y,getCellClassName:X}=D,Q=[pI(O,()=>O.current.unstable_applyPipeProcessors("cellClassName",[],{id:o,field:L}).filter(Boolean).join(" "))];n.cellClassName&&Q.push("function"==typeof n.cellClassName?n.cellClassName(B):n.cellClassName),"flex"===n.display&&Q.push(XT["cell--flex"]),X&&Q.push(X(B));const Z=B.formattedValue??K,J=s.useRef(null),ee=Tg(t,J),te=D.cellSelection??!1,ne=(e=>{const{align:t,showLeftBorder:n,showRightBorder:r,pinnedPosition:o,isEditable:i,isSelected:a,isSelectionMode:l,classes:s}=e;return wm({root:["cell",`cell--text${xf(t)}`,a&&"selected",i&&"cell--editable",n&&"cell--withLeftBorder",r&&"cell--withRightBorder",o===nD.LEFT&&"cell--pinnedLeft",o===nD.RIGHT&&"cell--pinnedRight",l&&!i&&"cell--selectionMode"]},YT,s)})({align:a,showLeftBorder:w,showRightBorder:y,isEditable:G,classes:D.classes,pinnedPosition:b,isSelected:_,isSelectionMode:te}),re=s.useCallback(e=>t=>{const n=O.current.getCellParams(o,L||"");O.current.publishEvent(e,n,t),k&&k(t)},[O,L,k,o]),oe=s.useCallback(e=>t=>{const n=O.current.getCellParams(o,L||"");O.current.publishEvent(e,n,t),C&&C(t)},[O,L,C,o]),ie=s.useCallback((e,t)=>n=>{if(!O.current.getRow(o))return;const r=O.current.getCellParams(o,L||"");O.current.publishEvent(e,r,n),t&&t(n)},[O,L,o]),ae=V[o]?.[l]??!1,le=W[o]?.[l]??1,se=s.useMemo(()=>{if(g)return{padding:0,opacity:0,width:0,height:0,border:0};const e=EN(f({"--width":`${c}px`},p),F,b,v),t=b===nD.LEFT,n=b===nD.RIGHT;return le>1&&(e.height=`calc(var(--height) * ${le})`,e.zIndex=10,(t||n)&&(e.zIndex=40)),e},[c,g,p,v,b,F,le]);if(Wh(()=>{if(!U||$===zI.Edit)return;const e=kg(O.current.rootElementRef.current);if(J.current&&!J.current.contains(e.activeElement)){const e=J.current.querySelector('[tabindex="0"]')||J.current;if(CN())e.focus({preventScroll:!0});else{const t=O.current.getScrollPosition();e.focus(),O.current.scroll(t)}}},[U,$,O]),ae)return Xp.jsx("div",{"data-colindex":l,role:"presentation",style:f({width:"var(--width)"},se)});let ce,ue,de=I.onFocus;if(null===A&&n.renderCell&&(ce=n.renderCell(B)),null!==A&&n.renderEditCell){const e=O.current.getRowWithUpdatedValues(o,n.field),t=d(A,PN),r=n.valueFormatter?n.valueFormatter(A.value,e,n,O):B.formattedValue,i=f({},B,{row:e,formattedValue:r},t);ce=n.renderEditCell(i),Q.push(XT["cell--editing"]),Q.push(Y?.["cell--editing"])}if(void 0===ce){const e=Z?.toString();ce=e,ue=e}const pe=m?null:{onDragEnter:ie("cellDragEnter",M),onDragOver:ie("cellDragOver",T)};return Xp.jsx("div",f({className:PR(ne.root,Q,u),role:"gridcell","data-field":L,"data-colindex":l,"aria-colindex":l+1,"aria-colspan":h,"aria-rowspan":le,style:se,title:ue,tabIndex:q,onClick:ie("cellClick",x),onDoubleClick:ie("cellDoubleClick",S),onMouseOver:ie("cellMouseOver",E),onMouseDown:oe("cellMouseDown"),onMouseUp:re("cellMouseUp"),onKeyDown:ie("cellKeyDown",R),onKeyUp:ie("cellKeyUp",P)},pe,I,{onFocus:de,ref:ee,children:ce}))}),TN=KT(MN),IN=["field","type","align","width","height","empty","style","className"],ON="1.3em",DN=[40,80],FN={number:[40,60],string:[40,80],date:[40,60],dateTime:[60,80],singleSelect:[40,80]},LN=function(e){const t=(n=e,()=>{let e=n+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296});var n;return(e,n)=>e+(n-e)*t()}(12345);const AN=KT(function(e){const{field:t,type:n,align:r,width:o,height:i,empty:a=!1,style:l,className:c}=e,u=d(e,IN),p=rP(),h=(e=>{const{align:t,classes:n,empty:r}=e;return wm({root:["cell","cellSkeleton",`cell--text${t?xf(t):"Left"}`,r&&"cellEmpty"]},YT,n)})({classes:p.classes,align:r,empty:a}),m=s.useMemo(()=>{if("boolean"===n||"actions"===n)return{variant:"circular",width:ON,height:ON};const[e,t]=n?FN[n]??DN:DN;return{variant:"text",width:`${Math.round(LN(e,t))}%`,height:"1.2em"}},[n]);return Xp.jsx("div",f({"data-field":t,className:PR(h.root,c),style:f({height:i,maxWidth:o,minWidth:o},l)},u,{children:!a&&Xp.jsx(p.slots.baseSkeleton,f({},m))}))}),NN={width:3,rx:1.5,x:10.5},$N=e=>e.current.state.dimensions.isReady?e.current.state.dimensions.hasScrollX&&(!e.current.state.dimensions.hasScrollY||0===e.current.state.dimensions.scrollbarSize):0===e.current.state.dimensions.scrollbarSize,zN=pg("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${XT.autoHeight}`]:t.autoHeight},{[`&.${XT.autosizing}`]:t.autosizing},{[`&.${XT["root--densityStandard"]}`]:t["root--densityStandard"]},{[`&.${XT["root--densityComfortable"]}`]:t["root--densityComfortable"]},{[`&.${XT["root--densityCompact"]}`]:t["root--densityCompact"]},{[`&.${XT["root--disableUserSelection"]}`]:t["root--disableUserSelection"]},{[`&.${XT["root--noToolbar"]}`]:t["root--noToolbar"]},{[`&.${XT.withVerticalBorder}`]:t.withVerticalBorder},{[`& .${XT.actionsCell}`]:t.actionsCell},{[`& .${XT.booleanCell}`]:t.booleanCell},{[`& .${XT.cell}`]:t.cell},{[`& .${XT["cell--editable"]}`]:t["cell--editable"]},{[`& .${XT["cell--editing"]}`]:t["cell--editing"]},{[`& .${XT["cell--flex"]}`]:t["cell--flex"]},{[`& .${XT["cell--pinnedLeft"]}`]:t["cell--pinnedLeft"]},{[`& .${XT["cell--pinnedRight"]}`]:t["cell--pinnedRight"]},{[`& .${XT["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${XT["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${XT["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${XT["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${XT["cell--selectionMode"]}`]:t["cell--selectionMode"]},{[`& .${XT["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${XT["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${XT["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${XT["cell--withLeftBorder"]}`]:t["cell--withLeftBorder"]},{[`& .${XT["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${XT.cellCheckbox}`]:t.cellCheckbox},{[`& .${XT.cellEmpty}`]:t.cellEmpty},{[`& .${XT.cellOffsetLeft}`]:t.cellOffsetLeft},{[`& .${XT.cellSkeleton}`]:t.cellSkeleton},{[`& .${XT.checkboxInput}`]:t.checkboxInput},{[`& .${XT.columnHeader}`]:t.columnHeader},{[`& .${XT["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${XT["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${XT["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${XT["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${XT["columnHeader--emptyGroup"]}`]:t["columnHeader--emptyGroup"]},{[`& .${XT["columnHeader--filledGroup"]}`]:t["columnHeader--filledGroup"]},{[`& .${XT["columnHeader--filtered"]}`]:t["columnHeader--filtered"]},{[`& .${XT["columnHeader--last"]}`]:t["columnHeader--last"]},{[`& .${XT["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${XT["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${XT["columnHeader--pinnedLeft"]}`]:t["columnHeader--pinnedLeft"]},{[`& .${XT["columnHeader--pinnedRight"]}`]:t["columnHeader--pinnedRight"]},{[`& .${XT["columnHeader--siblingFocused"]}`]:t["columnHeader--siblingFocused"]},{[`& .${XT["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${XT["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${XT["columnHeader--withLeftBorder"]}`]:t["columnHeader--withLeftBorder"]},{[`& .${XT["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${XT.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${XT.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${XT.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${XT.columnHeaderTitleContainerContent}`]:t.columnHeaderTitleContainerContent},{[`& .${XT.columnSeparator}`]:t.columnSeparator},{[`& .${XT["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${XT["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${XT["columnSeparator--sideLeft"]}`]:t["columnSeparator--sideLeft"]},{[`& .${XT["columnSeparator--sideRight"]}`]:t["columnSeparator--sideRight"]},{[`& .${XT["container--bottom"]}`]:t["container--bottom"]},{[`& .${XT["container--top"]}`]:t["container--top"]},{[`& .${XT.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${XT["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},{[`& .${XT.editBooleanCell}`]:t.editBooleanCell},{[`& .${XT.filterIcon}`]:t.filterIcon},{[`& .${XT["filler--borderBottom"]}`]:t["filler--borderBottom"]},{[`& .${XT["filler--pinnedLeft"]}`]:t["filler--pinnedLeft"]},{[`& .${XT["filler--pinnedRight"]}`]:t["filler--pinnedRight"]},{[`& .${XT.groupingCriteriaCell}`]:t.groupingCriteriaCell},{[`& .${XT.groupingCriteriaCellLoadingContainer}`]:t.groupingCriteriaCellLoadingContainer},{[`& .${XT.groupingCriteriaCellToggle}`]:t.groupingCriteriaCellToggle},{[`& .${XT.headerFilterRow}`]:t.headerFilterRow},{[`& .${XT.iconSeparator}`]:t.iconSeparator},{[`& .${XT.menuIcon}`]:t.menuIcon},{[`& .${XT.menuIconButton}`]:t.menuIconButton},{[`& .${XT.menuList}`]:t.menuList},{[`& .${XT.menuOpen}`]:t.menuOpen},{[`& .${XT.overlayWrapperInner}`]:t.overlayWrapperInner},{[`& .${XT.pinnedRows}`]:t.pinnedRows},{[`& .${XT["pinnedRows--bottom"]}`]:t["pinnedRows--bottom"]},{[`& .${XT["pinnedRows--top"]}`]:t["pinnedRows--top"]},{[`& .${XT.row}`]:t.row},{[`& .${XT["row--borderBottom"]}`]:t["row--borderBottom"]},{[`& .${XT["row--detailPanelExpanded"]}`]:t["row--detailPanelExpanded"]},{[`& .${XT["row--dragging"]}`]:t["row--dragging"]},{[`& .${XT["row--dynamicHeight"]}`]:t["row--dynamicHeight"]},{[`& .${XT["row--editable"]}`]:t["row--editable"]},{[`& .${XT["row--editing"]}`]:t["row--editing"]},{[`& .${XT["row--firstVisible"]}`]:t["row--firstVisible"]},{[`& .${XT["row--lastVisible"]}`]:t["row--lastVisible"]},{[`& .${XT.rowReorderCell}`]:t.rowReorderCell},{[`& .${XT["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${XT.rowReorderCellContainer}`]:t.rowReorderCellContainer},{[`& .${XT.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${XT.rowSkeleton}`]:t.rowSkeleton},{[`& .${XT.scrollbar}`]:t.scrollbar},{[`& .${XT["scrollbar--horizontal"]}`]:t["scrollbar--horizontal"]},{[`& .${XT["scrollbar--vertical"]}`]:t["scrollbar--vertical"]},{[`& .${XT.scrollbarFiller}`]:t.scrollbarFiller},{[`& .${XT["scrollbarFiller--pinnedRight"]}`]:t["scrollbarFiller--pinnedRight"]},{[`& .${XT.sortIcon}`]:t.sortIcon},{[`& .${XT.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${XT.treeDataGroupingCellLoadingContainer}`]:t.treeDataGroupingCellLoadingContainer},{[`& .${XT.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${XT.withBorderColor}`]:t.withBorderColor},{[`& .${XT["row--beingDragged"]}`]:t["row--beingDragged"]}]})(()=>{const e=pI(mL(),$N),t=bP.colors.background.base,n=bP.header.background.base,r=bP.cell.background.pinned,o=function(e){return jN(e,1)}(bP.colors.interactive.hover),i=bP.colors.interactive.hoverOpacity,a=bP.colors.interactive.selected,l=bP.colors.interactive.selectedOpacity,s=a,c=`calc(${l} + ${i})`,u=BN(t,o,i),d=BN(t,a,l),p=BN(t,s,c),f=BN(r,o,i),h=BN(r,a,l),m=BN(r,s,c),g=e=>({[`& .${XT["cell--pinnedLeft"]}, & .${XT["cell--pinnedRight"]}`]:{backgroundColor:e,"&.Mui-selected":{backgroundColor:BN(e,d,l),"&:hover":{backgroundColor:BN(e,p,c)}}}}),v=g(f),b=g(h),y=g(m),w={backgroundColor:d,"&:hover":{backgroundColor:p,"@media (hover: none)":{backgroundColor:d}}};return{"--unstable_DataGrid-radius":bP.radius.base,"--unstable_DataGrid-headWeight":bP.typography.fontWeight.medium,"--DataGrid-rowBorderColor":bP.colors.border.base,"--DataGrid-cellOffsetMultiplier":2,"--DataGrid-width":"0px","--DataGrid-hasScrollX":"0","--DataGrid-hasScrollY":"0","--DataGrid-scrollbarSize":"10px","--DataGrid-rowWidth":"0px","--DataGrid-columnsTotalWidth":"0px","--DataGrid-leftPinnedWidth":"0px","--DataGrid-rightPinnedWidth":"0px","--DataGrid-headerHeight":"0px","--DataGrid-headersTotalHeight":"0px","--DataGrid-topContainerHeight":"0px","--DataGrid-bottomContainerHeight":"0px",flex:1,boxSizing:"border-box",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:bP.colors.border.base,borderRadius:"var(--unstable_DataGrid-radius)",backgroundColor:bP.colors.background.base,color:bP.colors.foreground.base,font:bP.typography.font.body,outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflow:"hidden",overflowAnchor:"none",transform:"translate(0, 0)",[`.${XT.main} > *:first-child/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */`]:{borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"},[`&.${XT.autoHeight}`]:{height:"auto"},[`&.${XT.autosizing}`]:{[`& .${XT.columnHeaderTitleContainerContent} > *`]:{overflow:"visible !important"},"@media (hover: hover)":{[`& .${XT.menuIcon}`]:{width:"0 !important",visibility:"hidden !important"}},[`& .${XT.cell}`]:{overflow:"visible !important",whiteSpace:"nowrap",minWidth:"max-content !important",maxWidth:"max-content !important"},[`& .${XT.groupingCriteriaCell}`]:{width:"unset"},[`& .${XT.treeDataGroupingCell}`]:{width:"unset"}},[`&.${XT.withSidePanel}`]:{flexDirection:"row"},[`& .${XT.mainContent}`]:{display:"flex",flexDirection:"column",overflow:"hidden",flex:1},[`& .${XT.columnHeader}, & .${XT.cell}`]:{WebkitTapHighlightColor:"transparent",padding:"0 10px",boxSizing:"border-box"},[`& .${XT.columnHeader}:focus-within, & .${XT.cell}:focus-within`]:{outline:`solid ${jN(bP.colors.interactive.focus,.5)} 1px`,outlineOffset:-1},[`& .${XT.columnHeader}:focus, & .${XT.cell}:focus`]:{outline:`solid ${bP.colors.interactive.focus} 1px`,outlineOffset:-1},[`& .${XT.columnHeader}:focus,\n & .${XT["columnHeader--withLeftBorder"]},\n & .${XT["columnHeader--withRightBorder"]},\n & .${XT["columnHeader--siblingFocused"]}\n `]:{[`& .${XT.columnSeparator}`]:{opacity:0},"@media (hover: none)":{[`& .${XT["columnSeparator--resizable"]}`]:{opacity:1}},[`& .${XT["columnSeparator--resizable"]}:hover`]:{opacity:1}},[`&.${XT["root--noToolbar"]} [aria-rowindex="1"] [aria-colindex="1"]`]:{borderTopLeftRadius:"calc(var(--unstable_DataGrid-radius) - 1px)"},[`&.${XT["root--noToolbar"]} [aria-rowindex="1"] .${XT["columnHeader--last"]}`]:{borderTopRightRadius:e?"calc(var(--unstable_DataGrid-radius) - 1px)":void 0},[`& .${XT.columnHeaderCheckbox}, & .${XT.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${XT.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center",backgroundColor:n},[`& .${XT.columnHeader} .${XT.sortButton}`]:{backgroundColor:bP.header.background.base},[`& .${XT["columnHeader--filter"]}`]:{paddingTop:8,paddingBottom:8,paddingRight:5,minHeight:"min-content",overflow:"hidden"},[`& .${XT["virtualScroller--hasScrollX"]} .${XT["columnHeader--last"]}`]:{overflow:"hidden"},[`& .${XT["pivotPanelField--sorted"]} .${XT.iconButtonContainer},\n & .${XT["columnHeader--sorted"]} .${XT.iconButtonContainer},\n & .${XT["columnHeader--filtered"]} .${XT.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${XT.pivotPanelField}:not(.${XT["pivotPanelField--sorted"]}) .${XT.sortButton},\n & .${XT.columnHeader}:not(.${XT["columnHeader--sorted"]}) .${XT.sortButton}`]:{opacity:0,transition:bP.transition(["opacity"],{duration:bP.transitions.duration.short})},[`& .${XT.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",gap:bP.spacing(.25),minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden"},[`& .${XT.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${XT["columnHeader--filledGroup"]} .${XT.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${XT.sortIcon}, & .${XT.filterIcon}`]:{fontSize:"inherit"},[`& .${XT["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${XT["columnHeader--alignCenter"]} .${XT.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${XT["columnHeader--alignRight"]} .${XT.columnHeaderDraggableContainer}, & .${XT["columnHeader--alignRight"]} .${XT.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${XT["columnHeader--alignCenter"]} .${XT.menuIcon}`]:{marginLeft:"auto"},[`& .${XT["columnHeader--alignRight"]} .${XT.menuIcon}`]:{marginRight:"auto",marginLeft:-5},[`& .${XT["columnHeader--moving"]}`]:{backgroundColor:u},[`& .${XT["columnHeader--pinnedLeft"]}, & .${XT["columnHeader--pinnedRight"]}`]:{position:"sticky",zIndex:40,background:bP.header.background.base},[`& .${XT.columnSeparator}`]:{position:"absolute",overflow:"hidden",zIndex:30,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",maxWidth:10,color:bP.colors.border.base},[`& .${XT.columnHeaders}`]:{width:"var(--DataGrid-rowWidth)",backgroundColor:n},"@media (hover: hover)":{[`& .${XT.columnHeader}:hover`]:{[`& .${XT.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${XT.iconButtonContainer}`]:{visibility:"visible",width:"auto"}},[`& .${XT.columnHeader}:not(.${XT["columnHeader--sorted"]}):hover .${XT.sortButton},\n & .${XT.pivotPanelField}:not(.${XT["pivotPanelField--sorted"]}):hover .${XT.sortButton},\n & .${XT.pivotPanelField}:not(.${XT["pivotPanelField--sorted"]}) .${XT.sortButton}:focus-visible`]:{opacity:1},[`& .${XT.columnHeader}:not(.${XT["columnHeader--sorted"]}):hover .${XT.sortButton} > *,\n & .${XT.pivotPanelField}:not(.${XT["pivotPanelField--sorted"]}):hover .${XT.sortButton} > *,\n & .${XT.pivotPanelField}:not(.${XT["pivotPanelField--sorted"]}) .${XT.sortButton}:focus-visible > *`]:{opacity:.78},[`& .${XT.pivotPanelFieldActionContainer} button:hover`]:{backgroundColor:bP.colors.background.base}},"@media (hover: none)":{[`& .${XT.columnHeader} .${XT.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${XT.columnHeader}:focus,\n & .${XT["columnHeader--siblingFocused"]}`]:{[`.${XT["columnSeparator--resizable"]}`]:{color:bP.colors.foreground.accent}},[`& .${XT.pivotPanelField}:not(.${XT["pivotPanelField--sorted"]}) .${XT.sortButton}`]:{opacity:.78}},[`& .${XT["columnHeader--withLeftBorder"]} .${XT["columnSeparator--sideLeft"]}:not(.${XT["columnSeparator--resizable"]}), & .${XT["columnHeader--withRightBorder"]} .${XT["columnSeparator--sideRight"]}:not(.${XT["columnSeparator--resizable"]})`]:{display:"none"},[`& .${XT["columnSeparator--sideLeft"]}`]:{left:-5},[`& .${XT["columnSeparator--sideRight"]}`]:{right:-5},[`& .${XT["columnHeader--withRightBorder"]} .${XT["columnSeparator--sideLeft"]}`]:{left:-5.5},[`& .${XT["columnHeader--withRightBorder"]} .${XT["columnSeparator--sideRight"]}`]:{right:-5.5},[`& .${XT["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none",[`&.${XT["columnSeparator--resizing"]}`]:{color:bP.colors.foreground.accent},"@media (hover: none)":{[`& .${XT.iconSeparator} rect`]:NN},"@media (hover: hover)":{"&:hover":{color:bP.colors.foreground.accent,[`& .${XT.iconSeparator} rect`]:NN}},"& svg":{pointerEvents:"none"}},[`& .${XT.iconSeparator}`]:{color:"inherit",transition:bP.transition(["color","width"],{duration:bP.transitions.duration.short})},[`& .${XT.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-5,display:"flex",alignItems:"center"},[`.${XT.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${XT.headerFilterRow}`]:{[`& .${XT.columnHeader}, & .${XT.scrollbarFiller}`]:{boxSizing:"border-box",borderBottom:"1px solid var(--DataGrid-rowBorderColor)"}},[`& .${XT["row--borderBottom"]} .${XT.columnHeader},\n & .${XT["row--borderBottom"]} .${XT.filler},\n & .${XT["row--borderBottom"]} .${XT.scrollbarFiller}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${XT["row--borderBottom"]} .${XT.cell}`]:{borderBottom:"1px solid var(--rowBorderColor)"},[`.${XT.row}`]:{display:"flex",width:"var(--DataGrid-rowWidth)",breakInside:"avoid","--rowBorderColor":"var(--DataGrid-rowBorderColor)",[`&.${XT["row--firstVisible"]}`]:{"--rowBorderColor":"transparent"},"&:hover":{backgroundColor:u,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${XT.rowSkeleton}:hover`]:{backgroundColor:"transparent"},"&.Mui-selected":w,position:"relative"},[`& .${XT.cell}`]:{flex:"0 0 auto",height:"var(--height)",width:"var(--width)",lineHeight:"calc(var(--height) - 1px)",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis","&.Mui-selected":w},[`& .${XT["virtualScrollerContent--overflowed"]} .${XT["row--lastVisible"]} .${XT.cell}`]:{borderTopColor:"transparent"},[`& .${XT.pinnedRows} .${XT.row}, .${XT.aggregationRowOverlayWrapper} .${XT.row}`]:{backgroundColor:r,"&:hover":{backgroundColor:f}},[`& .${XT["pinnedRows--top"]} :first-of-type`]:{[`& .${XT.cell}, .${XT.scrollbarFiller}`]:{borderTop:"none"}},[`&.${XT["root--disableUserSelection"]}`]:{userSelect:"none"},[`& .${XT["row--dynamicHeight"]} > .${XT.cell}`]:{whiteSpace:"initial",lineHeight:"inherit"},[`& .${XT.cellEmpty}`]:{flex:1,padding:0,height:"unset"},[`& .${XT.cell}.${XT["cell--selectionMode"]}`]:{cursor:"default"},[`& .${XT.cell}.${XT["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:bP.shadows.base,backgroundColor:bP.colors.background.overlay,"&:focus-within":{outline:`1px solid ${bP.colors.interactive.focus}`,outlineOffset:-1}},[`& .${XT["cell--editing"]}`]:{"& .MuiInputBase-root":{height:"100%"}},[`& .${XT["row--editing"]}`]:{boxShadow:bP.shadows.base},[`& .${XT["row--editing"]} .${XT.cell}`]:{boxShadow:"none",backgroundColor:bP.colors.background.overlay},[`& .${XT.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${XT.booleanCell}[data-value="true"]`]:{color:bP.colors.foreground.muted},[`& .${XT.booleanCell}[data-value="false"]`]:{color:bP.colors.foreground.disabled},[`& .${XT.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:bP.spacing(1)},[`& .${XT.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:bP.colors.interactive.disabledOpacity},[`& .${XT["rowReorderCell--draggable"]}`]:{cursor:"grab",opacity:1},[`& .${XT.rowReorderCellContainer}`]:{padding:0,display:"flex",alignItems:"stretch"},[`.${XT.withBorderColor}`]:{borderColor:bP.colors.border.base},[`& .${XT["cell--withLeftBorder"]}, & .${XT["columnHeader--withLeftBorder"]}`]:{borderLeftColor:"var(--DataGrid-rowBorderColor)",borderLeftWidth:"1px",borderLeftStyle:"solid"},[`& .${XT["cell--withRightBorder"]}, & .${XT["columnHeader--withRightBorder"]}`]:{borderRightColor:"var(--DataGrid-rowBorderColor)",borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${XT["cell--flex"]}`]:{display:"flex",alignItems:"center",lineHeight:"inherit"},[`& .${XT["cell--textLeft"]}`]:{textAlign:"left",justifyContent:"flex-start"},[`& .${XT["cell--textRight"]}`]:{textAlign:"right",justifyContent:"flex-end"},[`& .${XT["cell--textCenter"]}`]:{textAlign:"center",justifyContent:"center"},[`& .${XT["cell--pinnedLeft"]}, & .${XT["cell--pinnedRight"]}`]:{position:"sticky",zIndex:30,background:bP.cell.background.pinned,"&.Mui-selected":{backgroundColor:h}},[`& .${XT.row}`]:{"&:hover":v,"&.Mui-selected":b,"&.Mui-selected:hover":y},[`& .${XT.cellOffsetLeft}`]:{flex:"0 0 auto",display:"inline-block"},[`& .${XT.cellSkeleton}`]:{flex:"0 0 auto",height:"100%",display:"inline-flex",alignItems:"center"},[`& .${XT.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${XT.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${XT["columnHeader--dragging"]}`]:{background:bP.colors.background.overlay,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:bP.colors.interactive.disabledOpacity},[`& .${XT["row--dragging"]}`]:{background:bP.colors.background.overlay,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",border:"1px solid var(--DataGrid-rowBorderColor)",color:bP.colors.foreground.base,transform:"translateZ(0)",[`& .${XT.rowReorderCellPlaceholder}`]:{padding:"0 6px",display:"flex"}},[`& .${XT.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${XT.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:bP.spacing(2)},[`& .${XT.treeDataGroupingCellLoadingContainer}, .${XT.groupingCriteriaCellLoadingContainer}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},[`& .${XT.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${XT.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:bP.spacing(2)},[`& .${XT.columnHeaders} .${XT.scrollbarFiller}`]:{backgroundColor:n},[`.${XT.scrollbarFiller}`]:{minWidth:"calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",alignSelf:"stretch",backgroundColor:n,[`&.${XT["scrollbarFiller--pinnedRight"]}`]:{position:"sticky",zIndex:40,right:0}},[`& .${XT.filler}`]:{flex:"1 0 auto"},[`& .${XT["filler--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${XT.columnHeaders} .${XT.filler}`]:{backgroundColor:n},[`& .${XT["main--hiddenContent"]}`]:{[`& .${XT.virtualScrollerContent}`]:{position:"fixed",visibility:"hidden"},[`& .${XT.pinnedRows}`]:{display:"none"}},[`& .${XT["row--beingDragged"]}`]:{color:bP.colors.foreground.disabled,"&:hover":{backgroundColor:"transparent"}}}});function jN(e,t){return`rgba(from ${e} r g b / ${t})`}function BN(e,t,n){return`color-mix(in srgb,${e}, ${t} calc(${n} * 100%))`}const _N=()=>()=>{},HN=()=>!1,VN=()=>!0,WN=s.createContext(void 0);function UN(){const e=s.useContext(WN);if(void 0===e)throw new Error("MUI X: Missing context.");return e}function GN({children:e}){const t=s.useRef(null),n=s.useRef(null),r=s.useRef(null),o=s.useMemo(()=>({columnsPanelTriggerRef:t,filterPanelTriggerRef:n,aiAssistantPanelTriggerRef:r}),[]);return Xp.jsx(WN.Provider,{value:o,children:e})}function KN(){const e=lP(),t=pI(e,aO),n=rP(),r=pI(e,KL),{columnsPanelTriggerRef:o,filterPanelTriggerRef:i,aiAssistantPanelTriggerRef:a}=UN(),l=e.current.unstable_applyPipeProcessors("preferencePanel",null,r.openedPanelValue??YL.filters);let s=null;switch(r.openedPanelValue){case YL.filters:s=i.current;break;case YL.columns:s=o.current;break;case YL.aiAssistant:s=a.current}return Xp.jsx(n.slots.panel,f({id:r.panelId,open:t.length>0&&r.open,"aria-labelledby":r.labelId,target:s,onClose:()=>e.current.hidePreferences()},n.slotProps?.panel,{children:l}))}function qN(){const e=rP();return Xp.jsxs(s.Fragment,{children:[Xp.jsx(KN,{}),e.showToolbar&&Xp.jsx(e.slots.toolbar,f({},e.slotProps?.toolbar))]})}const YN=["className","children","sidePanel"],XN=TR(function(e,t){const n=rP(),{className:r,children:o,sidePanel:i}=e,a=d(e,YN),l=mL(),c=pI(l,hI),u=l.current.rootElementRef,p=s.useCallback(e=>{null!==e&&l.current.publishEvent("rootMount",e)},[l]),h=Tg(u,t,p),m=n,g=((e,t)=>{const{autoHeight:n,classes:r,showCellVerticalBorder:o}=e;return wm({root:["root",n&&"autoHeight",`root--density${xf(t)}`,null===e.slots.toolbar&&"root--noToolbar","withBorderColor",o&&"withVerticalBorder"]},YT,r)})(m,c),v=s.useContext(BO);return WM.useSyncExternalStore(_N,HN,VN)?null:Xp.jsxs(zN,f({className:PR(g.root,r,v.className,i&&XT.withSidePanel),ownerState:m},a,{ref:h,children:[Xp.jsxs("div",{className:XT.mainContent,role:"presentation",children:[Xp.jsx(qN,{}),Xp.jsx(wN,{children:o}),Xp.jsx(xN,{})]}),i,v.tag]}))}),QN=KT(XN),ZN=["className"],JN=jh("div",{name:"MuiDataGrid",slot:"FooterContainer"})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),e$=TR(function(e,t){const{className:n}=e,r=d(e,ZN),o=rP(),i=(e=>{const{classes:t}=e;return wm({root:["footerContainer","withBorderColor"]},YT,t)})(o);return Xp.jsx(JN,f({className:PR(i.root,n),ownerState:o},r,{ref:t}))}),t$=["className"],n$=jh("div",{name:"MuiDataGrid",slot:"Overlay"})({width:"100%",height:"100%",display:"flex",gap:bP.spacing(1),flexDirection:"column",alignSelf:"center",alignItems:"center",justifyContent:"center",textAlign:"center",textWrap:"balance",backgroundColor:bP.colors.background.backdrop}),r$=TR(function(e,t){const{className:n}=e,r=d(e,t$),o=rP(),i=(e=>{const{classes:t}=e;return wm({root:["overlay"]},YT,t)})(o);return Xp.jsx(n$,f({className:PR(i.root,n),ownerState:o},r,{ref:t}))});function o$(e,t,n,r={}){return"function"==typeof t?t(n,r):t?(t.props.className&&(n.className=function(e,t){if(!e||!t)return e||t;return`${e} ${t}`}(t.props.className,n.className)),(t.props.style||n.style)&&(n.style=f({},n.style,t.props.style)),s.cloneElement(t,n)):s.createElement(e,n)}const i$=s.createContext(void 0);function a$(e,t){if(!e.ref.current||!t.ref.current)return 0;const n=e.ref.current.compareDocumentPosition(t.ref.current);return n?n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0:0}const l$=["render","className"],s$=jh("div",{name:"MuiDataGrid",slot:"Toolbar"})({flex:"0 1 1px",display:"flex",alignItems:"center",justifyContent:"end",gap:bP.spacing(.25),padding:bP.spacing(.75),minHeight:52,boxSizing:"border-box",borderBottom:`1px solid ${bP.colors.border.base}`}),c$=TR(function(e,t){const{render:n,className:r}=e,o=d(e,l$),i=rP(),a=(e=>{const{classes:t}=e;return wm({root:["toolbar"]},YT,t)})(i),[l,c]=s.useState(null),[u,p]=s.useState([]),h=s.useCallback(()=>u.sort(a$),[u]),m=s.useCallback((e,t,n=!0)=>{let r=e;const o=h(),i=o.length;for(let e=0;e<i;e+=1){if(r+=t,r>=i){if(!n)return-1;r=0}else if(r<0){if(!n)return-1;r=i-1}if(!o[r].ref.current?.disabled&&"true"!==o[r].ref.current?.ariaDisabled)return r}return-1},[h]),g=s.useCallback((e,t)=>{p(n=>[...n,{id:e,ref:t}])},[]),v=s.useCallback(e=>{p(t=>t.filter(t=>t.id!==e))},[]),b=s.useCallback(e=>{if(!l)return;const t=h(),n=t.findIndex(e=>e.id===l);let r=-1;if("ArrowRight"===e.key?(e.preventDefault(),r=m(n,1)):"ArrowLeft"===e.key?(e.preventDefault(),r=m(n,-1)):"Home"===e.key?(e.preventDefault(),r=m(-1,1,!1)):"End"===e.key&&(e.preventDefault(),r=m(t.length,-1,!1)),r>=0&&r<t.length){const e=t[r];c(e.id),e.ref.current?.focus()}},[h,l,m]),y=s.useCallback(e=>{l!==e&&c(e)},[l,c]),w=s.useCallback(e=>{const t=h(),n=t.findIndex(t=>t.id===e),r=m(n,1);if(r>=0&&r<t.length){const e=t[r];c(e.id),e.ref.current?.focus()}},[h,m]);s.useEffect(()=>{const e=h();if(e.length>0){if(!l)return void c(e[0].id);const t=e.findIndex(e=>e.id===l);if(e[t]){if(-1===t){const n=e[t];n&&(c(n.id),n.ref.current?.focus())}}else{const t=e[e.length-1];t&&(c(t.id),t.ref.current?.focus())}}},[h,m]);const x=s.useMemo(()=>({focusableItemId:l,registerItem:g,unregisterItem:v,onItemKeyDown:b,onItemFocus:y,onItemDisabled:w}),[l,g,v,b,y,w]),S=o$(s$,n,f({role:"toolbar","aria-orientation":"horizontal","aria-label":i.label||void 0,className:PR(a.root,r)},o,{ref:t}));return Xp.jsx(i$.Provider,{value:x,children:S})}),u$=["render","onKeyDown","onFocus","disabled","aria-disabled"],d$=TR(function(e,t){const{render:n,onKeyDown:r,onFocus:o,disabled:i,"aria-disabled":a}=e,l=d(e,u$),c=mm(),u=rP(),p=s.useRef(null),h=Tg(p,t),{focusableItemId:m,registerItem:g,unregisterItem:v,onItemKeyDown:b,onItemFocus:y,onItemDisabled:w}=function(){const e=s.useContext(i$);if(void 0===e)throw new Error("MUI X: Missing context. Toolbar subcomponents must be placed within a <Toolbar /> component.");return e}();s.useEffect(()=>(g(c,p),()=>v(c)),[]);const x=s.useRef(i);s.useEffect(()=>{x.current!==i&&!0===i&&w(c,i),x.current=i},[i,c,w]);const S=s.useRef(a);s.useEffect(()=>{S.current!==a&&!0===a&&w(c,!0),S.current=a},[a,c,w]);const C=o$(u.slots.baseIconButton,n,f({},u.slotProps?.baseIconButton,{tabIndex:m===c?0:-1},l,{disabled:i,"aria-disabled":a,onKeyDown:e=>{b(e),r?.(e)},onFocus:e=>{y(c),o?.(e)},ref:h}));return Xp.jsx(s.Fragment,{children:C})}),p$=s.memo(e=>{const{colDef:t,open:n,columnMenuId:r,columnMenuButtonId:o,iconButtonRef:i}=e,a=lP(),l=rP(),c=(e=>{const{classes:t,open:n}=e;return wm({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},YT,t)})(f({},e,{classes:l.classes})),u=s.useCallback(e=>{e.preventDefault(),e.stopPropagation(),a.current.toggleColumnMenu(t.field)},[a,t.field]),d=t.headerName??t.field;return Xp.jsx("div",{className:c.root,children:Xp.jsx(l.slots.baseTooltip,f({title:a.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},l.slotProps?.baseTooltip,{children:Xp.jsx(l.slots.baseIconButton,f({ref:i,tabIndex:-1,className:c.button,"aria-label":a.current.getLocaleText("columnMenuAriaLabel")(d),size:"small",onClick:u,"aria-haspopup":"menu","aria-expanded":n,"aria-controls":n?r:void 0,id:o},l.slotProps?.baseIconButton,{children:Xp.jsx(l.slots.columnMenuIcon,{fontSize:"inherit"})}))}))})});function f$({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:r,field:o,open:i,target:a,onExited:l}){const s=lP(),c=s.current.getColumn(o),u=Mg(e=>{e&&(e.stopPropagation(),a?.contains(e.target))||s.current.hideColumnMenu()});return a&&c?Xp.jsx(UO,{position:"bottom-"+("right"===c.align?"start":"end"),open:i,target:a,onClose:u,onExited:l,children:Xp.jsx(n,f({colDef:c,hideMenu:u,open:i,id:e,labelledby:t},r))}):null}function h$(e,t){return e.closest(`.${t}`)}function m$(e){return e.replace(/["\\]/g,"\\$&")}function g$(e){return`.${XT.row}[data-id="${m$(String(e))}"]`}function v$(e){return 1===e.target.nodeType&&!e.currentTarget.contains(e.target)}function b$(e,t){return e.rootElementRef.current.querySelector(`.${XT[t]}`)}const y$=({api:e,colIndex:t,position:n,filterFn:r})=>{if(null===t)return[];const o=[];return x$(e).forEach(e=>{e.getAttribute("data-id")&&e.querySelectorAll(`.${XT["left"===n?"cell--pinnedLeft":"cell--pinnedRight"]}`).forEach(e=>{const t=S$(e);null!==t&&r(t)&&o.push(e)})}),o};const w$=({api:e,colIndex:t,position:n,filterFn:r})=>{if(!e.columnHeadersContainerRef?.current)return[];if(null===t)return[];const o=[];return e.columnHeadersContainerRef.current.querySelectorAll(`.${XT["left"===n?"columnHeader--pinnedLeft":"columnHeader--pinnedRight"]}`).forEach(e=>{const t=S$(e);null!==t&&r(t,e)&&o.push(e)}),o};function x$(e){return e.virtualScrollerRef.current.querySelectorAll(`:scope > div > div > .${XT.row}`)}function S$(e){const t=e.getAttribute("aria-colindex");return t?Number(t)-1:null}const C$=["className","aria-label"],k$=jh("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle"})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)",lineHeight:"normal"}),E$=TR(function(e,t){const{className:n}=e,r=d(e,C$),o=rP(),i=(e=>{const{classes:t}=e;return wm({root:["columnHeaderTitle"]},YT,t)})(o);return Xp.jsx(k$,f({className:PR(i.root,n),ownerState:o},r,{ref:t}))});function R$(e){const{label:t,description:n}=e,r=rP(),o=s.useRef(null),[i,a]=s.useState(""),l=s.useCallback(()=>{if(!n&&o?.current){const n=(e=o.current).scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth;a(n?t:"")}var e},[n,t]);return Xp.jsx(r.slots.baseTooltip,f({title:n||i},r.slotProps?.baseTooltip,{children:Xp.jsx(E$,{onMouseOver:l,ref:o,children:t})}))}const P$=["resizable","resizing","height","side"];var M$=function(e){return e.Left="left",e.Right="right",e}(M$||{});function T$(e){const{height:t,side:n=M$.Right}=e,r=d(e,P$),o=rP(),i=(e=>{const{resizable:t,resizing:n,classes:r,side:o}=e;return wm({root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",o&&`columnSeparator--side${xf(o)}`],icon:["iconSeparator"]},YT,r)})(f({},e,{side:n,classes:o.classes})),a=s.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]);return Xp.jsx("div",f({className:i.root,style:{minHeight:t}},r,{onClick:a,children:Xp.jsx(o.slots.columnResizeIcon,{className:i.icon})}))}const I$=s.memo(T$),O$=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps","style"],D$=TR(function(e,t){const{classes:n,colIndex:r,height:o,isResizing:i,sortDirection:a,tabIndex:l,separatorSide:c,isDraggable:u,headerComponent:p,description:h,width:m,columnMenuIconButton:g=null,columnMenu:v=null,columnTitleIconButtons:b=null,headerClassName:y,label:w,resizable:x,draggableContainerProps:S,columnHeaderSeparatorProps:C,style:k}=e,E=d(e,O$),R=rP(),P=Tg(s.useRef(null),t);let M="none";return null!=a&&(M="asc"===a?"ascending":"descending"),Xp.jsxs("div",f({className:PR(n.root,y),style:f({},k,{width:m}),role:"columnheader",tabIndex:l,"aria-colindex":r+1,"aria-sort":M},E,{ref:P,children:[Xp.jsxs("div",f({className:n.draggableContainer,draggable:u,role:"presentation"},S,{children:[Xp.jsxs("div",{className:n.titleContainer,role:"presentation",children:[Xp.jsx("div",{className:n.titleContainerContent,children:void 0!==p?p:Xp.jsx(R$,{label:w,description:h,columnWidth:m})}),b]}),g]})),Xp.jsx(I$,f({resizable:!R.disableColumnResize&&!!x,resizing:i,height:o,side:c},C)),v]}))});const F$=KT(function(e){const{colDef:t,columnMenuOpen:n,colIndex:r,headerHeight:o,isResizing:i,isLast:a,sortDirection:l,sortIndex:c,filterItemsCounter:u,hasFocus:d,tabIndex:p,disableReorder:h,separatorSide:m,showLeftBorder:g,showRightBorder:v,pinnedPosition:b,pinnedOffset:y}=e,w=mL(),x=rP(),S=um(),C=s.useRef(null),k=mm(),E=mm(),R=s.useRef(null),[P,M]=s.useState(n),T=!x.disableColumnReorder&&!h&&!t.disableReorder;let I;t.renderHeader&&(I=t.renderHeader(w.current.getColumnHeaderParams(t.field)));const O=(e=>{const{disableColumnSorting:t}=rP(),{colDef:n,classes:r,isDragging:o,sortDirection:i,showRightBorder:a,showLeftBorder:l,filterItemsCounter:s,pinnedPosition:c,isSiblingFocused:u}=e,d=n.sortable&&!t,p=null!=i,f=null!=s&&s>0,h="number"===n.type;return wm({root:["columnHeader","left"===n.headerAlign&&"columnHeader--alignLeft","center"===n.headerAlign&&"columnHeader--alignCenter","right"===n.headerAlign&&"columnHeader--alignRight",d&&"columnHeader--sortable",o&&"columnHeader--moving",p&&"columnHeader--sorted",f&&"columnHeader--filtered",h&&"columnHeader--numeric","withBorderColor",a&&"columnHeader--withRightBorder",l&&"columnHeader--withLeftBorder",c===nD.LEFT&&"columnHeader--pinnedLeft",c===nD.RIGHT&&"columnHeader--pinnedRight",u&&"columnHeader--siblingFocused"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]},YT,r)})(f({},e,{classes:x.classes,showRightBorder:v,showLeftBorder:g})),D=s.useCallback(e=>n=>{v$(n)||w.current.publishEvent(e,w.current.getColumnHeaderParams(t.field),n)},[w,t.field]),F=s.useMemo(()=>({onClick:D("columnHeaderClick"),onContextMenu:D("columnHeaderContextMenu"),onDoubleClick:D("columnHeaderDoubleClick"),onMouseOver:D("columnHeaderOver"),onMouseOut:D("columnHeaderOut"),onMouseEnter:D("columnHeaderEnter"),onMouseLeave:D("columnHeaderLeave"),onKeyDown:D("columnHeaderKeyDown"),onFocus:D("columnHeaderFocus"),onBlur:D("columnHeaderBlur")}),[D]),L=s.useMemo(()=>T?{onDragStart:D("columnHeaderDragStart"),onDragEnter:D("columnHeaderDragEnter"),onDragOver:D("columnHeaderDragOver"),onDragEndCapture:D("columnHeaderDragEnd")}:{},[T,D]),A=s.useMemo(()=>({onMouseDown:D("columnSeparatorMouseDown"),onDoubleClick:D("columnSeparatorDoubleClick")}),[D]);s.useEffect(()=>{!P&&n&&M(n)},[P,n]);const N=s.useCallback(()=>{M(!1)},[]),$=!x.disableColumnMenu&&!t.disableColumnMenu&&Xp.jsx(p$,{colDef:t,columnMenuId:k,columnMenuButtonId:E,open:P,iconButtonRef:R}),z=Xp.jsx(f$,{columnMenuId:k,columnMenuButtonId:E,field:t.field,open:n,target:R.current,ContentComponent:x.slots.columnMenu,contentComponentProps:x.slotProps?.columnMenu,onExited:N}),j=t.sortingOrder??x.sortingOrder,B=(t.sortable||null!=l)&&!t.hideSortIcons&&!x.disableColumnSorting,_=Xp.jsxs(s.Fragment,{children:[!x.disableColumnFilter&&Xp.jsx(x.slots.columnHeaderFilterIconButton,f({field:t.field,counter:u},x.slotProps?.columnHeaderFilterIconButton)),B&&Xp.jsx(x.slots.columnHeaderSortIcon,f({field:t.field,direction:l,index:c,sortingOrder:j,disabled:!t.sortable},x.slotProps?.columnHeaderSortIcon))]});s.useLayoutEffect(()=>{const e=w.current.state.columnMenu;if(d&&!e.open){const e=C.current.querySelector('[tabindex="0"]')||C.current;if(!e)return;if(CN())e.focus({preventScroll:!0});else{const t=w.current.getScrollPosition();e.focus(),w.current.scroll(t)}}},[w,d]);const H="function"==typeof t.headerClassName?t.headerClassName({field:t.field,colDef:t}):t.headerClassName,V=t.headerName??t.field,W=s.useMemo(()=>EN(f({},e.style),S,b,y),[b,y,e.style,S]);return Xp.jsx(D$,f({ref:C,classes:O,columnMenuOpen:n,colIndex:r,height:o,isResizing:i,sortDirection:l,hasFocus:d,tabIndex:p,separatorSide:m,isDraggable:T,headerComponent:I,description:t.description,elementId:t.field,width:t.computedWidth,columnMenuIconButton:$,columnTitleIconButtons:_,headerClassName:PR(H,a&&XT["columnHeader--last"]),label:V,resizable:!x.disableColumnResize&&!!t.resizable,"data-field":t.field,columnMenu:z,draggableContainerProps:L,columnHeaderSeparatorProps:A,style:W},F))}),L$=["className"],A$=jh("div",{name:"MuiDataGrid",slot:"IconButtonContainer"})(()=>({display:"flex",visibility:"hidden",width:0})),N$=TR(function(e,t){const{className:n}=e,r=d(e,L$),o=rP(),i=(e=>{const{classes:t}=e;return wm({root:["iconButtonContainer"]},YT,t)})(o);return Xp.jsx(A$,f({className:PR(i.root,n),ownerState:o},r,{ref:t}))}),$$=["direction","index","sortingOrder","disabled","className"],z$=jh(gI,{name:"MuiDataGrid",slot:"SortButton"})({transition:bP.transition(["opacity"],{duration:bP.transitions.duration.short,easing:bP.transitions.easing.easeInOut})});function j$(e){const{direction:t,index:n,sortingOrder:r,disabled:o,className:i}=e,a=d(e,$$),l=lP(),c=rP(),u=f({},e,{classes:c.classes}),p=(e=>{const{classes:t}=e;return wm({root:["sortButton"],icon:["sortIcon"]},YT,t)})(u),h=function(e,t,n,r){let o;const i={};return"asc"===t?o=e.columnSortedAscendingIcon:"desc"===t?o=e.columnSortedDescendingIcon:(o=e.columnUnsortedIcon,i.sortingOrder=r),o?Xp.jsx(o,f({fontSize:"small",className:n},i)):null}(c.slots,t,p.icon,r);if(!h)return null;const m=Xp.jsx(z$,f({as:c.slots.baseIconButton,ownerState:u,"aria-label":l.current.getLocaleText("columnHeaderSortIconLabel"),title:l.current.getLocaleText("columnHeaderSortIconLabel"),size:"small",disabled:o,className:PR(p.root,i)},c.slotProps?.baseIconButton,a,{children:h}));return Xp.jsxs(s.Fragment,{children:[null!=n&&Xp.jsx(c.slots.baseBadge,{badgeContent:n,color:"default",overlap:"circular",children:m}),null==n&&m]})}function B$(e){return Xp.jsx(N$,{children:Xp.jsx(j$,f({},e,{tabIndex:-1}))})}const _$=s.memo(B$);function H$(e){const{counter:t,field:n,onClick:r}=e,o=lP(),i=rP(),a=(e=>{const{classes:t}=e;return wm({icon:["filterIcon"]},YT,t)})(f({},e,{classes:i.classes})),l=mm(),c=pI(o,qL,l),u=mm(),d=s.useCallback(e=>{e.preventDefault(),e.stopPropagation();const{open:t,openedPanelValue:i}=KL(o);t&&i===YL.filters?o.current.hideFilterPanel():o.current.showFilterPanel(void 0,u,l),r&&r(o.current.getColumnHeaderParams(n),e)},[o,n,r,u,l]);if(!t)return null;const p=Xp.jsx(i.slots.baseIconButton,f({id:l,onClick:d,"aria-label":o.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":c,"aria-controls":c?u:void 0},i.slotProps?.baseIconButton,{children:Xp.jsx(i.slots.columnFilteredIcon,{className:a.icon,fontSize:"small"})}));return Xp.jsx(i.slots.baseTooltip,f({title:o.current.getLocaleText("columnHeaderFiltersTooltipActive")(t),enterDelay:1e3},i.slotProps?.baseTooltip,{children:Xp.jsxs(N$,{children:[t>1&&Xp.jsx(i.slots.baseBadge,{badgeContent:t,color:"default",children:p}),1===t&&p]})}))}const V$=["hideMenu","colDef","id","labelledby","className","children","open"],W$=pg(gI)(()=>({minWidth:248}));function U$(e){e.currentTarget.contains(e.target)&&e.stopPropagation()}const G$=TR(function(e,t){const{hideMenu:n,id:r,labelledby:o,className:i,children:a,open:l}=e,c=d(e,V$),u=rP(),p=s.useCallback(e=>{"Tab"===e.key&&e.preventDefault(),NO(e.key)&&n(e)},[n]);return Xp.jsx(W$,f({as:u.slots.baseMenuList,id:r,className:PR(XT.menuList,i),"aria-labelledby":o,onKeyDown:p,onWheel:U$,onTouchMove:U$,autoFocus:l},c,{ref:t,children:a}))}),K$=["displayOrder"];function q$(e){const{colDef:t,onClick:n}=e,r=lP(),o=rP(),i=1===cO(r).filter(e=>!0!==e.disableColumnMenu).length,a=s.useCallback(e=>{i||(r.current.setColumnVisibility(t.field,!1),n(e))},[r,t.field,n,i]);return o.disableColumnSelector||!1===t.hideable?null:Xp.jsx(o.slots.baseMenuItem,{onClick:a,disabled:i,iconStart:Xp.jsx(o.slots.columnMenuHideIcon,{fontSize:"small"}),children:r.current.getLocaleText("columnMenuHideColumn")})}function Y$(e){const{onClick:t}=e,n=lP(),r=rP(),o=s.useCallback(e=>{t(e),n.current.showPreferences(YL.columns)},[n,t]);return r.disableColumnSelector?null:Xp.jsx(r.slots.baseMenuItem,{onClick:o,iconStart:Xp.jsx(r.slots.columnMenuManageColumnsIcon,{fontSize:"small"}),children:n.current.getLocaleText("columnMenuManageColumns")})}const X$=["defaultSlots","defaultSlotProps","slots","slotProps"],Q$={columnMenuSortItem:function(e){const{colDef:t,onClick:n}=e,r=lP(),o=pI(r,gD),i=rP(),a=s.useMemo(()=>{if(!t)return null;const e=o.find(e=>e.field===t.field);return e?.sort},[t,o]),l=t.sortingOrder??i.sortingOrder,c=s.useCallback(e=>{n(e);const o=e.currentTarget.getAttribute("data-value")||null,l="always"===i.multipleColumnsSortingMode;r.current.sortColumn(t.field,o===a?null:o,l)},[r,t,n,a,i.multipleColumnsSortingMode]);if(i.disableColumnSorting||!t||!t.sortable||!l.some(e=>!!e))return null;const u=e=>{const n=r.current.getLocaleText(e);return"function"==typeof n?n(t):n};return Xp.jsxs(s.Fragment,{children:[l.includes("asc")&&"asc"!==a?Xp.jsx(i.slots.baseMenuItem,{onClick:c,"data-value":"asc",iconStart:Xp.jsx(i.slots.columnMenuSortAscendingIcon,{fontSize:"small"}),children:u("columnMenuSortAsc")}):null,l.includes("desc")&&"desc"!==a?Xp.jsx(i.slots.baseMenuItem,{onClick:c,"data-value":"desc",iconStart:Xp.jsx(i.slots.columnMenuSortDescendingIcon,{fontSize:"small"}),children:u("columnMenuSortDesc")}):null,l.includes(null)&&null!=a?Xp.jsx(i.slots.baseMenuItem,{onClick:c,iconStart:i.slots.columnMenuUnsortIcon?Xp.jsx(i.slots.columnMenuUnsortIcon,{fontSize:"small"}):Xp.jsx("span",{}),children:r.current.getLocaleText("columnMenuUnsort")}):null]})},columnMenuFilterItem:function(e){const{colDef:t,onClick:n}=e,r=lP(),o=rP(),i=s.useCallback(e=>{n(e),r.current.showFilterPanel(t.field)},[r,t.field,n]);return o.disableColumnFilter||!t.filterable?null:Xp.jsx(o.slots.baseMenuItem,{onClick:i,iconStart:Xp.jsx(o.slots.columnMenuFilterIcon,{fontSize:"small"}),children:r.current.getLocaleText("columnMenuFilter")})},columnMenuColumnsItem:function(e){return Xp.jsxs(s.Fragment,{children:[Xp.jsx(q$,f({},e)),Xp.jsx(Y$,f({},e))]})}},Z$={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},J$=TR(function(e,t){const{defaultSlots:n,defaultSlotProps:r,slots:o,slotProps:i}=e,a=d(e,X$),l=(e=>{const t=mL(),n=rP(),{defaultSlots:r,defaultSlotProps:o,slots:i={},slotProps:a={},hideMenu:l,colDef:c,addDividers:u=!0}=e,p=s.useMemo(()=>f({},r,i),[r,i]),h=s.useMemo(()=>{if(!a||0===Object.keys(a).length)return o;const e=f({},a);return Object.entries(o).forEach(([t,n])=>{e[t]=f({},n,a[t]||{})}),e},[o,a]),m=t.current.unstable_applyPipeProcessors("columnMenu",[],e.colDef),g=s.useMemo(()=>{const e=Object.keys(r);return Object.keys(i).filter(t=>!e.includes(t))},[i,r]);return s.useMemo(()=>{const e=Array.from(new Set([...m,...g])).filter(e=>null!=p[e]),t=e.sort((e,t)=>{const n=h[e],r=h[t];return(Number.isFinite(n?.displayOrder)?n.displayOrder:100)-(Number.isFinite(r?.displayOrder)?r.displayOrder:100)});return t.reduce((e,r,o)=>{let i={colDef:c,onClick:l};const a=h[r];return a&&(i=f({},i,d(a,K$))),u&&o!==t.length-1?[...e,[p[r],i],[n.slots.baseDivider,{}]]:[...e,[p[r],i]]},[])},[u,c,m,l,p,h,g,n.slots.baseDivider])})(f({},a,{defaultSlots:n,defaultSlotProps:r,slots:o,slotProps:i}));return Xp.jsx(G$,f({},a,{ref:t,children:l.map(([e,t],n)=>Xp.jsx(e,f({},t),n))}))}),ez=TR(function(e,t){return Xp.jsx(J$,f({},e,{ref:t,defaultSlots:Q$,defaultSlotProps:Z$}))}),tz=["className"],nz=pg("div",{name:"MuiDataGrid",slot:"PanelWrapper"})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),rz=TR(function(e,t){const{className:n}=e,r=d(e,tz),o=rP(),i=(e=>{const{classes:t}=e;return wm({root:["panelWrapper"]},YT,t)})(o);return Xp.jsx(nz,f({tabIndex:-1,className:PR(i.root,n),ownerState:o},r,{ref:t}))});const oz=["children","className","classes","onClose"],iz=Mh("MuiDataGrid",["panel","paper"]),az=pg(gI,{name:"MuiDataGrid",slot:"panel"})({zIndex:bP.zIndex.panel}),lz=pg("div",{name:"MuiDataGrid",slot:"panelContent"})({backgroundColor:bP.colors.background.overlay,borderRadius:bP.radius.base,boxShadow:bP.shadows.overlay,display:"flex",maxWidth:`calc(100vw - ${bP.spacing(2)})`,overflow:"auto"}),sz=TR((e,t)=>{const{children:n,className:r,onClose:o}=e,i=d(e,oz),a=lP(),l=rP(),c=iz,[u,p]=s.useState(!1),h=_O(),m=Mg(()=>p(!0)),g=Mg(()=>p(!1)),v=Mg(()=>{o?.()}),b=Mg(e=>{"Escape"===e.key&&o?.()}),[y,w]=s.useState(null);return s.useEffect(()=>{const e=a.current.rootElementRef?.current?.querySelector('[data-id="gridPanelAnchor"]');e&&w(e)},[a]),y?Xp.jsx(az,f({as:l.slots.basePopper,ownerState:l,placement:"bottom-end",className:PR(c.panel,r,h),flip:!0,onDidShow:m,onDidHide:g,onClickAway:v,clickAwayMouseEvent:"onPointerUp",clickAwayTouchEvent:!1,focusTrap:!0},i,l.slotProps?.basePopper,{target:e.target??y,ref:t,children:Xp.jsx(lz,{className:c.paper,ownerState:l,onKeyDown:b,children:u&&n})})):null}),cz=["className"],uz=jh("div",{name:"MuiDataGrid",slot:"PanelContent"})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400,padding:bP.spacing(2.5,1.5,2,1),gap:bP.spacing(2.5)});function dz(e){const{className:t}=e,n=d(e,cz),r=rP(),o=(e=>{const{classes:t}=e;return wm({root:["panelContent"]},YT,t)})(r);return Xp.jsx(uz,f({className:PR(o.root,t),ownerState:r},n))}const pz=["className"],fz=pg("div",{name:"MuiDataGrid",slot:"PanelFooter"})({padding:bP.spacing(1),display:"flex",justifyContent:"space-between",borderTop:`1px solid ${bP.colors.border.base}`});function hz(e){const{className:t}=e,n=d(e,pz),r=rP(),o=(e=>{const{classes:t}=e;return wm({root:["panelFooter"]},YT,t)})(r);return Xp.jsx(fz,f({className:PR(o.root,t),ownerState:r},n))}const mz=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","readOnly","children"],gz=["InputComponentProps"],vz=pg("div",{name:"MuiDataGrid",slot:"FilterForm"})({display:"flex",gap:bP.spacing(1.5)}),bz=pg("div",{name:"MuiDataGrid",slot:"FilterFormDeleteIcon"})({flexShrink:0,display:"flex",justifyContent:"center",alignItems:"center"}),yz=pg("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput"})({minWidth:75,justifyContent:"end"}),wz=pg("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput"})({width:150}),xz=pg("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput"})({width:150}),Sz=pg("div",{name:"MuiDataGrid",slot:"FilterFormValueInput"})({width:190}),Cz=e=>e.headerName||e.field,kz=new Intl.Collator,Ez=TR(function(e,t){const{item:n,hasMultipleFilters:r,deleteFilter:o,applyFilterChanges:i,showMultiFilterOperators:a,disableMultiFilterOperator:l,applyMultiFilterOperatorChanges:c,focusElementRef:u,logicOperators:p=[BI.And,BI.Or],columnsSort:h,filterColumns:m,deleteIconProps:g={},logicOperatorInputProps:v={},operatorInputProps:b={},columnInputProps:y={},valueInputProps:w={},readOnly:x}=e,S=d(e,mz),C=lP(),k=pI(C,iO),E=pI(C,mO),R=pI(C,yD),P=mm(),M=mm(),T=mm(),I=mm(),O=rP(),D=(e=>{const{classes:t}=e;return wm({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},YT,t)})(O),F=s.useRef(null),L=s.useRef(null),A=R.logicOperator??BI.And,N=r&&p.length>0,$=(O.slotProps?.baseSelect||{}).native??!1,z=O.slotProps?.baseSelectOption||{},{InputComponentProps:j}=w,B=d(w,gz),_=pI(C,SL),H=pI(C,kL),{filteredColumns:V,selectedField:W}=s.useMemo(()=>{let e=n.field;const t=!1===k[n.field].filterable?k[n.field]:null;if(t)return{filteredColumns:[t],selectedField:e};if(_)return{filteredColumns:E.filter(e=>void 0!==H.get(e.field)),selectedField:e};if(void 0===m||"function"!=typeof m)return{filteredColumns:E,selectedField:e};const r=m({field:n.field,columns:E,currentFilters:R?.items||[]});return{filteredColumns:E.filter(t=>{const o=r.includes(t.field);return t.field!==n.field||o||(e=void 0),o}),selectedField:e}},[n.field,k,_,m,E,R?.items,H]),U=s.useMemo(()=>{switch(h){case"asc":return V.sort((e,t)=>kz.compare(Cz(e),Cz(t)));case"desc":return V.sort((e,t)=>-kz.compare(Cz(e),Cz(t)));default:return V}},[V,h]),G=n.field?C.current.getColumn(n.field):null,K=s.useMemo(()=>n.operator&&G?G.filterOperators?.find(e=>e.value===n.operator):null,[n,G]),q=s.useCallback(e=>{const t=e.target.value,r=C.current.getColumn(t);if(r.field===G.field)return;const o=r.filterOperators.find(e=>e.value===n.operator)||r.filterOperators[0];let a=!o.InputComponent||o.InputComponent!==K?.InputComponent||r.type!==G.type?void 0:n.value;if("singleSelect"===r.type&&void 0!==a){const e=r,t=NF(e);Array.isArray(a)?a=a.filter(n=>void 0!==$F(n,t,e?.getOptionValue)):void 0===$F(n.value,t,e?.getOptionValue)&&(a=void 0)}i(f({},n,{field:t,operator:o.value,value:a}))},[C,i,n,G,K]),Y=s.useCallback(e=>{const t=e.target.value,r=G?.filterOperators.find(e=>e.value===t);i(f({},n,{operator:t,value:!r?.InputComponent||r?.InputComponent!==K?.InputComponent?void 0:n.value}))},[i,n,G,K]),X=s.useCallback(e=>{const t=e.target.value===BI.And.toString()?BI.And:BI.Or;c(t)},[c]);return s.useImperativeHandle(u,()=>({focus:()=>{K?.InputComponent?F?.current?.focus():L.current.focus()}}),[K]),Xp.jsxs(vz,f({className:D.root,"data-id":n.id,ownerState:O},S,{ref:t,children:[Xp.jsx(bz,f({},g,{className:PR(D.deleteIcon,g.className),ownerState:O,children:Xp.jsx(O.slots.baseIconButton,f({"aria-label":C.current.getLocaleText("filterPanelDeleteIconLabel"),title:C.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:()=>{o(n)},size:"small",disabled:x},O.slotProps?.baseIconButton,{children:Xp.jsx(O.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),Xp.jsx(yz,f({as:O.slots.baseSelect,sx:[N?{display:"flex"}:{display:"none"},a?{visibility:"visible"}:{visibility:"hidden"},v.sx],className:PR(D.logicOperatorInput,v.className),ownerState:O},v,{size:"small",slotProps:{htmlInput:{"aria-label":C.current.getLocaleText("filterPanelLogicOperator")}},value:A??"",onChange:X,disabled:!!l||1===p.length,native:$},O.slotProps?.baseSelect,{children:p.map(e=>s.createElement(O.slots.baseSelectOption,f({},z,{native:$,key:e.toString(),value:e.toString()}),C.current.getLocaleText((e=>{switch(e){case BI.And:return"filterPanelOperatorAnd";case BI.Or:return"filterPanelOperatorOr";default:throw new Error("MUI X: Invalid `logicOperator` property in the `GridFilterPanel`.")}})(e))))})),Xp.jsx(wz,f({as:O.slots.baseSelect},y,{className:PR(D.columnInput,y.className),ownerState:O,size:"small",labelId:M,id:P,label:C.current.getLocaleText("filterPanelColumns"),value:W??"",onChange:q,native:$,disabled:x},O.slotProps?.baseSelect,{children:U.map(e=>s.createElement(O.slots.baseSelectOption,f({},z,{native:$,key:e.field,value:e.field}),Cz(e)))})),Xp.jsx(xz,f({as:O.slots.baseSelect,size:"small"},b,{className:PR(D.operatorInput,b.className),ownerState:O,labelId:I,label:C.current.getLocaleText("filterPanelOperator"),id:T,value:n.operator,onChange:Y,native:$,inputRef:L,disabled:x},O.slotProps?.baseSelect,{children:G?.filterOperators?.map(e=>s.createElement(O.slots.baseSelectOption,f({},z,{native:$,key:e.value,value:e.value}),e.label||C.current.getLocaleText(`filterOperator${xf(e.value)}`)))})),Xp.jsx(Sz,f({},B,{className:PR(D.valueInput,B.className),ownerState:O,children:K?.InputComponent?Xp.jsx(K.InputComponent,f({apiRef:C,item:n,applyValue:i,focusElementRef:F,disabled:x,slotProps:{root:{size:"small"}}},K.InputComponentProps,j),n.field):null}))]}))}),Rz=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],Pz=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(1e5*Math.random())}),Mz=TR(function(e,t){const n=lP(),r=rP(),o=pI(n,yD),i=pI(n,mO),a=pI(n,gO),l=s.useRef(null),c=s.useRef(null),{logicOperators:u=[BI.And,BI.Or],columnsSort:p,filterFormProps:h,getColumnForNewFilter:m,disableAddFilterButton:g=!1,disableRemoveAllButton:v=!1}=e,b=d(e,Rz),y=n.current.upsertFilterItem,w=s.useCallback(e=>{n.current.setFilterLogicOperator(e)},[n]),x=s.useCallback(()=>{let e;if(m&&"function"==typeof m){const t=m({currentFilters:o?.items||[],columns:i});if(null===t)return null;e=i.find(({field:e})=>e===t)}else e=i.find(e=>e.filterOperators?.length);return e?Pz(e):null},[o?.items,i,m]),S=s.useCallback(()=>{if(void 0===m||"function"!=typeof m)return x();const e=o.items.length?o.items:[x()].filter(Boolean),t=m({currentFilters:e,columns:i});if(null===t)return null;const n=i.find(({field:e})=>e===t);return n?Pz(n):null},[o.items,i,m,x]),C=s.useMemo(()=>o.items.length?o.items:(c.current||(c.current=x()),c.current?[c.current]:[]),[o.items,x]),k=C.length>1,{readOnlyFilters:E,validFilters:R}=s.useMemo(()=>C.reduce((e,t)=>(a[t.field]?e.validFilters.push(t):e.readOnlyFilters.push(t),e),{readOnlyFilters:[],validFilters:[]}),[C,a]),P=s.useCallback(()=>{const e=S();e&&n.current.upsertFilterItems([...C,e])},[n,S,C]),M=s.useCallback(e=>{const t=1===R.length;n.current.deleteFilterItem(e),t&&n.current.hideFilterPanel()},[n,R.length]),T=s.useCallback(()=>1===R.length&&void 0===R[0].value?(n.current.deleteFilterItem(R[0]),n.current.hideFilterPanel()):n.current.setFilterModel(f({},o,{items:E}),"removeAllFilterItems"),[n,E,o,R]);return s.useEffect(()=>{u.length>0&&o.logicOperator&&!u.includes(o.logicOperator)&&w(u[0])},[u,w,o.logicOperator]),s.useEffect(()=>{R.length>0&&l.current.focus()},[R.length]),Xp.jsxs(rz,f({},b,{ref:t,children:[Xp.jsxs(dz,{children:[E.map((e,t)=>Xp.jsx(Ez,f({item:e,applyFilterChanges:y,deleteFilter:M,hasMultipleFilters:k,showMultiFilterOperators:t>0,disableMultiFilterOperator:1!==t,applyMultiFilterOperatorChanges:w,focusElementRef:null,readOnly:!0,logicOperators:u,columnsSort:p},h),null==e.id?t:e.id)),R.map((e,t)=>Xp.jsx(Ez,f({item:e,applyFilterChanges:y,deleteFilter:M,hasMultipleFilters:k,showMultiFilterOperators:E.length+t>0,disableMultiFilterOperator:E.length+t!==1,applyMultiFilterOperatorChanges:w,focusElementRef:t===R.length-1?l:null,logicOperators:u,columnsSort:p},h),null==e.id?t+E.length:e.id))]}),r.disableMultipleColumnsFiltering||g&&v?null:Xp.jsxs(hz,{children:[g?Xp.jsx("span",{}):Xp.jsx(r.slots.baseButton,f({onClick:P,startIcon:Xp.jsx(r.slots.filterPanelAddIcon,{})},r.slotProps?.baseButton,{children:n.current.getLocaleText("filterPanelAddFilter")})),!v&&R.length>0?Xp.jsx(r.slots.baseButton,f({onClick:T,startIcon:Xp.jsx(r.slots.filterPanelRemoveAllIcon,{})},r.slotProps?.baseButton,{children:n.current.getLocaleText("filterPanelRemoveAll")})):null]})]}))}),Tz=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1,Iz=["children"],Oz=zp({from:{opacity:0},to:{opacity:1}}),Dz=zp({"from, to":{"--scrollable":'" "'}}),Fz=jh("div",{name:"MuiDataGrid",slot:"ShadowScrollArea"})`
213
+ `:null,Ck=pg("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!1!==n.animation&&t[n.animation],n.hasChildren&&t.withChildren,n.hasChildren&&!n.width&&t.fitContent,n.hasChildren&&!n.height&&t.heightAuto]}})(vg(({theme:e})=>{const t=(n=e.shape.borderRadius,String(n).match(/[\d.\-+]*\s*(.*)/)[1]||""||"px");var n;const r=function(e){return parseFloat(e)}(e.shape.borderRadius);return{display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:e.alpha(e.palette.text.primary,"light"===e.palette.mode?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${r}${t}/${Math.round(r/.6*10)/10}${t}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:({ownerState:e})=>e.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:e})=>e.hasChildren&&!e.width,style:{maxWidth:"fit-content"}},{props:({ownerState:e})=>e.hasChildren&&!e.height,style:{height:"auto"}},{props:{animation:"pulse"},style:xk||{animation:`${yk} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient(\n 90deg,\n transparent,\n ${(e.vars||e).palette.action.hover},\n transparent\n )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:Sk||{"&::after":{animation:`${wk} 2s linear 0.5s infinite`}}}]}})),kk=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiSkeleton"}),{animation:r="pulse",className:o,component:i="span",height:a,style:l,variant:s="text",width:c,...u}=n,d={...n,animation:r,component:i,variant:s,hasChildren:Boolean(u.children)},p=(e=>{const{classes:t,variant:n,animation:r,hasChildren:o,width:i,height:a}=e;return wm({root:["root",n,r,o&&"withChildren",o&&!i&&"fitContent",o&&!a&&"heightAuto"]},bk,t)})(d);return Xp.jsx(Ck,{as:i,ref:t,className:mg(p.root,o),ownerState:d,...u,style:{width:c,height:a,...l}})});function Ek(e){return Ph("MuiSnackbarContent",e)}Mh("MuiSnackbarContent",["root","message","action"]);const Rk=pg(qg,{name:"MuiSnackbarContent",slot:"Root"})(vg(({theme:e})=>{const t="light"===e.palette.mode?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(lm(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:lm(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),Pk=pg("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),Mk=pg("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),Tk=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiSnackbarContent"}),{action:r,className:o,message:i,role:a="alert",...l}=n,s=n,c=(e=>{const{classes:t}=e;return wm({root:["root"],action:["action"],message:["message"]},Ek,t)})(s);return Xp.jsxs(Rk,{role:a,elevation:6,className:mg(c.root,o),ownerState:s,ref:t,...l,children:[Xp.jsx(Pk,{className:c.message,ownerState:s,children:i}),r?Xp.jsx(Mk,{className:c.action,ownerState:s,children:r}):null]})});function Ik(e){return Ph("MuiSnackbar",e)}Mh("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const Ok=pg("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${xf(n.anchorOrigin.vertical)}${xf(n.anchorOrigin.horizontal)}`]]}})(vg(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:e})=>"top"===e.anchorOrigin.vertical,style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:e})=>"top"!==e.anchorOrigin.vertical,style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:e})=>"left"===e.anchorOrigin.horizontal,style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:e})=>"right"===e.anchorOrigin.horizontal,style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:e})=>"center"===e.anchorOrigin.horizontal,style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),Dk=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiSnackbar"}),r=sg(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{action:i,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:d,ClickAwayListenerProps:p,ContentProps:f,disableWindowBlurListener:h=!1,message:m,onBlur:g,onClose:v,onFocus:b,onMouseEnter:y,onMouseLeave:w,open:x,resumeHideDuration:S,slots:C={},slotProps:k={},TransitionComponent:E,transitionDuration:R=o,TransitionProps:{onEnter:P,onExited:M,...T}={},...I}=n,O={...n,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:c,disableWindowBlurListener:h,TransitionComponent:E,transitionDuration:R},D=(e=>{const{classes:t,anchorOrigin:n}=e;return wm({root:["root",`anchorOrigin${xf(n.vertical)}${xf(n.horizontal)}`]},Ik,t)})(O),{getRootProps:F,onClickAway:L}=function(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:o,resumeHideDuration:i}=e,a=Ng();s.useEffect(()=>{if(o)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){e.defaultPrevented||"Escape"===e.key&&r?.(e,"escapeKeyDown")}},[o,r]);const l=Mg((e,t)=>{r?.(e,t)}),c=Mg(e=>{r&&null!=e&&a.start(e,()=>{l(null,"timeout")})});s.useEffect(()=>(o&&c(t),a.clear),[o,t,c,a]);const u=a.clear,d=s.useCallback(()=>{null!=t&&c(null!=i?i:.5*t)},[t,i,c]),p=e=>t=>{const n=e.onFocus;n?.(t),u()},f=e=>t=>{const n=e.onMouseEnter;n?.(t),u()},h=e=>t=>{const n=e.onMouseLeave;n?.(t),d()};return s.useEffect(()=>{if(!n&&o)return window.addEventListener("focus",d),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",d),window.removeEventListener("blur",u)}},[n,o,d,u]),{getRootProps:(t={})=>{const n={...Hg(e),...Hg(t)};return{role:"presentation",...t,...n,onBlur:(r=n,e=>{const t=r.onBlur;t?.(e),d()}),onFocus:p(n),onMouseEnter:f(n),onMouseLeave:h(n)};var r},onClickAway:e=>{r?.(e,"clickaway")}}}(O),[A,N]=s.useState(!0),$={slots:{transition:E,...C},slotProps:{content:f,clickAwayListener:p,transition:T,...k}},[z,j]=Ug("root",{ref:t,className:[D.root,d],elementType:Ok,getSlotProps:F,externalForwardedProps:{...$,...I},ownerState:O}),[B,{ownerState:_,...H}]=Ug("clickAwayListener",{elementType:px,externalForwardedProps:$,getSlotProps:e=>({onClickAway:(...t)=>{const n=t[0];e.onClickAway?.(...t),n?.defaultMuiPrevented||L(...t)}}),ownerState:O}),[V,W]=Ug("content",{elementType:Tk,shouldForwardComponentProp:!0,externalForwardedProps:$,additionalProps:{message:m,action:i},ownerState:O}),[U,G]=Ug("transition",{elementType:PS,externalForwardedProps:$,getSlotProps:e=>({onEnter:(...t)=>{e.onEnter?.(...t),((e,t)=>{N(!1),P&&P(e,t)})(...t)},onExited:(...t)=>{e.onExited?.(...t),(e=>{N(!0),M&&M(e)})(...t)}}),additionalProps:{appear:!0,in:x,timeout:R,direction:"top"===a?"down":"up"},ownerState:O});return!x&&A?null:Xp.jsx(B,{...H,...C.clickAwayListener&&{ownerState:_},children:Xp.jsx(z,{...j,children:Xp.jsx(U,{...G,children:u||Xp.jsx(V,{...W})})})})});function Fk(e){return Ph("MuiTooltip",e)}const Lk=Mh("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);const Ak=pg(My,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(vg(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:e})=>!e.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:e})=>!e,style:{pointerEvents:"none"}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${Lk.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Lk.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Lk.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Lk.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${Lk.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${Lk.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${Lk.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${Lk.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),Nk=pg("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${xf(n.placement.split("-")[0])}`]]}})(vg(({theme:e})=>{return{backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${Lk.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Lk.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Lk.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Lk.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:e})=>e.arrow,style:{position:"relative",margin:0}},{props:({ownerState:e})=>e.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:(t=16/14,Math.round(1e5*t)/1e5)+"em",fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:e})=>!e.isRtl,style:{[`.${Lk.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Lk.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${Lk.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Lk.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${Lk.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Lk.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${Lk.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Lk.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${Lk.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${Lk.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]};var t})),$k=pg("span",{name:"MuiTooltip",slot:"Arrow"})(vg(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let zk=!1;const jk=new Ag;let Bk={x:0,y:0};function _k(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const Hk=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTooltip"}),{arrow:r=!1,children:o,classes:i,components:a={},componentsProps:l={},describeChild:c=!1,disableFocusListener:u=!1,disableHoverListener:d=!1,disableInteractive:p=!1,disableTouchListener:f=!1,enterDelay:h=100,enterNextDelay:m=0,enterTouchDelay:g=700,followCursor:v=!1,id:b,leaveDelay:y=0,leaveTouchDelay:w=1500,onClose:x,onOpen:S,open:C,placement:k="bottom",PopperComponent:E,PopperProps:R={},slotProps:P={},slots:M={},title:T,TransitionComponent:I,TransitionProps:O,...D}=n,F=s.isValidElement(o)?o:Xp.jsx("span",{children:o}),L=sg(),A=um(),[N,$]=s.useState(),[z,j]=s.useState(null),B=s.useRef(!1),_=p||v,H=Ng(),V=Ng(),W=Ng(),U=Ng(),[G,K]=Pg({controlled:C,default:!1,name:"Tooltip",state:"open"});let q=G;const Y=mm(b),X=s.useRef(),Q=Mg(()=>{void 0!==X.current&&(document.body.style.WebkitUserSelect=X.current,X.current=void 0),U.clear()});s.useEffect(()=>Q,[Q]);const Z=e=>{jk.clear(),zk=!0,K(!0),S&&!q&&S(e)},J=Mg(e=>{jk.start(800+y,()=>{zk=!1}),K(!1),x&&q&&x(e),H.start(L.transitions.duration.shortest,()=>{B.current=!1})}),ee=e=>{B.current&&"touchstart"!==e.type||(N&&N.removeAttribute("title"),V.clear(),W.clear(),h||zk&&m?V.start(zk?m:h,()=>{Z(e)}):Z(e))},te=e=>{V.clear(),W.start(y,()=>{J(e)})},[,ne]=s.useState(!1),re=e=>{Xg(e.target)||(ne(!1),te(e))},oe=e=>{N||$(e.currentTarget),Xg(e.target)&&(ne(!0),ee(e))},ie=e=>{B.current=!0;const t=F.props;t.onTouchStart&&t.onTouchStart(e)},ae=e=>{ie(e),W.clear(),H.clear(),Q(),X.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",U.start(g,()=>{document.body.style.WebkitUserSelect=X.current,ee(e)})},le=e=>{F.props.onTouchEnd&&F.props.onTouchEnd(e),Q(),W.start(w,()=>{J(e)})};s.useEffect(()=>{if(q)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){"Escape"===e.key&&J(e)}},[J,q]);const se=Tg(wy(F),$,t);T||0===T||(q=!1);const ce=s.useRef(),ue={},de="string"==typeof T;c?(ue.title=q||!de||d?null:T,ue["aria-describedby"]=q?Y:null):(ue["aria-label"]=de?T:null,ue["aria-labelledby"]=q&&!de?Y:null);const pe={...ue,...D,...F.props,className:mg(D.className,F.props.className),onTouchStart:ie,ref:se,...v?{onMouseMove:e=>{const t=F.props;t.onMouseMove&&t.onMouseMove(e),Bk={x:e.clientX,y:e.clientY},ce.current&&ce.current.update()}}:{}},fe={};f||(pe.onTouchStart=ae,pe.onTouchEnd=le),d||(pe.onMouseOver=_k(ee,pe.onMouseOver),pe.onMouseLeave=_k(te,pe.onMouseLeave),_||(fe.onMouseOver=ee,fe.onMouseLeave=te)),u||(pe.onFocus=_k(oe,pe.onFocus),pe.onBlur=_k(re,pe.onBlur),_||(fe.onFocus=oe,fe.onBlur=re));const he={...n,isRtl:A,arrow:r,disableInteractive:_,placement:k,PopperComponentProp:E,touch:B.current},me="function"==typeof P.popper?P.popper(he):P.popper,ge=s.useMemo(()=>{let e=[{name:"arrow",enabled:Boolean(z),options:{element:z,padding:4}}];return R.popperOptions?.modifiers&&(e=e.concat(R.popperOptions.modifiers)),me?.popperOptions?.modifiers&&(e=e.concat(me.popperOptions.modifiers)),{...R.popperOptions,...me?.popperOptions,modifiers:e}},[z,R.popperOptions,me?.popperOptions]),ve=(e=>{const{classes:t,disableInteractive:n,arrow:r,touch:o,placement:i}=e;return wm({popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",o&&"touch",`tooltipPlacement${xf(i.split("-")[0])}`],arrow:["arrow"]},Fk,t)})(he),be="function"==typeof P.transition?P.transition(he):P.transition,ye={slots:{popper:a.Popper,transition:a.Transition??I,tooltip:a.Tooltip,arrow:a.Arrow,...M},slotProps:{arrow:P.arrow??l.arrow,popper:{...R,...me??l.popper},tooltip:P.tooltip??l.tooltip,transition:{...O,...be??l.transition}}},[we,xe]=Ug("popper",{elementType:Ak,externalForwardedProps:ye,ownerState:he,className:mg(ve.popper,R?.className)}),[Se,Ce]=Ug("transition",{elementType:PS,externalForwardedProps:ye,ownerState:he}),[ke,Ee]=Ug("tooltip",{elementType:Nk,className:ve.tooltip,externalForwardedProps:ye,ownerState:he}),[Re,Pe]=Ug("arrow",{elementType:$k,className:ve.arrow,externalForwardedProps:ye,ownerState:he,ref:j});return Xp.jsxs(s.Fragment,{children:[s.cloneElement(F,pe),Xp.jsx(we,{as:E??My,placement:k,anchorEl:v?{getBoundingClientRect:()=>({top:Bk.y,left:Bk.x,right:Bk.x,bottom:Bk.y,width:0,height:0})}:N,popperRef:ce,open:!!N&&q,id:Y,transition:!0,...fe,...xe,popperOptions:ge,children:({TransitionProps:e})=>Xp.jsx(Se,{timeout:L.transitions.duration.shorter,...e,...Ce,children:Xp.jsxs(ke,{...Ee,children:[T,r?Xp.jsx(Re,{...Pe}):null]})})})]})});function Vk(e){return Ph("MuiSwitch",e)}const Wk=Mh("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),Uk=pg("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${xf(n.edge)}`],t[`size${xf(n.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${Wk.thumb}`]:{width:16,height:16},[`& .${Wk.switchBase}`]:{padding:4,[`&.${Wk.checked}`]:{transform:"translateX(16px)"}}}}]}),Gk=pg(ex,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${Wk.input}`]:t.input},"default"!==n.color&&t[`color${xf(n.color)}`]]}})(vg(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${"light"===e.palette.mode?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${Wk.checked}`]:{transform:"translateX(20px)"},[`&.${Wk.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${"light"===e.palette.mode?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${Wk.checked} + .${Wk.track}`]:{opacity:.5},[`&.${Wk.disabled} + .${Wk.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:""+("light"===e.palette.mode?.12:.2)},[`& .${Wk.input}`]:{left:"-100%",width:"300%"}})),vg(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(uv(["light"])).map(([t])=>({props:{color:t},style:{[`&.${Wk.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Wk.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${"light"===e.palette.mode?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.55)}`}},[`&.${Wk.checked} + .${Wk.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),Kk=pg("span",{name:"MuiSwitch",slot:"Track"})(vg(({theme:e})=>({height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${"light"===e.palette.mode?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:""+("light"===e.palette.mode?.38:.3)}))),qk=pg("span",{name:"MuiSwitch",slot:"Thumb"})(vg(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),Yk=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiSwitch"}),{className:r,color:o="primary",edge:i=!1,size:a="medium",sx:l,slots:s={},slotProps:c={},...u}=n,d={...n,color:o,edge:i,size:a},p=(e=>{const{classes:t,edge:n,size:r,color:o,checked:i,disabled:a}=e,l=wm({root:["root",n&&`edge${xf(n)}`,`size${xf(r)}`],switchBase:["switchBase",`color${xf(o)}`,i&&"checked",a&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},Vk,t);return{...t,...l}})(d),f={slots:s,slotProps:c},[h,m]=Ug("root",{className:mg(p.root,r),elementType:Uk,externalForwardedProps:f,ownerState:d,additionalProps:{sx:l}}),[g,v]=Ug("thumb",{className:p.thumb,elementType:qk,externalForwardedProps:f,ownerState:d}),b=Xp.jsx(g,{...v}),[y,w]=Ug("track",{className:p.track,elementType:Kk,externalForwardedProps:f,ownerState:d});return Xp.jsxs(h,{...m,children:[Xp.jsx(Gk,{type:"checkbox",icon:b,checkedIcon:b,ref:t,ownerState:d,...u,classes:{...p,root:p.switchBase},slots:{...s.switchBase&&{root:s.switchBase},...s.input&&{input:s.input}},slotProps:{...c.switchBase&&{root:"function"==typeof c.switchBase?c.switchBase(d):c.switchBase},input:{role:"switch"},...c.input&&{input:"function"==typeof c.input?c.input(d):c.input}}}),Xp.jsx(y,{...w})]})});function Xk(e){return Ph("MuiTab",e)}const Qk=Mh("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),Zk=pg(sv,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${xf(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${Qk.iconWrapper}`]:t.iconWrapper},{[`& .${Qk.icon}`]:t.icon}]}})(vg(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&("top"===e.iconPosition||"bottom"===e.iconPosition),style:{flexDirection:"column"}},{props:({ownerState:e})=>e.label&&"top"!==e.iconPosition&&"bottom"!==e.iconPosition,style:{flexDirection:"row"}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"top"===t,style:{[`& > .${Qk.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"bottom"===t,style:{[`& > .${Qk.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"start"===t,style:{[`& > .${Qk.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"end"===t,style:{[`& > .${Qk.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${Qk.selected}`]:{opacity:1},[`&.${Qk.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${Qk.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${Qk.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${Qk.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${Qk.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),Jk=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTab"}),{className:r,disabled:o=!1,disableFocusRipple:i=!1,fullWidth:a,icon:l,iconPosition:c="top",indicator:u,label:d,onChange:p,onClick:f,onFocus:h,selected:m,selectionFollowsFocus:g,textColor:v="inherit",value:b,wrapped:y=!1,...w}=n,x={...n,disabled:o,disableFocusRipple:i,selected:m,icon:!!l,iconPosition:c,label:!!d,fullWidth:a,textColor:v,wrapped:y},S=(e=>{const{classes:t,textColor:n,fullWidth:r,wrapped:o,icon:i,label:a,selected:l,disabled:s}=e;return wm({root:["root",i&&a&&"labelIcon",`textColor${xf(n)}`,r&&"fullWidth",o&&"wrapped",l&&"selected",s&&"disabled"],icon:["iconWrapper","icon"]},Xk,t)})(x),C=l&&d&&s.isValidElement(l)?s.cloneElement(l,{className:mg(S.icon,l.props.className)}):l;return Xp.jsxs(Zk,{focusRipple:!i,className:mg(S.root,r),ref:t,role:"tab","aria-selected":m,disabled:o,onClick:e=>{!m&&p&&p(e,b),f&&f(e)},onFocus:e=>{g&&!m&&p&&p(e,b),h&&h(e)},ownerState:x,tabIndex:m?0:-1,...w,children:["top"===c||"start"===c?Xp.jsxs(s.Fragment,{children:[C,d]}):Xp.jsxs(s.Fragment,{children:[d,C]}),u]})}),eE=s.createContext(),tE=s.createContext();function nE(e){return Ph("MuiTableCell",e)}const rE=Mh("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),oE=pg("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${xf(n.size)}`],"normal"!==n.padding&&t[`padding${xf(n.padding)}`],"inherit"!==n.align&&t[`align${xf(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(vg(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid\n ${"light"===e.palette.mode?e.lighten(e.alpha(e.palette.divider,1),.88):e.darken(e.alpha(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${rE.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:e})=>e.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),iE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTableCell"}),{align:r="inherit",className:o,component:i,padding:a,scope:l,size:c,sortDirection:u,variant:d,...p}=n,f=s.useContext(eE),h=s.useContext(tE),m=h&&"head"===h.variant;let g;g=i||(m?"th":"td");let v=l;"td"===g?v=void 0:!v&&m&&(v="col");const b=d||h&&h.variant,y={...n,align:r,component:g,padding:a||(f&&f.padding?f.padding:"normal"),size:c||(f&&f.size?f.size:"medium"),sortDirection:u,stickyHeader:"head"===b&&f&&f.stickyHeader,variant:b},w=(e=>{const{classes:t,variant:n,align:r,padding:o,size:i,stickyHeader:a}=e;return wm({root:["root",n,a&&"stickyHeader","inherit"!==r&&`align${xf(r)}`,"normal"!==o&&`padding${xf(o)}`,`size${xf(i)}`]},nE,t)})(y);let x=null;return u&&(x="asc"===u?"ascending":"descending"),Xp.jsx(oE,{as:g,ref:t,className:mg(w.root,o),"aria-sort":x,scope:v,ownerState:y,...p})});function aE(e){return Ph("MuiToolbar",e)}Mh("MuiToolbar",["root","gutters","regular","dense"]);const lE=pg("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(vg(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),sE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiToolbar"}),{className:r,component:o="div",disableGutters:i=!1,variant:a="regular",...l}=n,s={...n,component:o,disableGutters:i,variant:a},c=(e=>{const{classes:t,disableGutters:n,variant:r}=e;return wm({root:["root",!n&&"gutters",r]},aE,t)})(s);return Xp.jsx(lE,{as:o,className:mg(c.root,r),ref:t,ownerState:s,...l})});var cE=Sg(Xp.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),uE=Sg(Xp.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}));function dE(e){return Ph("MuiTablePaginationActions",e)}Mh("MuiTablePaginationActions",["root"]);const pE=pg("div",{name:"MuiTablePaginationActions",slot:"Root"})({}),fE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTablePaginationActions"}),{backIconButtonProps:r,className:o,count:i,disabled:a=!1,getItemAriaLabel:l,nextIconButtonProps:s,onPageChange:c,page:u,rowsPerPage:d,showFirstButton:p,showLastButton:f,slots:h={},slotProps:m={},...g}=n,v=um(),b=(e=>{const{classes:t}=e;return wm({root:["root"]},dE,t)})(n),y=h.firstButton??Mv,w=h.lastButton??Mv,x=h.nextButton??Mv,S=h.previousButton??Mv,C=h.firstButtonIcon??nk,k=h.lastButtonIcon??rk,E=h.nextButtonIcon??uE,R=h.previousButtonIcon??cE,P=v?w:y,M=v?x:S,T=v?S:x,I=v?y:w,O=v?m.lastButton:m.firstButton,D=v?m.nextButton:m.previousButton,F=v?m.previousButton:m.nextButton,L=v?m.firstButton:m.lastButton;return Xp.jsxs(pE,{ref:t,className:mg(b.root,o),...g,children:[p&&Xp.jsx(P,{onClick:e=>{c(e,0)},disabled:a||0===u,"aria-label":l("first",u),title:l("first",u),...O,children:v?Xp.jsx(k,{...m.lastButtonIcon}):Xp.jsx(C,{...m.firstButtonIcon})}),Xp.jsx(M,{onClick:e=>{c(e,u-1)},disabled:a||0===u,color:"inherit","aria-label":l("previous",u),title:l("previous",u),...D??r,children:v?Xp.jsx(E,{...m.nextButtonIcon}):Xp.jsx(R,{...m.previousButtonIcon})}),Xp.jsx(T,{onClick:e=>{c(e,u+1)},disabled:a||-1!==i&&u>=Math.ceil(i/d)-1,color:"inherit","aria-label":l("next",u),title:l("next",u),...F??s,children:v?Xp.jsx(R,{...m.previousButtonIcon}):Xp.jsx(E,{...m.nextButtonIcon})}),f&&Xp.jsx(I,{onClick:e=>{c(e,Math.max(0,Math.ceil(i/d)-1))},disabled:a||u>=Math.ceil(i/d)-1,"aria-label":l("last",u),title:l("last",u),...L,children:v?Xp.jsx(C,{...m.firstButtonIcon}):Xp.jsx(k,{...m.lastButtonIcon})})]})});function hE(e){return Ph("MuiTablePagination",e)}const mE=Mh("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var gE;const vE=pg(iE,{name:"MuiTablePagination",slot:"Root"})(vg(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),bE=pg(sE,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${mE.actions}`]:t.actions,...t.toolbar})})(vg(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${mE.actions}`]:{flexShrink:0,marginLeft:20}}))),yE=pg("div",{name:"MuiTablePagination",slot:"Spacer"})({flex:"1 1 100%"}),wE=pg("p",{name:"MuiTablePagination",slot:"SelectLabel"})(vg(({theme:e})=>({...e.typography.body2,flexShrink:0}))),xE=pg(vk,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${mE.selectIcon}`]:t.selectIcon,[`& .${mE.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${mE.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),SE=pg(_C,{name:"MuiTablePagination",slot:"MenuItem"})({}),CE=pg("p",{name:"MuiTablePagination",slot:"DisplayedRows"})(vg(({theme:e})=>({...e.typography.body2,flexShrink:0})));function kE({from:e,to:t,count:n}){return`${e}–${t} of ${-1!==n?n:`more than ${t}`}`}function EE(e){return`Go to ${e} page`}const RE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTablePagination"}),{ActionsComponent:r=fE,backIconButtonProps:o,colSpan:i,component:a=iE,count:l,disabled:c=!1,getItemAriaLabel:u=EE,labelDisplayedRows:d=kE,labelRowsPerPage:p="Rows per page:",nextIconButtonProps:f,onPageChange:h,onRowsPerPageChange:m,page:g,rowsPerPage:v,rowsPerPageOptions:b=[10,25,50,100],SelectProps:y={},showFirstButton:w=!1,showLastButton:x=!1,slotProps:S={},slots:C={},...k}=n,E=n,R=(e=>{const{classes:t}=e;return wm({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},hE,t)})(E),P=S?.select??y,M=P.native?"option":SE;let T;a!==iE&&"td"!==a||(T=i||1e3);const I=mm(P.id),O=mm(P.labelId),D={slots:C,slotProps:S},[F,L]=Ug("root",{ref:t,className:R.root,elementType:vE,externalForwardedProps:{...D,component:a,...k},ownerState:E,additionalProps:{colSpan:T}}),[A,N]=Ug("toolbar",{className:R.toolbar,elementType:bE,externalForwardedProps:D,ownerState:E}),[$,z]=Ug("spacer",{className:R.spacer,elementType:yE,externalForwardedProps:D,ownerState:E}),[j,B]=Ug("selectLabel",{className:R.selectLabel,elementType:wE,externalForwardedProps:D,ownerState:E,additionalProps:{id:O}}),[_,H]=Ug("select",{className:R.select,elementType:xE,externalForwardedProps:D,ownerState:E}),[V,W]=Ug("menuItem",{className:R.menuItem,elementType:M,externalForwardedProps:D,ownerState:E}),[U,G]=Ug("displayedRows",{className:R.displayedRows,elementType:CE,externalForwardedProps:D,ownerState:E});return Xp.jsx(F,{...L,children:Xp.jsxs(A,{...N,children:[Xp.jsx($,{...z}),b.length>1&&Xp.jsx(j,{...B,children:p}),b.length>1&&Xp.jsx(_,{variant:"standard",...!P.variant&&{input:gE||(gE=Xp.jsx(nw,{}))},value:v,onChange:m,id:I,labelId:O,...P,classes:{...P.classes,root:mg(R.input,R.selectRoot,(P.classes||{}).root),select:mg(R.select,(P.classes||{}).select),icon:mg(R.selectIcon,(P.classes||{}).icon)},disabled:c,...H,children:b.map(e=>s.createElement(V,{...W,key:e.label?e.label:e,value:e.value?e.value:e},e.label?e.label:e))}),Xp.jsx(U,{...G,children:d({from:0===l?0:g*v+1,to:-1===l?(g+1)*v:-1===v?l:Math.min(l,(g+1)*v),count:-1===l?-1:l,page:g})}),Xp.jsx(r,{className:R.actions,backIconButtonProps:o,count:l,nextIconButtonProps:f,onPageChange:h,page:g,rowsPerPage:v,showFirstButton:w,showLastButton:x,slotProps:S.actions,slots:C.actions,getItemAriaLabel:u,disabled:c})]})})});function PE(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}const ME={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function TE(e){return Ph("MuiTabScrollButton",e)}const IE=Mh("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),OE=pg(sv,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${IE.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),DE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTabScrollButton"}),{className:r,slots:o={},slotProps:i={},direction:a,orientation:l,disabled:s,...c}=n,u=um(),d={isRtl:u,...n},p=(e=>{const{classes:t,orientation:n,disabled:r}=e;return wm({root:["root",n,r&&"disabled"]},TE,t)})(d),f=o.StartScrollButtonIcon??cE,h=o.EndScrollButtonIcon??uE,m=yy({elementType:f,externalSlotProps:i.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),g=yy({elementType:h,externalSlotProps:i.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return Xp.jsx(OE,{component:"div",className:mg(p.root,r),ref:t,role:null,ownerState:d,tabIndex:null,...c,style:{...c.style,..."vertical"===l&&{"--TabScrollButton-svgRotate":`rotate(${u?-90:90}deg)`}},children:"left"===a?Xp.jsx(f,{...m}):Xp.jsx(h,{...g})})});function FE(e){return Ph("MuiTabs",e)}const LE=Mh("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),AE=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,NE=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,$E=(e,t,n)=>{let r=!1,o=n(e,t);for(;o;){if(o===e.firstChild){if(r)return;r=!0}const t=o.disabled||"true"===o.getAttribute("aria-disabled");if(o.hasAttribute("tabindex")&&!t)return void o.focus();o=n(e,o)}},zE=pg("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${LE.scrollButtons}`]:t.scrollButtons},{[`& .${LE.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(vg(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${LE.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),jE=pg("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),BE=pg("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),_E=pg("span",{name:"MuiTabs",slot:"Indicator"})(vg(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:"100%",width:2,right:0}}]}))),HE=pg(function(e){const{onChange:t,...n}=e,r=s.useRef(),o=s.useRef(null),i=()=>{r.current=o.current.offsetHeight-o.current.clientHeight};return Wh(()=>{const e=Cg(()=>{const e=r.current;i(),e!==r.current&&t(r.current)}),n=Eg(o.current);return n.addEventListener("resize",e),()=>{e.clear(),n.removeEventListener("resize",e)}},[t]),s.useEffect(()=>{i(),t(r.current)},[t]),Xp.jsx("div",{style:ME,...n,ref:o})})({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),VE={},WE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTabs"}),r=sg(),o=um(),{"aria-label":i,"aria-labelledby":a,action:l,centered:c=!1,children:u,className:d,component:p="div",allowScrollButtonsMobile:f=!1,indicatorColor:h="primary",onChange:m,orientation:g="horizontal",ScrollButtonComponent:v,scrollButtons:b="auto",selectionFollowsFocus:y,slots:w={},slotProps:x={},TabIndicatorProps:S={},TabScrollButtonProps:C={},textColor:k="primary",value:E,variant:R="standard",visibleScrollbar:P=!1,...M}=n,T="scrollable"===R,I="vertical"===g,O=I?"scrollTop":"scrollLeft",D=I?"top":"left",F=I?"bottom":"right",L=I?"clientHeight":"clientWidth",A=I?"height":"width",N={...n,component:p,allowScrollButtonsMobile:f,indicatorColor:h,orientation:g,vertical:I,scrollButtons:b,textColor:k,variant:R,visibleScrollbar:P,fixed:!T,hideScrollbar:T&&!P,scrollableX:T&&!I,scrollableY:T&&I,centered:c&&!T,scrollButtonsHideMobile:!f},$=(e=>{const{vertical:t,fixed:n,hideScrollbar:r,scrollableX:o,scrollableY:i,centered:a,scrollButtonsHideMobile:l,classes:s}=e;return wm({root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",o&&"scrollableX",i&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",l&&"scrollButtonsHideMobile"],scrollableX:[o&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},FE,s)})(N),z=yy({elementType:w.StartScrollButtonIcon,externalSlotProps:x.startScrollButtonIcon,ownerState:N}),j=yy({elementType:w.EndScrollButtonIcon,externalSlotProps:x.endScrollButtonIcon,ownerState:N}),[B,_]=s.useState(!1),[H,V]=s.useState(VE),[W,U]=s.useState(!1),[G,K]=s.useState(!1),[q,Y]=s.useState(!1),[X,Q]=s.useState({overflow:"hidden",scrollbarWidth:0}),Z=new Map,J=s.useRef(null),ee=s.useRef(null),te={slots:w,slotProps:{indicator:S,scrollButton:C,...x}},ne=()=>{const e=J.current;let t,n;if(e){const n=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}if(e&&!1!==E){const e=ee.current.children;if(e.length>0){const t=e[Z.get(E)];n=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:n}},re=Mg(()=>{const{tabsMeta:e,tabMeta:t}=ne();let n,r=0;I?(n="top",t&&e&&(r=t.top-e.top+e.scrollTop)):(n=o?"right":"left",t&&e&&(r=(o?-1:1)*(t[n]-e[n]+e.scrollLeft)));const i={[n]:r,[A]:t?t[A]:0};if("number"!=typeof H[n]||"number"!=typeof H[A])V(i);else{const e=Math.abs(H[n]-i[n]),t=Math.abs(H[A]-i[A]);(e>=1||t>=1)&&V(i)}}),oe=(e,{animation:t=!0}={})=>{t?function(e,t,n,r={},o=()=>{}){const{ease:i=PE,duration:a=300}=r;let l=null;const s=t[e];let c=!1;const u=()=>{c=!0},d=r=>{if(c)return void o(new Error("Animation cancelled"));null===l&&(l=r);const u=Math.min(1,(r-l)/a);t[e]=i(u)*(n-s)+s,u>=1?requestAnimationFrame(()=>{o(null)}):requestAnimationFrame(d)};s===n?o(new Error("Element already at target position")):requestAnimationFrame(d)}(O,J.current,e,{duration:r.transitions.duration.standard}):J.current[O]=e},ie=e=>{let t=J.current[O];t+=I?e:e*(o?-1:1),oe(t)},ae=()=>{const e=J.current[L];let t=0;const n=Array.from(ee.current.children);for(let r=0;r<n.length;r+=1){const o=n[r];if(t+o[L]>e){0===r&&(t=e);break}t+=o[L]}return t},le=()=>{ie(-1*ae())},se=()=>{ie(ae())},[ce,{onChange:ue,...de}]=Ug("scrollbar",{className:mg($.scrollableX,$.hideScrollbar),elementType:HE,shouldForwardComponentProp:!0,externalForwardedProps:te,ownerState:N}),pe=s.useCallback(e=>{ue?.(e),Q({overflow:null,scrollbarWidth:e})},[ue]),[fe,he]=Ug("scrollButtons",{className:mg($.scrollButtons,C.className),elementType:DE,externalForwardedProps:te,ownerState:N,additionalProps:{orientation:g,slots:{StartScrollButtonIcon:w.startScrollButtonIcon||w.StartScrollButtonIcon,EndScrollButtonIcon:w.endScrollButtonIcon||w.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:z,endScrollButtonIcon:j}}}),me=Mg(e=>{const{tabsMeta:t,tabMeta:n}=ne();if(n&&t)if(n[D]<t[D]){const r=t[O]+(n[D]-t[D]);oe(r,{animation:e})}else if(n[F]>t[F]){const r=t[O]+(n[F]-t[F]);oe(r,{animation:e})}}),ge=Mg(()=>{T&&!1!==b&&Y(!q)});s.useEffect(()=>{const e=Cg(()=>{J.current&&re()});let t;const n=n=>{n.forEach(e=>{e.removedNodes.forEach(e=>{t?.unobserve(e)}),e.addedNodes.forEach(e=>{t?.observe(e)})}),e(),ge()},r=Eg(J.current);let o;return r.addEventListener("resize",e),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(e),Array.from(ee.current.children).forEach(e=>{t.observe(e)})),"undefined"!=typeof MutationObserver&&(o=new MutationObserver(n),o.observe(ee.current,{childList:!0})),()=>{e.clear(),r.removeEventListener("resize",e),o?.disconnect(),t?.disconnect()}},[re,ge]),s.useEffect(()=>{const e=Array.from(ee.current.children),t=e.length;if("undefined"!=typeof IntersectionObserver&&t>0&&T&&!1!==b){const n=e[0],r=e[t-1],o={root:J.current,threshold:.99},i=new IntersectionObserver(e=>{U(!e[0].isIntersecting)},o);i.observe(n);const a=new IntersectionObserver(e=>{K(!e[0].isIntersecting)},o);return a.observe(r),()=>{i.disconnect(),a.disconnect()}}},[T,b,q,u?.length]),s.useEffect(()=>{_(!0)},[]),s.useEffect(()=>{re()}),s.useEffect(()=>{me(VE!==H)},[me,H]),s.useImperativeHandle(l,()=>({updateIndicator:re,updateScrollButtons:ge}),[re,ge]);const[ve,be]=Ug("indicator",{className:mg($.indicator,S.className),elementType:_E,externalForwardedProps:te,ownerState:N,additionalProps:{style:H}}),ye=Xp.jsx(ve,{...be});let we=0;const xe=s.Children.map(u,e=>{if(!s.isValidElement(e))return null;const t=void 0===e.props.value?we:e.props.value;Z.set(t,we);const n=t===E;return we+=1,s.cloneElement(e,{fullWidth:"fullWidth"===R,indicator:n&&!B&&ye,selected:n,selectionFollowsFocus:y,onChange:m,textColor:k,value:t,...1!==we||!1!==E||e.props.tabIndex?{}:{tabIndex:0}})}),Se=(()=>{const e={};e.scrollbarSizeListener=T?Xp.jsx(ce,{...de,onChange:pe}):null;const t=T&&("auto"===b&&(W||G)||!0===b);return e.scrollButtonStart=t?Xp.jsx(fe,{direction:o?"right":"left",onClick:le,disabled:!W,...he}):null,e.scrollButtonEnd=t?Xp.jsx(fe,{direction:o?"left":"right",onClick:se,disabled:!G,...he}):null,e})(),[Ce,ke]=Ug("root",{ref:t,className:mg($.root,d),elementType:zE,externalForwardedProps:{...te,...M,component:p},ownerState:N}),[Ee,Re]=Ug("scroller",{ref:J,className:$.scroller,elementType:jE,externalForwardedProps:te,ownerState:N,additionalProps:{style:{overflow:X.overflow,[I?"margin"+(o?"Left":"Right"):"marginBottom"]:P?void 0:-X.scrollbarWidth}}}),[Pe,Me]=Ug("list",{ref:ee,className:mg($.list,$.flexContainer),elementType:BE,externalForwardedProps:te,ownerState:N,getSlotProps:e=>({...e,onKeyDown:t=>{(e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;const t=ee.current,n=yx(kg(t)),r=n?.getAttribute("role");if("tab"!==r)return;let i="horizontal"===g?"ArrowLeft":"ArrowUp",a="horizontal"===g?"ArrowRight":"ArrowDown";switch("horizontal"===g&&o&&(i="ArrowRight",a="ArrowLeft"),e.key){case i:e.preventDefault(),$E(t,n,NE);break;case a:e.preventDefault(),$E(t,n,AE);break;case"Home":e.preventDefault(),$E(t,null,AE);break;case"End":e.preventDefault(),$E(t,null,NE)}})(t),e.onKeyDown?.(t)}})});return Xp.jsxs(Ce,{...ke,children:[Se.scrollButtonStart,Se.scrollbarSizeListener,Xp.jsxs(Ee,{...Re,children:[Xp.jsx(Pe,{"aria-label":i,"aria-labelledby":a,"aria-orientation":"vertical"===g?"vertical":null,role:"tablist",...Me,children:xe}),B&&ye]}),Se.scrollButtonEnd]})});function UE(e){return Ph("MuiTextField",e)}Mh("MuiTextField",["root"]);const GE={standard:IS,filled:iS,outlined:tk},KE=pg(sS,{name:"MuiTextField",slot:"Root"})({}),qE=s.forwardRef(function(e,t){const n=bg({props:e,name:"MuiTextField"}),{autoComplete:r,autoFocus:o=!1,children:i,className:a,color:l="primary",defaultValue:s,disabled:c=!1,error:u=!1,FormHelperTextProps:d,fullWidth:p=!1,helperText:f,id:h,InputLabelProps:m,inputProps:g,InputProps:v,inputRef:b,label:y,maxRows:w,minRows:x,multiline:S=!1,name:C,onBlur:k,onChange:E,onFocus:R,placeholder:P,required:M=!1,rows:T,select:I=!1,SelectProps:O,slots:D={},slotProps:F={},type:L,value:A,variant:N="outlined",...$}=n,z={...n,autoFocus:o,color:l,disabled:c,error:u,fullWidth:p,multiline:S,required:M,select:I,variant:N},j=(e=>{const{classes:t}=e;return wm({root:["root"]},UE,t)})(z),B=mm(h),_=f&&B?`${B}-helper-text`:void 0,H=y&&B?`${B}-label`:void 0,V=GE[N],W={slots:D,slotProps:{input:v,inputLabel:m,htmlInput:g,formHelperText:d,select:O,...F}},U={},G=W.slotProps.inputLabel;"outlined"===N&&(G&&void 0!==G.shrink&&(U.notched=G.shrink),U.label=y),I&&(O&&O.native||(U.id=void 0),U["aria-describedby"]=void 0);const[K,q]=Ug("root",{elementType:KE,shouldForwardComponentProp:!0,externalForwardedProps:{...W,...$},ownerState:z,className:mg(j.root,a),ref:t,additionalProps:{disabled:c,error:u,fullWidth:p,required:M,color:l,variant:N}}),[Y,X]=Ug("input",{elementType:V,externalForwardedProps:W,additionalProps:U,ownerState:z}),[Q,Z]=Ug("inputLabel",{elementType:zS,externalForwardedProps:W,ownerState:z}),[J,ee]=Ug("htmlInput",{elementType:"input",externalForwardedProps:W,ownerState:z}),[te,ne]=Ug("formHelperText",{elementType:bS,externalForwardedProps:W,ownerState:z}),[re,oe]=Ug("select",{elementType:vk,externalForwardedProps:W,ownerState:z}),ie=Xp.jsx(Y,{"aria-describedby":_,autoComplete:r,autoFocus:o,defaultValue:s,fullWidth:p,multiline:S,name:C,rows:T,maxRows:w,minRows:x,type:L,value:A,id:B,inputRef:b,onBlur:k,onChange:E,onFocus:R,placeholder:P,inputProps:ee,slots:{input:D.htmlInput?J:void 0},...X});return Xp.jsxs(K,{...q,children:[null!=y&&""!==y&&Xp.jsx(Q,{htmlFor:B,id:H,...Z,children:y}),I?Xp.jsx(re,{"aria-describedby":_,id:B,labelId:H,value:A,input:ie,...oe,children:i}):ie,f&&Xp.jsx(te,{id:_,...ne,children:f})]})});function YE(e){return Ph("MuiToggleButton",e)}const XE=Mh("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),QE=s.createContext({}),ZE=s.createContext(void 0);function JE(e,t){return void 0!==t&&void 0!==e&&(Array.isArray(t)?t.includes(e):e===t)}const eR=pg(sv,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`size${xf(n.size)}`]]}})(vg(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${XE.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${XE.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter(uv()).map(([t])=>({props:{color:t},style:{[`&.${XE.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),tR=s.forwardRef(function(e,t){const{value:n,...r}=s.useContext(QE),o=s.useContext(ZE),i=bg({props:Hh({...r,selected:JE(e.value,n)},e),name:"MuiToggleButton"}),{children:a,className:l,color:c="standard",disabled:u=!1,disableFocusRipple:d=!1,fullWidth:p=!1,onChange:f,onClick:h,selected:m,size:g="medium",value:v,...b}=i,y={...i,color:c,disabled:u,disableFocusRipple:d,fullWidth:p,size:g},w=(e=>{const{classes:t,fullWidth:n,selected:r,disabled:o,size:i,color:a}=e;return wm({root:["root",r&&"selected",o&&"disabled",n&&"fullWidth",`size${xf(i)}`,a]},YE,t)})(y),x=o||"";return Xp.jsx(eR,{className:mg(r.className,w.root,l,x),disabled:u,focusRipple:!d,ref:t,onClick:e=>{h&&(h(e,v),e.defaultPrevented)||f&&f(e,v)},onChange:f,value:v,ownerState:y,"aria-pressed":m,...b,children:a})}),nR=qh({themeId:od}),rR=Number("7");var oR=Sg(Xp.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"})),iR=Sg(Xp.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2m-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}));const aR=s.createElement(oR,{fontSize:"small"}),lR=s.createElement(iR,{fontSize:"small"});function sR({items:e,selectedKeys:t,defaultSelectedKeys:n,onChange:r,inputValue:o,defaultInputValue:i,onInputChange:a,debounceMs:l=300,label:c,placeholder:u,loading:d,disabled:p,size:f="small",error:h,helperText:m,limitTags:g=3,disableClearable:v,id:b,textFieldProps:y}){const w=s.useMemo(()=>Array.isArray(e)?e:[],[e]),x=Array.isArray(t),[S,C]=s.useState(Array.isArray(n)?n:[]),k=x?t:S,E=s.useMemo(()=>{const e=new Map;for(const t of w)e.set(t&&t.key,t);return e},[w]),R=s.useMemo(()=>(Array.isArray(k)?k:[]).map(e=>E.get(e)).filter(Boolean),[k,E]),P="string"==typeof o,[M,T]=s.useState("string"==typeof i?i:""),I=P?o:M,O=function(e,t=300){const n=s.useRef(e),r=s.useRef(null);return n.current=e,s.useEffect(()=>()=>{r.current&&window.clearTimeout(r.current)},[]),s.useCallback((...e)=>{n.current&&(r.current&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>{n.current&&n.current(...e)},t))},[t])}(e=>{a&&a(e)},l),D=R;return s.createElement(sS,{fullWidth:!0,error:h,disabled:p},s.createElement(Ew,{openOnFocus:!0,forcePopupIcon:!0,id:b,multiple:!0,disableCloseOnSelect:!0,options:w,value:D,inputValue:I,getOptionLabel:e=>e&&"object"==typeof e?e.value??"":"",isOptionEqualToValue:(e,t)=>e&&t&&e.key===t.key,loading:d,limitTags:g,disableClearable:v,onChange:(e,t)=>{const n=Array.isArray(t)?t.map(e=>e&&e.key):[];x||C(n),r&&r(n,Array.isArray(t)?t:[])},onInputChange:(e,t,n)=>{P||T(t??""),"input"===n?O(t??""):"clear"===n&&O("")},renderOption:(e,t,{selected:n})=>s.createElement("li",Xr({},e,{key:t&&t.key||Math.random().toString(36)}),s.createElement(ux,{icon:aR,checkedIcon:lR,style:{marginRight:8},checked:!!n}),t&&t.value),renderTags:(e,t)=>(Array.isArray(e)?e:[]).map((e,n)=>s.createElement(zy,Xr({},t({index:n}),{key:e&&e.key||n,label:e&&e.value||""}))),renderInput:e=>s.createElement(qE,Xr({},e,{label:c,placeholder:u,InputProps:{...e.InputProps,endAdornment:s.createElement(s.Fragment,null,d?s.createElement(Cv,{size:18}):null,e.InputProps.endAdornment)},size:f},y))}),m?s.createElement(bS,null,m):null)}const cR=({filter:e,channel:t,query:n})=>{const[r,o]=s.useState([]),[i,a]=s.useState([]),[l,u]=s.useState(!1),[d,p]=s.useState("");return s.useEffect(()=>{a(n?.filter?.[e?.filter]||[])},[n]),s.useEffect(()=>{(async()=>{u(!0);const t=await async function(e,t){return t?.source?(await jc.runReport({id:t.source})).map(e=>({key:e[t.field],value:e[t.field]})):[]}(0,e);o(t),u(!1)})()},[d]),c.createElement("div",{style:{display:"flex"}},c.createElement("div",{style:{maxWidth:640,minWidth:200}},c.createElement(sR,{id:e?.title,label:e?.title,placeholder:"Type to search…",items:r,selectedKeys:i,onChange:(n,r)=>{a(n),t.emit("filterChanged",e,{[e.filter]:n})},onInputChange:e=>{p(e)},loading:l,debounceMs:300,helperText:i.length?`${i.length} selected`:""})))};function uR({items:e,value:t,label:n,onChange:r,sx:o={width:"100%"},disabled:i=!1}){const a=e.some(e=>e.key===t)?t:"";return c.createElement(jw,{sx:o},c.createElement(sS,{fullWidth:!0},c.createElement(zS,{id:"demo-simple-select-label"},n),c.createElement(vk,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:a,label:n,onChange:r,disabled:i,MenuProps:{style:{maxHeight:"300px"}},size:"small"},e.map(e=>{const{key:t,value:n,disabled:r}=e;return c.createElement(_C,{key:t,value:t,disabled:r},n)}))))}const dR=({filter:e,channel:t,query:n})=>{const[r,o]=s.useState([]),[i,a]=s.useState("");return s.useEffect(()=>{a(n?.date_range?.name)},[n]),s.useEffect(()=>{(async()=>{const t=(await jc.getDateRanges()).filter(t=>!(e.allowedOptions.length>0)||e.allowedOptions.some(e=>e===t.name)).map(e=>({key:e.name,value:e.title}));o(t)})()},[]),c.createElement("div",{style:{minWidth:"200px",maxWidth:"640px"}},c.createElement(uR,{items:r,value:i,label:e?.title,onChange:(n,r)=>{const o=n.target.value;a(o),t.emit("filterChanged",e,{date_range:{name:o}})}}))},pR=({filters:e=[],channel:t,query:n})=>c.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"}},e.map(e=>"multi-select"===e.type?c.createElement(cR,{key:e.title,channel:t,filter:e,query:n}):"date-range"===e.type?c.createElement(dR,{key:e.title,channel:t,filter:e,query:n}):null));var fR,hR={exports:{}};var mR=(fR||(fR=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var l=new o(r,i||e,a),s=n?n+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],l]:e._events[s].push(l):(e._events[s]=l,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),l.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},l.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o<i;o++)a[o]=r[o].fn;return a},l.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},l.prototype.emit=function(e,t,r,o,i,a){var l=n?n+e:e;if(!this._events[l])return!1;var s,c,u=this._events[l],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,i),!0;case 6:return u.fn.call(u.context,t,r,o,i,a),!0}for(c=1,s=new Array(d-1);c<d;c++)s[c-1]=arguments[c];u.fn.apply(u.context,s)}else{var p,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,o);break;default:if(!s)for(p=1,s=new Array(d-1);p<d;p++)s[p-1]=arguments[p];u[c].fn.apply(u[c].context,s)}}return!0},l.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},l.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},l.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var l=this._events[i];if(l.fn)l.fn!==t||o&&!l.once||r&&l.context!==r||a(this,i);else{for(var s=0,c=[],u=l.length;s<u;s++)(l[s].fn!==t||o&&!l[s].once||r&&l[s].context!==r)&&c.push(l[s]);c.length?this._events[i]=1===c.length?c[0]:c:a(this,i)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l}(hR)),hR.exports),gR=t(mR),vR=e=>c.useRef(e||new gR).current,bR=e=>{const t=c.useState({}),n=c.useCallback((n,r)=>{let o={...t.current,...r};for(var i in t.current=o,o)"date_range"===i||o[i].length||delete o[i];e?.emit("mergedFilterChanged",{value:o})},[e]);c.useEffect(()=>(e?.on("filterChanged",n),()=>{e?.off("filterChanged",n)}),[e])},yR=({id:e,cache:t,dashboard:n,channel:r,...o})=>{const[i,a]=c.useState(),[l,u]=c.useState(),[d,p]=c.useState(),[f,h]=c.useState(),[m,g]=c.useState(vu()),[v,b]=c.useState(),[y,w]=c.useState(0),[x,S]=c.useState(!1),[C,k]=c.useState(),[E,R]=c.useState(!1),P=c.useRef({value:o?.filter}),[M,T]=c.useState({}),{ref:I,inView:O}=function({threshold:e,delay:t,trackVisibility:n,rootMargin:r,root:o,triggerOnce:i,skip:a,initialInView:l,fallbackInView:c,onChange:u}={}){var d;const[p,f]=s.useState(null),h=s.useRef(u),m=s.useRef(l),[g,v]=s.useState({inView:!!l,entry:void 0});h.current=u,s.useEffect(()=>{if(void 0===m.current&&(m.current=l),a||!p)return;let s;return s=Su(p,(e,t)=>{const n=m.current;m.current=e,(void 0!==n||e)&&(v({inView:e,entry:t}),h.current&&h.current(e,t),t.isIntersecting&&i&&s&&(s(),s=void 0))},{root:o,rootMargin:r,threshold:e,trackVisibility:n,delay:t},c),()=>{s&&s()}},[Array.isArray(e)?e.toString():e,p,o,r,i,a,n,c,t]);const b=null==(d=g.entry)?void 0:d.target,y=s.useRef(void 0);p||!b||i||a||y.current===b||(y.current=b,v({inView:!!l,entry:void 0}),m.current=l);const w=[f,g.inView,g.entry];return w.ref=w[0],w.inView=w[1],w.entry=w[2],w}({threshold:.1,delay:1e3}),D=vR(r);bR(D);const F=c.useCallback(e=>{const t=e.target.value;w(t),b(i.doc.view[t])},[i]);c.useEffect(()=>{e&&(async()=>{const n=e,r=t?.[n]||await jc.getChart({id:n}),i=r.doc.source?.id,l=i?t?.[i]||await jc.getReport({id:i}):void 0,s=t?.[`schema_${i}`]||o?.schema||await jc.getReportSchema({id:i}),c=r.doc?.view?.[0];w(0),u(l),a(r),b(c),p(s),R(!0)})().catch(e=>{console.error(e.message)})},[e]),c.useEffect(()=>{i&&f&&(!i?.doc?.source?.id||l)&&d&&(async()=>{g(vu(i.doc.chart?.component,{view:v,source:f,chart:i,report:l,schema:d,dashboard:n,query:M}))})().catch(e=>{console.error(e.message)})},[i,f,v,l,d]);const L=e=>{const t={...l?.doc.query.filter||{},...o?.filter,...e?.value},n=t.date_range||l?.doc.query.date_range;if(delete t.date_range,R(!1),k(),S(!0),"context"===i?.doc?.source?.type)return h({filter:t}),void S(!1);const r={filter:t,date_range:n,parameters:o?.params};T(r),jc.runReport({id:l.id,query:r}).then(e=>{h(i.doc.source.reverse?e.reverse():e)}).catch(e=>{h([])}).finally(()=>{S(!1)})},A=e=>{P.current=e,O?L(e):(k(e),R(!0))};return c.useEffect(()=>(D?.on("mergedFilterChanged",A),()=>{D?.off("mergedFilterChanged",A)}),[D,l,i,O]),c.useEffect(()=>{O&&E&&L(C)},[O,E]),c.useEffect(()=>{R(!0)},[o.params]),c.createElement(Yr,{ref:I,elevation:0,style:{borderRadius:12,padding:20,border:"1px solid #e5e5e5",background:"#fff",display:"flex",flexDirection:"column",gap:"12px",height:"100%"}},i&&c.createElement("div",{style:{display:"flex",alignItems:"center",lineHeight:0}},c.createElement(si,{variant:"subtitle2",style:{fontWeight:600,color:"#252525"}},o?.title||i.doc.name," ")),x?c.createElement(Wa,{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"100%"}}):c.createElement(c.Fragment,null,c.createElement("div",{style:{display:"flex"}},c.createElement("div",{style:{flexGrow:1}}),c.createElement("div",null,i?.doc?.view?.length>1&&c.createElement(Vi,null,c.createElement(Ha,{labelId:"date-range-select-label",id:"date-range-select",value:y,onChange:F,style:{fontSize:"12px"},disableUnderline:!0},i.doc.view.map((e,t)=>c.createElement(Ea,{key:t,value:t},e.title)))))),c.createElement("div",{style:{position:"relative",flexGrow:n?void 0:1,display:"flex",flexDirection:"column"}},c.createElement(pR,{filters:i?.doc?.filters,channel:D,query:M}),m)))};const wR=s.createContext(void 0),xR=({defaultParameters:e={},defaultApi:t={},children:n})=>{const r={base_currency:"EUR",...e},[o,i]=s.useState(r),[a,l]=s.useState(t),u={parameters:o,setParameters:e=>{const t={base_currency:"EUR",...e};i(t)},api:a,setApi:l,setReportingContext:({parameters:e,api:t})=>{if(void 0!==e){const t={base_currency:"EUR",...e};i(t)}void 0!==t&&l(t)}};return c.createElement(wR.Provider,{value:u},n)},SR=()=>s.useContext(wR);const CR=s.createContext(),kR=({children:e})=>{const[t,n]=s.useState({open:!1,message:"",severity:"info",duration:6e3}),r=(e,t="info",r=6e3)=>{n({open:!0,message:e,severity:t,duration:r})},o=(e,t)=>{"clickaway"!==t&&n(e=>({...e,open:!1}))},i={success:(e,t)=>r(e,"success",t),error:(e,t)=>r(e,"error",t),warning:(e,t)=>r(e,"warning",t),info:(e,t)=>r(e,"info",t)};return c.createElement(CR.Provider,{value:i},e,c.createElement(Dk,{open:t.open,autoHideDuration:t.duration,onClose:o,anchorOrigin:{vertical:"top",horizontal:"right"}},c.createElement(jv,{onClose:o,severity:t.severity,variant:"filled",sx:{width:"100%"}},t.message)))},ER=()=>{const e=s.useContext(CR);if(!e)throw new Error("useNotify must be used within a NotifyProvider");return e};function RR(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=RR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function PR(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=RR(e))&&(r&&(r+=" "),r+=t);return r}var MR=parseInt(s.version,10);const TR=e=>{if(MR>=19){const t=t=>e(t,t.ref??null);return t.displayName=e.displayName??e.name,t}return s.forwardRef(e)},IR=Sg,OR=IR(Xp.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"})),DR=IR(Xp.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"})),FR=IR(Xp.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),LR=IR(Xp.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),AR=IR(Xp.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})),NR=IR(Xp.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"})),$R=IR(Xp.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));IR(Xp.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"})),IR(Xp.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}));const zR=IR(Xp.jsx("path",{d:"M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z"})),jR=IR(Xp.jsx("rect",{width:"1",height:"24",x:"11.5",rx:"0.5"})),BR=IR(Xp.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"})),_R=IR(Xp.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"})),HR=IR(Xp.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"})),VR=IR(Xp.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),WR=IR(Xp.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),UR=IR(Xp.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),GR=IR(Xp.jsx("path",{d:"M19 13H5v-2h14v2z"})),KR=IR(Xp.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"})),qR=IR(Xp.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),YR=IR(Xp.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),XR=IR(Xp.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),QR=IR(Xp.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"})),ZR=IR(Xp.jsx("g",{children:Xp.jsx("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})})),JR=IR(Xp.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}));IR(Xp.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}));const eP=IR(Xp.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"})),tP=IR(Xp.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"})),nP=s.createContext(void 0),rP=()=>{const e=s.useContext(nP);if(!e)throw new Error("MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e},oP=["sortingOrder"],iP=s.memo(function(e){const{sortingOrder:t}=e,n=d(e,oP),r=rP(),[o]=t,i="asc"===o?r.slots.columnSortedAscendingIcon:r.slots.columnSortedDescendingIcon;return i?Xp.jsx(i,f({},n)):null}),aP=s.createContext(void 0);function lP(){const e=s.useContext(aP);if(void 0===e)throw new Error(["MUI X: Could not find the Data Grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join("\n"));return e}const sP=new TextEncoder;let cP=2048,uP=new ArrayBuffer(cP),dP=new Uint8Array(uP),pP=new Int32Array(uP);const fP=function(e){const t=2*e.length;t>cP&&(cP=t+(4-t%4),uP=new ArrayBuffer(cP),dP=new Uint8Array(uP),pP=new Int32Array(uP));const n=sP.encodeInto(e,dP).written,r=0|n;let o=0,i=374761393+(0+r|0)|0;if(r<16)for(;(o+3|0)<r;o=o+4|0)i=Math.imul(0|hP(i+Math.imul(0|pP[o],3266489917)|0,17),668265263);else{let e=606290984,t=-2048144777,n=0,a=1640531535;for(;(o+15|0)<r;o=o+16|0)e=Math.imul(0|hP(e+Math.imul(0|pP[o+0|0],2246822519)|0,13),2654435761),t=Math.imul(0|hP(t+Math.imul(0|pP[o+4|0],2246822519)|0,13),2654435761),n=Math.imul(0|hP(n+Math.imul(0|pP[o+8|0],2246822519)|0,13),2654435761),a=Math.imul(0|hP(a+Math.imul(0|pP[o+12|0],2246822519)|0,13),2654435761);for(i=(((hP(e,1)|0+hP(t,7)|0)+hP(n,12)|0)+hP(a,18)|0)+r|0;(o+3|0)<r;o=o+4|0)i=Math.imul(0|hP(i+Math.imul(0|pP[o],3266489917)|0,17),668265263)}for(;o<r;o=o+1|0)i=Math.imul(0|hP(i+Math.imul(0|dP[o],374761393)|0,11),2654435761);return i=Math.imul(i^i>>>15,2246822519),i=Math.imul(i^i>>>13,3266489917),((i^i>>>16)>>>0).toString()};function hP(e,t){return e<<t|e>>>32-t}const mP={values:{xs:0,sm:600,md:900,lg:1200,xl:1536},up:e=>{const t=mP.values;return`@media (min-width:${"number"==typeof t[e]?t[e]:e}px)`}},gP={spacingUnit:"--DataGrid-t-spacing-unit",colors:{border:{base:"--DataGrid-t-color-border-base"},foreground:{base:"--DataGrid-t-color-foreground-base",muted:"--DataGrid-t-color-foreground-muted",accent:"--DataGrid-t-color-foreground-accent",disabled:"--DataGrid-t-color-foreground-disabled",error:"--DataGrid-t-color-foreground-error"},background:{base:"--DataGrid-t-color-background-base",overlay:"--DataGrid-t-color-background-overlay",backdrop:"--DataGrid-t-color-background-backdrop"},interactive:{hover:"--DataGrid-t-color-interactive-hover",hoverOpacity:"--DataGrid-t-color-interactive-hover-opacity",focus:"--DataGrid-t-color-interactive-focus",focusOpacity:"--DataGrid-t-color-interactive-focus-opacity",disabled:"--DataGrid-t-color-interactive-disabled",disabledOpacity:"--DataGrid-t-color-interactive-disabled-opacity",selected:"--DataGrid-t-color-interactive-selected",selectedOpacity:"--DataGrid-t-color-interactive-selected-opacity"}},header:{background:{base:"--DataGrid-t-header-background-base"}},cell:{background:{pinned:"--DataGrid-t-cell-background-pinned"}},radius:{base:"--DataGrid-t-radius-base"},typography:{font:{body:"--DataGrid-t-typography-font-body",small:"--DataGrid-t-typography-font-small",large:"--DataGrid-t-typography-font-large"},fontFamily:{base:"--DataGrid-t-typography-font-family-base"},fontWeight:{light:"--DataGrid-t-typography-font-weight-light",regular:"--DataGrid-t-typography-font-weight-regular",medium:"--DataGrid-t-typography-font-weight-medium",bold:"--DataGrid-t-typography-font-weight-bold"}},transitions:{easing:{easeIn:"--DataGrid-t-transition-easing-ease-in",easeOut:"--DataGrid-t-transition-easing-ease-out",easeInOut:"--DataGrid-t-transition-easing-ease-in-out"},duration:{short:"--DataGrid-t-transition-duration-short",base:"--DataGrid-t-transition-duration-base",long:"--DataGrid-t-transition-duration-long"}},shadows:{base:"--DataGrid-t-shadow-base",overlay:"--DataGrid-t-shadow-overlay"},zIndex:{panel:"--DataGrid-t-z-index-panel",menu:"--DataGrid-t-z-index-menu"}},vP=function e(t){if("string"==typeof t)return`var(${t})`;const n={};for(const r in t)Object.hasOwn(t,r)&&(n[r]=e(t[r]));return n}(gP),bP=f({breakpoints:mP,spacing:function(e,t,n,r){if(void 0===e)return yP(1);if(void 0===t)return yP(e);if(void 0===n)return yP(e)+" "+yP(t);if(void 0===r)return yP(e)+" "+yP(t)+" "+yP(n);return yP(e)+" "+yP(t)+" "+yP(n)+" "+yP(r)},transition:function(e,t){const{duration:n=bP.transitions.duration.base,easing:r=bP.transitions.easing.easeInOut,delay:o=0}=t??{};return e.map(e=>`${e} ${n} ${r} ${o}ms`).join(", ")},keys:gP},vP);function yP(e){return 0===e?"0":`calc(var(--DataGrid-t-spacing-unit) * ${e})`}function wP(e){return function(e,t){return`rgba(from ${e} r g b / ${t})`}(e,1)}function xP(e){if(!e)return;const t="number"==typeof e.fontSize?`${e.fontSize}px`:e.fontSize;return`${e.fontWeight} ${t} / ${e.lineHeight} ${e.fontFamily}`}const SP=["id","label","labelId","material","disabled","slotProps","onChange","onKeyDown","onOpen","onClose","size","style","fullWidth"],CP=["onRowsPerPageChange","material","disabled"],kP=["material"],EP=["autoFocus","label","fullWidth","slotProps","className","material"],RP=["material"],PP=["material"],MP=["material"],TP=["material"],IP=["material"],OP=["material"],DP=["material"],FP=["material"],LP=["material"],AP=["material","label","className"],NP=["material"],$P=["inert","iconStart","iconEnd","children","material"],zP=["slotProps","material"],jP=["id","multiple","freeSolo","options","getOptionLabel","isOptionEqualToValue","value","onChange","label","placeholder","slotProps","material"],BP=["key"],_P=["inputProps","InputProps","InputLabelProps"],HP=["slotProps","material"],VP=["ref","open","children","className","clickAwayTouchEvent","clickAwayMouseEvent","flip","focusTrap","onExited","onClickAway","onDidShow","onDidHide","id","target","transition","placement","material"],WP=["native"],UP=["children","value","active"],GP=["items","value","material"],KP=pg(AS)(({theme:e})=>({[`&.${DS.positionEnd} .${Ev.sizeSmall}`]:{marginRight:e.spacing(-.75)}})),qP=pg(fS,{shouldForwardProp:e=>"fullWidth"!==e})(({theme:e})=>({gap:e.spacing(.5),margin:0,overflow:"hidden",[`& .${uS.label}`]:{fontSize:e.typography.pxToRem(14),overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),YP=pg(ux,{shouldForwardProp:e=>"density"!==e})(({theme:e})=>({variants:[{props:{density:"compact"},style:{padding:e.spacing(.5)}}]})),XP=pg(vC)({[`& .${mC.primary}`]:{overflowX:"clip",textOverflow:"ellipsis",maxWidth:"300px"}}),QP=TR(function(e,t){const{id:n,label:r,labelId:o,material:i,disabled:a,slotProps:l,onChange:s,onKeyDown:c,onOpen:u,onClose:p,size:h,style:m,fullWidth:g}=e,v=d(e,SP),b={PaperProps:{onKeyDown:c}};return p&&(b.onClose=p),Xp.jsxs(sS,{size:h,fullWidth:g,style:m,disabled:a,ref:t,children:[Xp.jsx(zS,{id:o,htmlFor:n,shrink:!0,variant:"outlined",children:r}),Xp.jsx(vk,f({id:n,labelId:o,label:r,displayEmpty:!0,onChange:s,variant:"outlined"},v,{notched:!0,inputProps:l?.htmlInput,onOpen:u,MenuProps:b,size:h},i))]})}),ZP=pg(RE)(({theme:e})=>({[`& .${mE.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${mE.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),JP=TR(function(e,t){const{onRowsPerPageChange:n,material:r,disabled:o}=e,i=d(e,CP),a=s.useMemo(()=>{if(o)return{backIconButtonProps:{disabled:!0},nextIconButtonProps:{disabled:!0}}},[o]),l=lP(),c=rP(),{estimatedRowCount:u}=c;return Xp.jsx(ZP,f({component:"div",onRowsPerPageChange:Mg(e=>{n?.(Number(e.target.value))}),labelRowsPerPage:l.current.getLocaleText("paginationRowsPerPage"),labelDisplayedRows:e=>l.current.getLocaleText("paginationDisplayedRows")(f({},e,{estimated:u})),getItemAriaLabel:l.current.getLocaleText("paginationItemAriaLabel")},a,i,r,{ref:t}))}),eM=TR(function(e,t){const{material:n}=e,r=d(e,kP);return Xp.jsx(Nw,f({},r,n,{ref:t}))}),tM=TR(function(e,t){const{autoFocus:n,label:r,fullWidth:o,slotProps:i,className:a,material:l}=e,c=d(e,EP),u=s.useRef(null),p=Tg(u,t),h=s.useRef(null);return s.useEffect(()=>{if(n){const e=u.current?.querySelector("input");e?.focus({preventScroll:!0})}else!1===n&&h.current&&h.current.stop({})},[n]),r?Xp.jsx(qP,{className:a,control:Xp.jsx(YP,f({},c,l,{inputProps:i?.htmlInput,ref:p,touchRippleRef:h})),label:r,fullWidth:o}):Xp.jsx(YP,f({},c,l,{className:PR(a,l?.className),inputProps:i?.htmlInput,ref:p,touchRippleRef:h}))}),nM=TR(function(e,t){const{material:n}=e,r=d(e,RP);return Xp.jsx(Cv,f({},r,n,{ref:t}))}),rM=TR(function(e,t){const{material:n}=e,r=d(e,PP);return Xp.jsx(nS,f({},r,n,{ref:t}))}),oM=TR(function(e,t){const{material:n}=e,r=d(e,MP);return Xp.jsx(QS,f({},r,n,{ref:t}))}),iM=TR(function(e,t){const{material:n}=e,r=d(e,TP);return Xp.jsx(Xw,f({},r,n,{ref:t}))}),aM=pg(tR)(({theme:e})=>({gap:e.spacing(1),border:0})),lM=TR(function(e,t){const{material:n}=e,r=d(e,IP);return Xp.jsx(aM,f({size:"small",color:"primary"},r,n,{ref:t}))}),sM=TR(function(e,t){const{material:n}=e,r=d(e,OP);return Xp.jsx(zy,f({},r,n,{ref:t}))}),cM=TR(function(e,t){const{material:n}=e,r=d(e,DP);return Xp.jsx(Mv,f({},r,n,{ref:t}))}),uM=TR(function(e,t){const{material:n}=e,r=d(e,FP);return Xp.jsx(Hk,f({},r,n,{ref:t}))}),dM=TR(function(e,t){const{material:n}=e,r=d(e,LP);return Xp.jsx(kk,f({},r,n,{ref:t}))}),pM=TR(function(e,t){const{material:n,label:r,className:o}=e,i=d(e,AP);return r?Xp.jsx(qP,{className:o,control:Xp.jsx(Yk,f({},i,n,{ref:t})),label:r}):Xp.jsx(Yk,f({},i,n,{className:o,ref:t}))}),fM=TR(function(e,t){const{material:n}=e,r=d(e,NP);return Xp.jsx(SC,f({},r,n,{ref:t}))});function hM(e,t=!0){if(!e)return;const{slotProps:n,material:r}=e,o=d(e,HP);t&&(o.startAdornment&&(o.startAdornment=Xp.jsx(KP,{position:"start",children:o.startAdornment})),o.endAdornment&&(o.endAdornment=Xp.jsx(KP,{position:"end",children:o.endAdornment})));for(const e in r)Object.hasOwn(r,e)&&(o[e]=r[e]);return n?.htmlInput&&(o.inputProps?o.inputProps=f({},o.inputProps,n?.htmlInput):o.inputProps=n?.htmlInput),o}const mM={"bottom-start":"top left","bottom-end":"top right"};function gM(e,t){return function(e,t){if(void 0===e.focusTrap)return t;return Xp.jsx(Cx,{open:!0,disableEnforceFocus:!0,disableAutoFocus:!0,children:Xp.jsx("div",{tabIndex:-1,children:t})})}(e,function(e,t){if(void 0===e.onClickAway)return t;return Xp.jsx(px,{onClickAway:e.onClickAway,touchEvent:e.clickAwayTouchEvent,mouseEvent:e.clickAwayMouseEvent,children:t})}(e,t))}const vM=pg(WE,{name:"MuiDataGrid",slot:"Tabs"})(({theme:e})=>({borderBottom:`1px solid ${e.palette.divider}`})),bM=pg(Jk,{name:"MuiDataGrid",slot:"Tab"})({flex:1,minWidth:"fit-content"}),yM=pg("div",{name:"MuiDataGrid",slot:"TabPanel"})({flex:1,display:"flex",flexDirection:"column",overflow:"hidden"});function wM(e){const{children:t,active:n}=e,r=d(e,UP);return Xp.jsx(yM,f({role:"tabpanel",style:{display:n?"flex":"none"}},r,{children:t}))}const xM={baseAutocomplete:function(e){const t=rP(),{id:n,multiple:r,freeSolo:o,options:i,getOptionLabel:a,isOptionEqualToValue:l,value:s,onChange:c,label:u,placeholder:p,slotProps:h,material:m}=e,g=d(e,jP);return Xp.jsx(Ew,f({id:n,multiple:r,freeSolo:o,options:i,getOptionLabel:a,isOptionEqualToValue:l,value:s,onChange:c,renderTags:(e,t)=>e.map((e,n)=>{const r=t({index:n}),{key:o}=r,i=d(r,BP);return Xp.jsx(zy,f({variant:"outlined",size:"small",label:"string"==typeof e?e:a?.(e)},i),o)}),renderInput:e=>{const{inputProps:n,InputProps:r,InputLabelProps:o}=e,i=d(e,_P);return Xp.jsx(qE,f({},i,{label:u,placeholder:p,inputProps:n,InputProps:hM(r,!1),InputLabelProps:f({shrink:!0},o)},h?.textField,t.slotProps?.baseTextField))}},g,m))},baseBadge:eM,baseCheckbox:tM,baseChip:sM,baseCircularProgress:nM,baseDivider:rM,baseInput:function(e){return Xp.jsx(nw,f({},hM(e)))},baseLinearProgress:oM,baseMenuList:fM,baseMenuItem:function(e){const{inert:t,iconStart:n,iconEnd:r,children:o,material:i}=e,a=d(e,$P);return t&&(a.disableRipple=!0),s.createElement(_C,f({},a,i),[n&&Xp.jsx(fC,{children:n},"1"),Xp.jsx(XP,{children:o},"2"),r&&Xp.jsx(fC,{children:r},"3")])},baseTextField:function(e){const{slotProps:t,material:n}=e,r=d(e,zP);return Xp.jsx(qE,f({variant:"outlined"},r,n,{inputProps:t?.htmlInput,InputProps:hM(t?.input),InputLabelProps:f({shrink:!0},t?.inputLabel)}))},baseButton:iM,baseIconButton:cM,baseToggleButton:lM,baseTooltip:uM,baseTabs:function(e){let{items:t,value:n,material:r}=e,o=d(e,GP);const i=mm(),a=`${i}-tab-${n}`,l=`${i}-tabpanel-${n}`;return Xp.jsxs(s.Fragment,{children:[Xp.jsx(vM,f({},o,{value:n,variant:"scrollable",scrollButtons:"auto"},r,{children:t.map(e=>Xp.jsx(bM,{value:e.value,label:e.label,id:a,"aria-controls":l},e.value))})),t.map(e=>Xp.jsx(wM,{value:e.value,active:n===e.value,id:l,"aria-labelledby":a,children:e.children},e.value))]})},basePagination:JP,basePopper:function(e){const{open:t,children:n,className:r,flip:o,onExited:i,onDidShow:a,onDidHide:l,id:c,target:u,transition:p,placement:h,material:m}=e,g=d(e,VP),v=s.useMemo(()=>{const e=[{name:"preventOverflow",options:{padding:8}}];return o&&e.push({name:"flip",enabled:!0}),(a||l)&&e.push({name:"isPlaced",enabled:!0,phase:"main",fn:()=>{a?.()},effect:()=>()=>{l?.()}}),e},[o,a,l]);let b;if(p){const t=e=>t=>{e&&e(),i&&i(t)};b=r=>gM(e,Xp.jsx(PS,f({},r.TransitionProps,{style:{transformOrigin:mM[r.placement]},onExited:t(r.TransitionProps?.onExited),children:Xp.jsx(qg,{children:n})})))}else b=gM(e,n);return Xp.jsx(My,f({id:c,className:r,open:t,anchorEl:u,transition:p,placement:h,modifiers:v},g,m,{children:b}))},baseSelect:QP,baseSelectOption:function(e){let{native:t}=e,n=d(e,WP);return t?Xp.jsx("option",f({},n)):Xp.jsx(_C,f({},n))},baseSkeleton:dM,baseSwitch:pM},SM=f({},xM,{booleanCellTrueIcon:YR,booleanCellFalseIcon:WR,columnMenuIcon:VR,openFilterButtonIcon:AR,filterPanelDeleteIcon:WR,columnFilteredIcon:NR,columnSelectorIcon:zR,columnUnsortedIcon:iP,columnSortedAscendingIcon:OR,columnSortedDescendingIcon:DR,columnResizeIcon:jR,densityCompactIcon:BR,densityStandardIcon:_R,densityComfortableIcon:HR,exportIcon:tP,moreActionsIcon:XR,treeDataCollapseIcon:LR,treeDataExpandIcon:FR,groupingCriteriaCollapseIcon:LR,groupingCriteriaExpandIcon:FR,detailPanelExpandIcon:UR,detailPanelCollapseIcon:GR,rowReorderIcon:qR,quickFilterIcon:$R,quickFilterClearIcon:JR,columnMenuHideIcon:QR,columnMenuSortAscendingIcon:OR,columnMenuSortDescendingIcon:DR,columnMenuUnsortIcon:null,columnMenuFilterIcon:NR,columnMenuManageColumnsIcon:ZR,columnMenuClearIcon:JR,loadIcon:KR,filterPanelAddIcon:UR,filterPanelRemoveAllIcon:eP,columnReorderIcon:qR,menuItemCheckIcon:YR});var CM=Symbol("NOT_FOUND");var kM=e=>Array.isArray(e)?e:[e];function EM(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){const n=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}var RM=(e,t)=>e===t;function PM(e,t){const n="object"==typeof t?t:{equalityCheck:t},{equalityCheck:r=RM,maxSize:o=1,resultEqualityCheck:i}=n,a=function(e){return function(t,n){if(null===t||null===n||t.length!==n.length)return!1;const{length:r}=t;for(let o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}}(r);let l=0;const s=o<=1?function(e){let t;return{get:n=>t&&e(t.key,n)?t.value:CM,put(e,n){t={key:e,value:n}},getEntries:()=>t?[t]:[],clear(){t=void 0}}}(a):function(e,t){let n=[];function r(e){const r=n.findIndex(n=>t(e,n.key));if(r>-1){const e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return CM}return{get:r,put:function(t,o){r(t)===CM&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(o,a);function c(){let t=s.get(arguments);if(t===CM){if(t=e.apply(null,arguments),l++,i){const e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,0!==l&&l--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>l,c.resetResultsCount=()=>{l=0},c}var MM="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function TM(){return{s:0,v:void 0,o:null,p:null}}function IM(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,i=0;function a(){let t=n;const{length:a}=arguments;for(let e=0,n=a;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=TM(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=TM(),e.set(n,t)):t=r}}const l=t;let s;if(1===t.s)s=t.v;else if(s=e.apply(null,arguments),i++,r){const e=o?.deref?.()??o;null!=e&&r(e,s)&&(s=e,0!==i&&i--);o="object"==typeof s&&null!==s||"function"==typeof s?new MM(s):s}return l.s=1,l.v=s,s}return a.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function OM(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,i={},a=e.pop();"object"==typeof a&&(i=a,a=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const l={...n,...i},{memoize:s,memoizeOptions:c=[],argsMemoize:u=IM,argsMemoizeOptions:d=[]}=l,p=kM(c),f=kM(d),h=EM(e),m=s(function(){return r++,a.apply(null,arguments)},...p),g=u(function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}(h,arguments);return t=m.apply(null,e),t},...f);return Object.assign(g,{resultFunc:a,memoizedResultFunc:m,dependencies:h,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:s,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var DM=OM(IM),FM=Object.assign((e,t=DM)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e),r=n.map(t=>e[t]),o=t(r,(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}));return o},{withTypes:()=>FM});const LM=OM({memoize:PM,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),AM=(e,t,n,r,o,i,a,l,...s)=>{if(s.length>0)throw new Error("Unsupported number of selectors");let c;if(e&&t&&n&&r&&o&&i&&a&&l)c=(s,c,u,d)=>{const p=e(s,c,u,d),f=t(s,c,u,d),h=n(s,c,u,d),m=r(s,c,u,d),g=o(s,c,u,d),v=i(s,c,u,d),b=a(s,c,u,d);return l(p,f,h,m,g,v,b,c,u,d)};else if(e&&t&&n&&r&&o&&i&&a)c=(l,s,c,u)=>{const d=e(l,s,c,u),p=t(l,s,c,u),f=n(l,s,c,u),h=r(l,s,c,u),m=o(l,s,c,u),g=i(l,s,c,u);return a(d,p,f,h,m,g,s,c,u)};else if(e&&t&&n&&r&&o&&i)c=(a,l,s,c)=>{const u=e(a,l,s,c),d=t(a,l,s,c),p=n(a,l,s,c),f=r(a,l,s,c),h=o(a,l,s,c);return i(u,d,p,f,h,l,s,c)};else if(e&&t&&n&&r&&o)c=(i,a,l,s)=>{const c=e(i,a,l,s),u=t(i,a,l,s),d=n(i,a,l,s),p=r(i,a,l,s);return o(c,u,d,p,a,l,s)};else if(e&&t&&n&&r)c=(o,i,a,l)=>{const s=e(o,i,a,l),c=t(o,i,a,l),u=n(o,i,a,l);return r(s,c,u,i,a,l)};else if(e&&t&&n)c=(r,o,i,a)=>{const l=e(r,o,i,a),s=t(r,o,i,a);return n(l,s,o,i,a)};else if(e&&t)c=(n,r,o,i)=>{const a=e(n,r,o,i);return t(a,r,o,i)};else{if(!e)throw new Error("Missing arguments");c=e}return c},NM=(...e)=>{const t=new WeakMap;let n=1;const r=e[e.length-1],o=e.length-1||1,i=Math.max(r.length-o,0);if(i>3)throw new Error("Unsupported number of arguments");return(o,a,l,s)=>{let c=o.__cacheKey__;c||(c={id:n},o.__cacheKey__=c,n+=1);let u=t.get(c);if(!u){const n=1===e.length?[e=>e,r]:e;let o=e;const a=[void 0,void 0,void 0];switch(i){case 0:break;case 1:o=[...n.slice(0,-1),()=>a[0],r];break;case 2:o=[...n.slice(0,-1),()=>a[0],()=>a[1],r];break;case 3:o=[...n.slice(0,-1),()=>a[0],()=>a[1],()=>a[2],r];break;default:throw new Error("Unsupported number of arguments")}u=LM(...o),u.selectorArgs=a,t.set(c,u)}switch(i){case 3:u.selectorArgs[2]=s;case 2:u.selectorArgs[1]=l;case 1:u.selectorArgs[0]=a}switch(i){case 0:return u(o);case 1:return u(o,a);case 2:return u(o,a,l);case 3:return u(o,a,l,s);default:throw new Error("unreachable")}}};var $M,zM,jM={exports:{}},BM={};function _M(){return zM||(zM=1,jM.exports=function(){if($M)return BM;$M=1;var e=l(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function a(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var l=t(),s=n({inst:{value:l,getSnapshot:t}}),c=s[0].inst,u=s[1];return o(function(){c.value=l,c.getSnapshot=t,a(c)&&u({inst:c})},[e,l,t]),r(function(){return a(c)&&u({inst:c}),e(function(){a(c)&&u({inst:c})})},[e]),i(l),l};return BM.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,BM}()),jM.exports}var HM,VM,WM=_M(),UM={exports:{}},GM={};var KM=(VM||(VM=1,UM.exports=function(){if(HM)return GM;HM=1;var e=l(),t=_M(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,s=e.useDebugValue;return GM.useSyncExternalStoreWithSelector=function(e,t,l,c,u){var d=o(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=a(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var a=c(e);return void 0!==u&&u(t,a)?(r=e,t):(r=e,o=a)}var r,o,i=!1,a=void 0===l?null:l;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]},[t,l,c,u]);var f=r(e,d[0],d[1]);return i(function(){p.hasValue=!0,p.value=f},[f]),s(f),f},GM}()),UM.exports);const qM=MR>=19?function(e,t,n,r,o){const i=s.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return WM.useSyncExternalStore(e.subscribe,i,i)}:function(e,t,n,r,o){return KM.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,o))};function YM(e,t,n,r,o){return qM(e,t,n,r,o)}const XM=()=>{};function QM(e,t,n){const r=Dg(ZM,{store:e,selector:t}).current;r.effect=n,Lg(r.onMount)}function ZM(e){const{store:t,selector:n}=e;let r=n(t.state);const o={effect:XM,dispose:null,subscribe:()=>{o.dispose??=t.subscribe(e=>{const t=n(e);if(!Object.is(r,t)){const e=r;r=t,o.effect(e,t)}})},onMount:()=>(o.subscribe(),()=>{o.dispose?.(),o.dispose=null})};return o.subscribe(),o}class JM{static create(e){return new JM(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){this.state=e,this.updateTick+=1;const t=this.updateTick,n=this.listeners.values();let r;for(;r=n.next(),!r.done;){if(t!==this.updateTick)return;(0,r.value)(e)}}update(e){for(const t in e)if(!Object.is(this.state[t],e[t]))return void this.setState(f({},this.state,e))}set(e,t){Object.is(this.state[e],t)||this.setState(f({},this.state,{[e]:t}))}use=(()=>(e,t,n,r)=>YM(this,e,t,n,r))()}const eT=(...e)=>{const t=AM(...e);return(e,n,r,o)=>t(rT(e),n,r,o)},tT=(...e)=>{const t=NM(...e);return(e,n,r,o)=>t(rT(e),n,r,o)},nT=e=>(t,n)=>e(rT(t),n);function rT(e){return"current"in e?e.current.state:e}const oT=nT(e=>e.dimensions),iT=eT(oT,e=>e.columnsTotalWidth),aT=eT(oT,e=>e.rowHeight);eT(oT,e=>e.contentSize.height);const lT=eT(oT,e=>e.hasScrollX),sT=eT(oT,e=>e.hasScrollY),cT=eT(oT,e=>e.columnsTotalWidth<e.viewportOuterSize.width),uT=eT(oT,e=>e.headerHeight),dT=eT(oT,e=>e.groupHeaderHeight);eT(oT,e=>e.headerFilterHeight);const pT=eT(oT,e=>e.hasScrollX?e.scrollbarSize:0),fT=eT(oT,e=>e.hasScrollY?e.scrollbarSize:0),hT=eT(oT,pT,(e,t)=>{const n=e.viewportOuterSize.height-e.minimumSize.height>0;return!(0===t&&!n)}),mT=nT(e=>e.rowsMeta),gT=nT(e=>e.rows),vT=eT(gT,e=>e.totalRowCount),bT=eT(gT,e=>e.loading),yT=eT(gT,e=>e.totalTopLevelRowCount),wT=eT(gT,e=>e.dataRowIdToModelLookup);eT(wT,(e,t)=>e[t]);const xT=eT(gT,e=>e.tree),ST=eT(xT,(e,t)=>e[t]),CT=eT(gT,e=>e.groupsToFetch),kT=eT(gT,e=>e.groupingName),ET=eT(gT,e=>e.treeDepths),RT=tT(gT,e=>{const t=Object.entries(e.treeDepths);return 0===t.length?1:(t.filter(([,e])=>e>0).map(([e])=>Number(e)).sort((e,t)=>t-e)[0]??0)+1}),PT=eT(gT,e=>e.dataRowIds),MT=tT(PT,wT,(e,t)=>e.reduce((e,n)=>t[n]?(e.push(t[n]),e):e,[])),TT=tT(eT(gT,e=>e?.additionalRowGroups),e=>{const t=e?.pinnedRows;return{bottom:t?.bottom?.map(e=>({id:e.id,model:e.model??{}}))??[],top:t?.top?.map(e=>({id:e.id,model:e.model??{}}))??[]}}),IT=eT(TT,e=>(e?.top?.length||0)+(e?.bottom?.length||0)),OT="auto-generated-group-node-root",DT=Symbol("mui.id_autogenerated");const FT=(e,t,n)=>{const r=t?t(e):e.id;return function(e,t,n="A row was provided without id in the rows prop:"){if(null==e)throw new Error(["MUI X: The Data Grid component requires all rows to have a unique `id` property.","Alternatively, you can use the `getRowId` prop to specify a custom id for each row.",n,JSON.stringify(t)].join("\n"))}(r,e,n),r},LT=(e,t,n)=>{const r=t.field;if(!t||!t.valueGetter)return e[r];const o=e[t.field];return t.valueGetter(o,e,t,n)},AT=({rows:e,getRowId:t,loading:n,rowCount:r})=>{const o={type:"full",rows:[]},i={};for(let n=0;n<e.length;n+=1){const r=e[n],a=FT(r,t);i[a]=r,o.rows.push(a)}return{rowsBeforePartialUpdates:e,loadingPropBeforePartialUpdates:n,rowCountPropBeforePartialUpdates:r,updates:o,dataRowIdToModelLookup:i}},NT=({tree:e,rowCountProp:t=0})=>{const n=e[OT];return Math.max(t,n.children.length+(null==n.footerId?0:1))},$T=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:r,previousTreeDepths:o,previousGroupsToFetch:i})=>{const a=e.current.caches.rows,{tree:l,treeDepths:s,dataRowIds:c,groupingName:u,groupsToFetch:d=[]}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:r,previousTreeDepths:o,updates:a.updates,dataRowIdToModelLookup:a.dataRowIdToModelLookup,previousGroupsToFetch:i}),p=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:l,treeDepths:s,dataRowIds:c,dataRowIdToModelLookup:a.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},f({},p,{totalRowCount:Math.max(t,p.dataRowIds.length),totalTopLevelRowCount:NT({tree:p.tree,rowCountProp:t}),groupingName:u,loading:n,groupsToFetch:d})},zT=e=>DT in e,jT=e=>"skeletonRow"===e.type||"footer"===e.type||"group"===e.type&&e.isAutoGenerated||"pinnedRow"===e.type&&e.isAutoGenerated,BT=(e,t,n,r)=>{const o=e[t];if("group"!==o.type)return[];const i=[];for(let t=0;t<o.children.length;t+=1){const a=o.children[t];if(n&&jT(e[a])||i.push(a),r)continue;const l=BT(e,a,n,r);for(let e=0;e<l.length;e+=1)i.push(l[e])}return n||null==o.footerId||i.push(o.footerId),i},_T=({previousCache:e,getRowId:t,updates:n,groupKeys:r})=>{if("full"===e.updates.type)throw new Error("MUI X: Unable to prepare a partial update if a full update is not applied yet.");const o=new Map;n.forEach(e=>{const n=FT(e,t,"A row was provided without id when calling updateRows():");o.has(n)?o.set(n,f({},o.get(n),e)):o.set(n,e)});const i={type:"partial",actions:{insert:[...e.updates.actions.insert??[]],modify:[...e.updates.actions.modify??[]],remove:[...e.updates.actions.remove??[]]},idToActionLookup:f({},e.updates.idToActionLookup),groupKeys:r},a=f({},e.dataRowIdToModelLookup),l={insert:{},modify:{},remove:{}};o.forEach((e,t)=>{const n=i.idToActionLookup[t];if("delete"===e._action){if("remove"===n||!a[t])return;return null!=n&&(l[n][t]=!0),i.actions.remove.push(t),void delete a[t]}const r=a[t];if(r)return"remove"===n?(l.remove[t]=!0,i.actions.modify.push(t)):null==n&&i.actions.modify.push(t),void(a[t]=f({},r,e));"remove"===n?(l.remove[t]=!0,i.actions.insert.push(t)):null==n&&i.actions.insert.push(t),a[t]=e});const s=Object.keys(l);for(let e=0;e<s.length;e+=1){const t=s[e],n=l[t];Object.keys(n).length>0&&(i.actions[t]=i.actions[t].filter(e=>!n[e]))}return{dataRowIdToModelLookup:a,updates:i,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}},HT="var(--DataGrid-overlayHeight, calc(var(--height) * 2))";function VT(e,t,n){const r=[];return t.forEach(t=>{const o=FT(t,n,"A row was provided without id when calling updateRows():"),i=ST(e,o);if("pinnedRow"===i?.type){const n=e.current.caches.pinnedRows,r=n.idLookup[o];r&&(n.idLookup[o]=f({},r,t))}else r.push(t)}),r}const WT=(e,t,n)=>"number"==typeof e&&e>0?e:t,UT=Object.is;function GT(e,t){if(e===t)return!0;if(!(e instanceof Object&&t instanceof Object))return!1;let n=0,r=0;for(const r in e){if(n+=1,!UT(e[r],t[r]))return!1;if(!(r in t))return!1}for(const e in t)r+=1;return n===r}function KT(e){return s.memo(e,GT)}const qT={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",noColumnsOverlayLabel:"No columns",noColumnsOverlayManageColumns:"Manage columns",emptyPivotOverlayLabel:"Add fields to rows, columns, and values to create a pivot table",toolbarDensity:"Density",toolbarDensityLabel:"Density",toolbarDensityCompact:"Compact",toolbarDensityStandard:"Standard",toolbarDensityComfortable:"Comfortable",toolbarColumns:"Columns",toolbarColumnsLabel:"Select columns",toolbarFilters:"Filters",toolbarFiltersLabel:"Show filters",toolbarFiltersTooltipHide:"Hide filters",toolbarFiltersTooltipShow:"Show filters",toolbarFiltersTooltipActive:e=>1!==e?`${e} active filters`:`${e} active filter`,toolbarQuickFilterPlaceholder:"Search…",toolbarQuickFilterLabel:"Search",toolbarQuickFilterDeleteIconLabel:"Clear",toolbarExport:"Export",toolbarExportLabel:"Export",toolbarExportCSV:"Download as CSV",toolbarExportPrint:"Print",toolbarExportExcel:"Download as Excel",toolbarPivot:"Pivot",toolbarCharts:"Charts",toolbarAssistant:"AI Assistant",columnsManagementSearchTitle:"Search",columnsManagementNoColumns:"No columns",columnsManagementShowHideAllText:"Show/Hide All",columnsManagementReset:"Reset",columnsManagementDeleteIconLabel:"Clear",filterPanelAddFilter:"Add filter",filterPanelRemoveAll:"Remove all",filterPanelDeleteIconLabel:"Delete",filterPanelLogicOperator:"Logic operator",filterPanelOperator:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorDoesNotContain:"does not contain",filterOperatorEquals:"equals",filterOperatorDoesNotEqual:"does not equal",filterOperatorStartsWith:"starts with",filterOperatorEndsWith:"ends with",filterOperatorIs:"is",filterOperatorNot:"is not",filterOperatorAfter:"is after",filterOperatorOnOrAfter:"is on or after",filterOperatorBefore:"is before",filterOperatorOnOrBefore:"is on or before",filterOperatorIsEmpty:"is empty",filterOperatorIsNotEmpty:"is not empty",filterOperatorIsAnyOf:"is any of","filterOperator=":"=","filterOperator!=":"!=","filterOperator>":">","filterOperator>=":">=","filterOperator<":"<","filterOperator<=":"<=",headerFilterOperatorContains:"Contains",headerFilterOperatorDoesNotContain:"Does not contain",headerFilterOperatorEquals:"Equals",headerFilterOperatorDoesNotEqual:"Does not equal",headerFilterOperatorStartsWith:"Starts with",headerFilterOperatorEndsWith:"Ends with",headerFilterOperatorIs:"Is",headerFilterOperatorNot:"Is not",headerFilterOperatorAfter:"Is after",headerFilterOperatorOnOrAfter:"Is on or after",headerFilterOperatorBefore:"Is before",headerFilterOperatorOnOrBefore:"Is on or before",headerFilterOperatorIsEmpty:"Is empty",headerFilterOperatorIsNotEmpty:"Is not empty",headerFilterOperatorIsAnyOf:"Is any of","headerFilterOperator=":"Equals","headerFilterOperator!=":"Not equals","headerFilterOperator>":"Greater than","headerFilterOperator>=":"Greater than or equal to","headerFilterOperator<":"Less than","headerFilterOperator<=":"Less than or equal to",headerFilterClear:"Clear filter",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuAriaLabel:e=>`${e} column menu`,columnMenuShowColumns:"Show columns",columnMenuManageColumns:"Manage columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide column",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnMenuManagePivot:"Manage pivot",columnMenuManageCharts:"Manage charts",columnHeaderFiltersTooltipActive:e=>1!==e?`${e} active filters`:`${e} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:e=>1!==e?`${e.toLocaleString()} rows selected`:`${e.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(e,t)=>`${e.toLocaleString()} of ${t.toLocaleString()}`,checkboxSelectionHeaderName:"Checkbox selection",checkboxSelectionSelectAllRows:"Select all rows",checkboxSelectionUnselectAllRows:"Unselect all rows",checkboxSelectionSelectRow:"Select row",checkboxSelectionUnselectRow:"Unselect row",booleanCellTrueLabel:"yes",booleanCellFalseLabel:"no",actionsCellMore:"more",pinToLeft:"Pin to left",pinToRight:"Pin to right",unpin:"Unpin",treeDataGroupingHeaderName:"Group",treeDataExpand:"see children",treeDataCollapse:"hide children",groupingColumnHeaderName:"Group",groupColumn:e=>`Group by ${e}`,unGroupColumn:e=>`Stop grouping by ${e}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",paginationRowsPerPage:"Rows per page:",paginationDisplayedRows:({from:e,to:t,count:n,estimated:r})=>{if(!r)return`${e}–${t} of ${-1!==n?n:`more than ${t}`}`;return`${e}–${t} of ${-1!==n?n:r&&r>t?`around ${r}`:`more than ${t}`}`},paginationItemAriaLabel:e=>"first"===e?"Go to first page":"last"===e?"Go to last page":"next"===e?"Go to next page":"Go to previous page",rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelNone:"none",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size",pivotToggleLabel:"Pivot",pivotRows:"Rows",pivotColumns:"Columns",pivotValues:"Values",pivotCloseButton:"Close pivot settings",pivotSearchButton:"Search fields",pivotSearchControlPlaceholder:"Search fields",pivotSearchControlLabel:"Search fields",pivotSearchControlClear:"Clear search",pivotNoFields:"No fields",pivotMenuMoveUp:"Move up",pivotMenuMoveDown:"Move down",pivotMenuMoveToTop:"Move to top",pivotMenuMoveToBottom:"Move to bottom",pivotMenuRows:"Rows",pivotMenuColumns:"Columns",pivotMenuValues:"Values",pivotMenuOptions:"Field options",pivotMenuAddToRows:"Add to Rows",pivotMenuAddToColumns:"Add to Columns",pivotMenuAddToValues:"Add to Values",pivotMenuRemove:"Remove",pivotDragToRows:"Drag here to create rows",pivotDragToColumns:"Drag here to create columns",pivotDragToValues:"Drag here to create values",pivotYearColumnHeaderName:"(Year)",pivotQuarterColumnHeaderName:"(Quarter)",chartsNoCharts:"There are no charts available",chartsChartNotSelected:"Select a chart type to configure its options",chartsTabChart:"Chart",chartsTabFields:"Fields",chartsTabCustomize:"Customize",chartsCloseButton:"Close charts configuration",chartsSyncButtonLabel:"Sync chart",chartsSearchPlaceholder:"Search fields",chartsSearchLabel:"Search fields",chartsSearchClear:"Clear search",chartsNoFields:"No fields",chartsFieldBlocked:"This field cannot be added to any section",chartsCategories:"Categories",chartsSeries:"Series",chartsMenuAddToDimensions:e=>`Add to ${e}`,chartsMenuAddToValues:e=>`Add to ${e}`,chartsMenuMoveUp:"Move up",chartsMenuMoveDown:"Move down",chartsMenuMoveToTop:"Move to top",chartsMenuMoveToBottom:"Move to bottom",chartsMenuOptions:"Field options",chartsMenuRemove:"Remove",chartsDragToDimensions:e=>`Drag here to use column as ${e}`,chartsDragToValues:e=>`Drag here to use column as ${e}`,aiAssistantPanelTitle:"AI Assistant",aiAssistantPanelClose:"Close AI Assistant",aiAssistantPanelNewConversation:"New conversation",aiAssistantPanelConversationHistory:"Conversation history",aiAssistantPanelEmptyConversation:"No prompt history",aiAssistantSuggestions:"Suggestions",promptFieldLabel:"Prompt",promptFieldPlaceholder:"Type a prompt…",promptFieldPlaceholderWithRecording:"Type or record a prompt…",promptFieldPlaceholderListening:"Listening for prompt…",promptFieldSpeechRecognitionNotSupported:"Speech recognition is not supported in this browser",promptFieldSend:"Send",promptFieldRecord:"Record",promptFieldStopRecording:"Stop recording",promptRerun:"Run again",promptProcessing:"Processing…",promptAppliedChanges:"Applied changes",promptChangeGroupDescription:e=>`Group by ${e}`,promptChangeAggregationLabel:(e,t)=>`${e} (${t})`,promptChangeAggregationDescription:(e,t)=>`Aggregate ${e} (${t})`,promptChangeFilterLabel:(e,t,n)=>"is any of"===t?`${e} is any of: ${n}`:`${e} ${t} ${n}`,promptChangeFilterDescription:(e,t,n)=>"is any of"===t?`Filter where ${e} is any of: ${n}`:`Filter where ${e} ${t} ${n}`,promptChangeSortDescription:(e,t)=>`Sort by ${e} (${t})`,promptChangePivotEnableLabel:"Pivot",promptChangePivotEnableDescription:"Enable pivot",promptChangePivotColumnsLabel:e=>`Columns (${e})`,promptChangePivotColumnsDescription:(e,t)=>`${e}${t?` (${t})`:""}`,promptChangePivotRowsLabel:e=>`Rows (${e})`,promptChangePivotValuesLabel:e=>`Values (${e})`,promptChangePivotValuesDescription:(e,t)=>`${e} (${t})`,promptChangeChartsLabel:(e,t)=>`Dimensions (${e}), Values (${t})`};function YT(e){return Ph("MuiDataGrid",e)}const XT=Mh("MuiDataGrid",["aiAssistantPanel","aiAssistantPanelHeader","aiAssistantPanelTitleContainer","aiAssistantPanelTitle","aiAssistantPanelBody","aiAssistantPanelEmptyText","aiAssistantPanelFooter","aiAssistantPanelConversation","aiAssistantPanelConversationList","aiAssistantPanelConversationTitle","aiAssistantPanelSuggestions","aiAssistantPanelSuggestionsList","aiAssistantPanelSuggestionsItem","aiAssistantPanelSuggestionsLabel","actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","aggregationColumnHeaderLabel","aggregationRowOverlayWrapper","autoHeight","autosizing","mainContent","withSidePanel","booleanCell","cell--editable","cell--editing","cell--flex","cell--textCenter","cell--textLeft","cell--textRight","cell--rangeTop","cell--rangeBottom","cell--rangeLeft","cell--rangeRight","cell--pinnedLeft","cell--pinnedRight","cell--selectionMode","cell","cellCheckbox","cellEmpty","cellSkeleton","cellOffsetLeft","checkboxInput","collapsible","collapsibleTrigger","collapsibleIcon","collapsiblePanel","columnHeader","columnHeader--alignCenter","columnHeader--alignLeft","columnHeader--alignRight","columnHeader--dragging","columnHeader--moving","columnHeader--numeric","columnHeader--sortable","columnHeader--sorted","columnHeader--filtered","columnHeader--pinnedLeft","columnHeader--pinnedRight","columnHeader--last","columnHeader--siblingFocused","columnHeader--filter","columnHeaderFilterInput","columnHeaderFilterOperatorLabel","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeaders","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsManagement","columnsManagementRow","columnsManagementHeader","columnsManagementSearchInput","columnsManagementFooter","columnsManagementScrollArea","columnsManagementEmptyText","container--top","container--bottom","detailPanel","detailPanelToggleCell","detailPanelToggleCell--expanded","footerCell","panel","panelHeader","panelWrapper","panelContent","panelFooter","paper","editBooleanCell","editInputCell","filler","filler--borderBottom","filler--pinnedLeft","filler--pinnedRight","filterForm","filterFormDeleteIcon","filterFormLogicOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","headerFilterRow","iconButtonContainer","iconSeparator","main","main--hasPinnedRight","main--hiddenContent","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","overlayWrapper","overlayWrapperInner","root","root--densityStandard","root--densityComfortable","root--densityCompact","root--disableUserSelection","root--noToolbar","row","row--editable","row--editing","row--firstVisible","row--lastVisible","row--dragging","row--beingDragged","row--dynamicHeight","row--detailPanelExpanded","row--borderBottom","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","rowReorderIcon","rowSkeleton","scrollArea--left","scrollArea--right","scrollArea--up","scrollArea--down","scrollArea","scrollbar","scrollbar--vertical","scrollbar--horizontal","scrollbarFiller","scrollbarFiller--pinnedRight","scrollShadow","scrollShadow--vertical","scrollShadow--horizontal","selectedRowCount","sortButton","sortIcon","shadowScrollArea","sidebar","sidebarHeader","toolbarContainer","toolbar","toolbarLabel","toolbarDivider","toolbarFilterList","toolbarQuickFilter","toolbarQuickFilterTrigger","toolbarQuickFilterControl","virtualScroller","virtualScroller--hasScrollX","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","withVerticalBorder","withBorderColor","cell--withRightBorder","cell--withLeftBorder","columnHeader--withRightBorder","columnHeader--withLeftBorder","treeDataGroupingCell","treeDataGroupingCellToggle","treeDataGroupingCellLoadingContainer","groupingCriteriaCell","groupingCriteriaCellToggle","groupingCriteriaCellLoadingContainer","pinnedRows","pinnedRows--top","pinnedRows--bottom","pivotPanelAvailableFields","pivotPanelField","pivotPanelField--sorted","pivotPanelFieldActionContainer","pivotPanelFieldCheckbox","pivotPanelFieldDragIcon","pivotPanelFieldList","pivotPanelFieldName","pivotPanelHeader","pivotPanelPlaceholder","pivotPanelScrollArea","pivotPanelSearchContainer","pivotPanelSection","pivotPanelSectionTitle","pivotPanelSections","pivotPanelSwitch","pivotPanelSwitchLabel","prompt","promptContent","promptText","promptFeedback","promptChangeList","promptChangesToggle","promptChangesToggleIcon","promptIcon","promptIconContainer","promptError","promptAction"]);let QT=function(e){return e.DataGrid="DataGrid",e.DataGridPro="DataGridPro",e.DataGridPremium="DataGridPremium",e}({});class ZT{timeouts=(()=>new Map)();cleanupTimeout=1e3;constructor(e=1e3){this.cleanupTimeout=e}register(e,t,n){this.timeouts||(this.timeouts=new Map);const r=setTimeout(()=>{"function"==typeof t&&t(),this.timeouts.delete(n.cleanupToken)},this.cleanupTimeout);this.timeouts.set(n.cleanupToken,r)}unregister(e){const t=this.timeouts.get(e.cleanupToken);t&&(this.timeouts.delete(e.cleanupToken),clearTimeout(t))}reset(){this.timeouts&&(this.timeouts.forEach((e,t)=>{this.unregister({cleanupToken:t})}),this.timeouts=void 0)}}class JT{registry=(()=>new FinalizationRegistry(e=>{"function"==typeof e&&e()}))();register(e,t,n){this.registry.register(e,t,n)}unregister(e){this.registry.unregister(e)}reset(){}}class eI{static create(){return new eI}}const tI={current:"undefined"!=typeof FinalizationRegistry?new JT:new ZT};let nI=0;function rI(e,t,n,r){const o=s.useState(eI.create)[0],i=s.useRef(null),a=s.useRef(null);a.current=n;const l=s.useRef(null);if(!i.current&&a.current){const n=(e,t,n)=>{t&&!t.defaultMuiPrevented&&a.current?.(e,t,n)};i.current=e.current.subscribeEvent(t,n,r),nI+=1,l.current={cleanupToken:nI},tI.current.register(o,()=>{i.current?.(),i.current=null,l.current=null},l.current)}else!a.current&&i.current&&(i.current(),i.current=null,l.current&&(tI.current.unregister(l.current),l.current=null));s.useEffect(()=>{if(!i.current&&a.current){const n=(e,t,n)=>{t&&!t.defaultMuiPrevented&&a.current?.(e,t,n)};i.current=e.current.subscribeEvent(t,n,r)}return l.current&&tI.current&&(tI.current.unregister(l.current),l.current=null),()=>{i.current?.(),i.current=null}},[e,t,r])}const oI={isFirst:!0};function iI(e,t,n){rI(e,t,n,oI)}const aI=Object.is,lI=GT,sI=(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>e===t[n]),cI=()=>({state:null,equals:null,selector:null,args:void 0}),uI=[],dI=()=>null;function pI(e,t,n=void 0,r=aI){e.current.state;const o=Dg(cI),i=null!==o.current.selector,[a,l]=s.useState(i?null:t(e,n));o.current.state=a,o.current.equals=r,o.current.selector=t;const c=o.current.args;if(o.current.args=n,i&&!((e,t)=>{let n=Object.is;return t instanceof Array?n=sI:t instanceof Object&&(n=lI),n(e,t)})(c,n)){const t=o.current.selector(e,o.current.args);o.current.equals(o.current.state,t)||(o.current.state=t,l(t))}const u=s.useCallback(()=>(o.current.subscription||(o.current.subscription=e.current.store.subscribe(()=>{const t=o.current.selector(e,o.current.args);o.current.equals(o.current.state,t)||(o.current.state=t,l(t))})),null),uI),d=s.useCallback(()=>(o.current.subscription||u(),()=>{o.current.subscription&&(o.current.subscription(),o.current.subscription=void 0)}),uI);return WM.useSyncExternalStore(d,u,dI),a}const fI={compact:.7,comfortable:1.3,standard:1},hI=nT(e=>e.density),mI=eT(hI,e=>fI[e]);function gI(e){throw new Error("Failed assertion: should not be rendered")}const vI=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange","slotProps"],bI=pg(gI,{name:"MuiDataGrid",slot:"EditInputCell"})({font:bP.typography.font.body,padding:"1px 0","& input":{padding:"0 16px",height:"100%"}}),yI=TR((e,t)=>{const n=rP(),{id:r,value:o,field:i,colDef:a,hasFocus:l,debounceMs:c=200,isProcessingProps:u,onValueChange:p,slotProps:h}=e,m=d(e,vI),g=lP(),v=s.useRef(null),[b,y]=s.useState(o),w=(e=>{const{classes:t}=e;return wm({root:["editInputCell"]},YT,t)})(n),x=s.useCallback(async e=>{const t=e.target.value,n=g.current.getColumn(i);let o=t;n.valueParser&&(o=n.valueParser(t,g.current.getRow(r),n,g)),y(o),g.current.setEditCellValue({id:r,field:i,value:o,debounceMs:c,unstable_skipValueParser:!0},e),p&&await p(e,t)},[g,c,i,r,p]),S=g.current.unstable_getEditCellMeta(r,i);return s.useEffect(()=>{"debouncedSetEditCellValue"!==S?.changeReason&&y(o)},[S,o]),Wh(()=>{l&&v.current.focus()},[l]),Xp.jsx(bI,f({as:n.slots.baseInput,inputRef:v,className:w.root,ownerState:n,fullWidth:!0,type:"number"===a.type?a.type:"text",value:b??"",onChange:x,endAdornment:u?Xp.jsx(n.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},m,h?.root,{ref:t}))}),wI=(e,t)=>t&&e.length>1?[e[0]]:e,xI=(e,t)=>n=>f({},n,{sorting:f({},n.sorting,{sortModel:wI(e,t)})}),SI=(e,t)=>{const n=e.map(e=>((e,t)=>{const n=t.current.getColumn(e.field);if(!n||null===e.sort)return null;let r;return r=n.getSortComparator?n.getSortComparator(e.sort):"desc"===e.sort?(...e)=>-1*n.sortComparator(...e):n.sortComparator,r?{getSortCellParams:e=>({id:e,field:n.field,rowNode:ST(t,e),value:t.current.getCellValue(e,n.field),api:t.current}),comparator:r}:null})(e,t)).filter(e=>!!e);return 0===n.length?null:e=>e.map(e=>({node:e,params:n.map(t=>t.getSortCellParams(e.id))})).sort((e,t)=>{return r=e,o=t,n.reduce((e,t,n)=>{if(0!==e)return e;const i=r.params[n],a=o.params[n];return t.comparator(i.value,a.value,i,a)},0);var r,o}).map(e=>e.node.id)},CI=(e,t)=>{const n=e.indexOf(t);return t&&-1!==n&&n+1!==e.length?e[n+1]:e[0]},kI=(e,t)=>null==e&&null!=t?-1:null==t&&null!=e?1:null==e&&null==t?0:null,EI=new Intl.Collator,RI=(e,t)=>{const n=kI(e,t);return null!==n?n:Number(e)-Number(t)},PI=(e,t)=>{const n=kI(e,t);return null!==n?n:e>t?1:e<t?-1:0},MI=["item","applyValue","type","apiRef","focusElementRef","tabIndex","disabled","isFilterActive","slotProps","clearButton","headerFilterMenu"];function TI(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,tabIndex:a,disabled:l,slotProps:c,clearButton:u,headerFilterMenu:p}=e,h=d(e,MI),m=c?.root,g=Ng(),[v,b]=s.useState(II(t.value)),[y,w]=s.useState(!1),x=mm(),S=rP(),C=s.useCallback(e=>{const o=II(e.target.value);b(o),w(!0),g.start(S.filterDebounceMs,()=>{const e=f({},t,{value:"number"!==r||Number.isNaN(Number(o))?o:Number(o),fromInput:x});n(e),w(!1)})},[g,S.filterDebounceMs,t,r,x,n]);return s.useEffect(()=>{t.fromInput===x&&null!=t.value||b(II(t.value))},[x,t]),Xp.jsxs(s.Fragment,{children:[Xp.jsx(S.slots.baseTextField,f({id:x,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),value:v??"",onChange:C,type:r||"text",disabled:l,slotProps:f({},m?.slotProps,{input:f({endAdornment:y?Xp.jsx(S.slots.loadIcon,{fontSize:"small",color:"action"}):null},m?.slotProps?.input),htmlInput:f({tabIndex:a},m?.slotProps?.htmlInput)}),inputRef:i},S.slotProps?.baseTextField,h,m)),p,u]})}function II(e){if(null!=e&&""!==e)return String(e)}function OI(e){return"object"==typeof e&&null!==e}function DI(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const FI=(e,t,n)=>Math.max(t,Math.min(n,e));function LI(e){return"function"==typeof structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e))}const AI=(e,t)=>n=>{e&&t(n)};function NI(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,slotProps:a}=e,l=mm(),[c,u]=s.useState([]),[d,p]=s.useState(t.value||[]),h=rP();s.useEffect(()=>{const e=t.value??[];p(e.map(String))},[t.value]);const m=s.useCallback((e,o)=>{p(o.map(String)),n(f({},t,{value:[...o.map(e=>"number"===r?Number(e):e)]}))},[n,t,r]),g=s.useCallback((e,t)=>{u(""===t?[]:[t])},[u]),v=h.slots.baseAutocomplete;return Xp.jsx(v,f({multiple:!0,freeSolo:!0,options:c,id:l,value:d,onChange:m,onInputChange:g,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),slotProps:{textField:{type:r||"text",inputRef:i}}},a?.root))}var $I=function(e){return e.Cell="cell",e.Row="row",e}($I||{}),zI=function(e){return e.Edit="edit",e.View="view",e}(zI||{}),jI=function(e){return e.Edit="edit",e.View="view",e}(jI||{}),BI=function(e){return e.And="and",e.Or="or",e}(BI||{});class _I{constructor(e){this.data=e.ids}has(e){return this.data.has(e)}select(e){this.data.add(e)}unselect(e){this.data.delete(e)}}class HI{constructor(e){this.data=e.ids}has(e){return!this.data.has(e)}select(e){this.data.delete(e)}unselect(e){this.data.add(e)}}const VI=e=>"include"===e.type?new _I(e):new HI(e);var WI=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e.pasteKeyDown="pasteKeyDown",e}(WI||{}),UI=function(e){return e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(UI||{}),GI=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e}(GI||{}),KI=function(e){return e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(KI||{});function qI(e){return void 0!==e.field}const YI={filteredRowsLookup:{},filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}},XI=()=>({items:[],logicOperator:BI.And,quickFilterValues:[],quickFilterLogicOperator:BI.And});function QI(e){return{current:e.current.getPublicApi()}}let ZI=function(e){return e.LEFT="left",e.RIGHT="right",e}({});const JI={left:[],right:[]},eO=nT(e=>e.isRtl),tO=nT(e=>e.props.listView??!1),nO=nT(e=>e.listViewColumn),rO=nT(e=>e.columns),oO=eT(rO,e=>e.orderedFields),iO=eT(rO,e=>e.lookup),aO=tT(oO,iO,(e,t)=>e.map(e=>t[e])),lO=eT(rO,e=>e.columnVisibilityModel),sO=eT(rO,e=>e.initialColumnVisibilityModel),cO=tT(aO,lO,tO,nO,(e,t,n,r)=>n&&r?[r]:e.filter(e=>!1!==t[e.field])),uO=tT(cO,e=>e.map(e=>e.field)),dO=nT(e=>e.pinnedColumns);tT(dO,oO,eO,(e,t,n)=>fO(e,t,n));const pO=tT(rO,dO,uO,eO,tO,(e,t,n,r,o)=>{if(o)return JI;const i=fO(t,n,r);return{left:i.left.map(t=>e.lookup[t]),right:i.right.map(t=>e.lookup[t])}});function fO(e,t,n){if(!Array.isArray(e.left)&&!Array.isArray(e.right))return JI;if(0===e.left?.length&&0===e.right?.length)return JI;const r=(e,t)=>Array.isArray(e)?e.filter(e=>t.includes(e)):[],o=r(e.left,t),i=t.filter(e=>!o.includes(e)),a=r(e.right,i);return n?{left:a,right:o}:{left:o,right:a}}const hO=tT(cO,e=>{const t=[];let n=0;for(let r=0;r<e.length;r+=1)t.push(n),n+=e[r].computedWidth;return t}),mO=tT(aO,e=>e.filter(e=>e.filterable)),gO=tT(aO,e=>e.reduce((e,t)=>(t.filterable&&(e[t.field]=t),e),{})),vO=tT(aO,e=>e.some(e=>void 0!==e.colSpan));let bO;const yO=(e,t)=>{const n=f({},e);if(null==n.id&&(n.id=Math.round(1e5*Math.random())),null==n.operator){const e=iO(t)[n.field];n.operator=e&&e.filterOperators[0].value}return n},wO=(e,t,n)=>{const r=e.items.length>1;let o;o=r&&t?[e.items[0]]:e.items;const i=r&&o.some(e=>null==e.id);return o.some(e=>null==e.operator)||i?f({},e,{items:o.map(e=>yO(e,n))}):e.items!==o?f({},e,{items:o}):e},xO=(e,t,n)=>r=>f({},r,{filterModel:wO(e,t,n)}),SO=e=>"string"==typeof e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,CO=(e,t,n)=>{if(!e.field||!e.operator)return null;const r=n.current.getColumn(e.field);if(!r)return null;let o;if(r.valueParser){const t=r.valueParser;o=Array.isArray(e.value)?e.value?.map(e=>t(e,void 0,r,n)):t(e.value,void 0,r,n)}else o=e.value;const{ignoreDiacritics:i}=n.current.rootProps;i&&(o=SO(o));const a=f({},e,{value:o}),l=r.filterOperators;if(!l?.length)throw new Error(`MUI X: No filter operators found for column '${r.field}'.`);const s=l.find(e=>e.value===a.operator);if(!s)throw new Error(`MUI X: No filter operator found for column '${r.field}' and operator value '${a.operator}'.`);const c=QI(n),u=s.getApplyFilterFn(a,r);return"function"!=typeof u?null:{item:a,fn:e=>{let n=t(e,r);return i&&(n=SO(n)),u(n,e,r,c)}}};let kO=1;const EO=(e,t,n,r)=>{const{items:o}=e,i=o.map(e=>CO(e,t,n)).filter(e=>!!e);if(0===i.length)return null;if(r||!function(){if(void 0!==bO)return bO;try{bO=new Function("return true")()}catch(e){bO=!1}return bO}())return(e,t)=>{const n={};for(let r=0;r<i.length;r+=1){const o=i[r];t&&!t(o.item.field)||(n[o.item.id]=o.fn(e))}return n};const a=new Function("appliers","row","shouldApplyFilter",`"use strict";\n${i.map((e,t)=>`const shouldApply${t} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(e.item.field)});`).join("\n")}\n\nconst result$$ = {\n${i.map((e,t)=>` ${JSON.stringify(String(e.item.id))}: !shouldApply${t} ? false : appliers[${t}].fn(row),`).join("\n")}\n};\n\nreturn result$$;`.replaceAll("$$",String(kO)));kO+=1;return(e,t)=>a(i,e,t)},RO=e=>e.quickFilterExcludeHiddenColumns??!0,PO=(e,t,n,r)=>{const o=EO(e,t,n,r),i=((e,t,n)=>{const r=e.quickFilterValues?.filter(Boolean)??[];if(0===r.length)return null;const o=oO(n),i=lO(n);let a;a=RO(e)?o.filter(e=>!1!==i[e]):o;const l=[],{ignoreDiacritics:s}=n.current.rootProps,c=QI(n);return a.forEach(e=>{const t=n.current.getColumn(e),o=t?.getApplyQuickFilterFn;o&&l.push({column:t,appliers:r.map(e=>{const n=s?SO(e):e;return{fn:o(n,t,c)}})})}),function(e,n){const o={};e:for(let i=0;i<r.length;i+=1){const a=r[i];for(let r=0;r<l.length;r+=1){const{column:u,appliers:d}=l[r],{field:p}=u;if(n&&!n(p))continue;const f=d[i];let h=t(e,u);if(null!==f.fn&&(s&&(h=SO(h)),f.fn(h,e,u,c))){o[a]=!0;continue e}}o[a]=!1}return o}})(e,t,n);return function(e,t,n){n.passingFilterItems=o?.(e,t)??null,n.passingQuickFilterValues=i?.(e,t)??null}},MO=e=>null!=e,TO=(e,t,n,r,o,i)=>{const a=((e,t,n,r)=>(e.cleanedFilterItems||(e.cleanedFilterItems=r.filter(e=>null!==CO(e,t,n))),e.cleanedFilterItems))(i,r,o,n.items),l=e.filter(MO),s=t.filter(MO);if(l.length>0){const e=e=>l.some(t=>t[e.id]);if((n.logicOperator??XI().logicOperator)===BI.And){if(!a.every(e))return!1}else{if(!a.some(e))return!1}}if(s.length>0&&null!=n.quickFilterValues){const e=e=>s.some(t=>t[e]);if((n.quickFilterLogicOperator??XI().quickFilterLogicOperator)===BI.And){if(!n.quickFilterValues.every(e))return!1}else{if(!n.quickFilterValues.some(e))return!1}}return!0},IO=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),o=new RegExp(DI(r),"i");return e=>{if(null==e)return t;const n=o.test(String(e));return t?!n:n}},OO=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),o=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return e=>{if(null==e)return t;const n=0===o.compare(r,e.toString());return t?!n:n}},DO=e=>()=>t=>{const n=""===t||null==t;return e?!n:n},FO={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,chartable:!0,editable:!1,sortComparator:(e,t)=>{const n=kI(e,t);return null!==n?n:"string"==typeof e?EI.compare(e.toString(),t.toString()):e-t},type:"string",align:"left",filterOperators:((e=!1)=>[{value:"contains",getApplyFilterFn:IO(e,!1),InputComponent:TI},{value:"doesNotContain",getApplyFilterFn:IO(e,!0),InputComponent:TI},{value:"equals",getApplyFilterFn:OO(e,!1),InputComponent:TI},{value:"doesNotEqual",getApplyFilterFn:OO(e,!0),InputComponent:TI},{value:"startsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`^${DI(n)}.*$`,"i");return e=>null!=e&&r.test(e.toString())},InputComponent:TI},{value:"endsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`.*${DI(n)}$`,"i");return e=>null!=e&&r.test(e.toString())},InputComponent:TI},{value:"isEmpty",getApplyFilterFn:DO(!1),requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:DO(!0),requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:t=>{if(!Array.isArray(t.value)||0===t.value.length)return null;const n=e?t.value:t.value.map(e=>e.trim()),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return e=>null!=e&&n.some(t=>0===r.compare(t,e.toString()||""))},InputComponent:NI}])(),renderEditCell:e=>Xp.jsx(yI,f({},e)),getApplyQuickFilterFn:e=>{if(!e)return null;const t=new RegExp(DI(e),"i");return(e,n,r,o)=>{let i=o.current.getRowFormattedValue(n,r);return o.current.ignoreDiacritics&&(i=SO(i)),null!=i&&t.test(i.toString())}}};function LO(e){return 1===e.key.length&&!e.ctrlKey&&!e.metaKey}const AO=e=>0===e.indexOf("Arrow")||0===e.indexOf("Page")||" "===e||"Home"===e||"End"===e,NO=e=>"Tab"===e||"Escape"===e;function $O(e){return(e.ctrlKey||e.metaKey)&&"V"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey}const zO=s.createContext(void 0),jO=()=>{const e=s.useContext(zO);if(void 0===e)throw new Error(["MUI X: Could not find the Data Grid configuration context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join("\n"));return e},BO=s.createContext({className:"unset",tag:Xp.jsx("style",{href:"/unset"})});function _O(){return s.useContext(BO).className}function HO(e){const t=jO(),n=rP(),r=t.hooks.useCSSVariables(),o=s.useMemo(()=>{const e=`MuiDataGridVariables-${r.id}`,t=`.${e}{${function(e){let t="";for(const n in e)Object.hasOwn(e,n)&&void 0!==e[n]&&(t+=`${n}:${e[n]};`);return t}(r.variables)}}`;return{className:e,tag:Xp.jsx("style",{href:`/${e}`,nonce:n.nonce,children:t})}},[n.nonce,r]);return Xp.jsx(BO.Provider,{value:o,children:e.children})}const VO=["open","target","onClose","children","position","className","onExited"],WO=pg(gI,{name:"MuiDataGrid",slot:"Menu"})({zIndex:bP.zIndex.menu,[`& .${XT.menuList}`]:{outline:0}});function UO(e){const{open:t,target:n,onClose:r,children:o,position:i,className:a,onExited:l}=e,c=d(e,VO),u=lP(),p=rP(),h=(e=>{const{classes:t}=e;return wm({root:["menu"]},YT,t)})(p),m=_O(),g=s.useRef(null);Wh(()=>{t?g.current=document.activeElement instanceof HTMLElement?document.activeElement:null:(g.current?.focus?.(),g.current=null)},[t]),s.useEffect(()=>{const e=t?"menuOpen":"menuClose";u.current.publishEvent(e,{target:n})},[u,t,n]);return Xp.jsx(WO,f({as:p.slots.basePopper,className:PR(h.root,a,m),ownerState:p,open:t,target:n,transition:!0,placement:i,onClickAway:e=>{e.target&&(n===e.target||n?.contains(e.target))||r(e)},onExited:l,clickAwayMouseEvent:"onMouseDown",onKeyDown:e=>{NO(e.key)&&r(e)}},c,p.slotProps?.basePopper,{children:o}))}const GO=["label","icon","showInMenu","onClick"],KO=["label","icon","showInMenu","onClick","closeMenuOnClick","closeMenu"],qO=TR((e,t)=>{const n=rP();if(!e.showInMenu){const{label:r,icon:o,onClick:i}=e,a=d(e,GO),l=e=>{i?.(e)};return Xp.jsx(n.slots.baseIconButton,f({size:"small",role:"menuitem","aria-label":r},a,{onClick:l},n.slotProps?.baseIconButton,{ref:t,children:s.cloneElement(o,{fontSize:"small"})}))}const{label:r,icon:o,onClick:i,closeMenuOnClick:a=!0,closeMenu:l}=e,c=d(e,KO);return Xp.jsx(n.slots.baseMenuItem,f({ref:t},c,{onClick:e=>{i?.(e),a&&l?.()},iconStart:o,children:r}))}),YO=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","children","suppressChildrenValidation"];function XO(e){const{hasFocus:t,tabIndex:n,position:r="bottom-end",children:o,suppressChildrenValidation:i}=e,a=d(e,YO),[l,c]=s.useState(-1),[u,p]=s.useState(!1),h=lP(),m=s.useRef(null),g=s.useRef(null),v=s.useRef(!1),b=s.useRef({}),y=um(),w=mm(),x=mm(),S=rP(),C=[];s.Children.forEach(o,e=>{s.isValidElement(e)&&(e.type===s.Fragment?s.Children.forEach(e.props.children,e=>{s.isValidElement(e)&&C.push(e)}):e.type===qO||i?C.push(e):"function"==typeof e.type?e.type.name:e.type)});const k=C.filter(e=>!e.props.showInMenu),E=C.filter(e=>e.props.showInMenu),R=k.length+(E.length?1:0);s.useLayoutEffect(()=>{t||Object.entries(b.current).forEach(([e,t])=>{t?.stop({},()=>{delete b.current[e]})})},[t]),s.useEffect(()=>{if(l<0||!m.current)return;if(l>=m.current.children.length)return;m.current.children[l].focus({preventScroll:!0})},[l]);const P=C.findIndex(e=>!e.props.disabled);s.useEffect(()=>{t&&-1===l&&c(P),t||(c(-1),v.current=!1)},[t,l,P]),s.useEffect(()=>{l>=R&&c(R-1)},[l,R]);const M=()=>{p(!1)},T=e=>t=>{b.current[e]=t},I=(e,t)=>n=>{c(e),v.current=!0,t&&t(n)},O=R>0?{role:"menu",onKeyDown:e=>{if(R<=1)return;const t=(e,n)=>{if(e<0||e>C.length)return e;const r=("left"===n?-1:1)*(y?-1:1);return C[e+r]?.props.disabled?t(e+r,n):e+r};let n=l;"ArrowRight"===e.key?n=t(l,"right"):"ArrowLeft"===e.key&&(n=t(l,"left")),n<0||n>=R||n!==l&&(e.preventDefault(),e.stopPropagation(),c(n))}}:void 0;return Xp.jsxs("div",f({ref:m,tabIndex:-1,className:XT.actionsCell},O,a,{children:[k.map((e,t)=>s.cloneElement(e,{key:t,touchRippleRef:T(t),onClick:I(t,e.props.onClick),tabIndex:l===t?n:-1})),E.length>0&&x&&Xp.jsx(S.slots.baseIconButton,f({ref:g,id:x,"aria-label":h.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":u,"aria-controls":u?w:void 0,role:"menuitem",size:"small",onClick:e=>{e.stopPropagation(),e.preventDefault(),u?M():(p(!0),c(R-1),v.current=!0)},touchRippleRef:T(x),tabIndex:l===k.length?n:-1},S.slotProps?.baseIconButton,{children:Xp.jsx(S.slots.moreActionsIcon,{fontSize:"small"})})),E.length>0&&Xp.jsx(UO,{open:u,target:g.current,position:r,onClose:M,children:Xp.jsx(S.slots.baseMenuList,{id:w,className:XT.menuList,"aria-labelledby":x,autoFocusItem:!0,children:E.map((e,t)=>s.cloneElement(e,{key:t,closeMenu:M}))})})]}))}function QO(e){const{colDef:t,id:n}=e,r=lP();if(!(e=>"function"==typeof e.getActions)(t))throw new Error("MUI X: Missing the `getActions` property in the `GridColDef`.");const o=t.getActions(r.current.getRowParams(n));return Xp.jsx(XO,f({suppressChildrenValidation:!0},e,{children:o}))}const ZO="actions",JO=f({},FO,{sortable:!1,filterable:!1,aggregable:!1,chartable:!1,width:100,display:"flex",align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:e=>Xp.jsx(QO,f({},e)),getApplyQuickFilterFn:()=>null}),eD="__row_group_by_columns_group__",tD="__detail_panel_toggle__";let nD=function(e){return e[e.NONE=0]="NONE",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.VIRTUAL=3]="VIRTUAL",e}({});const rD=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","hideDescendantCount"];function oD(e){const{value:t,rowNode:n}=e,r=d(e,rD),o=lP(),i=rP(),a=(e=>{const{classes:t}=e;return wm({root:["booleanCell"]},YT,t)})({classes:i.classes}),l=pI(o,RT)>0&&"group"===n.type&&!1===i.treeData,c=s.useMemo(()=>t?i.slots.booleanCellTrueIcon:i.slots.booleanCellFalseIcon,[i.slots.booleanCellFalseIcon,i.slots.booleanCellTrueIcon,t]);return l&&void 0===t?null:Xp.jsx(c,f({fontSize:"small",className:a.root,titleAccess:o.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":Boolean(t)},r))}const iD=s.memo(oD),aD=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"];function lD(e){const{id:t,value:n,field:r,className:o,hasFocus:i,onValueChange:a}=e,l=d(e,aD),c=lP(),u=s.useRef(null),p=mm(),[h,m]=s.useState(n),g=rP(),v=(e=>{const{classes:t}=e;return wm({root:["editBooleanCell"]},YT,t)})({classes:g.classes}),b=s.useCallback(async e=>{const n=e.target.checked;a&&await a(e,n),m(n),await c.current.setEditCellValue({id:t,field:r,value:n},e)},[c,r,t,a]);return s.useEffect(()=>{m(n)},[n]),Wh(()=>{i&&u.current.focus()},[i]),Xp.jsx("label",f({htmlFor:p,className:PR(v.root,o)},l,{children:Xp.jsx(g.slots.baseCheckbox,f({id:p,inputRef:u,checked:Boolean(h),onChange:b,size:"small"},g.slotProps?.baseCheckbox))}))}const sD=["item","applyValue","apiRef","focusElementRef","isFilterActive","headerFilterMenu","clearButton","tabIndex","slotProps"];function cD(e){const{item:t,applyValue:n,apiRef:r,focusElementRef:o,headerFilterMenu:i,clearButton:a,tabIndex:l,slotProps:c}=e,u=d(e,sD),[p,h]=s.useState(uD(t.value)),m=rP(),g=mm(),v=mm(),b=m.slotProps?.baseSelect||{},y=b.native??!1,w=m.slotProps?.baseSelectOption||{},x=s.useCallback(e=>{const r=uD(e.target.value);h(r),n(f({},t,{value:r}))},[n,t]);s.useEffect(()=>{h(uD(t.value))},[t.value]);const S=c?.root.label??r.current.getLocaleText("filterPanelInputLabel"),C=c?.root.slotProps;return Xp.jsxs(s.Fragment,{children:[Xp.jsxs(m.slots.baseSelect,f({fullWidth:!0,labelId:g,id:v,label:S,value:void 0===p?"":String(p),onChange:x,native:y,slotProps:{htmlInput:f({ref:o,tabIndex:l},C?.htmlInput)}},b,u,c?.root,{children:[Xp.jsx(m.slots.baseSelectOption,f({},w,{native:y,value:"",children:r.current.getLocaleText("filterValueAny")})),Xp.jsx(m.slots.baseSelectOption,f({},w,{native:y,value:"true",children:r.current.getLocaleText("filterValueTrue")})),Xp.jsx(m.slots.baseSelectOption,f({},w,{native:y,value:"false",children:r.current.getLocaleText("filterValueFalse")}))]})),i,a]})}function uD(e){return"true"===String(e).toLowerCase()||"false"!==String(e).toLowerCase()&&void 0}const dD=f({},FO,{type:"boolean",display:"flex",align:"center",headerAlign:"center",renderCell:e=>e.field!==eD&&jT(e.rowNode)?"":Xp.jsx(iD,f({},e)),renderEditCell:e=>Xp.jsx(lD,f({},e)),sortComparator:RI,valueFormatter:(e,t,n,r)=>e?r.current.getLocaleText("booleanCellTrueLabel"):r.current.getLocaleText("booleanCellFalseLabel"),filterOperators:[{value:"is",getApplyFilterFn:e=>{const t=uD(e.value);return void 0===t?null:e=>Boolean(e)===t},InputComponent:cD}],getApplyQuickFilterFn:()=>null,aggregable:!1,chartable:!1,pastedValueParser:e=>(e=>{switch(e.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case"null":case"undefined":return!1;default:return}})(e)});function pD(e){for(const t in e)return!1;return!0}const fD=nT(e=>e.sorting),hD=eT(fD,e=>e.sortedRows),mD=tT(hD,wT,xT,(e,t,n)=>e.reduce((e,r)=>{const o=t[r];if(o)e.push({id:r,model:o});else{const t=n[r];t&&jT(t)&&e.push({id:r,model:{[DT]:r}})}return e},[])),gD=eT(fD,e=>e.sortModel),vD=tT(gD,e=>{const t=e.reduce((t,n,r)=>(t[n.field]={sortDirection:n.sort,sortIndex:e.length>1?r+1:void 0},t),{});return t});tT(hD,e=>e.reduce((e,t,n)=>(e[t]=n,e),Object.create(null)));const bD=nT(e=>e.filter),yD=eT(bD,e=>e.filterModel),wD=eT(yD,e=>e.quickFilterValues),xD=nT(e=>e.visibleRowsLookup),SD=eT(bD,e=>e.filteredRowsLookup);eT(bD,e=>e.filteredChildrenCountLookup),eT(bD,e=>e.filteredDescendantCountLookup);const CD=tT(xD,mD,(e,t)=>pD(e)?t:t.filter(t=>!1!==e[t.id])),kD=tT(CD,e=>e.map(e=>e.id)),ED=tT(SD,mD,(e,t)=>pD(e)?t:t.filter(t=>!1!==e[t.id])),RD=tT(ED,e=>e.map(e=>e.id));tT(kD,xT,(e,t)=>{const n={};let r=0;return e.reduce((e,o)=>{const i=t[o];return n[i.depth]||(n[i.depth]=0),i.depth>r&&(n[i.depth]=0),r=i.depth,n[i.depth]+=1,e[o]=n[i.depth],e},{})});const PD=eT(tT(ED,xT,RT,(e,t,n)=>n<2?[e]:e.reduce((e,n)=>{const r=t[n.id]?.depth;return void 0===r||(e[r]||(e[r]=[]),e[r].push(n)),e},[[]])),e=>e[0]??[]),MD=eT(CD,e=>e.length),TD=eT(PD,e=>e.length),ID=eT(ED,e=>e.length);eT(ID,TD,(e,t)=>e-t);const OD=tT(yD,iO,(e,t)=>e.items?.filter(e=>{if(!e.field)return!1;const n=t[e.field];if(!n?.filterOperators||0===n?.filterOperators?.length)return!1;const r=n.filterOperators.find(t=>t.value===e.operator);return!!r&&(!r.InputComponent||null!=e.value&&""!==e.value?.toString())})),DD=tT(OD,e=>{const t=e.reduce((e,t)=>(e[t.field]?e[t.field].push(t):e[t.field]=[t],e),{});return t}),FD=tT(kD,e=>e.reduce((e,t,n)=>(e[t]=n,e),Object.create(null))),LD=nT(e=>e.rowSelection),AD=tT(LD,VI),ND=eT(LD,ID,(e,t)=>"include"===e.type?e.ids.size:t-e.ids.size),$D=tT(LD,wT,PT,(e,t,n)=>{const r=new Map;if("include"===e.type)for(const n of e.ids)r.set(n,t[n]);else for(let o=0;o<n.length;o+=1){const i=n[o];e.ids.has(i)||r.set(i,t[i])}return r}),zD=nT((e,t)=>DT in t?t[DT]:e.props.getRowId?e.props.getRowId(t):t.id),jD=nT(e=>e.props.isRowSelectable);function BD(e,t){const n=xT(e),r=hD(e),o=SD(e),i=n[t];if(!i||"group"!==i.type)return[];const a=[];for(let l=r.findIndex(e=>e===t)+1;l<r.length&&n[r[l]]?.depth>i.depth;l+=1){const t=r[l];!1!==o[t]&&e.current.isRowSelectable(t)&&a.push(t)}return a}const _D=eT(aO,xT,SD,AD,wT,jD,(e,t,n,r,o,i,{groupId:a,autoSelectParents:l})=>{const s=t[a],c={id:a,row:o[a],columns:e};let u=!0;if("function"==typeof i&&(u=i(c)),!s||"group"!==s.type||r.has(a))return{isIndeterminate:!1,isChecked:r.has(a),isSelectable:u};let d=!1,p=!1;const f=e=>{if(!1===n[e]||d&&p)return;const o=t[e];"group"===o?.type&&o.children.forEach(f),r.has(e)?d=!0:p=!0};return f(a),{isIndeterminate:d&&p,isChecked:!!l&&(d&&!p),isSelectable:u}});function HD(e){return e.signature===QT.DataGrid?e.checkboxSelection&&!0!==e.disableMultipleRowSelection:!e.disableMultipleRowSelection}const VD=(e,t,n,r,o,i,a=AD(e))=>{const l=SD(e),s=new Set([]);if((r||o)&&!1!==l[n]){if(r){const r=t[n];if("group"===r?.type){BD(e,n).forEach(e=>{i(e),s.add(e)})}}if(o){const r=e=>{if(!a.has(e)&&!s.has(e))return!1;const n=t[e];return!!n&&("group"!==n.type||n.children.every(r))},o=n=>{const a=((e,t,n)=>{const r=e[n];if(!r)return[];const o=r.parent;return null==o?[]:e[o].children.filter(e=>e!==n&&!1!==t[e])})(t,l,n);if(0===a.length||a.every(r)){const r=t[n],a=r?.parent;null!=a&&a!==OT&&e.current.isRowSelectable(a)&&(i(a),s.add(a),o(a))}},c=t[n];if(!c||c.parent===OT)return;o(n)}}},WD=(e,t,n,r,o,i)=>{const a=AD(e);if(o||r){if(o){const e=((e,t)=>{const n=[];let r=t;for(;null!=r&&r!==OT;){const t=e[r];if(!t)return n;n.push(r),r=t.parent}return n})(t,n);e.forEach(e=>{a.has(e)&&i(e)})}if(r){const r=t[n];if("group"===r?.type){BD(e,n).forEach(e=>{i(e)})}}}},UD=["field","id","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],GD=TR(function(e,t){const{field:n,id:r,rowNode:o,tabIndex:i}=e,a=d(e,UD),l=lP(),c=rP(),u=(e=>{const{classes:t}=e;return wm({root:["checkboxInput"]},YT,t)})({classes:c.classes}),{isIndeterminate:p,isChecked:h,isSelectable:m}=pI(l,_D,{groupId:r,autoSelectParents:c.rowSelectionPropagation?.parents??!1}),g=!m;s.useLayoutEffect(()=>{if(0===i){const e=l.current.getCellElement(r,n);e&&(e.tabIndex=-1)}},[l,i,r,n]);const v=Mg(e=>{" "===e.key&&e.stopPropagation()}),b=Mg(e=>{g&&e.preventDefault()}),y=Mg(()=>{});if("footer"===o.type||"pinnedRow"===o.type)return null;const w=l.current.getLocaleText(h&&!p?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return Xp.jsx(c.slots.baseCheckbox,f({tabIndex:i,checked:h&&!p,onChange:e=>{if(g)return;const t={value:e.target.checked,id:r};l.current.publishEvent("rowSelectionCheckboxChange",t,e)},onClick:b,onMouseDown:y,className:PR(u.root,g&&"Mui-disabled"),material:{disableRipple:g},slotProps:{htmlInput:{"aria-disabled":g||void 0,"aria-label":w,name:"select_row"}},onKeyDown:v,indeterminate:p},c.slotProps?.baseCheckbox,a,{ref:t}))}),KD=GD,qD=nT(e=>e.focus),YD=eT(qD,e=>e.cell),XD=eT(qD,e=>e.columnHeader);eT(qD,e=>e.columnHeaderFilter);const QD=eT(qD,e=>e.columnGroupHeader),ZD=nT(e=>e.tabIndex),JD=eT(ZD,e=>e.cell),eF=eT(ZD,e=>e.columnHeader);eT(ZD,e=>e.columnHeaderFilter);const tF=eT(ZD,e=>e.columnGroupHeader),nF=(e,t,n)=>t>0&&e>0?Math.ceil(e/t):-1===e?n+2:0,rF=e=>({page:0,pageSize:e?0:100}),oF=(e,t)=>{if(t===QT.DataGrid&&e>100)throw new Error(["MUI X: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join("\n"))},iF=nT(e=>e.pagination),aF=eT(iF,e=>e.enabled&&"client"===e.paginationMode),lF=eT(iF,e=>e.paginationModel),sF=eT(iF,e=>e.rowCount),cF=eT(iF,e=>e.meta),uF=eT(lF,e=>e.page),dF=eT(lF,e=>e.pageSize),pF=eT(lF,sF,(e,t)=>nF(t,e.pageSize,e.page)),fF=tT(aF,lF,xT,RT,CD,PD,(e,t,n,r,o,i)=>{if(!e)return null;const a=i.length,l=Math.min(t.pageSize*t.page,a-1),s=-1===t.pageSize?a-1:Math.min(l+t.pageSize-1,a-1);if(-1===l||-1===s)return null;if(r<2)return{firstRowIndex:l,lastRowIndex:s};const c=i[l],u=s-l+1,d=o.findIndex(e=>e.id===c.id);let p=d,f=0;for(;p<o.length&&f<=u;){const e=o[p],t=n[e.id]?.depth;void 0===t?p+=1:((f<u||t>0)&&(p+=1),0===t&&(f+=1))}return{firstRowIndex:d,lastRowIndex:p-1}}),hF=tT(CD,fF,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),mF=tT(kD,fF,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),gF=tT(aF,fF,hF,CD,(e,t,n,r)=>e?{rows:n,range:t,rowIdToIndexMap:n.reduce((e,t,n)=>(e.set(t.id,n),e),new Map)}:{rows:r,range:0===r.length?null:{firstRowIndex:0,lastRowIndex:r.length-1},rowIdToIndexMap:r.reduce((e,t,n)=>(e.set(t.id,n),e),new Map)}),vF=["field","colDef"],bF=TR(function(e,t){const n=d(e,vF),[,r]=s.useState(!1),o=lP(),i=rP(),a=(e=>{const{classes:t}=e;return wm({root:["checkboxInput"]},YT,t)})({classes:i.classes}),l=pI(o,eF),c=pI(o,LD),u=pI(o,kD),p=pI(o,mF),h=s.useMemo(()=>{const e=i.isRowSelectable;if("function"!=typeof e)return c;if("exclude"===c.type)return c;const t={type:"include",ids:new Set};for(const n of c.ids)i.keepNonExistentRowsSelected&&t.ids.add(n),o.current.getRow(n)&&e(o.current.getRowParams(n))&&t.ids.add(n);return t},[o,i.isRowSelectable,i.keepNonExistentRowsSelected,c]),m=s.useMemo(()=>{const e=i.pagination&&i.checkboxSelectionVisibleOnly&&"server"!==i.paginationMode?p:u,t=new Set;for(let n=0;n<e.length;n+=1){const r=e[n];o.current.getRow(r)&&(o.current.isRowSelectable(r)&&t.add(r))}return t},[o,i.pagination,i.paginationMode,i.checkboxSelectionVisibleOnly,p,u]),g=s.useMemo(()=>{const e=VI(h);let t=0;for(const n of m)e.has(n)&&(t+=1);return t},[h,m]),v=s.useMemo(()=>{if(0===g)return!1;const e=VI(h);for(const t of m)if(!e.has(t))return!0;return!1},[g,h,m]),b=g>0,y=null!==l&&l.field===e.field?0:-1;s.useLayoutEffect(()=>{const t=o.current.getColumnHeaderElement(e.field);0===y&&t&&(t.tabIndex=-1)},[y,o,e.field]);const w=s.useCallback(e=>{" "===e.key&&o.current.publishEvent("headerSelectionCheckboxChange",{value:!b})},[o,b]),x=s.useCallback(()=>{r(e=>!e)},[]);s.useEffect(()=>o.current.subscribeEvent("rowSelectionChange",x),[o,x]);const S=o.current.getLocaleText(b&&!v?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return Xp.jsx(i.slots.baseCheckbox,f({indeterminate:v,checked:b&&!v,onChange:e=>{const t={value:e.target.checked};o.current.publishEvent("headerSelectionCheckboxChange",t)},className:a.root,slotProps:{htmlInput:{"aria-label":S,name:"select_all_rows"}},tabIndex:y,onKeyDown:w,disabled:!HD(i)},i.slotProps?.baseCheckbox,n,{ref:t}))}),yF="__check__",wF=f({},dD,{type:"custom",field:yF,width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,chartable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:()=>null,display:"flex",valueGetter:(e,t,n,r)=>{const o=zD(r,t);return r.current.isRowSelected(o)},rowSpanValueGetter:(e,t,n,r)=>zD(r,t),renderHeader:e=>Xp.jsx(bF,f({},e)),renderCell:e=>Xp.jsx(KD,f({},e))}),xF=["item","applyValue","type","apiRef","focusElementRef","slotProps","isFilterActive","headerFilterMenu","clearButton","tabIndex","disabled"];function SF(e,t){if(null==e)return"";const n=new Date(e);return Number.isNaN(n.getTime())?"":"date"===t?n.toISOString().substring(0,10):"datetime-local"===t?(n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n.toISOString().substring(0,19)):n.toISOString().substring(0,10)}function CF(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,slotProps:a,headerFilterMenu:l,clearButton:c,tabIndex:u,disabled:p}=e,h=d(e,xF),m=a?.root.slotProps,g=Ng(),[v,b]=s.useState(()=>SF(t.value,r)),[y,w]=s.useState(!1),x=mm(),S=rP(),C=s.useCallback(e=>{g.clear();const r=e.target.value;b(r),w(!0),g.start(S.filterDebounceMs,()=>{const e=new Date(r);n(f({},t,{value:Number.isNaN(e.getTime())?void 0:e})),w(!1)})},[n,t,S.filterDebounceMs,g]);return s.useEffect(()=>{const e=SF(t.value,r);b(e)},[t.value,r]),Xp.jsxs(s.Fragment,{children:[Xp.jsx(S.slots.baseTextField,f({fullWidth:!0,id:x,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),value:v,onChange:C,type:r||"text",disabled:p,inputRef:i,slotProps:f({},m,{input:f({endAdornment:y?Xp.jsx(S.slots.loadIcon,{fontSize:"small",color:"action"}):null},m?.input),htmlInput:f({max:"datetime-local"===r?"9999-12-31T23:59":"9999-12-31",tabIndex:u},m?.htmlInput)})},S.slotProps?.baseTextField,h,a?.root)),l,c]})}function kF(e,t,n,r){if(!e.value)return null;const o=new Date(e.value);n?o.setSeconds(0,0):(o.setMinutes(o.getMinutes()+o.getTimezoneOffset()),o.setHours(0,0,0,0));const i=o.getTime();return e=>{if(!e)return!1;if(r)return t(e.getTime(),i);const o=new Date(e);return n?o.setSeconds(0,0):o.setHours(0,0,0,0),t(o.getTime(),i)}}const EF=e=>[{value:"is",getApplyFilterFn:t=>kF(t,(e,t)=>e===t,e),InputComponent:CF,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFn:t=>kF(t,(e,t)=>e!==t,e),InputComponent:CF,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFn:t=>kF(t,(e,t)=>e>t,e),InputComponent:CF,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:t=>kF(t,(e,t)=>e>=t,e),InputComponent:CF,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFn:t=>kF(t,(e,t)=>e<t,e,!e),InputComponent:CF,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrBefore",getApplyFilterFn:t=>kF(t,(e,t)=>e<=t,e),InputComponent:CF,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>e=>null==e,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>null!=e,requiresFilterValue:!1}],RF=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange","slotProps"],PF=pg(gI)({fontSize:"inherit"});function MF(e){const{id:t,value:n,field:r,colDef:o,hasFocus:i,onValueChange:a,slotProps:l}=e,c=d(e,RF),u="dateTime"===o.type,p=lP(),h=s.useRef(null),m=s.useMemo(()=>{let e,t;if(e=null==n?null:n instanceof Date?n:new Date((n??"").toString()),null==e||Number.isNaN(e.getTime()))t="";else{t=new Date(e.getTime()-60*e.getTimezoneOffset()*1e3).toISOString().substr(0,u?16:10)}return{parsed:e,formatted:t}},[n,u]),[g,v]=s.useState(m),b=rP(),y=(e=>{const{classes:t}=e;return wm({root:["editInputCell"]},YT,t)})({classes:b.classes}),w=s.useCallback(e=>{if(""===e)return null;const[t,n]=e.split("T"),[r,o,i]=t.split("-"),a=new Date;if(a.setFullYear(Number(r),Number(o)-1,Number(i)),a.setHours(0,0,0,0),n){const[e,t]=n.split(":");a.setHours(Number(e),Number(t),0,0)}return a},[]),x=s.useCallback(async e=>{const n=e.target.value,o=w(n);a&&await a(e,o),v({parsed:o,formatted:n}),p.current.setEditCellValue({id:t,field:r,value:o},e)},[p,r,t,a,w]);return s.useEffect(()=>{v(e=>m.parsed!==e.parsed&&m.parsed?.getTime()!==e.parsed?.getTime()?m:e)},[m]),Wh(()=>{i&&h.current.focus()},[i]),Xp.jsx(PF,f({as:b.slots.baseInput,inputRef:h,fullWidth:!0,className:y.root,type:u?"datetime-local":"date",value:g.formatted,onChange:x},c,l?.root,{slotProps:{htmlInput:f({max:u?"9999-12-31T23:59":"9999-12-31"},l?.root?.slotProps?.htmlInput)}}))}const TF=e=>Xp.jsx(MF,f({},e));function IF({value:e,columnType:t,rowId:n,field:r}){if(!(e instanceof Date))throw new Error([`MUI X: \`${t}\` column type only accepts \`Date\` objects as values.`,"Use `valueGetter` to transform the value into a `Date` object.",`Row ID: ${n}, field: "${r}".`].join("\n"))}const OF=f({},FO,{type:"date",sortComparator:PI,valueFormatter:(e,t,n,r)=>{if(!e)return"";const o=zD(r,t);return!zT(t)||e instanceof Date?(IF({value:e,columnType:"date",rowId:o,field:n.field}),e.toLocaleDateString()):e},filterOperators:EF(),renderEditCell:TF,pastedValueParser:e=>new Date(e)}),DF=f({},FO,{type:"dateTime",sortComparator:PI,valueFormatter:(e,t,n,r)=>{if(!e)return"";const o=zD(r,t);return!zT(t)||e instanceof Date?(IF({value:e,columnType:"dateTime",rowId:o,field:n.field}),e.toLocaleString()):e},filterOperators:EF(!0),renderEditCell:TF,pastedValueParser:e=>new Date(e)}),FF=e=>null==e?null:Number(e),LF=f({},FO,{type:"number",align:"right",headerAlign:"right",sortComparator:RI,valueParser:e=>""===e?null:Number(e),valueFormatter:e=>function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)?e.toLocaleString():e||"",filterOperators:[{value:"=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>FF(t)===e.value,InputComponent:TI,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>FF(t)!==e.value,InputComponent:TI,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&FF(t)>e.value,InputComponent:TI,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&FF(t)>=e.value,InputComponent:TI,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&FF(t)<e.value,InputComponent:TI,InputComponentProps:{type:"number"}},{value:"<=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&FF(t)<=e.value,InputComponent:TI,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFn:()=>e=>null==e,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>null!=e,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:e=>Array.isArray(e.value)&&0!==e.value.length?t=>null!=t&&e.value.includes(Number(t)):null,InputComponent:NI,InputComponentProps:{type:"number"}}],getApplyQuickFilterFn:e=>null==e||Number.isNaN(e)||""===e?null:t=>FF(t)===FF(e)});function AF(e){return"singleSelect"===e?.type}function NF(e,t){if(e)return"function"==typeof e.valueOptions?e.valueOptions(f({field:e.field},t)):e.valueOptions}function $F(e,t,n){if(void 0===t)return;const r=t.find(t=>{const r=n(t);return String(r)===String(e)});return n(r)}const zF=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen","slotProps"];function jF(e){const t=rP(),{id:n,value:r,field:o,row:i,colDef:a,hasFocus:l,error:c,onValueChange:u,initialOpen:p=t.editMode===$I.Cell,slotProps:h}=e,m=d(e,zF),g=lP(),v=s.useRef(null),b=s.useRef(null),[y,w]=s.useState(p),x=(t.slotProps?.baseSelect||{}).native??!1;if(Wh(()=>{l&&b.current?.focus()},[l]),!AF(a))return null;const S=NF(a,{id:n,row:i});if(!S)return null;const C=a.getOptionValue,k=a.getOptionLabel;return S&&a?Xp.jsx(t.slots.baseSelect,f({ref:v,value:r,onChange:async e=>{if(!AF(a)||!S)return;w(!1);const t=$F(e.target.value,S,C);u&&await u(e,t),await g.current.setEditCellValue({id:n,field:o,value:t},e)},open:y,onOpen:e=>{(function(e){return"key"in e&&!!e.key})(e)&&"Enter"===e.key||w(!0)},onClose:(e,r)=>{if(t.editMode!==$I.Row){if("backdropClick"===r||"Escape"===e.key){const t=g.current.getCellParams(n,o);g.current.publishEvent("cellEditStop",f({},t,{reason:"Escape"===e.key?UI.escapeKeyDown:UI.cellFocusOut}))}}else w(!1)},error:c,native:x,fullWidth:!0,slotProps:{htmlInput:{ref:b}}},m,h?.root,t.slotProps?.baseSelect,{children:S.map(e=>{const n=C(e);return s.createElement(t.slots.baseSelectOption,f({},t.slotProps?.baseSelectOption||{},{native:x,key:n,value:n}),k(e))})})):null}const BF=["item","applyValue","type","apiRef","focusElementRef","tabIndex","isFilterActive","clearButton","headerFilterMenu","slotProps"],_F=({column:e,OptionComponent:t,getOptionLabel:n,getOptionValue:r,isSelectNative:o,baseSelectOptionProps:i})=>["",...NF(e)||[]].map(e=>{const a=r(e);let l=n(e);return""===l&&(l=" "),s.createElement(t,f({},i,{native:o,key:a,value:a}),l)});function HF(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,tabIndex:a,clearButton:l,headerFilterMenu:c,slotProps:u}=e,p=d(e,BF),h=t.value??"",m=mm(),g=mm(),v=rP(),b=v.slotProps?.baseSelect?.native??!1,y=o.current.getColumn(t.field),w=y.getOptionValue,x=y.getOptionLabel,S=s.useMemo(()=>NF(y),[y]),C=s.useCallback(e=>{let r=e.target.value;r=$F(r,S,w),n(f({},t,{value:r}))},[S,w,n,t]);if(!y||!AF(y))return null;const k=u?.root.label??o.current.getLocaleText("filterPanelInputLabel");return Xp.jsxs(s.Fragment,{children:[Xp.jsx(v.slots.baseSelect,f({fullWidth:!0,id:m,label:k,labelId:g,value:h,onChange:C,slotProps:{htmlInput:f({tabIndex:a,ref:i,type:r||"text",placeholder:u?.root.placeholder??o.current.getLocaleText("filterPanelInputPlaceholder")},u?.root.slotProps?.htmlInput)},native:b},v.slotProps?.baseSelect,p,u?.root,{children:_F({column:y,OptionComponent:v.slots.baseSelectOption,getOptionLabel:x,getOptionValue:w,isSelectNative:b,baseSelectOptionProps:v.slotProps?.baseSelectOption})})),c,l]})}const VF=["item","applyValue","type","apiRef","focusElementRef","slotProps"];function WF(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,slotProps:a}=e,l=d(e,VF),c=mm(),u=rP(),p=o.current.getColumn(t.field),h=p.getOptionValue,m=p.getOptionLabel,g=s.useCallback((e,t)=>h(e)===h(t),[h]),v=s.useMemo(()=>NF(p)||[],[p]),b=s.useMemo(()=>Array.isArray(t.value)?t.value.reduce((e,t)=>{const n=v.find(e=>h(e)===t);return null!=n&&e.push(n),e},[]):[],[h,t.value,v]),y=s.useCallback((e,r)=>{n(f({},t,{value:r.map(h)}))},[n,t,h]);if(!p||!AF(p))return null;const w=u.slots.baseAutocomplete;return Xp.jsx(w,f({multiple:!0,options:v,isOptionEqualToValue:g,id:c,value:b,onChange:y,getOptionLabel:m,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),slotProps:{textField:{type:r||"text",inputRef:i}}},l,a?.root))}const UF=e=>null!=e&&OI(e)?e.value:e,GF=f({},FO,{type:"singleSelect",getOptionLabel:e=>OI(e)?e.label:String(e),getOptionValue:e=>OI(e)?e.value:e,valueFormatter(e,t,n,r){const o=zD(r,t);if(!AF(n))return"";const i=NF(n,{id:o,row:t});if(null==e)return"";if(!i)return e;if("object"!=typeof i[0])return n.getOptionLabel(e);const a=i.find(t=>n.getOptionValue(t)===e);return a?n.getOptionLabel(a):""},renderEditCell:e=>Xp.jsx(jF,f({},e)),filterOperators:[{value:"is",getApplyFilterFn:e=>null==e.value||""===e.value?null:t=>UF(t)===UF(e.value),InputComponent:HF},{value:"not",getApplyFilterFn:e=>null==e.value||""===e.value?null:t=>UF(t)!==UF(e.value),InputComponent:HF},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||0===e.value.length)return null;const t=e.value.map(UF);return e=>t.includes(UF(e))},InputComponent:WF}],pastedValueParser:(e,t,n)=>{const r=n,o=NF(r)||[],i=r.getOptionValue;if(o.find(t=>i(t)===e))return e}}),KF=nT(e=>e.headerFiltering),qF=eT(KF,e=>e?.enabled??!1),YF=eT(KF,e=>e.editing),XF=eT(KF,e=>e.menuOpen),QF=nT(e=>e.columnGrouping),ZF=tT(QF,e=>e?.unwrappedGroupingModel??{}),JF=tT(QF,e=>e?.lookup??{}),eL=tT(QF,e=>e?.headerStructure??[]),tL=eT(QF,e=>e?.maxDepth??0),nL=["maxWidth","minWidth","width","flex"],rL={string:FO,number:LF,date:OF,dateTime:DF,boolean:dD,singleSelect:GF,[ZO]:JO,custom:FO};const oL=(e,t)=>{const n={};let r=0,o=0;const i=[];e.orderedFields.forEach(t=>{let a=e.lookup[t],l=0,s=!1;!1!==e.columnVisibilityModel[t]&&(a.flex&&a.flex>0?(r+=a.flex,s=!0):l=FI(a.width||FO.width,a.minWidth||FO.minWidth,a.maxWidth||FO.maxWidth),o+=l),a.computedWidth!==l&&(a=f({},a,{computedWidth:l})),s&&i.push(a),n[t]=a});const a=void 0===t?0:t.viewportOuterSize.width-(t.hasScrollY?t.scrollbarSize:0),l=Math.max(a-o,0);if(r>0&&a>0){const e=function({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const r=new Set(n.map(e=>e.field)),o={all:{},frozenFields:[],freeze:e=>{const t=o.all[e];t&&!0!==t.frozen&&(o.all[e].frozen=!0,o.frozenFields.push(e))}};return function i(){if(o.frozenFields.length===r.size)return;const a={min:{},max:{}};let l=e,s=t,c=0;o.frozenFields.forEach(e=>{l-=o.all[e].computedWidth,s-=o.all[e].flex});for(let e=0;e<n.length;e+=1){const t=n[e];if(o.all[t.field]&&!0===o.all[t.field].frozen)continue;let r=l/s*t.flex;r<t.minWidth?(c+=t.minWidth-r,r=t.minWidth,a.min[t.field]=!0):r>t.maxWidth&&(c+=t.maxWidth-r,r=t.maxWidth,a.max[t.field]=!0),o.all[t.field]={frozen:!1,computedWidth:r,flex:t.flex}}c<0?Object.keys(a.max).forEach(e=>{o.freeze(e)}):c>0?Object.keys(a.min).forEach(e=>{o.freeze(e)}):n.forEach(({field:e})=>{o.freeze(e)}),i()}(),o.all}({initialFreeSpace:l,totalFlexUnits:r,flexColumns:i});Object.keys(e).forEach(t=>{n[t]=f({},n[t],{computedWidth:e[t].computedWidth})})}return f({},e,{lookup:n})};function iL(e){let t=rL.string;return e&&rL[e]&&(t=rL[e]),t}const aL=({apiRef:e,columnsToUpsert:t,initialState:n,columnVisibilityModel:r=lO(e),keepOnlyColumnsToUpsert:o=!1,updateInitialVisibilityModel:i=!1})=>{const a=!e.current.state.columns;let l;if(a)l={orderedFields:[],lookup:{},columnVisibilityModel:r,initialColumnVisibilityModel:r};else{const t=rO(e);l={orderedFields:o?[]:[...t.orderedFields],lookup:f({},t.lookup),columnVisibilityModel:r,initialColumnVisibilityModel:i?r:t.initialColumnVisibilityModel}}const s={};if(o&&!a)for(const e in l.lookup)Object.prototype.hasOwnProperty.call(l.lookup,e)&&(s[e]=!1);t.forEach(e=>{const{field:t}=e;s[t]=!0;let n=l.lookup[t];null==n?(n=f({},iL(e.type),{field:t,hasBeenResized:!1}),l.orderedFields.push(t)):o&&l.orderedFields.push(t),n&&n.type!==e.type&&(n=f({},iL(e.type),{field:t}));let r=n.hasBeenResized;nL.forEach(t=>{void 0!==e[t]&&(r=!0,-1===e[t]&&(e[t]=1/0))}),l.lookup[t]=Hh(n,f({},iL(e.type),e,{hasBeenResized:r}))}),o&&!a&&Object.keys(l.lookup).forEach(e=>{s[e]||delete l.lookup[e]});const c=((e,t)=>{if(!t)return e;const{orderedFields:n=[],dimensions:r={}}=t,o=Object.keys(r);if(0===o.length&&0===n.length)return e;const i={},a=[];for(let t=0;t<n.length;t+=1){const r=n[t];e.lookup[r]&&(i[r]=!0,a.push(r))}const l=0===a.length?e.orderedFields:[...a,...e.orderedFields.filter(e=>!i[e])],s=f({},e.lookup);for(let e=0;e<o.length;e+=1){const t=o[e],n=f({},s[t],{hasBeenResized:!0});Object.entries(r[t]).forEach(([e,t])=>{n[e]=-1===t?1/0:t}),s[t]=n}return f({},e,{orderedFields:l,lookup:s})})(e.current.unstable_applyPipeProcessors("hydrateColumns",l),n);return oL(c,e.current.getRootDimensions?.()??void 0)};function lL(e,t){if(t.listView)return 0;const n=mI(e),r=tL(e),o=qF(e);return Math.floor(t.columnHeaderHeight*n)+Math.floor((t.columnGroupHeaderHeight??t.columnHeaderHeight)*n)*r+(o?Math.floor((t.headerFilterHeight??t.columnHeaderHeight)*n):0)}const sL=jh("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${XT["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${XT["scrollArea--right"]}`]:t["scrollArea--right"]},{[`&.${XT["scrollArea--up"]}`]:t["scrollArea--up"]},{[`&.${XT["scrollArea--down"]}`]:t["scrollArea--down"]},t.scrollArea]})(()=>({position:"absolute",zIndex:101,[`&.${XT["scrollArea--left"]}`]:{top:0,left:0,width:20,bottom:0},[`&.${XT["scrollArea--right"]}`]:{top:0,right:0,width:20,bottom:0},[`&.${XT["scrollArea--up"]}`]:{top:0,left:0,right:0,height:20},[`&.${XT["scrollArea--down"]}`]:{bottom:0,left:0,right:0,height:20}})),cL=eT(oT,(e,t)=>"left"===t?e.leftPinnedWidth:"right"===t?e.rightPinnedWidth+(e.hasScrollX?e.scrollbarSize:0):0);function uL(e){const{scrollDirection:t,scrollPosition:n}=e,r=s.useRef(null),o=lP(),i=Ng(),a=pI(o,mI),l=pI(o,iT),c=pI(o,cL,t),u=rP(),d=lL(o,u),p=Math.floor(u.columnHeaderHeight*a),h=f({height:p,top:d-p},"left"===t?{left:c}:{},"right"===t?{right:c}:{}),m=Mg(e=>{let a;if(e.preventDefault(),"left"===t)a=e.clientX-r.current.getBoundingClientRect().right;else{if("right"!==t)throw new Error("MUI X: Wrong drag direction");a=Math.max(1,e.clientX-r.current.getBoundingClientRect().left)}a=1.5*(a-1)+1,i.start(0,()=>{o.current.scroll({left:n.current.left+a,top:n.current.top})})});return Xp.jsx(pL,f({},e,{ref:r,getCanScrollMore:()=>{const e=oT(o);if("left"===t)return n.current.left>0;if("right"===t){const t=l-e.viewportInnerSize.width;return n.current.left<t}return!1},style:h,handleDragOver:m}))}function dL(e){const{scrollDirection:t,scrollPosition:n}=e,r=s.useRef(null),o=lP(),i=Ng(),a=pI(o,mT),l=rP(),c=lL(o,l),u={top:"up"===t?c:void 0,bottom:"down"===t?0:void 0},d=Mg(e=>{let a;if(e.preventDefault(),"up"===t)a=e.clientY-r.current.getBoundingClientRect().bottom;else{if("down"!==t)throw new Error("MUI X: Wrong drag direction");a=Math.max(1,e.clientY-r.current.getBoundingClientRect().top)}a=1.5*(a-1)+1,i.start(0,()=>{o.current.scroll({left:n.current.left,top:n.current.top+a})})});return Xp.jsx(pL,f({},e,{ref:r,getCanScrollMore:()=>{const e=oT(o);if("up"===t)return n.current.top>0;if("down"===t){const t=(a.currentPageTotalHeight||0)-e.viewportInnerSize.height-(e.hasScrollX?e.scrollbarSize:0);return n.current.top<t}return!1},style:u,handleDragOver:d}))}const pL=TR(function(e,t){const{scrollDirection:n,getCanScrollMore:r,style:o,handleDragOver:i}=e,a=lP(),[l,c]=s.useState(r),u=f({},rP(),{scrollDirection:n}),d=(e=>{const{scrollDirection:t,classes:n}=e;return wm({root:["scrollArea",`scrollArea--${t}`]},YT,n)})(u);return rI(a,"scrollPositionChange",()=>{c(r)}),l?Xp.jsx(sL,{ref:t,className:d.root,ownerState:u,onDragOver:i,style:o}):null}),fL=KT(function(e){const t=lP(),[n,r]=s.useState("none");return rI(t,"columnHeaderDragStart",()=>r("horizontal")),rI(t,"columnHeaderDragEnd",()=>r("none")),rI(t,"rowDragStart",()=>r("vertical")),rI(t,"rowDragEnd",()=>r("none")),"none"===n?null:"horizontal"===n?Xp.jsx(uL,f({},e)):Xp.jsx(dL,f({},e))}),hL=s.createContext(void 0);function mL(){const e=s.useContext(hL);if(void 0===e)throw new Error(["MUI X: Could not find the Data Grid private context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join("\n"));return e}const gL=()=>{};function vL(e,t,n){const r=s.useRef(!0);Wh(()=>{r.current=!1,e.current.register(n,t)},[e,n,t]),r.current&&e.current.register(n,t)}function bL(e,t){const n=s.useRef(null);if(n.current)return n.current;const r=e.current.getLogger(t);return n.current=r,r}const yL=(e,t,n,r,o)=>{const i=bL(e,"useNativeEventListener");iI(e,"rootMount",()=>{const e=t();if(e&&n)return i.debug(`Binding native ${n} event`),e.addEventListener(n,r,o),()=>{i.debug(`Clearing native ${n} event`),e.removeEventListener(n,r,o)}})};function wL(e){const t=s.useRef(!0);t.current&&(t.current=!1,e())}const xL=nT(e=>e.pivoting),SL=eT(xL,e=>e?.active),CL=new Map,kL=eT(xL,e=>e?.initialColumns||CL),EL=(e,t)=>{const n=pI(e,vT),r=pI(e,MD),o=pI(e,IT),i=pI(e,cO),a=0===n&&0===o,l=pI(e,bT),s=pI(e,SL),c=!l&&a,u=!l&&n>0&&0===r;let d=null,p=null;return c&&(d="noRowsOverlay"),!l&&0===i.length&&(d="noColumnsOverlay"),c&&s&&(d="emptyPivotOverlay"),u&&(d="noResultsOverlay"),l&&(d="loadingOverlay",p=t.slotProps?.loadingOverlay?.[a?"noRowsVariant":"variant"]??(a?"skeleton":"linear-progress")),{overlayType:d,loadingOverlayVariant:p}},RL=nT(e=>e.columnMenu);const PL=KT(function(){const e=mL(),t=rP(),n=pI(e,cO),r=pI(e,DD),o=pI(e,vD),i=pI(e,eF),a=pI(e,()=>null===JD(e)),l=pI(e,tF),s=pI(e,XD),c=pI(e,QD),u=pI(e,tL),d=pI(e,RL),p=pI(e,lO),h=pI(e,eL),m=!(null===l&&null===i&&a),g=e.current.columnHeadersContainerRef;return Xp.jsx(t.slots.columnHeaders,f({ref:g,visibleColumns:n,filterColumnLookup:r,sortColumnLookup:o,columnHeaderTabIndexState:i,columnGroupHeaderTabIndexState:l,columnHeaderFocus:s,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:d,columnVisibility:p,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:m},t.slotProps?.columnHeaders))}),ML=jh("div")({position:"absolute",top:"var(--DataGrid-headersTotalHeight)",left:0,width:"calc(100% - (var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))"}),TL=jh("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>{const{ownerState:n,loadingOverlayVariant:r,overlayType:o}=e,i="skeleton"===r||"noColumnsOverlay"===o;return[t.main,n.hasPinnedRight&&t["main--hasPinnedRight"],i&&t["main--hiddenContent"]]}})({flexGrow:1,position:"relative",overflow:"hidden",display:"flex",flexDirection:"column"}),IL=TR((e,t)=>{const{ownerState:n}=e,r=rP(),o=jO().hooks.useGridAriaAttributes();return Xp.jsxs(TL,f({ownerState:n,className:e.className,tabIndex:-1},o,r.slotProps?.main,{ref:t,children:[Xp.jsx(ML,{role:"presentation","data-id":"gridPanelAnchor"}),e.children]}))}),OL=jh("div")({position:"sticky",zIndex:40,top:0});function DL(e){const t=wm({root:["topContainer"]},YT,{});return Xp.jsx(OL,f({},e,{className:PR(t.root,XT["container--top"]),role:"presentation"}))}const FL=jh("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScrollerContent,n.overflowedContent&&t["virtualScrollerContent--overflowed"]]}})({}),LL=TR(function(e,t){const n=rP(),r=!n.autoHeight&&"auto"===e.style?.minHeight,o=((e,t)=>{const{classes:n}=e;return wm({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},YT,n)})(n,r),i={classes:n.classes,overflowedContent:r};return Xp.jsx(FL,f({},e,{ownerState:i,className:PR(o.root,e.className),ref:t}))}),AL=jh("div")({display:"flex",flexDirection:"row",width:"var(--DataGrid-rowWidth)",boxSizing:"border-box"}),NL=jh("div")({position:"sticky",height:"100%",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",backgroundColor:bP.cell.background.pinned}),$L=jh(NL)({left:0}),zL=jh(NL)({right:0}),jL=jh("div")({flexGrow:1,borderTop:"1px solid var(--rowBorderColor)"});const BL=KT(function({rowsLength:e}){const t=lP(),{viewportOuterSize:n,minimumSize:r,hasScrollX:o,hasScrollY:i,scrollbarSize:a,leftPinnedWidth:l,rightPinnedWidth:s}=pI(t,oT),c=o?a:0,u=n.height-r.height>0;return 0!==c||u?Xp.jsxs(AL,{className:XT.filler,role:"presentation",style:{height:c,"--rowBorderColor":0===e?"transparent":"var(--DataGrid-rowBorderColor)"},children:[l>0&&Xp.jsx($L,{className:XT["filler--pinnedLeft"],style:{width:l}}),Xp.jsx(jL,{}),s>0&&Xp.jsx(zL,{className:XT["filler--pinnedRight"],style:{width:s+(i?a:0)}})]}):null}),_L=jh("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone"})({position:"absolute",display:"flex",flexDirection:"column"}),HL=TR(function(e,t){const n=rP(),r=(e=>{const{classes:t}=e;return wm({root:["virtualScrollerRenderZone"]},YT,t)})(n);return Xp.jsx(_L,f({ownerState:n},e,{className:PR(r.root,e.className),ref:t}))}),VL={includeHeaders:!0,includeOutliers:!1,outliersFactor:1.5,expand:!1,disableColumnVirtualization:!0},WL=nT(e=>e.editRows),UL=eT(WL,(e,{rowId:t,editMode:n})=>n===$I.Row&&Boolean(e[t])),GL=eT(WL,(e,{rowId:t,field:n})=>e[t]?.[n]??null),KL=nT(e=>e.preferencePanel),qL=eT(KL,(e,t)=>!(!e.open||e.labelId!==t));var YL=function(e){return e.filters="filters",e.columns="columns",e.aiAssistant="aiAssistant",e}(YL||{});const XL={initialize:function(e){return{colspanMap:new Map}},use:function(e,t,n){const r=t.colspan?.getColspan,o=Mg(r?(t,n,o,i)=>{for(let a=n;a<o;a+=1){const l=QL(e.state.colspanMap,a,t,n,o,i,r);l.colSpan>1&&(a+=l.colSpan-1)}}:()=>{});return n.calculateColSpan=o,{resetColSpan:()=>{e.state.colspanMap=new Map},getCellColSpanInfo:(t,n)=>e.state.colspanMap.get(t)?.[n],calculateColSpan:o}},selectors:{}};function QL(e,t,n,r,o,i,a){const l=i.length,s=i[t],c=a(n,s,t);if(!c||1===c)return ZL(e,n,t,{spannedByColSpan:!1,cellProps:{colSpan:1,width:s.computedWidth}}),{colSpan:1};let u=s.computedWidth;for(let a=1;a<c;a+=1){const s=t+a;if(s>=r&&s<o){u+=i[s].computedWidth,ZL(e,n,t+a,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(t+c,l-1),leftVisibleCellIndex:t})}ZL(e,n,t,{spannedByColSpan:!1,cellProps:{colSpan:c,width:u}})}return{colSpan:c}}function ZL(e,t,n,r){let o=e.get(t);o||(o={},e.set(t,o)),o[n]=r}function JL(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r+=1)if(!JL(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;const n=Array.from(e.entries());for(let e=0;e<n.length;e+=1)if(!t.has(n[e][0]))return!1;for(let e=0;e<n.length;e+=1){const r=n[e];if(!JL(r[1],t.get(r[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;const n=Array.from(e.entries());for(let e=0;e<n.length;e+=1)if(!t.has(n[e][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r+=1)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;for(let e=0;e<r;e+=1)if(!Object.prototype.hasOwnProperty.call(t,n[e]))return!1;for(let o=0;o<r;o+=1){const r=n[o];if(!JL(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function eA(e,t){return Math.round(e*10**t)/10**t}const tA={EMPTY:{width:0,height:0},equals:(e,t)=>e.width===t.width&&e.height===t.height},nA={EMPTY:{top:[],bottom:[]}},rA={EMPTY:{left:[],right:[]}},oA={EMPTY:{top:0,left:0}};let iA=function(e){return e[e.NONE=0]="NONE",e[e.UP=1]="UP",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e[e.RIGHT=4]="RIGHT",e}({});(iA||(iA={})).forDelta=function(e,t){return 0===e&&0===t?iA.NONE:Math.abs(t)>=Math.abs(e)?t>0?iA.DOWN:iA.UP:e>0?iA.RIGHT:iA.LEFT};const aA={isReady:!1,root:tA.EMPTY,viewportOuterSize:tA.EMPTY,viewportInnerSize:tA.EMPTY,contentSize:tA.EMPTY,minimumSize:tA.EMPTY,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,topContainerHeight:0,bottomContainerHeight:0,autoHeight:!1,minimalContentHeight:void 0},lA={rootSize:e=>e.rootSize,dimensions:e=>e.dimensions,rowHeight:e=>e.dimensions.rowHeight,columnsTotalWidth:e=>e.dimensions.columnsTotalWidth,contentHeight:e=>e.dimensions.contentSize.height,autoHeight:e=>e.dimensions.autoHeight,minimalContentHeight:e=>e.dimensions.minimalContentHeight,rowsMeta:e=>e.rowsMeta,rowPositions:e=>e.rowsMeta.positions,columnPositions:NM((e,t)=>{const n=[];let r=0;for(let e=0;e<t.length;e+=1)n.push(r),r+=t[e].computedWidth;return n}),needsHorizontalScrollbar:e=>e.dimensions.viewportOuterSize.width>0&&e.dimensions.columnsTotalWidth>e.dimensions.viewportOuterSize.width},sA={initialize:function(e){const t=f({},aA,e.dimensions,{autoHeight:e.dimensions.autoHeight,minimalContentHeight:e.dimensions.minimalContentHeight}),{rowCount:n}=e,{rowHeight:r}=t,o={currentPageTotalHeight:n*r,positions:Array.from({length:n},(e,t)=>t*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0},i=new Map;return{rootSize:tA.EMPTY,dimensions:t,rowsMeta:o,rowHeights:i}},use:function(e,t,n){const r=s.useRef(!0),{layout:o,dimensions:{rowHeight:i,columnsTotalWidth:a,leftPinnedWidth:l,rightPinnedWidth:c,topPinnedHeight:u,bottomPinnedHeight:d},onResize:p}=t,h=s.useCallback(n=>{if(n&&(r.current=!1),r.current)return;const s=o.refs.container.current,f=lA.rootSize(e.state),h=lA.rowsMeta(e.state),m=function(e,t){if(void 0!==t)return t;if(null===e)return 0;const n=cA.get(e);if(void 0!==n)return n;const r=kg(e).createElement("div");r.style.width="99px",r.style.height="99px",r.style.position="absolute",r.style.overflow="scroll",r.className="scrollDiv",e.appendChild(r);const o=r.offsetWidth-r.clientWidth;return e.removeChild(r),cA.set(e,o),o}(s,t.dimensions.scrollbarSize),g=u+h.pinnedTopRowsTotalHeight,v=d+h.pinnedBottomRowsTotalHeight,b={width:a,height:eA(h.currentPageTotalHeight,1)};let y,w,x=!1,S=!1;if(t.dimensions.autoHeight)S=!1,x=Math.round(a)>Math.round(f.width),y={width:f.width,height:g+v+b.height},w={width:Math.max(0,y.width-(S?m:0)),height:Math.max(0,y.height-(x?m:0))};else{y={width:f.width,height:f.height},w={width:Math.max(0,y.width),height:Math.max(0,y.height-g-v)};const e=b,t=w,n=e.width>t.width,r=e.height>t.height;(n||r)&&(S=r,x=e.width+(S?m:0)>t.width,x&&(S=e.height+m>t.height)),S&&(w.width-=m),x&&(w.height-=m)}t.disableHorizontalScroll&&(x=!1),t.disableVerticalScroll&&(S=!1);const C=Math.max(y.width,a+(S?m:0)),k={isReady:!0,root:f,viewportOuterSize:y,viewportInnerSize:w,contentSize:b,minimumSize:{width:a,height:g+b.height+v},hasScrollX:x,hasScrollY:S,scrollbarSize:m,rowWidth:C,rowHeight:i,columnsTotalWidth:a,leftPinnedWidth:l,rightPinnedWidth:c,topContainerHeight:g,bottomContainerHeight:v,autoHeight:t.dimensions.autoHeight,minimalContentHeight:t.dimensions.minimalContentHeight};JL(e.state.dimensions,k)||(e.update({dimensions:k}),p?.(k.root))},[e,o.refs.container,t.dimensions.scrollbarSize,t.dimensions.autoHeight,t.dimensions.minimalContentHeight,t.disableHorizontalScroll,t.disableVerticalScroll,p,i,a,l,c,u,d]),{resizeThrottleMs:m}=t,g=Mg(h),v=s.useMemo(()=>m>0?function(e,t=166){let n,r;const o=()=>{n=void 0,e(...r)};function i(...e){r=e,void 0===n&&(n=setTimeout(o,t))}return i.clear=()=>{clearTimeout(n),n=void 0},i}(g,m):void 0,[m,g]);s.useEffect(()=>v?.clear,[v]),Wh(h,[h]),Wh(()=>{e.update({dimensions:f({},e.state.dimensions,{autoHeight:t.dimensions.autoHeight,minimalContentHeight:t.dimensions.minimalContentHeight})})},[e,t.dimensions.autoHeight,t.dimensions.minimalContentHeight]);const b=function(e,t,n){const r=e.state.rowHeights,{rows:o,getRowHeight:i,getRowSpacing:a,getEstimatedRowHeight:l}=t,c=s.useRef(-1),u=s.useRef(!1),d=s.useRef(!1),p=t.pinnedRows,f=YM(e,lA.rowHeight),h=Mg(t=>{let n=r.get(t);return void 0===n&&(n={content:e.state.dimensions.rowHeight,spacingTop:0,spacingBottom:0,detail:0,autoHeight:!1,needsFirstMeasurement:!0},r.set(t,n)),n}),{applyRowHeight:m}=t,g=s.useCallback(t=>{const n=lA.dimensions(e.state),r=n.rowHeight,o=h(t.id);if(i){const e=i(t);if("auto"===e){if(o.needsFirstMeasurement){const e=l?l(t):r;o.content=e??r}u.current=!0,o.autoHeight=!0}else o.content=e??n.rowHeight,o.needsFirstMeasurement=!1,o.autoHeight=!1}else o.content=r,o.needsFirstMeasurement=!1;if(a){const e=a(t);o.spacingTop=e.top??0,o.spacingBottom=e.bottom??0}else o.spacingTop=0,o.spacingBottom=0;return m?.(o,t),o},[e,i,h,l,f,a,m]),v=s.useCallback(()=>{u.current=!1;const t=p?.top.reduce((e,t)=>{const n=g(t);return e+n.content+n.spacingTop+n.spacingBottom+n.detail},0)??0,r=p?.bottom.reduce((e,t)=>{const n=g(t);return e+n.content+n.spacingTop+n.spacingBottom+n.detail},0)??0,i=[],a=o.reduce((e,t)=>{i.push(e);const n=g(t);return e+(n.content+n.spacingTop+n.spacingBottom+n.detail)},0);u.current||(c.current=1/0);const l=t!==e.state.rowsMeta.pinnedTopRowsTotalHeight||r!==e.state.rowsMeta.pinnedBottomRowsTotalHeight||a!==e.state.rowsMeta.currentPageTotalHeight,s={currentPageTotalHeight:a,positions:i,pinnedTopRowsTotalHeight:t,pinnedBottomRowsTotalHeight:r};e.set("rowsMeta",s),l&&n(),d.current=!0},[e,p,o,g,n]),b=Mg(v),y=t=>r.get(t)?.content??lA.rowHeight(e.state),w=(e,t)=>{const n=h(e),r=n.content!==t;n.needsFirstMeasurement=!1,n.content=t,d.current&&=!r},x=e=>r.get(e)?.autoHeight??!1,S=()=>c.current,C=e=>{u.current&&e>c.current&&(c.current=e)},k=()=>{r.clear(),v()},E=Dg(()=>"undefined"==typeof ResizeObserver?void 0:new ResizeObserver(e=>{for(let n=0;n<e.length;n+=1){const r=e[n],o=r.borderBoxSize&&r.borderBoxSize.length>0?r.borderBoxSize[0].blockSize:r.contentRect.height,i=r.target.__mui_id,a=t.focusedVirtualCell?.()?.id;if(a===i&&0===o)return;w(i,o)}d.current||requestAnimationFrame(()=>{b()})})).current,R=(e,t)=>(e.__mui_id=t,E?.observe(e),()=>E?.unobserve(e));return Wh(()=>{v()},[v]),{getRowHeight:y,setLastMeasuredRowIndex:C,storeRowHeightMeasurement:w,hydrateRowsMeta:v,observeRowHeight:R,rowHasAutoHeight:x,getRowHeightEntry:h,getLastMeasuredRowIndex:S,resetRowHeights:k}}(e,t,h);return{updateDimensions:h,debouncedUpdateDimensions:v,rowsMeta:b}},selectors:lA};const cA=new WeakMap;const uA=("undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"empty").includes("firefox"),dA="undefined"!=typeof window&&/jsdom|HappyDOM/.test(window.navigator.userAgent),pA=(e,t,n)=>Math.max(t,Math.min(n,e)),fA={top:0,left:0},hA=Object.freeze(new Map),mA={firstRowIndex:0,lastRowIndex:0,firstColumnIndex:0,lastColumnIndex:0},gA=(()=>{const e=AM(e=>e.virtualization.renderContext.firstRowIndex);return{store:AM(e=>e.virtualization),renderContext:AM(e=>e.virtualization.renderContext),enabledForRows:AM(e=>e.virtualization.enabledForRows),enabledForColumns:AM(e=>e.virtualization.enabledForColumns),offsetTop:AM(sA.selectors.rowPositions,e,(e,t)=>e[t]??0),context:AM(e=>e.virtualization.context),scrollPosition:AM(e=>e.virtualization.scrollPosition)}})(),vA={initialize:function(e){const t={virtualization:f({enabled:!dA,enabledForRows:!dA,enabledForColumns:!dA,renderContext:mA,props:e.layout.constructor.elements.reduce((e,t)=>(e[t],e),{}),context:{},scrollPosition:{current:oA.EMPTY}},e.initialState?.virtualization),getters:null};return t},use:function(e,t,n){const{layout:r,dimensions:{rowHeight:o,columnsTotalWidth:i=0},virtualization:{isRtl:a=!1,rowBufferPx:l=150,columnBufferPx:c=150},colspan:u,initialState:d,rows:p,range:h,columns:m,pinnedRows:g=nA.EMPTY,pinnedColumns:v=rA.EMPTY,onWheel:b,onTouchMove:y,onRenderContextChange:w,onScrollChange:x,scrollReset:S,renderRow:C,renderInfiniteLoadingTrigger:k}=t,E=g.bottom.length>0,[R,P]=s.useState(hA),M=s.useRef(!1),T=s.useRef(!1),I=YM(e,gA.renderContext),O=YM(e,gA.enabledForRows),D=YM(e,gA.enabledForColumns),F=YM(e,sA.selectors.contentHeight),L=s.useRef(d?.scroll??fA),A=s.useRef(!1),N=s.useRef(fA),$=s.useRef(mA),z=Ng(),j=s.useRef(void 0),B=Dg(()=>function(e,t,n,r,o){return{direction:iA.NONE,buffer:RA(e,iA.NONE,t,n,r,o)}}(a,l,c,15*o,300)).current,_=s.useCallback(t=>{kA(t,e.state.virtualization.renderContext)||e.set("virtualization",f({},e.state.virtualization,{renderContext:t,scrollPosition:{current:f({},L.current)}}));const n=sA.selectors.dimensions(e.state).isReady,r=t.firstRowIndex!==$.current.firstRowIndex||t.lastRowIndex!==$.current.lastRowIndex;n&&r&&($.current=t,w?.(t)),N.current=L.current},[e,w]),H=Mg(()=>{const i=r.refs.scroller.current;if(!i)return;const s=sA.selectors.dimensions(e.state),u=Math.ceil(s.contentSize.height-s.viewportInnerSize.height),d=Math.ceil(s.contentSize.width-s.viewportInnerSize.width),p={top:pA(i.scrollTop,0,u),left:a?pA(i.scrollLeft,-Math.abs(d),0):pA(i.scrollLeft,0,d)},h=p.left-L.current.left,m=p.top-L.current.top,g=0!==h||0!==m;L.current=p;const v=g?iA.forDelta(h,m):iA.NONE,b=Math.abs(L.current.top-N.current.top),y=Math.abs(L.current.left-N.current.left),w=b>=o||y>=50,x=B.direction!==v;if(!(w||x))return e.set("virtualization",f({},e.state.virtualization,{scrollPosition:{current:f({},L.current)}})),I;if(x)switch(v){case iA.NONE:case iA.LEFT:case iA.RIGHT:j.current=void 0;break;default:j.current=I}B.direction=v,B.buffer=RA(a,v,l,c,15*o,300);const S=wA(yA(e,t,n,O,D),L.current,B);return kA(S,I)||(So.flushSync(()=>{_(S)}),z.start(1e3,H)),S}),V=()=>{if(!sA.selectors.dimensions(e.state).isReady&&(O||D))return;const r=wA(yA(e,t,n,O,D),L.current,B);j.current=void 0,_(r)},W=Mg(V);QM(e,sA.selectors.dimensions,(e,t)=>{t.isReady&&V()}),Wh(()=>{M.current&&(V(),M.current=!1)});const U=Mg(()=>{if(A.current)return void(A.current=!1);const e=H();e&&x?.(L.current,e)}),G=s.useRef(null);Wh(()=>{T.current&&W()},[D,O,W]),Wh(()=>{r.refs.scroller.current&&(r.refs.scroller.current.scrollLeft=0)},[r.refs.scroller,S]),((e,t)=>{const n=s.useRef(!1);Wh(()=>n.current||!e?gL:(n.current=!0,t()),[n.current||e])})(I!==mA,()=>{if(x?.(L.current,I),T.current=!0,d?.scroll&&r.refs.scroller.current){const e=r.refs.scroller.current,{top:t,left:n}=d.scroll,o={top:!(t>0),left:!(n>0)};!o.left&&i&&(e.scrollLeft=n,o.left=!0,A.current=!0),!o.top&&F&&(e.scrollTop=t,A.current=!0),o.top&&o.left||(G.current=(r,i)=>{!o.left&&r&&(e.scrollLeft=n,o.left=!0,A.current=!0),!o.top&&i&&(e.scrollTop=t,o.top=!0,A.current=!0),o.left&&o.top&&(G.current=null)})}}),QM(e,sA.selectors.dimensions,V),Wh(()=>{r.refs.scroller&&G.current?.(i,F)},[r.refs.scroller,i,F]);const K=s.useRef(!0),q=bA(t=>{r.refs.container.current=t;const o=function(e,t,n){if(!e)return;const r=e.getBoundingClientRect(),o={width:eA(r.width,1),height:eA(r.height,1)};if(t.state.rootSize!==tA.EMPTY&&tA.equals(o,t.state.rootSize)||n(o),"undefined"==typeof ResizeObserver)return;const i=new ResizeObserver(([e])=>{if(!e)return;const r={width:eA(e.contentRect.width,1),height:eA(e.contentRect.height,1)};tA.equals(r,t.state.rootSize)||n(r)});return i.observe(e),()=>{i.disconnect()}}(t,e,t=>{0===t.width&&0===t.height&&0!==e.state.rootSize.height&&0!==e.state.rootSize.width||(e.state.rootSize=t,K.current||!n.debouncedUpdateDimensions?(n.updateDimensions(K.current),K.current=!1):n.debouncedUpdateDimensions())});return()=>{o?.(),r.refs.container.current=null}}),Y=bA(e=>{r.refs.scroller.current=e;const t={passive:!0};return e.addEventListener("scroll",U,t),e.addEventListener("wheel",b,t),e.addEventListener("touchmove",y,t),()=>{e.removeEventListener("scroll",U,t),e.removeEventListener("wheel",b,t),e.removeEventListener("touchmove",y,t),r.refs.scroller.current=null}}),X={containerRef:q,scrollerRef:Y},Q=r.use(e,t,n,X),Z=f({setPanels:P,getRows:(r={},o)=>{if(!r.rows&&!h)return[];let a=I;r.renderContext&&(a=r.renderContext,a.firstColumnIndex=I.firstColumnIndex,a.lastColumnIndex=I.lastColumnIndex);const l=!E&&void 0===r.position||E&&"bottom"===r.position,s=void 0!==r.position;let c;switch(r.position){case"top":c=0;break;case"bottom":c=g.top.length+p.length;break;default:c=g.top.length}const d=r.rows??p,f=a.firstRowIndex,b=Math.min(a.lastRowIndex,d.length),y=r.rows?PA(0,r.rows.length):PA(f,b);let w=-1;const x=t.focusedVirtualCell?.();!s&&x&&(x.rowIndex<f&&(y.unshift(x.rowIndex),w=x.rowIndex),x.rowIndex>b&&(y.push(x.rowIndex),w=x.rowIndex));const S=[],P=sA.selectors.columnPositions(e.state,m);return y.forEach(e=>{const{id:t,model:f}=d[e];if(o&&!o[t])return;const g=(h?.firstRowIndex||0)+c+e;if(u?.enabled){const e=v.left.length,r=m.length-v.right.length;n.calculateColSpan(t,e,r,m),v.left.length>0&&n.calculateColSpan(t,0,v.left.length,m),v.right.length>0&&n.calculateColSpan(t,m.length-v.right.length,m.length,m)}const b=n.rowsMeta.rowHasAutoHeight(t)?"auto":n.rowsMeta.getRowHeight(t);let y=!1;void 0===r.position&&(y=0===e);let E=!1;const M=e===d.length-1;l&&(s?E=M:e===p.length-1&&(E=!0));let T=a;j.current&&e>=j.current.firstRowIndex&&e<j.current.lastRowIndex&&(T=j.current);const I=e===w,O=x?.rowIndex===g,D=EA(P,T,v.left.length),F=M&&"top"===r.position,L=T.firstColumnIndex,A=T.lastColumnIndex;if(S.push(C({id:t,model:f,rowIndex:g,offsetLeft:D,columnsTotalWidth:i,baseRowHeight:b,firstColumnIndex:L,lastColumnIndex:A,focusedColumnIndex:O?x.columnIndex:void 0,isFirstVisible:y,isLastVisible:E,isVirtualFocusRow:I,showBottomBorder:F})),I)return;const N=R.get(t);N&&S.push(N),void 0===r.position&&M&&k&&S.push(k(t))}),S},rows:t.rows},Q);return f({getters:Z,setPanels:P,forceUpdateRenderContext:V,scheduleUpdateRenderContext:()=>{M.current=!0}},{getCellColSpanInfo:()=>{throw new Error("Unimplemented: colspan feature is required")},calculateColSpan:()=>{throw new Error("Unimplemented: colspan feature is required")},getHiddenCellsOrigin:()=>{throw new Error("Unimplemented: rowspan feature is required")}})},selectors:gA};function bA(e){const t=s.useRef(void 0),n=Mg(n=>{if(n)return t.current=e(n),MR>=19?t.current:void 0;t.current?.()});return n}function yA(e,t,n,r,o){const i=sA.selectors.dimensions(e.state),a=t.rows,l=t.range,s=t.columns,c=n.getHiddenCellsOrigin(),u=t.rows.at(-1)?.id,d=s.at(-1);return{api:n,enabledForRows:r,enabledForColumns:o,autoHeight:i.autoHeight,rowBufferPx:t.virtualization.rowBufferPx,columnBufferPx:t.virtualization.columnBufferPx,leftPinnedWidth:i.leftPinnedWidth,columnsTotalWidth:i.columnsTotalWidth,viewportInnerWidth:i.viewportInnerSize.width,viewportInnerHeight:i.viewportInnerSize.height,lastRowHeight:void 0!==u?n.rowsMeta.getRowHeight(u):0,lastColumnWidth:d?.computedWidth??0,rowsMeta:sA.selectors.rowsMeta(e.state),columnPositions:sA.selectors.columnPositions(e.state,t.columns),rows:a,range:l,pinnedColumns:t.pinnedColumns,columns:s,hiddenCellsOriginMap:c,virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight}}function wA(e,t,n){const r={firstRowIndex:0,lastRowIndex:e.rows.length,firstColumnIndex:0,lastColumnIndex:e.columns.length},{top:o,left:i}=t,a=Math.abs(i)+e.leftPinnedWidth;if(e.enabledForRows){let t=Math.min(xA(e,o,{atStart:!0,lastPosition:e.rowsMeta.positions[e.rowsMeta.positions.length-1]+e.lastRowHeight}),e.rowsMeta.positions.length-1);const n=e.hiddenCellsOriginMap[t];if(n){const e=Math.min(...Object.values(n));t=Math.min(t,e)}const i=e.autoHeight?t+e.rows.length:xA(e,o+e.viewportInnerHeight);r.firstRowIndex=t,r.lastRowIndex=i}if(e.enabledForColumns){let t=0,o=e.columnPositions.length,i=!1;const[l,s]=CA({firstIndex:r.firstRowIndex,lastIndex:r.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight});if(!e.virtualizeColumnsWithAutoRowHeight)for(let t=l;t<s&&!i;t+=1){const n=e.rows[t];i=e.api.rowsMeta.rowHasAutoHeight(n.id)}i&&!e.virtualizeColumnsWithAutoRowHeight||(t=SA(a,e.columnPositions,{atStart:!0,lastPosition:e.columnsTotalWidth}),o=SA(a+e.viewportInnerWidth,e.columnPositions)),r.firstColumnIndex=t,r.lastColumnIndex=o}const l=function(e,t,n){const[r,o]=CA({firstIndex:t.firstRowIndex,lastIndex:t.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight}),[i,a]=CA({firstIndex:t.firstColumnIndex,lastIndex:t.lastColumnIndex,minFirstIndex:e.pinnedColumns?.left.length??0,maxLastIndex:e.columns.length-(e.pinnedColumns?.right.length??0),bufferBefore:n.buffer.columnBefore,bufferAfter:n.buffer.columnAfter,positions:e.columnPositions,lastSize:e.lastColumnWidth}),l=function({api:e,firstColumnToRender:t,firstRowToRender:n,lastRowToRender:r,visibleRows:o}){let i=t,a=!1;for(;!a&&i>=0;){a=!0;for(let t=n;t<r;t+=1){if(o[t]){const n=o[t].id,r=e.getCellColSpanInfo(n,i);if(r&&r.spannedByColSpan&&r.leftVisibleCellIndex<i){i=r.leftVisibleCellIndex,a=!1;break}}}}return i}({api:e.api,firstColumnToRender:i,firstRowToRender:r,lastRowToRender:o,visibleRows:e.rows});return{firstRowIndex:r,lastRowIndex:o,firstColumnIndex:l,lastColumnIndex:a}}(e,r,n);return l}function xA(e,t,n){const r=e.api.rowsMeta.getLastMeasuredRowIndex();let o=r===1/0;e.range?.lastRowIndex&&!o&&(o=r>=e.range.lastRowIndex);const i=pA(r-(e.range?.firstRowIndex||0),0,e.rowsMeta.positions.length);return o||e.rowsMeta.positions[i]>=t?SA(t,e.rowsMeta.positions,n):function(e,t,n,r){let o=1;for(;n<t.length&&Math.abs(t[n])<e;)n+=o,o*=2;return SA(e,t,r,Math.floor(n/2),Math.min(n,t.length))}(t,e.rowsMeta.positions,i,n)}function SA(e,t,n=void 0,r=0,o=t.length){if(t.length<=0)return-1;if(r>=o)return r;const i=r+Math.floor((o-r)/2),a=t[i];let l;if(n?.atStart){l=e-((i===t.length-1?n.lastPosition:t[i+1])-a)<a}else l=e<=a;return l?SA(e,t,n,r,i):SA(e,t,n,i+1,o)}function CA({firstIndex:e,lastIndex:t,bufferBefore:n,bufferAfter:r,minFirstIndex:o,maxLastIndex:i,positions:a,lastSize:l}){const s=a[e]-n,c=a[t]+r,u=SA(s,a,{atStart:!0,lastPosition:a[a.length-1]+l}),d=SA(c,a);return[pA(u,o,i),pA(d,o,i)]}function kA(e,t){return e===t||e.firstRowIndex===t.firstRowIndex&&e.lastRowIndex===t.lastRowIndex&&e.firstColumnIndex===t.firstColumnIndex&&e.lastColumnIndex===t.lastColumnIndex}function EA(e,t,n){const r=(e[t.firstColumnIndex]??0)-(e[n]??0);return Math.abs(r)}function RA(e,t,n,r,o,i){if(e)switch(t){case iA.LEFT:t=iA.RIGHT;break;case iA.RIGHT:t=iA.LEFT}switch(t){case iA.NONE:return{rowAfter:n,rowBefore:n,columnAfter:r,columnBefore:r};case iA.LEFT:return{rowAfter:0,rowBefore:0,columnAfter:0,columnBefore:i};case iA.RIGHT:return{rowAfter:0,rowBefore:0,columnAfter:i,columnBefore:0};case iA.UP:return{rowAfter:0,rowBefore:o,columnAfter:0,columnBefore:0};case iA.DOWN:return{rowAfter:o,rowBefore:0,columnAfter:0,columnBefore:0};default:throw new Error("unreachable")}}function PA(e,t){return Array.from({length:t-e}).map((t,n)=>e+n)}class MA{static elements=["scroller","container"];constructor(e){this.refs=e}refSetter(e){return t=>{t&&this.refs[e].current!==t&&(this.refs[e].current=t)}}}class TA extends MA{static elements=["scroller","container","content","positioner","scrollbarVertical","scrollbarHorizontal"];use(e,t,n,r){const{scrollerRef:o,containerRef:i}=r,a=Mg(this.refSetter("scrollbarVertical")),l=Mg(this.refSetter("scrollbarHorizontal"));e.state.virtualization.context={scrollerRef:o,containerRef:i,scrollbarVerticalRef:a,scrollbarHorizontalRef:l}}static selectors=(()=>({containerProps:NM(vA.selectors.context,e=>({ref:e.containerRef})),scrollerProps:NM(vA.selectors.context,sA.selectors.autoHeight,sA.selectors.needsHorizontalScrollbar,(e,t,n)=>({ref:e.scrollerRef,style:{overflowX:n?void 0:"hidden",overflowY:t?"hidden":void 0},role:"presentation",tabIndex:uA?-1:void 0})),contentProps:NM(sA.selectors.contentHeight,sA.selectors.minimalContentHeight,sA.selectors.columnsTotalWidth,sA.selectors.needsHorizontalScrollbar,(e,t,n,r)=>({style:{width:r?n:"auto",flexBasis:0===e?t:e,flexShrink:0},role:"presentation"})),positionerProps:NM(vA.selectors.offsetTop,e=>({style:{transform:`translate3d(0, ${e}px, 0)`}})),scrollbarHorizontalProps:NM(vA.selectors.context,vA.selectors.scrollPosition,(e,t)=>({ref:e.scrollbarHorizontalRef,scrollPosition:t})),scrollbarVerticalProps:NM(vA.selectors.context,vA.selectors.scrollPosition,(e,t)=>({ref:e.scrollbarVerticalRef,scrollPosition:t})),scrollAreaProps:NM(vA.selectors.scrollPosition,e=>({scrollPosition:e}))}))()}class IA extends TA{use(e,t,n,r){super.use(e,t,n,r);const o=e.use(TA.selectors.containerProps),i=e.use(TA.selectors.scrollerProps),a=e.use(TA.selectors.contentProps),l=e.use(TA.selectors.positionerProps),s=e.use(TA.selectors.scrollbarVerticalProps),c=e.use(TA.selectors.scrollbarHorizontalProps),u=e.use(TA.selectors.scrollAreaProps);return{getContainerProps:()=>o,getScrollerProps:()=>i,getContentProps:()=>a,getPositionerProps:()=>l,getScrollbarVerticalProps:()=>s,getScrollbarHorizontalProps:()=>c,getScrollAreaProps:()=>u}}}NM(vA.selectors.context,sA.selectors.autoHeight,sA.selectors.needsHorizontalScrollbar,(e,t,n)=>({ref:e.mergedRef,style:{overflowX:n?void 0:"hidden",overflowY:t?"hidden":void 0,position:"relative"},role:"presentation",tabIndex:uA?-1:void 0})),NM(sA.selectors.contentHeight,e=>({style:{position:"absolute",display:"inline-block",width:"100%",height:e,top:0,left:0,zIndex:-1},role:"presentation"})),NM(vA.selectors.offsetTop,e=>({style:{height:e}}));const OA={initialize:function(e){return{}},use:function(e,t,n){return{getViewportPageSize:()=>{const n=sA.selectors.dimensions(e.state);if(!n.isReady)return 0;if(t.getRowHeight){const n=vA.selectors.renderContext(e.state),r=n.lastRowIndex-n.firstRowIndex;return Math.min(r-1,t.rows.length)}const r=Math.floor(n.viewportInnerSize.height/n.rowHeight);return Math.min(r,t.rows.length)}}},selectors:{}};const DA={firstRowIndex:0,lastRowIndex:0},FA={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},LA={state:e=>e.rowSpanning,hiddenCells:e=>e.rowSpanning.caches.hiddenCells,spannedCells:e=>e.rowSpanning.caches.spannedCells,hiddenCellsOriginMap:e=>e.rowSpanning.caches.hiddenCellOriginMap},AA={initialize:function(e){return{rowSpanning:e.initialState?.rowSpanning??{caches:FA,processedRange:DA}}},use:function(e,t,n){return{getHiddenCellsOrigin:()=>LA.hiddenCellsOriginMap(e.state)}},selectors:LA};const NA={resizeThrottleMs:100,columns:[{field:"DEFAULT_COLUMN"}],dimensions:{autoHeight:!1,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,topPinnedHeight:0,bottomPinnedHeight:0},virtualization:{isRtl:!1,rowBufferPx:150,columnBufferPx:150}},$A=[sA,vA,XL,AA,OA],zA=e=>{const t=jA(e,NA),n=Dg(()=>new JM($A.map(e=>e.initialize(t)).reduce((e,t)=>Object.assign(e,t),{}))).current,r={};for(const e of $A)Object.assign(r,e.use(n,t,r));return{store:n,api:r}};function jA(e,t){const n=f({},e);for(const r in t)if(Object.hasOwn(t,r)){const o=t[r];null===o||"object"!=typeof o||Array.isArray(o)?n[r]=e[r]??o:n[r]=jA(e[r]??{},o)}return n}const BA=!("undefined"!=typeof window&&/jsdom|HappyDOM/.test(window.navigator.userAgent)),_A=(e,t)=>{const{disableVirtualization:n,autoHeight:r}=t;return f({},e,{virtualization:{enabled:!n&&BA,enabledForColumns:!n&&BA,enabledForRows:!n&&!r&&BA,renderContext:mA}})};const HA=nT(e=>e.virtualization);eT(HA,e=>e.enabled);const VA=eT(HA,e=>e.enabledForColumns);eT(HA,e=>e.enabledForRows);const WA=eT(HA,e=>e.renderContext),UA=tT(nT(e=>e.virtualization.renderContext.firstColumnIndex),nT(e=>e.virtualization.renderContext.lastColumnIndex),(e,t)=>({firstColumnIndex:e,lastColumnIndex:t}));function GA(e){return JSON.stringify([e.filterModel,e.sortModel,e.start,e.end])}class KA{constructor({ttl:e=3e5,getKey:t=GA}){this.cache={},this.ttl=e,this.getKey=t}set(e,t){const n=this.getKey(e),r=Date.now()+this.ttl;this.cache[n]={value:t,expiry:r}}get(e){const t=this.getKey(e),n=this.cache[t];if(n){if(!(Date.now()>n.expiry))return n.value;delete this.cache[t]}}clear(){this.cache={}}}class qA extends Error{constructor(e){super(e.message),this.name="GridGetRowsError",this.params=e.params,this.cause=e.cause}}class YA extends Error{constructor(e){super(e.message),this.name="GridUpdateRowError",this.params=e.params,this.cause=e.cause}}const XA="calc(max(var(--DataGrid-scrollbarSize), 14px))",QA=jh("div")({position:"absolute",display:"inline-block",zIndex:60,"&:hover":{zIndex:70},"--size":XA}),ZA=jh(QA)({width:"var(--size)",height:"calc(var(--DataGrid-hasScrollY) * (100% - var(--DataGrid-headersTotalHeight) - var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize)))",overflowY:"auto",overflowX:"hidden",outline:0,"& > div":{width:"var(--size)"},top:"var(--DataGrid-headersTotalHeight)",right:0}),JA=jh(QA)({width:"calc(var(--DataGrid-hasScrollX) * (100% - var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))",height:"var(--size)",overflowY:"hidden",overflowX:"auto",outline:0,"& > div":{height:"var(--size)"},bottom:0}),eN=jh(QA)({width:"var(--size)",height:"var(--size)",right:0,bottom:0,overflow:"scroll","@media print":{display:"none"}}),tN=TR(function(e,t){const n=mL(),r=rP(),o=s.useRef(!1),i=s.useRef(0),a=s.useRef(null),l=((e,t)=>{const{classes:n}=e;return wm({root:["scrollbar",`scrollbar--${t}`],content:["scrollbarContent"]},YT,n)})(r,e.position),c=pI(n,oT),u="vertical"===e.position?"height":"width",d="vertical"===e.position?"scrollTop":"scrollLeft",p="vertical"===e.position?"top":"left",f="horizontal"===e.position?c.minimumSize.width:c.minimumSize.height-c.headersTotalHeight,h=Mg(()=>{const t=a.current,n=e.scrollPosition.current;t&&n[p]!==i.current&&(i.current=n[p],o.current?o.current=!1:(o.current=!0,t[d]=e.scrollPosition.current[p]))}),m=Mg(()=>{const e=n.current.virtualScrollerRef.current,t=a.current;t&&(o.current?o.current=!1:(o.current=!0,e[d]=t[d]))});Lg(()=>{const e=n.current.virtualScrollerRef.current,t=a.current,r={passive:!0};return e.addEventListener("scroll",h,r),t.addEventListener("scroll",m,r),()=>{e.removeEventListener("scroll",h,r),t.removeEventListener("scroll",m,r)}});const g="vertical"===e.position?ZA:JA,v=s.useMemo(()=>({[u]:`${f}px`}),[u,f]);return Xp.jsx(g,{ref:Tg(t,a),className:l.root,tabIndex:-1,"aria-hidden":"true",onFocus:e=>{e.target.blur()},children:Xp.jsx("div",{className:l.content,style:v})})}),nN=jh("div",{name:"MuiDataGrid",slot:"ScrollShadow",overridesResolver:(e,t)=>[t.root,t[e.position]]})(({theme:e})=>({position:"absolute",inset:0,pointerEvents:"none",transition:bP.transition(["box-shadow"],{duration:bP.transitions.duration.short}),"--length":"dark"===e.palette.mode?"8px":"6px","--length-inverse":"calc(var(--length) * -1)","--opacity":"dark"===e.palette.mode?"0.7":"0.18","--blur":"var(--length)","--spread":"calc(var(--length) * -1)","--color":"0, 0, 0","--color-start":"rgba(var(--color), calc(var(--hasScrollStart) * var(--opacity)))","--color-end":"rgba(var(--color), calc(var(--hasScrollEnd) * var(--opacity)))",variants:[{props:{position:"vertical"},style:{top:"var(--DataGrid-topContainerHeight)",bottom:"calc(var(--DataGrid-bottomContainerHeight) + var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))",boxShadow:"inset 0 var(--length) var(--blur) var(--spread) var(--color-start), inset 0 var(--length-inverse) var(--blur) var(--spread) var(--color-end)"}},{props:{position:"horizontal"},style:{left:"var(--DataGrid-leftPinnedWidth)",right:"calc(var(--DataGrid-rightPinnedWidth) + var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",boxShadow:"inset var(--length) 0 var(--blur) var(--spread) var(--color-start), inset var(--length-inverse) 0 var(--blur) var(--spread) var(--color-end)"}}]}));function rN(e){const{position:t}=e,n={classes:rP().classes,position:t},r=(e=>{const{classes:t,position:n}=e;return wm({root:["scrollShadow",`scrollShadow--${n}`]},YT,t)})(n),o=s.useRef(null),i=mL(),a=pI(i,lT),l=pI(i,sT),c=pI(i,TT),u=pI(i,dO),d="vertical"===t?l&&c?.bottom?.length>0:a&&void 0!==u?.right?.length&&u?.right?.length>0,p=um(),f=s.useCallback(e=>{if(!o.current)return;const n=Math.abs(Math.round(e)),r=oT(i),a=Math.round(r.contentSize["vertical"===t?"height":"width"]-r.viewportInnerSize["vertical"===t?"height":"width"]),l="vertical"===t?c?.top?.length>0:void 0!==u?.left?.length&&u?.left?.length>0,s="vertical"===t?c?.bottom?.length>0:void 0!==u?.right?.length&&u?.right?.length>0,d=p?n<a:n>0,f=p?n>0:n<a;o.current.style.setProperty("--hasScrollStart",l&&d?"1":"0"),o.current.style.setProperty("--hasScrollEnd",s&&f?"1":"0")},[c,u,p,t,i]);return rI(i,"scrollPositionChange",e=>{f(e["vertical"===t?"top":"left"])}),rI(i,"columnResizeStop",()=>{"horizontal"===t&&f(i.current.virtualScrollerRef?.current?.scrollLeft||0)}),s.useEffect(()=>{f(("horizontal"===t?i.current.virtualScrollerRef?.current?.scrollLeft:i.current.virtualScrollerRef?.current?.scrollTop)??0)},[f,i,t]),Xp.jsx(nN,{className:r.root,ownerState:n,ref:o,style:{"--hasScrollStart":0,"--hasScrollEnd":d?"1":"0"}})}const oN=jh("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>"overlayType"!==e&&"loadingOverlayVariant"!==e&&"right"!==e})(({overlayType:e,loadingOverlayVariant:t,right:n})=>"skeleton"!==t?{position:"sticky",top:"var(--DataGrid-headersTotalHeight)",left:0,right:`${n}px`,width:0,height:0,zIndex:"loadingOverlay"===e?5:4}:{}),iN=jh("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>"overlayType"!==e&&"loadingOverlayVariant"!==e})({});function aN(e){const t=lP(),n=rP(),r=pI(t,oT);let o=Math.max(r.viewportOuterSize.height-r.topContainerHeight-r.bottomContainerHeight-(r.hasScrollX?r.scrollbarSize:0),0);0===o&&(o=HT);const i=(e=>{const{classes:t}=e;return wm({root:["overlayWrapper"],inner:["overlayWrapperInner"]},YT,t)})(f({},e,{classes:n.classes}));return Xp.jsx(oN,f({className:i.root},e,{right:r.columnsTotalWidth-r.viewportOuterSize.width,children:Xp.jsx(iN,f({className:i.inner,style:{height:o,width:r.viewportOuterSize.width}},e))}))}const lN=(e,t)=>gF(e),sN=(e,t)=>pI(e,gF),cN=eT(YD,WA,gF,cO,(e,t,n,r)=>{if(!e)return!1;const o=n.rowIdToIndexMap.get(e.id),i=r.slice(t.firstColumnIndex,t.lastColumnIndex).findIndex(t=>t.field===e.field);return!(void 0!==o&&-1!==i&&o>=t.firstRowIndex&&o<=t.lastRowIndex)}),uN=tT(cN,cO,gF,YD,(e,t,n,r)=>{if(!e)return null;const o=n.rowIdToIndexMap.get(r.id);if(void 0===o)return null;const i=t.findIndex(e=>e.field===r.field);return-1===i?null:f({},r,{rowIndex:o,columnIndex:i})}),dN={autoHeight:!1,autoPageSize:!1,autosizeOnMount:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,clipboardCopyCellDelimiter:"\t",columnBufferPx:150,columnFilterDebounceMs:150,columnHeaderHeight:56,disableAutosize:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnReorder:!1,disableColumnResize:!1,disableColumnSelector:!1,disableColumnSorting:!1,disableDensitySelector:!1,disableEval:!1,disableMultipleColumnsFiltering:!1,disableMultipleColumnsSorting:!1,disableMultipleRowSelection:!1,disableRowSelectionOnClick:!1,disableRowSelectionExcludeModel:!1,disableVirtualization:!1,editMode:$I.Cell,filterDebounceMs:150,filterMode:"client",hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,ignoreValueFormatterDuringExport:!1,keepColumnPositionIfDraggedOutside:!1,keepNonExistentRowsSelected:!1,loading:!1,logger:console,logLevel:"error",pageSizeOptions:[25,50,100],pagination:!1,paginationMode:"client",resizeThrottleMs:60,rowBufferPx:150,rowHeight:52,rows:[],rowSelection:!0,rowSpacingType:"margin",rowSpanning:!1,showCellVerticalBorder:!1,showColumnVerticalBorder:!1,showToolbar:!1,sortingMode:"client",sortingOrder:["asc","desc",null],throttleRowsMs:0,virtualizeColumnsWithAutoRowHeight:!1,tabNavigation:"none"},pN=(e,t,n,r=!0)=>{const o=s.useRef(null),i=s.useRef(`mui-${Math.round(1e9*Math.random())}`),a=s.useCallback(()=>{o.current=e.current.registerPipeProcessor(t,i.current,n)},[e,n,t]);wL(()=>{r&&a()});const l=s.useRef(!0);s.useEffect(()=>(l.current?l.current=!1:r&&a(),()=>{o.current&&(o.current(),o.current=null)}),[a,r])},fN=(e,t,n)=>{const r=s.useRef(null),o=s.useRef(`mui-${Math.round(1e9*Math.random())}`),i=s.useCallback(()=>{r.current=e.current.registerPipeApplier(t,o.current,n)},[e,n,t]);wL(()=>{i()});const a=s.useRef(!0);s.useEffect(()=>(a.current?a.current=!1:i(),()=>{r.current&&(r.current(),r.current=null)}),[i])},hN=(e,t,n)=>{const r=aT(n),o=vT(n),i=iF(n),a=Math.min(i.enabled?i.paginationModel.pageSize:o,o);return f({},e,{rowsMeta:{currentPageTotalHeight:a*r,positions:Array.from({length:a},(e,t)=>t*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0}})},mN=eT(cO,hO,(e,t)=>{const n=e.length;return 0===n?0:eA(t[n-1]+e[n-1].computedWidth,1)}),gN=()=>PM((e,t,n,r,o)=>f({},e,{headerHeight:t,groupHeaderHeight:n,headerFilterHeight:r,headersTotalHeight:o}),{maxSize:1});function vN(){const e=um(),t=rP(),n=mL(),{listView:r}=t,o=pI(n,cO),i=pI(n,TT),a=pO(n),l=pI(n,AD),c=s.useCallback(e=>l.has(e)&&n.current.isRowSelectable(e),[l,n]),u=sN(n),d=pI(n,vO),p=pI(n,fT),h=pI(n,cT),{autoHeight:m}=t,g=r,v=pI(n,mI),b=WT(t.rowHeight,dN.rowHeight),y=Math.floor(b*v),w=Math.floor(t.columnHeaderHeight*v),x=Math.floor((t.columnGroupHeaderHeight??t.columnHeaderHeight)*v),S=Math.floor((t.headerFilterHeight??t.columnHeaderHeight)*v),C=pI(n,mN),k=lL(n,t),E=a.left.reduce((e,t)=>e+t.computedWidth,0),R=a.right.reduce((e,t)=>e+t.computedWidth,0),P=EL(n,t),M={rowHeight:y,headerHeight:w,columnsTotalWidth:C,leftPinnedWidth:E,rightPinnedWidth:R,topPinnedHeight:k,bottomPinnedHeight:0,autoHeight:m,minimalContentHeight:HT,scrollbarSize:t.scrollbarSize},T=Dg(gN).current,I=pI(n,vT),O=pI(n,iF),D=Math.min(O.enabled?O.paginationModel.pageSize:I,I),{getRowHeight:F,getEstimatedRowHeight:L,getRowSpacing:A}=t,N=t.slots.row,$=t.slotProps?.row;pI(n,uN);const z=Dg(()=>new IA({container:n.current.mainElementRef,scroller:n.current.virtualScrollerRef,scrollbarVertical:n.current.virtualScrollbarVerticalRef,scrollbarHorizontal:n.current.virtualScrollbarHorizontalRef})).current,j=zA({layout:z,dimensions:M,virtualization:{isRtl:e,rowBufferPx:t.rowBufferPx,columnBufferPx:t.columnBufferPx},colspan:{enabled:d,getColspan:s.useCallback((e,t)=>{if("function"==typeof t.colSpan){const r=n.current.getRow(e),o=n.current.getRowValue(r,t);return t.colSpan(o,r,t,n)??0}return t.colSpan??1},[n])},initialState:{scroll:t.initialState?.scroll,rowSpanning:n.current.state.rowSpanning,virtualization:n.current.state.virtualization},rows:u.rows,range:u.range,rowCount:D,columns:o,pinnedRows:i,pinnedColumns:a,disableHorizontalScroll:r,disableVerticalScroll:"noColumnsOverlay"===P.overlayType||"skeleton"===P.loadingOverlayVariant,getRowHeight:s.useMemo(()=>{if(F)return e=>F(f({},e,{densityFactor:v}))},[F,v]),getEstimatedRowHeight:s.useMemo(()=>L?e=>L(f({},e,{densityFactor:v})):void 0,[L,v]),getRowSpacing:s.useMemo(()=>A?e=>{const t=u.rowIdToIndexMap.get(e.id)??-1,r={isFirstVisible:0===t,isLastVisible:t===u.rows.length-1,indexRelativeToCurrentPage:t};return A(f({},e,r,{indexRelativeToCurrentPage:n.current.getRowIndexRelativeToVisibleRows(e.id)}))}:void 0,[n,A,u.rows,u.rowIdToIndexMap]),applyRowHeight:Mg((e,t)=>n.current.unstable_applyPipeProcessors("rowHeight",e,t)),virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight,focusedVirtualCell:Mg(()=>uN(n)),resizeThrottleMs:t.resizeThrottleMs,onResize:Mg(e=>n.current.publishEvent("resize",e)),onWheel:Mg(e=>{n.current.publishEvent("virtualScrollerWheel",{},e)}),onTouchMove:Mg(e=>{n.current.publishEvent("virtualScrollerTouchMove",{},e)}),onRenderContextChange:Mg(e=>{n.current.publishEvent("renderedRowsIntervalChange",e)}),onScrollChange:s.useCallback((e,t)=>{n.current.publishEvent("scrollPositionChange",{top:e.top,left:e.left,renderContext:t})},[n]),scrollReset:g,renderRow:s.useCallback(e=>Xp.jsx(N,f({row:e.model,rowId:e.id,index:e.rowIndex,selected:c(e.id),offsetLeft:e.offsetLeft,columnsTotalWidth:C,rowHeight:e.baseRowHeight,pinnedColumns:a,visibleColumns:o,firstColumnIndex:e.firstColumnIndex,lastColumnIndex:e.lastColumnIndex,focusedColumnIndex:e.focusedColumnIndex,isFirstVisible:e.isFirstVisible,isLastVisible:e.isLastVisible,isNotVisible:e.isVirtualFocusRow,showBottomBorder:e.showBottomBorder,scrollbarWidth:p,gridHasFiller:h},$),e.id),[C,h,c,a,N,$,p,o]),renderInfiniteLoadingTrigger:s.useCallback(e=>n.current.getInfiniteLoadingTriggerElement?.({lastRowId:e}),[n])});return wL(()=>{n.current.store.state.dimensions=T(j.store.state.dimensions,w,x,S,k),n.current.store.state.rowsMeta=j.store.state.rowsMeta,n.current.store.state.virtualization=j.store.state.virtualization}),QM(j.store,sA.selectors.dimensions,(e,t)=>{t.isReady&&n.current.setState(e=>f({},e,{dimensions:T(t,w,x,S,k)}))}),QM(j.store,sA.selectors.rowsMeta,(e,t)=>{t!==n.current.state.rowsMeta&&n.current.setState(e=>f({},e,{rowsMeta:t}))}),QM(j.store,vA.selectors.store,(e,t)=>{t.renderContext!==mA&&t!==n.current.state.virtualization&&n.current.setState(e=>f({},e,{virtualization:t}))}),n.current.register("private",{virtualizer:j}),(e=>{const t=e.current.virtualizer,{getRowHeight:n,setLastMeasuredRowIndex:r,storeRowHeightMeasurement:o,resetRowHeights:i,hydrateRowsMeta:a,observeRowHeight:l,rowHasAutoHeight:s,getRowHeightEntry:c,getLastMeasuredRowIndex:u}=t.api.rowsMeta;fN(e,"rowHeight",a);const d={hydrateRowsMeta:a,observeRowHeight:l,rowHasAutoHeight:s,getRowHeightEntry:c,getLastMeasuredRowIndex:u};vL(e,{unstable_getRowHeight:n,unstable_setLastMeasuredRowIndex:r,unstable_storeRowHeightMeasurement:o,resetRowHeights:i},"public"),vL(e,d,"private")})(n),j}const bN=jh("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScroller,n.hasScrollX&&t["virtualScroller--hasScrollX"]]}})({position:"relative",height:"100%",flexGrow:1,overflow:"scroll",scrollbarWidth:"none",display:"flex",flexDirection:"column","&::-webkit-scrollbar":{display:"none"},"@media print":{overflow:"hidden"},zIndex:0}),yN=e=>e.current.state.dimensions.rightPinnedWidth>0;function wN(e){const t=mL(),n=rP(),r=pI(t,sT),o=pI(t,lT),i=pI(t,yN),a=pI(t,hT),{overlayType:l,loadingOverlayVariant:c}=EL(t,n),u=n.slots?.[l],d={classes:n.classes,hasScrollX:o,hasPinnedRight:i,overlayType:l,loadingOverlayVariant:c},p=(e=>{const{classes:t,hasScrollX:n,hasPinnedRight:r,loadingOverlayVariant:o,overlayType:i}=e;return wm({root:["main",r&&"main--hasPinnedRight",("skeleton"===o||"noColumnsOverlay"===i)&&"main--hiddenContent"],scroller:["virtualScroller",n&&"virtualScroller--hasScrollX"]},YT,t)})(d),h=vN().api.getters,{getContainerProps:m,getScrollerProps:g,getContentProps:v,getPositionerProps:b,getScrollbarVerticalProps:y,getScrollbarHorizontalProps:w,getRows:x,getScrollAreaProps:S}=h,C=x(void 0,xT(t));return Xp.jsxs(IL,f({className:p.root},m(),{ownerState:d,children:[Xp.jsx(fL,f({scrollDirection:"left"},S())),Xp.jsx(fL,f({scrollDirection:"right"},S())),Xp.jsx(fL,f({scrollDirection:"up"},S())),Xp.jsx(fL,f({scrollDirection:"down"},S())),Xp.jsxs(bN,f({className:p.scroller},g(),{ownerState:d,children:[Xp.jsxs(DL,{children:[!n.listView&&Xp.jsx(PL,{}),Xp.jsx(n.slots.pinnedRows,{position:"top",virtualScroller:h})]}),l&&Xp.jsx(aN,{overlayType:l,loadingOverlayVariant:c,children:Xp.jsx(u,f({},n.slotProps?.[l]))}),Xp.jsx(LL,f({},v(),{children:Xp.jsxs(HL,f({role:"rowgroup"},b(),{children:[C,Xp.jsx(n.slots.detailPanels,{virtualScroller:h})]}))})),a&&Xp.jsx(BL,{rowsLength:C.length}),Xp.jsx(n.slots.bottomContainer,{children:Xp.jsx(n.slots.pinnedRows,{position:"bottom",virtualScroller:h})})]})),o&&Xp.jsxs(s.Fragment,{children:[n.pinnedColumnsSectionSeparator?.endsWith("shadow")&&Xp.jsx(rN,{position:"horizontal"}),Xp.jsx(tN,f({position:"horizontal"},w()))]}),r&&Xp.jsxs(s.Fragment,{children:[n.pinnedRowsSectionSeparator?.endsWith("shadow")&&Xp.jsx(rN,{position:"vertical"}),Xp.jsx(tN,f({position:"vertical"},y()))]}),o&&r&&Xp.jsx(eN,{"aria-hidden":"true"}),e.children]}))}function xN(){const e=rP();return e.hideFooter?null:Xp.jsx(e.slots.footer,f({},e.slotProps?.footer))}let SN;function CN(){return void 0===SN&&document.createElement("div").focus({get preventScroll(){return SN=!0,!1}}),SN}const kN=(e,t)=>{if(e)if(t){if(e===nD.LEFT)return"right";if(e===nD.RIGHT)return"left"}else{if(e===nD.LEFT)return"left";if(e===nD.RIGHT)return"right"}};function EN(e,t,n,r){const o=kN(n,t);return o&&void 0!==r?(e[o]=r,e):e}const RN=["column","row","rowId","rowNode","align","children","colIndex","width","className","style","colSpan","disableDragEvents","isNotVisible","pinnedOffset","pinnedPosition","showRightBorder","showLeftBorder","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver"],PN=["changeReason","unstable_updateValueOnRender"];nD.LEFT,ZI.LEFT,nD.RIGHT,ZI.RIGHT,nD.NONE,nD.VIRTUAL;const MN=TR(function(e,t){const{column:n,row:r,rowId:o,rowNode:i,align:a,colIndex:l,width:c,className:u,style:p,colSpan:h,disableDragEvents:m,isNotVisible:g,pinnedOffset:v,pinnedPosition:b,showRightBorder:y,showLeftBorder:w,onClick:x,onDoubleClick:S,onMouseDown:C,onMouseUp:k,onMouseOver:E,onKeyDown:R,onKeyUp:P,onDragEnter:M,onDragOver:T}=e,I=d(e,RN),O=mL(),D=rP(),F=um(),L=n.field,A=pI(O,GL,{rowId:o,field:L}),N=jO().hooks.useCellAggregationResult(o,L),$=A?zI.Edit:zI.View,{value:z,formattedValue:j}=N||{},B=O.current.getCellParamsForRow(o,L,r,{colDef:n,cellMode:$,rowNode:i,tabIndex:pI(O,()=>{const e=JD(O);return e&&e.field===L&&e.id===o?0:-1}),hasFocus:pI(O,()=>{const e=YD(O);return e?.id===o&&e.field===L}),value:z,formattedValue:j});B.api=O.current,pI(O,()=>O.current.isCellEditable(B));const _=pI(O,()=>O.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:o,field:L})),H=O.current.virtualizer.store,V=YM(H,AA.selectors.hiddenCells),W=YM(H,AA.selectors.spannedCells),{hasFocus:U,isEditable:G=!1,value:K}=B,q="view"!==$&&G||"actions"===n.type?-1:B.tabIndex,{classes:Y,getCellClassName:X}=D,Q=[pI(O,()=>O.current.unstable_applyPipeProcessors("cellClassName",[],{id:o,field:L}).filter(Boolean).join(" "))];n.cellClassName&&Q.push("function"==typeof n.cellClassName?n.cellClassName(B):n.cellClassName),"flex"===n.display&&Q.push(XT["cell--flex"]),X&&Q.push(X(B));const Z=B.formattedValue??K,J=s.useRef(null),ee=Tg(t,J),te=D.cellSelection??!1,ne=(e=>{const{align:t,showLeftBorder:n,showRightBorder:r,pinnedPosition:o,isEditable:i,isSelected:a,isSelectionMode:l,classes:s}=e;return wm({root:["cell",`cell--text${xf(t)}`,a&&"selected",i&&"cell--editable",n&&"cell--withLeftBorder",r&&"cell--withRightBorder",o===nD.LEFT&&"cell--pinnedLeft",o===nD.RIGHT&&"cell--pinnedRight",l&&!i&&"cell--selectionMode"]},YT,s)})({align:a,showLeftBorder:w,showRightBorder:y,isEditable:G,classes:D.classes,pinnedPosition:b,isSelected:_,isSelectionMode:te}),re=s.useCallback(e=>t=>{const n=O.current.getCellParams(o,L||"");O.current.publishEvent(e,n,t),k&&k(t)},[O,L,k,o]),oe=s.useCallback(e=>t=>{const n=O.current.getCellParams(o,L||"");O.current.publishEvent(e,n,t),C&&C(t)},[O,L,C,o]),ie=s.useCallback((e,t)=>n=>{if(!O.current.getRow(o))return;const r=O.current.getCellParams(o,L||"");O.current.publishEvent(e,r,n),t&&t(n)},[O,L,o]),ae=V[o]?.[l]??!1,le=W[o]?.[l]??1,se=s.useMemo(()=>{if(g)return{padding:0,opacity:0,width:0,height:0,border:0};const e=EN(f({"--width":`${c}px`},p),F,b,v),t=b===nD.LEFT,n=b===nD.RIGHT;return le>1&&(e.height=`calc(var(--height) * ${le})`,e.zIndex=10,(t||n)&&(e.zIndex=40)),e},[c,g,p,v,b,F,le]);if(Wh(()=>{if(!U||$===zI.Edit)return;const e=kg(O.current.rootElementRef.current);if(J.current&&!J.current.contains(e.activeElement)){const e=J.current.querySelector('[tabindex="0"]')||J.current;if(CN())e.focus({preventScroll:!0});else{const t=O.current.getScrollPosition();e.focus(),O.current.scroll(t)}}},[U,$,O]),ae)return Xp.jsx("div",{"data-colindex":l,role:"presentation",style:f({width:"var(--width)"},se)});let ce,ue,de=I.onFocus;if(null===A&&n.renderCell&&(ce=n.renderCell(B)),null!==A&&n.renderEditCell){const e=O.current.getRowWithUpdatedValues(o,n.field),t=d(A,PN),r=n.valueFormatter?n.valueFormatter(A.value,e,n,O):B.formattedValue,i=f({},B,{row:e,formattedValue:r},t);ce=n.renderEditCell(i),Q.push(XT["cell--editing"]),Q.push(Y?.["cell--editing"])}if(void 0===ce){const e=Z?.toString();ce=e,ue=e}const pe=m?null:{onDragEnter:ie("cellDragEnter",M),onDragOver:ie("cellDragOver",T)};return Xp.jsx("div",f({className:PR(ne.root,Q,u),role:"gridcell","data-field":L,"data-colindex":l,"aria-colindex":l+1,"aria-colspan":h,"aria-rowspan":le,style:se,title:ue,tabIndex:q,onClick:ie("cellClick",x),onDoubleClick:ie("cellDoubleClick",S),onMouseOver:ie("cellMouseOver",E),onMouseDown:oe("cellMouseDown"),onMouseUp:re("cellMouseUp"),onKeyDown:ie("cellKeyDown",R),onKeyUp:ie("cellKeyUp",P)},pe,I,{onFocus:de,ref:ee,children:ce}))}),TN=KT(MN),IN=["field","type","align","width","height","empty","style","className"],ON="1.3em",DN=[40,80],FN={number:[40,60],string:[40,80],date:[40,60],dateTime:[60,80],singleSelect:[40,80]},LN=function(e){const t=(n=e,()=>{let e=n+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296});var n;return(e,n)=>e+(n-e)*t()}(12345);const AN=KT(function(e){const{field:t,type:n,align:r,width:o,height:i,empty:a=!1,style:l,className:c}=e,u=d(e,IN),p=rP(),h=(e=>{const{align:t,classes:n,empty:r}=e;return wm({root:["cell","cellSkeleton",`cell--text${t?xf(t):"Left"}`,r&&"cellEmpty"]},YT,n)})({classes:p.classes,align:r,empty:a}),m=s.useMemo(()=>{if("boolean"===n||"actions"===n)return{variant:"circular",width:ON,height:ON};const[e,t]=n?FN[n]??DN:DN;return{variant:"text",width:`${Math.round(LN(e,t))}%`,height:"1.2em"}},[n]);return Xp.jsx("div",f({"data-field":t,className:PR(h.root,c),style:f({height:i,maxWidth:o,minWidth:o},l)},u,{children:!a&&Xp.jsx(p.slots.baseSkeleton,f({},m))}))}),NN={width:3,rx:1.5,x:10.5},$N=e=>e.current.state.dimensions.isReady?e.current.state.dimensions.hasScrollX&&(!e.current.state.dimensions.hasScrollY||0===e.current.state.dimensions.scrollbarSize):0===e.current.state.dimensions.scrollbarSize,zN=pg("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${XT.autoHeight}`]:t.autoHeight},{[`&.${XT.autosizing}`]:t.autosizing},{[`&.${XT["root--densityStandard"]}`]:t["root--densityStandard"]},{[`&.${XT["root--densityComfortable"]}`]:t["root--densityComfortable"]},{[`&.${XT["root--densityCompact"]}`]:t["root--densityCompact"]},{[`&.${XT["root--disableUserSelection"]}`]:t["root--disableUserSelection"]},{[`&.${XT["root--noToolbar"]}`]:t["root--noToolbar"]},{[`&.${XT.withVerticalBorder}`]:t.withVerticalBorder},{[`& .${XT.actionsCell}`]:t.actionsCell},{[`& .${XT.booleanCell}`]:t.booleanCell},{[`& .${XT.cell}`]:t.cell},{[`& .${XT["cell--editable"]}`]:t["cell--editable"]},{[`& .${XT["cell--editing"]}`]:t["cell--editing"]},{[`& .${XT["cell--flex"]}`]:t["cell--flex"]},{[`& .${XT["cell--pinnedLeft"]}`]:t["cell--pinnedLeft"]},{[`& .${XT["cell--pinnedRight"]}`]:t["cell--pinnedRight"]},{[`& .${XT["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${XT["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${XT["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${XT["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${XT["cell--selectionMode"]}`]:t["cell--selectionMode"]},{[`& .${XT["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${XT["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${XT["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${XT["cell--withLeftBorder"]}`]:t["cell--withLeftBorder"]},{[`& .${XT["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${XT.cellCheckbox}`]:t.cellCheckbox},{[`& .${XT.cellEmpty}`]:t.cellEmpty},{[`& .${XT.cellOffsetLeft}`]:t.cellOffsetLeft},{[`& .${XT.cellSkeleton}`]:t.cellSkeleton},{[`& .${XT.checkboxInput}`]:t.checkboxInput},{[`& .${XT.columnHeader}`]:t.columnHeader},{[`& .${XT["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${XT["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${XT["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${XT["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${XT["columnHeader--emptyGroup"]}`]:t["columnHeader--emptyGroup"]},{[`& .${XT["columnHeader--filledGroup"]}`]:t["columnHeader--filledGroup"]},{[`& .${XT["columnHeader--filtered"]}`]:t["columnHeader--filtered"]},{[`& .${XT["columnHeader--last"]}`]:t["columnHeader--last"]},{[`& .${XT["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${XT["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${XT["columnHeader--pinnedLeft"]}`]:t["columnHeader--pinnedLeft"]},{[`& .${XT["columnHeader--pinnedRight"]}`]:t["columnHeader--pinnedRight"]},{[`& .${XT["columnHeader--siblingFocused"]}`]:t["columnHeader--siblingFocused"]},{[`& .${XT["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${XT["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${XT["columnHeader--withLeftBorder"]}`]:t["columnHeader--withLeftBorder"]},{[`& .${XT["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${XT.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${XT.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${XT.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${XT.columnHeaderTitleContainerContent}`]:t.columnHeaderTitleContainerContent},{[`& .${XT.columnSeparator}`]:t.columnSeparator},{[`& .${XT["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${XT["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${XT["columnSeparator--sideLeft"]}`]:t["columnSeparator--sideLeft"]},{[`& .${XT["columnSeparator--sideRight"]}`]:t["columnSeparator--sideRight"]},{[`& .${XT["container--bottom"]}`]:t["container--bottom"]},{[`& .${XT["container--top"]}`]:t["container--top"]},{[`& .${XT.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${XT["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},{[`& .${XT.editBooleanCell}`]:t.editBooleanCell},{[`& .${XT.filterIcon}`]:t.filterIcon},{[`& .${XT["filler--borderBottom"]}`]:t["filler--borderBottom"]},{[`& .${XT["filler--pinnedLeft"]}`]:t["filler--pinnedLeft"]},{[`& .${XT["filler--pinnedRight"]}`]:t["filler--pinnedRight"]},{[`& .${XT.groupingCriteriaCell}`]:t.groupingCriteriaCell},{[`& .${XT.groupingCriteriaCellLoadingContainer}`]:t.groupingCriteriaCellLoadingContainer},{[`& .${XT.groupingCriteriaCellToggle}`]:t.groupingCriteriaCellToggle},{[`& .${XT.headerFilterRow}`]:t.headerFilterRow},{[`& .${XT.iconSeparator}`]:t.iconSeparator},{[`& .${XT.menuIcon}`]:t.menuIcon},{[`& .${XT.menuIconButton}`]:t.menuIconButton},{[`& .${XT.menuList}`]:t.menuList},{[`& .${XT.menuOpen}`]:t.menuOpen},{[`& .${XT.overlayWrapperInner}`]:t.overlayWrapperInner},{[`& .${XT.pinnedRows}`]:t.pinnedRows},{[`& .${XT["pinnedRows--bottom"]}`]:t["pinnedRows--bottom"]},{[`& .${XT["pinnedRows--top"]}`]:t["pinnedRows--top"]},{[`& .${XT.row}`]:t.row},{[`& .${XT["row--borderBottom"]}`]:t["row--borderBottom"]},{[`& .${XT["row--detailPanelExpanded"]}`]:t["row--detailPanelExpanded"]},{[`& .${XT["row--dragging"]}`]:t["row--dragging"]},{[`& .${XT["row--dynamicHeight"]}`]:t["row--dynamicHeight"]},{[`& .${XT["row--editable"]}`]:t["row--editable"]},{[`& .${XT["row--editing"]}`]:t["row--editing"]},{[`& .${XT["row--firstVisible"]}`]:t["row--firstVisible"]},{[`& .${XT["row--lastVisible"]}`]:t["row--lastVisible"]},{[`& .${XT.rowReorderCell}`]:t.rowReorderCell},{[`& .${XT["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${XT.rowReorderCellContainer}`]:t.rowReorderCellContainer},{[`& .${XT.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${XT.rowSkeleton}`]:t.rowSkeleton},{[`& .${XT.scrollbar}`]:t.scrollbar},{[`& .${XT["scrollbar--horizontal"]}`]:t["scrollbar--horizontal"]},{[`& .${XT["scrollbar--vertical"]}`]:t["scrollbar--vertical"]},{[`& .${XT.scrollbarFiller}`]:t.scrollbarFiller},{[`& .${XT["scrollbarFiller--pinnedRight"]}`]:t["scrollbarFiller--pinnedRight"]},{[`& .${XT.sortIcon}`]:t.sortIcon},{[`& .${XT.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${XT.treeDataGroupingCellLoadingContainer}`]:t.treeDataGroupingCellLoadingContainer},{[`& .${XT.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${XT.withBorderColor}`]:t.withBorderColor},{[`& .${XT["row--beingDragged"]}`]:t["row--beingDragged"]}]})(()=>{const e=pI(mL(),$N),t=bP.colors.background.base,n=bP.header.background.base,r=bP.cell.background.pinned,o=function(e){return jN(e,1)}(bP.colors.interactive.hover),i=bP.colors.interactive.hoverOpacity,a=bP.colors.interactive.selected,l=bP.colors.interactive.selectedOpacity,s=a,c=`calc(${l} + ${i})`,u=BN(t,o,i),d=BN(t,a,l),p=BN(t,s,c),f=BN(r,o,i),h=BN(r,a,l),m=BN(r,s,c),g=e=>({[`& .${XT["cell--pinnedLeft"]}, & .${XT["cell--pinnedRight"]}`]:{backgroundColor:e,"&.Mui-selected":{backgroundColor:BN(e,d,l),"&:hover":{backgroundColor:BN(e,p,c)}}}}),v=g(f),b=g(h),y=g(m),w={backgroundColor:d,"&:hover":{backgroundColor:p,"@media (hover: none)":{backgroundColor:d}}};return{"--unstable_DataGrid-radius":bP.radius.base,"--unstable_DataGrid-headWeight":bP.typography.fontWeight.medium,"--DataGrid-rowBorderColor":bP.colors.border.base,"--DataGrid-cellOffsetMultiplier":2,"--DataGrid-width":"0px","--DataGrid-hasScrollX":"0","--DataGrid-hasScrollY":"0","--DataGrid-scrollbarSize":"10px","--DataGrid-rowWidth":"0px","--DataGrid-columnsTotalWidth":"0px","--DataGrid-leftPinnedWidth":"0px","--DataGrid-rightPinnedWidth":"0px","--DataGrid-headerHeight":"0px","--DataGrid-headersTotalHeight":"0px","--DataGrid-topContainerHeight":"0px","--DataGrid-bottomContainerHeight":"0px",flex:1,boxSizing:"border-box",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:bP.colors.border.base,borderRadius:"var(--unstable_DataGrid-radius)",backgroundColor:bP.colors.background.base,color:bP.colors.foreground.base,font:bP.typography.font.body,outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflow:"hidden",overflowAnchor:"none",transform:"translate(0, 0)",[`.${XT.main} > *:first-child/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */`]:{borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"},[`&.${XT.autoHeight}`]:{height:"auto"},[`&.${XT.autosizing}`]:{[`& .${XT.columnHeaderTitleContainerContent} > *`]:{overflow:"visible !important"},"@media (hover: hover)":{[`& .${XT.menuIcon}`]:{width:"0 !important",visibility:"hidden !important"}},[`& .${XT.cell}`]:{overflow:"visible !important",whiteSpace:"nowrap",minWidth:"max-content !important",maxWidth:"max-content !important"},[`& .${XT.groupingCriteriaCell}`]:{width:"unset"},[`& .${XT.treeDataGroupingCell}`]:{width:"unset"}},[`&.${XT.withSidePanel}`]:{flexDirection:"row"},[`& .${XT.mainContent}`]:{display:"flex",flexDirection:"column",overflow:"hidden",flex:1},[`& .${XT.columnHeader}, & .${XT.cell}`]:{WebkitTapHighlightColor:"transparent",padding:"0 10px",boxSizing:"border-box"},[`& .${XT.columnHeader}:focus-within, & .${XT.cell}:focus-within`]:{outline:`solid ${jN(bP.colors.interactive.focus,.5)} 1px`,outlineOffset:-1},[`& .${XT.columnHeader}:focus, & .${XT.cell}:focus`]:{outline:`solid ${bP.colors.interactive.focus} 1px`,outlineOffset:-1},[`& .${XT.columnHeader}:focus,\n & .${XT["columnHeader--withLeftBorder"]},\n & .${XT["columnHeader--withRightBorder"]},\n & .${XT["columnHeader--siblingFocused"]}\n `]:{[`& .${XT.columnSeparator}`]:{opacity:0},"@media (hover: none)":{[`& .${XT["columnSeparator--resizable"]}`]:{opacity:1}},[`& .${XT["columnSeparator--resizable"]}:hover`]:{opacity:1}},[`&.${XT["root--noToolbar"]} [aria-rowindex="1"] [aria-colindex="1"]`]:{borderTopLeftRadius:"calc(var(--unstable_DataGrid-radius) - 1px)"},[`&.${XT["root--noToolbar"]} [aria-rowindex="1"] .${XT["columnHeader--last"]}`]:{borderTopRightRadius:e?"calc(var(--unstable_DataGrid-radius) - 1px)":void 0},[`& .${XT.columnHeaderCheckbox}, & .${XT.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${XT.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center",backgroundColor:n},[`& .${XT.columnHeader} .${XT.sortButton}`]:{backgroundColor:bP.header.background.base},[`& .${XT["columnHeader--filter"]}`]:{paddingTop:8,paddingBottom:8,paddingRight:5,minHeight:"min-content",overflow:"hidden"},[`& .${XT["virtualScroller--hasScrollX"]} .${XT["columnHeader--last"]}`]:{overflow:"hidden"},[`& .${XT["pivotPanelField--sorted"]} .${XT.iconButtonContainer},\n & .${XT["columnHeader--sorted"]} .${XT.iconButtonContainer},\n & .${XT["columnHeader--filtered"]} .${XT.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${XT.pivotPanelField}:not(.${XT["pivotPanelField--sorted"]}) .${XT.sortButton},\n & .${XT.columnHeader}:not(.${XT["columnHeader--sorted"]}) .${XT.sortButton}`]:{opacity:0,transition:bP.transition(["opacity"],{duration:bP.transitions.duration.short})},[`& .${XT.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",gap:bP.spacing(.25),minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden"},[`& .${XT.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${XT["columnHeader--filledGroup"]} .${XT.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${XT.sortIcon}, & .${XT.filterIcon}`]:{fontSize:"inherit"},[`& .${XT["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${XT["columnHeader--alignCenter"]} .${XT.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${XT["columnHeader--alignRight"]} .${XT.columnHeaderDraggableContainer}, & .${XT["columnHeader--alignRight"]} .${XT.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${XT["columnHeader--alignCenter"]} .${XT.menuIcon}`]:{marginLeft:"auto"},[`& .${XT["columnHeader--alignRight"]} .${XT.menuIcon}`]:{marginRight:"auto",marginLeft:-5},[`& .${XT["columnHeader--moving"]}`]:{backgroundColor:u},[`& .${XT["columnHeader--pinnedLeft"]}, & .${XT["columnHeader--pinnedRight"]}`]:{position:"sticky",zIndex:40,background:bP.header.background.base},[`& .${XT.columnSeparator}`]:{position:"absolute",overflow:"hidden",zIndex:30,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",maxWidth:10,color:bP.colors.border.base},[`& .${XT.columnHeaders}`]:{width:"var(--DataGrid-rowWidth)",backgroundColor:n},"@media (hover: hover)":{[`& .${XT.columnHeader}:hover`]:{[`& .${XT.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${XT.iconButtonContainer}`]:{visibility:"visible",width:"auto"}},[`& .${XT.columnHeader}:not(.${XT["columnHeader--sorted"]}):hover .${XT.sortButton},\n & .${XT.pivotPanelField}:not(.${XT["pivotPanelField--sorted"]}):hover .${XT.sortButton},\n & .${XT.pivotPanelField}:not(.${XT["pivotPanelField--sorted"]}) .${XT.sortButton}:focus-visible`]:{opacity:1},[`& .${XT.columnHeader}:not(.${XT["columnHeader--sorted"]}):hover .${XT.sortButton} > *,\n & .${XT.pivotPanelField}:not(.${XT["pivotPanelField--sorted"]}):hover .${XT.sortButton} > *,\n & .${XT.pivotPanelField}:not(.${XT["pivotPanelField--sorted"]}) .${XT.sortButton}:focus-visible > *`]:{opacity:.78},[`& .${XT.pivotPanelFieldActionContainer} button:hover`]:{backgroundColor:bP.colors.background.base}},"@media (hover: none)":{[`& .${XT.columnHeader} .${XT.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${XT.columnHeader}:focus,\n & .${XT["columnHeader--siblingFocused"]}`]:{[`.${XT["columnSeparator--resizable"]}`]:{color:bP.colors.foreground.accent}},[`& .${XT.pivotPanelField}:not(.${XT["pivotPanelField--sorted"]}) .${XT.sortButton}`]:{opacity:.78}},[`& .${XT["columnHeader--withLeftBorder"]} .${XT["columnSeparator--sideLeft"]}:not(.${XT["columnSeparator--resizable"]}), & .${XT["columnHeader--withRightBorder"]} .${XT["columnSeparator--sideRight"]}:not(.${XT["columnSeparator--resizable"]})`]:{display:"none"},[`& .${XT["columnSeparator--sideLeft"]}`]:{left:-5},[`& .${XT["columnSeparator--sideRight"]}`]:{right:-5},[`& .${XT["columnHeader--withRightBorder"]} .${XT["columnSeparator--sideLeft"]}`]:{left:-5.5},[`& .${XT["columnHeader--withRightBorder"]} .${XT["columnSeparator--sideRight"]}`]:{right:-5.5},[`& .${XT["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none",[`&.${XT["columnSeparator--resizing"]}`]:{color:bP.colors.foreground.accent},"@media (hover: none)":{[`& .${XT.iconSeparator} rect`]:NN},"@media (hover: hover)":{"&:hover":{color:bP.colors.foreground.accent,[`& .${XT.iconSeparator} rect`]:NN}},"& svg":{pointerEvents:"none"}},[`& .${XT.iconSeparator}`]:{color:"inherit",transition:bP.transition(["color","width"],{duration:bP.transitions.duration.short})},[`& .${XT.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-5,display:"flex",alignItems:"center"},[`.${XT.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${XT.headerFilterRow}`]:{[`& .${XT.columnHeader}, & .${XT.scrollbarFiller}`]:{boxSizing:"border-box",borderBottom:"1px solid var(--DataGrid-rowBorderColor)"}},[`& .${XT["row--borderBottom"]} .${XT.columnHeader},\n & .${XT["row--borderBottom"]} .${XT.filler},\n & .${XT["row--borderBottom"]} .${XT.scrollbarFiller}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${XT["row--borderBottom"]} .${XT.cell}`]:{borderBottom:"1px solid var(--rowBorderColor)"},[`.${XT.row}`]:{display:"flex",width:"var(--DataGrid-rowWidth)",breakInside:"avoid","--rowBorderColor":"var(--DataGrid-rowBorderColor)",[`&.${XT["row--firstVisible"]}`]:{"--rowBorderColor":"transparent"},"&:hover":{backgroundColor:u,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${XT.rowSkeleton}:hover`]:{backgroundColor:"transparent"},"&.Mui-selected":w,position:"relative"},[`& .${XT.cell}`]:{flex:"0 0 auto",height:"var(--height)",width:"var(--width)",lineHeight:"calc(var(--height) - 1px)",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis","&.Mui-selected":w},[`& .${XT["virtualScrollerContent--overflowed"]} .${XT["row--lastVisible"]} .${XT.cell}`]:{borderTopColor:"transparent"},[`& .${XT.pinnedRows} .${XT.row}, .${XT.aggregationRowOverlayWrapper} .${XT.row}`]:{backgroundColor:r,"&:hover":{backgroundColor:f}},[`& .${XT["pinnedRows--top"]} :first-of-type`]:{[`& .${XT.cell}, .${XT.scrollbarFiller}`]:{borderTop:"none"}},[`&.${XT["root--disableUserSelection"]}`]:{userSelect:"none"},[`& .${XT["row--dynamicHeight"]} > .${XT.cell}`]:{whiteSpace:"initial",lineHeight:"inherit"},[`& .${XT.cellEmpty}`]:{flex:1,padding:0,height:"unset"},[`& .${XT.cell}.${XT["cell--selectionMode"]}`]:{cursor:"default"},[`& .${XT.cell}.${XT["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:bP.shadows.base,backgroundColor:bP.colors.background.overlay,"&:focus-within":{outline:`1px solid ${bP.colors.interactive.focus}`,outlineOffset:-1}},[`& .${XT["cell--editing"]}`]:{"& .MuiInputBase-root":{height:"100%"}},[`& .${XT["row--editing"]}`]:{boxShadow:bP.shadows.base},[`& .${XT["row--editing"]} .${XT.cell}`]:{boxShadow:"none",backgroundColor:bP.colors.background.overlay},[`& .${XT.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${XT.booleanCell}[data-value="true"]`]:{color:bP.colors.foreground.muted},[`& .${XT.booleanCell}[data-value="false"]`]:{color:bP.colors.foreground.disabled},[`& .${XT.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:bP.spacing(1)},[`& .${XT.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:bP.colors.interactive.disabledOpacity},[`& .${XT["rowReorderCell--draggable"]}`]:{cursor:"grab",opacity:1},[`& .${XT.rowReorderCellContainer}`]:{padding:0,display:"flex",alignItems:"stretch"},[`.${XT.withBorderColor}`]:{borderColor:bP.colors.border.base},[`& .${XT["cell--withLeftBorder"]}, & .${XT["columnHeader--withLeftBorder"]}`]:{borderLeftColor:"var(--DataGrid-rowBorderColor)",borderLeftWidth:"1px",borderLeftStyle:"solid"},[`& .${XT["cell--withRightBorder"]}, & .${XT["columnHeader--withRightBorder"]}`]:{borderRightColor:"var(--DataGrid-rowBorderColor)",borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${XT["cell--flex"]}`]:{display:"flex",alignItems:"center",lineHeight:"inherit"},[`& .${XT["cell--textLeft"]}`]:{textAlign:"left",justifyContent:"flex-start"},[`& .${XT["cell--textRight"]}`]:{textAlign:"right",justifyContent:"flex-end"},[`& .${XT["cell--textCenter"]}`]:{textAlign:"center",justifyContent:"center"},[`& .${XT["cell--pinnedLeft"]}, & .${XT["cell--pinnedRight"]}`]:{position:"sticky",zIndex:30,background:bP.cell.background.pinned,"&.Mui-selected":{backgroundColor:h}},[`& .${XT.row}`]:{"&:hover":v,"&.Mui-selected":b,"&.Mui-selected:hover":y},[`& .${XT.cellOffsetLeft}`]:{flex:"0 0 auto",display:"inline-block"},[`& .${XT.cellSkeleton}`]:{flex:"0 0 auto",height:"100%",display:"inline-flex",alignItems:"center"},[`& .${XT.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${XT.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${XT["columnHeader--dragging"]}`]:{background:bP.colors.background.overlay,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:bP.colors.interactive.disabledOpacity},[`& .${XT["row--dragging"]}`]:{background:bP.colors.background.overlay,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",border:"1px solid var(--DataGrid-rowBorderColor)",color:bP.colors.foreground.base,transform:"translateZ(0)",[`& .${XT.rowReorderCellPlaceholder}`]:{padding:"0 6px",display:"flex"}},[`& .${XT.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${XT.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:bP.spacing(2)},[`& .${XT.treeDataGroupingCellLoadingContainer}, .${XT.groupingCriteriaCellLoadingContainer}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},[`& .${XT.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${XT.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:bP.spacing(2)},[`& .${XT.columnHeaders} .${XT.scrollbarFiller}`]:{backgroundColor:n},[`.${XT.scrollbarFiller}`]:{minWidth:"calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",alignSelf:"stretch",backgroundColor:n,[`&.${XT["scrollbarFiller--pinnedRight"]}`]:{position:"sticky",zIndex:40,right:0}},[`& .${XT.filler}`]:{flex:"1 0 auto"},[`& .${XT["filler--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${XT.columnHeaders} .${XT.filler}`]:{backgroundColor:n},[`& .${XT["main--hiddenContent"]}`]:{[`& .${XT.virtualScrollerContent}`]:{position:"fixed",visibility:"hidden"},[`& .${XT.pinnedRows}`]:{display:"none"}},[`& .${XT["row--beingDragged"]}`]:{color:bP.colors.foreground.disabled,"&:hover":{backgroundColor:"transparent"}}}});function jN(e,t){return`rgba(from ${e} r g b / ${t})`}function BN(e,t,n){return`color-mix(in srgb,${e}, ${t} calc(${n} * 100%))`}const _N=()=>()=>{},HN=()=>!1,VN=()=>!0,WN=s.createContext(void 0);function UN(){const e=s.useContext(WN);if(void 0===e)throw new Error("MUI X: Missing context.");return e}function GN({children:e}){const t=s.useRef(null),n=s.useRef(null),r=s.useRef(null),o=s.useMemo(()=>({columnsPanelTriggerRef:t,filterPanelTriggerRef:n,aiAssistantPanelTriggerRef:r}),[]);return Xp.jsx(WN.Provider,{value:o,children:e})}function KN(){const e=lP(),t=pI(e,aO),n=rP(),r=pI(e,KL),{columnsPanelTriggerRef:o,filterPanelTriggerRef:i,aiAssistantPanelTriggerRef:a}=UN(),l=e.current.unstable_applyPipeProcessors("preferencePanel",null,r.openedPanelValue??YL.filters);let s=null;switch(r.openedPanelValue){case YL.filters:s=i.current;break;case YL.columns:s=o.current;break;case YL.aiAssistant:s=a.current}return Xp.jsx(n.slots.panel,f({id:r.panelId,open:t.length>0&&r.open,"aria-labelledby":r.labelId,target:s,onClose:()=>e.current.hidePreferences()},n.slotProps?.panel,{children:l}))}function qN(){const e=rP();return Xp.jsxs(s.Fragment,{children:[Xp.jsx(KN,{}),e.showToolbar&&Xp.jsx(e.slots.toolbar,f({},e.slotProps?.toolbar))]})}const YN=["className","children","sidePanel"],XN=TR(function(e,t){const n=rP(),{className:r,children:o,sidePanel:i}=e,a=d(e,YN),l=mL(),c=pI(l,hI),u=l.current.rootElementRef,p=s.useCallback(e=>{null!==e&&l.current.publishEvent("rootMount",e)},[l]),h=Tg(u,t,p),m=n,g=((e,t)=>{const{autoHeight:n,classes:r,showCellVerticalBorder:o}=e;return wm({root:["root",n&&"autoHeight",`root--density${xf(t)}`,null===e.slots.toolbar&&"root--noToolbar","withBorderColor",o&&"withVerticalBorder"]},YT,r)})(m,c),v=s.useContext(BO);return WM.useSyncExternalStore(_N,HN,VN)?null:Xp.jsxs(zN,f({className:PR(g.root,r,v.className,i&&XT.withSidePanel),ownerState:m},a,{ref:h,children:[Xp.jsxs("div",{className:XT.mainContent,role:"presentation",children:[Xp.jsx(qN,{}),Xp.jsx(wN,{children:o}),Xp.jsx(xN,{})]}),i,v.tag]}))}),QN=KT(XN),ZN=["className"],JN=jh("div",{name:"MuiDataGrid",slot:"FooterContainer"})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),e$=TR(function(e,t){const{className:n}=e,r=d(e,ZN),o=rP(),i=(e=>{const{classes:t}=e;return wm({root:["footerContainer","withBorderColor"]},YT,t)})(o);return Xp.jsx(JN,f({className:PR(i.root,n),ownerState:o},r,{ref:t}))}),t$=["className"],n$=jh("div",{name:"MuiDataGrid",slot:"Overlay"})({width:"100%",height:"100%",display:"flex",gap:bP.spacing(1),flexDirection:"column",alignSelf:"center",alignItems:"center",justifyContent:"center",textAlign:"center",textWrap:"balance",backgroundColor:bP.colors.background.backdrop}),r$=TR(function(e,t){const{className:n}=e,r=d(e,t$),o=rP(),i=(e=>{const{classes:t}=e;return wm({root:["overlay"]},YT,t)})(o);return Xp.jsx(n$,f({className:PR(i.root,n),ownerState:o},r,{ref:t}))});function o$(e,t,n,r={}){return"function"==typeof t?t(n,r):t?(t.props.className&&(n.className=function(e,t){if(!e||!t)return e||t;return`${e} ${t}`}(t.props.className,n.className)),(t.props.style||n.style)&&(n.style=f({},n.style,t.props.style)),s.cloneElement(t,n)):s.createElement(e,n)}const i$=s.createContext(void 0);function a$(e,t){if(!e.ref.current||!t.ref.current)return 0;const n=e.ref.current.compareDocumentPosition(t.ref.current);return n?n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0:0}const l$=["render","className"],s$=jh("div",{name:"MuiDataGrid",slot:"Toolbar"})({flex:"0 1 1px",display:"flex",alignItems:"center",justifyContent:"end",gap:bP.spacing(.25),padding:bP.spacing(.75),minHeight:52,boxSizing:"border-box",borderBottom:`1px solid ${bP.colors.border.base}`}),c$=TR(function(e,t){const{render:n,className:r}=e,o=d(e,l$),i=rP(),a=(e=>{const{classes:t}=e;return wm({root:["toolbar"]},YT,t)})(i),[l,c]=s.useState(null),[u,p]=s.useState([]),h=s.useCallback(()=>u.sort(a$),[u]),m=s.useCallback((e,t,n=!0)=>{let r=e;const o=h(),i=o.length;for(let e=0;e<i;e+=1){if(r+=t,r>=i){if(!n)return-1;r=0}else if(r<0){if(!n)return-1;r=i-1}if(!o[r].ref.current?.disabled&&"true"!==o[r].ref.current?.ariaDisabled)return r}return-1},[h]),g=s.useCallback((e,t)=>{p(n=>[...n,{id:e,ref:t}])},[]),v=s.useCallback(e=>{p(t=>t.filter(t=>t.id!==e))},[]),b=s.useCallback(e=>{if(!l)return;const t=h(),n=t.findIndex(e=>e.id===l);let r=-1;if("ArrowRight"===e.key?(e.preventDefault(),r=m(n,1)):"ArrowLeft"===e.key?(e.preventDefault(),r=m(n,-1)):"Home"===e.key?(e.preventDefault(),r=m(-1,1,!1)):"End"===e.key&&(e.preventDefault(),r=m(t.length,-1,!1)),r>=0&&r<t.length){const e=t[r];c(e.id),e.ref.current?.focus()}},[h,l,m]),y=s.useCallback(e=>{l!==e&&c(e)},[l,c]),w=s.useCallback(e=>{const t=h(),n=t.findIndex(t=>t.id===e),r=m(n,1);if(r>=0&&r<t.length){const e=t[r];c(e.id),e.ref.current?.focus()}},[h,m]);s.useEffect(()=>{const e=h();if(e.length>0){if(!l)return void c(e[0].id);const t=e.findIndex(e=>e.id===l);if(e[t]){if(-1===t){const n=e[t];n&&(c(n.id),n.ref.current?.focus())}}else{const t=e[e.length-1];t&&(c(t.id),t.ref.current?.focus())}}},[h,m]);const x=s.useMemo(()=>({focusableItemId:l,registerItem:g,unregisterItem:v,onItemKeyDown:b,onItemFocus:y,onItemDisabled:w}),[l,g,v,b,y,w]),S=o$(s$,n,f({role:"toolbar","aria-orientation":"horizontal","aria-label":i.label||void 0,className:PR(a.root,r)},o,{ref:t}));return Xp.jsx(i$.Provider,{value:x,children:S})}),u$=["render","onKeyDown","onFocus","disabled","aria-disabled"],d$=TR(function(e,t){const{render:n,onKeyDown:r,onFocus:o,disabled:i,"aria-disabled":a}=e,l=d(e,u$),c=mm(),u=rP(),p=s.useRef(null),h=Tg(p,t),{focusableItemId:m,registerItem:g,unregisterItem:v,onItemKeyDown:b,onItemFocus:y,onItemDisabled:w}=function(){const e=s.useContext(i$);if(void 0===e)throw new Error("MUI X: Missing context. Toolbar subcomponents must be placed within a <Toolbar /> component.");return e}();s.useEffect(()=>(g(c,p),()=>v(c)),[]);const x=s.useRef(i);s.useEffect(()=>{x.current!==i&&!0===i&&w(c,i),x.current=i},[i,c,w]);const S=s.useRef(a);s.useEffect(()=>{S.current!==a&&!0===a&&w(c,!0),S.current=a},[a,c,w]);const C=o$(u.slots.baseIconButton,n,f({},u.slotProps?.baseIconButton,{tabIndex:m===c?0:-1},l,{disabled:i,"aria-disabled":a,onKeyDown:e=>{b(e),r?.(e)},onFocus:e=>{y(c),o?.(e)},ref:h}));return Xp.jsx(s.Fragment,{children:C})}),p$=s.memo(e=>{const{colDef:t,open:n,columnMenuId:r,columnMenuButtonId:o,iconButtonRef:i}=e,a=lP(),l=rP(),c=(e=>{const{classes:t,open:n}=e;return wm({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},YT,t)})(f({},e,{classes:l.classes})),u=s.useCallback(e=>{e.preventDefault(),e.stopPropagation(),a.current.toggleColumnMenu(t.field)},[a,t.field]),d=t.headerName??t.field;return Xp.jsx("div",{className:c.root,children:Xp.jsx(l.slots.baseTooltip,f({title:a.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},l.slotProps?.baseTooltip,{children:Xp.jsx(l.slots.baseIconButton,f({ref:i,tabIndex:-1,className:c.button,"aria-label":a.current.getLocaleText("columnMenuAriaLabel")(d),size:"small",onClick:u,"aria-haspopup":"menu","aria-expanded":n,"aria-controls":n?r:void 0,id:o},l.slotProps?.baseIconButton,{children:Xp.jsx(l.slots.columnMenuIcon,{fontSize:"inherit"})}))}))})});function f$({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:r,field:o,open:i,target:a,onExited:l}){const s=lP(),c=s.current.getColumn(o),u=Mg(e=>{e&&(e.stopPropagation(),a?.contains(e.target))||s.current.hideColumnMenu()});return a&&c?Xp.jsx(UO,{position:"bottom-"+("right"===c.align?"start":"end"),open:i,target:a,onClose:u,onExited:l,children:Xp.jsx(n,f({colDef:c,hideMenu:u,open:i,id:e,labelledby:t},r))}):null}function h$(e,t){return e.closest(`.${t}`)}function m$(e){return e.replace(/["\\]/g,"\\$&")}function g$(e){return`.${XT.row}[data-id="${m$(String(e))}"]`}function v$(e){return 1===e.target.nodeType&&!e.currentTarget.contains(e.target)}function b$(e,t){return e.rootElementRef.current.querySelector(`.${XT[t]}`)}const y$=({api:e,colIndex:t,position:n,filterFn:r})=>{if(null===t)return[];const o=[];return x$(e).forEach(e=>{e.getAttribute("data-id")&&e.querySelectorAll(`.${XT["left"===n?"cell--pinnedLeft":"cell--pinnedRight"]}`).forEach(e=>{const t=S$(e);null!==t&&r(t)&&o.push(e)})}),o};const w$=({api:e,colIndex:t,position:n,filterFn:r})=>{if(!e.columnHeadersContainerRef?.current)return[];if(null===t)return[];const o=[];return e.columnHeadersContainerRef.current.querySelectorAll(`.${XT["left"===n?"columnHeader--pinnedLeft":"columnHeader--pinnedRight"]}`).forEach(e=>{const t=S$(e);null!==t&&r(t,e)&&o.push(e)}),o};function x$(e){return e.virtualScrollerRef.current.querySelectorAll(`:scope > div > div > .${XT.row}`)}function S$(e){const t=e.getAttribute("aria-colindex");return t?Number(t)-1:null}const C$=["className","aria-label"],k$=jh("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle"})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)",lineHeight:"normal"}),E$=TR(function(e,t){const{className:n}=e,r=d(e,C$),o=rP(),i=(e=>{const{classes:t}=e;return wm({root:["columnHeaderTitle"]},YT,t)})(o);return Xp.jsx(k$,f({className:PR(i.root,n),ownerState:o},r,{ref:t}))});function R$(e){const{label:t,description:n}=e,r=rP(),o=s.useRef(null),[i,a]=s.useState(""),l=s.useCallback(()=>{if(!n&&o?.current){const n=(e=o.current).scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth;a(n?t:"")}var e},[n,t]);return Xp.jsx(r.slots.baseTooltip,f({title:n||i},r.slotProps?.baseTooltip,{children:Xp.jsx(E$,{onMouseOver:l,ref:o,children:t})}))}const P$=["resizable","resizing","height","side"];var M$=function(e){return e.Left="left",e.Right="right",e}(M$||{});function T$(e){const{height:t,side:n=M$.Right}=e,r=d(e,P$),o=rP(),i=(e=>{const{resizable:t,resizing:n,classes:r,side:o}=e;return wm({root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",o&&`columnSeparator--side${xf(o)}`],icon:["iconSeparator"]},YT,r)})(f({},e,{side:n,classes:o.classes})),a=s.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]);return Xp.jsx("div",f({className:i.root,style:{minHeight:t}},r,{onClick:a,children:Xp.jsx(o.slots.columnResizeIcon,{className:i.icon})}))}const I$=s.memo(T$),O$=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps","style"],D$=TR(function(e,t){const{classes:n,colIndex:r,height:o,isResizing:i,sortDirection:a,tabIndex:l,separatorSide:c,isDraggable:u,headerComponent:p,description:h,width:m,columnMenuIconButton:g=null,columnMenu:v=null,columnTitleIconButtons:b=null,headerClassName:y,label:w,resizable:x,draggableContainerProps:S,columnHeaderSeparatorProps:C,style:k}=e,E=d(e,O$),R=rP(),P=Tg(s.useRef(null),t);let M="none";return null!=a&&(M="asc"===a?"ascending":"descending"),Xp.jsxs("div",f({className:PR(n.root,y),style:f({},k,{width:m}),role:"columnheader",tabIndex:l,"aria-colindex":r+1,"aria-sort":M},E,{ref:P,children:[Xp.jsxs("div",f({className:n.draggableContainer,draggable:u,role:"presentation"},S,{children:[Xp.jsxs("div",{className:n.titleContainer,role:"presentation",children:[Xp.jsx("div",{className:n.titleContainerContent,children:void 0!==p?p:Xp.jsx(R$,{label:w,description:h,columnWidth:m})}),b]}),g]})),Xp.jsx(I$,f({resizable:!R.disableColumnResize&&!!x,resizing:i,height:o,side:c},C)),v]}))});const F$=KT(function(e){const{colDef:t,columnMenuOpen:n,colIndex:r,headerHeight:o,isResizing:i,isLast:a,sortDirection:l,sortIndex:c,filterItemsCounter:u,hasFocus:d,tabIndex:p,disableReorder:h,separatorSide:m,showLeftBorder:g,showRightBorder:v,pinnedPosition:b,pinnedOffset:y}=e,w=mL(),x=rP(),S=um(),C=s.useRef(null),k=mm(),E=mm(),R=s.useRef(null),[P,M]=s.useState(n),T=!x.disableColumnReorder&&!h&&!t.disableReorder;let I;t.renderHeader&&(I=t.renderHeader(w.current.getColumnHeaderParams(t.field)));const O=(e=>{const{disableColumnSorting:t}=rP(),{colDef:n,classes:r,isDragging:o,sortDirection:i,showRightBorder:a,showLeftBorder:l,filterItemsCounter:s,pinnedPosition:c,isSiblingFocused:u}=e,d=n.sortable&&!t,p=null!=i,f=null!=s&&s>0,h="number"===n.type;return wm({root:["columnHeader","left"===n.headerAlign&&"columnHeader--alignLeft","center"===n.headerAlign&&"columnHeader--alignCenter","right"===n.headerAlign&&"columnHeader--alignRight",d&&"columnHeader--sortable",o&&"columnHeader--moving",p&&"columnHeader--sorted",f&&"columnHeader--filtered",h&&"columnHeader--numeric","withBorderColor",a&&"columnHeader--withRightBorder",l&&"columnHeader--withLeftBorder",c===nD.LEFT&&"columnHeader--pinnedLeft",c===nD.RIGHT&&"columnHeader--pinnedRight",u&&"columnHeader--siblingFocused"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]},YT,r)})(f({},e,{classes:x.classes,showRightBorder:v,showLeftBorder:g})),D=s.useCallback(e=>n=>{v$(n)||w.current.publishEvent(e,w.current.getColumnHeaderParams(t.field),n)},[w,t.field]),F=s.useMemo(()=>({onClick:D("columnHeaderClick"),onContextMenu:D("columnHeaderContextMenu"),onDoubleClick:D("columnHeaderDoubleClick"),onMouseOver:D("columnHeaderOver"),onMouseOut:D("columnHeaderOut"),onMouseEnter:D("columnHeaderEnter"),onMouseLeave:D("columnHeaderLeave"),onKeyDown:D("columnHeaderKeyDown"),onFocus:D("columnHeaderFocus"),onBlur:D("columnHeaderBlur")}),[D]),L=s.useMemo(()=>T?{onDragStart:D("columnHeaderDragStart"),onDragEnter:D("columnHeaderDragEnter"),onDragOver:D("columnHeaderDragOver"),onDragEndCapture:D("columnHeaderDragEnd")}:{},[T,D]),A=s.useMemo(()=>({onMouseDown:D("columnSeparatorMouseDown"),onDoubleClick:D("columnSeparatorDoubleClick")}),[D]);s.useEffect(()=>{!P&&n&&M(n)},[P,n]);const N=s.useCallback(()=>{M(!1)},[]),$=!x.disableColumnMenu&&!t.disableColumnMenu&&Xp.jsx(p$,{colDef:t,columnMenuId:k,columnMenuButtonId:E,open:P,iconButtonRef:R}),z=Xp.jsx(f$,{columnMenuId:k,columnMenuButtonId:E,field:t.field,open:n,target:R.current,ContentComponent:x.slots.columnMenu,contentComponentProps:x.slotProps?.columnMenu,onExited:N}),j=t.sortingOrder??x.sortingOrder,B=(t.sortable||null!=l)&&!t.hideSortIcons&&!x.disableColumnSorting,_=Xp.jsxs(s.Fragment,{children:[!x.disableColumnFilter&&Xp.jsx(x.slots.columnHeaderFilterIconButton,f({field:t.field,counter:u},x.slotProps?.columnHeaderFilterIconButton)),B&&Xp.jsx(x.slots.columnHeaderSortIcon,f({field:t.field,direction:l,index:c,sortingOrder:j,disabled:!t.sortable},x.slotProps?.columnHeaderSortIcon))]});s.useLayoutEffect(()=>{const e=w.current.state.columnMenu;if(d&&!e.open){const e=C.current.querySelector('[tabindex="0"]')||C.current;if(!e)return;if(CN())e.focus({preventScroll:!0});else{const t=w.current.getScrollPosition();e.focus(),w.current.scroll(t)}}},[w,d]);const H="function"==typeof t.headerClassName?t.headerClassName({field:t.field,colDef:t}):t.headerClassName,V=t.headerName??t.field,W=s.useMemo(()=>EN(f({},e.style),S,b,y),[b,y,e.style,S]);return Xp.jsx(D$,f({ref:C,classes:O,columnMenuOpen:n,colIndex:r,height:o,isResizing:i,sortDirection:l,hasFocus:d,tabIndex:p,separatorSide:m,isDraggable:T,headerComponent:I,description:t.description,elementId:t.field,width:t.computedWidth,columnMenuIconButton:$,columnTitleIconButtons:_,headerClassName:PR(H,a&&XT["columnHeader--last"]),label:V,resizable:!x.disableColumnResize&&!!t.resizable,"data-field":t.field,columnMenu:z,draggableContainerProps:L,columnHeaderSeparatorProps:A,style:W},F))}),L$=["className"],A$=jh("div",{name:"MuiDataGrid",slot:"IconButtonContainer"})(()=>({display:"flex",visibility:"hidden",width:0})),N$=TR(function(e,t){const{className:n}=e,r=d(e,L$),o=rP(),i=(e=>{const{classes:t}=e;return wm({root:["iconButtonContainer"]},YT,t)})(o);return Xp.jsx(A$,f({className:PR(i.root,n),ownerState:o},r,{ref:t}))}),$$=["direction","index","sortingOrder","disabled","className"],z$=jh(gI,{name:"MuiDataGrid",slot:"SortButton"})({transition:bP.transition(["opacity"],{duration:bP.transitions.duration.short,easing:bP.transitions.easing.easeInOut})});function j$(e){const{direction:t,index:n,sortingOrder:r,disabled:o,className:i}=e,a=d(e,$$),l=lP(),c=rP(),u=f({},e,{classes:c.classes}),p=(e=>{const{classes:t}=e;return wm({root:["sortButton"],icon:["sortIcon"]},YT,t)})(u),h=function(e,t,n,r){let o;const i={};return"asc"===t?o=e.columnSortedAscendingIcon:"desc"===t?o=e.columnSortedDescendingIcon:(o=e.columnUnsortedIcon,i.sortingOrder=r),o?Xp.jsx(o,f({fontSize:"small",className:n},i)):null}(c.slots,t,p.icon,r);if(!h)return null;const m=Xp.jsx(z$,f({as:c.slots.baseIconButton,ownerState:u,"aria-label":l.current.getLocaleText("columnHeaderSortIconLabel"),title:l.current.getLocaleText("columnHeaderSortIconLabel"),size:"small",disabled:o,className:PR(p.root,i)},c.slotProps?.baseIconButton,a,{children:h}));return Xp.jsxs(s.Fragment,{children:[null!=n&&Xp.jsx(c.slots.baseBadge,{badgeContent:n,color:"default",overlap:"circular",children:m}),null==n&&m]})}function B$(e){return Xp.jsx(N$,{children:Xp.jsx(j$,f({},e,{tabIndex:-1}))})}const _$=s.memo(B$);function H$(e){const{counter:t,field:n,onClick:r}=e,o=lP(),i=rP(),a=(e=>{const{classes:t}=e;return wm({icon:["filterIcon"]},YT,t)})(f({},e,{classes:i.classes})),l=mm(),c=pI(o,qL,l),u=mm(),d=s.useCallback(e=>{e.preventDefault(),e.stopPropagation();const{open:t,openedPanelValue:i}=KL(o);t&&i===YL.filters?o.current.hideFilterPanel():o.current.showFilterPanel(void 0,u,l),r&&r(o.current.getColumnHeaderParams(n),e)},[o,n,r,u,l]);if(!t)return null;const p=Xp.jsx(i.slots.baseIconButton,f({id:l,onClick:d,"aria-label":o.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":c,"aria-controls":c?u:void 0},i.slotProps?.baseIconButton,{children:Xp.jsx(i.slots.columnFilteredIcon,{className:a.icon,fontSize:"small"})}));return Xp.jsx(i.slots.baseTooltip,f({title:o.current.getLocaleText("columnHeaderFiltersTooltipActive")(t),enterDelay:1e3},i.slotProps?.baseTooltip,{children:Xp.jsxs(N$,{children:[t>1&&Xp.jsx(i.slots.baseBadge,{badgeContent:t,color:"default",children:p}),1===t&&p]})}))}const V$=["hideMenu","colDef","id","labelledby","className","children","open"],W$=pg(gI)(()=>({minWidth:248}));function U$(e){e.currentTarget.contains(e.target)&&e.stopPropagation()}const G$=TR(function(e,t){const{hideMenu:n,id:r,labelledby:o,className:i,children:a,open:l}=e,c=d(e,V$),u=rP(),p=s.useCallback(e=>{"Tab"===e.key&&e.preventDefault(),NO(e.key)&&n(e)},[n]);return Xp.jsx(W$,f({as:u.slots.baseMenuList,id:r,className:PR(XT.menuList,i),"aria-labelledby":o,onKeyDown:p,onWheel:U$,onTouchMove:U$,autoFocus:l},c,{ref:t,children:a}))}),K$=["displayOrder"];function q$(e){const{colDef:t,onClick:n}=e,r=lP(),o=rP(),i=1===cO(r).filter(e=>!0!==e.disableColumnMenu).length,a=s.useCallback(e=>{i||(r.current.setColumnVisibility(t.field,!1),n(e))},[r,t.field,n,i]);return o.disableColumnSelector||!1===t.hideable?null:Xp.jsx(o.slots.baseMenuItem,{onClick:a,disabled:i,iconStart:Xp.jsx(o.slots.columnMenuHideIcon,{fontSize:"small"}),children:r.current.getLocaleText("columnMenuHideColumn")})}function Y$(e){const{onClick:t}=e,n=lP(),r=rP(),o=s.useCallback(e=>{t(e),n.current.showPreferences(YL.columns)},[n,t]);return r.disableColumnSelector?null:Xp.jsx(r.slots.baseMenuItem,{onClick:o,iconStart:Xp.jsx(r.slots.columnMenuManageColumnsIcon,{fontSize:"small"}),children:n.current.getLocaleText("columnMenuManageColumns")})}const X$=["defaultSlots","defaultSlotProps","slots","slotProps"],Q$={columnMenuSortItem:function(e){const{colDef:t,onClick:n}=e,r=lP(),o=pI(r,gD),i=rP(),a=s.useMemo(()=>{if(!t)return null;const e=o.find(e=>e.field===t.field);return e?.sort},[t,o]),l=t.sortingOrder??i.sortingOrder,c=s.useCallback(e=>{n(e);const o=e.currentTarget.getAttribute("data-value")||null,l="always"===i.multipleColumnsSortingMode;r.current.sortColumn(t.field,o===a?null:o,l)},[r,t,n,a,i.multipleColumnsSortingMode]);if(i.disableColumnSorting||!t||!t.sortable||!l.some(e=>!!e))return null;const u=e=>{const n=r.current.getLocaleText(e);return"function"==typeof n?n(t):n};return Xp.jsxs(s.Fragment,{children:[l.includes("asc")&&"asc"!==a?Xp.jsx(i.slots.baseMenuItem,{onClick:c,"data-value":"asc",iconStart:Xp.jsx(i.slots.columnMenuSortAscendingIcon,{fontSize:"small"}),children:u("columnMenuSortAsc")}):null,l.includes("desc")&&"desc"!==a?Xp.jsx(i.slots.baseMenuItem,{onClick:c,"data-value":"desc",iconStart:Xp.jsx(i.slots.columnMenuSortDescendingIcon,{fontSize:"small"}),children:u("columnMenuSortDesc")}):null,l.includes(null)&&null!=a?Xp.jsx(i.slots.baseMenuItem,{onClick:c,iconStart:i.slots.columnMenuUnsortIcon?Xp.jsx(i.slots.columnMenuUnsortIcon,{fontSize:"small"}):Xp.jsx("span",{}),children:r.current.getLocaleText("columnMenuUnsort")}):null]})},columnMenuFilterItem:function(e){const{colDef:t,onClick:n}=e,r=lP(),o=rP(),i=s.useCallback(e=>{n(e),r.current.showFilterPanel(t.field)},[r,t.field,n]);return o.disableColumnFilter||!t.filterable?null:Xp.jsx(o.slots.baseMenuItem,{onClick:i,iconStart:Xp.jsx(o.slots.columnMenuFilterIcon,{fontSize:"small"}),children:r.current.getLocaleText("columnMenuFilter")})},columnMenuColumnsItem:function(e){return Xp.jsxs(s.Fragment,{children:[Xp.jsx(q$,f({},e)),Xp.jsx(Y$,f({},e))]})}},Z$={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},J$=TR(function(e,t){const{defaultSlots:n,defaultSlotProps:r,slots:o,slotProps:i}=e,a=d(e,X$),l=(e=>{const t=mL(),n=rP(),{defaultSlots:r,defaultSlotProps:o,slots:i={},slotProps:a={},hideMenu:l,colDef:c,addDividers:u=!0}=e,p=s.useMemo(()=>f({},r,i),[r,i]),h=s.useMemo(()=>{if(!a||0===Object.keys(a).length)return o;const e=f({},a);return Object.entries(o).forEach(([t,n])=>{e[t]=f({},n,a[t]||{})}),e},[o,a]),m=t.current.unstable_applyPipeProcessors("columnMenu",[],e.colDef),g=s.useMemo(()=>{const e=Object.keys(r);return Object.keys(i).filter(t=>!e.includes(t))},[i,r]);return s.useMemo(()=>{const e=Array.from(new Set([...m,...g])).filter(e=>null!=p[e]),t=e.sort((e,t)=>{const n=h[e],r=h[t];return(Number.isFinite(n?.displayOrder)?n.displayOrder:100)-(Number.isFinite(r?.displayOrder)?r.displayOrder:100)});return t.reduce((e,r,o)=>{let i={colDef:c,onClick:l};const a=h[r];return a&&(i=f({},i,d(a,K$))),u&&o!==t.length-1?[...e,[p[r],i],[n.slots.baseDivider,{}]]:[...e,[p[r],i]]},[])},[u,c,m,l,p,h,g,n.slots.baseDivider])})(f({},a,{defaultSlots:n,defaultSlotProps:r,slots:o,slotProps:i}));return Xp.jsx(G$,f({},a,{ref:t,children:l.map(([e,t],n)=>Xp.jsx(e,f({},t),n))}))}),ez=TR(function(e,t){return Xp.jsx(J$,f({},e,{ref:t,defaultSlots:Q$,defaultSlotProps:Z$}))}),tz=["className"],nz=pg("div",{name:"MuiDataGrid",slot:"PanelWrapper"})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),rz=TR(function(e,t){const{className:n}=e,r=d(e,tz),o=rP(),i=(e=>{const{classes:t}=e;return wm({root:["panelWrapper"]},YT,t)})(o);return Xp.jsx(nz,f({tabIndex:-1,className:PR(i.root,n),ownerState:o},r,{ref:t}))});const oz=["children","className","classes","onClose"],iz=Mh("MuiDataGrid",["panel","paper"]),az=pg(gI,{name:"MuiDataGrid",slot:"panel"})({zIndex:bP.zIndex.panel}),lz=pg("div",{name:"MuiDataGrid",slot:"panelContent"})({backgroundColor:bP.colors.background.overlay,borderRadius:bP.radius.base,boxShadow:bP.shadows.overlay,display:"flex",maxWidth:`calc(100vw - ${bP.spacing(2)})`,overflow:"auto"}),sz=TR((e,t)=>{const{children:n,className:r,onClose:o}=e,i=d(e,oz),a=lP(),l=rP(),c=iz,[u,p]=s.useState(!1),h=_O(),m=Mg(()=>p(!0)),g=Mg(()=>p(!1)),v=Mg(()=>{o?.()}),b=Mg(e=>{"Escape"===e.key&&o?.()}),[y,w]=s.useState(null);return s.useEffect(()=>{const e=a.current.rootElementRef?.current?.querySelector('[data-id="gridPanelAnchor"]');e&&w(e)},[a]),y?Xp.jsx(az,f({as:l.slots.basePopper,ownerState:l,placement:"bottom-end",className:PR(c.panel,r,h),flip:!0,onDidShow:m,onDidHide:g,onClickAway:v,clickAwayMouseEvent:"onPointerUp",clickAwayTouchEvent:!1,focusTrap:!0},i,l.slotProps?.basePopper,{target:e.target??y,ref:t,children:Xp.jsx(lz,{className:c.paper,ownerState:l,onKeyDown:b,children:u&&n})})):null}),cz=["className"],uz=jh("div",{name:"MuiDataGrid",slot:"PanelContent"})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400,padding:bP.spacing(2.5,1.5,2,1),gap:bP.spacing(2.5)});function dz(e){const{className:t}=e,n=d(e,cz),r=rP(),o=(e=>{const{classes:t}=e;return wm({root:["panelContent"]},YT,t)})(r);return Xp.jsx(uz,f({className:PR(o.root,t),ownerState:r},n))}const pz=["className"],fz=pg("div",{name:"MuiDataGrid",slot:"PanelFooter"})({padding:bP.spacing(1),display:"flex",justifyContent:"space-between",borderTop:`1px solid ${bP.colors.border.base}`});function hz(e){const{className:t}=e,n=d(e,pz),r=rP(),o=(e=>{const{classes:t}=e;return wm({root:["panelFooter"]},YT,t)})(r);return Xp.jsx(fz,f({className:PR(o.root,t),ownerState:r},n))}const mz=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","readOnly","children"],gz=["InputComponentProps"],vz=pg("div",{name:"MuiDataGrid",slot:"FilterForm"})({display:"flex",gap:bP.spacing(1.5)}),bz=pg("div",{name:"MuiDataGrid",slot:"FilterFormDeleteIcon"})({flexShrink:0,display:"flex",justifyContent:"center",alignItems:"center"}),yz=pg("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput"})({minWidth:75,justifyContent:"end"}),wz=pg("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput"})({width:150}),xz=pg("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput"})({width:150}),Sz=pg("div",{name:"MuiDataGrid",slot:"FilterFormValueInput"})({width:190}),Cz=e=>e.headerName||e.field,kz=new Intl.Collator,Ez=TR(function(e,t){const{item:n,hasMultipleFilters:r,deleteFilter:o,applyFilterChanges:i,showMultiFilterOperators:a,disableMultiFilterOperator:l,applyMultiFilterOperatorChanges:c,focusElementRef:u,logicOperators:p=[BI.And,BI.Or],columnsSort:h,filterColumns:m,deleteIconProps:g={},logicOperatorInputProps:v={},operatorInputProps:b={},columnInputProps:y={},valueInputProps:w={},readOnly:x}=e,S=d(e,mz),C=lP(),k=pI(C,iO),E=pI(C,mO),R=pI(C,yD),P=mm(),M=mm(),T=mm(),I=mm(),O=rP(),D=(e=>{const{classes:t}=e;return wm({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},YT,t)})(O),F=s.useRef(null),L=s.useRef(null),A=R.logicOperator??BI.And,N=r&&p.length>0,$=(O.slotProps?.baseSelect||{}).native??!1,z=O.slotProps?.baseSelectOption||{},{InputComponentProps:j}=w,B=d(w,gz),_=pI(C,SL),H=pI(C,kL),{filteredColumns:V,selectedField:W}=s.useMemo(()=>{let e=n.field;const t=!1===k[n.field].filterable?k[n.field]:null;if(t)return{filteredColumns:[t],selectedField:e};if(_)return{filteredColumns:E.filter(e=>void 0!==H.get(e.field)),selectedField:e};if(void 0===m||"function"!=typeof m)return{filteredColumns:E,selectedField:e};const r=m({field:n.field,columns:E,currentFilters:R?.items||[]});return{filteredColumns:E.filter(t=>{const o=r.includes(t.field);return t.field!==n.field||o||(e=void 0),o}),selectedField:e}},[n.field,k,_,m,E,R?.items,H]),U=s.useMemo(()=>{switch(h){case"asc":return V.sort((e,t)=>kz.compare(Cz(e),Cz(t)));case"desc":return V.sort((e,t)=>-kz.compare(Cz(e),Cz(t)));default:return V}},[V,h]),G=n.field?C.current.getColumn(n.field):null,K=s.useMemo(()=>n.operator&&G?G.filterOperators?.find(e=>e.value===n.operator):null,[n,G]),q=s.useCallback(e=>{const t=e.target.value,r=C.current.getColumn(t);if(r.field===G.field)return;const o=r.filterOperators.find(e=>e.value===n.operator)||r.filterOperators[0];let a=!o.InputComponent||o.InputComponent!==K?.InputComponent||r.type!==G.type?void 0:n.value;if("singleSelect"===r.type&&void 0!==a){const e=r,t=NF(e);Array.isArray(a)?a=a.filter(n=>void 0!==$F(n,t,e?.getOptionValue)):void 0===$F(n.value,t,e?.getOptionValue)&&(a=void 0)}i(f({},n,{field:t,operator:o.value,value:a}))},[C,i,n,G,K]),Y=s.useCallback(e=>{const t=e.target.value,r=G?.filterOperators.find(e=>e.value===t);i(f({},n,{operator:t,value:!r?.InputComponent||r?.InputComponent!==K?.InputComponent?void 0:n.value}))},[i,n,G,K]),X=s.useCallback(e=>{const t=e.target.value===BI.And.toString()?BI.And:BI.Or;c(t)},[c]);return s.useImperativeHandle(u,()=>({focus:()=>{K?.InputComponent?F?.current?.focus():L.current.focus()}}),[K]),Xp.jsxs(vz,f({className:D.root,"data-id":n.id,ownerState:O},S,{ref:t,children:[Xp.jsx(bz,f({},g,{className:PR(D.deleteIcon,g.className),ownerState:O,children:Xp.jsx(O.slots.baseIconButton,f({"aria-label":C.current.getLocaleText("filterPanelDeleteIconLabel"),title:C.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:()=>{o(n)},size:"small",disabled:x},O.slotProps?.baseIconButton,{children:Xp.jsx(O.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),Xp.jsx(yz,f({as:O.slots.baseSelect,sx:[N?{display:"flex"}:{display:"none"},a?{visibility:"visible"}:{visibility:"hidden"},v.sx],className:PR(D.logicOperatorInput,v.className),ownerState:O},v,{size:"small",slotProps:{htmlInput:{"aria-label":C.current.getLocaleText("filterPanelLogicOperator")}},value:A??"",onChange:X,disabled:!!l||1===p.length,native:$},O.slotProps?.baseSelect,{children:p.map(e=>s.createElement(O.slots.baseSelectOption,f({},z,{native:$,key:e.toString(),value:e.toString()}),C.current.getLocaleText((e=>{switch(e){case BI.And:return"filterPanelOperatorAnd";case BI.Or:return"filterPanelOperatorOr";default:throw new Error("MUI X: Invalid `logicOperator` property in the `GridFilterPanel`.")}})(e))))})),Xp.jsx(wz,f({as:O.slots.baseSelect},y,{className:PR(D.columnInput,y.className),ownerState:O,size:"small",labelId:M,id:P,label:C.current.getLocaleText("filterPanelColumns"),value:W??"",onChange:q,native:$,disabled:x},O.slotProps?.baseSelect,{children:U.map(e=>s.createElement(O.slots.baseSelectOption,f({},z,{native:$,key:e.field,value:e.field}),Cz(e)))})),Xp.jsx(xz,f({as:O.slots.baseSelect,size:"small"},b,{className:PR(D.operatorInput,b.className),ownerState:O,labelId:I,label:C.current.getLocaleText("filterPanelOperator"),id:T,value:n.operator,onChange:Y,native:$,inputRef:L,disabled:x},O.slotProps?.baseSelect,{children:G?.filterOperators?.map(e=>s.createElement(O.slots.baseSelectOption,f({},z,{native:$,key:e.value,value:e.value}),e.label||C.current.getLocaleText(`filterOperator${xf(e.value)}`)))})),Xp.jsx(Sz,f({},B,{className:PR(D.valueInput,B.className),ownerState:O,children:K?.InputComponent?Xp.jsx(K.InputComponent,f({apiRef:C,item:n,applyValue:i,focusElementRef:F,disabled:x,slotProps:{root:{size:"small"}}},K.InputComponentProps,j),n.field):null}))]}))}),Rz=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],Pz=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(1e5*Math.random())}),Mz=TR(function(e,t){const n=lP(),r=rP(),o=pI(n,yD),i=pI(n,mO),a=pI(n,gO),l=s.useRef(null),c=s.useRef(null),{logicOperators:u=[BI.And,BI.Or],columnsSort:p,filterFormProps:h,getColumnForNewFilter:m,disableAddFilterButton:g=!1,disableRemoveAllButton:v=!1}=e,b=d(e,Rz),y=n.current.upsertFilterItem,w=s.useCallback(e=>{n.current.setFilterLogicOperator(e)},[n]),x=s.useCallback(()=>{let e;if(m&&"function"==typeof m){const t=m({currentFilters:o?.items||[],columns:i});if(null===t)return null;e=i.find(({field:e})=>e===t)}else e=i.find(e=>e.filterOperators?.length);return e?Pz(e):null},[o?.items,i,m]),S=s.useCallback(()=>{if(void 0===m||"function"!=typeof m)return x();const e=o.items.length?o.items:[x()].filter(Boolean),t=m({currentFilters:e,columns:i});if(null===t)return null;const n=i.find(({field:e})=>e===t);return n?Pz(n):null},[o.items,i,m,x]),C=s.useMemo(()=>o.items.length?o.items:(c.current||(c.current=x()),c.current?[c.current]:[]),[o.items,x]),k=C.length>1,{readOnlyFilters:E,validFilters:R}=s.useMemo(()=>C.reduce((e,t)=>(a[t.field]?e.validFilters.push(t):e.readOnlyFilters.push(t),e),{readOnlyFilters:[],validFilters:[]}),[C,a]),P=s.useCallback(()=>{const e=S();e&&n.current.upsertFilterItems([...C,e])},[n,S,C]),M=s.useCallback(e=>{const t=1===R.length;n.current.deleteFilterItem(e),t&&n.current.hideFilterPanel()},[n,R.length]),T=s.useCallback(()=>1===R.length&&void 0===R[0].value?(n.current.deleteFilterItem(R[0]),n.current.hideFilterPanel()):n.current.setFilterModel(f({},o,{items:E}),"removeAllFilterItems"),[n,E,o,R]);return s.useEffect(()=>{u.length>0&&o.logicOperator&&!u.includes(o.logicOperator)&&w(u[0])},[u,w,o.logicOperator]),s.useEffect(()=>{R.length>0&&l.current.focus()},[R.length]),Xp.jsxs(rz,f({},b,{ref:t,children:[Xp.jsxs(dz,{children:[E.map((e,t)=>Xp.jsx(Ez,f({item:e,applyFilterChanges:y,deleteFilter:M,hasMultipleFilters:k,showMultiFilterOperators:t>0,disableMultiFilterOperator:1!==t,applyMultiFilterOperatorChanges:w,focusElementRef:null,readOnly:!0,logicOperators:u,columnsSort:p},h),null==e.id?t:e.id)),R.map((e,t)=>Xp.jsx(Ez,f({item:e,applyFilterChanges:y,deleteFilter:M,hasMultipleFilters:k,showMultiFilterOperators:E.length+t>0,disableMultiFilterOperator:E.length+t!==1,applyMultiFilterOperatorChanges:w,focusElementRef:t===R.length-1?l:null,logicOperators:u,columnsSort:p},h),null==e.id?t+E.length:e.id))]}),r.disableMultipleColumnsFiltering||g&&v?null:Xp.jsxs(hz,{children:[g?Xp.jsx("span",{}):Xp.jsx(r.slots.baseButton,f({onClick:P,startIcon:Xp.jsx(r.slots.filterPanelAddIcon,{})},r.slotProps?.baseButton,{children:n.current.getLocaleText("filterPanelAddFilter")})),!v&&R.length>0?Xp.jsx(r.slots.baseButton,f({onClick:T,startIcon:Xp.jsx(r.slots.filterPanelRemoveAllIcon,{})},r.slotProps?.baseButton,{children:n.current.getLocaleText("filterPanelRemoveAll")})):null]})]}))}),Tz=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1,Iz=["children"],Oz=zp({from:{opacity:0},to:{opacity:1}}),Dz=zp({"from, to":{"--scrollable":'" "'}}),Fz=jh("div",{name:"MuiDataGrid",slot:"ShadowScrollArea"})`
214
214
  flex: 1;
215
215
  display: flex;
216
216
  flex-direction: column;
@@ -254,4 +254,4 @@ var _BYGD_NC_REPORT_UI=function(){"use strict";function e(e,t){return t.forEach(
254
254
  animation-direction: reverse;
255
255
  animation-range: calc(100% - 4px) 100%;
256
256
  }
257
- `,Lz=TR(function(e,t){const{children:n}=e,r=d(e,Iz);return Xp.jsx(Fz,f({},r,{ref:t,children:n}))}),Az=new Intl.Collator;const Nz=pg("div",{name:"MuiDataGrid",slot:"ColumnsManagement"})({display:"flex",flexDirection:"column",padding:bP.spacing(.5,1.5)}),$z=pg(Lz,{name:"MuiDataGrid",slot:"ColumnsManagementScrollArea"})({maxHeight:300}),zz=pg("div",{name:"MuiDataGrid",slot:"ColumnsManagementHeader"})({padding:bP.spacing(1.5,2),borderBottom:`1px solid ${bP.colors.border.base}`}),jz=pg(gI,{name:"MuiDataGrid",slot:"ColumnsManagementSearchInput"})({[`& .${Yy.input}::-webkit-search-decoration,\n & .${Yy.input}::-webkit-search-cancel-button,\n & .${Yy.input}::-webkit-search-results-button,\n & .${Yy.input}::-webkit-search-results-decoration`]:{display:"none"}}),Bz=pg("div",{name:"MuiDataGrid",slot:"ColumnsManagementFooter"})({padding:bP.spacing(1,1,1,1.5),display:"flex",justifyContent:"space-between",borderTop:`1px solid ${bP.colors.border.base}`}),_z=pg("div",{name:"MuiDataGrid",slot:"ColumnsManagementEmptyText"})({padding:bP.spacing(1,0),alignSelf:"center",font:bP.typography.font.body}),Hz=pg(gI,{name:"MuiDataGrid",slot:"ColumnsManagementRow"})({}),Vz=TR(function(e,t){const{children:n,slotProps:r={}}=e,o=r.button||{},i=r.tooltip||{},a=lP(),l=rP(),c=mm(),u=mm(),[d,p]=s.useState(!1),h=s.useRef(null),m=Tg(t,h),g=()=>p(!1);return null==n?null:Xp.jsxs(s.Fragment,{children:[Xp.jsx(l.slots.baseTooltip,f({title:a.current.getLocaleText("toolbarExportLabel"),enterDelay:1e3},l.slotProps?.baseTooltip,i,{children:Xp.jsx(l.slots.baseButton,f({size:"small",startIcon:Xp.jsx(l.slots.exportIcon,{}),"aria-expanded":d,"aria-label":a.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-controls":d?u:void 0,id:c},l.slotProps?.baseButton,o,{onClick:e=>{p(e=>!e),o.onClick?.(e)},ref:m,children:a.current.getLocaleText("toolbarExport")}))})),Xp.jsx(UO,{open:d,target:h.current,onClose:g,position:"bottom-end",children:Xp.jsx(l.slots.baseMenuList,{id:u,className:XT.menuList,"aria-labelledby":c,autoFocusItem:d,children:s.Children.map(n,e=>s.isValidElement(e)?s.cloneElement(e,{hideMenu:g}):e)})})]})}),Wz=["hideMenu","options"],Uz=["hideMenu","options"],Gz=["csvOptions","printOptions","excelOptions"];function Kz(e){const t=lP(),n=rP(),{hideMenu:r,options:o}=e,i=d(e,Wz);return Xp.jsx(n.slots.baseMenuItem,f({onClick:()=>{t.current.exportDataAsCsv(o),r?.()}},i,{children:t.current.getLocaleText("toolbarExportCSV")}))}function qz(e){const t=lP(),n=rP(),{hideMenu:r,options:o}=e,i=d(e,Uz);return Xp.jsx(n.slots.baseMenuItem,f({onClick:()=>{t.current.exportDataAsPrint(o),r?.()}},i,{children:t.current.getLocaleText("toolbarExportPrint")}))}TR(function(e,t){const n=e,{csvOptions:r={},printOptions:o={},excelOptions:i}=n,a=d(n,Gz),l=lP().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:i,csvOptions:r,printOptions:o}).sort((e,t)=>e.componentName>t.componentName?1:-1);return 0===l.length?null:Xp.jsx(Vz,f({},a,{ref:t,children:l.map((e,t)=>s.cloneElement(e.component,{key:t}))}))});const Yz=s.createContext(void 0);function Xz(){const e=s.useContext(Yz);if(void 0===e)throw new Error("MUI X: Missing context. Quick Filter subcomponents must be placed within a <QuickFilter /> component.");return e}const Qz=["render","className","parser","formatter","debounceMs","defaultExpanded","expanded","onExpandedChange"],Zz=e=>e.split(" ").filter(e=>""!==e),Jz=e=>e.join(" ");function ej(e){const t=rP(),{render:n,className:r,parser:o=Zz,formatter:i=Jz,debounceMs:a=t.filterDebounceMs,defaultExpanded:l,expanded:c,onExpandedChange:u}=e,p=d(e,Qz),h=lP(),m=s.useRef(null),g=s.useRef(null),v=pI(h,wD),[b,y]=s.useState(i(v??[])),[w,x]=s.useState(l??b.length>0),S=c??w,C=s.useMemo(()=>({value:b,expanded:S}),[b,S]),k="function"==typeof r?r(C):r,E=s.useRef(null),R=mm(),P=s.useCallback(e=>{u&&u(e),void 0===c&&x(e)},[u,c]),M=s.useRef(v);s.useEffect(()=>{JL(M.current,v)||(M.current=v,y(e=>JL(o(e),v)?e:i(v??[])))},[v,i,o]);const T=s.useRef(!0),I=s.useRef(S);s.useEffect(()=>{T.current?T.current=!1:I.current!==S&&(S?requestAnimationFrame(()=>{m.current?.focus({preventScroll:!0})}):g.current?.focus({preventScroll:!0}),I.current=S)},[S]);const O=s.useMemo(()=>Cg(e=>{const t=o(e);M.current=t,h.current.setQuickFilterValues(t)},a),[h,a,o]);s.useEffect(()=>O.clear,[O]);const D=s.useCallback(e=>{const t=e.target.value;y(t),O(t)},[O]),F=s.useCallback(()=>{y(""),h.current.setQuickFilterValues([]),m.current?.focus()},[h,m]),L=s.useMemo(()=>({controlRef:m,triggerRef:g,state:C,controlId:R,clearValue:F,onValueChange:D,onExpandedChange:P}),[R,C,D,F,P]);Wh(()=>{E.current&&g.current&&E.current.style.setProperty("--trigger-width",`${g.current?.offsetWidth}px`)},[]);const A=o$("div",n,f({className:k},p,{ref:E}),C);return Xp.jsx(Yz.Provider,{value:L,children:A})}const tj=["render","className","slotProps","onKeyDown","onChange"],nj=TR(function(e,t){const{render:n,className:r,slotProps:o,onKeyDown:i,onChange:a}=e,l=d(e,tj),c=rP(),{state:u,controlId:p,controlRef:h,onValueChange:m,onExpandedChange:g,clearValue:v}=Xz(),b="function"==typeof r?r(u):r,y=Tg(h,t),w=o$(c.slots.baseTextField,n,f({},c.slotProps?.baseTextField,{slotProps:f({htmlInput:f({role:"searchbox",id:p,tabIndex:u.expanded?void 0:-1},o?.htmlInput,{onBlur:e=>{""===u.value&&g(!1),o?.htmlInput?.onBlur?.(e)}})},o),value:u.value,className:b},l,{onChange:e=>{u.expanded||g(!0),m(e),a?.(e)},onKeyDown:e=>{"Escape"===e.key&&(""===u.value?g(!1):v()),i?.(e)},ref:y}),u);return Xp.jsx(s.Fragment,{children:w})}),rj=["render","className","onClick"],oj=TR(function(e,t){const{render:n,className:r,onClick:o}=e,i=d(e,rj),a=rP(),{state:l,clearValue:c}=Xz(),u="function"==typeof r?r(l):r,p=o$(a.slots.baseIconButton,n,f({},a.slotProps?.baseIconButton,{className:u,tabIndex:-1},i,{onClick:e=>{c(),o?.(e)},ref:t}),l);return Xp.jsx(s.Fragment,{children:p})}),ij=["render","className","onClick"],aj=TR(function(e,t){const{render:n,className:r,onClick:o}=e,i=d(e,ij),a=rP(),{state:l,controlId:c,onExpandedChange:u,triggerRef:p}=Xz(),h="function"==typeof r?r(l):r,m=Tg(p,t),g=o$(a.slots.baseButton,n,f({},a.slotProps?.baseButton,{className:h,"aria-controls":c,"aria-expanded":l.expanded},i,{onClick:e=>{u(!l.expanded),o?.(e)},ref:m}),l);return Xp.jsx(s.Fragment,{children:g})}),lj=["quickFilterParser","quickFilterFormatter","debounceMs","className","slotProps"],sj=["ref","slotProps"],cj=jh("div",{name:"MuiDataGrid",slot:"ToolbarQuickFilter"})({display:"grid",alignItems:"center"}),uj=jh(d$,{name:"MuiDataGrid",slot:"ToolbarQuickFilterTrigger"})(({ownerState:e})=>({gridArea:"1 / 1",width:"min-content",height:"min-content",zIndex:1,opacity:e.expanded?0:1,pointerEvents:e.expanded?"none":"auto",transition:bP.transition(["opacity"])})),dj=jh(e=>{throw new Error("Failed assertion: should not be rendered")},{name:"MuiDataGrid",slot:"ToolbarQuickFilterControl"})(({ownerState:e})=>({gridArea:"1 / 1",overflowX:"clip",width:e.expanded?260:"var(--trigger-width)",opacity:e.expanded?1:0,transition:bP.transition(["width","opacity"])}));function pj(e){const t=lP(),n=rP(),r={classes:n.classes,expanded:!1},o=(e=>{const{classes:t}=e;return wm({root:["toolbarQuickFilter"],trigger:["toolbarQuickFilterTrigger"],control:["toolbarQuickFilterControl"]},YT,t)})(r),{quickFilterParser:i,quickFilterFormatter:a,debounceMs:l,className:s,slotProps:c}=e,u=d(e,lj);return Xp.jsx(ej,{parser:i,formatter:a,debounceMs:l,render:(e,i)=>{const a=f({},r,{expanded:i.expanded});return Xp.jsxs(cj,f({},e,{className:PR(o.root,s),children:[Xp.jsx(aj,{render:e=>Xp.jsx(n.slots.baseTooltip,{title:t.current.getLocaleText("toolbarQuickFilterLabel"),enterDelay:0,children:Xp.jsx(uj,f({className:o.trigger},e,{ownerState:a,color:"default","aria-disabled":i.expanded,children:Xp.jsx(n.slots.quickFilterIcon,{fontSize:"small"})}))})}),Xp.jsx(nj,{render:e=>{let{ref:r,slotProps:i}=e,l=d(e,sj);return Xp.jsx(dj,f({as:n.slots.baseTextField,className:o.control,ownerState:a,inputRef:r,"aria-label":t.current.getLocaleText("toolbarQuickFilterLabel"),placeholder:t.current.getLocaleText("toolbarQuickFilterPlaceholder"),size:"small",slotProps:f({input:f({startAdornment:Xp.jsx(n.slots.quickFilterIcon,{fontSize:"small"}),endAdornment:l.value?Xp.jsx(oj,{render:Xp.jsx(n.slots.baseIconButton,{size:"small",edge:"end","aria-label":t.current.getLocaleText("toolbarQuickFilterDeleteIconLabel"),children:Xp.jsx(n.slots.quickFilterClearIcon,{fontSize:"small"})})}):null},i?.input)},i)},n.slotProps?.baseTextField,l,c?.root,u))}})]}))}})}const fj=["render","className","onClick","onPointerUp"],hj=TR(function(e,t){const{render:n,className:r,onClick:o,onPointerUp:i}=e,a=d(e,fj),l=rP(),c=mm(),u=mm(),p=lP(),h=pI(p,KL),m=h.open&&h.openedPanelValue===YL.filters,g=pI(p,OD).length,v={open:m,filterCount:g},b="function"==typeof r?r(v):r,{filterPanelTriggerRef:y}=UN(),w=Tg(t,y),x=o$(l.slots.baseButton,n,f({},l.slotProps?.baseButton,{id:c,"aria-haspopup":"true","aria-expanded":m?"true":void 0,"aria-controls":m?u:void 0,onClick:e=>{m?p.current.hidePreferences():p.current.showPreferences(YL.filters,u,c),o?.(e)},onPointerUp:e=>{m&&e.stopPropagation(),i?.(e)},className:b},a,{ref:w}),v);return Xp.jsx(s.Fragment,{children:x})}),mj=["render","className","onClick","onPointerUp"],gj=TR(function(e,t){const{render:n,className:r,onClick:o,onPointerUp:i}=e,a=d(e,mj),l=rP(),c=mm(),u=mm(),p=lP(),h=pI(p,KL),m=h.open&&h.openedPanelValue===YL.columns,g={open:m},v="function"==typeof r?r(g):r,{columnsPanelTriggerRef:b}=UN(),y=Tg(t,b),w=o$(l.slots.baseButton,n,f({},l.slotProps?.baseButton,{id:c,"aria-haspopup":"true","aria-expanded":m?"true":void 0,"aria-controls":m?u:void 0,className:v},a,{onPointerUp:e=>{m&&e.stopPropagation(),i?.(e)},onClick:e=>{m?p.current.hidePreferences():p.current.showPreferences(YL.columns,u,c),o?.(e)},ref:y}),g);return Xp.jsx(s.Fragment,{children:w})}),vj=["render","options","onClick"],bj=TR(function(e,t){const{render:n,options:r,onClick:o}=e,i=d(e,vj),a=rP(),l=lP(),c=o$(a.slots.baseButton,n,f({},a.slotProps?.baseButton,{onClick:e=>{l.current.exportDataAsCsv(r),o?.(e)}},i,{ref:t}));return Xp.jsx(s.Fragment,{children:c})}),yj=["render","options","onClick"],wj=TR(function(e,t){const{render:n,options:r,onClick:o}=e,i=d(e,yj),a=rP(),l=lP(),c=o$(a.slots.baseButton,n,f({},a.slotProps?.baseButton,{onClick:e=>{l.current.exportDataAsPrint(r),o?.(e)}},i,{ref:t}));return Xp.jsx(s.Fragment,{children:c})}),xj=["className"],Sj=["className"],Cj=["showQuickFilter","quickFilterProps","csvOptions","printOptions","additionalItems","additionalExportMenuItems"],kj=e=>{const{classes:t}=e;return wm({divider:["toolbarDivider"],label:["toolbarLabel"]},YT,t)},Ej=jh(gI,{name:"MuiDataGrid",slot:"ToolbarDivider"})({height:"50%",margin:bP.spacing(0,.5)}),Rj=jh("span",{name:"MuiDataGrid",slot:"ToolbarLabel"})({flex:1,font:bP.typography.font.large,fontWeight:bP.typography.fontWeight.medium,margin:bP.spacing(0,.5),textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"});function Pj(e){const t=d(e,xj),n=rP(),r=kj(n);return Xp.jsx(Ej,f({as:n.slots.baseDivider,orientation:"vertical",className:r.divider},t))}function Mj(e){const t=d(e,Sj),n=rP(),r=kj(n);return Xp.jsx(Rj,f({className:r.label},t))}const Tj=["className","selectedRowCount"],Ij=jh("div",{name:"MuiDataGrid",slot:"SelectedRowCount"})({alignItems:"center",display:"flex",margin:bP.spacing(0,2),visibility:"hidden",width:0,height:0,[bP.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}}),Oj=TR(function(e,t){const{className:n,selectedRowCount:r}=e,o=d(e,Tj),i=lP(),a=rP(),l=(e=>{const{classes:t}=e;return wm({root:["selectedRowCount"]},YT,t)})(a),s=i.current.getLocaleText("footerRowSelected")(r);return Xp.jsx(Ij,f({className:PR(l.root,n),ownerState:a},o,{ref:t,children:s}))}),Dj=TR(function(e,t){const n=lP(),r=rP(),o=pI(n,yT),i=pI(n,ND),a=pI(n,TD),l=!r.hideFooterSelectedRowCount&&i>0?Xp.jsx(Oj,{selectedRowCount:i}):Xp.jsx("div",{}),s=r.hideFooterRowCount||r.pagination?null:Xp.jsx(r.slots.footerRowCount,f({},r.slotProps?.footerRowCount,{rowCount:o,visibleRowCount:a})),c=r.pagination&&!r.hideFooterPagination&&r.slots.pagination&&Xp.jsx(r.slots.pagination,f({},r.slotProps?.pagination));return Xp.jsxs(e$,f({},e,{ref:t,children:[l,s,c]}))}),Fj=(e,t,n,r,o,i)=>{let a;switch(e){case nD.LEFT:a=r[n];break;case nD.RIGHT:a=o-r[n]-t+i;break;default:a=void 0}return Number.isNaN(a)&&(a=void 0),a},Lj=(e,t,n,r,o,i)=>{const a=t===n-1;return!(!i?.startsWith("border")||e!==nD.LEFT||!a)||!!r&&(e===nD.LEFT||(e===nD.RIGHT?!a:!a||o))},Aj=(e,t,n,r)=>r?.startsWith("border")?e===nD.RIGHT&&0===t:n&&e===nD.RIGHT&&0===t,Nj=["skeletonRowsCount","visibleColumns","showFirstRowBorder"],$j=jh("div",{name:"MuiDataGrid",slot:"SkeletonLoadingOverlay"})({minWidth:"100%",width:"max-content",height:"100%",overflow:"clip"}),zj=e=>parseInt(e.getAttribute("data-colindex"),10),jj=TR(function(e,t){const n=rP(),{slots:r}=n,o=um(),i=(e=>{const{classes:t}=e;return wm({root:["skeletonLoadingOverlay"]},YT,t)})({classes:n.classes}),a=s.useRef(null),l=Tg(a,t),c=lP(),u=pI(c,oT),p=pI(c,iT),h=pI(c,hO),m=s.useMemo(()=>h.filter(e=>e<=p).length,[p,h]),{skeletonRowsCount:g,visibleColumns:v,showFirstRowBorder:b}=e,y=d(e,Nj),w=pI(c,cO),x=s.useMemo(()=>w.slice(0,m),[w,m]),S=pI(c,pO),C=s.useCallback(e=>-1!==S.left.findIndex(t=>t.field===e)?nD.LEFT:-1!==S.right.findIndex(t=>t.field===e)?nD.RIGHT:void 0,[S.left,S.right]),k=s.useMemo(()=>{const e=[];for(let t=0;t<g;t+=1){const i=[];for(let e=0;e<x.length;e+=1){const a=x[e],l=C(a.field),s=l===nD.LEFT,c=l===nD.RIGHT,d=kN(l,o),p=d?S[d].length:x.length-S.left.length-S.right.length,m=d?S[d].findIndex(e=>e.field===a.field):e-S.left.length,g=u.hasScrollY?u.scrollbarSize:0,b=EN({},o,l,Fj(l,a.computedWidth,e,h,u.columnsTotalWidth,g)),y=u.columnsTotalWidth<u.viewportOuterSize.width,w=Lj(l,m,p,n.showCellVerticalBorder,y,n.pinnedColumnsSectionSeparator),k=Aj(l,m,n.showCellVerticalBorder,n.pinnedColumnsSectionSeparator),E=c&&0===m,R=E&&y,P=e===x.length-1&&!E&&y,M=u.viewportOuterSize.width-u.columnsTotalWidth,T=Math.max(0,M),I=Xp.jsx(r.skeletonCell,{width:T,empty:!0},`skeleton-filler-column-${t}`);R&&i.push(I),i.push(Xp.jsx(r.skeletonCell,{field:a.field,type:a.type,align:a.align,width:"var(--width)",height:u.rowHeight,"data-colindex":e,empty:v&&!v.has(a.field),className:PR(s&&XT["cell--pinnedLeft"],c&&XT["cell--pinnedRight"],w&&XT["cell--withRightBorder"],k&&XT["cell--withLeftBorder"]),style:f({"--width":`${a.computedWidth}px`},b)},`skeleton-column-${t}-${a.field}`)),P&&i.push(I)}e.push(Xp.jsx("div",{className:PR(XT.row,XT.rowSkeleton,0===t&&!b&&XT["row--firstVisible"]),children:i},`skeleton-row-${t}`))}return e},[g,x,C,o,S,u.hasScrollY,u.scrollbarSize,u.columnsTotalWidth,u.viewportOuterSize.width,u.rowHeight,h,n.showCellVerticalBorder,n.pinnedColumnsSectionSeparator,r,v,b]);return rI(c,"columnResize",e=>{const{colDef:t,width:n}=e,r=a.current?.querySelectorAll(`[data-field="${m$(t.field)}"]`);if(!r)throw new Error("MUI X: Expected skeleton cells to be defined with `data-field` attribute.");const o=x.findIndex(e=>e.field===t.field),i=C(t.field),l=i===nD.LEFT,s=i===nD.RIGHT,c=getComputedStyle(r[0]).getPropertyValue("--width"),u=parseInt(c,10)-n;if(r&&r.forEach(e=>{e.style.setProperty("--width",`${n}px`)}),l){const e=a.current?.querySelectorAll(`.${XT["cell--pinnedLeft"]}`);e?.forEach(e=>{zj(e)>o&&(e.style.left=parseInt(getComputedStyle(e).left,10)-u+"px")})}if(s){const e=a.current?.querySelectorAll(`.${XT["cell--pinnedRight"]}`);e?.forEach(e=>{zj(e)<o&&(e.style.right=`${parseInt(getComputedStyle(e).right,10)+u}px`)})}}),Xp.jsx($j,f({className:i.root},y,{ref:l,children:k}))}),Bj=TR(function(e,t){const n=pI(lP(),oT),r=n?.viewportInnerSize.height??0,o=Math.ceil(r/n.rowHeight);return Xp.jsx(jj,f({},e,{skeletonRowsCount:o,ref:t}))}),_j=["variant","noRowsVariant","style"],Hj={"circular-progress":{component:e=>e.slots.baseCircularProgress,style:{}},"linear-progress":{component:e=>e.slots.baseLinearProgress,style:{display:"block"}},skeleton:{component:()=>Bj,style:{display:"block"}}},Vj=TR(function(e,t){const{variant:n="linear-progress",noRowsVariant:r="skeleton",style:o}=e,i=d(e,_j),a=lP(),l=rP(),s=pI(a,vT),c=Hj[0===s?r:n],u=c.component(l);return Xp.jsx(r$,f({style:f({},c.style,o)},i,{ref:t,children:Xp.jsx(u,{})}))}),Wj=TR(function(e,t){const n=lP().current.getLocaleText("noRowsLabel");return Xp.jsx(r$,f({},e,{ref:t,children:n}))}),Uj=TR(function(e,t){const n=rP(),r=lP(),o=pI(r,oO),i=!n.disableColumnSelector&&o.length>0;return Xp.jsxs(r$,f({},e,{ref:t,children:[r.current.getLocaleText("noColumnsOverlayLabel"),i&&Xp.jsx(n.slots.baseButton,f({size:"small"},n.slotProps?.baseButton,{onClick:()=>{r.current.showPreferences(YL.columns)},children:r.current.getLocaleText("noColumnsOverlayManageColumns")}))]}))}),Gj=pg(gI)({maxHeight:"calc(100% + 1px)",flexGrow:1});const Kj=["className","rowCount","visibleRowCount"],qj=jh("div",{name:"MuiDataGrid",slot:"RowCount"})({alignItems:"center",display:"flex",margin:bP.spacing(0,2)}),Yj=TR(function(e,t){const{className:n,rowCount:r,visibleRowCount:o}=e,i=d(e,Kj),a=lP(),l=rP(),s=(e=>{const{classes:t}=e;return wm({root:["rowCount"]},YT,t)})(l);if(0===r)return null;const c=o<r?a.current.getLocaleText("footerTotalVisibleRows")(o,r):r.toLocaleString();return Xp.jsxs(qj,f({className:PR(s.root,n),ownerState:l},i,{ref:t,children:[a.current.getLocaleText("footerTotalRows")," ",c]}))});const Xj=nT(e=>e.rowReorder),Qj=eT(Xj,e=>e?.isActive??!1),Zj=eT(Xj,e=>e?.dropTarget??{rowId:null,position:null});eT(Zj,e=>e.rowId??null);const Jj=eT(Zj,(e,t)=>e.rowId===t?e.position:null);eT(Xj,e=>e?.draggedRowId??null);const eB=pg("div",{name:"MuiDataGrid",slot:"RowDragOverlay",shouldForwardProp:e=>Oh(e)&&"action"!==e})(({theme:e,action:t})=>f({position:"absolute",left:0,right:0,top:0,bottom:0,pointerEvents:"none",zIndex:1},"above"===t&&{"&::before":{pointerEvents:"none",content:'""',position:"absolute",top:0,left:0,right:0,height:"2px",backgroundColor:(e.vars||e).palette.primary.main}},"below"===t&&{"&::after":{pointerEvents:"none",content:'""',position:"absolute",bottom:"-2px",left:0,right:0,height:"2px",backgroundColor:(e.vars||e).palette.primary.main}},"inside"===t&&{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.1)`:tm(e.palette.primary.main,.1)})),tB=s.memo(function(e){const{rowId:t,className:n}=e,r=pI(mL(),Jj,t);return r?Xp.jsx(eB,{action:r,className:n}):null}),nB=["selected","rowId","row","index","style","rowHeight","className","visibleColumns","pinnedColumns","offsetLeft","columnsTotalWidth","firstColumnIndex","lastColumnIndex","focusedColumnIndex","isFirstVisible","isLastVisible","isNotVisible","showBottomBorder","scrollbarWidth","gridHasFiller","onClick","onDoubleClick","onMouseEnter","onMouseLeave","onMouseOut","onMouseOver"],rB=eT(WL,(e,{rowReordering:t,treeData:n})=>{if(!t||n)return!1;return!!pD(e)}),oB=TR(function(e,t){const{selected:n,rowId:r,row:o,index:i,style:a,rowHeight:l,className:c,visibleColumns:u,pinnedColumns:p,offsetLeft:h,columnsTotalWidth:m,firstColumnIndex:g,lastColumnIndex:v,focusedColumnIndex:b,isFirstVisible:y,isLastVisible:w,isNotVisible:x,showBottomBorder:S,scrollbarWidth:C,gridHasFiller:k,onClick:E,onDoubleClick:R,onMouseEnter:P,onMouseLeave:M,onMouseOut:T,onMouseOver:I}=e,O=d(e,nB),D=mL(),F=jO(),L=s.useRef(null),A=rP(),N=sN(D),$=pI(D,gD),z=pI(D,hO),j=A.rowReordering,B=A.treeData,_=pI(D,rB,{rowReordering:j,treeData:B}),H=pI(D,Qj),V=Tg(L,t),W=ST(D,r),U=pI(D,UL,{rowId:r,editMode:A.editMode}),G=A.editMode===$I.Row,K=void 0!==b,q=K&&b>=p.left.length&&b<g,Y=K&&b<u.length-p.right.length&&b>=v,X=function(e,t){return wm(t,YT,e)}(A.classes,{root:["row",n&&"selected",G&&"row--editable",U&&"row--editing",y&&"row--firstVisible",w&&"row--lastVisible",S&&"row--borderBottom","auto"===l&&"row--dynamicHeight"]}),Q=F.hooks.useGridRowAriaAttributes();s.useLayoutEffect(()=>{if(N.range){const e=D.current.getRowIndexRelativeToVisibleRows(r);void 0!==e&&D.current.unstable_setLastMeasuredRowIndex(e)}if(L.current&&"auto"===l)return D.current.observeRowHeight(L.current,r)},[D,N.range,l,r]);const Z=s.useCallback((e,t)=>n=>{v$(n)||D.current.getRow(r)&&(D.current.publishEvent(e,D.current.getRowParams(r),n),t&&t(n))},[D,r]),J=s.useCallback(e=>{const t=h$(e.target,XT.cell),n=t?.getAttribute("data-field");if(n){if(n===wF.field)return;if(n===tD)return;if("__reorder__"===n)return;if(D.current.getCellMode(r,n)===zI.Edit)return;const e=D.current.getColumn(n);if(e?.type===ZO)return}Z("rowClick",E)(e)},[D,E,Z,r]),{slots:ee,slotProps:te,disableColumnReorder:ne}=A,re=pI(D,()=>f({},D.current.getRowHeightEntry(r)),void 0,lI),oe=s.useMemo(()=>{if(x)return{opacity:0,width:0,height:0};const e=f({},a,{maxHeight:"auto"===l?"none":l,minHeight:l,"--height":"number"==typeof l?`${l}px`:l});if(re.spacingTop){e["border"===A.rowSpacingType?"borderTopWidth":"marginTop"]=re.spacingTop}if(re.spacingBottom){const t="border"===A.rowSpacingType?"borderBottomWidth":"marginBottom";let n=e[t];"number"!=typeof n&&(n=parseInt(n||"0",10)),n+=re.spacingBottom,e[t]=n}return e},[x,l,a,re.spacingTop,re.spacingBottom,A.rowSpacingType]);if(!W)return null;const ie=D.current.unstable_applyPipeProcessors("rowClassName",[],r),ae=Q(W,i);if("function"==typeof A.getRowClassName){const e=i-(N.range?.firstRowIndex||0),t=f({},D.current.getRowParams(r),{isFirstVisible:0===e,isLastVisible:e===N.rows.length-1,indexRelativeToCurrentPage:e});ie.push(A.getRowClassName(t))}const le=(e,t,n,i,a=nD.NONE)=>{const s=D.current.unstable_getCellColSpanInfo(r,n);if(s?.spannedByColSpan)return null;const c=s?.cellProps.width??e.computedWidth,u=s?.cellProps.colSpan??1,d=Fj(a,e.computedWidth,n,z,m,C);if("skeletonRow"===W.type)return Xp.jsx(ee.skeletonCell,{type:e.type,width:c,height:l,field:e.field,align:e.align},e.field);const p="__reorder__"===e.field,h=!(ne||e.disableReorder),g=_&&!$.length,v=!(h||p&&g||H),b=a===nD.VIRTUAL,y=Aj(a,t,A.showCellVerticalBorder,A.pinnedColumnsSectionSeparator),w=Lj(a,t,i,A.showCellVerticalBorder,k,A.pinnedColumnsSectionSeparator);return Xp.jsx(ee.cell,f({column:e,width:c,rowId:r,align:e.align||"left",colIndex:n,colSpan:u,disableDragEvents:v,isNotVisible:b,pinnedOffset:d,pinnedPosition:a,showLeftBorder:y,showRightBorder:w,row:o,rowNode:W},te?.cell),e.field)},se=p.left.map((e,t)=>le(e,t,t,p.left.length,nD.LEFT)),ce=p.right.map((e,t)=>{const n=u.length-p.right.length+t;return le(e,t,n,p.right.length,nD.RIGHT)}),ue=u.length-p.left.length-p.right.length,de=[];q&&de.push(le(u[b],b-p.left.length,b,ue,nD.VIRTUAL));for(let e=g;e<v;e+=1){const t=u[e],n=e-p.left.length;t&&de.push(le(t,n,e,ue))}Y&&de.push(le(u[b],b-p.left.length,b,ue,nD.VIRTUAL));const pe=o?{onClick:J,onDoubleClick:Z("rowDoubleClick",R),onMouseEnter:Z("rowMouseEnter",P),onMouseLeave:Z("rowMouseLeave",M),onMouseOut:Z("rowMouseOut",T),onMouseOver:Z("rowMouseOver",I)}:null;return Xp.jsxs("div",f({"data-id":r,"data-rowindex":i,role:"row",className:PR(...ie,X.root,c),style:oe},ae,pe,O,{ref:V,children:[se,Xp.jsx("div",{role:"presentation",className:XT.cellOffsetLeft,style:{width:h}}),de,Xp.jsx("div",{role:"presentation",className:PR(XT.cell,XT.cellEmpty)}),ce,Xp.jsx(tB,{rowId:r})]}))}),iB=KT(oB);function aB({privateApiRef:e,configuration:t,props:n,children:r}){const o=s.useRef(e.current.getPublicApi());return Xp.jsx(zO.Provider,{value:t,children:Xp.jsx(nP.Provider,{value:n,children:Xp.jsx(hL.Provider,{value:e,children:Xp.jsx(aP.Provider,{value:o,children:Xp.jsx(GN,{children:Xp.jsx(HO,{children:r})})})})})})}const lB=function(){try{const e="__some_random_key_you_are_not_going_to_use__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}()&&null!=window.localStorage.getItem("DEBUG"),sB=()=>{},cB={debug:sB,info:sB,warn:sB,error:sB},uB=["debug","info","warn","error"];function dB(e,t,n=console){const r=uB.indexOf(t);if(-1===r)throw new Error(`MUI X: Log level ${t} not recognized.`);return uB.reduce((t,o,i)=>(t[o]=i>=r?(...t)=>{const[r,...i]=t;n[o](`MUI X: ${e} - ${r}`,...i)}:sB,t),{})}let pB=function(e){return e.DataSource="dataSource",e.RowTree="rowTree",e}({});const fB=(e,t,n,r)=>{const o=s.useCallback(()=>{e.current.registerStrategyProcessor(t,n,r)},[e,r,n,t]);wL(()=>{o()});const i=s.useRef(!0);s.useEffect(()=>{i.current?i.current=!1:o()},[o])},hB="none",mB={dataSourceRowsUpdate:pB.DataSource,rowTreeCreation:pB.RowTree,filtering:pB.RowTree,sorting:pB.RowTree,visibleRowsLookupCreation:pB.RowTree},gB=(e,t)=>f({},e,{props:{listView:t.listView,getRowId:t.getRowId,isCellEditable:t.isCellEditable}}),vB=(e,t)=>{(e=>{const t=s.useRef(null),n=s.useRef(null),r=s.useRef(null),o=s.useRef(null),i=s.useRef(null),a=s.useRef(null);e.current.register("public",{rootElementRef:t}),e.current.register("private",{mainElementRef:n,virtualScrollerRef:r,virtualScrollbarVerticalRef:o,virtualScrollbarHorizontalRef:i,columnHeadersContainerRef:a})})(e),((e,t)=>{const n=s.useRef(!0);s.useEffect(()=>{n.current?n.current=!1:e.current.setState(e=>f({},e,{props:{listView:t.listView,getRowId:t.getRowId,isCellEditable:t.isCellEditable,isRowSelectable:t.isRowSelectable}}))},[e,t.listView,t.getRowId,t.isCellEditable,t.isRowSelectable])})(e,t),(e=>{const t=um();void 0===e.current.state.isRtl&&(e.current.state.isRtl=t);const n=s.useRef(!0);s.useEffect(()=>{n.current?n.current=!1:e.current.setState(e=>f({},e,{isRtl:t}))},[e,t])})(e),((e,t)=>{vL(e,{getLogger:s.useCallback(e=>lB?dB(e,"debug",t.logger):t.logLevel?dB(e,t.logLevel.toString(),t.logger):cB,[t.logLevel,t.logger])},"private")})(e,t),(e=>{const t=s.useRef({}),n=s.useCallback(e=>{t.current[e.stateId]=e},[]),r=s.useCallback((n,r)=>{let o;if(o="function"==typeof n?n(e.current.state):n,e.current.state===o)return!1;const i={current:{state:o}};let a=!1;const l=[];if(Object.keys(t.current).forEach(n=>{const r=t.current[n],o=r.stateSelector(e),s=r.stateSelector(i);s!==o&&(l.push({stateId:r.stateId,hasPropChanged:s!==r.propModel}),void 0!==r.propModel&&s!==r.propModel&&(a=!0))}),l.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${l[0].stateId}, therefore, you're not allowed to update ${l.map(e=>e.stateId).join(", ")} in the same transaction.`);if(a||(e.current.state=o,e.current.publishEvent("stateChange",o),e.current.store.update(o)),1===l.length){const{stateId:n,hasPropChanged:o}=l[0],s=t.current[n],c=s.stateSelector(i);s.propOnChange&&o&&s.propOnChange(c,{reason:r,api:e.current}),a||e.current.publishEvent(s.changeEvent,c,{reason:r})}return!a},[e]),o=s.useCallback((t,n,r)=>e.current.setState(e=>f({},e,{[t]:n(e[t])}),r),[e]),i={updateControlState:o,registerControlState:n};vL(e,{setState:r},"public"),vL(e,i,"private")})(e),(e=>{const t=s.useRef({}),n=s.useRef(!1),r=s.useCallback(e=>{!n.current&&e&&(n.current=!0,Object.values(e.appliers).forEach(e=>{e()}),n.current=!1)},[]),o=s.useCallback((e,n,r)=>{t.current[e]||(t.current[e]={processors:new Map,processorsAsArray:[],appliers:{},processorsUpdated:!1});const o=t.current[e];return o.processors.get(n)!==r&&(o.processors.set(n,r),o.processorsAsArray=Array.from(t.current[e].processors.values()).filter(e=>null!==e),o.processorsUpdated=!0),()=>{t.current[e].processors.set(n,null),t.current[e].processorsAsArray=Array.from(t.current[e].processors.values()).filter(e=>null!==e)}},[]),i=s.useCallback((e,n,r)=>(t.current[e]||(t.current[e]={processors:new Map,processorsAsArray:[],appliers:{},processorsUpdated:!1}),t.current[e].appliers[n]=r,()=>{const r=d(t.current[e].appliers,[n].map(T));t.current[e].appliers=r}),[]),a=s.useCallback(e=>{r(t.current[e])},[r]),l=s.useCallback(()=>{for(const e in t.current){if(!Object.prototype.hasOwnProperty.call(t.current,e))continue;const n=t.current[e];n.processorsUpdated&&(n.processorsUpdated=!1,r(n))}},[r]),c={unstable_applyPipeProcessors:s.useCallback((...e)=>{const[n,r,o]=e;if(!t.current[n])return r;const i=t.current[n].processorsAsArray;let a=r;for(let e=0;e<i.length;e+=1)a=i[e](a,o);return a},[])};vL(e,{registerPipeProcessor:o,registerPipeApplier:i,requestPipeProcessorsApplication:a,runAppliersForPendingProcessors:l},"private"),vL(e,c,"public")})(e),(e=>{const t=s.useRef(new Map),n=s.useRef({}),r=s.useCallback((t,r,o)=>{const i=()=>{const e=d(n.current[r],[t].map(T));n.current[r]=e};n.current[r]||(n.current[r]={});const a=n.current[r],l=a[t];return a[t]=o,l&&l!==o?(t===e.current.getActiveStrategy(mB[r])&&e.current.publishEvent("activeStrategyProcessorChange",r),i):i},[e]),o=s.useCallback((t,r)=>{const o=e.current.getActiveStrategy(mB[t]);if(null==o)throw new Error("Can't apply a strategy processor before defining an active strategy");const i=n.current[t];if(!i||!i[o])throw new Error(`No processor found for processor "${t}" on strategy "${o}"`);return(0,i[o])(r)},[e]),i=s.useCallback(e=>{const n=Array.from(t.current.entries()).find(([,t])=>t.group===e&&t.isAvailable());return n?.[0]??hB},[]),a=s.useCallback((n,r,o)=>{t.current.set(r,{group:n,isAvailable:o}),e.current.publishEvent("strategyAvailabilityChange")},[e]);vL(e,{registerStrategyProcessor:r,applyStrategyProcessor:o,getActiveStrategy:i,setStrategyAvailability:a},"private")})(e),((e,t)=>{const n=s.useCallback(e=>{if(null==t.localeText[e])throw new Error(`Missing translation for key ${e}.`);return t.localeText[e]},[t.localeText]);e.current.register("public",{getLocaleText:n})})(e,t),e.current.register("private",{rootProps:t})},bB=(e,t,n,r)=>{const o=s.useRef(r),i=s.useRef(!1);r!==o.current&&(i.current=!1,o.current=r),i.current||(t.current.state=e(t.current.state,n,t),i.current=!0)};function yB(e,t){if(null==e)return"";const n="string"==typeof e?e:`${e}`;if(t.shouldAppendQuotes||t.escapeFormulas){const e=n.replace(/"/g,'""');return t.escapeFormulas&&["=","+","-","@","\t","\r"].includes(e[0])?`"'${e}"`:[t.delimiter,"\n","\r",'"'].some(e=>n.includes(e))?`"${e}"`:e}return n}const wB=(e,t)=>{const{csvOptions:n,ignoreValueFormatter:r}=t;let o;if(r){const t=e.colDef.type;o="number"===t?String(e.value):"date"===t||"dateTime"===t?e.value?.toISOString():"function"==typeof e.value?.toString?e.value.toString():e.value}else o=e.formattedValue;return yB(o,n)};class xB{rowString="";isEmpty=!0;constructor(e){this.options=e}addValue(e){this.isEmpty||(this.rowString+=this.options.csvOptions.delimiter),"function"==typeof this.options.sanitizeCellValue?this.rowString+=this.options.sanitizeCellValue(e,this.options.csvOptions):this.rowString+=e,this.isEmpty=!1}getRowString(){return this.rowString}}function SB(e){const{columns:t,rowIds:n,csvOptions:r,ignoreValueFormatter:o,apiRef:i}=e,a=n.reduce((e,n)=>`${e}${(({id:e,columns:t,getCellParams:n,csvOptions:r,ignoreValueFormatter:o})=>{const i=new xB({csvOptions:r});return t.forEach(t=>{const a=n(e,t.field);String(a.formattedValue),i.addValue(wB(a,{ignoreValueFormatter:o,csvOptions:r}))}),i.getRowString()})({id:n,columns:t,getCellParams:i.current.getCellParams,ignoreValueFormatter:o,csvOptions:r})}\r\n`,"").trim();if(!r.includeHeaders)return a;const l=t.filter(e=>e.field!==wF.field),s=[];if(r.includeColumnGroupsHeaders){const e=i.current.getAllGroupDetails();let t=0;const n=l.reduce((e,n)=>{const r=i.current.getColumnGroupPath(n.field);return e[n.field]=r,t=Math.max(t,r.length),e},{});for(let o=0;o<t;o+=1){const t=new xB({csvOptions:r,sanitizeCellValue:yB});s.push(t),l.forEach(r=>{const i=(n[r.field]||[])[o],a=e[i];t.addValue(a?a.headerName||a.groupId:"")})}}const c=new xB({csvOptions:r,sanitizeCellValue:yB});l.forEach(e=>{c.addValue(e.headerName||e.field)}),s.push(c);return`${`${s.map(e=>e.getRowString()).join("\r\n")}\r\n`}${a}`.trim()}function CB(e){const t=document.createElement("span");t.style.whiteSpace="pre",t.style.userSelect="all",t.style.opacity="0px",t.textContent=e,document.body.appendChild(t);const n=document.createRange();n.selectNode(t);const r=window.getSelection();r.removeAllRanges(),r.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(t)}}const kB=(e,t)=>{const n=t.ignoreValueFormatterDuringExport,r=("object"==typeof n?n?.clipboardExport:n)||!1,o=t.clipboardCopyCellDelimiter,i=s.useCallback(t=>{if(!function(e){return(e.ctrlKey||e.metaKey)&&"C"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey}(t))return;if(n=t.target,window.getSelection()?.toString()||n&&(n.selectionEnd||0)-(n.selectionStart||0)>0)return;var n;let i="";if(ND(e)>0)i=e.current.getDataAsCsv({includeHeaders:!1,delimiter:o,shouldAppendQuotes:!1,escapeFormulas:!1});else{const t=YD(e);if(t){const n=e.current.getCellParams(t.id,t.field);i=wB(n,{csvOptions:{delimiter:o,shouldAppendQuotes:!1,escapeFormulas:!1},ignoreValueFormatter:r})}}var a;i=e.current.unstable_applyPipeProcessors("clipboardCopy",i),i&&(a=i,navigator.clipboard?navigator.clipboard.writeText(a).catch(()=>{CB(a)}):CB(a),e.current.publishEvent("clipboardCopy",i))},[e,r,o]);yL(e,()=>e.current.rootElementRef.current,"keydown",i),iI(e,"clipboardCopy",t.onClipboardCopy)},EB=e=>f({},e,{columnMenu:{open:!1}}),RB=(e,t,n)=>{n.current.caches.columns={lastColumnsProp:t.columns};return f({},e,{columns:aL({apiRef:n,columnsToUpsert:t.columns,initialState:t.initialState?.columns,columnVisibilityModel:t.columnVisibilityModel??t.initialState?.columns?.columnVisibilityModel??{},keepOnlyColumnsToUpsert:!0}),pinnedColumns:e.pinnedColumns??JI})};function PB(e,t){const n=bL(e,"useGridColumns");e.current.registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:lO,changeEvent:"columnVisibilityModelChange"});const r=s.useCallback(t=>{n.debug("Updating columns state."),e.current.setState(function(e){return t=>f({},t,{columns:e})}(t)),e.current.publishEvent("columnsChange",t.orderedFields)},[n,e]),o=s.useCallback(t=>iO(e)[t],[e]),i=s.useCallback(()=>aO(e),[e]),a=s.useCallback(()=>cO(e),[e]),l=s.useCallback((t,n=!0)=>(n?cO(e):aO(e)).findIndex(e=>e.field===t),[e]),c=s.useCallback(t=>{const n=l(t);return hO(e)[n]},[e,l]),u=s.useCallback(t=>{lO(e)!==t&&(e.current.setState(n=>f({},n,{columns:aL({apiRef:e,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:t,keepOnlyColumnsToUpsert:!1})})),e.current.updateRenderContext?.())},[e]),d=s.useCallback(t=>{let n=t;if(SL(e)){const r=[],o=[],i=kL(e);if(t.forEach(e=>{i.has(e.field)?r.push(e):o.push(e)}),r.length>0&&e.current.updateNonPivotColumns(r),0===o.length)return;n=o}const o=aL({apiRef:e,columnsToUpsert:n,initialState:void 0,keepOnlyColumnsToUpsert:!1,updateInitialVisibilityModel:!0});r(o)},[e,r]),p=s.useCallback((t,n)=>{const r=lO(e);if(n!==(r[t]??!0)){const o=f({},r,{[t]:n});e.current.setColumnVisibilityModel(o)}},[e]),h=s.useCallback(t=>oO(e).findIndex(e=>e===t),[e]),m=s.useCallback((t,o)=>{const i=oO(e),a=h(t);if(a===o)return;n.debug(`Moving column ${t} to index ${o}`);const l=[...i],s=l.splice(a,1)[0];l.splice(o,0,s),r(f({},rO(e),{orderedFields:l}));const c={column:e.current.getColumn(t),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(t),oldIndex:a};e.current.publishEvent("columnIndexChange",c)},[e,n,r,h]),g=s.useCallback((t,o)=>{n.debug(`Updating column ${t} width to ${o}`);const i=rO(e),a=f({},i.lookup[t],{width:o,hasBeenResized:!0});r(oL(f({},i,{lookup:f({},i.lookup,{[t]:a})}),e.current.getRootDimensions())),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(t),colDef:a,width:o})},[e,n,r]),v={setColumnIndex:m};vL(e,{getColumn:o,getAllColumns:i,getColumnIndex:l,getColumnPosition:c,getVisibleColumns:a,getColumnIndexRelativeToVisibleColumns:h,updateColumns:d,setColumnVisibilityModel:u,setColumnVisibility:p,setColumnWidth:g},"public"),vL(e,v,t.signature===QT.DataGrid?"private":"public");const b=s.useCallback((n,r)=>{const o={},i=lO(e);(!r.exportOnlyDirtyModels||null!=t.columnVisibilityModel||Object.keys(t.initialState?.columns?.columnVisibilityModel??{}).length>0||Object.keys(i).length>0)&&(o.columnVisibilityModel=i),o.orderedFields=oO(e);const a=aO(e),l={};return a.forEach(e=>{if(e.hasBeenResized){const t={};nL.forEach(n=>{let r=e[n];r===1/0&&(r=-1),t[n]=r}),l[e.field]=t}}),Object.keys(l).length>0&&(o.dimensions=l),f({},n,{columns:o})},[e,t.columnVisibilityModel,t.initialState?.columns]),y=s.useCallback((t,n)=>{const r=n.stateToRestore.columns,o=r?.columnVisibilityModel;if(null==r)return t;const i=aL({apiRef:e,columnsToUpsert:[],initialState:r,columnVisibilityModel:o,keepOnlyColumnsToUpsert:!1});return null!=r&&e.current.setState(e=>f({},e,{columns:f({},e.columns,{lookup:i.lookup,orderedFields:i.orderedFields,initialColumnVisibilityModel:i.initialColumnVisibilityModel})})),null!=o&&e.current.setState(e=>f({},e,{columns:f({},e.columns,{columnVisibilityModel:o})})),null!=r&&e.current.publishEvent("columnsChange",i.orderedFields),t},[e]),w=s.useCallback((e,n)=>{if(n===YL.columns){const e=t.slots.columnsPanel;return Xp.jsx(e,f({},t.slotProps?.columnsPanel))}return e},[t.slots.columnsPanel,t.slotProps?.columnsPanel]),x=s.useCallback(n=>{const r=SL(e);return t.disableColumnSelector||r?n:[...n,"columnMenuColumnsItem"]},[t.disableColumnSelector,e]);pN(e,"columnMenu",x),pN(e,"exportState",b),pN(e,"restoreState",y),pN(e,"preferencePanel",w);const S=s.useRef(null);rI(e,"viewportInnerSizeChange",t=>{if(S.current!==t.width){S.current=t.width;if(!cO(e).some(e=>e.flex&&e.flex>0))return;r(oL(rO(e),e.current.getRootDimensions()))}});const C=s.useCallback(()=>{n.info("Columns pipe processing have changed, regenerating the columns");const t=aL({apiRef:e,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1});r(t)},[e,n,r]);fN(e,"hydrateColumns",C),s.useEffect(()=>{if(e.current.caches.columns.lastColumnsProp===t.columns)return;e.current.caches.columns.lastColumnsProp=t.columns,n.info(`GridColumns have changed, new length ${t.columns.length}`);const o=aL({apiRef:e,initialState:void 0,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0,updateInitialVisibilityModel:!0,columnVisibilityModel:t.columnVisibilityModel});r(o)},[n,e,r,t.columns,t.columnVisibilityModel]),s.useEffect(()=>{void 0!==t.columnVisibilityModel&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,n,t.columnVisibilityModel])}const MB=(e,t)=>f({},e,{density:t.initialState?.density??t.density??"standard"});const TB=({apiRef:e,options:t})=>{const n=aO(e);if(t.fields)return t.fields.reduce((e,t)=>{const r=n.find(e=>e.field===t);return r&&e.push(r),e},[]);return(t.allColumns?n:cO(e)).filter(e=>!0!==e.disableExport)},IB=({apiRef:e})=>{const t=RD(e),n=xT(e),r=ND(e),o=t.filter(e=>"footer"!==n[e].type),i=TT(e),a=i?.top?.map(e=>e.id)||[],l=i?.bottom?.map(e=>e.id)||[];if(o.unshift(...a),o.push(...l),r>0){const t=$D(e);return o.filter(e=>t.has(e))}return o},OB=(e,t)=>{const n=bL(e,"useGridCsvExport"),r=t.ignoreValueFormatterDuringExport,o=("object"==typeof r?r?.csvExport:r)||!1,i=s.useCallback((t={})=>{n.debug("Get data as CSV");return SB({columns:TB({apiRef:e,options:t}),rowIds:(t.getRowsToExport??IB)({apiRef:e}),csvOptions:{delimiter:t.delimiter||",",shouldAppendQuotes:t.shouldAppendQuotes??!0,includeHeaders:t.includeHeaders??!0,includeColumnGroupsHeaders:t.includeColumnGroupsHeaders??!0,escapeFormulas:t.escapeFormulas??!0},ignoreValueFormatter:o,apiRef:e})},[n,e,o]),a=s.useCallback(e=>{n.debug("Export data as CSV");const t=i(e);!function(e,t="csv",n=document.title||"untitled"){const r=`${n}.${t}`;if("download"in HTMLAnchorElement.prototype){const t=URL.createObjectURL(e),n=document.createElement("a");return n.href=t,n.download=r,n.click(),void setTimeout(()=>{URL.revokeObjectURL(t)})}throw new Error("MUI X: exportAs not supported.")}(new Blob([e?.utf8WithBom?new Uint8Array([239,187,191]):"",t],{type:"text/csv"}),"csv",e?.fileName)},[n,i]);vL(e,{getDataAsCsv:i,exportDataAsCsv:a},"public");const l=s.useCallback((e,t)=>t.csvOptions?.disableToolbarButton?e:[...e,{component:Xp.jsx(Kz,{options:t.csvOptions}),componentName:"csvExport"}],[]);pN(e,"exportMenu",l)};const DB=(e,t,n)=>{let r=e.paginationModel;const o=e.rowCount,i=n?.pageSize??r.pageSize,a=n?.page??r.page,l=nF(o,i,a);!n||n?.page===r.page&&n?.pageSize===r.pageSize||(r=n);const s=-1===i?0:((e,t=0)=>0===t?e:Math.max(Math.min(e,t-1),0))(r.page,l);return s!==r.page&&(r=f({},r,{page:s})),oF(r.pageSize,t),r};const FB=(e,t)=>{const n=null!==e.current.rootElementRef.current,r=bL(e,"useGridPrintExport"),o=s.useRef(null),i=s.useRef(null),a=s.useRef({}),l=s.useRef([]),c=s.useRef(null);s.useEffect(()=>{o.current=kg(e.current.rootElementRef.current)},[e,n]);const u=s.useCallback((t,n,r)=>new Promise(o=>{const i=TB({apiRef:e,options:{fields:t,allColumns:n}}).map(e=>e.field),a=aO(e),l={};a.forEach(e=>{l[e.field]=i.includes(e.field)}),r&&(l[wF.field]=!0),e.current.setColumnVisibilityModel(l),o()}),[e]),d=s.useCallback(t=>{const n=t({apiRef:e}).reduce((t,n)=>{const r=e.current.getRow(n);return r[DT]||t.push(r),t},[]);e.current.setRows(n)},[e]),p=s.useCallback((t,n)=>{const r=f({copyStyles:!0,hideToolbar:!1,hideFooter:!1,includeCheckboxes:!1},n),i=t.contentDocument;if(!i)return;const a=e.current.rootElementRef.current,l=a.cloneNode(!0),s=l.querySelector(`.${XT.virtualScrollerContent}`);if(l.querySelector(`.${XT.main}`).style.overflow="visible",l.querySelector(`.${XT.virtualScrollerRenderZone}`).style.position="static",s.style.flexBasis="auto",l.querySelector(`.${XT["scrollbar--vertical"]}`)?.remove(),!(s.nextSibling instanceof HTMLElement&&s.nextSibling.classList.contains(XT.filler))){const e=document.createElement("div");e.style.height=XA,s.insertAdjacentElement("afterend",e)}const c=l.querySelector(`.${XT.footerContainer}`);r.hideToolbar&&l.querySelector(`.${XT.toolbar}`)?.remove(),r.hideFooter&&c&&c.remove(),l.style.height="auto",l.style.boxSizing="content-box",!r.hideFooter&&c&&(c.style.width="100%");const u=document.createElement("div");u.appendChild(l),i.body.style.marginTop="0px",i.body.innerHTML=u.innerHTML;const d="function"==typeof r.pageStyle?r.pageStyle():r.pageStyle;if("string"==typeof d){const e=i.createElement("style");e.appendChild(i.createTextNode(d)),i.head.appendChild(e)}r.bodyClassName&&i.body.classList.add(...r.bodyClassName.split(" "));let p=[];if(r.copyStyles){const e=a.getRootNode();p=function(e,t){const n=[],r=t.querySelectorAll("style, link[rel='stylesheet']");for(let t=0;t<r.length;t+=1){const o=r[t],i=e.createElement(o.tagName);if("STYLE"===o.tagName){const t=o.sheet;if(t){let n="";for(let e=0;e<t.cssRules.length;e+=1)"string"==typeof t.cssRules[e].cssText&&(n+=`${t.cssRules[e].cssText}\r\n`);i.appendChild(e.createTextNode(n))}}else if(o.getAttribute("href")){for(let e=0;e<o.attributes.length;e+=1){const t=o.attributes[e];t&&i.setAttribute(t.nodeName,t.nodeValue||"")}n.push(new Promise(e=>{i.addEventListener("load",()=>e())}))}e.head.appendChild(i)}return n}(i,"ShadowRoot"===e.constructor.name?e:o.current)}Promise.all(p).then(()=>{t.contentWindow.print()})},[e,o]),h=s.useCallback(t=>{o.current.body.removeChild(t),e.current.restoreState(i.current||{}),i.current?.columns?.columnVisibilityModel||e.current.setColumnVisibilityModel(a.current),e.current.setState(e=>f({},e,{virtualization:c.current})),e.current.setRows(l.current),i.current=null,a.current={},l.current=[]},[e]),m=s.useCallback(async n=>{if(r.debug("Export data as Print"),!e.current.rootElementRef.current)throw new Error("MUI X: No grid root element available.");if(i.current=e.current.exportState(),a.current=lO(e),l.current=e.current.getSortedRows().filter(e=>!e[DT]),t.pagination){const t={page:0,pageSize:MD(e)};e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{paginationModel:DB(e.pagination,"DataGridPro",t)})}))}c.current=e.current.state.virtualization,e.current.unstable_setVirtualization(!1),await u(n?.fields,n?.allColumns,n?.includeCheckboxes),d(n?.getRowsToExport??IB),await new Promise(e=>{requestAnimationFrame(()=>{e()})});const s=function(e){const t=document.createElement("iframe");return t.style.position="absolute",t.style.width="0px",t.style.height="0px",t.title=e||document.title,t}(n?.fileName);s.onload=()=>{p(s,n);s.contentWindow.matchMedia("print").addEventListener("change",e=>{!1===e.matches&&h(s)})},o.current.body.appendChild(s)},[t,r,e,p,h,u,d]);vL(e,{exportDataAsPrint:m},"public");const g=s.useCallback((e,t)=>t.printOptions?.disableToolbarButton?e:[...e,{component:Xp.jsx(qz,{options:t.printOptions}),componentName:"printExport"}],[]);pN(e,"exportMenu",g)},LB=(e,t,n)=>{const r=t.filterModel??t.initialState?.filter?.filterModel??XI();return f({},e,{filter:f({filterModel:wO(r,t.disableMultipleColumnsFiltering,n)},YI),visibleRowsLookup:{}})},AB=e=>e.filteredRowsLookup;function NB(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}function $B(){return PM(Object.values)}const zB=e=>f({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),jB=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(e<n)return e+1}else if(!r&&e>t)return e-1;return null},BB=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(e>t)return e-1}else if(!r&&e<n)return e+1;return null};const _B=tT(gF,TT,(e,t)=>(t.top||[]).concat(e.rows,t.bottom||[])),HB=(e,t)=>{const n=bL(e,"useGridKeyboardNavigation"),r=um(),o=s.useCallback(()=>_B(e),[e]),i="DataGrid"!==t.signature&&t.headerFilters,a=s.useCallback((t,r,o="left",i="up")=>{const a=CD(e),l=e.current.unstable_getCellColSpanInfo(r,t);l&&l.spannedByColSpan&&("left"===o?t=l.leftVisibleCellIndex:"right"===o&&(t=l.rightVisibleCellIndex));const s=uO(e)[t],c=function(e,t,n,r){const o=AA.selectors.hiddenCells(e.current.virtualizer.store.state);if(!o[t]?.[n])return t;const i=RD(e);let a=i.indexOf(t)+("down"===r?1:-1);for(;a>=0&&a<i.length;){const e=i[a];if(!o[e]?.[n])return e;a+="down"===r?1:-1}return t}(e,r,t,i),u=a.findIndex(e=>e.id===c);n.debug(`Navigating to cell row ${u}, col ${t}`),e.current.scrollToIndexes({colIndex:t,rowIndex:u}),e.current.setCellFocus(c,s)},[e,n]),l=s.useCallback((t,r)=>{n.debug(`Navigating to header col ${t}`),e.current.scrollToIndexes({colIndex:t});const o=e.current.getVisibleColumns()[t].field;e.current.setColumnHeaderFocus(o,r)},[e,n]),c=s.useCallback((t,r)=>{n.debug(`Navigating to header filter col ${t}`),e.current.scrollToIndexes({colIndex:t});const o=e.current.getVisibleColumns()[t].field;e.current.setColumnHeaderFilterFocus(o,r)},[e,n]),u=s.useCallback((t,r,o)=>{n.debug(`Navigating to header col ${t}`),e.current.scrollToIndexes({colIndex:t});const{field:i}=e.current.getVisibleColumns()[t];e.current.setColumnGroupHeaderFocus(i,r,o)},[e,n]),d=s.useCallback(e=>o()[e]?.id,[o]),p=s.useCallback((n,s)=>{const p=s.currentTarget.querySelector(`.${XT.columnHeaderTitleContainerContent}`);if(!!p&&p.contains(s.target)&&n.field!==wF.field)return;if(!AO(s.key)&&"Tab"!==s.key)return;if("Tab"===s.key&&("none"===t.tabNavigation||"content"===t.tabNavigation&&s.shiftKey))return;const f=o(),h=e.current.getViewportPageSize(),m=n.field?e.current.getColumnIndex(n.field):0,g=f.length>0?0:null,v=f.length>0?f.length-1:null,b=Math.max(0,cO(e).length-1),y=tL(e);let w=!0;if("Tab"!==s.key||"content"!==t.tabNavigation||s.shiftKey){switch(s.key){case"ArrowDown":i?c(m,s):null!==g&&a(m,d(g));break;case"ArrowRight":{const e=BB({currentColIndex:m,firstColIndex:0,lastColIndex:b,isRtl:r});null!==e&&l(e,s);break}case"ArrowLeft":{const e=jB({currentColIndex:m,firstColIndex:0,lastColIndex:b,isRtl:r});null!==e&&l(e,s);break}case"ArrowUp":y>0&&u(m,y-1,s);break;case"PageDown":null!==g&&null!==v&&a(m,d(Math.min(g+h,v)));break;case"Home":l(0,s);break;case"End":l(b,s);break;case"Enter":(s.ctrlKey||s.metaKey)&&e.current.toggleColumnMenu(n.field);break;case"Tab":s.shiftKey?0===m?y>0?u(b,y-1,s):w=!1:l(m-1,s):m===b?i?c(0,s):"all"===t.tabNavigation&&null!==g?a(0,d(g)):w=!1:l(m+1,s);break;case" ":break;default:w=!1}w&&s.preventDefault()}else null!==g&&(a(0,d(g)),s.preventDefault())},[e,t.tabNavigation,o,i,c,a,d,r,l,u]),f=s.useCallback((n,i)=>{const s=YF(e)===n.field;if(XF(e)===n.field||s&&"Tab"!==i.key)return;if(!AO(i.key)&&"Tab"!==i.key)return;if("Tab"===i.key&&("none"===t.tabNavigation||"content"===t.tabNavigation&&i.shiftKey))return;const u=o(),p=e.current.getViewportPageSize(),f=n.field?e.current.getColumnIndex(n.field):0,h=u.length>0?0:null,m=u.length>0?u.length-1:null,g=Math.max(0,cO(e).length-1);let v=!0;if("Tab"!==i.key||"content"!==t.tabNavigation||i.shiftKey){switch(i.key){case"ArrowDown":null!==h&&a(f,d(h));break;case"ArrowRight":{const e=BB({currentColIndex:f,firstColIndex:0,lastColIndex:g,isRtl:r});null!==e&&c(e,i);break}case"ArrowLeft":{const t=jB({currentColIndex:f,firstColIndex:0,lastColIndex:g,isRtl:r});null!==t?c(t,i):e.current.setColumnHeaderFilterFocus(n.field,i);break}case"ArrowUp":l(f,i);break;case"PageDown":null!==h&&null!==m&&a(f,d(Math.min(h+p,m)));break;case"Home":c(0,i);break;case"End":c(g,i);break;case"Tab":i.shiftKey?0===f?l(g,i):c(f-1,i):f===g?"all"===t.tabNavigation&&null!==h?a(0,d(h)):v=!1:c(f+1,i);break;case" ":break;default:v=!1}v&&i.preventDefault()}else null!==h&&(a(0,d(h)),i.preventDefault())},[e,t.tabNavigation,o,c,r,l,a,d]),h=s.useCallback((n,r)=>{const i=QD(e);if(null===i)return;const{field:s,depth:c}=i,{fields:p,depth:f,maxDepth:h}=n;if(!AO(r.key)&&"Tab"!==r.key)return;if("Tab"===r.key&&("none"===t.tabNavigation||"content"===t.tabNavigation&&r.shiftKey))return;const m=o(),g=e.current.getViewportPageSize(),v=e.current.getColumnIndex(s),b=s?e.current.getColumnIndex(s):0,y=m.length>0?0:null,w=m.length>0?m.length-1:null,x=Math.max(0,cO(e).length-1);let S=!0;if("Tab"!==r.key||"content"!==t.tabNavigation||r.shiftKey){switch(r.key){case"ArrowDown":f===h-1?l(v,r):u(v,c+1,r);break;case"ArrowUp":f>0&&u(v,c-1,r);break;case"ArrowRight":{const e=p.length-p.indexOf(s)-1;v+e+1<=x&&u(v+e+1,c,r);break}case"ArrowLeft":{const e=p.indexOf(s);v-e-1>=0&&u(v-e-1,c,r);break}case"PageDown":null!==y&&null!==w&&a(b,d(Math.min(y+g,w)));break;case"Home":u(0,c,r);break;case"End":u(x,c,r);break;case"Tab":if(r.shiftKey){const e=v-p.indexOf(s)-1;e<0?0===f?S=!1:u(x,c-1,r):u(e,c,r)}else{const e=v+(p.length-p.indexOf(s)-1)+1;e>x&&f===h-1?l(0,r):e>x?u(0,c+1,r):u(e,c,r)}break;case" ":break;default:S=!1}S&&r.preventDefault()}else null!==y&&(a(0,d(y)),r.preventDefault())},[e,t.tabNavigation,o,l,u,a,d]),m=s.useCallback((n,s)=>{if(v$(s))return;const u=e.current.getCellParams(n.id,n.field);if(u.cellMode===zI.Edit||!AO(s.key)&&"Tab"!==s.key)return;if("Tab"===s.key&&("none"===t.tabNavigation||"header"===t.tabNavigation&&!s.shiftKey))return;if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:s,cell:u}))return;const p=o();if(0===p.length)return;const f=i?c:l,h=e.current.getViewportPageSize(),m=n.field?e.current.getColumnIndex(n.field):0,g=p.findIndex(e=>e.id===n.id),v=p.length-1,b=Math.max(0,cO(e).length-1);let y=!0;if("Tab"===s.key&&"header"===t.tabNavigation&&s.shiftKey)return f(b,s),void s.preventDefault();switch(s.key){case"ArrowDown":g<v&&a(m,d(g+1),r?"right":"left","down");break;case"ArrowUp":g>0?a(m,d(g-1)):f(m,s);break;case"ArrowRight":{const e=BB({currentColIndex:m,firstColIndex:0,lastColIndex:b,isRtl:r});null!==e&&a(e,d(g),r?"left":"right");break}case"ArrowLeft":{const e=jB({currentColIndex:m,firstColIndex:0,lastColIndex:b,isRtl:r});null!==e&&a(e,d(g),r?"right":"left");break}case"Tab":s.shiftKey?0===m&&0===g?"all"===t.tabNavigation?f(b,s):y=!1:0===m?a(b,d(g-1)):a(m-1,d(g),"left"):m===b?g!==v?a(0,d(g+1)):y=!1:a(m+1,d(g),"right");break;case" ":{if(n.field===tD)break;const e=n.colDef;if(e&&("__tree_data_group__"===e.field||(e=>e===eD||null!==(e=>{const t=e.match(/^__row_group_by_columns_group_(.*)__$/);return t?t[1]:null})(e))(e.field)))break;!s.shiftKey&&g<v&&a(m,d(Math.min(g+h,v)));break}case"PageDown":g<v&&a(m,d(Math.min(g+h,v)));break;case"PageUp":{const e=Math.max(g-h,0);e!==g&&e>=0?a(m,d(e)):l(m,s);break}case"Home":s.ctrlKey||s.metaKey||s.shiftKey?a(0,d(0)):a(0,d(g));break;case"End":s.ctrlKey||s.metaKey||s.shiftKey?a(b,d(v)):a(b,d(g));break;default:y=!1}y&&s.preventDefault()},[e,t.tabNavigation,o,r,a,d,i,c,l]),g=s.useCallback((e,{event:t})=>" "!==t.key&&e,[]);pN(e,"canStartEditing",g),rI(e,"columnHeaderKeyDown",p),rI(e,"headerFilterKeyDown",f),rI(e,"columnGroupHeaderKeyDown",h),rI(e,"cellKeyDown",m)},VB=(e,t)=>{const n=f({},rF(t.autoPageSize),t.paginationModel??t.initialState?.pagination?.paginationModel);oF(n.pageSize,t.signature);const r=t.rowCount??t.initialState?.pagination?.rowCount??("client"===t.paginationMode?e.rows?.totalRowCount:void 0),o=t.paginationMeta??t.initialState?.pagination?.meta??{};return f({},e,{pagination:f({},e.pagination,{paginationModel:n,rowCount:r,meta:o,enabled:!0===t.pagination,paginationMode:t.paginationMode})})},WB=(e,t)=>{((e,t)=>{const n=bL(e,"useGridPaginationMeta");e.current.registerControlState({stateId:"paginationMeta",propModel:t.paginationMeta,propOnChange:t.onPaginationMetaChange,stateSelector:cF,changeEvent:"paginationMetaChange"});const r=s.useCallback(t=>{cF(e)!==t&&(n.debug("Setting 'paginationMeta' to",t),e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{meta:t})})))},[e,n]);vL(e,{setPaginationMeta:r},"public");const o=s.useCallback((n,r)=>{const o=cF(e);return r.exportOnlyDirtyModels&&null==t.paginationMeta&&null==t.initialState?.pagination?.meta?n:f({},n,{pagination:f({},n.pagination,{meta:o})})},[e,t.paginationMeta,t.initialState?.pagination?.meta]),i=s.useCallback((t,n)=>{const r=n.stateToRestore.pagination?.meta?n.stateToRestore.pagination.meta:cF(e);return e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{meta:r})})),t},[e]);pN(e,"exportState",o),pN(e,"restoreState",i),s.useEffect(()=>{t.paginationMeta&&e.current.setPaginationMeta(t.paginationMeta)},[e,t.paginationMeta])})(e,t),((e,t)=>{const n=bL(e,"useGridPaginationModel"),r=pI(e,mI),o=s.useRef(yD(e)),i=Math.floor(t.rowHeight*r);e.current.registerControlState({stateId:"paginationModel",propModel:t.paginationModel,propOnChange:t.onPaginationModelChange,stateSelector:lF,changeEvent:"paginationModelChange"});const a=s.useCallback(t=>{const r=lF(e);t!==r.page&&(n.debug(`Setting page to ${t}`),e.current.setPaginationModel({page:t,pageSize:r.pageSize}))},[e,n]),l=s.useMemo(()=>Cg(a,0),[a]),c=s.useCallback(t=>{const r=lF(e);t!==r.pageSize&&(n.debug(`Setting page size to ${t}`),e.current.setPaginationModel({pageSize:t,page:r.page}))},[e,n]),u=s.useCallback(r=>{const o=lF(e);r!==o&&(n.debug("Setting 'paginationModel' to",r),e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{paginationModel:DB(e.pagination,t.signature,r)})}),"setPaginationModel"))},[e,n,t.signature]);vL(e,{setPage:a,setPageSize:c,setPaginationModel:u},"public");const d=s.useCallback((n,r)=>{const o=lF(e);return!r.exportOnlyDirtyModels||null!=t.paginationModel||null!=t.initialState?.pagination?.paginationModel||0!==o.page&&o.pageSize!==(t.autoPageSize?0:100)?f({},n,{pagination:f({},n.pagination,{paginationModel:o})}):n},[e,t.paginationModel,t.initialState?.pagination?.paginationModel,t.autoPageSize]),p=s.useCallback((n,r)=>{const o=r.stateToRestore.pagination?.paginationModel?f({},rF(t.autoPageSize),r.stateToRestore.pagination?.paginationModel):lF(e);return e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{paginationModel:DB(e.pagination,t.signature,o)})}),"stateRestorePreProcessing"),n},[e,t.autoPageSize,t.signature]);pN(e,"exportState",d),pN(e,"restoreState",p);const h=s.useCallback(()=>{if(!t.autoPageSize)return;const n=e.current.getRootDimensions(),r=Math.max(1,Math.floor(n.viewportInnerSize.height/i));e.current.setPageSize(r)},[e,t.autoPageSize,i]),m=s.useCallback(t=>{if(null==t)return;const n=lF(e);if(0===n.page)return;const r=pF(e);n.page>r-1&&queueMicrotask(()=>{l(Math.max(0,r-1))})},[e,l]),g=s.useCallback(()=>{0!==lF(e).page&&l(0),0!==e.current.getScrollPosition().top&&e.current.scroll({top:0})},[e,l]),v=s.useMemo(()=>Cg(g,0),[g]),b=s.useCallback(t=>{const n=f({},t,{items:OD(e)});JL(n,o.current)||(o.current=n,v())},[e,v]);rI(e,"viewportInnerSizeChange",h),rI(e,"paginationModelChange",()=>{const t=lF(e);e.current.virtualScrollerRef?.current&&e.current.scrollToIndexes({rowIndex:t.page*t.pageSize})}),rI(e,"rowCountChange",m),rI(e,"sortModelChange",v),rI(e,"filterModelChange",b);const y=s.useRef(!0);s.useEffect(()=>{y.current?y.current=!1:t.pagination&&e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{paginationModel:DB(e.pagination,t.signature,t.paginationModel)})}))},[e,t.paginationModel,t.signature,t.pagination]),s.useEffect(()=>{e.current.setState(e=>{const n=!0===t.pagination;return e.pagination.paginationMode===t.paginationMode&&e.pagination.enabled===n?e:f({},e,{pagination:f({},e.pagination,{paginationMode:t.paginationMode,enabled:n})})})},[e,t.paginationMode,t.pagination]),s.useEffect(h,[h])})(e,t),((e,t)=>{const n=bL(e,"useGridRowCount"),r=Dg(()=>lF(e).pageSize);e.current.registerControlState({stateId:"paginationRowCount",propModel:t.rowCount,propOnChange:t.onRowCountChange,stateSelector:sF,changeEvent:"rowCountChange"});const o=s.useCallback(t=>{sF(e)!==t&&(n.debug("Setting 'rowCount' to",t),e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{rowCount:t})})))},[e,n]);vL(e,{setRowCount:o},"public");const i=s.useCallback((n,r)=>{const o=sF(e);return r.exportOnlyDirtyModels&&null==t.rowCount&&null==t.initialState?.pagination?.rowCount?n:f({},n,{pagination:f({},n.pagination,{rowCount:o})})},[e,t.rowCount,t.initialState?.pagination?.rowCount]),a=s.useCallback((t,n)=>{const r=n.stateToRestore.pagination?.rowCount?n.stateToRestore.pagination.rowCount:sF(e);return e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{rowCount:r})})),t},[e]);pN(e,"exportState",i),pN(e,"restoreState",a);const l=s.useCallback(n=>{"client"!==t.paginationMode&&r.current&&n.pageSize!==r.current&&(r.current=n.pageSize,-1===sF(e)&&e.current.setPage(0))},[t.paginationMode,r,e]);rI(e,"paginationModelChange",l),s.useEffect(()=>{"server"===t.paginationMode&&null!=t.rowCount&&e.current.setRowCount(t.rowCount)},[e,t.paginationMode,t.rowCount]),QM(e.current.store,()=>!(!1!==cF(e).hasNextPage)||("client"===t.paginationMode?TD(e):void 0),(t,n)=>{if(!0===n&&-1!==sF(e)){const t=TD(e),n=lF(e);e.current.setRowCount(n.pageSize*n.page+t)}else"number"==typeof n&&e.current.setRowCount(n)}),s.useEffect(()=>{"client"===t.paginationMode&&e.current.setRowCount(TD(e))},[e,t.paginationMode])})(e,t)},UB=(e,t)=>f({},e,{preferencePanel:t.initialState?.preferencePanel??{open:!1}}),GB=e=>{switch(e.type){case"boolean":return!1;case"date":case"dateTime":case"number":return;case"singleSelect":return null;default:return""}},KB=["id","field"],qB=["id","field"],YB=["id"],XB=["id"],QB=e=>f({},e,{editRows:{}}),ZB=(e,t,n)=>{((e,t)=>{const[n,r]=s.useState({}),o=s.useRef(n),i=s.useRef({}),{processRowUpdate:a,onProcessRowUpdateError:l,cellModesModel:c,onCellModesModelChange:u}=t,p=e=>(...n)=>{t.editMode===$I.Cell&&e(...n)},h=s.useCallback((t,n)=>{const r=e.current.getCellParams(t,n);if(!e.current.isCellEditable(r))throw new Error(`MUI X: The cell with id=${t} and field=${n} is not editable.`)},[e]),m=s.useCallback((t,n,r)=>{if(e.current.getCellMode(t,n)!==r)throw new Error(`MUI X: The cell with id=${t} and field=${n} is not in ${r} mode.`)},[e]),g=s.useCallback((t,n)=>{if(!t.isEditable)return;if(t.cellMode===zI.Edit)return;const r=f({},t,{reason:WI.cellDoubleClick});e.current.publishEvent("cellEditStart",r,n)},[e]),v=s.useCallback((t,n)=>{if(t.cellMode===zI.View)return;if(e.current.getCellMode(t.id,t.field)===zI.View)return;const r=f({},t,{reason:UI.cellFocusOut});e.current.publishEvent("cellEditStop",r,n)},[e]),b=s.useCallback((t,n)=>{if(t.cellMode===zI.Edit){if(229===n.which)return;let r;if("Escape"===n.key?r=UI.escapeKeyDown:"Enter"===n.key?r=UI.enterKeyDown:"Tab"===n.key&&(r=n.shiftKey?UI.shiftTabKeyDown:UI.tabKeyDown,n.preventDefault()),r){const o=f({},t,{reason:r});e.current.publishEvent("cellEditStop",o,n)}}else if(t.isEditable){let r;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:n,cellParams:t,editMode:"cell"}))return;if(LO(n)?r=WI.printableKeyDown:$O(n)?r=WI.pasteKeyDown:"Enter"===n.key?r=WI.enterKeyDown:"Backspace"!==n.key&&"Delete"!==n.key||(r=WI.deleteKeyDown),r){const o=f({},t,{reason:r,key:n.key});e.current.publishEvent("cellEditStart",o,n)}}},[e]),y=s.useCallback(t=>{const{id:n,field:r,reason:o}=t,i={id:n,field:r};o!==WI.printableKeyDown&&o!==WI.deleteKeyDown&&o!==WI.pasteKeyDown||(i.deleteValue=!0),e.current.startCellEditMode(i)},[e]),w=s.useCallback(t=>{const{id:n,field:r,reason:o}=t;let i;e.current.runPendingEditCellValueMutation(n,r),o===UI.enterKeyDown?i="below":o===UI.tabKeyDown?i="right":o===UI.shiftTabKeyDown&&(i="left");const a="escapeKeyDown"===o;e.current.stopCellEditMode({id:n,field:r,ignoreModifications:a,cellToFocusAfter:i})},[e]);var x;rI(e,"cellDoubleClick",p(g)),rI(e,"cellFocusOut",p(v)),rI(e,"cellKeyDown",p(b)),rI(e,"cellEditStart",p(y)),rI(e,"cellEditStop",p(w)),iI(e,"cellEditStart",t.onCellEditStart),iI(e,"cellEditStop",(x=t.onCellEditStop,async(...t)=>{if(x){const{id:n,field:r}=t[0],o=e.current.state.editRows,i=o[n][r]?.error;i||x(...t)}}));const S=s.useCallback((t,n)=>{const r=WL(e);return r[t]&&r[t][n]?zI.Edit:zI.View},[e]),C=Mg(n=>{const i=n!==t.cellModesModel;u&&i&&u(n,{api:e.current}),t.cellModesModel&&i||(r(n),o.current=n,e.current.publishEvent("cellModesModelChange",n))}),k=s.useCallback((e,t,n)=>{const r=f({},o.current);if(null!==n)r[e]=f({},r[e],{[t]:f({},n)});else{const n=d(r[e],[t].map(T));r[e]=n,0===Object.keys(r[e]).length&&delete r[e]}C(r)},[C]),E=s.useCallback((t,n,r)=>{e.current.setState(e=>{const o=f({},e.editRows);return null!==r?o[t]=f({},o[t],{[n]:f({},r)}):(delete o[t][n],0===Object.keys(o[t]).length&&delete o[t]),f({},e,{editRows:o})})},[e]),R=s.useCallback(e=>{const{id:t,field:n}=e,r=d(e,KB);h(t,n),m(t,n,zI.View),k(t,n,f({mode:zI.Edit},r))},[h,m,k]),P=Mg(async t=>{const{id:n,field:r,deleteValue:o,initialValue:i}=t,a=e.current.getCellValue(n,r);let l=a;o?l=GB(e.current.getColumn(r)):i&&(l=i);const s=e.current.getColumn(r),c=!!s.preProcessEditCellProps&&o;let u={value:l,error:!1,isProcessingProps:c};if(E(n,r,u),e.current.setCellFocus(n,r),c&&(u=await Promise.resolve(s.preProcessEditCellProps({id:n,row:e.current.getRow(n),props:u,hasChanged:l!==a})),e.current.getCellMode(n,r)===zI.Edit)){const t=WL(e);E(n,r,f({},u,{value:t[n][r].value,isProcessingProps:!1}))}}),M=s.useCallback(e=>{const{id:t,field:n}=e,r=d(e,qB);m(t,n,zI.Edit),k(t,n,f({mode:zI.View},r))},[m,k]),I=Mg(async n=>{const{id:r,field:o,ignoreModifications:s,cellToFocusAfter:c="none"}=n;m(r,o,zI.Edit),e.current.runPendingEditCellValueMutation(r,o);const u=()=>{E(r,o,null),k(r,o,null),"none"!==c&&e.current.moveFocusToRelativeCell(r,o,c)};if(s)return void u();const d=WL(e),{error:p,isProcessingProps:f}=d[r][o],h=e.current.getRow(r);if(p||f)return i.current[r][o].mode=zI.Edit,void k(r,o,{mode:zI.Edit});const g=e.current.getRowWithUpdatedValuesFromCellEditing(r,o);if(t.dataSource?.updateRow){if(JL(h,g))return void u();const t=()=>{i.current[r][o].mode=zI.Edit,k(r,o,{mode:zI.Edit})},n={rowId:r,updatedRow:g,previousRow:h};try{await e.current.dataSource.editRow(n),u()}catch{t()}}else if(a){const t=e=>{i.current[r][o].mode=zI.Edit,k(r,o,{mode:zI.Edit}),l&&l(e)};try{Promise.resolve(a(g,h,{rowId:r})).then(t=>{e.current.updateRows([t]),u()}).catch(t)}catch(e){t(e)}}else e.current.updateRows([g]),u()}),O=s.useCallback(async t=>{const{id:n,field:r,value:o,debounceMs:i,unstable_skipValueParser:a}=t;h(n,r),m(n,r,zI.Edit);const l=e.current.getColumn(r),s=e.current.getRow(n);let c=o;l.valueParser&&!a&&(c=l.valueParser(o,s,l,e));let u=WL(e),d=f({},u[n][r],{value:c,changeReason:i?"debouncedSetEditCellValue":"setEditCellValue"});if(l.preProcessEditCellProps){const e=o!==u[n][r].value;d=f({},d,{isProcessingProps:!0}),E(n,r,d),d=await Promise.resolve(l.preProcessEditCellProps({id:n,row:s,props:d,hasChanged:e}))}return e.current.getCellMode(n,r)!==zI.View&&(u=WL(e),d=f({},d,{isProcessingProps:!1}),d.value=l.preProcessEditCellProps?u[n][r].value:c,E(n,r,d),u=WL(e),!u[n]?.[r]?.error)},[e,h,m,E]),D=s.useCallback((t,n)=>{const r=e.current.getColumn(n),o=WL(e),i=e.current.getRow(t);if(!o[t]||!o[t][n])return e.current.getRow(t);const{value:a}=o[t][n];return r.valueSetter?r.valueSetter(a,i,r,e):f({},i,{[n]:a})},[e]),F={setCellEditingEditCellValue:O,getRowWithUpdatedValuesFromCellEditing:D};vL(e,{getCellMode:S,startCellEditMode:R,stopCellEditMode:M},"public"),vL(e,F,"private"),s.useEffect(()=>{c&&C(c)},[c,C]),Wh(()=>{const t=wT(e),r=i.current;i.current=LI(n),Object.entries(n).forEach(([n,o])=>{Object.entries(o).forEach(([o,i])=>{const a=r[n]?.[o]?.mode||zI.View,l=t[n]?e.current.getRowId(t[n]):n;i.mode===zI.Edit&&a===zI.View?P(f({id:l,field:o},i)):i.mode===zI.View&&a===zI.Edit&&I(f({id:l,field:o},i))})})},[e,n,P,I])})(e,t),((e,t)=>{const[n,r]=s.useState({}),o=s.useRef(n),i=s.useRef({}),a=s.useRef({}),l=s.useRef(void 0),c=s.useRef(null),{processRowUpdate:u,onProcessRowUpdateError:p,rowModesModel:h,onRowModesModelChange:m}=t,g=e=>(...n)=>{t.editMode===$I.Row&&e(...n)},v=s.useCallback((t,n)=>{const r=e.current.getCellParams(t,n);if(!e.current.isCellEditable(r))throw new Error(`MUI X: The cell with id=${t} and field=${n} is not editable.`)},[e]),b=s.useCallback((t,n)=>{if(e.current.getRowMode(t)!==n)throw new Error(`MUI X: The row with id=${t} is not in ${n} mode.`)},[e]),y=s.useCallback(t=>{const n=WL(e);return Object.values(n[t]).some(e=>e.error)},[e]),w=s.useCallback((t,n)=>{if(!t.isEditable)return;if(e.current.getRowMode(t.id)===jI.Edit)return;const r=f({},e.current.getRowParams(t.id),{field:t.field,reason:GI.cellDoubleClick});e.current.publishEvent("rowEditStart",r,n)},[e]),x=s.useCallback(e=>{c.current=e},[]),S=s.useCallback((t,n)=>{t.isEditable&&e.current.getRowMode(t.id)!==jI.View&&(c.current=null,l.current=setTimeout(()=>{if(c.current?.id!==t.id){if(!e.current.getRow(t.id))return;if(e.current.getRowMode(t.id)===jI.View)return;if(y(t.id))return;const r=f({},e.current.getRowParams(t.id),{field:t.field,reason:KI.rowFocusOut});e.current.publishEvent("rowEditStop",r,n)}}))},[e,y]);s.useEffect(()=>()=>{clearTimeout(l.current)},[]);const C=s.useCallback((t,n)=>{if(t.cellMode===jI.Edit){if(229===n.which)return;let r;if("Escape"===n.key)r=KI.escapeKeyDown;else if("Enter"===n.key)r=KI.enterKeyDown;else if("Tab"===n.key){const o=uO(e).filter(n=>e.current.getColumn(n).type===ZO||e.current.isCellEditable(e.current.getCellParams(t.id,n)));if(n.shiftKey?t.field===o[0]&&(r=KI.shiftTabKeyDown):t.field===o[o.length-1]&&(r=KI.tabKeyDown),n.preventDefault(),!r){const r=o.findIndex(e=>e===t.field),i=o[n.shiftKey?r-1:r+1];e.current.setCellFocus(t.id,i)}}if(r){if(r!==KI.escapeKeyDown&&y(t.id))return;const o=f({},e.current.getRowParams(t.id),{reason:r,field:t.field});e.current.publishEvent("rowEditStop",o,n)}}else if(t.isEditable){let r;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:n,cellParams:t,editMode:"row"}))return;if(LO(n)||$O(n)?r=GI.printableKeyDown:"Enter"===n.key?r=GI.enterKeyDown:"Backspace"!==n.key&&"Delete"!==n.key||(r=GI.deleteKeyDown),r){const o=f({},e.current.getRowParams(t.id),{field:t.field,reason:r});e.current.publishEvent("rowEditStart",o,n)}}},[e,y]),k=s.useCallback(t=>{const{id:n,field:r,reason:o}=t,i={id:n,fieldToFocus:r};o!==GI.printableKeyDown&&o!==GI.deleteKeyDown||(i.deleteValue=!!r),e.current.startRowEditMode(i)},[e]),E=s.useCallback(t=>{const{id:n,reason:r,field:o}=t;let i;e.current.runPendingEditCellValueMutation(n),r===KI.enterKeyDown?i="below":r===KI.tabKeyDown?i="right":r===KI.shiftTabKeyDown&&(i="left");const a="escapeKeyDown"===r;e.current.stopRowEditMode({id:n,ignoreModifications:a,field:o,cellToFocusAfter:i})},[e]);rI(e,"cellDoubleClick",g(w)),rI(e,"cellFocusIn",g(x)),rI(e,"cellFocusOut",g(S)),rI(e,"cellKeyDown",g(C)),rI(e,"rowEditStart",g(k)),rI(e,"rowEditStop",g(E)),iI(e,"rowEditStart",t.onRowEditStart),iI(e,"rowEditStop",t.onRowEditStop);const R=s.useCallback(n=>UL(e,{rowId:n,editMode:t.editMode})?jI.Edit:jI.View,[e,t.editMode]),P=Mg(n=>{const i=n!==t.rowModesModel;m&&i&&m(n,{api:e.current}),t.rowModesModel&&i||(r(n),o.current=n,e.current.publishEvent("rowModesModelChange",n))}),M=s.useCallback((e,t)=>{const n=f({},o.current);null!==t?n[e]=f({},t):delete n[e],P(n)},[P]),I=s.useCallback((t,n)=>{e.current.setState(e=>{const r=f({},e.editRows);return null!==n?r[t]=n:delete r[t],f({},e,{editRows:r})})},[e]),O=s.useCallback((t,n,r)=>{e.current.setState(e=>{const o=f({},e.editRows);return null!==r?o[t]=f({},o[t],{[n]:f({},r)}):(delete o[t][n],0===Object.keys(o[t]).length&&delete o[t]),f({},e,{editRows:o})})},[e]),D=s.useCallback(e=>{const{id:t}=e,n=d(e,YB);b(t,jI.View),M(t,f({mode:jI.Edit},n))},[b,M]),F=Mg(t=>{const{id:n,fieldToFocus:r,deleteValue:o,initialValue:i}=t,l=e.current.getRow(n),s=aO(e),c=s.reduce((t,a)=>{const l=a.field;if(!e.current.getCellParams(n,l).isEditable)return t;const s=e.current.getColumn(l);let c=e.current.getCellValue(n,l);return r===l&&(o||i)&&(o?c=GB(s):i&&(c=i)),t[l]={value:c,error:!1,isProcessingProps:s.editable&&!!s.preProcessEditCellProps&&o},t},{});a.current[n]=l,I(n,c),r&&e.current.setCellFocus(n,r),s.filter(t=>e.current.getCellParams(n,t.field).isEditable&&t.editable&&!!t.preProcessEditCellProps&&o).forEach(t=>{const r=t.field,a=e.current.getCellValue(n,r),s=o?GB(t):i??a;Promise.resolve(t.preProcessEditCellProps({id:n,row:l,props:c[r],hasChanged:s!==a})).then(t=>{if(e.current.getRowMode(n)===jI.Edit){const o=WL(e);O(n,r,f({},t,{value:o[n][r].value,isProcessingProps:!1}))}})})}),L=s.useCallback(e=>{const{id:t}=e,n=d(e,XB);b(t,jI.Edit),M(t,f({mode:jI.View},n))},[b,M]),A=Mg(async n=>{const{id:r,ignoreModifications:o,field:l,cellToFocusAfter:s="none"}=n;e.current.runPendingEditCellValueMutation(r);const c=()=>{"none"!==s&&l&&e.current.moveFocusToRelativeCell(r,l,s),I(r,null),M(r,null),delete a.current[r]};if(o)return void c();const d=WL(e),f=a.current[r];if(Object.values(d[r]).some(e=>e.isProcessingProps))return void(i.current[r].mode=jI.Edit);if(y(r))return i.current[r].mode=jI.Edit,void M(r,{mode:jI.Edit});const h=e.current.getRowWithUpdatedValuesFromRowEditing(r);if(t.dataSource?.updateRow){if(JL(f,h))return void c();const t=()=>{i.current[r].mode=jI.Edit,M(r,{mode:jI.Edit})},n={rowId:r,updatedRow:h,previousRow:f};try{await e.current.dataSource.editRow(n),c()}catch{t()}}else if(u){const t=e=>{i.current[r]&&(i.current[r].mode=jI.Edit,M(r,{mode:jI.Edit})),p&&p(e)};try{Promise.resolve(u(h,f,{rowId:r})).then(t=>{e.current.updateRows([t]),c()}).catch(t)}catch(e){t(e)}}else e.current.updateRows([h]),c()}),N=s.useCallback(t=>{const{id:n,field:r,value:o,debounceMs:i,unstable_skipValueParser:a}=t;v(n,r);const l=e.current.getColumn(r),s=e.current.getRow(n);let c=o;l.valueParser&&!a&&(c=l.valueParser(o,s,l,e));let u=WL(e),p=f({},u[n][r],{value:c,changeReason:i?"debouncedSetEditCellValue":"setEditCellValue"});return l.preProcessEditCellProps||O(n,r,p),new Promise(t=>{const o=[];if(l.preProcessEditCellProps){const i=p.value!==u[n][r].value;p=f({},p,{isProcessingProps:!0}),O(n,r,p);const a=d(u[n],[r].map(T)),h=Promise.resolve(l.preProcessEditCellProps({id:n,row:s,props:p,hasChanged:i,otherFieldsProps:a})).then(o=>{e.current.getRowMode(n)!==jI.View?(u=WL(e),(o=f({},o,{isProcessingProps:!1})).value=l.preProcessEditCellProps?u[n][r].value:c,O(n,r,o)):t(!1)});o.push(h)}Object.entries(u[n]).forEach(([i,a])=>{if(i===r)return;const l=e.current.getColumn(i);if(!l.preProcessEditCellProps)return;a=f({},a,{isProcessingProps:!0}),O(n,i,a),u=WL(e);const c=d(u[n],[i].map(T)),p=Promise.resolve(l.preProcessEditCellProps({id:n,row:s,props:a,hasChanged:!1,otherFieldsProps:c})).then(r=>{e.current.getRowMode(n)!==jI.View?(r=f({},r,{isProcessingProps:!1}),O(n,i,r)):t(!1)});o.push(p)}),Promise.all(o).then(()=>{e.current.getRowMode(n)===jI.Edit?(u=WL(e),t(!u[n][r].error)):t(!1)})})},[e,v,O]),$=s.useCallback(t=>{const n=WL(e),r=e.current.getRow(t);if(!n[t])return e.current.getRow(t);let o=f({},a.current[t],r);return Object.entries(n[t]).forEach(([t,n])=>{const r=e.current.getColumn(t);r?.valueSetter?o=r.valueSetter(n.value,o,r,e):o[t]=n.value}),o},[e]),z={setRowEditingEditCellValue:N,getRowWithUpdatedValuesFromRowEditing:$};vL(e,{getRowMode:R,startRowEditMode:D,stopRowEditMode:L},"public"),vL(e,z,"private"),s.useEffect(()=>{h&&P(h)},[h,P]),Wh(()=>{const t=wT(e),r=i.current;i.current=LI(n);const o=new Set([...Object.keys(n),...Object.keys(r)]);Array.from(o).forEach(o=>{const i=n[o]??{mode:jI.View},a=r[o]?.mode||jI.View,l=t[o]?e.current.getRowId(t[o]):o;i.mode===jI.Edit&&a===jI.View?F(f({id:l},i)):i.mode===jI.View&&a===jI.Edit&&A(f({id:l},i))})},[e,n,F,A])})(e,t);const r=s.useRef({}),{isCellEditable:o}=t,i=n.hooks.useIsCellEditable(e,t),a=s.useCallback(e=>!!i(e)&&(!!e.colDef.editable&&(!!e.colDef.renderEditCell&&(!o||o(e)))),[o,i]);s.useEffect(()=>{const e=r.current;return()=>{Object.entries(e).forEach(([t,n])=>{Object.keys(n).forEach(n=>{const[r]=e[t][n];clearTimeout(r),delete e[t][n]})})}},[]);const l=s.useCallback((e,t)=>{if(r.current[e])if(t){if(r.current[e][t]){const[,n]=r.current[e][t];n()}}else Object.keys(r.current[e]).forEach(t=>{const[,n]=r.current[e][t];n()})},[]),c=s.useCallback(n=>{const{id:o,field:i,debounceMs:a}=n;return new Promise(l=>{((e,t,n,o)=>{if(!n)return void o();if(r.current[e]||(r.current[e]={}),r.current[e][t]){const[n]=r.current[e][t];clearTimeout(n)}const i=setTimeout(()=>{o(),delete r.current[e][t]},n);r.current[e][t]=[i,()=>{const[n]=r.current[e][t];clearTimeout(n),o(),delete r.current[e][t]}]})(o,i,a,async()=>{const r=t.editMode===$I.Row?e.current.setRowEditingEditCellValue:e.current.setCellEditingEditCellValue;if(e.current.getCellMode(o,i)===zI.Edit){const e=await r(n);l(e)}})})},[e,t.editMode]),u=s.useCallback((n,r)=>t.editMode===$I.Cell?e.current.getRowWithUpdatedValuesFromCellEditing(n,r):e.current.getRowWithUpdatedValuesFromRowEditing(n),[e,t.editMode]),p=s.useCallback((t,n)=>{const r=WL(e);return r[t]?.[n]??null},[e]),h={runPendingEditCellValueMutation:l};vL(e,{isCellEditable:a,setEditCellValue:c,getRowWithUpdatedValues:u,unstable_getEditCellMeta:p},"public"),vL(e,h,"private")},JB=(e,t,n)=>{const r=!!t.dataSource;return n.current.caches.rows=AT({rows:r?[]:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),f({},e,{rows:$T({apiRef:n,rowCountProp:t.rowCount,loadingProp:!!r||t.loading,previousTree:null,previousTreeDepths:null})})},e_=e=>"full"===e.updates.type?(e=>{const t={[OT]:f({},{type:"group",id:OT,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null},{children:e})};for(let n=0;n<e.length;n+=1){const r=e[n];t[r]={id:r,depth:0,parent:OT,type:"leaf",groupingKey:null}}return{groupingName:hB,tree:t,treeDepths:{0:e.length},dataRowIds:e}})(e.updates.rows):(({previousTree:e,actions:t})=>{const n=f({},e),r={};for(let e=0;e<t.remove.length;e+=1){const o=t.remove[e];r[o]=!0,delete n[o]}for(let e=0;e<t.insert.length;e+=1){const r=t.insert[e];n[r]={id:r,depth:0,parent:OT,type:"leaf",groupingKey:null}}const o=n[OT];let i=[...o.children,...t.insert];return Object.values(r).length&&(i=i.filter(e=>!r[e])),n[OT]=f({},o,{children:i}),{groupingName:hB,tree:n,treeDepths:{0:i.length},dataRowIds:i}})({previousTree:e.previousTree,actions:e.updates.actions});class t_ extends Error{}function n_(e,t,n){const r=s.useCallback(t=>({field:t,colDef:e.current.getColumn(t)}),[e]),o=s.useCallback(t=>{const n=e.current.getRow(t);if(!n)throw new t_(`No row with id #${t} found`);return{id:t,columns:e.current.getAllColumns(),row:n}},[e]),i=s.useCallback((t,n,r,{cellMode:o,colDef:i,hasFocus:a,rowNode:l,tabIndex:s,value:c,formattedValue:u})=>{const d={id:t,field:n,row:r,rowNode:l,colDef:i,cellMode:o,hasFocus:a,tabIndex:s,value:void 0!==c?c:e.current.getRowValue(r,i),formattedValue:void 0!==u?u:e.current.getRowFormattedValue(r,i),isEditable:!1,api:e.current};return d.isEditable=i&&e.current.isCellEditable(d),d},[e]),a=s.useCallback((n,r)=>{const o=e.current.getRow(n),i=ST(e,n);if(!o||!i)throw new t_(`No row with id #${n} found`);const a=YD(e),l=JD(e),s=e.current.getCellMode(n,r);return e.current.getCellParamsForRow(n,r,o,{colDef:t.listView&&t.listViewColumn?.field===r?nO(e):e.current.getColumn(r),rowNode:i,hasFocus:null!==a&&a.field===r&&a.id===n,tabIndex:l&&l.field===r&&l.id===n?0:-1,cellMode:s})},[e,t.listView,t.listViewColumn?.field]),l=s.useCallback(t=>e.current.rootElementRef.current?function(e,t){return e.querySelector(`[role="columnheader"][data-field="${m$(t)}"]`)}(e.current.rootElementRef.current,t):null,[e]),c=s.useCallback(t=>e.current.rootElementRef.current?function(e,t){return e.querySelector(g$(t))}(e.current.rootElementRef.current,t):null,[e]),u=s.useCallback((t,n)=>e.current.rootElementRef.current?function(e,{id:t,field:n}){const r=`${g$(t)} .${XT.cell}[data-field="${m$(n)}"]`;return e.querySelector(r)}(e.current.rootElementRef.current,{id:t,field:n}):null,[e]),d=n.hooks.useGridParamsOverridableMethods(e),p={getCellValue:d.getCellValue,getCellParams:a,getCellElement:u,getRowValue:d.getRowValue,getRowFormattedValue:d.getRowFormattedValue,getRowParams:o,getRowElement:c,getColumnHeaderParams:r,getColumnHeaderElement:l},f={getCellParamsForRow:i};vL(e,p,"public"),vL(e,f,"private")}const r_={type:"include",ids:new Set},o_=(e,t)=>f({},e,{rowSelection:t.rowSelection?t.rowSelectionModel??r_:r_}),i_=(e,t)=>{const n=(e=>{const{classes:t}=e;return s.useMemo(()=>wm({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},YT,t),[t])})({classes:t.classes}),r=s.useCallback(r=>{const o=f({},wF,{cellClassName:n.cellCheckbox,headerClassName:n.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),i=t.checkboxSelection,a=null!=r.lookup[yF];return i&&!a?(r.lookup[yF]=o,r.orderedFields=[yF,...r.orderedFields]):!i&&a?(delete r.lookup[yF],r.orderedFields=r.orderedFields.filter(e=>e!==yF)):i&&a&&(r.lookup[yF]=f({},o,r.lookup[yF]),t.columns.some(e=>e.field===yF)||(r.orderedFields=[yF,...r.orderedFields.filter(e=>e!==yF)])),r},[e,n,t.columns,t.checkboxSelection]);pN(e,"hydrateColumns",r)},a_=(e,t)=>{const n=t.sortModel??t.initialState?.sorting?.sortModel??[];return f({},e,{sorting:{sortModel:wI(n,t.disableMultipleColumnsSorting),sortedRows:[]}})};function l_(e){const{containerSize:t,scrollPosition:n,elementSize:r,elementOffset:o}=e,i=o+r;return r>t?o:i-t>n?i-t:o<n?o:void 0}const s_={width:0,height:0},c_={isReady:!1,root:s_,viewportOuterSize:s_,viewportInnerSize:s_,contentSize:s_,minimumSize:s_,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,headerHeight:0,groupHeaderHeight:0,headerFilterHeight:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,headersTotalHeight:0,topContainerHeight:0,bottomContainerHeight:0,autoHeight:!1,minimalContentHeight:void 0},u_=(e,t,n)=>{const r=f({},c_,function(e,t,n,r){const o=WT(e.rowHeight,dN.rowHeight);return{rowHeight:Math.floor(o*n),headerHeight:Math.floor(e.columnHeaderHeight*n),groupHeaderHeight:Math.floor((e.columnGroupHeaderHeight??e.columnHeaderHeight)*n),headerFilterHeight:Math.floor((e.headerFilterHeight??e.columnHeaderHeight)*n),columnsTotalWidth:d_(t),headersTotalHeight:lL(t,e),leftPinnedWidth:r.left.reduce((e,t)=>e+t.computedWidth,0),rightPinnedWidth:r.right.reduce((e,t)=>e+t.computedWidth,0)}}(t,n,mI(n),pO(n)));return n.current.store.state.dimensions=r,f({},e,{dimensions:r})},d_=eT(cO,hO,(e,t)=>{const n=e.length;return 0===n?0:eA(t[n-1]+e[n-1].computedWidth,1)});function p_(e,t){const n=(t,n)=>e.style.setProperty(t,n);n("--DataGrid-hasScrollX",`${Number(t.hasScrollX)}`),n("--DataGrid-hasScrollY",`${Number(t.hasScrollY)}`),n("--DataGrid-scrollbarSize",`${t.scrollbarSize}px`),n("--DataGrid-rowWidth",`${t.rowWidth}px`),n("--DataGrid-columnsTotalWidth",`${t.columnsTotalWidth}px`),n("--DataGrid-leftPinnedWidth",`${t.leftPinnedWidth}px`),n("--DataGrid-rightPinnedWidth",`${t.rightPinnedWidth}px`),n("--DataGrid-headerHeight",`${t.headerHeight}px`),n("--DataGrid-headersTotalHeight",`${t.headersTotalHeight}px`),n("--DataGrid-topContainerHeight",`${t.topContainerHeight}px`),n("--DataGrid-bottomContainerHeight",`${t.bottomContainerHeight}px`),n("--height",`${t.rowHeight}px`)}const f_=["groupId","children"],h_=e=>{const t={};for(let n=0;n<e.length;n+=1){const r=e[n];if(qI(r))continue;const{groupId:o,children:i}=r,a=d(r,f_);if(!o)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");const l=f({},a,{groupId:o}),s=h_(i);if(void 0!==s[o]||void 0!==t[o])throw new Error(`MUI X: The groupId ${o} is used multiple times in the columnGroupingModel.`);Object.assign(t,s),t[o]=l}return t},m_=(e,t,n)=>{if(qI(e)){if(void 0!==n[e.field])throw new Error(["MUI X: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join("\n"));return void(n[e.field]=t)}const{groupId:r,children:o}=e;o.forEach(e=>{m_(e,[...t,r],n)})},g_=e=>{if(!e)return{};const t={};return e.forEach(e=>{m_(e,[],t)}),t},v_=(e,t,n)=>{const r=e=>t[e]??[],o=[],i=Math.max(0,...e.map(e=>r(e).length)),a=(e,t,n)=>{const o=r(e),i=r(t);for(let e=0;e<=n;e+=1)if(o[e]!==i[e])return!1;return!0},l=(e,t)=>{const r=n?.left,o=n?.right,i=!!r?.includes(e),a=!!r?.includes(t),l=!!o?.includes(e),s=!!o?.includes(t);return i!==a||l!==s};for(let t=0;t<i;t+=1){const n=[];for(let o=0;o<e.length;o+=1){const i=e[o],s=r(i)[t]??null;if(0===n.length){n.push({columnFields:[i],groupId:s});continue}const c=n[n.length-1],u=c.columnFields[c.columnFields.length-1];c.groupId!==s||!a(u,i,t)||l(u,i)?n.push({columnFields:[i],groupId:s}):c.columnFields.push(i)}o.push(n)}return o},b_=(e,t,n)=>{if(n.current.caches.columnGrouping={lastColumnGroupingModel:t.columnGroupingModel},!t.columnGroupingModel)return f({},e,{columnGrouping:void 0});const r=oO(n),o=uO(n),i=h_(t.columnGroupingModel??[]),a=g_(t.columnGroupingModel??[]),l=v_(r,a,n.current.state.pinnedColumns??{}),s=0===o.length?0:Math.max(...o.map(e=>a[e]?.length??0));return f({},e,{columnGrouping:{lookup:i,unwrappedGroupingModel:a,headerStructure:l,maxDepth:s}})};function y_(e,t){if(void 0!==t&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){const r=e.changedTouches[n];if(r.identifier===t)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function w_(e,t,n,r){let o=e;return o+="Right"===r?t-n.left:n.right-t,Math.round(o)}function x_(e,t){return t===ZI.LEFT?e?"--DataGrid-rightPinnedWidth":"--DataGrid-leftPinnedWidth":e?"--DataGrid-leftPinnedWidth":"--DataGrid-rightPinnedWidth"}function S_(e,t,n){return n===ZI.LEFT?t?e.rightPinnedWidth:e.leftPinnedWidth:t?e.leftPinnedWidth:e.rightPinnedWidth}function C_(e){e.preventDefault(),e.stopImmediatePropagation()}function k_(e){const t=s.useRef(void 0),n=()=>VA(e),r=pI(e,n);s.useEffect(()=>{t.current&&!1===r&&(t.current.resolve(),t.current=void 0)});return()=>{if(!t.current){if(!1===n())return Promise.resolve();t.current=function(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}()}return t.current}}function E_(e,t,n){const r={},o=e.current.rootElementRef.current;return o.classList.add(XT.autosizing),n.forEach(n=>{const o=function(e,t){const n=e.virtualScrollerRef.current;return Array.from(n.querySelectorAll(`:scope > div > div > div > [data-field="${m$(t)}"][role="gridcell"]`))}(e.current,n.field),i=o.map(e=>e.getBoundingClientRect().width??0),a=t.includeOutliers?i:function(e,t){if(e.length<4)return e;const n=e.slice();n.sort((e,t)=>e-t);const r=n[Math.floor(.25*n.length)],o=n[Math.floor(.75*n.length)-1],i=o-r,a=i<5?5:i*t;return n.filter(e=>e>r-a&&e<o+a)}(i,t.outliersFactor);if(t.includeHeaders){const t=(l=e.current,s=n.field,l.columnHeadersContainerRef.current.querySelector(`:scope > div > [data-field="${m$(s)}"][role="columnheader"]`));if(t){const e=t.querySelector(`.${XT.columnHeaderTitleContainer}`),n=Array.from(e.children),r=t.querySelector(`.${XT.menuIcon}`),o=window.getComputedStyle(e,null),i=parseInt(o.gap,10)||0,l=window.getComputedStyle(t,null),s=parseInt(l.paddingLeft,10)+parseInt(l.paddingRight,10);let c=0,u=0;for(let e=0;e<n.length;e+=1){const t=n[e];t.clientWidth>0&&(c+=1,u+=t.scrollWidth)}u+=1;const d=u+i*(c-1)+s+(r?.clientWidth??0);a.push(d)}}var l,s;const c=n.minWidth!==-1/0&&void 0!==n.minWidth,u=n.maxWidth!==1/0&&void 0!==n.maxWidth,d=c?n.minWidth:0,p=u?n.maxWidth:1/0,f=0===a.length?0:Math.max(...a);r[n.field]=FI(f,d,p)}),o.classList.remove(XT.autosizing),r}const R_=e=>f({},e,{columnResize:{resizingColumnField:""}});function P_(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const M_=(e,t)=>{const n=um(),r=bL(e,"useGridColumnResize"),o=Dg(P_).current,i=s.useRef(null),a=s.useRef(null),l=Ng(),c=s.useRef(void 0),u=t=>{r.debug(`Updating width to ${t} for col ${o.colDef.field}`);const i=o.columnHeaderElement.offsetWidth,a=t-i,l=t-o.initialColWidth;if(l>0){const t=o.initialTotalWidth+l;e.current.rootElementRef?.current?.style.setProperty("--DataGrid-rowWidth",`${t}px`)}o.colDef.computedWidth=t,o.colDef.width=t,o.colDef.flex=0,o.columnHeaderElement.style.width=`${t}px`;const s=o.headerFilterElement;s&&(s.style.width=`${t}px`),o.groupHeaderElements.forEach(e=>{const n=e;let r;r="1"===n.getAttribute("aria-colspan")?`${t}px`:`${n.offsetWidth+a}px`,n.style.width=r}),o.cellElements.forEach(e=>{const n=e;let r;r="1"===n.getAttribute("aria-colspan")?`${t}px`:`${n.offsetWidth+a}px`,n.style.setProperty("--width",r)});const c=oT(e),u=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);u===ZI.LEFT&&(T_(o.fillerLeft,"width",a),o.leftPinnedCellsAfter.forEach(e=>{T_(e,"left",a)}),o.leftPinnedHeadersAfter.forEach(e=>{T_(e,"left",a)}),e.current.rootElementRef?.current?.style.setProperty(x_(n,u),`${S_(c,n,u)+l}px`)),u===ZI.RIGHT&&(T_(o.fillerRight,"width",a),o.rightPinnedCellsBefore.forEach(e=>{T_(e,"right",a)}),o.rightPinnedHeadersBefore.forEach(e=>{T_(e,"right",a)}),e.current.rootElementRef?.current?.style.setProperty(x_(n,u),`${S_(c,n,u)+l}px`))},d=t=>{if(y(),o.previousMouseClickEvent){const n=o.previousMouseClickEvent,r=n.timeStamp,i=n.clientX,a=n.clientY;if(t.timeStamp-r<300&&t.clientX===i&&t.clientY===a)return o.previousMouseClickEvent=void 0,void e.current.publishEvent("columnResizeStop",null,t)}if(o.colDef){e.current.setColumnWidth(o.colDef.field,o.colDef.width),r.debug(`Updating col ${o.colDef.field} with new width: ${o.colDef.width}`);const t=rO(e);o.groupHeaderElements.forEach(e=>{const n=e,r=`${e.getAttribute("data-fields").slice(2,-2).split("-|-").reduce((e,n)=>!1!==t.columnVisibilityModel[n]?e+t.lookup[n].computedWidth:e,0)}px`;n.style.width=r})}l.start(0,()=>{e.current.publishEvent("columnResizeStop",null,t)})},p=(t,r,l)=>{const s=e.current.rootElementRef.current;var c,u;o.initialColWidth=t.computedWidth,o.initialTotalWidth=e.current.getRootDimensions().rowWidth,o.colDef=t,o.columnHeaderElement=(c=e.current.columnHeadersContainerRef.current,u=t.field,c.querySelector(`[data-field="${m$(u)}"]`));const d=s.querySelector(`.${XT.headerFilterRow} [data-field="${m$(t.field)}"]`);d&&(o.headerFilterElement=d),o.groupHeaderElements=function(e,t){return Array.from(e.querySelectorAll(`[data-fields*="|-${m$(t)}-|"]`)??[])}(e.current.columnHeadersContainerRef?.current,t.field),o.cellElements=function(e,t){if(!h$(e,XT.root))throw new Error("MUI X: The root element is not found.");const n=e.getAttribute("aria-colindex");if(!n)return[];const r=Number(n)-1,o=[];return t.virtualScrollerRef?.current?(x$(t).forEach(e=>{const n=e.getAttribute("data-id");if(!n)return;let i=r;const a=t.unstable_getCellColSpanInfo(n,r);a&&a.spannedByColSpan&&(i=a.leftVisibleCellIndex);const l=e.querySelector(`[data-colindex="${i}"]`);l&&o.push(l)}),o):[]}(o.columnHeaderElement,e.current),o.fillerLeft=b$(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),o.fillerRight=b$(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const p=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);o.leftPinnedCellsAfter=p!==ZI.LEFT?[]:function(e,t,n){const r=S$(t);return y$({api:e,colIndex:r,position:n?"right":"left",filterFn:e=>n?e<r:e>r})}(e.current,o.columnHeaderElement,n),o.rightPinnedCellsBefore=p!==ZI.RIGHT?[]:function(e,t,n){const r=S$(t);return y$({api:e,colIndex:r,position:n?"left":"right",filterFn:e=>n?e>r:e<r})}(e.current,o.columnHeaderElement,n),o.leftPinnedHeadersAfter=p!==ZI.LEFT?[]:function(e,t,n){const r=S$(t);return w$({api:e,position:n?"right":"left",colIndex:r,filterFn:e=>n?e<r:e>r})}(e.current,o.columnHeaderElement,n),o.rightPinnedHeadersBefore=p!==ZI.RIGHT?[]:function(e,t,n){const r=S$(t);return w$({api:e,position:n?"left":"right",colIndex:r,filterFn:(e,t)=>!t.classList.contains(XT["columnHeader--last"])&&(n?e>r:e<r)})}(e.current,o.columnHeaderElement,n),a.current=function(e,t){const n=e.classList.contains(XT["columnSeparator--sideRight"])?"Right":"Left";return t?function(e){return"Right"===e?"Left":"Right"}(n):n}(r,n),i.current=function(e,t,n){return"Left"===n?e-t.left:t.right-e}(l,o.columnHeaderElement.getBoundingClientRect(),a.current)},h=Mg(d),m=Mg(t=>{if(0===t.buttons)return void h(t);let n=w_(i.current,t.clientX,o.columnHeaderElement.getBoundingClientRect(),a.current);n=FI(n,o.colDef.minWidth,o.colDef.maxWidth),u(n);const r={element:o.columnHeaderElement,colDef:o.colDef,width:n};e.current.publishEvent("columnResize",r,t)}),g=Mg(e=>{y_(e,c.current)&&d(e)}),v=Mg(t=>{const n=y_(t,c.current);if(!n)return;if("mousemove"===t.type&&0===t.buttons)return void g(t);let r=w_(i.current,n.x,o.columnHeaderElement.getBoundingClientRect(),a.current);r=FI(r,o.colDef.minWidth,o.colDef.maxWidth),u(r);const l={element:o.columnHeaderElement,colDef:o.colDef,width:r};e.current.publishEvent("columnResize",l,t)}),b=Mg(t=>{const n=h$(t.target,XT["columnSeparator--resizable"]);if(!n)return;const o=t.changedTouches[0];null!=o&&(c.current=o.identifier);const i=h$(t.target,XT.columnHeader),a=i.getAttribute("data-field");const l=e.current.getColumn(a);r.debug(`Start Resize on col ${l.field}`),e.current.publishEvent("columnResizeStart",{field:a},t),p(l,n,o.clientX);const s=kg(t.currentTarget);s.addEventListener("touchmove",v),s.addEventListener("touchend",g)}),y=s.useCallback(()=>{const t=kg(e.current.rootElementRef.current);t.body.style.removeProperty("cursor"),t.removeEventListener("mousemove",m),t.removeEventListener("mouseup",h),t.removeEventListener("touchmove",v),t.removeEventListener("touchend",g),setTimeout(()=>{t.removeEventListener("click",C_,!0)},100),o.columnHeaderElement&&(o.columnHeaderElement.style.pointerEvents="unset")},[e,o,m,h,v,g]),w=s.useCallback(({field:t})=>{e.current.setState(e=>f({},e,{columnResize:f({},e.columnResize,{resizingColumnField:t})}))},[e]),x=s.useCallback(()=>{e.current.setState(e=>f({},e,{columnResize:f({},e.columnResize,{resizingColumnField:""})}))},[e]),S=Mg(({colDef:t},n)=>{if(0!==n.button)return;if(!n.currentTarget.classList.contains(XT["columnSeparator--resizable"]))return;n.preventDefault(),r.debug(`Start Resize on col ${t.field}`),e.current.publishEvent("columnResizeStart",{field:t.field},n),p(t,n.currentTarget,n.clientX);const i=kg(e.current.rootElementRef.current);i.body.style.cursor="col-resize",o.previousMouseClickEvent=n.nativeEvent,i.addEventListener("mousemove",m),i.addEventListener("mouseup",h),i.addEventListener("click",C_,!0)}),C=Mg((n,r)=>{if(t.disableAutosize)return;if(0!==r.button)return;const o=e.current.state.columns.lookup[n.field];!1!==o.resizable&&e.current.autosizeColumns(f({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[o.field]}))}),k=k_(e),E=s.useRef(!1),R=s.useCallback(async n=>{const r=e.current.rootElementRef?.current;if(!r)return;if(E.current)return;E.current=!0;const o=rO(e),i=f({},VL,n,{columns:n?.columns??o.orderedFields});i.columns=i.columns.filter(e=>!1!==o.columnVisibilityModel[e]);const a=i.columns.map(t=>e.current.state.columns.lookup[t]);try{!t.disableVirtualization&&i.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await k());const n=E_(e,i,a),r=a.map(e=>f({},e,{width:n[e.field],computedWidth:n[e.field],flex:0}));if(i.expand){const t=o.orderedFields.map(e=>o.lookup[e]).filter(e=>!1!==o.columnVisibilityModel[e.field]).reduce((e,t)=>e+(n[t.field]??t.computedWidth??t.width),0),i=e.current.getRootDimensions(),a=i.viewportInnerSize.width-t;if(a>0){const e=a/(r.length||1);r.forEach(t=>{t.width+=e,t.computedWidth+=e})}}e.current.updateColumns(r),r.forEach((t,n)=>{if(t.width!==a[n].width){const n=t.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(t.field),colDef:t,width:n})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),E.current=!1}},[e,k,t.disableVirtualization]);s.useEffect(()=>y,[y]),Lg(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),yL(e,()=>e.current.columnHeadersContainerRef?.current,"touchstart",b,{passive:!0}),vL(e,{autosizeColumns:R},"public"),rI(e,"columnResizeStop",x),rI(e,"columnResizeStart",w),rI(e,"columnSeparatorMouseDown",S),rI(e,"columnSeparatorDoubleClick",C),iI(e,"columnResize",t.onColumnResize),iI(e,"columnWidthChange",t.onColumnWidthChange)};function T_(e,t,n){e&&(e.style[t]=`${Math.round(parseFloat(e.style[t]))+n}px`)}function I_(e){return 0!==e.firstRowIndex||0!==e.lastRowIndex}const O_=(e,t,n)=>{if(!e)return null;const r=e[t.field];return t.rowSpanValueGetter?t.rowSpanValueGetter(r,e,t,n):LT(e,t,n)},D_={caches:{spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},processedRange:{firstRowIndex:0,lastRowIndex:0}},F_=e=>f({},e,{rowSpanning:D_}),L_=(e,t)=>{const n=s.useCallback((t,n=!1)=>{const r=e.current.virtualizer.store,{range:o,rows:i}=lN(e);if(n&&r.set("rowSpanning",D_),null===o||!I_(t))return;const a=n?D_:AA.selectors.state(r.state),l=(s={firstRowIndex:t.firstRowIndex,lastRowIndex:Math.min(t.lastRowIndex,o.lastRowIndex-o.firstRowIndex+1)},c=a.processedRange,s.firstRowIndex>=c.firstRowIndex&&s.lastRowIndex<=c.lastRowIndex?null:s.firstRowIndex>=c.firstRowIndex&&s.lastRowIndex>c.lastRowIndex?{firstRowIndex:c.lastRowIndex,lastRowIndex:s.lastRowIndex}:s.firstRowIndex<c.firstRowIndex&&s.lastRowIndex<=c.lastRowIndex?{firstRowIndex:s.firstRowIndex,lastRowIndex:c.firstRowIndex-1}:s);var s,c;if(null===l)return;const u=cO(e),d=((e,t,n,r,o,i)=>{const a=e.current.virtualizer,l=i?D_:AA.selectors.state(a.store.state),s=f({},l.caches.spannedCells),c=f({},l.caches.hiddenCells),u=f({},l.caches.hiddenCellOriginMap),d={firstRowIndex:Math.min(l.processedRange.firstRowIndex,o.firstRowIndex),lastRowIndex:Math.max(l.processedRange.lastRowIndex,o.lastRowIndex)};return t.forEach((t,i)=>{for(let a=o.firstRowIndex;a<o.lastRowIndex;a+=1){const l=n[a];if(c[l.id]?.[i])continue;const d=O_(l.model,t,e);if(null==d)continue;let p=l.id,f=a,h=0;const m=[];if(a===o.firstRowIndex){let o=a-1,l=n[o];for(;o>=r.firstRowIndex&&l&&O_(l.model,t,e)===d;){const e=n[o+1];c[e.id]?c[e.id][i]=!0:c[e.id]={[i]:!0},m.push(a),h+=1,p=l.id,f=o,o-=1,l=n[o]}}m.forEach(e=>{u[e]?u[e][i]=f:u[e]={[i]:f}});let g=a+1;for(;g<=r.lastRowIndex&&n[g]&&O_(n[g].model,t,e)===d;){const e=n[g];c[e.id]?c[e.id][i]=!0:c[e.id]={[i]:!0},u[g]?u[g][i]=f:u[g]={[i]:f},g+=1,h+=1}h>0&&(s[p]?s[p][i]=h+1:s[p]={[i]:h+1})}}),{caches:{spannedCells:s,hiddenCells:c,hiddenCellOriginMap:u},processedRange:d}})(e,u,i,o,l,n),p=Object.keys(d.caches.spannedCells).length,h=Object.keys(d.caches.hiddenCells).length,m=Object.keys(a.caches.spannedCells).length,g=Object.keys(a.caches.hiddenCells).length;(n||p!==m||h!==g)&&!(0===p&&0===m)&&r.set("rowSpanning",d)},[e]),{schedule:r,cancel:o}=function(e){const t=s.useRef(null),n=s.useCallback((...n)=>{t.current||queueMicrotask(()=>{t.current&&t.current()}),t.current=()=>{t.current=null,e(...n)}},[e]);return s.useLayoutEffect(()=>{t.current&&t.current()}),{schedule:n,cancel:()=>!!t.current&&(t.current=null,!0)}}(n),i=s.useCallback(()=>{const t=WA(e);I_(t)&&r(t,!0)},[e,r]);rI(e,"renderedRowsIntervalChange",AI(t.rowSpanning,e=>{const t=o();n(e,t)})),rI(e,"sortedRowsSet",AI(t.rowSpanning,i)),rI(e,"paginationModelChange",AI(t.rowSpanning,i)),rI(e,"filteredRowsSet",AI(t.rowSpanning,i)),rI(e,"columnsChange",AI(t.rowSpanning,i)),s.useEffect(()=>{const r=e.current.virtualizer?.store;r&&(t.rowSpanning?r.state.rowSpanning===D_&&n(WA(e)):r.state.rowSpanning!==D_&&r.set("rowSpanning",D_))},[e,t.rowSpanning,n])},A_=(e,t,n)=>f({},e,{listViewColumn:t.listViewColumn?f({},t.listViewColumn,{computedWidth:N_(n)}):void 0});function N_(e){return oT(e).viewportInnerSize.width}const $_=eT(yD,gD,lF,(e,t,n)=>({groupKeys:[],paginationModel:n,sortModel:t,filterModel:e,start:n.page*n.pageSize,end:n.page*n.pageSize+n.pageSize-1}));let z_=function(e){return e.Default="set-flat-rows",e.LazyLoading="replace-row-range",e.GroupedData="set-grouped-rows",e}({});class j_{constructor(e){this.chunkSize=e}getCacheKeys=e=>{if(this.chunkSize<1||"number"!=typeof e.start)return[e];const t=[];for(let n=e.start;n<=e.end;n+=this.chunkSize){const r=Math.min(n+this.chunkSize-1,e.end);t.push(f({},e,{start:n,end:r}))}return t};splitResponse=(e,t)=>{const n=this.getCacheKeys(e);if(1===n.length)return new Map([[e,t]]);const r=new Map;return n.forEach(n=>{const o=n.end===e.end,i=f({},t,{pageInfo:f({},t.pageInfo,{hasNextPage:void 0!==t.pageInfo?.hasNextPage&&!o||t.pageInfo?.hasNextPage,nextCursor:void 0===t.pageInfo?.nextCursor||o?t.pageInfo?.nextCursor:t.rows[n.end+1].id}),rows:"number"!=typeof n.start||"number"!=typeof e.start?t.rows:t.rows.slice(n.start-e.start,n.end-e.start+1)});r.set(n,i)}),r};static mergeResponses=e=>1===e.length?e[0]:e.reduce((e,t)=>f({},t,{rows:[...e.rows,...t.rows]}),{rows:[],rowCount:0,pageInfo:{}})}const B_=["skipCache","keepChildrenExpanded"],__={clear:()=>{},get:()=>{},set:()=>{}};function H_(e,t={}){return null===e?__:e??new KA(t)}const V_=(e,t)=>{const{api:n,strategyProcessor:r,events:o,setStrategyAvailability:i}=((e,t,n={})=>{const r=s.useCallback(()=>{e.current.setStrategyAvailability(pB.DataSource,z_.Default,t.dataSource?()=>!0:()=>!1)},[e,t.dataSource]),[o,i]=s.useState(e.current.getActiveStrategy(pB.DataSource)),a=s.useMemo(()=>o===z_.Default||o===z_.GroupedData,[o]),l=pI(e,lF),c=s.useRef(0),u=t.onDataSourceError,p=Dg(()=>{if(!t.pagination)return new j_(l.pageSize);const e=t.pageSizeOptions.map(e=>"number"==typeof e?e:e.value).sort((e,t)=>e-t),n=Math.min(l.pageSize,e[0]);return new j_(n)}).current,[h,m]=s.useState(()=>H_(t.dataSourceCache,n.cacheOptions)),g=s.useCallback(async(r,o)=>{const i=t.dataSource?.getRows;if(!i)return;if(r&&r!==OT&&"DataGrid"!==t.signature)return void n.fetchRowChildren?.([r]);n.clearDataSourceState?.();const l=o||{},{skipCache:s,keepChildrenExpanded:m}=l,g=d(l,B_),v=f({},$_(e),e.current.unstable_applyPipeProcessors("getRowsParams",{}),g),b=p.getCacheKeys(v).map(e=>h.get(e));if(!s&&b.every(e=>void 0!==e))return void e.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:j_.mergeResponses(b),fetchParams:v,options:{skipCache:s,keepChildrenExpanded:m}});(a||0===e.current.getRowsCount())&&e.current.setLoading(!0);const y=c.current+1;c.current=y;try{const t=await i(v);p.splitResponse(v,t).forEach((e,t)=>h.set(t,e)),c.current===y&&e.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:t,fetchParams:v,options:{skipCache:s,keepChildrenExpanded:m}})}catch(t){c.current===y&&(e.current.applyStrategyProcessor("dataSourceRowsUpdate",{error:t,fetchParams:v,options:{skipCache:s,keepChildrenExpanded:m}}),"function"==typeof u&&u(new qA({message:t?.message,params:v,cause:t})))}finally{a&&c.current===y&&e.current.setLoading(!1)}},[p,h,e,a,t.dataSource?.getRows,u,n,t.signature]),v=s.useCallback(()=>{i(e.current.getActiveStrategy(pB.DataSource))},[e]),b=s.useCallback(t=>{if("error"in t)return void e.current.setRows([]);const{response:n}=t;void 0!==n.rowCount&&e.current.setRowCount(n.rowCount),e.current.setRows(n.rows),e.current.unstable_applyPipeProcessors("processDataSourceRows",{params:t.fetchParams,response:n},!0)},[e]),y=t.dataSource?.updateRow,w=n.handleEditRow,x=s.useCallback(async t=>{if(y)try{const n=await y(t);return"function"==typeof w?(w(t,n),n):(n&&!JL(n,t.previousRow)&&e.current.dataSource.cache.clear(),e.current.updateNestedRows([n],[]),n)}catch(e){throw"function"==typeof u&&u(new YA({message:e?.message,params:t,cause:e})),e}},[e,y,u,w]),S={dataSource:{fetchRows:g,cache:h,editRow:x}},C=s.useMemo(()=>Cg(g,0),[g]),k=s.useRef(!0);return s.useEffect(()=>{if(k.current)return void(k.current=!1);if(void 0===t.dataSourceCache)return;const e=H_(t.dataSourceCache,n.cacheOptions);m(t=>t!==e?e:t)},[t.dataSourceCache,n.cacheOptions]),s.useEffect(()=>{if(o===z_.Default||o===z_.LazyLoading||o===z_.GroupedData)return t.dataSource&&(e.current.dataSource.cache.clear(),e.current.dataSource.fetchRows()),()=>{c.current+=1}},[e,t.dataSource,o]),{api:{public:S},debouncedFetchRows:C,strategyProcessor:{strategyName:z_.Default,group:"dataSourceRowsUpdate",processor:b},setStrategyAvailability:r,cacheChunkManager:p,cache:h,events:{strategyAvailabilityChange:v,sortModelChange:AI(a,()=>C()),filterModelChange:AI(a,()=>C()),paginationModelChange:AI(a,()=>C())}}})(e,t);vL(e,n.public,"public"),fB(e,r.strategyName,r.group,r.processor),Object.entries(o).forEach(([t,n])=>{rI(e,t,n)}),s.useEffect(()=>{i()},[i])},W_=(e,t,n)=>{vB(e,t),i_(e,t),(e=>{fB(e,hB,"rowTreeCreation",e_)})(e),bB(gB,e,t),bB(o_,e,t),bB(RB,e,t),bB(JB,e,t),bB(VB,e,t),bB(QB,e,t),bB(zB,e,t),bB(a_,e,t),bB(UB,e,t),bB(LB,e,t),bB(F_,e,t),bB(MB,e,t),bB(R_,e,t),bB(EB,e,t),bB(b_,e,t),bB(_A,e,t),bB(u_,e,t),bB(hN,e,t),bB(A_,e,t),HB(e,t),((e,t)=>{const n=bL(e,"useGridSelection"),r=s.useCallback(e=>(...n)=>{t.rowSelection&&e(...n)},[t.rowSelection]),o=pI(e,RT)>1,i=t.signature!==QT.DataGrid&&(t.rowSelectionPropagation?.parents||t.rowSelectionPropagation?.descendants)&&o,a=s.useMemo(()=>t.rowSelectionModel,[t.rowSelectionModel]),l=s.useRef(null);e.current.registerControlState({stateId:"rowSelection",propModel:a,propOnChange:t.onRowSelectionModelChange,stateSelector:LD,changeEvent:"rowSelectionChange"});const{checkboxSelection:c,disableRowSelectionOnClick:u,isRowSelectable:d}=t,p=HD(t),h=s.useCallback(t=>{let n=t;const r=l.current??t,o=e.current.isRowSelected(t);if(o){const t=kD(e),o=t.findIndex(e=>e===r),i=t.findIndex(e=>e===n);if(o===i)return;n=o>i?t[i+1]:t[i-1]}l.current=t,e.current.selectRowRange({startId:r,endId:n},!o)},[e]),m=Mg(()=>t.pagination&&t.checkboxSelectionVisibleOnly&&"client"===t.paginationMode?mF(e):kD(e)),g=s.useCallback((r,o)=>{if(t.signature===QT.DataGrid&&!p&&("include"!==r.type||r.ids.size>1))throw new Error(["MUI X: `rowSelectionModel` can only contain 1 item in DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection."].join("\n"));if(LD(e)!==r){if(n.debug("Setting selection model"),null!==l.current){const e=r.ids.has(l.current);("include"===r.type&&!e||"exclude"===r.type&&e)&&(l.current=null)}e.current.setState(e=>f({},e,{rowSelection:t.rowSelection?r:r_}),o)}},[e,n,t.rowSelection,t.signature,p]),v=s.useCallback(t=>AD(e).has(t),[e]),b=s.useCallback(n=>{if(!1===t.rowSelection)return!1;if(d&&!d(e.current.getRowParams(n)))return!1;const r=ST(e,n);return"footer"!==r?.type&&"pinnedRow"!==r?.type},[e,t.rowSelection,d]),y=s.useCallback(()=>$D(e),[e]),w=s.useCallback((r,o=!0,a=!1)=>{if(!e.current.isRowSelectable(r))return;const s=xT(e);if(l.current=o?r:null,a){n.debug(`Setting selection for row ${r}`);const a={type:"include",ids:new Set},l=e=>{a.ids.add(e)};o&&(l(r),i&&VD(e,s,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,l)),e.current.setRowSelectionModel(a,"singleRowSelection")}else{n.debug(`Toggling selection for row ${r}`);const a=LD(e),l={type:a.type,ids:new Set(a.ids)},c=VI(l);c.unselect(r);const u=e=>{c.select(e)},d=e=>{c.unselect(e)};o?(u(r),i&&VD(e,s,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,u)):i&&WD(e,s,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,d),("include"===l.type&&l.ids.size<2||p)&&e.current.setRowSelectionModel(l,"singleRowSelection")}},[e,n,i,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents,p]),x=s.useCallback((r,o=!0,a=!1)=>{if(n.debug("Setting selection for several rows"),!1===t.rowSelection)return;const l=xT(e),s=new Set;for(let t=0;t<r.length;t+=1){const n=r[t];e.current.isRowSelectable(n)&&s.add(n)}const c=LD(e);let u;if(a){if(u={type:"include",ids:s},o){const n=VI(u);if(i){const r=e=>{n.select(e)};for(const n of s)VD(e,l,n,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,r)}}else u.ids=new Set;if(c.type===u.type&&u.ids.size===c.ids.size&&Array.from(u.ids).every(e=>c.ids.has(e)))return}else{u={type:c.type,ids:new Set(c.ids)};const n=VI(u),r=e=>{n.select(e)},a=e=>{n.unselect(e)};for(const c of s)o?(n.select(c),i&&VD(e,l,c,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,r)):(a(c),i&&WD(e,l,c,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,a))}("include"===u.type&&u.ids.size<2||p)&&e.current.setRowSelectionModel(u,"multipleRowsSelection")},[n,i,p,e,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents,t.rowSelection]),S=s.useCallback(n=>{if(!o||!i||"exclude"===n.type||0===n.ids.size&&"include"===n.type)return n;const r={type:n.type,ids:new Set(n.ids)},a=xT(e),l=VI(r),s=e=>{l.select(e)};for(const r of n.ids)VD(e,a,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,s,l);return r},[e,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents,o,i]),C=s.useCallback(({startId:t,endId:r},o=!0,i=!1)=>{if(!e.current.getRow(t)||!e.current.getRow(r))return;n.debug(`Expanding selection from row ${t} to row ${r}`);const a=kD(e),l=a.indexOf(t),s=a.indexOf(r),[c,u]=l>s?[s,l]:[l,s],d=a.slice(c,u+1);e.current.selectRows(d,o,i)},[e,n]),k={selectRows:x,selectRowRange:C,getPropagatedRowSelectionModel:S};vL(e,{selectRow:w,setRowSelectionModel:g,getSelectedRows:y,isRowSelected:v,isRowSelectable:b},"public"),vL(e,k,t.signature===QT.DataGrid?"private":"public");const E=s.useRef(!0),R=s.useCallback((n=!1)=>{if(E.current)return;const r=LD(e),i=wT(e),a=xT(e),l=SD(e),s=e=>"server"===t.filterMode?!i[e]:!a[e]||!1===l[e],c={type:r.type,ids:new Set(r.ids)},u=VI(c);let d=!1;for(const e of r.ids){if(s(e)){if(t.keepNonExistentRowsSelected)continue;u.unselect(e),d=!0;continue}if(!t.rowSelectionPropagation?.parents)continue;const n=a[e];if("group"===n?.type){if(n.isAutoGenerated){u.unselect(e),d=!0;continue}n.children.every(e=>!1===l[e])||(u.unselect(e),d=!0)}}const p=o&&t.rowSelectionPropagation?.parents&&(c.ids.size>0||"exclude"===c.type);if(d||p&&!n)if(p)if("exclude"===c.type){const n=m(),r=[];for(let e=0;e<n.length;e+=1){const o=n[e];!t.keepNonExistentRowsSelected&&s(o)||!u.has(o)||r.push(o)}e.current.selectRows(r,!0,!0)}else e.current.selectRows(Array.from(c.ids),!0,!0);else e.current.setRowSelectionModel(c,"multipleRowsSelection")},[e,o,t.rowSelectionPropagation?.parents,t.keepNonExistentRowsSelected,t.filterMode,m]),P=s.useCallback((t,n)=>{const r=n.metaKey||n.ctrlKey,o=!c&&!r&&!(e=>!!e.key)(n),i=!p||o,a=e.current.isRowSelected(t),l=ND(e)>1&&i||!a;e.current.selectRow(t,l,i)},[e,p,c]),M=s.useCallback((t,n)=>{if(u)return;const r=n.target.closest(`.${XT.cell}`)?.getAttribute("data-field");if(r!==wF.field&&r!==tD){if(r){const t=e.current.getColumn(r);if(t?.type===ZO)return}"pinnedRow"!==ST(e,t.id).type&&(n.shiftKey&&p?h(t.id):P(t.id,n))}},[u,p,e,h,P]),T=s.useCallback((e,t)=>{p&&t.shiftKey&&window.getSelection()?.removeAllRanges()},[p]),I=s.useCallback((t,n)=>{p&&n.nativeEvent.shiftKey?h(t.id):e.current.selectRow(t.id,t.value,!p)},[e,h,p]),O=s.useCallback(n=>{const r=yD(e),i=wD(e),a=r.items.length>0||i?.some(e=>e.length);t.isRowSelectable||t.checkboxSelectionVisibleOnly||o&&!t.rowSelectionPropagation?.descendants||a||t.disableRowSelectionExcludeModel?e.current.selectRows(m(),n):e.current.setRowSelectionModel({type:n?"exclude":"include",ids:new Set},"multipleRowsSelection")},[e,m,t.checkboxSelectionVisibleOnly,t.isRowSelectable,t.rowSelectionPropagation?.descendants,t.disableRowSelectionExcludeModel,o]),D=s.useCallback(e=>{O(e.value)},[O]),F=s.useCallback((t,n)=>{if(e.current.getCellMode(t.id,t.field)!==zI.Edit&&!v$(n)){if(AO(n.key)&&n.shiftKey){const r=YD(e);if(r&&r.id!==t.id){n.preventDefault();const o=e.current.isRowSelected(r.id);if(!p)return void e.current.selectRow(r.id,!o,!0);const i=e.current.getRowIndexRelativeToVisibleRows(r.id),a=e.current.getRowIndexRelativeToVisibleRows(t.id);let l,s;i>a?o?(l=a,s=i-1):(l=a,s=i):o?(l=i+1,s=a):(l=i,s=a);const c=lN(e),u=[];for(let e=l;e<=s;e+=1)u.push(c.rows[e].id);return void e.current.selectRows(u,!o)}}if(" "===n.key&&n.shiftKey)return n.preventDefault(),void P(t.id,n);"A"===String.fromCharCode(n.keyCode)&&(n.ctrlKey||n.metaKey)&&(n.preventDefault(),p&&O(!0))}},[e,p,P,O]),L=Mg(()=>{if(!t.rowSelection)return void e.current.setRowSelectionModel(r_);if(void 0===a)return;if(!i||!o||"include"===a.type&&0===a.ids.size)return void e.current.setRowSelectionModel(a);const n=e.current.getPropagatedRowSelectionModel(a);n.type===a.type&&n.ids.size===a.ids.size&&Array.from(a.ids).every(e=>n.ids.has(e))?e.current.setRowSelectionModel(a):e.current.setRowSelectionModel(n)});rI(e,"filteredRowsSet",r(()=>R())),rI(e,"rowClick",r(M)),rI(e,"rowSelectionCheckboxChange",r(I)),rI(e,"headerSelectionCheckboxChange",D),rI(e,"cellMouseDown",r(T)),rI(e,"cellKeyDown",r(F)),s.useEffect(()=>{L()},[e,a,t.rowSelection,L]);const A=null!=a;s.useEffect(()=>{if(A||!t.rowSelection||"function"!=typeof b)return;const n=LD(e);if("include"!==n.type)return;const r=new Set;for(const e of n.ids)b(e)&&r.add(e);r.size<n.ids.size&&e.current.setRowSelectionModel({type:n.type,ids:r})},[e,b,A,t.rowSelection]),s.useEffect(()=>{if(!t.rowSelection||A)return;const n=LD(e);!p&&("include"===n.type&&n.ids.size>1||"exclude"===n.type)&&e.current.setRowSelectionModel(r_)},[e,p,c,A,t.rowSelection]),s.useEffect(()=>{r(R)},[R,r]),s.useEffect(()=>{E.current&&(E.current=!1)},[])})(e,t),PB(e,t),((e,t,n)=>{const r=bL(e,"useGridRows"),o=s.useRef(Date.now()),i=s.useRef(t.rowCount),a=Ng(),{setRowIndex:l,setRowPosition:c}=n.hooks.useGridRowsOverridableMethods(e,t),u=s.useCallback(t=>{const n=wT(e)[t];if(n)return n;const r=ST(e,t);return r&&jT(r)?{[DT]:t}:null},[e]),d=s.useCallback(t=>zD(e,t),[e]),p=s.useCallback(({cache:n,throttle:r})=>{const i=()=>{o.current=Date.now(),e.current.setState(n=>f({},n,{rows:$T({apiRef:e,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:xT(e),previousTreeDepths:ET(e),previousGroupsToFetch:CT(e)})})),e.current.publishEvent("rowsSet")};if(a.clear(),e.current.caches.rows=n,!r)return void i();const l=t.throttleRowsMs-(Date.now()-o.current);l>0?a.start(l,i):i()},[t.throttleRowsMs,t.rowCount,t.loading,e,a]),h=s.useCallback(n=>{if(r.debug(`Updating all rows, new length ${n.length}`),!t.dataSource&&SL(e))return void e.current.updateNonPivotRows(n,!1);const o=AT({rows:n,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),i=e.current.caches.rows;o.rowsBeforePartialUpdates=i.rowsBeforePartialUpdates,p({cache:o,throttle:!0})},[r,t.getRowId,t.dataSource,t.loading,t.rowCount,p,e]),m=s.useCallback(n=>{if(t.signature===QT.DataGrid&&n.length>1)throw new Error(["MUI X: You cannot update several rows at once in `apiRef.current.updateRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join("\n"));if(!t.dataSource&&SL(e))return void e.current.updateNonPivotRows(n);const r=VT(e,n,t.getRowId),o=_T({updates:r,getRowId:t.getRowId,previousCache:e.current.caches.rows});p({cache:o,throttle:!0})},[t.signature,t.dataSource,t.getRowId,p,e]),g=s.useCallback((n,r)=>{const o=VT(e,n,t.getRowId),i=_T({updates:o,getRowId:t.getRowId,previousCache:e.current.caches.rows,groupKeys:r??[]});p({cache:i,throttle:!1})},[t.getRowId,p,e]),v=s.useCallback(t=>{r.debug(`Setting loading to ${t}`),e.current.setState(e=>f({},e,{rows:f({},e.rows,{loading:t})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t},[e,r]),b=s.useCallback(()=>{const t=PT(e),n=wT(e);return new Map(t.map(e=>[e,n[e]??{}]))},[e]),y=s.useCallback(()=>vT(e),[e]),w=s.useCallback(()=>PT(e),[e]),x=s.useCallback(t=>{const{rowIdToIndexMap:n}=lN(e);return n.get(t)},[e]),S=s.useCallback((t,n)=>{const r=ST(e,t);if(!r)throw new Error(`MUI X: No row with id #${t} found.`);if("group"!==r.type)throw new Error("MUI X: Only group nodes can be expanded or collapsed.");const o=f({},r,{childrenExpanded:n});e.current.setState(e=>f({},e,{rows:f({},e.rows,{tree:f({},e.rows.tree,{[t]:o})})})),e.current.publishEvent("rowExpansionChange",o)},[e]),C=s.useCallback(()=>{const t=f({},xT(e)),n=e=>{const r=t[e];"group"===r?.type&&(t[e]=f({},r,{childrenExpanded:!0}),r.children.forEach(n))};n(OT),e.current.setState(e=>f({},e,{rows:f({},e.rows,{tree:t})})),e.current.publishEvent("rowExpansionChange",t[OT])},[e]),k=s.useCallback(()=>{const t=f({},xT(e)),n=e=>{const r=t[e];"group"===r?.type&&(t[e]=f({},r,{childrenExpanded:!1}),r.children.forEach(n))};n(OT),e.current.setState(e=>f({},e,{rows:f({},e.rows,{tree:t})})),e.current.publishEvent("rowExpansionChange",t[OT])},[e]),E=s.useCallback(t=>ST(e,t)??null,[e]),R=s.useCallback(({skipAutoGeneratedRows:t=!0,groupId:n,applySorting:r,applyFiltering:o,directChildrenOnly:i=!1})=>{const a=xT(e);let l;if(r){const r=a[n];if(!r)return[];const o=hD(e);l=[];for(let e=o.findIndex(e=>e===n)+1;e<o.length&&(i?a[o[e]].depth===r.depth+1:a[o[e]].depth>r.depth);e+=1){const n=o[e];t&&jT(a[n])||l.push(n)}}else l=BT(a,n,t,i);if(o){const t=SD(e);l=pD(t)?l:l.filter(e=>!1!==t[e])}return l},[e]),P={getRow:u,setLoading:v,getRowId:d,getRowModels:b,getRowsCount:y,getAllRowIds:w,setRows:h,updateRows:m,getRowNode:E,getRowIndexRelativeToVisibleRows:x,unstable_replaceRows:s.useCallback((n,r)=>{if(t.signature===QT.DataGrid&&r.length>1)throw new Error(["MUI X: You cannot replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join("\n"));if(0===r.length)return;if(RT(e)>1)throw new Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");const o=f({},xT(e)),i=f({},wT(e)),a=o[OT],l=[...a.children],s=new Set;for(let e=0;e<r.length;e+=1){const a=r[e],c=FT(a,t.getRowId,"A row was provided without id when calling replaceRows()."),[u]=l.splice(n+e,1,c);s.has(u)||(delete i[u],delete o[u]);const d={id:c,depth:0,parent:OT,type:"leaf",groupingKey:null};i[c]=a,o[c]=d,s.add(c)}o[OT]=f({},a,{children:l});const c=l.filter(e=>"leaf"===o[e]?.type);e.current.caches.rows.dataRowIdToModelLookup=i,e.current.setState(e=>f({},e,{rows:f({},e.rows,{loading:t.loading,totalRowCount:Math.max(t.rowCount||0,l.length),dataRowIdToModelLookup:i,dataRowIds:c,tree:o})})),e.current.publishEvent("rowsSet")},[e,t.signature,t.getRowId,t.loading,t.rowCount])},M={setRowIndex:l,setRowPosition:c,setRowChildrenExpansion:S,getRowGroupChildren:R,expandAllRows:C,collapseAllRows:k},T={updateNestedRows:g},I=s.useCallback(()=>{let n;r.info("Row grouping pre-processing have changed, regenerating the row tree"),n=e.current.caches.rows.rowsBeforePartialUpdates===t.rows?f({},e.current.caches.rows,{updates:{type:"full",rows:PT(e)}}):AT({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),p({cache:n,throttle:!1})},[r,e,t.rows,t.getRowId,t.loading,t.rowCount,p]),O=Dg(()=>t.dataSource),D=s.useCallback(e=>{t.dataSource&&t.dataSource!==O.current?O.current=t.dataSource:"rowTreeCreation"===e&&I()},[I,O,t.dataSource]),F=s.useCallback(()=>{e.current.getActiveStrategy(pB.RowTree)!==kT(e)&&I()},[e,I]);rI(e,"activeStrategyProcessorChange",D),rI(e,"strategyAvailabilityChange",F);const L=s.useCallback(()=>{e.current.setState(n=>{const r=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:xT(e),treeDepths:ET(e),dataRowIds:PT(e),dataRowIdToModelLookup:wT(e)});return f({},n,{rows:f({},n.rows,r,{totalTopLevelRowCount:NT({tree:r.tree,rowCountProp:t.rowCount})})})}),e.current.publishEvent("rowsSet")},[e,t.rowCount]);fN(e,"hydrateRows",L),vL(e,P,"public"),vL(e,M,t.signature===QT.DataGrid?"private":"public"),vL(e,T,"private");const A=s.useRef(!0);s.useEffect(()=>{if(A.current)return void(A.current=!1);let n=!1;t.rowCount!==i.current&&(n=!0,i.current=t.rowCount);const o=t.dataSource?MT(e):t.rows,a=e.current.caches.rows.rowsBeforePartialUpdates===o,l=e.current.caches.rows.loadingPropBeforePartialUpdates===t.loading,s=e.current.caches.rows.rowCountPropBeforePartialUpdates===t.rowCount;a&&(l||(e.current.setState(e=>f({},e,{rows:f({},e.rows,{loading:t.loading})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t.loading),s||(e.current.setState(e=>f({},e,{rows:f({},e.rows,{totalRowCount:Math.max(t.rowCount||0,e.rows.totalRowCount),totalTopLevelRowCount:Math.max(t.rowCount||0,e.rows.totalTopLevelRowCount)})})),e.current.caches.rows.rowCountPropBeforePartialUpdates=t.rowCount),!n)||(r.debug(`Updating all rows, new length ${o?.length}`),p({cache:AT({rows:o,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),throttle:!1}))},[t.rows,t.rowCount,t.getRowId,t.loading,t.dataSource,r,p,e])})(e,t,n),L_(e,t),n_(e,t,n),(e=>{const t=()=>e.current.virtualizer.api.resetColSpan(),n={unstable_getCellColSpanInfo:(...t)=>e.current.virtualizer.api.getCellColSpanInfo(...t)},r={resetColSpan:t,calculateColSpan:(...t)=>{e.current.virtualizer.api.calculateColSpan(...t)}};vL(e,n,"public"),vL(e,r,"private"),rI(e,"columnOrderChange",t)})(e),((e,t)=>{const n=s.useCallback(t=>ZF(e)[t]??[],[e]),r=s.useCallback(()=>JF(e),[e]);vL(e,{getColumnGroupPath:n,getAllGroupDetails:r},"public");const o=s.useCallback(()=>{const n=g_(t.columnGroupingModel??[]);e.current.setState(e=>{const t=e.columns?.orderedFields??[],r=e.pinnedColumns??{},o=v_(t,n,r);return f({},e,{columnGrouping:f({},e.columnGrouping,{headerStructure:o})})})},[e,t.columnGroupingModel]),i=s.useCallback(t=>{if(!t&&!e.current.caches.columnGrouping.lastColumnGroupingModel)return;e.current.caches.columnGrouping.lastColumnGroupingModel=t;const n=e.current.getPinnedColumns?.()??{},r=oO(e),o=uO(e),i=h_(t??[]),a=g_(t??[]),l=v_(r,a,n),s=0===o.length?0:Math.max(...o.map(e=>a[e]?.length??0));e.current.setState(e=>f({},e,{columnGrouping:{lookup:i,unwrappedGroupingModel:a,headerStructure:l,maxDepth:s}}))},[e]);rI(e,"columnIndexChange",o),rI(e,"columnsChange",()=>{i(t.columnGroupingModel)}),rI(e,"columnVisibilityModelChange",()=>{i(t.columnGroupingModel)}),s.useEffect(()=>{t.columnGroupingModel!==e.current.caches.columnGrouping.lastColumnGroupingModel&&i(t.columnGroupingModel)},[e,i,t.columnGroupingModel])})(e,t),ZB(e,t,n),((e,t)=>{const n=bL(e,"useGridFocus"),r=s.useRef(null),o=null!==e.current.rootElementRef.current,i=s.useCallback((t,n)=>{t&&e.current.getRow(t.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(t.id,t.field),n)},[e]),a=s.useCallback((t,r)=>{const o=YD(e);o?.id===t&&o?.field===r||(e.current.setState(e=>(n.debug(`Focusing on cell with id=${t} and field=${r}`),f({},e,{tabIndex:{cell:{id:t,field:r},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},focus:{cell:{id:t,field:r},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))),e.current.getRow(t)&&(o&&i(o,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(t,r))))},[e,n,i]),l=s.useCallback((t,r={})=>{const o=YD(e);i(o,r),e.current.setState(e=>(n.debug(`Focusing on column header with colIndex=${t}`),f({},e,{tabIndex:{columnHeader:{field:t},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:t},columnHeaderFilter:null,cell:null,columnGroupHeader:null}})))},[e,n,i]),c=s.useCallback((t,r={})=>{const o=YD(e);i(o,r),e.current.setState(e=>(n.debug(`Focusing on column header filter with colIndex=${t}`),f({},e,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:t},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:t},cell:null,columnGroupHeader:null}})))},[e,n,i]),u=s.useCallback((t,n,r={})=>{const o=YD(e);o&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(o.id,o.field),r),e.current.setState(e=>f({},e,{tabIndex:{columnGroupHeader:{field:t,depth:n},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:t,depth:n},columnHeader:null,columnHeaderFilter:null,cell:null}}))},[e]),d=s.useCallback(()=>QD(e),[e]),p=s.useCallback((n,r,o)=>{let i=e.current.getColumnIndex(r);const a=cO(e),l=lN(e,(t.pagination,t.paginationMode)),s=TT(e),c=[].concat(s.top||[],l.rows,s.bottom||[]);let u=c.findIndex(e=>e.id===n);"right"===o?i+=1:"left"===o?i-=1:u+=1,i>=a.length?(u+=1,u<c.length&&(i=0)):i<0&&(u-=1,u>=0&&(i=a.length-1)),u=FI(u,0,c.length-1);const d=c[u];if(!d)return;const p=e.current.unstable_getCellColSpanInfo(d.id,i);p&&p.spannedByColSpan&&("left"===o||"below"===o?i=p.leftVisibleCellIndex:"right"===o&&(i=p.rightVisibleCellIndex)),i=FI(i,0,a.length-1);const f=a[i];e.current.setCellFocus(d.id,f.field)},[e,t.pagination,t.paginationMode]),h=s.useCallback(({id:t,field:n})=>{e.current.setCellFocus(t,n)},[e]),m=s.useCallback((t,n)=>{"Enter"===n.key||"Tab"===n.key||"Shift"===n.key||AO(n.key)||e.current.setCellFocus(t.id,t.field)},[e]),g=s.useCallback(({field:t},n)=>{n.target===n.currentTarget&&e.current.setColumnHeaderFocus(t,n)},[e]),v=s.useCallback(({fields:t,depth:n},r)=>{if(r.target!==r.currentTarget)return;const o=QD(e);null!==o&&o.depth===n&&t.includes(o.field)||e.current.setColumnGroupHeaderFocus(t[0],n,r)},[e]),b=s.useCallback((t,r)=>{r.relatedTarget?.getAttribute("class")?.includes(XT.columnHeader)||(n.debug("Clearing focus"),e.current.setState(e=>f({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[n,e]),y=s.useCallback(e=>{r.current=e},[]),w=s.useCallback(t=>{const n=r.current;r.current=null;const o=YD(e);if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:t,cell:n}))return;if(!o)return void(n&&e.current.setCellFocus(n.id,n.field));if(n?.id===o.id&&n?.field===o.field)return;const a=e.current.getCellElement(o.id,o.field);a?.contains(t.target)||(n?e.current.setCellFocus(n.id,n.field):(e.current.setState(e=>f({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),i(o,t)))},[e,i]),x=s.useCallback(t=>{if("view"===t.cellMode)return;const n=YD(e);n?.id===t.id&&n?.field===t.field||e.current.setCellFocus(t.id,t.field)},[e]),S=s.useCallback(()=>{const n=YD(e);if(n&&!e.current.getRow(n.id)){const r=n.id;let o=null;if(void 0!==r){const n=e.current.getRowElement(r),i=n?.dataset.rowindex?Number(n?.dataset.rowindex):0,a=lN(e,(t.pagination,t.paginationMode)),l=a.rows[FI(i,0,a.rows.length-1)];o=l?.id??null}e.current.setState(e=>f({},e,{focus:{cell:null===o?null:{id:o,field:n.field},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))}},[e,t.pagination,t.paginationMode]),C=s.useMemo(()=>Cg(S,0),[S]),k=Mg(()=>{const n=YD(e);if(!n)return;const r=lN(e,(t.pagination,t.paginationMode));if(r.rows.find(e=>e.id===n.id)||0===r.rows.length)return;const o=cO(e);e.current.setState(e=>f({},e,{tabIndex:{cell:{id:r.rows[0].id,field:o[0].field},columnGroupHeader:null,columnHeader:null,columnHeaderFilter:null}}))}),E={moveFocusToRelativeCell:p,setColumnGroupHeaderFocus:u,getColumnGroupHeaderFocus:d};vL(e,{setCellFocus:a,setColumnHeaderFocus:l,setColumnHeaderFilterFocus:c},"public"),vL(e,E,"private"),s.useEffect(()=>{const t=kg(e.current.rootElementRef.current);return t.addEventListener("mouseup",w),()=>{t.removeEventListener("mouseup",w)}},[e,o,w]),rI(e,"columnHeaderBlur",b),rI(e,"cellDoubleClick",h),rI(e,"cellMouseDown",y),rI(e,"cellKeyDown",m),rI(e,"cellModeChange",x),rI(e,"columnHeaderFocus",g),rI(e,"columnGroupHeaderFocus",v),rI(e,"rowsSet",C),rI(e,"paginationModelChange",k)})(e,t),((e,t)=>{const n=bL(e,"useGridPreferencesPanel"),r=s.useCallback(()=>{e.current.setState(t=>{if(!t.preferencePanel.open)return t;n.debug("Hiding Preferences Panel");const r=KL(e);return e.current.publishEvent("preferencePanelClose",{openedPanelValue:r.openedPanelValue}),f({},t,{preferencePanel:{open:!1}})})},[e,n]),o=s.useCallback((t,r,o)=>{n.debug("Opening Preferences Panel"),e.current.setState(e=>f({},e,{preferencePanel:f({},e.preferencePanel,{open:!0,openedPanelValue:t,panelId:r,labelId:o})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:t})},[n,e]);vL(e,{showPreferences:o,hidePreferences:r},"public");const i=s.useCallback((n,r)=>{const o=KL(e);return!r.exportOnlyDirtyModels||null!=t.initialState?.preferencePanel||o.open?f({},n,{preferencePanel:o}):n},[e,t.initialState?.preferencePanel]),a=s.useCallback((t,n)=>{const r=n.stateToRestore.preferencePanel;return null!=r&&e.current.setState(e=>f({},e,{preferencePanel:r})),t},[e]);pN(e,"exportState",i),pN(e,"restoreState",a)})(e,t),((e,t,n)=>{const r=bL(e,"useGridFilter");e.current.registerControlState({stateId:"filter",propModel:t.filterModel,propOnChange:t.onFilterModelChange,stateSelector:yD,changeEvent:"filterModelChange"});const o=s.useCallback(()=>{e.current.setState(t=>{const n=yD(e),r=e.current.getFilterState(n),o=f({},t,{filter:f({},t.filter,r)});return f({},o,{visibleRowsLookup:NB(e,o)})}),e.current.publishEvent("filteredRowsSet")},[e]),i=s.useCallback((e,n)=>null==n||!1===n.filterable||t.disableColumnFilter?e:[...e,"columnMenuFilterItem"],[t.disableColumnFilter]),a=s.useCallback(t=>{const n=yD(e),r=[...n.items],o=r.findIndex(e=>e.id===t.id);-1===o?r.push(t):r[o]=t,e.current.setFilterModel(f({},n,{items:r}),"upsertFilterItem")},[e]),l=s.useCallback(t=>{const n=yD(e),r=[...n.items];t.forEach(e=>{const t=r.findIndex(t=>t.id===e.id);-1===t?r.push(e):r[t]=e}),e.current.setFilterModel(f({},n,{items:r}),"upsertFilterItems")},[e]),c=s.useCallback(t=>{const n=yD(e),r=n.items.filter(e=>e.id!==t.id);r.length!==n.items.length&&e.current.setFilterModel(f({},n,{items:r}),"deleteFilterItem")},[e]),u=s.useCallback((n,o,i)=>{if(r.debug("Displaying filter panel"),n){const r=yD(e),o=r.items.filter(t=>{if(void 0!==t.value)return!Array.isArray(t.value)||0!==t.value.length;const n=e.current.getColumn(t.field),r=n.filterOperators?.find(e=>e.value===t.operator);return!(void 0===r?.requiresFilterValue||r?.requiresFilterValue)});let i;const a=o.find(e=>e.field===n),l=e.current.getColumn(n);i=a?o:t.disableMultipleColumnsFiltering?[yO({field:n,operator:l.filterOperators[0].value},e)]:[...o,yO({field:n,operator:l.filterOperators[0].value},e)],e.current.setFilterModel(f({},r,{items:i}))}e.current.showPreferences(YL.filters,o,i)},[e,r,t.disableMultipleColumnsFiltering]),d=s.useCallback(()=>{r.debug("Hiding filter panel"),e.current.hidePreferences()},[e,r]),p=s.useCallback(t=>{const n=yD(e);n.logicOperator!==t&&e.current.setFilterModel(f({},n,{logicOperator:t}),"changeLogicOperator")},[e]),h=s.useCallback(t=>{const n=yD(e);JL(n.quickFilterValues,t)||e.current.setFilterModel(f({},n,{quickFilterValues:[...t]}))},[e]),m=s.useCallback((n,o)=>{yD(e)!==n&&(r.debug("Setting filter model"),e.current.updateControlState("filter",xO(n,t.disableMultipleColumnsFiltering,e),o),e.current.unstable_applyFilters())},[e,r,t.disableMultipleColumnsFiltering]),g=s.useCallback(r=>{const o=wO(r,t.disableMultipleColumnsFiltering,e),i=n.hooks.useFilterValueGetter(e,t),a="client"===t.filterMode?PO(o,i,e,t.disableEval):null;return f({},e.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:a,filterModel:o??XI(),filterValueGetter:i}),{filterModel:o})},[e,n.hooks,t]),v={setFilterLogicOperator:p,unstable_applyFilters:o,deleteFilterItem:c,upsertFilterItem:a,upsertFilterItems:l,setFilterModel:m,showFilterPanel:u,hideFilterPanel:d,setQuickFilterValues:h,ignoreDiacritics:t.ignoreDiacritics,getFilterState:g};vL(e,v,"public");const b=s.useCallback((n,r)=>{const o=yD(e);return o.items.forEach(e=>{delete e.fromInput}),r.exportOnlyDirtyModels&&null==t.filterModel&&null==t.initialState?.filter?.filterModel&&JL(o,XI())?n:f({},n,{filter:{filterModel:o}})},[e,t.filterModel,t.initialState?.filter?.filterModel]),y=s.useCallback((n,r)=>{const o=r.stateToRestore.filter?.filterModel;return null==o?n:(e.current.updateControlState("filter",xO(o,t.disableMultipleColumnsFiltering,e),"restoreState"),f({},n,{callbacks:[...n.callbacks,e.current.unstable_applyFilters]}))},[e,t.disableMultipleColumnsFiltering]),w=s.useCallback((e,n)=>{if(n===YL.filters){const e=t.slots.filterPanel;return Xp.jsx(e,f({},t.slotProps?.filterPanel))}return e},[t.slots.filterPanel,t.slotProps?.filterPanel]),{getRowId:x}=t,S=Dg($B),C=s.useCallback(n=>{if("client"!==t.filterMode||!n.isRowMatchingFilters||!n.filterModel.items.length&&!n.filterModel.quickFilterValues?.length)return YI;const r=wT(e),o={},{isRowMatchingFilters:i}=n,a={},l={passingFilterItems:null,passingQuickFilterValues:null},s=S.current(e.current.state.rows.dataRowIdToModelLookup);for(let t=0;t<s.length;t+=1){const r=s[t],c=x?x(r):r.id;i(r,void 0,l);const u=TO([l.passingFilterItems],[l.passingQuickFilterValues],n.filterModel,n.filterValueGetter,e,a);u||(o[c]=u)}const c="auto-generated-group-footer-root";return r[c]&&(o[c]=!0),{filteredRowsLookup:o,filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}}},[e,t.filterMode,x,S]);pN(e,"columnMenu",i),pN(e,"exportState",b),pN(e,"restoreState",y),pN(e,"preferencePanel",w),fB(e,hB,"filtering",C),fB(e,hB,"visibleRowsLookupCreation",AB);const k=s.useCallback(()=>{r.debug("onColUpdated - GridColumns changed, applying filters");const t=yD(e),n=iO(e),o=t.items.filter(e=>e.field&&n[e.field]);o.length<t.items.length&&e.current.setFilterModel(f({},t,{items:o}))},[e,r]),E=s.useCallback(t=>{"filtering"===t&&e.current.unstable_applyFilters()},[e]),R=s.useCallback(()=>{e.current.setState(t=>f({},t,{visibleRowsLookup:NB(e,t)}))},[e]);rI(e,"rowsSet",o),rI(e,"columnsChange",k),rI(e,"activeStrategyProcessorChange",E),rI(e,"rowExpansionChange",R),rI(e,"columnVisibilityModelChange",()=>{const t=yD(e);t.quickFilterValues?.length&&RO(t)&&o()}),wL(()=>{"DataGrid"===t.signature&&o()}),Wh(()=>{void 0!==t.filterModel&&e.current.setFilterModel(t.filterModel)},[e,r,t.filterModel])})(e,t,n),((e,t)=>{const n=bL(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:gD,changeEvent:"sortModelChange"});const r=s.useCallback((t,n)=>{const r=gD(e),o=r.findIndex(e=>e.field===t);let i=[...r];return o>-1?null==n?.sort?i.splice(o,1):i.splice(o,1,n):i=[...r,n],i},[e]),o=s.useCallback((n,r)=>{const o=gD(e).find(e=>e.field===n.field);if(o){const e=void 0===r?CI(n.sortingOrder??t.sortingOrder,o.sort):r;return void 0===e?void 0:f({},o,{sort:e})}return{field:n.field,sort:void 0===r?CI(n.sortingOrder??t.sortingOrder):r}},[e,t.sortingOrder]),i=s.useCallback((e,n)=>null==n||!1===n.sortable||t.disableColumnSorting?e:(n.sortingOrder||t.sortingOrder).some(e=>!!e)?[...e,"columnMenuSortItem"]:e,[t.sortingOrder,t.disableColumnSorting]),a=s.useCallback(()=>{e.current.setState(r=>{if("server"===t.sortingMode)return n.debug("Skipping sorting rows as sortingMode = server"),f({},r,{sorting:f({},r.sorting,{sortedRows:BT(xT(e),OT,!1)})});const o=gD(e),i=SI(o,e),a=e.current.applyStrategyProcessor("sorting",{sortRowList:i});return f({},r,{sorting:f({},r.sorting,{sortedRows:a})})}),e.current.publishEvent("sortedRowsSet")},[e,n,t.sortingMode]),l=s.useCallback(r=>{gD(e)!==r&&(n.debug("Setting sort model"),e.current.setState(xI(r,t.disableMultipleColumnsSorting)),e.current.applySorting())},[e,n,t.disableMultipleColumnsSorting]),c=s.useCallback((n,i,a)=>{const l=e.current.getColumn(n),s=o(l,i);let c;c=!a||t.disableMultipleColumnsSorting?null==s?.sort?[]:[s]:r(l.field,s),e.current.setSortModel(c)},[e,r,o,t.disableMultipleColumnsSorting]),u=s.useCallback(()=>gD(e),[e]),d=s.useCallback(()=>mD(e).map(e=>e.model),[e]),p=s.useCallback(()=>hD(e),[e]),h=s.useCallback(t=>e.current.getSortedRowIds()[t],[e]);vL(e,{getSortModel:u,getSortedRows:d,getSortedRowIds:p,getRowIdFromRowIndex:h,setSortModel:l,sortColumn:c,applySorting:a},"public");const m=s.useCallback((n,r)=>{const o=gD(e);return!r.exportOnlyDirtyModels||null!=t.sortModel||null!=t.initialState?.sorting?.sortModel||o.length>0?f({},n,{sorting:{sortModel:o}}):n},[e,t.sortModel,t.initialState?.sorting?.sortModel]),g=s.useCallback((n,r)=>{const o=r.stateToRestore.sorting?.sortModel;return null==o?n:(e.current.setState(xI(o,t.disableMultipleColumnsSorting)),f({},n,{callbacks:[...n.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),v=s.useCallback(t=>{const n=xT(e),r=n[OT],o=t.sortRowList?t.sortRowList(r.children.map(e=>n[e])):[...r.children];return null!=r.footerId&&o.push(r.footerId),o},[e]);pN(e,"exportState",m),pN(e,"restoreState",g),fB(e,hB,"sorting",v);const b=s.useCallback(({field:e,colDef:n},r)=>{if(!n.sortable||t.disableColumnSorting)return;const o="always"===t.multipleColumnsSortingMode||r.shiftKey||r.metaKey||r.ctrlKey;c(e,void 0,o)},[c,t.disableColumnSorting,t.multipleColumnsSortingMode]),y=s.useCallback(({field:e,colDef:n},r)=>{n.sortable&&!t.disableColumnSorting&&("Enter"!==r.key||r.ctrlKey||r.metaKey||c(e,void 0,"always"===t.multipleColumnsSortingMode||r.shiftKey))},[c,t.disableColumnSorting,t.multipleColumnsSortingMode]),w=s.useCallback(()=>{const t=gD(e),n=iO(e);if(t.length>0){const r=t.filter(e=>n[e.field]);r.length<t.length&&e.current.setSortModel(r)}},[e]),x=s.useCallback(t=>{"sorting"===t&&e.current.applySorting()},[e]);pN(e,"columnMenu",i),rI(e,"columnHeaderClick",b),rI(e,"columnHeaderKeyDown",y),rI(e,"rowsSet",e.current.applySorting),rI(e,"columnsChange",w),rI(e,"activeStrategyProcessorChange",x),wL(()=>{"DataGrid"===t.signature&&e.current.applySorting()}),Wh(()=>{void 0!==t.sortModel&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])})(e,t),((e,t)=>{const n=bL(e,"useDensity");e.current.registerControlState({stateId:"density",propModel:t.density,propOnChange:t.onDensityChange,stateSelector:hI,changeEvent:"densityChange"});const r=Mg(t=>{hI(e)!==t&&(n.debug(`Set grid density to ${t}`),e.current.setState(e=>f({},e,{density:t})))});vL(e,{setDensity:r},"public");const o=s.useCallback((n,r)=>{const o=hI(e);return r.exportOnlyDirtyModels&&null==t.density&&null==t.initialState?.density?n:f({},n,{density:o})},[e,t.density,t.initialState?.density]),i=s.useCallback((t,n)=>{const r=n.stateToRestore?.density?n.stateToRestore.density:hI(e);return e.current.setState(e=>f({},e,{density:r})),t},[e]);pN(e,"exportState",o),pN(e,"restoreState",i),s.useEffect(()=>{t.density&&e.current.setDensity(t.density)},[e,t.density])})(e,t),M_(e,t),WB(e,t),((e,t)=>{const n=um(),r=bL(e,"useGridScroll"),o=e.current.columnHeadersContainerRef,i=e.current.virtualScrollerRef,a=s.useCallback(n=>{const o=oT(e),a=vT(e),l=cO(e);if(null!=n.rowIndex&&0===a||0===l.length)return!1;r.debug(`Scrolling to cell at row ${n.rowIndex}, col: ${n.colIndex} `);let s={};if(void 0!==n.colIndex){const t=hO(e);let r;if(void 0!==n.rowIndex){const t=CD(e),o=t[n.rowIndex]?.id,i=e.current.unstable_getCellColSpanInfo(o,n.colIndex);i&&!i.spannedByColSpan&&(r=i.cellProps.width)}void 0===r&&(r=l[n.colIndex].computedWidth),s.left=l_({containerSize:o.viewportOuterSize.width,scrollPosition:Math.abs(i.current.scrollLeft),elementSize:r,elementOffset:t[n.colIndex]})}if(void 0!==n.rowIndex){const r=mT(e),a=uF(e),l=dF(e),c=t.pagination?n.rowIndex-a*l:n.rowIndex,u=r.positions[c+1]?r.positions[c+1]-r.positions[c]:r.currentPageTotalHeight-r.positions[c];s.top=l_({containerSize:o.viewportInnerSize.height,scrollPosition:i.current.scrollTop,elementSize:u,elementOffset:r.positions[c]})}return s=e.current.unstable_applyPipeProcessors("scrollToIndexes",s,n),(void 0!==s.left||void 0!==s.top)&&(e.current.scroll(s),!0)},[r,e,i,t.pagination]),l=s.useCallback(e=>{if(i.current&&void 0!==e.left&&o.current){const t=n?-1:1;o.current.scrollLeft=e.left,i.current.scrollLeft=t*e.left,r.debug(`Scrolling left: ${e.left}`)}i.current&&void 0!==e.top&&(i.current.scrollTop=e.top,r.debug(`Scrolling top: ${e.top}`)),r.debug("Scrolling, updating container, and viewport")},[i,n,o,r]),c=s.useCallback(()=>i?.current?{top:i.current.scrollTop,left:i.current.scrollLeft}:{top:0,left:0},[i]);vL(e,{scroll:l,scrollToIndexes:a,getScrollPosition:c},"public")})(e,t),(e=>{const t=bL(e,"useGridColumnMenu"),n=s.useRef({}),r=s.useCallback(()=>{n.current.wheel?.(),n.current.touchMove?.()},[]),o=s.useCallback(()=>{r(),n.current.wheel=e.current.subscribeEvent("virtualScrollerWheel",e.current.hideColumnMenu),n.current.touchMove=e.current.subscribeEvent("virtualScrollerTouchMove",e.current.hideColumnMenu)},[e,r]),i=s.useCallback(n=>{const r=RL(e),i=n;(!0!==r.open||i!==r.field)&&(e.current.setState(e=>e.columnMenu.open&&e.columnMenu.field===n?e:(t.debug("Opening Column Menu"),o(),f({},e,{columnMenu:{open:!0,field:n}}))),e.current.hidePreferences())},[e,t,o]),a=s.useCallback(()=>{const n=RL(e);if(n.field){const t=iO(e),r=lO(e),o=oO(e);let i=n.field;if(t[i]||(i=o[0]),!1===r[i]){const e=o.filter(e=>e===i||!1!==r[e]),t=e.indexOf(i);i=e[t+1]||e[t-1]}e.current.setColumnHeaderFocus(i)}const o={open:!1,field:void 0};(o.open!==n.open||o.field!==n.field)&&e.current.setState(e=>(t.debug("Hiding Column Menu"),r(),f({},e,{columnMenu:o})))},[e,t,r]),l=s.useCallback(n=>{t.debug("Toggle Column Menu");const r=RL(e);r.open&&r.field===n?a():i(n)},[e,t,i,a]);vL(e,{showColumnMenu:i,hideColumnMenu:a,toggleColumnMenu:l},"public"),rI(e,"columnResizeStart",a)})(e),OB(e,t),FB(e,t),kB(e,t),function(e,t){const n=s.useCallback(()=>oT(e),[e]),r={updateDimensions:()=>e.current.virtualizer.api.updateDimensions(),getViewportPageSize:()=>e.current.virtualizer.api.getViewportPageSize()};vL(e,{getRootDimensions:n},"public"),vL(e,r,"private"),iI(e,"rootMount",t=>{p_(t,oT(e))}),iI(e,"debouncedResize",t.onResize),QM(e.current.store,e=>e.dimensions,(t,n)=>{var r,o;n.isReady&&(e.current.rootElementRef.current&&p_(e.current.rootElementRef.current,n),r=n.viewportInnerSize,o=t.viewportInnerSize,(r.width!==o.width||r.height!==o.height)&&e.current.publishEvent("viewportInnerSizeChange",n.viewportInnerSize),e.current.publishEvent("debouncedResize",n.root))})}(e,t),function(e,t){iI(e,"columnHeaderClick",t.onColumnHeaderClick),iI(e,"columnHeaderContextMenu",t.onColumnHeaderContextMenu),iI(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),iI(e,"columnHeaderOver",t.onColumnHeaderOver),iI(e,"columnHeaderOut",t.onColumnHeaderOut),iI(e,"columnHeaderEnter",t.onColumnHeaderEnter),iI(e,"columnHeaderLeave",t.onColumnHeaderLeave),iI(e,"cellClick",t.onCellClick),iI(e,"cellDoubleClick",t.onCellDoubleClick),iI(e,"cellKeyDown",t.onCellKeyDown),iI(e,"preferencePanelClose",t.onPreferencePanelClose),iI(e,"preferencePanelOpen",t.onPreferencePanelOpen),iI(e,"menuOpen",t.onMenuOpen),iI(e,"menuClose",t.onMenuClose),iI(e,"rowDoubleClick",t.onRowDoubleClick),iI(e,"rowClick",t.onRowClick),iI(e,"stateChange",t.onStateChange)}(e,t),(e=>{const t=s.useCallback((t={})=>e.current.unstable_applyPipeProcessors("exportState",{},t),[e]),n=s.useCallback(t=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:t}).callbacks.forEach(e=>{e()})},[e]);vL(e,{exportState:t,restoreState:n},"public")})(e),function(e,t){const{autoHeight:n,disableVirtualization:r}=t,o=t=>{const{virtualizer:r}=e.current;t&&=BA;const o=r.store.getSnapshot();o.virtualization.enabled===t&&o.virtualization.enabledForRows===t&&o.virtualization.enabledForColumns===t||r.store.set("virtualization",f({},r.store.state.virtualization,{enabled:t,enabledForColumns:t,enabledForRows:t&&!n}))};vL(e,{unstable_setVirtualization:o,unstable_setColumnVirtualization:t=>{const{virtualizer:n}=e.current;t&&=BA,n.store.getSnapshot().virtualization.enabledForColumns!==t&&n.store.set("virtualization",f({},n.store.state.virtualization,{enabledForColumns:t}))}},"public");const i=()=>{const{virtualizer:t}=e.current;t?.api.scheduleUpdateRenderContext()};e.current.register("private",{updateRenderContext:i}),iI(e,"sortedRowsSet",i),iI(e,"paginationModelChange",i),iI(e,"columnsChange",i),s.useEffect(()=>{e.current.virtualizer&&o(!t.disableVirtualization)},[e,r,n])}(e,t),function(e,t){const n=()=>{e.current.setState(t=>t.listViewColumn?f({},t,{listViewColumn:f({},t.listViewColumn,{computedWidth:N_(e)})}):t)},r=s.useRef(null);rI(e,"viewportInnerSizeChange",e=>{r.current!==e.width&&(r.current=e.width,n())}),rI(e,"columnVisibilityModelChange",n),Wh(()=>{const n=t.listViewColumn;n&&e.current.setState(t=>f({},t,{listViewColumn:f({},n,{computedWidth:N_(e)})}))},[e,t.listViewColumn]),s.useEffect(()=>{t.listView&&t.listViewColumn},[t.listView,t.listViewColumn])}(e,t),V_(e,t),wL(()=>{e.current.runAppliersForPendingProcessors()}),s.useEffect(()=>{e.current.runAppliersForPendingProcessors()})};function U_(e){const{groupId:t,width:n,depth:r,maxDepth:o,fields:i,height:a,colIndex:l,hasFocus:c,tabIndex:u,isLastColumn:d,pinnedPosition:p,pinnedOffset:h}=e,m=rP(),g=um(),v=s.useRef(null),b=lP(),y=pI(b,JF),w=t?y[t]:{},{headerName:x=t??"",description:S="",headerAlign:C}=w;let k;const E=t&&y[t]?.renderHeaderGroup,R=s.useMemo(()=>({groupId:t,headerName:x,description:S,depth:r,maxDepth:o,fields:i,colIndex:l,isLastColumn:d}),[t,x,S,r,o,i,l,d]);t&&E&&(k=E(R));const P=f({},e,{classes:m.classes,headerAlign:C,depth:r,isDragging:!1}),M=x??t,T=mm(),I=null===t?`empty-group-cell-${T}`:t,O=(e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:o,showLeftBorder:i,showRightBorder:a,groupId:l,pinnedPosition:s}=e;return wm({root:["columnHeader","left"===n&&"columnHeader--alignLeft","center"===n&&"columnHeader--alignCenter","right"===n&&"columnHeader--alignRight",r&&"columnHeader--moving",a&&"columnHeader--withRightBorder",i&&"columnHeader--withLeftBorder","withBorderColor",null===l?"columnHeader--emptyGroup":"columnHeader--filledGroup",s===nD.LEFT&&"columnHeader--pinnedLeft",s===nD.RIGHT&&"columnHeader--pinnedRight",o&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]},YT,t)})(P);s.useLayoutEffect(()=>{if(c){const e=v.current.querySelector('[tabindex="0"]')||v.current;if(!e)return;if(CN())e.focus({preventScroll:!0});else{const t=b.current.getScrollPosition();e.focus(),b.current.scroll(t)}}},[b,c]);const D=s.useCallback(e=>t=>{v$(t)||b.current.publishEvent(e,R,t)},[b,R]),F=s.useMemo(()=>({onKeyDown:D("columnGroupHeaderKeyDown"),onFocus:D("columnGroupHeaderFocus"),onBlur:D("columnGroupHeaderBlur")}),[D]),L="function"==typeof w.headerClassName?w.headerClassName(R):w.headerClassName,A=s.useMemo(()=>EN(f({},e.style),g,p,h),[p,h,e.style,g]);return Xp.jsx(D$,f({ref:v,classes:O,columnMenuOpen:!1,colIndex:l,height:a,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:u,isDraggable:!1,headerComponent:k,headerClassName:L,description:S,elementId:I,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:M,"aria-colspan":i.length,"data-fields":`|-${i.join("-|-")}-|`,style:A},F))}const G_={root:XT.scrollbarFiller,pinnedRight:XT["scrollbarFiller--pinnedRight"]};function K_({pinnedRight:e}){return Xp.jsx("div",{role:"presentation",className:PR(G_.root,e&&G_.pinnedRight)})}const q_=pg("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow"})({display:"flex"}),Y_=["className"],X_=jh("div",{name:"MuiDataGrid",slot:"ColumnHeaders"})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),Q_=TR(function(e,t){const{className:n}=e,r=d(e,Y_),o=rP(),i=(e=>{const{classes:t}=e;return wm({root:["columnHeaders"]},YT,t)})(o);return Xp.jsx(X_,f({className:PR(i.root,n),ownerState:o},r,{role:"presentation",ref:t}))}),Z_=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],J_=TR(function(e,t){const{visibleColumns:n,sortColumnLookup:r,filterColumnLookup:o,columnHeaderTabIndexState:i,columnGroupHeaderTabIndexState:a,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:p,columnVisibility:h,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:g}=e,v=d(e,Z_),{getInnerProps:b,getColumnHeadersRow:y,getColumnGroupHeadersRows:w}=(e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:r,columnHeaderTabIndexState:o,columnGroupHeaderTabIndexState:i,columnHeaderFocus:a,columnGroupHeaderFocus:l,headerGroupingMaxDepth:c,columnMenuState:u,columnVisibility:d,columnGroupsHeaderStructure:p,hasOtherElementInTabSequence:h}=e,[m,g]=s.useState(""),[v,b]=s.useState(""),y=mL(),w=rP(),x=pI(y,ZF),S=pI(y,hO),C=pI(y,UA),k=pI(y,pO),E=pI(y,iO),R=EA(S,C,k.left.length),P=pI(y,iT),M=pI(y,cT),T=pI(y,uT),I=pI(y,dT),O=pI(y,fT),D=s.useCallback(e=>b(e.field),[]),F=s.useCallback(()=>b(""),[]),L=s.useCallback(e=>g(e.field),[]),A=s.useCallback(()=>g(""),[]),N=s.useMemo(()=>k.left.length?{firstColumnIndex:0,lastColumnIndex:k.left.length}:null,[k.left.length]),$=s.useMemo(()=>k.right.length?{firstColumnIndex:t.length-k.right.length,lastColumnIndex:t.length}:null,[k.right.length,t.length]);rI(y,"columnResizeStart",D),rI(y,"columnResizeStop",F),rI(y,"columnHeaderDragStart",L),rI(y,"columnHeaderDragEndNative",A);const z=e=>{const{renderContext:n=C}=e||{},r=n.firstColumnIndex,o=Math.min(n.lastColumnIndex,t.length);return{renderedColumns:t.slice(r,o),firstColumnToRender:r,lastColumnToRender:o}},j=(e,t,n,r=!1)=>{const o=e?.position===nD.RIGHT,i=void 0===e?.position,a=k.right.length>0&&o||0===k.right.length&&i,l=R-n;return Xp.jsxs(s.Fragment,{children:[i&&Xp.jsx("div",{role:"presentation",style:{width:l}}),t,i&&Xp.jsx("div",{role:"presentation",className:PR(XT.filler,r&&XT["filler--borderBottom"])}),a&&Xp.jsx(K_,{pinnedRight:o})]})},B=(e,t={})=>{const{renderedColumns:i,firstColumnToRender:l}=z(e),s=[];for(let c=0;c<i.length;c+=1){const d=i[c],p=l+c,g=0===p,b=null!==o&&o.field===d.field||g&&!h?0:-1,y=null!==a&&a.field===d.field,x=u.open&&u.field===d.field,C=e?.position,k=Fj(C,d.computedWidth,p,S,P,O),E=C===nD.RIGHT?i[c-1]:i[c+1],R=!!E&&null!==a&&a.field===E.field,I=c,D=i.length,F=Aj(C,I,w.showColumnVerticalBorder,w.pinnedColumnsSectionSeparator),L=Lj(C,I,D,w.showColumnVerticalBorder,M,w.pinnedColumnsSectionSeparator);s.push(Xp.jsx(F$,f({},n[d.field],{columnMenuOpen:x,filterItemsCounter:r[d.field]&&r[d.field].length,headerHeight:T,isDragging:d.field===m,colDef:d,colIndex:p,isResizing:v===d.field,isLast:p===S.length-1,hasFocus:y,tabIndex:b,pinnedPosition:C,pinnedOffset:k,isSiblingFocused:R,showLeftBorder:F,showRightBorder:L},t),d.field))}return j(e,s,0)},_=({depth:e,params:n})=>{const r=z(n);if(0===r.renderedColumns.length)return null;const{firstColumnToRender:o,lastColumnToRender:a}=r,s=p[e],u=t[o].field,h=x[u]?.[e]??null,m=s.findIndex(({groupId:e,columnFields:t})=>e===h&&t.includes(u)),g=t[a-1].field,v=x[g]?.[e]??null,b=s.findIndex(({groupId:e,columnFields:t})=>e===v&&t.includes(g)),y=s.slice(m,b+1).map(e=>f({},e,{columnFields:e.columnFields.filter(e=>!1!==d[e])})).filter(e=>e.columnFields.length>0),C=y[0].columnFields.indexOf(u),k=y[0].columnFields.slice(0,C).reduce((e,t)=>e+(E[t].computedWidth??0),0);let R=o;const T=y.map(({groupId:t,columnFields:r},o)=>{const a=null!==l&&l.depth===e&&r.includes(l.field),s=null!==i&&i.depth===e&&r.includes(i.field)?0:-1,u={width:r.reduce((e,t)=>e+E[t].computedWidth,0),fields:r,colIndex:R},d=n.position,p=Fj(d,u.width,R,S,P,O);R+=r.length;let f=o;return d===nD.LEFT&&(f=R-1),Xp.jsx(U_,{groupId:t,width:u.width,fields:u.fields,colIndex:u.colIndex,depth:e,isLastColumn:o===y.length-1,maxDepth:c,height:I,hasFocus:a,tabIndex:s,pinnedPosition:d,pinnedOffset:p,showLeftBorder:Aj(d,f,w.showColumnVerticalBorder,w.pinnedColumnsSectionSeparator),showRightBorder:Lj(d,f,y.length,w.showColumnVerticalBorder,M,w.pinnedColumnsSectionSeparator)},o)});return j(n,T,k)};return{renderContext:C,leftRenderContext:N,rightRenderContext:$,pinnedColumns:k,visibleColumns:t,columnPositions:S,getFillers:j,getColumnHeadersRow:()=>Xp.jsxs(q_,{role:"row","aria-rowindex":c+1,ownerState:w,className:XT["row--borderBottom"],style:{height:T},children:[N&&B({position:nD.LEFT,renderContext:N},{disableReorder:!0}),B({renderContext:C}),$&&B({position:nD.RIGHT,renderContext:$},{disableReorder:!0,separatorSide:M$.Left})]}),getColumnsToRender:z,getColumnGroupHeadersRows:()=>{if(0===c)return null;const e=[];for(let t=0;t<c;t+=1)e.push(Xp.jsxs(q_,{role:"row","aria-rowindex":t+1,ownerState:w,style:{height:I},children:[N&&_({depth:t,params:{position:nD.LEFT,renderContext:N,maxLastColumn:N.lastColumnIndex}}),_({depth:t,params:{renderContext:C}}),$&&_({depth:t,params:{position:nD.RIGHT,renderContext:$,maxLastColumn:$.lastColumnIndex}})]},t));return e},getPinnedCellOffset:Fj,isDragging:!!m,getInnerProps:()=>({role:"rowgroup"})}})({visibleColumns:n,sortColumnLookup:r,filterColumnLookup:o,columnHeaderTabIndexState:i,columnGroupHeaderTabIndexState:a,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:p,columnVisibility:h,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:g});return Xp.jsxs(Q_,f({},v,b(),{ref:t,children:[w(),y()]}))}),eH=KT(J_);const tH=TR(function(e,t){const n=lP().current.getLocaleText("noResultsOverlayLabel");return Xp.jsx(r$,f({},e,{ref:t,children:n}))}),nH=jh("div")({position:"sticky",zIndex:40,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});const rH=f({},SM,{cell:TN,skeletonCell:AN,columnHeaderFilterIconButton:function(e){return e.counter?Xp.jsx(H$,f({},e)):null},columnHeaderSortIcon:_$,columnMenu:ez,columnHeaders:eH,detailPanels:function(e){return null},bottomContainer:function(e){const t=wm({root:["bottomContainer"]},YT,{});return Xp.jsx(nH,f({},e,{className:PR(t.root,XT["container--bottom"]),role:"presentation"}))},footer:Dj,footerRowCount:Yj,toolbar:function(e){const{showQuickFilter:t=!0,quickFilterProps:n,csvOptions:r,printOptions:o,additionalItems:i,additionalExportMenuItems:a}=e,l=d(e,Cj),c=lP(),u=rP(),[p,h]=s.useState(!1),m=s.useRef(null),g=mm(),v=mm(),b=!r?.disableToolbarButton||!o?.disableToolbarButton||a,y=()=>h(!1);return Xp.jsxs(c$,f({},l,{children:[u.label&&Xp.jsx(Mj,{children:u.label}),!u.disableColumnSelector&&Xp.jsx(u.slots.baseTooltip,{title:c.current.getLocaleText("toolbarColumns"),children:Xp.jsx(gj,{render:Xp.jsx(d$,{}),children:Xp.jsx(u.slots.columnSelectorIcon,{fontSize:"small"})})}),!u.disableColumnFilter&&Xp.jsx(u.slots.baseTooltip,{title:c.current.getLocaleText("toolbarFilters"),children:Xp.jsx(hj,{render:(e,t)=>Xp.jsx(d$,f({},e,{color:t.filterCount>0?"primary":"default",children:Xp.jsx(u.slots.baseBadge,{badgeContent:t.filterCount,color:"primary",variant:"dot",children:Xp.jsx(u.slots.openFilterButtonIcon,{fontSize:"small"})})}))})}),i,b&&(!u.disableColumnFilter||!u.disableColumnSelector)&&Xp.jsx(Pj,{}),b&&Xp.jsxs(s.Fragment,{children:[Xp.jsx(u.slots.baseTooltip,{title:c.current.getLocaleText("toolbarExport"),disableInteractive:p,children:Xp.jsx(d$,{ref:m,id:v,"aria-controls":g,"aria-haspopup":"true","aria-expanded":p?"true":void 0,onClick:()=>h(!p),children:Xp.jsx(u.slots.exportIcon,{fontSize:"small"})})}),Xp.jsx(UO,{target:m.current,open:p,onClose:y,position:"bottom-end",children:Xp.jsxs(u.slots.baseMenuList,f({id:g,"aria-labelledby":v,autoFocusItem:!0},u.slotProps?.baseMenuList,{children:[!o?.disableToolbarButton&&Xp.jsx(wj,{render:Xp.jsx(u.slots.baseMenuItem,f({},u.slotProps?.baseMenuItem)),options:o,onClick:y,children:c.current.getLocaleText("toolbarExportPrint")}),!r?.disableToolbarButton&&Xp.jsx(bj,{render:Xp.jsx(u.slots.baseMenuItem,f({},u.slotProps?.baseMenuItem)),options:r,onClick:y,children:c.current.getLocaleText("toolbarExportCSV")}),a?.(y)]}))})]}),t&&Xp.jsxs(s.Fragment,{children:[Xp.jsx(Pj,{}),Xp.jsx(pj,f({},n))]})]}))},pinnedRows:function(e){return null},loadingOverlay:Vj,noResultsOverlay:tH,noRowsOverlay:Wj,noColumnsOverlay:Uj,pagination:function(){const e=lP(),t=rP(),n=pI(e,lF),r=pI(e,sF),o=pI(e,pF),{paginationMode:i,loading:a}=t,l=-1===r&&"server"===i&&a,c=s.useMemo(()=>Math.max(0,o-1),[o]),u=s.useMemo(()=>-1===r||n.page<=c?n.page:c,[c,n.page,r]),d=s.useCallback(t=>{e.current.setPageSize(t)},[e]),p=s.useCallback((t,n)=>{e.current.setPage(n)},[e]),h=(e=>{for(let n=0;n<t.pageSizeOptions.length;n+=1){const r=t.pageSizeOptions[n];if("number"==typeof r){if(r===e)return!0}else if(r.value===e)return!0}return!1})(n.pageSize)?t.pageSizeOptions:[];return Xp.jsx(Gj,f({as:t.slots.basePagination,count:r,page:u,rowsPerPageOptions:h,rowsPerPage:n.pageSize,onPageChange:p,onRowsPerPageChange:d,disabled:l},t.slotProps?.basePagination))},filterPanel:Mz,columnsPanel:function(e){const t=rP();return Xp.jsx(rz,f({},e,{children:Xp.jsx(t.slots.columnsManagement,f({},t.slotProps?.columnsManagement))}))},columnsManagement:function(e){const t=lP(),n=s.useRef(null),r=pI(t,sO),o=pI(t,lO),i=rP(),[a,l]=s.useState(""),c=(e=>{const{classes:t}=e;return wm({root:["columnsManagement"],header:["columnsManagementHeader"],searchInput:["columnsManagementSearchInput"],footer:["columnsManagementFooter"],row:["columnsManagementRow"]},YT,t)})(i),u=pI(t,aO),d=pI(t,SL),p=pI(t,kL),h=s.useMemo(()=>d?Array.from(p.values()):u,[d,p,u]),{sort:m,searchPredicate:g=Tz,autoFocusSearchField:v=!0,disableShowHideToggle:b=!1,disableResetButton:y=!1,toggleAllMode:w="all",getTogglableColumns:x,searchInputProps:S,searchDebounceMs:C=i.columnFilterDebounceMs}=e,k=s.useMemo(()=>Cg(e=>{l(e)},C??150),[C]),E=s.useMemo(()=>((e,t)=>{const n=new Set(Object.keys(e).filter(t=>!1===e[t])),r=new Set(Object.keys(t).filter(e=>!1===t[e]));if(n.size!==r.size)return!1;let o=!0;return n.forEach(e=>{r.has(e)||(o=!1)}),o})(o,r),[o,r]),R=s.useMemo(()=>{switch(m){case"asc":return[...h].sort((e,t)=>Az.compare(e.headerName||e.field,t.headerName||t.field));case"desc":return[...h].sort((e,t)=>-Az.compare(e.headerName||e.field,t.headerName||t.field));default:return h}},[h,m]),P=e=>{const{name:n}=e.target;t.current.setColumnVisibility(n,!1===o[n])},M=s.useMemo(()=>{const e=x?x(R):null,t=e?R.filter(({field:t})=>e.includes(t)):R;return a?t.filter(e=>g(e,a.toLowerCase())):t},[R,a,g,x]),T=s.useCallback(e=>{const n=f({},lO(t)),r=x?x(h):null;return("filteredOnly"===w?M:h).forEach(t=>{t.hideable&&(null==r||r.includes(t.field))&&(e?delete n[t.field]:n[t.field]=!1)}),t.current.setColumnVisibilityModel(n)},[t,h,x,w,M]),I=s.useCallback(e=>{k(e.target.value)},[k]),O=s.useMemo(()=>M.filter(e=>e.hideable),[M]),D=s.useMemo(()=>O.every(e=>null==o[e.field]||!1!==o[e.field]),[o,O]),F=s.useMemo(()=>O.every(e=>!1===o[e.field]),[o,O]),L=s.useRef(null);s.useEffect(()=>{v?n.current?.focus():L.current&&"function"==typeof L.current.focus&&L.current.focus()},[v]);let A=!1;const N=e=>!1===A&&!1!==e.hideable&&(A=!0,!0),$=s.useCallback(()=>{l(""),n.current&&(n.current.value="",n.current.focus())},[]);return Xp.jsxs(s.Fragment,{children:[Xp.jsx(zz,{className:c.header,ownerState:i,children:Xp.jsx(jz,f({as:i.slots.baseTextField,ownerState:i,placeholder:t.current.getLocaleText("columnsManagementSearchTitle"),inputRef:n,className:c.searchInput,onChange:I,size:"small",type:"search",slotProps:{input:{startAdornment:Xp.jsx(i.slots.quickFilterIcon,{fontSize:"small"}),endAdornment:Xp.jsx(i.slots.baseIconButton,f({size:"small","aria-label":t.current.getLocaleText("columnsManagementDeleteIconLabel"),style:a?{visibility:"visible"}:{visibility:"hidden"},tabIndex:-1,onClick:$,edge:"end"},i.slotProps?.baseIconButton,{children:Xp.jsx(i.slots.quickFilterClearIcon,{fontSize:"small"})}))},htmlInput:{"aria-label":t.current.getLocaleText("columnsManagementSearchTitle")}},autoComplete:"off",fullWidth:!0},i.slotProps?.baseTextField,S))}),Xp.jsx($z,{ownerState:i,children:Xp.jsxs(Nz,{className:c.root,ownerState:i,children:[M.map(e=>Xp.jsx(Hz,f({as:i.slots.baseCheckbox,className:c.row,disabled:!1===e.hideable||d,checked:!1!==o[e.field],onChange:P,name:e.field,inputRef:N(e)?L:void 0,label:e.headerName||e.field,density:"compact",fullWidth:!0},i.slotProps?.baseCheckbox),e.field)),0===M.length&&Xp.jsx(_z,{ownerState:i,children:t.current.getLocaleText("columnsManagementNoColumns")})]})}),b&&y?null:Xp.jsxs(Bz,{ownerState:i,className:c.footer,children:[b?Xp.jsx("span",{}):Xp.jsx(i.slots.baseCheckbox,f({disabled:0===O.length||d,checked:D,indeterminate:!D&&!F,onChange:()=>T(!D),name:t.current.getLocaleText("columnsManagementShowHideAllText"),label:t.current.getLocaleText("columnsManagementShowHideAllText"),density:"compact"},i.slotProps?.baseCheckbox)),y?null:Xp.jsx(i.slots.baseButton,f({onClick:()=>t.current.setColumnVisibilityModel(r),disabled:E||d},i.slotProps?.baseButton,{children:t.current.getLocaleText("columnsManagementReset")}))]})]})},panel:sz,row:iB}),oH={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",listView:!1},iH=rH,aH=e=>{const t=sg(),n=s.useMemo(()=>Vh({props:e,theme:t,name:"MuiDataGrid"}),[t,e]),r=s.useMemo(()=>f({},qT,n.localeText),[n.localeText]),o=s.useMemo(()=>function({defaultSlots:e,slots:t}){const n=t;if(!n||0===Object.keys(n).length)return e;const r=f({},e);return Object.keys(n).forEach(e=>{const t=e;void 0!==n[t]&&(r[t]=n[t])}),r}({defaultSlots:iH,slots:n.slots}),[n.slots]),i=s.useMemo(()=>Object.keys(dN).reduce((e,t)=>(e[t]=n[t]??dN[t],e),{}),[n]);return s.useMemo(()=>f({},n,i,{localeText:r,slots:o},(e=>f({},oH,e.dataSource?{filterMode:"server",sortingMode:"server",paginationMode:"server"}:{}))(n)),[n,r,o,i])};class lH{maxListeners=20;warnOnce=!1;events={};on(e,t,n={}){let r=this.events[e];r||(r={highPriority:new Map,regular:new Map},this.events[e]=r),n.isFirst?r.highPriority.set(t,!0):r.regular.set(t,!0)}removeListener(e,t){this.events[e]&&(this.events[e].regular.delete(t),this.events[e].highPriority.delete(t))}removeAllListeners(){this.events={}}emit(e,...t){const n=this.events[e];if(!n)return;const r=Array.from(n.highPriority.keys()),o=Array.from(n.regular.keys());for(let e=r.length-1;e>=0;e-=1){const o=r[e];n.highPriority.has(o)&&o.apply(this,t)}for(let e=0;e<o.length;e+=1){const r=o[e];n.regular.has(r)&&r.apply(this,t)}}once(e,t){const n=this;this.on(e,function r(...o){n.removeListener(e,r),t.apply(n,o)})}}const sH=Symbol("mui.api_private");let cH=0;function uH(e,t){const n=s.useRef(null),r=s.useRef(null);r.current||(r.current=function(e){const t=e.current?.[sH];if(t)return t;const n={},r={state:n,store:JM.create(n),instanceId:{id:cH}};return cH+=1,r.getPublicApi=()=>e.current,r.register=(t,n)=>{Object.keys(n).forEach(o=>{const i=n[o],a=r[o];if(!0===a?.spying?a.target=i:r[o]=i,"public"===t){const t=e.current,n=t[o];!0===n?.spying?n.target=i:t[o]=i}})},r.register("private",{caches:{},eventManager:new lH}),r}(n)),n.current||(n.current=function(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[sH]:e.current}}(r));const o=s.useCallback((...e)=>{const[n,o,i={}]=e;if(i.defaultMuiPrevented=!1,(e=>void 0!==e.isPropagationStopped)(i)&&i.isPropagationStopped())return;const a=t.signature===QT.DataGridPro||t.signature===QT.DataGridPremium?{api:r.current.getPublicApi()}:{};r.current.eventManager.emit(n,o,i,a)},[r,t.signature]),i=s.useCallback((e,t,n)=>{r.current.eventManager.on(e,t,n);const o=r.current;return()=>{o.eventManager.removeListener(e,t)}},[r]);return vL(r,{subscribeEvent:i,publishEvent:o},"public"),e&&!e.current?.state&&(e.current=n.current),s.useImperativeHandle(e,()=>n.current,[n]),s.useEffect(()=>{const e=r.current;return()=>{e.publishEvent("unmount")}},[r]),r}const dH={hooks:{useCSSVariables:function(){const e=sg();return s.useMemo(()=>{const t=fP(function(e){const t=new WeakSet;return JSON.stringify(e,(e,n)=>{if("undefined"!=typeof window&&n===window||"undefined"!=typeof document&&n===document)return n.toString();if(null!==n&&"object"==typeof n){if(s.isValidElement(n))return null;if(t.has(n))return null;t.add(n)}return n})}(e)),n=function(e){const t=function(e){if(e.vars)return e.vars.palette.TableCell.border;if("light"===e.palette.mode)return im(tm(e.palette.divider,1),.88);return rm(tm(e.palette.divider,1),.68)}(e),n=(e.vars||e).palette.DataGrid,r=n?.bg??("dark"===e.palette.mode?`color-mix(in srgb, ${(e.vars||e).palette.background.paper} 95%, #fff)`:(e.vars||e).palette.background.paper),o=n?.headerBg??r,i=n?.pinnedBg??r,a=e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:tm(e.palette.background.default,e.palette.action.disabledOpacity),l="dark"===e.palette.mode?`color-mix(in srgb, ${(e.vars||e).palette.background.paper} 90%, #fff)`:(e.vars||e).palette.background.paper,s=e.vars?`rgb(${e.vars.palette.primary.mainChannel})`:e.palette.primary.main,c=function(e){if(e.vars)return e.vars.shape.borderRadius;return"number"==typeof e.shape.borderRadius?`${e.shape.borderRadius}px`:e.shape.borderRadius}(e),u=e.vars?.font?.body2??xP(e.typography.body2),d=e.vars?.font?.caption??xP(e.typography.caption),p=e.vars?.font?.body1??xP(e.typography.body1),f=bP.keys;return{[f.spacingUnit]:e.vars?e.vars.spacing??e.spacing(1):e.spacing(1),[f.colors.border.base]:t,[f.colors.background.base]:r,[f.colors.background.overlay]:l,[f.colors.background.backdrop]:a,[f.colors.foreground.base]:(e.vars||e).palette.text.primary,[f.colors.foreground.muted]:(e.vars||e).palette.text.secondary,[f.colors.foreground.accent]:(e.vars||e).palette.primary.dark,[f.colors.foreground.disabled]:(e.vars||e).palette.text.disabled,[f.colors.foreground.error]:(e.vars||e).palette.error.dark,[f.colors.interactive.hover]:(e.vars||e).palette.action.hover,[f.colors.interactive.hoverOpacity]:(e.vars||e).palette.action.hoverOpacity,[f.colors.interactive.focus]:wP((e.vars||e).palette.primary.main),[f.colors.interactive.focusOpacity]:(e.vars||e).palette.action.focusOpacity,[f.colors.interactive.disabled]:wP((e.vars||e).palette.action.disabled),[f.colors.interactive.disabledOpacity]:(e.vars||e).palette.action.disabledOpacity,[f.colors.interactive.selected]:s,[f.colors.interactive.selectedOpacity]:(e.vars||e).palette.action.selectedOpacity,[f.header.background.base]:o,[f.cell.background.pinned]:i,[f.radius.base]:c,[f.typography.fontFamily.base]:e.typography.fontFamily,[f.typography.fontWeight.light]:e.typography.fontWeightLight,[f.typography.fontWeight.regular]:e.typography.fontWeightRegular,[f.typography.fontWeight.medium]:e.typography.fontWeightMedium,[f.typography.fontWeight.bold]:e.typography.fontWeightBold,[f.typography.font.body]:u,[f.typography.font.small]:d,[f.typography.font.large]:p,[f.transitions.easing.easeIn]:e.transitions.easing.easeIn,[f.transitions.easing.easeOut]:e.transitions.easing.easeOut,[f.transitions.easing.easeInOut]:e.transitions.easing.easeInOut,[f.transitions.duration.short]:`${e.transitions.duration.shorter}ms`,[f.transitions.duration.base]:`${e.transitions.duration.short}ms`,[f.transitions.duration.long]:`${e.transitions.duration.standard}ms`,[f.shadows.base]:(e.vars||e).shadows[2],[f.shadows.overlay]:(e.vars||e).shadows[8],[f.zIndex.panel]:(e.vars||e).zIndex.modal,[f.zIndex.menu]:(e.vars||e).zIndex.modal}}(e);return{id:t,variables:n}},[e])},useGridAriaAttributes:()=>{const e=mL(),t=rP(),n=pI(e,cO),r=pI(e,MD),o=pI(e,tL),i=pI(e,IT),a=t["aria-label"],l=t["aria-labelledby"];return{role:"grid","aria-label":!a&&!l&&t.label?t.label:a,"aria-labelledby":l,"aria-colcount":n.length,"aria-rowcount":o+1+i+r,"aria-multiselectable":HD(t)}},useGridRowAriaAttributes:()=>{const e=mL(),t=pI(e,tL);return s.useCallback((n,r)=>{const o={},i=r+t+2;return o["aria-rowindex"]=i,n&&e.current.isRowSelectable(n.id)&&(o["aria-selected"]=e.current.isRowSelected(n.id)),o},[e,t])},useGridRowsOverridableMethods:e=>{const t=s.useCallback((t,n,r)=>{const o=ST(e,t),i=ST(e,n);if(!o)throw new Error(`MUI X: No row with id #${t} found.`);if(!i)throw new Error(`MUI X: No row with id #${n} found.`);if("leaf"!==o.type)throw new Error("MUI X: The row reordering does not support reordering of footer or grouping rows.");if("inside"===r)throw new Error("MUI X: The 'inside' position is only supported for tree data. Use 'above' or 'below' for flat data.");const a=FD(e),l=a[n];if(void 0===l)throw new Error(`MUI X: Target row with id #${n} not found in current view.`);const s=a[t];if(void 0===s)throw new Error(`MUI X: Source row with id #${t} not found in current view.`);let c;c="up"===(l<s?"up":"down")?"above"===r?l:l+1:"above"===r?l-1:l,c!==s&&(e.current.setState(t=>{const n=xT(e)[OT],r=[...n.children];return r.splice(c,0,r.splice(s,1)[0]),f({},t,{rows:f({},t.rows,{tree:f({},t.rows.tree,{[OT]:f({},n,{children:r})})})})}),e.current.publishEvent("rowsSet"))},[e]),n=s.useCallback((t,n)=>{const r=ST(e,t);if(!r)throw new Error(`MUI X: No row with id #${t} found.`);if("leaf"!==r.type)throw new Error("MUI X: The row reordering does not support reordering of footer or grouping rows.");e.current.setState(r=>{const o=xT(e)[OT],i=o.children,a=i.findIndex(e=>e===t);if(-1===a||a===n)return r;const l=[...i];return l.splice(n,0,l.splice(a,1)[0]),f({},r,{rows:f({},r.rows,{tree:f({},r.rows.tree,{[OT]:f({},o,{children:l})})})})}),e.current.publishEvent("rowsSet")},[e]);return{setRowIndex:n,setRowPosition:t}},useGridParamsOverridableMethods:e=>{const t=s.useCallback((t,n)=>{const r=e.current.getColumn(n),o=e.current.getRow(t);if(!o)throw new Error(`No row with id #${t} found`);return r&&r.valueGetter?r.valueGetter(o[r.field],o,r,e):o[n]},[e]),n=s.useCallback((t,n)=>LT(t,n,e),[e]),r=s.useCallback((t,r)=>{const o=n(t,r);return r&&r.valueFormatter?r.valueFormatter(o,t,r,e):o},[e,n]);return{getCellValue:t,getRowValue:n,getRowFormattedValue:r}},useIsCellEditable:()=>s.useCallback(e=>!jT(e.rowNode),[]),useCellAggregationResult:()=>null,useFilterValueGetter:e=>e.current.getRowValue}},pH=function(e,t){const n=aH(e),r=uH(n.apiRef,n);return W_(r,n,dH),Xp.jsx(aB,{privateApiRef:r,configuration:dH,props:n,children:Xp.jsx(QN,f({className:n.className,style:n.style,sx:n.sx},n.slotProps?.root,{ref:t}))})},fH=s.memo(TR(pH));pH.propTypes={apiRef:C.shape({current:C.object}),"aria-label":C.string,"aria-labelledby":C.string,autoHeight:C.bool,autoPageSize:C.bool,autosizeOnMount:C.bool,autosizeOptions:C.shape({columns:C.arrayOf(C.string),disableColumnVirtualization:C.bool,expand:C.bool,includeHeaders:C.bool,includeOutliers:C.bool,outliersFactor:C.number}),cellModesModel:C.object,checkboxSelection:C.bool,classes:C.object,className:C.string,clipboardCopyCellDelimiter:C.string,columnBufferPx:C.number,columnFilterDebounceMs:C.number,columnGroupHeaderHeight:C.number,columnGroupingModel:C.arrayOf(C.object),columnHeaderHeight:C.number,columns:C.arrayOf(C.object).isRequired,columnVisibilityModel:C.object,dataSource:C.shape({getRows:C.func.isRequired,updateRow:C.func}),dataSourceCache:C.shape({clear:C.func.isRequired,get:C.func.isRequired,set:C.func.isRequired}),density:C.oneOf(["comfortable","compact","standard"]),disableAutosize:C.bool,disableColumnFilter:C.bool,disableColumnMenu:C.bool,disableColumnResize:C.bool,disableColumnSelector:C.bool,disableColumnSorting:C.bool,disableDensitySelector:C.bool,disableEval:C.bool,disableMultipleRowSelection:C.bool,disableRowSelectionExcludeModel:C.bool,disableRowSelectionOnClick:C.bool,disableVirtualization:C.bool,editMode:C.oneOf(["cell","row"]),estimatedRowCount:C.number,experimentalFeatures:C.shape({warnIfFocusStateIsNotSynced:C.bool}),filterDebounceMs:C.number,filterMode:C.oneOf(["client","server"]),filterModel:C.shape({items:C.arrayOf(C.shape({field:C.string.isRequired,id:C.oneOfType([C.number,C.string]),operator:C.string.isRequired,value:C.any})).isRequired,logicOperator:C.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:C.bool,quickFilterLogicOperator:C.oneOf(["and","or"]),quickFilterValues:C.array}),getCellClassName:C.func,getDetailPanelContent:C.func,getEstimatedRowHeight:C.func,getRowClassName:C.func,getRowHeight:C.func,getRowId:C.func,getRowSpacing:C.func,hideFooter:C.bool,hideFooterPagination:C.bool,hideFooterSelectedRowCount:C.bool,ignoreDiacritics:C.bool,ignoreValueFormatterDuringExport:C.oneOfType([C.shape({clipboardExport:C.bool,csvExport:C.bool}),C.bool]),initialState:C.object,isCellEditable:C.func,isRowSelectable:C.func,keepNonExistentRowsSelected:C.bool,label:C.string,loading:C.bool,localeText:C.object,logger:C.shape({debug:C.func.isRequired,error:C.func.isRequired,info:C.func.isRequired,warn:C.func.isRequired}),logLevel:C.oneOf(["debug","error","info","warn",!1]),nonce:C.string,onCellClick:C.func,onCellDoubleClick:C.func,onCellEditStart:C.func,onCellEditStop:C.func,onCellKeyDown:C.func,onCellModesModelChange:C.func,onClipboardCopy:C.func,onColumnHeaderClick:C.func,onColumnHeaderContextMenu:C.func,onColumnHeaderDoubleClick:C.func,onColumnHeaderEnter:C.func,onColumnHeaderLeave:C.func,onColumnHeaderOut:C.func,onColumnHeaderOver:C.func,onColumnOrderChange:C.func,onColumnResize:C.func,onColumnVisibilityModelChange:C.func,onColumnWidthChange:C.func,onDataSourceError:C.func,onDensityChange:C.func,onFilterModelChange:C.func,onMenuClose:C.func,onMenuOpen:C.func,onPaginationMetaChange:C.func,onPaginationModelChange:C.func,onPreferencePanelClose:C.func,onPreferencePanelOpen:C.func,onProcessRowUpdateError:C.func,onResize:C.func,onRowClick:C.func,onRowCountChange:C.func,onRowDoubleClick:C.func,onRowEditStart:C.func,onRowEditStop:C.func,onRowModesModelChange:C.func,onRowSelectionModelChange:C.func,onSortModelChange:C.func,onStateChange:C.func,pageSizeOptions:C.arrayOf(C.oneOfType([C.number,C.shape({label:C.string.isRequired,value:C.number.isRequired})]).isRequired),pagination:C.oneOf([!0]),paginationMeta:C.shape({hasNextPage:C.bool}),paginationMode:C.oneOf(["client","server"]),paginationModel:C.shape({page:C.number.isRequired,pageSize:C.number.isRequired}),processRowUpdate:C.func,resizeThrottleMs:C.number,rowBufferPx:C.number,rowCount:C.number,rowHeight:C.number,rowModesModel:C.object,rows:C.arrayOf(C.object),rowSelection:C.bool,rowSelectionModel:C.shape({ids:C.instanceOf(Set).isRequired,type:C.oneOf(["exclude","include"]).isRequired}),rowSpacingType:C.oneOf(["border","margin"]),rowSpanning:C.bool,scrollbarSize:C.number,showCellVerticalBorder:C.bool,showColumnVerticalBorder:C.bool,showToolbar:C.bool,slotProps:C.object,slots:C.object,sortingMode:C.oneOf(["client","server"]),sortingOrder:C.arrayOf(C.oneOf(["asc","desc"])),sortModel:C.arrayOf(C.shape({field:C.string.isRequired,sort:C.oneOf(["asc","desc"])})),style:C.object,sx:C.oneOfType([C.arrayOf(C.oneOfType([C.func,C.object,C.bool])),C.func,C.object]),virtualizeColumnsWithAutoRowHeight:C.bool};var hH=Sg(Xp.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),mH=Sg(Xp.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"})),gH=Sg(Xp.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"})),vH=Sg(Xp.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"})),bH=Sg(Xp.jsx("path",{d:"M8 5v14l11-7z"}));const yH=({open:e,title:t="Confirm Action",message:n,onConfirm:r,onCancel:o,confirmText:i="Confirm",cancelText:a="Cancel",confirmColor:l="error"})=>c.createElement(zx,{open:e,onClose:o,"aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-description"},c.createElement(Qx,{id:"confirm-dialog-title"},t),c.createElement(Gx,null,c.createElement(Yx,{id:"confirm-dialog-description"},n)),c.createElement(_x,null,c.createElement(Xw,{onClick:o,variant:"outlined"},a),c.createElement(Xw,{onClick:r,variant:"contained",color:l,autoFocus:!0},i))),wH=({onSelectReport:e,onAddNew:t,onCloneReport:n,onRunReport:r,refreshTrigger:o})=>{const i=ER(),[a,l]=s.useState([]),[u,d]=s.useState(!0),[p,f]=s.useState(null),[h,m]=s.useState(!1),[g,v]=s.useState(null);s.useEffect(()=>{b()},[o]);const b=async()=>{try{d(!0),f(null);const e=await jc.getReportDefinitions();l(e)}catch(e){console.error("Error loading report definitions:",e);const t="Failed to load report definitions: "+(e.message||"Unknown error");f(t),i.error(t)}finally{d(!1)}},y=[{field:"title",headerName:"Title",flex:1,minWidth:200},{field:"provider",headerName:"Provider",flex:1,minWidth:200},{field:"actions",headerName:"Actions",width:200,sortable:!1,filterable:!1,disableColumnMenu:!0,renderCell:t=>c.createElement(jw,{sx:{display:"flex",gap:1}},c.createElement(Hk,{title:"Run"},c.createElement(Mv,{size:"small",color:"success",onClick:e=>{return n=t.row.id,e.stopPropagation(),void r(n);var n}},c.createElement(bH,{fontSize:"small"}))),c.createElement(Hk,{title:"Edit"},c.createElement(Mv,{size:"small",color:"primary",onClick:n=>{return r=t.row.id,n.stopPropagation(),void e(r);var r}},c.createElement(mH,{fontSize:"small"}))),c.createElement(Hk,{title:"Clone"},c.createElement(Mv,{size:"small",onClick:e=>(async(e,t)=>{t.stopPropagation();try{const t=await jc.getReportDefinition({id:e}),r={...t,title:`${t.title} (Copy)`};n(r)}catch(e){console.error("Error cloning report:",e),i.error("Failed to clone report: "+(e.message||"Unknown error"))}})(t.row.id,e)},c.createElement(gH,{fontSize:"small"}))),c.createElement(Hk,{title:"Delete"},c.createElement(Mv,{size:"small",color:"error",onClick:e=>((e,t)=>{t.stopPropagation();const n=a.find(t=>t.id===e);v(n),m(!0)})(t.row.id,e)},c.createElement(vH,{fontSize:"small"}))))}],w=a.map(e=>({id:e.id,title:e.title,provider:e.provider}));return u?c.createElement(jw,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400},c.createElement(Cv,null)):p?c.createElement(jw,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:400,gap:2},c.createElement(Gv,{variant:"body1",color:"error"},p),c.createElement(Xw,{variant:"contained",onClick:b},"Retry")):c.createElement(jw,{sx:{p:3}},c.createElement(jw,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3}},c.createElement(Gv,{variant:"h4",component:"h1"},"Report Definitions"),c.createElement(Xw,{variant:"contained",color:"primary",startIcon:c.createElement(hH,null),onClick:t},"Add New Report")),c.createElement(jw,{sx:{height:600,width:"100%"}},c.createElement(fH,{rows:w,columns:y,pageSize:10,rowsPerPageOptions:[10,25,50],disableSelectionOnClick:!0,onRowClick:t=>{e(t.row.id)},sx:{"& .MuiDataGrid-row":{cursor:"pointer"},"& .MuiDataGrid-row:hover":{backgroundColor:"#f5f5f5"},"& .MuiDataGrid-columnHeader":{backgroundColor:"#f5f5f5",fontWeight:"bold"}}})),c.createElement(yH,{open:h,title:"Delete Report Definition",message:g?`Are you sure you want to delete "${g.title}"? This action cannot be undone.`:"",onConfirm:async()=>{if(g)try{await jc.deleteReportDefinition({id:g.id}),i.success(`Report "${g.title}" deleted successfully!`),m(!1),v(null),b()}catch(e){console.error("Error deleting report:",e),i.error("Failed to delete report: "+(e.response?.data?.message||e.message||"Unknown error")),m(!1),v(null)}},onCancel:()=>{m(!1),v(null)},confirmText:"Delete",cancelText:"Cancel",confirmColor:"error"}))};var xH=Sg(Xp.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),SH=Sg(Xp.jsx("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"})),CH=Sg(Xp.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}));const kH=({providersData:e,rootProvider:t,onSelectionChange:n,existingDimensions:r=[],existingMetrics:o=[],existingFilters:i={}})=>{const[a,l]=s.useState([]);s.useEffect(()=>{l([]),n&&n([])},[t]);const u=t=>{if(!e||!t)return[];const n=e[t];if(!n||!n.relations||0===n.relations.length)return[];const a=(()=>{const e=new Map,t=t=>{if(t.relations&&t.providerPath)for(let n=0;n<t.relations.length;n++){const r=t.relations[n],o=t.providerPath[n];r.type&&(e.has(o)||e.set(o,new Set),e.get(o).add(r.name))}};return r.forEach(t),o.forEach(t),Object.values(i).forEach(t),e})().get(t);return n.relations.filter(t=>e[t.target]).map(e=>{let t=!1,n=null;if(!!e.type&&a&&a.size>0){if(!a.has(e.name)&&a.size>0){t=!0;n=`Cannot select: '${Array.from(a)[0]}' is already in use`}}return{key:e.name,value:e.name,targetKey:e.target,disabled:t,disabledReason:n}})},d=(e,r)=>{const o=r.target.value,i=0===e?t:a[e-1].targetKey,s=u(i).find(e=>e.key===o);if(!s)return;const c=a.slice(0,e);c.push({providerKey:o,relationName:o,targetKey:s.targetKey}),l(c),console.log("Selection chain:",c),n&&n(c)};return c.createElement(jw,null,a.length>0&&c.createElement(jw,{sx:{marginBottom:2}},c.createElement(Gv,{variant:"subtitle2",sx:{marginBottom:1,color:"text.secondary"}},"Selected Path:"),c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"}},c.createElement(zy,{label:t,size:"small",color:"primary",variant:"outlined"}),a.map((e,t)=>c.createElement(c.Fragment,{key:t},c.createElement(Gv,{variant:"body2",sx:{color:"text.secondary"}},"→"),c.createElement(zy,{label:e.targetKey,size:"small",color:"primary",onDelete:()=>(e=>{const t=a.slice(0,e);l(t),n&&n(t)})(t),sx:{fontWeight:500}}))))),c.createElement("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"flex-start",gap:"8px"}},(()=>{if(!e||!t)return null;const n=[],r=u(t);r.length>0&&n.push(c.createElement("div",{key:"level-0",style:{marginRight:"16px"}},c.createElement(uR,{items:r,value:a[0]?.providerKey||"",label:`Related to ${t}`,onChange:e=>d(0,e),sx:{width:"300px"}})));for(let e=0;e<a.length;e++){const t=a[e],r=u(t.targetKey);if(r.length>0){const o=a[e+1];n.push(c.createElement("div",{key:`level-${e+1}`,style:{marginRight:"16px"}},c.createElement(uR,{items:r,value:o?.providerKey||"",label:`Related to ${t.targetKey}`,onChange:t=>d(e+1,t),sx:{width:"300px"}})))}}return n})()))};const EH="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function RH(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function PH(e){return"nodeType"in e}function MH(e){var t,n;return e?RH(e)?e:PH(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function TH(e){const{Document:t}=MH(e);return e instanceof t}function IH(e){return!RH(e)&&e instanceof MH(e).HTMLElement}function OH(e){return e instanceof MH(e).SVGElement}function DH(e){return e?RH(e)?e.document:PH(e)?TH(e)?e:IH(e)||OH(e)?e.ownerDocument:document:document:document}const FH=EH?s.useLayoutEffect:s.useEffect;function LH(e){const t=s.useRef(e);return FH(()=>{t.current=e}),s.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function AH(e,t){void 0===t&&(t=[e]);const n=s.useRef(e);return FH(()=>{n.current!==e&&(n.current=e)},t),n}function NH(e,t){const n=s.useRef();return s.useMemo(()=>{const t=e(n.current);return n.current=t,t},[...t])}function $H(e){const t=LH(e),n=s.useRef(null),r=s.useCallback(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function zH(e){const t=s.useRef();return s.useEffect(()=>{t.current=e},[e]),t.current}let jH={};function BH(e,t){return s.useMemo(()=>{if(t)return t;const n=null==jH[e]?0:jH[e]+1;return jH[e]=n,e+"-"+n},[e,t])}function _H(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const HH=_H(1),VH=_H(-1);function WH(e){if(!e)return!1;const{KeyboardEvent:t}=MH(e.target);return t&&e instanceof t}function UH(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=MH(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const GH=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[GH.Translate.toString(e),GH.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),KH="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function qH(e){return e.matches(KH)?e:e.querySelector(KH)}const YH={display:"none"};function XH(e){let{id:t,value:n}=e;return c.createElement("div",{id:t,style:YH},n)}function QH(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return c.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const ZH=s.createContext(null);const JH={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},eV={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function tV(e){let{announcements:t=eV,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=JH}=e;const{announce:i,announcement:a}=function(){const[e,t]=s.useState("");return{announce:s.useCallback(e=>{null!=e&&t(e)},[]),announcement:e}}(),l=BH("DndLiveRegion"),[u,d]=s.useState(!1);if(s.useEffect(()=>{d(!0)},[]),function(e){const t=s.useContext(ZH);s.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(s.useMemo(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!u)return null;const p=c.createElement(c.Fragment,null,c.createElement(XH,{id:r,value:o.draggable}),c.createElement(QH,{id:l,announcement:a}));return n?So.createPortal(p,n):p}var nV;function rV(){}function oV(e,t){return s.useMemo(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}function iV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.useMemo(()=>[...t].filter(e=>null!=e),[...t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(nV||(nV={}));const aV=Object.freeze({x:0,y:0});function lV(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function sV(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function cV(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function uV(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function dV(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}function pV(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const fV=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=pV(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=lV(pV(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(sV)};function hV(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const mV=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=hV(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(cV)};function gV(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:aV}function vV(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const bV=vV(1);const yV={ignoreTransform:!1};function wV(e,t){void 0===t&&(t=yV);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=MH(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,s=e.left-a-(1-o)*parseFloat(n),c=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:s+u,bottom:c+d,left:s}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:s}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:s}}function xV(e){return wV(e,{ignoreTransform:!0})}function SV(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(TH(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!IH(o)||OH(o))return n;if(n.includes(o))return n;const i=MH(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=MH(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=MH(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function CV(e){const[t]=SV(e,1);return null!=t?t:null}function kV(e){return EH&&e?RH(e)?e:PH(e)?TH(e)||e===DH(e).scrollingElement?window:IH(e)?e:null:null:null}function EV(e){return RH(e)?e.scrollX:e.scrollLeft}function RV(e){return RH(e)?e.scrollY:e.scrollTop}function PV(e){return{x:EV(e),y:RV(e)}}var MV;function TV(e){return!(!EH||!e)&&e===document.scrollingElement}function IV(e){const t={x:0,y:0},n=TV(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(MV||(MV={}));const OV={x:.2,y:.2};function DV(e,t,n,r,o){let{top:i,left:a,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=OV);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=IV(e),f={x:0,y:0},h={x:0,y:0},m=t.height*o.y,g=t.width*o.x;return!c&&i<=t.top+m?(f.y=MV.Backward,h.y=r*Math.abs((t.top+m-i)/m)):!u&&s>=t.bottom-m&&(f.y=MV.Forward,h.y=r*Math.abs((t.bottom-m-s)/m)),!p&&l>=t.right-g?(f.x=MV.Forward,h.x=r*Math.abs((t.right-g-l)/g)):!d&&a<=t.left+g&&(f.x=MV.Backward,h.x=r*Math.abs((t.left+g-a)/g)),{direction:f,speed:h}}function FV(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function LV(e){return e.reduce((e,t)=>HH(e,PV(t)),aV)}const AV=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+EV(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+RV(t),0)}]];class NV{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=SV(t),r=LV(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of AV)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class $V{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function zV(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var jV,BV;function _V(e){e.preventDefault()}function HV(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(jV||(jV={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(BV||(BV={}));const VV={start:[BV.Space,BV.Enter],cancel:[BV.Esc],end:[BV.Space,BV.Enter,BV.Tab]},WV=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case BV.Right:return{...n,x:n.x+25};case BV.Left:return{...n,x:n.x-25};case BV.Down:return{...n,y:n.y+25};case BV.Up:return{...n,y:n.y-25}}};class UV{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new $V(DH(t)),this.windowListeners=new $V(MH(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(jV.Resize,this.handleCancel),this.windowListeners.add(jV.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(jV.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=wV),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);CV(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(aV)}handleKeyDown(e){if(WH(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=VV,coordinateGetter:i=WV,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:aV;this.referenceCoordinates||(this.referenceCoordinates=c);const u=i(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=VH(u,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:s,isBottom:c,maxScroll:d,minScroll:p}=IV(n),f=FV(n),h={x:Math.min(o===BV.Right?f.right-f.width/2:f.right,Math.max(o===BV.Right?f.left:f.left+f.width/2,u.x)),y:Math.min(o===BV.Down?f.bottom-f.height/2:f.bottom,Math.max(o===BV.Down?f.top:f.top+f.height/2,u.y))},m=o===BV.Right&&!l||o===BV.Left&&!s,g=o===BV.Down&&!c||o===BV.Up&&!i;if(m&&h.x!==u.x){const e=n.scrollLeft+t.x,i=o===BV.Right&&e<=d.x||o===BV.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===BV.Right?n.scrollLeft-d.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(g&&h.y!==u.y){const e=n.scrollTop+t.y,i=o===BV.Down&&e<=d.y||o===BV.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===BV.Down?n.scrollTop-d.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,HH(VH(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function GV(e){return Boolean(e&&"distance"in e)}function KV(e){return Boolean(e&&"delay"in e)}UV.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=VV,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class qV{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=MH(e);return e instanceof t?e:DH(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=DH(i),this.documentListeners=new $V(this.document),this.listeners=new $V(n),this.windowListeners=new $V(MH(i)),this.initialCoordinates=null!=(r=UH(o))?r:aV,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(jV.Resize,this.handleCancel),this.windowListeners.add(jV.DragStart,_V),this.windowListeners.add(jV.VisibilityChange,this.handleCancel),this.windowListeners.add(jV.ContextMenu,_V),this.documentListeners.add(jV.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(KV(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(GV(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(jV.Click,HV,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(jV.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=UH(e))?t:aV,s=VH(r,l);if(!n&&a){if(GV(a)){if(null!=a.tolerance&&zV(s,a.tolerance))return this.handleCancel();if(zV(s,a.distance))return this.handleStart()}return KV(a)&&zV(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===BV.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const YV={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class XV extends qV{constructor(e){const{event:t}=e,n=DH(t.target);super(e,YV,n)}}XV.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const QV={move:{name:"mousemove"},end:{name:"mouseup"}};var ZV;!function(e){e[e.RightClick=2]="RightClick"}(ZV||(ZV={}));(class extends qV{constructor(e){super(e,QV,DH(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ZV.RightClick&&(null==r||r({event:n}),!0)}}];const JV={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var eW,tW;function nW(e){let{acceleration:t,activator:n=eW.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:l=tW.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:p,threshold:f}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=zH(t);return NH(e=>{if(n||!r||!e)return rW;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[MV.Backward]:e.x[MV.Backward]||-1===o.x,[MV.Forward]:e.x[MV.Forward]||1===o.x},y:{[MV.Backward]:e.y[MV.Backward]||-1===o.y,[MV.Forward]:e.y[MV.Forward]||1===o.y}}},[n,t,r])}({delta:p,disabled:!i}),[m,g]=function(){const e=s.useRef(null),t=s.useCallback((t,n)=>{e.current=setInterval(t,n)},[]);return[t,s.useCallback(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),v=s.useRef({x:0,y:0}),b=s.useRef({x:0,y:0}),y=s.useMemo(()=>{switch(n){case eW.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case eW.DraggableRect:return o}},[n,o,c]),w=s.useRef(null),x=s.useCallback(()=>{const e=w.current;if(!e)return;const t=v.current.x*b.current.x,n=v.current.y*b.current.y;e.scrollBy(t,n)},[]),S=s.useMemo(()=>l===tW.TreeOrder?[...u].reverse():u,[l,u]);s.useEffect(()=>{if(i&&u.length&&y){for(const e of S){if(!1===(null==r?void 0:r(e)))continue;const n=u.indexOf(e),o=d[n];if(!o)continue;const{direction:i,speed:l}=DV(e,o,y,t,f);for(const e of["x","y"])h[e][i[e]]||(l[e]=0,i[e]=0);if(l.x>0||l.y>0)return g(),w.current=e,m(x,a),v.current=l,void(b.current=i)}v.current={x:0,y:0},b.current={x:0,y:0},g()}else g()},[t,x,r,g,i,a,JSON.stringify(y),JSON.stringify(h),m,u,S,d,JSON.stringify(f)])}(class extends qV{constructor(e){super(e,JV)}static setup(){return window.addEventListener(JV.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(JV.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(eW||(eW={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(tW||(tW={}));const rW={x:{[MV.Backward]:!1,[MV.Forward]:!1},y:{[MV.Backward]:!1,[MV.Forward]:!1}};var oW,iW;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(oW||(oW={})),function(e){e.Optimized="optimized"}(iW||(iW={}));const aW=new Map;function lW(e,t){return NH(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function sW(e){let{callback:t,disabled:n}=e;const r=LH(t),o=s.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return s.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function cW(e){return new NV(wV(e),e)}function uW(e,t,n){void 0===t&&(t=cW);const[r,o]=s.useState(null);function i(){o(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const a=function(e){let{callback:t,disabled:n}=e;const r=LH(t),o=s.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return s.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),l=sW({callback:i});return FH(()=>{i(),e?(null==l||l.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==a||a.disconnect())},[e]),r}const dW=[];function pW(e,t){void 0===t&&(t=[]);const n=s.useRef(null);return s.useEffect(()=>{n.current=null},t),s.useEffect(()=>{const t=e!==aV;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?VH(e,n.current):aV}function fW(e){return s.useMemo(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const hW=[];function mW(e){let{measure:t}=e;const[n,r]=s.useState(null),o=s.useCallback(e=>{for(const{target:n}of e)if(IH(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),i=sW({callback:o}),a=s.useCallback(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return IH(t)?t:e}(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)},[t,i]),[l,c]=$H(a);return s.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const gW=[{sensor:XV,options:{}},{sensor:UV,options:{}}],vW={current:{}},bW={draggable:{measure:xV},droppable:{measure:xV,strategy:oW.WhileDragging,frequency:iW.Optimized},dragOverlay:{measure:wV}};class yW extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const wW={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new yW,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:rV},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:bW,measureDroppableContainers:rV,windowRect:null,measuringScheduled:!1},xW={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:rV,draggableNodes:new Map,over:null,measureDroppableContainers:rV},SW=s.createContext(xW),CW=s.createContext(wW);function kW(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new yW}}}function EW(e,t){switch(t.type){case nV.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case nV.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case nV.DragEnd:case nV.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case nV.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new yW(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case nV.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new yW(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case nV.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new yW(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function RW(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=s.useContext(SW),i=zH(r),a=zH(null==n?void 0:n.id);return s.useEffect(()=>{if(!t&&!r&&i&&null!=a){if(!WH(i))return;if(document.activeElement===i.target)return;const e=o.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=qH(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}const PW=s.createContext({...aV,scaleX:1,scaleY:1});var MW;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(MW||(MW={}));const TW=s.memo(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:l=!0,children:u,sensors:d=gW,collisionDetection:p=mV,measuring:f,modifiers:h,...m}=e;const g=s.useReducer(EW,void 0,kW),[v,b]=g,[y,w]=function(){const[e]=s.useState(()=>new Set),t=s.useCallback(t=>(e.add(t),()=>e.delete(t)),[e]),n=s.useCallback(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]);return[n,t]}(),[x,S]=s.useState(MW.Uninitialized),C=x===MW.Initialized,{draggable:{active:k,nodes:E,translate:R},droppable:{containers:P}}=v,M=null!=k?E.get(k):null,T=s.useRef({initial:null,translated:null}),I=s.useMemo(()=>{var e;return null!=k?{id:k,data:null!=(e=null==M?void 0:M.data)?e:vW,rect:T}:null},[k,M]),O=s.useRef(null),[D,F]=s.useState(null),[L,A]=s.useState(null),N=AH(m,Object.values(m)),$=BH("DndDescribedBy",i),z=s.useMemo(()=>P.getEnabled(),[P]),j=function(e){return s.useMemo(()=>({draggable:{...bW.draggable,...null==e?void 0:e.draggable},droppable:{...bW.droppable,...null==e?void 0:e.droppable},dragOverlay:{...bW.dragOverlay,...null==e?void 0:e.dragOverlay}}),[null==e?void 0:e.draggable,null==e?void 0:e.droppable,null==e?void 0:e.dragOverlay])}(f),{droppableRects:B,measureDroppableContainers:_,measuringScheduled:H}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=s.useState(null),{frequency:l,measure:c,strategy:u}=o,d=s.useRef(e),p=function(){switch(u){case oW.Always:return!1;case oW.BeforeDragging:return n;default:return!n}}(),f=AH(p),h=s.useCallback(function(e){void 0===e&&(e=[]),f.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=s.useRef(null),g=NH(t=>{if(p&&!n)return aW;if(!t||t===aW||d.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new NV(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,p,c]);return s.useEffect(()=>{d.current=e},[e]),s.useEffect(()=>{p||h()},[n,p]),s.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),s.useEffect(()=>{p||"number"!=typeof l||null!==m.current||(m.current=setTimeout(()=>{h(),m.current=null},l))},[l,p,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=i}}(z,{dragging:C,dependencies:[R.x,R.y],config:j.droppable}),V=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return NH(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(E,k),W=s.useMemo(()=>L?UH(L):null,[L]),U=function(){const e=!1===(null==D?void 0:D.autoScrollEnabled),t="object"==typeof l?!1===l.enabled:!1===l,n=C&&!e&&!t;if("object"==typeof l)return{...l,enabled:n};return{enabled:n}}(),G=function(e,t){return lW(e,t)}(V,j.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=s.useRef(!1),{x:a,y:l}="boolean"==typeof o?{x:o,y:o}:o;FH(()=>{if(!a&&!l||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=gV(n(e),r);if(a||(o.x=0),l||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=CV(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,l,r,n])}({activeNode:null!=k?E.get(k):null,config:U.layoutShiftCompensation,initialRect:G,measure:j.draggable.measure});const K=uW(V,j.draggable.measure,G),q=uW(V?V.parentElement:null),Y=s.useRef({activatorEvent:null,active:null,activeNode:V,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),X=P.getNodeFor(null==(t=Y.current.over)?void 0:t.id),Q=mW({measure:j.dragOverlay.measure}),Z=null!=(n=Q.nodeRef.current)?n:V,J=C?null!=(r=Q.rect)?r:K:null,ee=Boolean(Q.nodeRef.current&&Q.rect),te=gV(ne=ee?null:K,lW(ne));var ne;const re=fW(Z?MH(Z):null),oe=function(e){const t=s.useRef(e),n=NH(n=>e?n&&n!==dW&&e&&t.current&&e.parentNode===t.current.parentNode?n:SV(e):dW,[e]);return s.useEffect(()=>{t.current=e},[e]),n}(C?null!=X?X:V:null),ie=function(e,t){void 0===t&&(t=wV);const[n]=e,r=fW(n?MH(n):null),[o,i]=s.useState(hW);function a(){i(()=>e.length?e.map(e=>TV(e)?r:new NV(t(e),e)):hW)}const l=sW({callback:a});return FH(()=>{null==l||l.disconnect(),a(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),o}(oe),ae=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(h,{transform:{x:R.x-te.x,y:R.y-te.y,scaleX:1,scaleY:1},activatorEvent:L,active:I,activeNodeRect:K,containerNodeRect:q,draggingNodeRect:J,over:Y.current.over,overlayNodeRect:Q.rect,scrollableAncestors:oe,scrollableAncestorRects:ie,windowRect:re}),le=W?HH(W,R):null,se=function(e){const[t,n]=s.useState(null),r=s.useRef(e),o=s.useCallback(e=>{const t=kV(e.target);t&&n(e=>e?(e.set(t,PV(t)),new Map(e)):null)},[]);return s.useEffect(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=kV(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,PV(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=kV(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),s.useMemo(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>HH(e,t),aV):LV(e):aV,[e,t])}(oe),ce=pW(se),ue=pW(se,[K]),de=HH(ae,ce),pe=J?bV(J,ae):null,fe=I&&pe?p({active:I,collisionRect:pe,droppableRects:B,droppableContainers:z,pointerCoordinates:le}):null,he=dV(fe,"id"),[me,ge]=s.useState(null),ve=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ee?ae:HH(ae,ue),null!=(o=null==me?void 0:me.rect)?o:null,K),be=s.useRef(null),ye=s.useCallback((e,t)=>{let{sensor:n,options:r}=t;if(null==O.current)return;const o=E.get(O.current);if(!o)return;const i=e.nativeEvent,a=new n({active:O.current,activeNode:o,event:i,options:r,context:Y,onAbort(e){if(!E.get(e))return;const{onDragAbort:t}=N.current,n={id:e};null==t||t(n),y({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!E.get(e))return;const{onDragPending:o}=N.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),y({type:"onDragPending",event:i})},onStart(e){const t=O.current;if(null==t)return;const n=E.get(t);if(!n)return;const{onDragStart:r}=N.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:T}};So.unstable_batchedUpdates(()=>{null==r||r(o),S(MW.Initializing),b({type:nV.DragStart,initialCoordinates:e,active:t}),y({type:"onDragStart",event:o}),F(be.current),A(i)})},onMove(e){b({type:nV.DragMove,coordinates:e})},onEnd:l(nV.DragEnd),onCancel:l(nV.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Y.current;let a=null;if(t&&o){const{cancelDrop:l}=N.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===nV.DragEnd&&"function"==typeof l){await Promise.resolve(l(a))&&(e=nV.DragCancel)}}O.current=null,So.unstable_batchedUpdates(()=>{b({type:e}),S(MW.Uninitialized),ge(null),F(null),A(null),be.current=null;const t=e===nV.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=N.current[t];null==e||e(a),y({type:t,event:a})}})}}be.current=a},[E]),we=s.useCallback((e,t)=>(n,r)=>{const o=n.nativeEvent,i=E.get(r);if(null!==O.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},O.current=r,ye(n,t))},[E,ye]),xe=function(e,t){return s.useMemo(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(d,we);!function(e){s.useEffect(()=>{if(!EH)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(d),FH(()=>{K&&x===MW.Initializing&&S(MW.Initialized)},[K,x]),s.useEffect(()=>{const{onDragMove:e}=N.current,{active:t,activatorEvent:n,collisions:r,over:o}=Y.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:de.x,y:de.y},over:o};So.unstable_batchedUpdates(()=>{null==e||e(i),y({type:"onDragMove",event:i})})},[de.x,de.y]),s.useEffect(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Y.current;if(!e||null==O.current||!t||!o)return;const{onDragOver:i}=N.current,a=r.get(he),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};So.unstable_batchedUpdates(()=>{ge(l),null==i||i(s),y({type:"onDragOver",event:s})})},[he]),FH(()=>{Y.current={activatorEvent:L,active:I,activeNode:V,collisionRect:pe,collisions:fe,droppableRects:B,draggableNodes:E,draggingNode:Z,draggingNodeRect:J,droppableContainers:P,over:me,scrollableAncestors:oe,scrollAdjustedTranslate:de},T.current={initial:J,translated:pe}},[I,V,fe,pe,E,Z,J,B,P,me,oe,de]),nW({...U,delta:R,draggingRect:pe,pointerCoordinates:le,scrollableAncestors:oe,scrollableAncestorRects:ie});const Se=s.useMemo(()=>({active:I,activeNode:V,activeNodeRect:K,activatorEvent:L,collisions:fe,containerNodeRect:q,dragOverlay:Q,draggableNodes:E,droppableContainers:P,droppableRects:B,over:me,measureDroppableContainers:_,scrollableAncestors:oe,scrollableAncestorRects:ie,measuringConfiguration:j,measuringScheduled:H,windowRect:re}),[I,V,K,L,fe,q,Q,E,P,B,me,_,oe,ie,j,H,re]),Ce=s.useMemo(()=>({activatorEvent:L,activators:xe,active:I,activeNodeRect:K,ariaDescribedById:{draggable:$},dispatch:b,draggableNodes:E,over:me,measureDroppableContainers:_}),[L,xe,I,K,b,$,E,me,_]);return c.createElement(ZH.Provider,{value:w},c.createElement(SW.Provider,{value:Ce},c.createElement(CW.Provider,{value:Se},c.createElement(PW.Provider,{value:ve},u)),c.createElement(RW,{disabled:!1===(null==a?void 0:a.restoreFocus)})),c.createElement(tV,{...a,hiddenTextDescribedById:$}))}),IW=s.createContext(null),OW="button";function DW(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=BH("Draggable"),{activators:a,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:p,over:f}=s.useContext(SW),{role:h=OW,roleDescription:m="draggable",tabIndex:g=0}=null!=o?o:{},v=(null==c?void 0:c.id)===t,b=s.useContext(v?PW:IW),[y,w]=$H(),[x,S]=$H(),C=function(e,t){return s.useMemo(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),k=AH(n);FH(()=>(p.set(t,{id:t,key:i,node:y,activatorNode:x,data:k}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)}),[p,t]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:s.useMemo(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":!(!v||h!==OW)||void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[r,h,g,v,m,d.draggable]),isDragging:v,listeners:r?void 0:C,node:y,over:f,setNodeRef:w,setActivatorNodeRef:S,transform:b}}const FW={timeout:25};function LW(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function AW(e,t){return e.reduce((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e},Array(e.length))}function NW(e){return null!==e&&e>=0}const $W=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=LW(t,r,n),a=t[o],l=i[o];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},zW={scaleX:1,scaleY:1},jW=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const l=null!=(t=i[n])?t:r;if(!l)return null;if(o===n){const e=i[a];return e?{x:0,y:n<a?e.top+e.height-(l.top+l.height):e.top-l.top,...zW}:null}const s=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0;return i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(i,o,n);return o>n&&o<=a?{x:0,y:-l.height-s,...zW}:o<n&&o>=a?{x:0,y:l.height+s,...zW}:{x:0,y:0,...zW}};const BW="Sortable",_W=c.createContext({activeIndex:-1,containerId:BW,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:$W,disabled:{draggable:!1,droppable:!1}});function HW(e){let{children:t,id:n,items:r,strategy:o=$W,disabled:i=!1}=e;const{active:a,dragOverlay:l,droppableRects:u,over:d,measureDroppableContainers:p}=s.useContext(CW),f=BH(BW,n),h=Boolean(null!==l.rect),m=s.useMemo(()=>r.map(e=>"object"==typeof e&&"id"in e?e.id:e),[r]),g=null!=a,v=a?m.indexOf(a.id):-1,b=d?m.indexOf(d.id):-1,y=s.useRef(m),w=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(m,y.current),x=-1!==b&&-1===v||w,S=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(i);FH(()=>{w&&g&&p(m)},[w,m,g,p]),s.useEffect(()=>{y.current=m},[m]);const C=s.useMemo(()=>({activeIndex:v,containerId:f,disabled:S,disableTransforms:x,items:m,overIndex:b,useDragOverlay:h,sortedRects:AW(m,u),strategy:o}),[v,f,S.draggable,S.droppable,x,m,b,u,h,o]);return c.createElement(_W.Provider,{value:C},t)}const VW=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return LW(n,r,o).indexOf(t)},WW=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:l,previousContainerId:s,transition:c}=e;return!(!c||!r)&&((l===i||o!==a)&&(!!n||a!==o&&t===s))},UW={duration:200,easing:"ease"},GW="transform",KW=GH.Transition.toString({property:GW,duration:0,easing:"linear"}),qW={roleDescription:"sortable"};function YW(e){let{animateLayoutChanges:t=WW,attributes:n,disabled:r,data:o,getNewIndex:i=VW,id:a,strategy:l,resizeObserverConfig:c,transition:u=UW}=e;const{items:d,containerId:p,activeIndex:f,disabled:h,disableTransforms:m,sortedRects:g,overIndex:v,useDragOverlay:b,strategy:y}=s.useContext(_W),w=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,h),x=d.indexOf(a),S=s.useMemo(()=>({sortable:{containerId:p,index:x,items:d},...o}),[p,o,x,d]),C=s.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:k,node:E,isOver:R,setNodeRef:P}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=BH("Droppable"),{active:a,dispatch:l,over:c,measureDroppableContainers:u}=s.useContext(SW),d=s.useRef({disabled:n}),p=s.useRef(!1),f=s.useRef(null),h=s.useRef(null),{disabled:m,updateMeasurementsFor:g,timeout:v}={...FW,...o},b=AH(null!=g?g:r),y=sW({callback:s.useCallback(()=>{p.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),h.current=null},v)):p.current=!0},[v]),disabled:m||!a}),w=s.useCallback((e,t)=>{y&&(t&&(y.unobserve(t),p.current=!1),e&&y.observe(e))},[y]),[x,S]=$H(w),C=AH(t);return s.useEffect(()=>{y&&x.current&&(y.disconnect(),p.current=!1,y.observe(x.current))},[x,y]),s.useEffect(()=>(l({type:nV.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:f,data:C}}),()=>l({type:nV.UnregisterDroppable,key:i,id:r})),[r]),s.useEffect(()=>{n!==d.current.disabled&&(l({type:nV.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,l]),{active:a,rect:f,isOver:(null==c?void 0:c.id)===r,node:x,over:c,setNodeRef:S}}({id:a,data:S,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...c}}),{active:M,activatorEvent:T,activeNodeRect:I,attributes:O,setNodeRef:D,listeners:F,isDragging:L,over:A,setActivatorNodeRef:N,transform:$}=DW({id:a,data:S,attributes:{...qW,...n},disabled:w.draggable}),z=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.useMemo(()=>e=>{t.forEach(t=>t(e))},t)}(P,D),j=Boolean(M),B=j&&!m&&NW(f)&&NW(v),_=!b&&L,H=_&&B?$:null,V=B?null!=H?H:(null!=l?l:y)({rects:g,activeNodeRect:I,activeIndex:f,overIndex:v,index:x}):null,W=NW(f)&&NW(v)?i({id:a,items:d,activeIndex:f,overIndex:v}):x,U=null==M?void 0:M.id,G=s.useRef({activeId:U,items:d,newIndex:W,containerId:p}),K=d!==G.current.items,q=t({active:M,containerId:p,isDragging:L,isSorting:j,id:a,index:x,items:d,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:u,wasDragging:null!=G.current.activeId}),Y=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,a]=s.useState(null),l=s.useRef(n);return FH(()=>{if(!t&&n!==l.current&&r.current){const e=o.current;if(e){const t=wV(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&a(n)}}n!==l.current&&(l.current=n)},[t,n,r,o]),s.useEffect(()=>{i&&a(null)},[i]),i}({disabled:!q,index:x,node:E,rect:k});return s.useEffect(()=>{j&&G.current.newIndex!==W&&(G.current.newIndex=W),p!==G.current.containerId&&(G.current.containerId=p),d!==G.current.items&&(G.current.items=d)},[j,W,p,d]),s.useEffect(()=>{if(U===G.current.activeId)return;if(null!=U&&null==G.current.activeId)return void(G.current.activeId=U);const e=setTimeout(()=>{G.current.activeId=U},50);return()=>clearTimeout(e)},[U]),{active:M,activeIndex:f,attributes:O,data:S,rect:k,index:x,newIndex:W,items:d,isOver:R,isSorting:j,isDragging:L,listeners:F,node:E,overIndex:v,over:A,setNodeRef:z,setActivatorNodeRef:N,setDroppableNodeRef:P,setDraggableNodeRef:D,transform:null!=Y?Y:V,transition:function(){if(Y||K&&G.current.newIndex===x)return KW;if(_&&!WH(T)||!u)return;if(j||q)return GH.Transition.toString({...u,property:GW});return}()}}function XW(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const QW=[BV.Down,BV.Right,BV.Up,BV.Left],ZW=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(QW.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];i.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case BV.Down:r.top<i.top&&t.push(n);break;case BV.Up:r.top>i.top&&t.push(n);break;case BV.Left:r.left>i.left&&t.push(n);break;case BV.Right:r.left<i.left&&t.push(n)}});const s=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=uV(t),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=uV(r),a=o.reduce((e,t,r)=>e+lV(n[r],t),0),l=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:l}})}}return i.sort(sV)})({collisionRect:r,droppableRects:o,droppableContainers:t});let c=dV(s,"id");if(c===(null==a?void 0:a.id)&&s.length>1&&(c=s[1].id),null!=c){const e=i.get(n.id),t=i.get(c),a=t?o.get(t.id):null,s=null==t?void 0:t.node.current;if(s&&a&&e&&t){const n=SV(s).some((e,t)=>l[t]!==e),o=JW(e,t),i=function(e,t){if(!XW(e)||!XW(t))return!1;if(!JW(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),c=n||!o?{x:0,y:0}:{x:i?r.width-a.width:0,y:i?r.height-a.height:0},u={x:a.left,y:a.top};return c.x&&c.y?u:VH(u,c)}}}};function JW(e,t){return!(!XW(e)||!XW(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var eU=Sg(Xp.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})),tU=Sg(Xp.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),nU=Sg(Xp.jsx("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z"})),rU=Sg(Xp.jsx("path",{d:"M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z"})),oU=Sg(Xp.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),iU=Sg(Xp.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),aU=Sg(Xp.jsx("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"})),lU=Sg(Xp.jsx("path",{d:"M14 10H3v2h11zm0-4H3v2h11zm4 8v-4h-2v4h-4v2h4v4h2v-4h4v-2zM3 16h7v-2H3z"}));const sU=({id:e,label:t,fullLabel:n,onDelete:r,onMoveUp:o,onMoveDown:i,isFirst:a,isLast:l,sortOrder:u,onSortOrderChange:d,fullPath:p,defaultTitle:f,customTitle:h,onUpdateTitle:m,onResetTitle:g})=>{const[v,b]=s.useState(!1),[y,w]=s.useState(""),x=s.useRef(null),S=s.useRef(null),{attributes:C,listeners:k,setNodeRef:E,transform:R,transition:P,isDragging:M}=YW({id:e}),T={transform:GH.Transform.toString(R),transition:P,opacity:M?.5:1,display:"flex",alignItems:"center",width:"100%"};s.useEffect(()=>{v&&x.current&&(x.current.focus(),x.current.select())},[v]),s.useEffect(()=>{const e=e=>{v&&S.current&&!S.current.contains(e.target)&&O()};if(v)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[v]);const I=()=>{const e=y.trim();""!==e?(m(p,e),b(!1)):O()},O=()=>{b(!1),w("")},D=h||t,F=!!h;return c.createElement("div",Xr({ref:E,style:T},C),c.createElement(jw,{ref:S,sx:{display:"flex",alignItems:"center",width:"100%",gap:1}},c.createElement(jw,Xr({},k,{sx:{display:"flex",alignItems:"center",cursor:"grab","&:active":{cursor:"grabbing"}}}),c.createElement(eU,{sx:{cursor:"grab"}})),v?c.createElement(c.Fragment,null,c.createElement(qE,{inputRef:x,value:y,onChange:e=>w(e.target.value),onKeyDown:e=>{"Enter"===e.key?I():"Escape"===e.key&&O()},size:"small",sx:{width:"200px"}}),c.createElement(Hk,{title:"Save",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:I,color:"primary","aria-label":"save title"},c.createElement(oU,{fontSize:"small"}))),c.createElement(Hk,{title:"Cancel",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:O,"aria-label":"cancel edit"},c.createElement(iU,{fontSize:"small"}))),F&&c.createElement(Hk,{title:"Reset to default",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:()=>{g(p),b(!1),w("")},color:"warning","aria-label":"reset title"},c.createElement(aU,{fontSize:"small"})))):c.createElement(c.Fragment,null,c.createElement(Hk,{title:n,arrow:!0,placement:"top"},c.createElement(zy,{label:D,onDelete:r,color:"primary",variant:"outlined",sx:{fontWeight:F?"bold":"normal",fontStyle:F?"italic":"normal"}})),c.createElement(Hk,{title:"Edit title",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:()=>{w(h||f),b(!0)},"aria-label":"edit title"},c.createElement(mH,{fontSize:"small"})))),!v&&c.createElement(c.Fragment,null,c.createElement(Hk,{title:null===u?"No sort":"asc"===u?"Ascending":"Descending",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:()=>{d(null===u?"asc":"asc"===u?"desc":null)},"aria-label":"toggle sort order",color:u?"primary":"default"},"asc"===u?c.createElement(tU,{fontSize:"small"}):"desc"===u?c.createElement(nU,{fontSize:"small"}):c.createElement(rU,{fontSize:"small",sx:{opacity:.3}}))),c.createElement(jw,{sx:{flex:1}}),c.createElement(jw,{sx:{display:"flex",gap:.5}},c.createElement(Mv,{size:"small",onClick:o,disabled:a,"aria-label":"move up"},c.createElement(tU,{fontSize:"small"})),c.createElement(Mv,{size:"small",onClick:i,disabled:l,"aria-label":"move down"},c.createElement(nU,{fontSize:"small"}))))))},cU=({providersData:e,rootProvider:t,savedDimensions:n=[],onSaveDimension:r,onRemoveDimension:o,onReorderDimensions:i,titleOverrides:a={},onUpdateTitle:l,onResetTitle:u,existingMetrics:d=[],existingFilters:p={}})=>{const[f,h]=s.useState(!1),[m,g]=s.useState([]),[v,b]=s.useState(""),y=iV(oV(XV),oV(UV,{coordinateGetter:ZW})),w=()=>{const r=t?0===m.length?t:m[m.length-1].targetKey:null;if(!r||!e||!e[r])return[];const o=e[r];if(!o.dimensions)return[];const i=[e[t].default_alias];let a=t;m.forEach(t=>{const n=e[a];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&i.push(e.alias)}a=t.targetKey});const l=new Set(n.map(e=>e.fullPath)),s=[];return Object.keys(o.dimensions).forEach(e=>{const t=o.dimensions[e];Object.keys(t).forEach(n=>{const o=t[n],a=`${i.join("_")}.${n}`,c=l.has(a);s.push({key:`${r}_${e}.${n}`,value:o.title||n,dimensionKey:n,alias:e,dimension:o,disabled:c})})}),s},x=()=>{h(!1),g([]),b("")},S=e=>{const n=[t];return e.relationNames&&e.relationNames.length>0&&n.push(...e.relationNames),n.join(" → ")};return c.createElement("div",null,c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:2,marginBottom:2}},f?c.createElement(c.Fragment,null,c.createElement(Xw,{variant:"outlined",onClick:x},"Cancel"),c.createElement(Xw,{variant:"contained",onClick:()=>{if(!v)return;const n=w().find(e=>e.key===v);if(!n)return;const o=[],i=[t],a=[];let l=t;m.forEach(t=>{const n=e[l];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&(o.push(e),a.push(e.name))}i.push(t.targetKey),l=t.targetKey});const s=[e[t].default_alias];o.forEach(e=>{s.push(e.alias)});const c=`${s.join("_")}.${n.dimensionKey}`,u={dimension:n.dimension,relations:o,providerPath:i,relationNames:a,dimensionKey:n.dimensionKey,dimensionTitle:n.value,fullPath:c};r(u),x()},disabled:!v},"Save Dimension")):c.createElement(Xw,{variant:"contained",onClick:()=>{h(!0),g([]),b("")}},"Add Dimension")),f&&c.createElement(qg,{sx:{padding:3,marginBottom:3}},c.createElement(Gv,{variant:"h6",sx:{marginBottom:2}},"Select Provider Path"),c.createElement(kH,{providersData:e,rootProvider:t,onSelectionChange:g,existingDimensions:n,existingMetrics:d,existingFilters:p}),c.createElement(Gv,{variant:"h6",sx:{marginTop:3,marginBottom:2}},"Select Dimension"),c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:1}},c.createElement(uR,{items:w(),value:v,label:"Choose Dimension",onChange:e=>{b(e.target.value)},sx:{width:"400px"}}),c.createElement(Hk,{title:"Add all available dimensions",arrow:!0,placement:"top"},c.createElement("span",null,c.createElement(Mv,{color:"primary",onClick:()=>{const n=w().filter(e=>!e.disabled);if(0===n.length)return;const o=[],i=[t],a=[];let l=t;m.forEach(t=>{const n=e[l];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&(o.push(e),a.push(e.name))}i.push(t.targetKey),l=t.targetKey});const s=[e[t].default_alias];o.forEach(e=>{s.push(e.alias)}),n.forEach(e=>{const t=`${s.join("_")}.${e.dimensionKey}`,n={dimension:e.dimension,relations:o,providerPath:i,relationNames:a,dimensionKey:e.dimensionKey,dimensionTitle:e.value,fullPath:t};r(n)}),x()},disabled:0===w().filter(e=>!e.disabled).length,"aria-label":"add all dimensions"},c.createElement(lU,null)))))),n.length>0&&c.createElement(jw,{sx:{marginTop:3}},c.createElement(Gv,{variant:"h6",sx:{marginBottom:2}},"Saved Dimensions (Drag to reorder or use arrows)"),c.createElement(TW,{sensors:y,collisionDetection:fV,onDragEnd:e=>{const{active:t,over:r}=e;if(r&&t.id!==r.id){const e=n.findIndex((e,n)=>n===t.id),o=n.findIndex((e,t)=>t===r.id),a=LW(n,e,o);i(a)}}},c.createElement(HW,{items:n.map((e,t)=>t),strategy:jW},c.createElement(jw,{sx:{display:"flex",flexDirection:"column",gap:1}},n.map((e,t)=>c.createElement(sU,{key:t,id:t,label:e.dimensionTitle,fullLabel:`${S(e)} → ${e.dimensionTitle} (${e.fullPath})`,onDelete:()=>o(t),onMoveUp:()=>(e=>{if(e>0){const t=LW(n,e,e-1);i(t)}})(t),onMoveDown:()=>(e=>{if(e<n.length-1){const t=LW(n,e,e+1);i(t)}})(t),isFirst:0===t,isLast:t===n.length-1,sortOrder:e.sortOrder||null,onSortOrderChange:e=>((e,t)=>{const r=[...n];r[e]={...r[e],sortOrder:t},i(r)})(t,e),fullPath:e.fullPath,defaultTitle:e.dimensionTitle,customTitle:a[e.fullPath],onUpdateTitle:l,onResetTitle:u})))))))},uU=({id:e,label:t,fullLabel:n,onDelete:r,onMoveUp:o,onMoveDown:i,isFirst:a,isLast:l,fullPath:u,defaultTitle:d,customTitle:p,onUpdateTitle:f,onResetTitle:h})=>{const[m,g]=s.useState(!1),[v,b]=s.useState(""),y=s.useRef(null),w=s.useRef(null),{attributes:x,listeners:S,setNodeRef:C,transform:k,transition:E,isDragging:R}=YW({id:e}),P={transform:GH.Transform.toString(k),transition:E,opacity:R?.5:1,display:"flex",alignItems:"center",width:"100%"};s.useEffect(()=>{m&&y.current&&(y.current.focus(),y.current.select())},[m]),s.useEffect(()=>{const e=e=>{m&&w.current&&!w.current.contains(e.target)&&T()};if(m)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[m]);const M=()=>{const e=v.trim();""!==e?(f(u,e),g(!1)):T()},T=()=>{g(!1),b("")},I=p||t,O=!!p;return c.createElement("div",Xr({ref:C,style:P},x),c.createElement(jw,{ref:w,sx:{display:"flex",alignItems:"center",width:"100%",gap:1}},c.createElement(jw,Xr({},S,{sx:{display:"flex",alignItems:"center",cursor:"grab","&:active":{cursor:"grabbing"}}}),c.createElement(eU,{sx:{cursor:"grab"}})),m?c.createElement(c.Fragment,null,c.createElement(qE,{inputRef:y,value:v,onChange:e=>b(e.target.value),onKeyDown:e=>{"Enter"===e.key?M():"Escape"===e.key&&T()},size:"small",sx:{width:"200px"}}),c.createElement(Hk,{title:"Save",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:M,color:"primary","aria-label":"save title"},c.createElement(oU,{fontSize:"small"}))),c.createElement(Hk,{title:"Cancel",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:T,"aria-label":"cancel edit"},c.createElement(iU,{fontSize:"small"}))),O&&c.createElement(Hk,{title:"Reset to default",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:()=>{h(u),g(!1),b("")},color:"warning","aria-label":"reset title"},c.createElement(aU,{fontSize:"small"})))):c.createElement(c.Fragment,null,c.createElement(Hk,{title:n,arrow:!0,placement:"top"},c.createElement(zy,{label:I,onDelete:r,color:"secondary",variant:"outlined",sx:{fontWeight:O?"bold":"normal",fontStyle:O?"italic":"normal"}})),c.createElement(Hk,{title:"Edit title",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:()=>{b(p||d),g(!0)},"aria-label":"edit title"},c.createElement(mH,{fontSize:"small"})))),!m&&c.createElement(c.Fragment,null,c.createElement(jw,{sx:{flex:1}}),c.createElement(jw,{sx:{display:"flex",gap:.5}},c.createElement(Mv,{size:"small",onClick:o,disabled:a,"aria-label":"move up"},c.createElement(tU,{fontSize:"small"})),c.createElement(Mv,{size:"small",onClick:i,disabled:l,"aria-label":"move down"},c.createElement(nU,{fontSize:"small"}))))))},dU=({providersData:e,rootProvider:t,savedMetrics:n=[],onSaveMetric:r,onRemoveMetric:o,onReorderMetrics:i,titleOverrides:a={},onUpdateTitle:l,onResetTitle:u,existingDimensions:d=[],existingFilters:p={}})=>{const[f,h]=s.useState(!1),[m,g]=s.useState([]),[v,b]=s.useState(""),y=iV(oV(XV),oV(UV,{coordinateGetter:ZW})),w=()=>{const r=t?0===m.length?t:m[m.length-1].targetKey:null;if(!r||!e||!e[r])return[];const o=e[r];if(!o.metrics)return[];const i=[e[t].default_alias];let a=t;m.forEach(t=>{const n=e[a];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&i.push(e.alias)}a=t.targetKey});const l=new Set(n.map(e=>e.fullPath)),s=o.metrics.map((e,t)=>{const n=`${i.join("_")}.${e.name}`,o=l.has(n);return{key:`${r}_${e.name}_${t}`,value:e.title||e.name,metricName:e.name,metric:e,disabled:o}});return s},x=()=>{h(!1),g([]),b("")},S=e=>{const n=[t];return e.relationNames&&e.relationNames.length>0&&n.push(...e.relationNames),n.join(" → ")};return c.createElement("div",null,c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:2,marginBottom:2}},f?c.createElement(c.Fragment,null,c.createElement(Xw,{variant:"outlined",onClick:x},"Cancel"),c.createElement(Xw,{variant:"contained",onClick:()=>{if(!v)return;const n=w().find(e=>e.key===v);if(!n)return;const o=[],i=[t],a=[];let l=t;m.forEach(t=>{const n=e[l];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&(o.push(e),a.push(e.name))}i.push(t.targetKey),l=t.targetKey});const s=[e[t].default_alias];o.forEach(e=>{s.push(e.alias)});const c=`${s.join("_")}.${n.metricName}`,u={metric:n.metric,relations:o,providerPath:i,relationNames:a,metricName:n.metricName,metricTitle:n.value,fullPath:c};r(u),x()},disabled:!v},"Save Metric")):c.createElement(Xw,{variant:"contained",onClick:()=>{h(!0),g([]),b("")}},"Add Metric")),f&&c.createElement(qg,{sx:{padding:3,marginBottom:3}},c.createElement(Gv,{variant:"h6",sx:{marginBottom:2}},"Select Provider Path"),c.createElement(kH,{providersData:e,rootProvider:t,onSelectionChange:g,existingDimensions:d,existingMetrics:n,existingFilters:p}),c.createElement(Gv,{variant:"h6",sx:{marginTop:3,marginBottom:2}},"Select Metric"),c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:1}},c.createElement(uR,{items:w(),value:v,label:"Choose Metric",onChange:e=>{b(e.target.value)},sx:{width:"400px"}}),c.createElement(Hk,{title:"Add all available metrics",arrow:!0,placement:"top"},c.createElement("span",null,c.createElement(Mv,{color:"primary",onClick:()=>{const n=w().filter(e=>!e.disabled);if(0===n.length)return;const o=[],i=[t],a=[];let l=t;m.forEach(t=>{const n=e[l];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&(o.push(e),a.push(e.name))}i.push(t.targetKey),l=t.targetKey});const s=[e[t].default_alias];o.forEach(e=>{s.push(e.alias)}),n.forEach(e=>{const t=`${s.join("_")}.${e.metricName}`,n={metric:e.metric,relations:o,providerPath:i,relationNames:a,metricName:e.metricName,metricTitle:e.value,fullPath:t};r(n)}),x()},disabled:0===w().filter(e=>!e.disabled).length,"aria-label":"add all metrics"},c.createElement(lU,null)))))),n.length>0&&c.createElement(jw,{sx:{marginTop:3}},c.createElement(Gv,{variant:"h6",sx:{marginBottom:2}},"Saved Metrics (Drag to reorder or use arrows)"),c.createElement(TW,{sensors:y,collisionDetection:fV,onDragEnd:e=>{const{active:t,over:r}=e;if(r&&t.id!==r.id){const e=n.findIndex((e,n)=>n===t.id),o=n.findIndex((e,t)=>t===r.id),a=LW(n,e,o);i(a)}}},c.createElement(HW,{items:n.map((e,t)=>t),strategy:jW},c.createElement(jw,{sx:{display:"flex",flexDirection:"column",gap:1}},n.map((e,t)=>c.createElement(uU,{key:t,id:t,label:e.metricTitle,fullLabel:`${S(e)} → ${e.metricTitle} (${e.fullPath})`,onDelete:()=>o(t),onMoveUp:()=>(e=>{if(e>0){const t=LW(n,e,e-1);i(t)}})(t),onMoveDown:()=>(e=>{if(e<n.length-1){const t=LW(n,e,e+1);i(t)}})(t),isFirst:0===t,isLast:t===n.length-1,fullPath:e.fullPath,defaultTitle:e.metricTitle,customTitle:a[e.fullPath],onUpdateTitle:l,onResetTitle:u})))))))};var pU=Sg(Xp.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61"}));const fU=["localeText"],hU=s.createContext(null),mU=function(e){const{localeText:t}=e,n=d(e,fU),{adapter:r,localeText:o}=s.useContext(hU)??{adapter:void 0,localeText:void 0},i=cg({props:n,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:c,dateLibInstance:u,adapterLocale:p,localeText:h}=i,m=s.useMemo(()=>f({},h,o,t),[h,o,t]),g=s.useMemo(()=>{if(!l)return r||null;const e=new l({locale:p,formats:c,instance:u});if(!e.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/quickstart/#installation"].join("\n"));return e},[l,p,c,u,r]),v=s.useMemo(()=>g?{minDate:g.date("1900-01-01T00:00:00.000"),maxDate:g.date("2099-12-31T00:00:00.000")}:null,[g]),b=s.useMemo(()=>({utils:g,adapter:g,defaultDates:v,localeText:m}),[v,g,m]);return Xp.jsx(hU.Provider,{value:b,children:a})},gU=(e,t)=>e.length===t.length&&t.every(t=>e.includes(t)),vU=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},bU=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:o,isDateDisabled:i,adapter:a,timezone:l})=>{const s=vU(a,a.date(void 0,l),e);n&&a.isBefore(o,s)&&(o=s),t&&a.isAfter(r,s)&&(r=s);let c=e,u=e;for(a.isBefore(e,o)&&(c=o,u=null),a.isAfter(e,r)&&(u&&(u=r),c=null);c||u;){if(c&&a.isAfter(c,r)&&(c=null),u&&a.isBefore(u,o)&&(u=null),c){if(!i(c))return c;c=a.addDays(c,1)}if(u){if(!i(u))return u;u=a.addDays(u,-1)}}return null},yU=(e,t,n)=>null!=t&&e.isValid(t)?t:n,wU=(e,t)=>{const n=[e.startOfYear(t)];for(;n.length<12;){const t=n[n.length-1];n.push(e.addMonths(t,1))}return n},xU=(e,t,n)=>"date"===n?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),SU=["year","month","day"],CU=e=>SU.includes(e),kU=(e,{format:t,views:n},r)=>{if(null!=t)return t;const o=e.formats;return gU(n,["year"])?o.year:gU(n,["month"])?o.month:gU(n,["day"])?o.dayOfMonth:gU(n,["month","year"])?`${o.month} ${o.year}`:gU(n,["day","month"])?`${o.month} ${o.dayOfMonth}`:r?/en/.test(e.getCurrentLocaleCode())?o.normalDateWithWeekday:o.normalDate:o.keyboardDate},EU=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(t=>e.addDays(n,t))},RU=["hours","minutes","seconds"],PU=(e,t)=>3600*t.getHours(e)+60*t.getMinutes(e)+t.getSeconds(e),MU={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},TU=(e,t,n)=>{if(t===MU.year)return e.startOfYear(n);if(t===MU.month)return e.startOfMonth(n);if(t===MU.day)return e.startOfDay(n);let r=n;return t<MU.minutes&&(r=e.setMinutes(r,0)),t<MU.seconds&&(r=e.setSeconds(r,0)),t<MU.milliseconds&&(r=e.setMilliseconds(r,0)),r},IU=({props:e,adapter:t,granularity:n,timezone:r,getTodayDate:o})=>{let i=o?o():TU(t,n,xU(t,r));null!=e.minDate&&t.isAfterDay(e.minDate,i)&&(i=TU(t,n,e.minDate)),null!=e.maxDate&&t.isBeforeDay(e.maxDate,i)&&(i=TU(t,n,e.maxDate));const a=((e,t)=>(n,r)=>e?t.isAfter(n,r):PU(n,t)>PU(r,t))(e.disableIgnoringDatePartForTimeValidation??!1,t);return null!=e.minTime&&a(e.minTime,i)&&(i=TU(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:vU(t,i,e.minTime))),null!=e.maxTime&&a(i,e.maxTime)&&(i=TU(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:vU(t,i,e.maxTime))),i},OU=(e,t)=>{const n=e.formatTokenMap[t];if(null==n)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join("\n"));return"string"==typeof n?{type:n,contentType:"meridiem"===n?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},DU=(e,t)=>{const n=[],r=e.date(void 0,"default"),o=e.startOfWeek(r),i=e.endOfWeek(r);let a=o;for(;e.isBefore(a,i);)n.push(a),a=e.addDays(a,1);return n.map(n=>e.formatByString(n,t))},FU=(e,t,n,r)=>{switch(n){case"month":return wU(e,e.date(void 0,t)).map(t=>e.formatByString(t,r));case"weekDay":return DU(e,r);case"meridiem":{const n=e.date(void 0,t);return[e.startOfDay(n),e.endOfDay(n)].map(t=>e.formatByString(t,r))}default:return[]}},LU=["0","1","2","3","4","5","6","7","8","9"],AU=(e,t)=>{if("0"===t[0])return e;const n=[];let r="";for(let o=0;o<e.length;o+=1){r+=e[o];const i=t.indexOf(r);i>-1&&(n.push(i.toString()),r="")}return n.join("")},NU=(e,t)=>"0"===t[0]?e:e.split("").map(e=>t[Number(e)]).join(""),$U=(e,t)=>{const n=AU(e,t);return" "!==n&&!Number.isNaN(Number(n))},zU=(e,t)=>Number(e).toString().padStart(t,"0"),jU=(e,t,n,r,o)=>{if("day"===o.type&&"digit-with-letter"===o.contentType){const r=e.setDate(n.longestMonth,t);return e.formatByString(r,o.format)}let i=t.toString();return o.hasLeadingZerosInInput&&(i=zU(i,o.maxLength)),NU(i,r)},BU=(e,t,n)=>{let r=e.value||e.placeholder;const o="non-input"===t?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;"non-input"===t&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number(AU(r,n)).toString());return["input-rtl","input-ltr"].includes(t)&&"digit"===e.contentType&&!o&&1===r.length&&(r=`${r}‎`),"input-rtl"===t&&(r=`⁨${r}⁩`),r},_U=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),HU=(e,t)=>4===e.formatByString(e.date(void 0,"system"),t).length,VU=(e,t,n,r)=>{if("digit"!==t)return!1;const o=e.date(void 0,"default");switch(n){case"year":return"dayjs"===e.lib&&"YY"===r||e.formatByString(e.setYear(o,1),r).startsWith("0");case"month":return e.formatByString(e.startOfYear(o),r).length>1;case"day":return e.formatByString(e.startOfMonth(o),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(o),r).length>1;case"hours":return e.formatByString(e.setHours(o,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(o,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(o,1),r).length>1;default:throw new Error("Invalid section type")}},WU={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},UU=(e,t,n,r,o)=>[...n].sort((e,t)=>WU[e.type]-WU[t.type]).reduce((n,r)=>!o||r.modified?((e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{let r=e.formatByString(n,t.format);t.hasLeadingZerosInInput&&(r=zU(r,t.maxLength));const o=DU(e,t.format),i=o.indexOf(r),a=o.indexOf(t.value)-i;return e.addDays(n,a)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{const t=e.getHours(n)<12,o=e.getHours(r);return t&&o>=12?e.addHours(r,-12):!t&&o<12?e.addHours(r,12):r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}})(e,r,t,n):n,r),GU=(e,t)=>{if(null==e)return null;if("all"===e)return"all";if("string"==typeof e){const n=t.findIndex(t=>t.type===e);return-1===n?null:n}return e},KU=["value","referenceDate"],qU={emptyValue:null,getTodayValue:xU,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=d(e,KU);return r.adapter.isValid(t)?t:null!=n?n:IU(r)},cleanValue:(e,t)=>e.isValid(t)?t:null,areValuesEqual:(e,t,n)=>!e.isValid(t)&&null!=t&&!e.isValid(n)&&null!=n||e.isEqual(t,n),isSameError:(e,t)=>e===t,hasError:e=>null!=e,defaultErrorState:null,getTimezone:(e,t)=>e.isValid(t)?e.getTimezone(t):null,setTimezone:(e,t,n)=>null==n?null:e.setTimezone(n,t)},YU={updateReferenceValue:(e,t,n)=>e.isValid(t)?t:n,getSectionsFromValue:(e,t)=>t(e),getV7HiddenInputValueFromSections:e=>e.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),getV6InputValueFromSections:(e,t,n)=>{const r=e.map(e=>{const r=BU(e,n?"input-rtl":"input-ltr",t);return`${e.startSeparator}${r}${e.endSeparator}`}).join("");return n?`⁦${r}⁩`:r},parseValueStr:(e,t,n)=>n(e.trim(),t),getDateFromSection:e=>e,getDateSectionsFromValue:e=>e,updateDateInValue:(e,t,n)=>n,clearDateSections:e=>e.map(e=>f({},e,{value:""}))};function XU(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=XU(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function QU(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=XU(e))&&(r&&(r+=" "),r+=t);return r}function ZU(e){return Ph("MuiPickersToolbar",e)}Mh("MuiPickersToolbar",["root","title","content"]);const JU=s.createContext(()=>!0);const eG=s.createContext(null);function tG(){return s.useContext(eG)}const nG=s.createContext(null),rG=()=>{const e=s.useContext(nG);if(null==e)throw new Error("MUI X: The `usePickerContext` hook can only be called inside the context of a Picker component");return e},oG=s.createContext(null),iG=s.createContext({ownerState:{isPickerDisabled:!1,isPickerReadOnly:!1,isPickerValueEmpty:!1,isPickerOpen:!1,pickerVariant:"desktop",pickerOrientation:"portrait"},rootRefObject:{current:null},labelId:void 0,dismissViews:()=>{},hasUIView:!0,getCurrentViewMode:()=>"UI",triggerElement:null,viewContainerRole:null,defaultActionBarActions:[],onPopperExited:void 0});function aG(e){const{contextValue:t,actionsContextValue:n,privateContextValue:r,fieldPrivateContextValue:o,isValidContextValue:i,localeText:a,children:l}=e;return Xp.jsx(nG.Provider,{value:t,children:Xp.jsx(oG.Provider,{value:n,children:Xp.jsx(iG.Provider,{value:r,children:Xp.jsx(eG.Provider,{value:o,children:Xp.jsx(JU.Provider,{value:i,children:Xp.jsx(mU,{localeText:a,children:l})})})})})})}const lG=()=>s.useContext(iG);function sG(){const{ownerState:e}=lG(),t=um();return s.useMemo(()=>f({},e,{toolbarDirection:t?"rtl":"ltr"}),[e,t])}const cG=["children","className","classes","toolbarTitle","hidden","titleId","classes","landscapeDirection"],uG=pg("div",{name:"MuiPickersToolbar",slot:"Root"})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{pickerOrientation:"landscape"},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),dG=pg("div",{name:"MuiPickersToolbar",slot:"Content",shouldForwardProp:e=>Oh(e)&&"landscapeDirection"!==e})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{pickerOrientation:"landscape"},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{pickerOrientation:"landscape",landscapeDirection:"row"},style:{flexDirection:"row"}}]}),pG=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersToolbar"}),{children:r,className:o,classes:i,toolbarTitle:a,hidden:l,titleId:s,landscapeDirection:c}=n,u=d(n,cG),p=sG(),h=(e=>wm({root:["root"],title:["title"],content:["content"]},ZU,e))(i);return l?null:Xp.jsxs(uG,f({ref:t,className:QU(h.root,o),ownerState:p},u,{children:[Xp.jsx(Gv,{color:"text.secondary",variant:"overline",id:s,className:h.title,children:a}),Xp.jsx(dG,{className:h.content,ownerState:p,landscapeDirection:c,children:r})]}))}),fG={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>"year"===e?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",nextStepButtonLabel:"Next",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",timeRangePickerToolbarTitle:"Select time range",clockLabelText:(e,t)=>`Select ${e}. ${t?`Selected time is ${t}`:"No time selected"}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:e=>e?`Choose date, selected date is ${e}`:"Choose date",openTimePickerDialogue:e=>e?`Choose time, selected time is ${e}`:"Choose time",openRangePickerDialogue:e=>e?`Choose range, selected range is ${e}`:"Choose range",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>"letter"===e.contentType?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>"letter"===e.contentType?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},hG=fG;f({},fG);const mG=()=>{const e=s.useContext(hU);if(null===e)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join("\n"));if(null===e.adapter)throw new Error(["MUI X: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join("\n"));const t=s.useMemo(()=>f({},hG,e.localeText),[e.localeText]);return s.useMemo(()=>f({},e,{localeText:t}),[e,t])},gG=()=>mG().adapter,vG=()=>mG().localeText,bG=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],yG=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],wG=["minDateTime","maxDateTime"],xG=[...bG,...yG,...wG],SG=e=>xG.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{}),CG=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","unstableStartFieldRef","unstableEndFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator","autoFocus","focused"],kG=(e,t)=>s.useMemo(()=>{const n=f({},e),r={},o=e=>{n.hasOwnProperty(e)&&(r[e]=n[e],delete n[e])};return CG.forEach(o),"date"===t?bG.forEach(o):"time"===t?yG.forEach(o):"date-time"===t&&(bG.forEach(o),yG.forEach(o),wG.forEach(o)),{forwardedProps:n,internalProps:r}},[e,t]),EG=(e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}},RG=({adapter:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:o,now:i,token:a,startSeparator:l})=>{if(""===a)throw new Error("MUI X: Should not call `commitToken` with an empty token");const s=OU(e,a),c=VU(e,s.contentType,s.type,a),u=n?c:"digit"===s.contentType,d=e.isValid(t);let p=d?e.formatByString(t,a):"",h=null;if(u)if(c)h=""===p?e.formatByString(i,a).length:p.length;else{if(null==s.maxLength)throw new Error(`MUI X: The token ${a} should have a 'maxLength' property on it's adapter`);h=s.maxLength,d&&(p=NU(zU(AU(p,o),h),o))}return f({},s,{format:a,maxLength:h,value:p,placeholder:EG(e,r,s,a),hasLeadingZerosInFormat:c,hasLeadingZerosInInput:u,startSeparator:l,endSeparator:"",modified:!1})},PG=e=>{let t=(({adapter:e,format:t})=>{let n=10,r=t,o=e.expandFormat(t);for(;o!==r;)if(r=o,o=e.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the component.");return o})(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));const n=(({adapter:e,expandedFormat:t})=>{const n=[],{start:r,end:o}=e.escapedCharacters,i=new RegExp(`(\\${r}[^\\${o}]*\\${o})+`,"g");let a=null;for(;a=i.exec(t);)n.push({start:a.index,end:i.lastIndex-1});return n})(f({},e,{expandedFormat:t})),r=(e=>{const{adapter:t,expandedFormat:n,escapedParts:r}=e,o=t.date(void 0),i=[];let a="";const l=Object.keys(t.formatTokenMap).sort((e,t)=>t.length-e.length),s=/^([a-zA-Z]+)/,c=new RegExp(`^(${l.join("|")})*$`),u=new RegExp(`^(${l.join("|")})`),d=e=>r.find(t=>t.start<=e&&t.end>=e);let p=0;for(;p<n.length;){const t=d(p),r=null!=t,l=s.exec(n.slice(p))?.[1];if(!r&&null!=l&&c.test(l)){let t=l;for(;t.length>0;){const n=u.exec(t)[1];t=t.slice(n.length),i.push(RG(f({},e,{now:o,token:n,startSeparator:a}))),a=""}p+=l.length}else{const e=n[p];r&&t?.start===p||t?.end===p||(0===i.length?a+=e:(i[i.length-1].endSeparator+=e,i[i.length-1].isEndFormatSeparator=!0)),p+=1}}return 0===i.length&&a.length>0&&i.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:a,endSeparator:"",modified:!1}),i})(f({},e,{expandedFormat:t,escapedParts:n}));return(({isRtl:e,formatDensity:t,sections:n})=>n.map(n=>{const r=n=>{let r=n;return e&&null!==r&&r.includes(" ")&&(r=`⁩${r}⁦`),"spacious"===t&&["/",".","-"].includes(r)&&(r=` ${r} `),r};return n.startSeparator=r(n.startSeparator),n.endSeparator=r(n.endSeparator),n}))(f({},e,{sections:r}))},MG=()=>s.useContext(nG);function TG(e){return Ph("MuiDatePickerToolbar",e)}Mh("MuiDatePickerToolbar",["root","title"]);const IG=["toolbarFormat","toolbarPlaceholder","className","classes"],OG=pg(pG,{name:"MuiDatePickerToolbar",slot:"Root"})({}),DG=pg(Gv,{name:"MuiDatePickerToolbar",slot:"Title"})({variants:[{props:{pickerOrientation:"landscape"},style:{margin:"auto 16px auto auto"}}]}),FG=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiDatePickerToolbar"}),{toolbarFormat:r,toolbarPlaceholder:o="––",className:i,classes:a}=n,l=d(n,IG),c=gG(),{value:u,views:p,orientation:h}=rG(),m=vG(),g=sG(),v=(e=>wm({root:["root"],title:["title"]},TG,e))(a),b=s.useMemo(()=>{if(!c.isValid(u))return o;const e=kU(c,{format:r,views:p},!0);return c.formatByString(u,e)},[u,r,o,c,p]);return Xp.jsx(OG,f({ref:t,toolbarTitle:m.datePickerToolbarTitle,className:QU(v.root,i)},l,{children:Xp.jsx(DG,{variant:"h4",align:"landscape"===h?"left":"center",ownerState:g,className:v.title,children:b})}))}),LG=({props:e,value:t,timezone:n,adapter:r})=>{if(null===t)return null;const{shouldDisableDate:o,shouldDisableMonth:i,shouldDisableYear:a,disablePast:l,disableFuture:s,minDate:c,maxDate:u}=e,d=r.date(void 0,n);switch(!0){case!r.isValid(t):return"invalidDate";case Boolean(o&&o(t)):return"shouldDisableDate";case Boolean(i&&i(t)):return"shouldDisableMonth";case Boolean(a&&a(t)):return"shouldDisableYear";case Boolean(s&&r.isAfterDay(t,d)):return"disableFuture";case Boolean(l&&r.isBeforeDay(t,d)):return"disablePast";case Boolean(c&&r.isBeforeDay(t,c)):return"minDate";case Boolean(u&&r.isAfterDay(t,u)):return"maxDate";default:return null}};function AG(e){const{props:t,validator:n,value:r,timezone:o,onError:i}=e,a=gG(),l=s.useRef(n.valueManager.defaultErrorState),c=n({adapter:a,value:r,timezone:o,props:t}),u=n.valueManager.hasError(c);s.useEffect(()=>{i&&!n.valueManager.isSameError(c,l.current)&&i(c,r),l.current=c},[n,i,c,r]);const d=Mg(e=>n({adapter:a,value:e,timezone:o,props:t}));return{validationError:c,hasValidationError:u,getValidationErrorForNewValue:d}}LG.valueManager=qU;const NG=e=>{const t=gG(),n=s.useRef(void 0);return void 0===n.current&&(n.current=t.date(void 0,e)),n.current};function $G(e){const t=gG(),n=vG();return s.useMemo(()=>{const r=t.isValid(e)?t.format(e,"fullDate"):null;return n.openDatePickerDialogue(r)},[e,n,t])}function zG(e){const t=gG(),n=jG(e);return s.useMemo(()=>f({},e,n,{format:e.format??t.formats.keyboardDate}),[e,n,t])}function jG(e){const t=gG(),n=mG().defaultDates;return s.useMemo(()=>({disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,minDate:yU(t,e.minDate,n.minDate),maxDate:yU(t,e.maxDate,n.maxDate)}),[e.minDate,e.maxDate,e.disableFuture,e.disablePast,t,n])}function BG(e,t){const n=cg({props:e,name:t}),r=jG(n),o=s.useMemo(()=>null==n.localeText?.toolbarTitle?n.localeText:f({},n.localeText,{datePickerToolbarTitle:n.localeText.toolbarTitle}),[n.localeText]);return f({},n,r,{localeText:o},(({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const o=n??r;let i;if(null!=e)i=e;else if(o.includes(t))i=t;else{if(!(o.length>0))throw new Error("MUI X: The `views` prop must contain at least one view.");i=o[0]}return{views:o,openTo:i}})({views:n.views,openTo:n.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{slots:f({toolbar:FG},n.slots)})}function _G(e){return Ph("MuiPickerPopper",e)}Mh("MuiPickerPopper",["root","paper"]);const HG=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?HG(t.shadowRoot):t:null},VG=e=>HG(kg(e)),WG="@media (pointer: fine)",UG=["PaperComponent","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],GG=pg(My,{name:"MuiPickerPopper",slot:"Root"})(({theme:e})=>({zIndex:e.zIndex.modal})),KG=pg(qg,{name:"MuiPickerPopper",slot:"Paper"})({outline:0,transformOrigin:"top center",variants:[{props:({popperPlacement:e})=>new Set(["top","top-start","top-end"]).has(e),style:{transformOrigin:"bottom center"}}]});const qG=s.forwardRef((e,t)=>{const{PaperComponent:n,ownerState:r,children:o,paperSlotProps:i,paperClasses:a,onPaperClick:l,onPaperTouchStart:s}=e,c=d(e,UG),u=yy({elementType:n,externalSlotProps:i,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:a,ownerState:r});return Xp.jsx(n,f({},c,u,{onClick:e=>{l(e),u.onClick?.(e)},onTouchStart:e=>{s(e),u.onTouchStart?.(e)},ownerState:r,children:o}))});function YG(e){const t=cg({props:e,name:"MuiPickerPopper"}),{children:n,placement:r="bottom-start",slots:o,slotProps:i,classes:a}=t,{open:l,popupRef:c,reduceAnimations:u}=rG(),{ownerState:d,rootRefObject:p}=lG(),{dismissViews:h,getCurrentViewMode:m,onPopperExited:g,triggerElement:v,viewContainerRole:b}=lG();s.useEffect(()=>{function e(e){l&&"Escape"===e.key&&h()}return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[h,l]);const y=s.useRef(null);s.useEffect(()=>{"tooltip"!==b&&"field"!==m()&&(l?y.current=VG(p.current):y.current&&y.current instanceof HTMLElement&&setTimeout(()=>{y.current instanceof HTMLElement&&y.current.focus()}))},[l,b,m,p]);const w=(e=>wm({root:["root"],paper:["paper"]},_G,e))(a),x=Mg(()=>{"tooltip"===b?setTimeout(()=>{p.current?.contains(VG(p.current))||c.current?.contains(VG(c.current))||h()},0):h()}),[S,C,k]=function(e,t){const n=s.useRef(!1),r=s.useRef(!1),o=s.useRef(null),i=s.useRef(!1);s.useEffect(()=>{if(e)return document.addEventListener("mousedown",t,!0),document.addEventListener("touchstart",t,!0),()=>{document.removeEventListener("mousedown",t,!0),document.removeEventListener("touchstart",t,!0),i.current=!1};function t(){i.current=!0}},[e]);const a=Mg(e=>{if(!i.current)return;const a=r.current;r.current=!1;const l=kg(o.current);if(!o.current||"clientX"in e&&function(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}(e,l))return;if(n.current)return void(n.current=!1);let s;s=e.composedPath?e.composedPath().indexOf(o.current)>-1:!l.documentElement.contains(e.target)||o.current.contains(e.target),s||a||t(e)}),l=e=>{e.defaultMuiPrevented||(r.current=!0)};return s.useEffect(()=>{if(e){const e=kg(o.current),t=()=>{n.current=!0};return e.addEventListener("touchstart",a),e.addEventListener("touchmove",t),()=>{e.removeEventListener("touchstart",a),e.removeEventListener("touchmove",t)}}},[e,a]),s.useEffect(()=>{if(e){const e=kg(o.current);return e.addEventListener("click",a),()=>{e.removeEventListener("click",a),r.current=!1}}},[e,a]),[o,l,l]}(l,x),E=Tg(s.useRef(null),c),R=Tg(E,S),P=o?.desktopTransition??u?Pw:PS,M=o?.desktopTrapFocus??Cx,T=o?.desktopPaper??KG,I=o?.popper??GG,O=yy({elementType:I,externalSlotProps:i?.popper,additionalProps:{transition:!0,role:null==b?void 0:b,open:l,placement:r,anchorEl:v,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),h())}},className:w.root,ownerState:d}),D=s.useMemo(()=>f({},d,{popperPlacement:O.placement}),[d,O.placement]);return Xp.jsx(I,f({},O,{children:({TransitionProps:e})=>Xp.jsx(M,f({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:"tooltip"===b,isEnabled:()=>!0},i?.desktopTrapFocus,{children:Xp.jsx(P,f({},e,i?.desktopTransition,{onExited:t=>{g?.(),i?.desktopTransition?.onExited?.(t),e?.onExited?.()},children:Xp.jsx(qG,{PaperComponent:T,ownerState:D,ref:R,onPaperClick:C,onPaperTouchStart:k,paperClasses:w.paper,paperSlotProps:i?.desktopPaper,children:n})}))}))}))}const XG="undefined"!=typeof navigator&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),QG=XG&&XG[1]?parseInt(XG[1],10):null,ZG=XG&&XG[2]?parseInt(XG[2],10):null,JG=QG&&QG<10||ZG&&ZG<13||!1;function eK(e){const t=nR("@media (prefers-reduced-motion: reduce)",{defaultMatches:!1});return null!=e?e:t||JG}const tK={hasNextStep:!1,hasSeveralSteps:!1,goToNextStep:()=>{},areViewsInSameStep:()=>!0};function nK({onChange:e,onViewChange:t,openTo:n,view:r,views:o,autoFocus:i,focusedView:a,onFocusedViewChange:l,getStepNavigation:c}){const u=s.useRef(n),d=s.useRef(o),p=s.useRef(o.includes(n)?n:o[0]),[h,m]=Pg({name:"useViews",state:"view",controlled:r,default:p.current}),g=s.useRef(i?h:null),[v,b]=Pg({name:"useViews",state:"focusedView",controlled:a,default:g.current}),y=c?c({setView:m,view:h,defaultView:p.current,views:o}):tK;s.useEffect(()=>{(u.current&&u.current!==n||d.current&&d.current.some(e=>!o.includes(e)))&&(m(o.includes(n)?n:o[0]),d.current=o,u.current=n)},[n,m,h,o]);const w=o.indexOf(h),x=o[w-1]??null,S=o[w+1]??null,C=Mg((e,t)=>{b(t?e:t=>e===t?null:t),l?.(e,t)}),k=Mg(e=>{C(e,!0),e!==h&&(m(e),t&&t(e))}),E=Mg(()=>{S&&k(S)}),R=Mg((t,n,r)=>{const i="finish"===n,a=r?o.indexOf(r)<o.length-1:Boolean(S);e(t,i&&a?"partial":n,r);let l=null;if(null!=r&&r!==h?l=r:i&&(l=h),null==l)return;const s=o[o.indexOf(l)+1];null!=s&&y.areViewsInSameStep(l,s)&&k(s)});return f({},y,{view:h,setView:k,focusedView:v,setFocusedView:C,nextView:S,previousView:x,defaultView:o.includes(n)?n:o[0],goToNextView:E,setValueAndGoToNextView:R})}function rK(){return"undefined"==typeof window?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?90===Math.abs(window.screen.orientation.angle)?"landscape":"portrait":window.orientation&&90===Math.abs(Number(window.orientation))?"landscape":"portrait"}function oK(e,t){const[n,r]=s.useState(rK);return Wh(()=>{const e=()=>{r(rK())};return window.addEventListener("orientationchange",e),()=>{window.removeEventListener("orientationchange",e)}},[]),o=e,i=["hours","minutes","seconds"],(Array.isArray(i)?i.every(e=>-1!==o.indexOf(e)):-1!==o.indexOf(i))?"portrait":t??n;var o,i}const iK=({name:e,timezone:t,value:n,defaultValue:r,referenceDate:o,onChange:i,valueManager:a})=>{const l=gG(),[c,u]=Pg({name:e,state:"value",controlled:n,default:r??a.emptyValue}),d=s.useMemo(()=>a.getTimezone(l,c),[l,a,c]),p=Mg(e=>null==d?e:a.setTimezone(l,d,e)),f=s.useMemo(()=>t||(d||(o?l.getTimezone(Array.isArray(o)?o[0]:o):"default")),[t,d,o,l]);return{value:s.useMemo(()=>a.setTimezone(l,f,c),[a,l,f,c]),handleValueChange:Mg((e,...t)=>{const n=p(e);u(n),i?.(n,...t)}),timezone:f}};const aK=["className","sx"],lK=({ref:e,props:t,valueManager:n,valueType:r,variant:o,validator:i,onPopperExited:a,autoFocusView:l,rendererInterceptor:c,localeText:u,viewContainerRole:p,getStepNavigation:h})=>{const{views:m,view:g,openTo:v,onViewChange:b,viewRenderers:y,reduceAnimations:w,orientation:x,disableOpenPicker:S,closeOnSelect:C,disabled:k,readOnly:E,formatDensity:R,enableAccessibleFieldDOMStructure:P,selectedSections:M,onSelectedSectionsChange:T,format:I,label:O,autoFocus:D,name:F}=t,{className:L,sx:A}=t,N=d(t,aK),$=mm(),z=gG(),j=eK(w),B=oK(m,x),{current:_}=s.useRef(v??null),[H,V]=s.useState(null),W=s.useRef(null),U=s.useRef(null),G=s.useRef(null),K=Tg(e,G),{timezone:q,state:Y,setOpen:X,setValue:Q,setValueFromView:Z,value:J,viewValue:ee}=function(e){const{props:t,valueManager:n,validator:r}=e,{value:o,defaultValue:i,onChange:a,referenceDate:l,timezone:c,onAccept:u,closeOnSelect:d,open:p,onOpen:h,onClose:m}=t,{current:g}=s.useRef(i),{current:v}=s.useRef(void 0!==o),{current:b}=s.useRef(void 0!==p),y=gG(),{timezone:w,value:x,handleValueChange:S}=iK({name:"a picker component",timezone:c,value:o,defaultValue:g,referenceDate:l,onChange:a,valueManager:n}),[C,k]=s.useState(()=>({open:!1,lastExternalValue:x,clockShallowValue:void 0,lastCommittedValue:x,hasBeenModifiedSinceMount:!1})),{getValidationErrorForNewValue:E}=AG({props:t,validator:r,timezone:w,value:x,onError:t.onError}),R=Mg(e=>{const t="function"==typeof e?e(C.open):e;b||k(e=>f({},e,{open:t})),t&&h&&h(),t||m?.()}),P=Mg((e,t)=>{const{changeImportance:r="accept",skipPublicationIfPristine:o=!1,validationError:i,shortcut:a,source:l,shouldClose:s="accept"===r}=t??{};let c,d;o||v||C.hasBeenModifiedSinceMount?(c=!n.areValuesEqual(y,e,x),d="accept"===r&&!n.areValuesEqual(y,e,C.lastCommittedValue)):(c=!0,d="accept"===r),k(t=>f({},t,{clockShallowValue:c?void 0:t.clockShallowValue,lastCommittedValue:d?e:t.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let p=null;const h=()=>{if(!p){let t;t=l||(a?"view":"unknown"),p={validationError:null==i?E(e):i,source:t},a&&(p.shortcut=a)}return p};c&&S(e,h()),d&&u&&u(e,h()),s&&R(!1)});x!==C.lastExternalValue&&k(e=>f({},e,{lastExternalValue:x,clockShallowValue:void 0,hasBeenModifiedSinceMount:!0}));const M=Mg((e,t="partial")=>{"shallow"!==t?P(e,{changeImportance:"finish"===t&&d?"accept":"set",source:"view"}):k(t=>f({},t,{clockShallowValue:e,hasBeenModifiedSinceMount:!0}))});s.useEffect(()=>{if(b){if(void 0===p)throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");k(e=>f({},e,{open:p}))}},[b,p]);const T=s.useMemo(()=>n.cleanValue(y,void 0===C.clockShallowValue?x:C.clockShallowValue),[y,n,C.clockShallowValue,x]);return{timezone:w,state:C,setValue:P,setValueFromView:M,setOpen:R,value:x,viewValue:T}}({props:t,valueManager:n,validator:i}),{view:te,setView:ne,defaultView:re,focusedView:oe,setFocusedView:ie,setValueAndGoToNextView:ae,goToNextStep:le,hasNextStep:se,hasSeveralSteps:ce}=nK({view:g,views:m,openTo:v,onChange:Z,onViewChange:b,autoFocus:l,getStepNavigation:h}),ue=Mg(()=>Q(n.emptyValue,{source:"view"})),de=Mg(()=>Q(n.getTodayValue(z,q,r),{source:"view"})),pe=Mg(()=>Q(J,{source:"view"})),fe=Mg(()=>Q(Y.lastCommittedValue,{skipPublicationIfPristine:!0,source:"view"})),he=Mg(()=>{Q(J,{skipPublicationIfPristine:!0,source:"view"})}),{hasUIView:me,viewModeLookup:ge,timeViewsCount:ve}=s.useMemo(()=>m.reduce((e,t)=>{const n=null==y[t]?"field":"UI";return e.viewModeLookup[t]=n,"UI"===n&&(e.hasUIView=!0,(e=>RU.includes(e))(t)&&(e.timeViewsCount+=1)),e},{hasUIView:!1,viewModeLookup:{},timeViewsCount:0}),[y,m]),be=ge[te],ye=Mg(()=>be),[we,xe]=s.useState("UI"===be?te:null);we!==te&&"UI"===ge[te]&&xe(te),Wh(()=>{"field"===be&&Y.open&&(X(!1),setTimeout(()=>{U?.current?.setSelectedSections(te),U?.current?.focusField(te)}))},[te]),Wh(()=>{if(!Y.open)return;let e=te;"field"===be&&null!=we&&(e=we),e!==re&&"UI"===ge[e]&&"UI"===ge[re]&&(e=re),e!==te&&ne(e),ie(e,!0)},[Y.open]);const Se=s.useMemo(()=>({isPickerValueEmpty:n.areValuesEqual(z,J,n.emptyValue),isPickerOpen:Y.open,isPickerDisabled:t.disabled??!1,isPickerReadOnly:t.readOnly??!1,pickerOrientation:B,pickerVariant:o}),[z,n,J,Y.open,B,o,t.disabled,t.readOnly]),Ce=s.useMemo(()=>S||!me?"hidden":k||E?"disabled":"enabled",[S,me,k,E]),ke=Mg(le),Ee=s.useMemo(()=>C&&!ce?[]:["cancel","nextOrAccept"],[C,ce]),Re=s.useMemo(()=>({setValue:Q,setOpen:X,clearValue:ue,setValueToToday:de,acceptValueChanges:pe,cancelValueChanges:fe,setView:ne,goToNextStep:ke}),[Q,X,ue,de,pe,fe,ne,ke]),Pe=s.useMemo(()=>f({},Re,{value:J,timezone:q,open:Y.open,views:m,view:we,initialView:_,disabled:k??!1,readOnly:E??!1,autoFocus:D??!1,variant:o,orientation:B,popupRef:W,reduceAnimations:j,triggerRef:V,triggerStatus:Ce,hasNextStep:se,fieldFormat:I??"",name:F,label:O,rootSx:A,rootRef:K,rootClassName:L}),[Re,J,K,o,B,j,k,E,I,L,F,O,A,Ce,se,q,Y.open,we,m,_,D]),Me=s.useMemo(()=>({dismissViews:he,ownerState:Se,hasUIView:me,getCurrentViewMode:ye,rootRefObject:G,labelId:$,triggerElement:H,viewContainerRole:p,defaultActionBarActions:Ee,onPopperExited:a}),[he,Se,me,ye,$,H,p,Ee,a]),Te=s.useMemo(()=>({formatDensity:R,enableAccessibleFieldDOMStructure:P,selectedSections:M,onSelectedSectionsChange:T,fieldRef:U}),[R,P,M,T,U]);return{providerProps:{localeText:u,contextValue:Pe,privateContextValue:Me,actionsContextValue:Re,fieldPrivateContextValue:Te,isValidContextValue:e=>{const r=i({adapter:z,value:e,timezone:q,props:t});return!n.hasError(r)}},renderCurrentView:()=>{if(null==we)return null;const e=y[we];if(null==e)return null;const t=f({},N,{views:m,timezone:q,value:ee,onChange:ae,view:we,onViewChange:ne,showViewSwitcher:ve>1,timeViewsCount:ve},"tooltip"===p?{focusedView:null,onFocusedViewChange:()=>{}}:{focusedView:oe,onFocusedViewChange:ie});return c?Xp.jsx(c,{viewRenderers:y,popperView:we,rendererProps:t}):e(t)},ownerState:Se}};function sK(e){return Ph("MuiPickersLayout",e)}const cK=Mh("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),uK=["actions"],dK=pg(_x,{name:"MuiPickersLayout",slot:"ActionBar"})({});function pK(e){const{actions:t}=e,n=d(e,uK),r=vG(),{clearValue:o,setValueToToday:i,acceptValueChanges:a,cancelValueChanges:l,goToNextStep:s,hasNextStep:c}=rG();if(null==t||0===t.length)return null;const u=t?.map(e=>{switch(e){case"clear":return Xp.jsx(Xw,{onClick:o,children:r.clearButtonLabel},e);case"cancel":return Xp.jsx(Xw,{onClick:l,children:r.cancelButtonLabel},e);case"accept":return Xp.jsx(Xw,{onClick:a,children:r.okButtonLabel},e);case"today":return Xp.jsx(Xw,{onClick:i,children:r.todayButtonLabel},e);case"next":return Xp.jsx(Xw,{onClick:s,children:r.nextStepButtonLabel},e);case"nextOrAccept":return c?Xp.jsx(Xw,{onClick:s,children:r.nextStepButtonLabel},e):Xp.jsx(Xw,{onClick:a,children:r.okButtonLabel},e);default:return null}});return Xp.jsx(dK,f({},n,{children:u}))}const fK=s.memo(pK),hK=320,mK=["items","changeImportance"],gK=["getValue"],vK=pg(tC,{name:"MuiPickersLayout",slot:"Shortcuts"})({});function bK(e){const{items:t,changeImportance:n="accept"}=e,r=d(e,mK),{setValue:o}=(()=>{const e=s.useContext(oG);if(null==e)throw new Error(["MUI X: The `usePickerActionsContext` can only be called in fields that are used as a slot of a Picker component"].join("\n"));return e})(),i=s.useContext(JU);if(null==t||0===t.length)return null;const a=t.map(e=>{let{getValue:t}=e,r=d(e,gK);const a=t({isValid:i});return f({},r,{label:r.label,onClick:()=>{o(a,{changeImportance:n,shortcut:r,source:"view"})},disabled:!i(a)})});return Xp.jsx(vK,f({dense:!0,sx:[{maxHeight:336,maxWidth:200,overflow:"auto"},...Array.isArray(r.sx)?r.sx:[r.sx]]},r,{children:a.map(e=>Xp.jsx(cC,{children:Xp.jsx(zy,f({},e))},e.id??e.label))}))}const yK=["ownerState"];const wK=e=>{const{ownerState:t,defaultActionBarActions:n}=lG(),{view:r}=rG(),o=um(),{children:i,slots:a,slotProps:l,classes:c}=e,u=s.useMemo(()=>f({},t,{layoutDirection:o?"rtl":"ltr",hasShortcuts:!1}),[t,o]),p=((e,t)=>{const{pickerOrientation:n}=t;return wm({root:["root","landscape"===n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},sK,e)})(c,u),h=a?.actionBar??fK,m=d(yy({elementType:h,externalSlotProps:l?.actionBar,additionalProps:{actions:n},className:p.actionBar,ownerState:u}),yK),g=Xp.jsx(h,f({},m)),v=a?.toolbar,b=yy({elementType:v,externalSlotProps:l?.toolbar,className:p.toolbar,ownerState:u}),y=function(e){return null!==e.view}(b)&&v?Xp.jsx(v,f({},b)):null,w=i,x=a?.tabs,S=r&&x?Xp.jsx(x,f({className:p.tabs},l?.tabs)):null,C=a?.shortcuts??bK,k=yy({elementType:C,externalSlotProps:l?.shortcuts,className:p.shortcuts,ownerState:u}),E=Array.isArray(k?.items)&&k.items.length>0;return{toolbar:y,content:w,tabs:S,actionBar:g,shortcuts:r&&C?Xp.jsx(C,f({},k)):null,ownerState:f({},u,{hasShortcuts:E})}},xK=pg("div",{name:"MuiPickersLayout",slot:"Root"})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${cK.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{pickerOrientation:"landscape",hasShortcuts:!1},style:{[`& .${cK.toolbar}`]:{gridColumn:1,gridRow:"1 / 3"}}},{props:{pickerOrientation:"landscape",hasShortcuts:!0},style:{[`& .${cK.toolbar}`]:{gridColumn:"2 / 4",gridRow:1,maxWidth:"max-content"},[`& .${cK.shortcuts}`]:{gridColumn:1,gridRow:2}}},{props:{pickerOrientation:"portrait"},style:{[`& .${cK.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${cK.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{hasShortcuts:!0,layoutDirection:"rtl"},style:{[`& .${cK.shortcuts}`]:{gridColumn:4}}}]}),SK=pg("div",{name:"MuiPickersLayout",slot:"ContentWrapper"})({gridColumn:"2 / 4",gridRow:2,display:"flex",flexDirection:"column"}),CK=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersLayout"}),{toolbar:r,content:o,tabs:i,actionBar:a,shortcuts:l,ownerState:c}=wK(n),{orientation:u,variant:d}=rG(),{sx:p,className:f,classes:h}=n,m=((e,t)=>{const{pickerOrientation:n}=t;return wm({root:["root","landscape"===n&&"landscape"],contentWrapper:["contentWrapper"]},sK,e)})(h,c);return Xp.jsxs(xK,{ref:t,sx:p,className:QU(m.root,f),ownerState:c,children:["landscape"===u?l:r,"landscape"===u?r:l,Xp.jsx(SK,{className:m.contentWrapper,ownerState:c,children:"desktop"===d?Xp.jsxs(s.Fragment,{children:[o,i]}):Xp.jsxs(s.Fragment,{children:[i,o]})}),a]})});function kK(e){const{steps:t}=e;return function(e){const{steps:t,isViewMatchingStep:n,onStepChange:r}=e;return e=>{if(null==t)return tK;const o=t.findIndex(t=>n(e.view,t)),i=-1===o||o===t.length-1?null:t[o+1];return{hasNextStep:null!=i,hasSeveralSteps:t.length>1,goToNextStep:()=>{null!=i&&r(f({},e,{step:i}))},areViewsInSameStep:(e,r)=>t.find(t=>n(e,t))===t.find(e=>n(r,e))}}}({steps:t,isViewMatchingStep:(e,t)=>null==t.views||t.views.includes(e),onStepChange:({step:e,defaultView:t,setView:n,view:r,views:o})=>{const i=null==e.views?t:e.views.find(e=>o.includes(e));i!==r&&n(i)}})}const EK=["props","steps"],RK=["ownerState"],PK=e=>null!=e.saveQuery,MK=({stateResponse:{localizedDigits:e,sectionsValueBoundaries:t,state:n,timezone:r,setCharacterQuery:o,setTempAndroidValueStr:i,updateSectionValue:a}})=>{const l=gG(),s=({keyPressed:e,sectionIndex:t},r,i)=>{const a=e.toLowerCase(),l=n.sections[t];if(null!=n.characterQuery&&(!i||i(n.characterQuery.value))&&n.characterQuery.sectionIndex===t){const e=`${n.characterQuery.value}${a}`,i=r(e,l);if(!PK(i))return o({sectionIndex:t,value:e,sectionType:l.type}),i}const s=r(a,l);return PK(s)&&!s.saveQuery?(o(null),null):(o({sectionIndex:t,value:a,sectionType:l.type}),PK(s)?null:s)};return Mg(o=>{const c=n.sections[o.sectionIndex],u=$U(o.keyPressed,e)?(n=>{const r=({queryValue:n,skipIfBelowMinimum:r,section:o})=>{const i=AU(n,e),a=Number(i),s=t[o.type]({currentDate:null,format:o.format,contentType:o.contentType});if(a>s.maximum)return{saveQuery:!1};if(r&&a<s.minimum)return{saveQuery:!0};const c=10*a>s.maximum||i.length===s.maximum.toString().length;return{sectionValue:jU(l,a,s,e,o),shouldGoToNextSection:c}};return s(n,(e,t)=>{if("digit"===t.contentType||"digit-with-letter"===t.contentType)return r({queryValue:e,skipIfBelowMinimum:!1,section:t});if("month"===t.type){VU(l,"digit","month","MM");const n=r({queryValue:e,skipIfBelowMinimum:!0,section:{type:t.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2}});return PK(n)?n:f({},n,{sectionValue:_U(l,n.sectionValue,"MM",t.format)})}if("weekDay"===t.type){const n=r({queryValue:e,skipIfBelowMinimum:!0,section:t});return PK(n)?n:f({},n,{sectionValue:DU(l,t.format)[Number(n.sectionValue)-1]})}return{saveQuery:!1}},t=>$U(t,e))})(f({},o,{keyPressed:NU(o.keyPressed,e)})):(e=>{const t=(e,t,n)=>{const r=t.filter(e=>e.toLowerCase().startsWith(n));return 0===r.length?{saveQuery:!1}:{sectionValue:r[0],shouldGoToNextSection:1===r.length}},n=(e,n,o,i)=>{const a=e=>FU(l,r,n.type,e);if("letter"===n.contentType)return t(n.format,a(n.format),e);if(o&&null!=i&&"letter"===OU(l,o).contentType){const n=a(o),r=t(0,n,e);return PK(r)?{saveQuery:!1}:f({},r,{sectionValue:i(r.sectionValue,n)})}return{saveQuery:!1}};return s(e,(e,t)=>{switch(t.type){case"month":{const r=e=>_U(l,e,l.formats.month,t.format);return n(e,t,l.formats.month,r)}case"weekDay":{const r=(e,t)=>t.indexOf(e).toString();return n(e,t,l.formats.weekday,r)}case"meridiem":return n(e,t);default:return{saveQuery:!1}}})})(o);null!=u?a({section:c,newSectionValue:u.sectionValue,shouldGoToNextSection:u.shouldGoToNextSection}):i(null)})},TK=e=>{const t=gG(),n=vG(),r=um(),{manager:{validator:o,valueType:i,internal_valueManager:a,internal_fieldValueManager:l},internalPropsWithDefaults:c,internalPropsWithDefaults:{value:u,defaultValue:d,referenceDate:p,onChange:h,format:m,formatDensity:g="dense",selectedSections:v,onSelectedSectionsChange:b,shouldRespectLeadingZeros:y=!1,timezone:w,enableAccessibleFieldDOMStructure:x=!0},forwardedProps:{error:S}}=e,{value:C,handleValueChange:k,timezone:E}=iK({name:"a field component",timezone:w,value:u,defaultValue:d,referenceDate:p,onChange:h,valueManager:a}),R=s.useRef(C);s.useEffect(()=>{R.current=C},[C]);const{hasValidationError:P}=AG({props:c,validator:o,timezone:E,value:C,onError:c.onError}),M=s.useMemo(()=>(e=>{const t=e.date(void 0);return"0"===e.formatByString(e.setSeconds(t,0),"s")?LU:Array.from({length:10}).map((n,r)=>e.formatByString(e.setSeconds(t,r),"s"))})(t),[t]),T=s.useMemo(()=>((e,t,n)=>{const r=e.date(void 0,n),o=e.endOfYear(r),i=e.endOfDay(r),{maxDaysInMonth:a,longestMonth:l}=wU(e,r).reduce((t,n)=>{const r=e.getDaysInMonth(n);return r>t.maxDaysInMonth?{maxDaysInMonth:r,longestMonth:n}:t},{maxDaysInMonth:0,longestMonth:null});return{year:({format:t})=>({minimum:0,maximum:HU(e,t)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(o)+1}),day:({currentDate:t})=>({minimum:1,maximum:e.isValid(t)?e.getDaysInMonth(t):a,longestMonth:l}),weekDay:({format:t,contentType:n})=>{if("digit"===n){const n=DU(e,t).map(Number);return{minimum:Math.min(...n),maximum:Math.max(...n)}}return{minimum:1,maximum:7}},hours:({format:n})=>{const o=e.getHours(i);return AU(e.formatByString(e.endOfDay(r),n),t)!==o.toString()?{minimum:1,maximum:Number(AU(e.formatByString(e.startOfDay(r),n),t))}:{minimum:0,maximum:o}},minutes:()=>({minimum:0,maximum:e.getMinutes(i)}),seconds:()=>({minimum:0,maximum:e.getSeconds(i)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}})(t,M,E),[t,M,E]),I=s.useCallback(e=>l.getSectionsFromValue(e,e=>PG({adapter:t,localeText:n,localizedDigits:M,format:m,date:e,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:x,isRtl:r})),[l,m,n,M,r,y,t,g,x]),[O,D]=s.useState(()=>{const e=I(C),n={sections:e,lastExternalValue:C,lastSectionsDependencies:{format:m,isRtl:r,locale:t.locale},tempValueStrAndroid:null,characterQuery:null},o=(e=>Math.max(...e.map(e=>MU[e.type]??1)))(e);return f({},n,{referenceValue:a.getInitialReferenceValue({referenceDate:p,value:C,adapter:t,props:c,granularity:o,timezone:E})})}),[F,L]=Pg({controlled:v,default:null,name:"useField",state:"selectedSections"}),A=e=>{L(e),b?.(e)},N=s.useMemo(()=>GU(F,O.sections),[F,O.sections]),$="all"===N?0:N,z=s.useMemo(()=>((e,t)=>{const n={};if(!t)return e.forEach((t,r)=>{const o=0===r?null:r-1,i=r===e.length-1?null:r+1;n[r]={leftIndex:o,rightIndex:i}}),{neighbors:n,startIndex:0,endIndex:e.length-1};const r={},o={};let i=0,a=0,l=e.length-1;for(;l>=0;){a=e.findIndex((e,t)=>t>=i&&e.endSeparator?.includes(" ")&&" / "!==e.endSeparator),-1===a&&(a=e.length-1);for(let e=a;e>=i;e-=1)o[e]=l,r[l]=e,l-=1;i=a+1}return e.forEach((t,i)=>{const a=o[i],l=0===a?null:r[a-1],s=a===e.length-1?null:r[a+1];n[i]={leftIndex:l,rightIndex:s}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}})(O.sections,r&&!x),[O.sections,r,x]),j=s.useMemo(()=>O.sections.every(e=>""===e.value),[O.sections]),B=s.useMemo(()=>{if(null!=$)return!1;const e=O.sections.filter(e=>""!==e.value);return e.length>0&&O.sections.length-e.length>0},[O.sections,$]),_=s.useMemo(()=>void 0!==S?S:P||B,[P,B,S]),H=e=>{const n={validationError:o({adapter:t,value:e,timezone:E,props:c})};k(e,n)},V=(e,t)=>{const n=[...O.sections];return n[e]=f({},n[e],{value:t,modified:!0}),n},W=s.useRef(null),U=Ng(),G=e=>{null!=$&&(W.current={sectionIndex:$,value:e},U.start(0,()=>{W.current=null}))},K=()=>{if(null==$)return;const e=O.sections[$];""!==e.value&&(G(""),null===l.getDateFromSection(C,e)?D(e=>f({},e,{sections:V($,""),tempValueStrAndroid:null,characterQuery:null})):(D(e=>f({},e,{characterQuery:null})),H(l.updateDateInValue(C,e,null))))},q=Ng(),Y=Mg(e=>{D(t=>f({},t,{characterQuery:e}))});if(C!==O.lastExternalValue){const e=null!=W.current&&!t.isValid(l.getDateFromSection(C,O.sections[W.current.sectionIndex]));let n;n=e?V(W.current.sectionIndex,W.current.value):I(C),D(o=>f({},o,{lastExternalValue:C,sections:n,sectionsDependencies:{format:m,isRtl:r,locale:t.locale},referenceValue:e?o.referenceValue:l.updateReferenceValue(t,C,o.referenceValue),tempValueStrAndroid:null}))}if(r!==O.lastSectionsDependencies.isRtl||m!==O.lastSectionsDependencies.format||t.locale!==O.lastSectionsDependencies.locale){const e=I(C);D(n=>f({},n,{lastSectionsDependencies:{format:m,isRtl:r,locale:t.locale},sections:e,tempValueStrAndroid:null,characterQuery:null}))}null==O.characterQuery||_||null!=$||Y(null),null!=O.characterQuery&&O.sections[O.characterQuery.sectionIndex]?.type!==O.characterQuery.sectionType&&Y(null),s.useEffect(()=>{null!=W.current&&(W.current=null)});const X=Ng();return s.useEffect(()=>(null!=O.characterQuery&&X.start(5e3,()=>Y(null)),()=>{}),[O.characterQuery,Y,X]),s.useEffect(()=>{null!=O.tempValueStrAndroid&&null!=$&&K()},[O.sections]),{activeSectionIndex:$,areAllSectionsEmpty:j,error:_,localizedDigits:M,parsedSelectedSections:N,sectionOrder:z,sectionsValueBoundaries:T,state:O,timezone:E,value:C,clearValue:()=>{a.areValuesEqual(t,C,a.emptyValue)?D(e=>f({},e,{sections:e.sections.map(e=>f({},e,{value:""})),tempValueStrAndroid:null,characterQuery:null})):(D(e=>f({},e,{characterQuery:null})),H(a.emptyValue))},clearActiveSection:K,setCharacterQuery:Y,setSelectedSections:A,setTempAndroidValueStr:e=>D(t=>f({},t,{tempValueStrAndroid:e})),updateSectionValue:({section:e,newSectionValue:n,shouldGoToNextSection:r})=>{U.clear(),q.clear();const o=l.getDateFromSection(C,e);r&&$<O.sections.length-1&&A($+1);const i=V($,n),a=l.getDateSectionsFromValue(i,e),s=((e,t,n)=>{const r=t.some(e=>"day"===e.type),o=[],i=[];for(let e=0;e<t.length;e+=1){const a=t[e];r&&"weekDay"===a.type||(o.push(a.format),i.push(BU(a,"non-input",n)))}const a=o.join(" "),l=i.join(" ");return e.parse(l,a)})(t,a,M);if(t.isValid(s)){const n=UU(t,s,a,l.getDateFromSection(O.referenceValue,e),!0);return null==o&&q.start(0,()=>{R.current===C&&D(t=>f({},t,{sections:l.clearDateSections(O.sections,e),tempValueStrAndroid:null}))}),H(l.updateDateInValue(C,e,n))}return a.every(e=>""!==e.value)&&(null==o||t.isValid(o))?(G(n),H(l.updateDateInValue(C,e,s))):(null!=o&&(G(n),H(l.updateDateInValue(C,e,s))),D(e=>f({},e,{sections:i,tempValueStrAndroid:null})))},updateValueFromValueStr:e=>{const o=l.parseValueStr(e,O.referenceValue,(e,o)=>{const i=t.parse(e,m);if(!t.isValid(i))return null;const a=PG({adapter:t,localeText:n,localizedDigits:M,format:m,date:i,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:x,isRtl:r});return UU(t,i,a,o,!1)});H(o)},getSectionsFromValue:I}};function IK(e){const{manager:{internal_useApplyDefaultValuesToFieldInternalProps:t},internalProps:n,skipContextFieldRefAssignment:r}=e,o=MG(),i=tG(),a=Tg(n.unstableFieldRef,r?null:i?.fieldRef),l=o?.setValue,c=s.useCallback((e,t)=>l?.(e,{validationError:t.validationError,shouldClose:!1}),[l]);return t(s.useMemo(()=>null!=i&&null!=o?f({value:o.value,onChange:c,timezone:o.timezone,disabled:o.disabled,readOnly:o.readOnly,autoFocus:o.autoFocus&&!o.open,focused:!!o.open||void 0,format:o.fieldFormat,formatDensity:i.formatDensity,enableAccessibleFieldDOMStructure:i.enableAccessibleFieldDOMStructure,selectedSections:i.selectedSections,onSelectedSectionsChange:i.onSelectedSectionsChange,unstableFieldRef:a},n):n,[o,i,n,c,a]))}function OK(e){const{focused:t,domGetters:n,stateResponse:{parsedSelectedSections:r,state:o}}=e;if(!n.isReady())return;const i=kg(n.getRoot()).getSelection();if(!i)return;if(null==r)return i.rangeCount>0&&i.getRangeAt(0).startContainer instanceof Node&&n.getRoot().contains(i.getRangeAt(0).startContainer)&&i.removeAllRanges(),void(t&&n.getRoot().blur());if(!n.getRoot().contains(VG(n.getRoot())))return;const a=new window.Range;let l;if("all"===r)l=n.getRoot();else{l="empty"===o.sections[r].type?n.getSectionContainer(r):n.getSectionContent(r)}a.selectNodeContents(l),l.focus(),i.removeAllRanges(),i.addRange(a)}function DK(e){const t=gG(),{manager:{internal_fieldValueManager:n},internalPropsWithDefaults:{minutesStep:r,disabled:o,readOnly:i},stateResponse:{state:a,value:l,activeSectionIndex:s,parsedSelectedSections:c,sectionsValueBoundaries:u,localizedDigits:d,timezone:p,sectionOrder:f,clearValue:h,clearActiveSection:m,setSelectedSections:g,updateSectionValue:v}}=e;return Mg(e=>{if(!o)switch(!0){case(e.ctrlKey||e.metaKey)&&"A"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey:e.preventDefault(),g("all");break;case"ArrowRight"===e.key:if(e.preventDefault(),null==c)g(f.startIndex);else if("all"===c)g(f.endIndex);else{const e=f.neighbors[c].rightIndex;null!==e&&g(e)}break;case"ArrowLeft"===e.key:if(e.preventDefault(),null==c)g(f.endIndex);else if("all"===c)g(f.startIndex);else{const e=f.neighbors[c].leftIndex;null!==e&&g(e)}break;case"Delete"===e.key:if(e.preventDefault(),i)break;null==c||"all"===c?h():m();break;case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(e.key):{if(e.preventDefault(),i||null==s)break;"all"===c&&g(s);const o=a.sections[s],f=function(e,t,n,r,o,i,a,l){const s=function(e){switch(e){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}}(r),c="Home"===r,u="End"===r,d=""===n.value||c||u,p=()=>{const r=o[n.type]({currentDate:a,format:n.format,contentType:n.contentType}),p=t=>jU(e,t,r,i,n),f="minutes"===n.type&&l?.minutesStep?l.minutesStep:1;let h;if(d){if("year"===n.type&&!u&&!c)return e.formatByString(e.date(void 0,t),n.format);h=s>0||c?r.minimum:r.maximum}else{h=parseInt(AU(n.value,i),10)+s*f}return h%f!==0&&((s<0||c)&&(h+=f-(f+h)%f),(s>0||u)&&(h-=h%f)),h>r.maximum?p(r.minimum+(h-r.maximum-1)%(r.maximum-r.minimum+1)):h<r.minimum?p(r.maximum-(r.minimum-h-1)%(r.maximum-r.minimum+1)):p(h)},f=()=>{const r=FU(e,t,n.type,n.format);if(0===r.length)return n.value;if(d)return s>0||c?r[0]:r[r.length-1];const o=r.indexOf(n.value);return r[((o+s)%r.length+r.length)%r.length]};if("digit"===n.contentType||"digit-with-letter"===n.contentType)return p();return f()}(t,p,o,e.key,u,d,n.getDateFromSection(l,o),{minutesStep:r});v({section:o,newSectionValue:f,shouldGoToNextSection:!1});break}}})}function FK(e,t){if(e.value)switch(e.type){case"month":{if("digit"===e.contentType){const n=t.setMonth(t.date(),Number(e.value)-1);return t.isValid(n)?t.format(n,"month"):""}const n=t.parse(e.value,e.format);return n&&t.isValid(n)?t.format(n,"month"):void 0}case"day":if("digit"===e.contentType){const n=t.setDate(t.startOfYear(t.date()),Number(e.value));return t.isValid(n)?t.format(n,"dayOfMonthFull"):""}return e.value;default:return}}function LK(e,t){if(e.value)switch(e.type){case"weekDay":if("letter"===e.contentType)return;return Number(e.value);case"meridiem":{const n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);return n?t.getHours(n)>=12?1:0:void 0}case"day":return"digit-with-letter"===e.contentType?parseInt(e.value,10):Number(e.value);case"month":{if("digit"===e.contentType)return Number(e.value);const n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return"letter"!==e.contentType?Number(e.value):void 0}}const AK=e=>{const{props:t,manager:n,skipContextFieldRefAssignment:r,manager:{valueType:o,internal_useOpenPickerButtonAriaLabel:i}}=e,{internalProps:a,forwardedProps:l}=kG(t,o),c=IK({manager:n,internalProps:a,skipContextFieldRefAssignment:r}),{sectionListRef:u,onBlur:d,onClick:p,onFocus:h,onInput:m,onPaste:g,onKeyDown:v,onClear:b,clearable:y}=l,{disabled:w=!1,readOnly:x=!1,autoFocus:S=!1,focused:C,unstableFieldRef:k}=c,E=s.useRef(null),R=Tg(u,E),P=s.useMemo(()=>({isReady:()=>null!=E.current,getRoot:()=>E.current.getRoot(),getSectionContainer:e=>E.current.getSectionContainer(e),getSectionContent:e=>E.current.getSectionContent(e),getSectionIndexFromDOMElement:e=>E.current.getSectionIndexFromDOMElement(e)}),[E]),M=TK({manager:n,internalPropsWithDefaults:c,forwardedProps:l}),{areAllSectionsEmpty:T,error:I,parsedSelectedSections:O,sectionOrder:D,state:F,value:L,clearValue:A,setSelectedSections:N}=M,$=MK({stateResponse:M}),z=i(L),[j,B]=s.useState(!1);function _(e=0){if(w||!E.current||null!=NK(E))return;const t=GU(e,F.sections);B(!0),E.current.getSectionContent(t).focus()}const H=function(e){const{manager:t,focused:n,setFocused:r,domGetters:o,stateResponse:i,applyCharacterEditing:a,internalPropsWithDefaults:l,stateResponse:{parsedSelectedSections:s,sectionOrder:c,state:u,clearValue:d,setCharacterQuery:p,setSelectedSections:f,updateValueFromValueStr:h},internalPropsWithDefaults:{disabled:m=!1,readOnly:g=!1}}=e,v=DK({manager:t,internalPropsWithDefaults:l,stateResponse:i}),b=Ng(),y=Mg(e=>{!m&&o.isReady()&&(r(!0),"all"===s?b.start(0,()=>{const e=document.getSelection().getRangeAt(0).startOffset;if(0===e)return void f(c.startIndex);let t=0,n=0;for(;n<e&&t<u.sections.length;){const e=u.sections[t];t+=1,n+=`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`.length}f(t-1)}):n?o.getRoot().contains(e.target)||f(c.startIndex):(r(!0),f(c.startIndex)))}),w=Mg(e=>{if(!o.isReady()||"all"!==s)return;const t=e.target.textContent??"";o.getRoot().innerHTML=u.sections.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),OK({focused:n,domGetters:o,stateResponse:i}),0===t.length||10===t.charCodeAt(0)?(d(),f("all")):t.length>1?h(t):("all"===s&&f(0),a({keyPressed:t,sectionIndex:0}))}),x=Mg(e=>{if(g||"all"!==s)return void e.preventDefault();const t=e.clipboardData.getData("text");e.preventDefault(),p(null),h(t)}),S=Mg(()=>{if(n||m||!o.isReady())return;const e=VG(o.getRoot());r(!0),null!=o.getSectionIndexFromDOMElement(e)||f(c.startIndex)}),C=Mg(()=>{setTimeout(()=>{if(!o.isReady())return;const e=VG(o.getRoot());!o.getRoot().contains(e)&&(r(!1),f(null))})});return{onKeyDown:v,onBlur:C,onFocus:S,onClick:y,onPaste:x,onInput:w,contentEditable:"all"===s,tabIndex:l.disabled||0===s?-1:0}}({manager:n,internalPropsWithDefaults:c,stateResponse:M,applyCharacterEditing:$,focused:j,setFocused:B,domGetters:P}),V=function(e){const{manager:{internal_fieldValueManager:t},stateResponse:{areAllSectionsEmpty:n,state:r,updateValueFromValueStr:o}}=e,i=Mg(e=>{o(e.target.value)});return{value:s.useMemo(()=>n?"":t.getV7HiddenInputValueFromSections(r.sections),[n,r.sections,t]),onChange:i}}({manager:n,stateResponse:M}),W=function(e){const{stateResponse:{setSelectedSections:t},internalPropsWithDefaults:{disabled:n=!1}}=e,r=s.useCallback(e=>r=>{n||r.isDefaultPrevented()||t(e)},[n,t]);return s.useCallback(e=>({"data-sectionindex":e,onClick:r(e)}),[r])}({stateResponse:M,internalPropsWithDefaults:c}),U=function(e){const t=gG(),n=vG(),{focused:r,domGetters:o,stateResponse:i,applyCharacterEditing:a,manager:{internal_fieldValueManager:l},stateResponse:{parsedSelectedSections:c,sectionsValueBoundaries:u,state:d,value:p,clearActiveSection:f,setCharacterQuery:h,setSelectedSections:m,updateSectionValue:g,updateValueFromValueStr:v},internalPropsWithDefaults:{disabled:b=!1,readOnly:y=!1}}=e,w="all"===c,x=!w&&!b&&!y,S=Mg(e=>{if(!o.isReady())return;const t=d.sections[e];o.getSectionContent(e).innerHTML=t.value||t.placeholder,OK({focused:r,domGetters:o,stateResponse:i})}),C=Mg(e=>{if(!o.isReady())return;const t=e.target,n=t.textContent??"",r=o.getSectionIndexFromDOMElement(t),i=d.sections[r];if(y)S(r);else{if(0===n.length){if(""===i.value)return void S(r);const t=e.nativeEvent.inputType;return"insertParagraph"===t||"insertLineBreak"===t?void S(r):(S(r),void f())}a({keyPressed:n,sectionIndex:r}),S(r)}}),k=Mg(e=>{e.preventDefault()}),E=Mg(e=>{if(e.preventDefault(),y||b||"number"!=typeof c)return;const t=d.sections[c],n=e.clipboardData.getData("text"),r=/^[a-zA-Z]+$/.test(n),o=/^[0-9]+$/.test(n),i=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(n);"letter"===t.contentType&&r||"digit"===t.contentType&&o||"digit-with-letter"===t.contentType&&i?(h(null),g({section:t,newSectionValue:n,shouldGoToNextSection:!0})):r||o||(h(null),v(n))}),R=Mg(e=>{e.preventDefault(),e.dataTransfer.dropEffect="none"}),P=s.useCallback(e=>()=>{b||m(e)},[b,m]);return s.useCallback((e,r)=>{const o=u[e.type]({currentDate:l.getDateFromSection(p,e),contentType:e.contentType,format:e.format});return{onInput:C,onPaste:E,onMouseUp:k,onDragOver:R,onFocus:P(r),"aria-readonly":y,"aria-valuenow":LK(e,t),"aria-valuemin":o.minimum,"aria-valuemax":o.maximum,"aria-valuetext":e.value?FK(e,t):n.empty,"aria-label":n[e.type],"aria-disabled":b,tabIndex:!x||w||r>0?-1:0,contentEditable:!w&&!b&&!y,role:"spinbutton","data-range-position":e.dateName||void 0,spellCheck:!x&&void 0,autoCapitalize:x?"none":void 0,autoCorrect:x?"off":void 0,children:e.value||e.placeholder,inputMode:"letter"===e.contentType?"text":"numeric"}},[u,w,b,y,x,n,t,C,E,k,R,P,l,p])}({manager:n,stateResponse:M,applyCharacterEditing:$,internalPropsWithDefaults:c,domGetters:P,focused:j}),G=Mg(e=>{v?.(e),H.onKeyDown(e)}),K=Mg(e=>{d?.(e),H.onBlur(e)}),q=Mg(e=>{h?.(e),H.onFocus(e)}),Y=Mg(e=>{e.isDefaultPrevented()||(p?.(e),H.onClick(e))}),X=Mg(e=>{g?.(e),H.onPaste(e)}),Q=Mg(e=>{m?.(e),H.onInput(e)}),Z=Mg((e,...t)=>{e.preventDefault(),b?.(e,...t),A(),$K(E)?N(D.startIndex):_(0)}),J=s.useMemo(()=>F.sections.map((e,t)=>{const n=U(e,t);return{container:W(t),content:U(e,t),before:{children:e.startSeparator},after:{children:e.endSeparator,"data-range-position":e.isEndFormatSeparator?n["data-range-position"]:void 0}}}),[F.sections,W,U]);return s.useEffect(()=>{if(null==E.current)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.","","If you want to keep using an `<input />` HTML element for the editing, please add the `enableAccessibleFieldDOMStructure={false}` prop to your Picker or Field component:","","<DatePicker enableAccessibleFieldDOMStructure={false} slots={{ textField: MyCustomTextField }} />","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join("\n"));S&&!w&&E.current&&E.current.getSectionContent(D.startIndex).focus()},[]),Wh(()=>{if(j&&E.current)if("all"===O)E.current.getRoot().focus();else if("number"==typeof O){const e=E.current.getSectionContent(O);e&&e.focus()}},[O,j]),Wh(()=>{OK({focused:j,domGetters:P,stateResponse:M})}),s.useImperativeHandle(k,()=>({getSections:()=>F.sections,getActiveSectionIndex:()=>NK(E),setSelectedSections:e=>{if(w||!E.current)return;const t=GU(e,F.sections);B(null!==("all"===t?0:t)),N(e)},focusField:_,isFieldFocused:()=>$K(E)})),f({},l,H,{onBlur:K,onClick:Y,onFocus:q,onInput:Q,onPaste:X,onKeyDown:G,onClear:Z},V,{error:I,clearable:Boolean(y&&!T&&!x&&!w),focused:C??j,sectionListRef:R,enableAccessibleFieldDOMStructure:!0,elements:J,areAllSectionsEmpty:T,disabled:w,readOnly:x,autoFocus:S,openPickerAriaLabel:z})};function NK(e){const t=VG(e.current?.getRoot());return t&&e.current&&e.current.getRoot().contains(t)?e.current.getSectionIndexFromDOMElement(t):null}function $K(e){const t=VG(e.current?.getRoot());return!!e.current&&e.current.getRoot().contains(t)}const zK=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),jK=e=>{const t=um(),n=Ng(),r=Ng(),{props:o,manager:i,skipContextFieldRefAssignment:a,manager:{valueType:l,internal_valueManager:c,internal_fieldValueManager:u,internal_useOpenPickerButtonAriaLabel:d}}=e,{internalProps:p,forwardedProps:h}=kG(o,l),m=IK({manager:i,internalProps:p,skipContextFieldRefAssignment:a}),{onFocus:g,onClick:v,onPaste:b,onBlur:y,onKeyDown:w,onClear:x,clearable:S,inputRef:C,placeholder:k}=h,{readOnly:E=!1,disabled:R=!1,autoFocus:P=!1,focused:M,unstableFieldRef:T}=m,I=s.useRef(null),O=Tg(C,I),D=TK({manager:i,internalPropsWithDefaults:m,forwardedProps:h}),{activeSectionIndex:F,areAllSectionsEmpty:L,error:A,localizedDigits:N,parsedSelectedSections:$,sectionOrder:z,state:j,value:B,clearValue:_,clearActiveSection:H,setCharacterQuery:V,setSelectedSections:W,setTempAndroidValueStr:U,updateSectionValue:G,updateValueFromValueStr:K,getSectionsFromValue:q}=D,Y=MK({stateResponse:D}),X=d(B),Q=s.useMemo(()=>((e,t,n)=>{let r=0,o=n?1:0;const i=[];for(let a=0;a<e.length;a+=1){const l=e[a],s=BU(l,n?"input-rtl":"input-ltr",t),c=`${l.startSeparator}${s}${l.endSeparator}`,u=zK(c).length,d=c.length,p=zK(s),h=o+(""===p?0:s.indexOf(p[0]))+l.startSeparator.length,m=h+p.length;i.push(f({},l,{start:r,end:r+u,startInInput:h,endInInput:m})),r+=u,o+=d}return i})(j.sections,N,t),[j.sections,N,t]);function Z(){const e=I.current.selectionStart??0;let t;t=e<=Q[0].startInInput||e>=Q[Q.length-1].endInInput?1:Q.findIndex(t=>t.startInInput-t.startSeparator.length>e);const n=-1===t?Q.length-1:t-1;W(n)}function J(e=0){VG(I.current)!==I.current&&(I.current?.focus(),W(e))}const ee=Mg(e=>{g?.(e);const t=I.current;n.start(0,()=>{t&&t===I.current&&null==F&&(t.value.length&&Number(t.selectionEnd)-Number(t.selectionStart)===t.value.length?W("all"):Z())})}),te=Mg((e,...t)=>{e.isDefaultPrevented()||(v?.(e,...t),Z())}),ne=Mg(e=>{if(b?.(e),e.preventDefault(),E||R)return;const t=e.clipboardData.getData("text");if("number"==typeof $){const e=j.sections[$],n=/^[a-zA-Z]+$/.test(t),r=/^[0-9]+$/.test(t),o=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(t);if("letter"===e.contentType&&n||"digit"===e.contentType&&r||"digit-with-letter"===e.contentType&&o)return V(null),void G({section:e,newSectionValue:t,shouldGoToNextSection:!0});if(n||r)return}V(null),K(t)}),re=Mg(e=>{y?.(e),W(null)}),oe=Mg(e=>{if(E)return;const n=e.target.value;if(""===n)return void _();const r=e.nativeEvent.data,o=r&&r.length>1,i=o?r:n,a=zK(i);if("all"===$&&W(F),null==F||o)return void K(o?r:a);let l;if("all"===$&&1===a.length)l=a;else{const e=zK(u.getV6InputValueFromSections(Q,N,t));let n=-1,r=-1;for(let t=0;t<e.length;t+=1)-1===n&&e[t]!==a[t]&&(n=t),-1===r&&e[e.length-t-1]!==a[a.length-t-1]&&(r=t);const o=Q[F];if(n<o.start||e.length-r-1>o.end)return;const i=a.length-e.length+o.end-zK(o.endSeparator||"").length;l=a.slice(o.start+zK(o.startSeparator||"").length,i)}if(0===l.length)return navigator.userAgent.toLowerCase().includes("android")&&U(i),void H();Y({keyPressed:l,sectionIndex:F})}),ie=Mg((e,...t)=>{e.preventDefault(),x?.(e,...t),_(),BK(I)?W(z.startIndex):J(0)}),ae=DK({manager:i,internalPropsWithDefaults:m,stateResponse:D}),le=Mg(e=>{w?.(e),ae(e)}),se=s.useMemo(()=>void 0!==k?k:u.getV6InputValueFromSections(q(c.emptyValue),N,t),[k,u,q,c.emptyValue,N,t]),ce=s.useMemo(()=>j.tempValueStrAndroid??u.getV6InputValueFromSections(j.sections,N,t),[j.sections,u,j.tempValueStrAndroid,N,t]);s.useEffect(()=>{I.current&&I.current===VG(I.current)&&W("all")},[]),Wh(()=>{!function e(){if(!I.current)return;if(null==$)return void(I.current.scrollLeft&&(I.current.scrollLeft=0));if(I.current!==VG(I.current))return;const t=I.current.scrollTop;if("all"===$)I.current.select();else{const t=Q[$],n="empty"===t.type?t.startInInput-t.startSeparator.length:t.startInInput,o="empty"===t.type?t.endInInput+t.endSeparator.length:t.endInInput;n===I.current.selectionStart&&o===I.current.selectionEnd||I.current===VG(I.current)&&I.current.setSelectionRange(n,o),r.start(0,()=>{!I.current||I.current!==VG(I.current)||I.current.selectionStart!==I.current.selectionEnd||I.current.selectionStart===n&&I.current.selectionEnd===o||e()})}I.current.scrollTop=t}()});const ue=s.useMemo(()=>null==F||"letter"===j.sections[F].contentType?"text":"numeric",[F,j.sections]),de=!(I.current&&I.current===VG(I.current))&&L;return s.useImperativeHandle(T,()=>({getSections:()=>j.sections,getActiveSectionIndex:()=>{const e=I.current.selectionStart??0,t=I.current.selectionEnd??0;if(0===e&&0===t)return null;const n=e<=Q[0].startInInput?1:Q.findIndex(t=>t.startInInput-t.startSeparator.length>e);return-1===n?Q.length-1:n-1},setSelectedSections:e=>W(e),focusField:J,isFieldFocused:()=>BK(I)})),f({},h,{error:A,"aria-invalid":A,clearable:Boolean(S&&!L&&!E&&!R),onBlur:re,onClick:te,onFocus:ee,onPaste:ne,onKeyDown:le,onClear:ie,inputRef:O,enableAccessibleFieldDOMStructure:!1,placeholder:se,inputMode:ue,autoComplete:"off",value:de?"":ce,onChange:oe,focused:M,disabled:R,readOnly:E,autoFocus:P,openPickerAriaLabel:X})};function BK(e){return e.current===VG(e.current)}const _K=e=>(e=>{const t=tG();return(e.props.enableAccessibleFieldDOMStructure??t?.enableAccessibleFieldDOMStructure??1?AK:jK)(e)})({manager:function(e={}){const{enableAccessibleFieldDOMStructure:t=!0}=e;return s.useMemo(()=>({valueType:"date",validator:LG,internal_valueManager:qU,internal_fieldValueManager:YU,internal_enableAccessibleFieldDOMStructure:t,internal_useApplyDefaultValuesToFieldInternalProps:zG,internal_useOpenPickerButtonAriaLabel:$G}),[t])}(e),props:e});function HK(e){const{ownerState:t}=lG(),n=um();return s.useMemo(()=>f({},t,{isFieldDisabled:e.disabled??!1,isFieldReadOnly:e.readOnly??!1,isFieldRequired:e.required??!1,fieldDirection:n?"rtl":"ltr"}),[t,e.disabled,e.readOnly,e.required,n])}const VK=Sg(Xp.jsx("path",{d:"M7 10l5 5 5-5z"})),WK=Sg(Xp.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})),UK=Sg(Xp.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),GK=Sg(Xp.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}));Sg(Xp.jsxs(s.Fragment,{children:[Xp.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),Xp.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]})),Sg(Xp.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"})),Sg(Xp.jsxs(s.Fragment,{children:[Xp.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),Xp.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}));const KK=Sg(Xp.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function qK(e){return Ph("MuiPickersTextField",e)}function YK(e){return Ph("MuiPickersInputBase",e)}Mh("MuiPickersTextField",["root","focused","disabled","error","required"]);const XK=Mh("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input","inputSizeSmall","activeBar"]);function QK(e){return Ph("MuiPickersSectionList",e)}const ZK=Mh("MuiPickersSectionList",["root","section","sectionContent"]),JK=["slots","slotProps","elements","sectionListRef","classes"],eq=pg("div",{name:"MuiPickersSectionList",slot:"Root"})({direction:"ltr /*! @noflip */",outline:"none"}),tq=pg("span",{name:"MuiPickersSectionList",slot:"Section"})({}),nq=pg("span",{name:"MuiPickersSectionList",slot:"SectionSeparator"})({whiteSpace:"pre"}),rq=pg("span",{name:"MuiPickersSectionList",slot:"SectionContent"})({outline:"none"});function oq(e){const{slots:t,slotProps:n,element:r,classes:o}=e,{ownerState:i}=lG(),a=t?.section??tq,l=yy({elementType:a,externalSlotProps:n?.section,externalForwardedProps:r.container,className:o.section,ownerState:i}),c=t?.sectionContent??rq,u=yy({elementType:c,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:o.sectionContent,ownerState:i}),d=t?.sectionSeparator??nq,p=yy({elementType:d,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:f({},i,{separatorPosition:"before"})}),h=yy({elementType:d,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:f({},i,{separatorPosition:"after"})}),m=s.useRef(null),g=Tg(u.ref,m);return Xp.jsxs(a,f({},l,{children:[Xp.jsx(d,f({},p)),Xp.jsx(c,f({},u,{ref:g,onBlur:e=>{const t=e.relatedTarget,n=e.currentTarget.closest(`.${ZK.root}`);n&&t instanceof Node&&n.contains(t)&&e.stopPropagation()}})),Xp.jsx(d,f({},h))]}))}const iq=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersSectionList"}),{slots:r,slotProps:o,elements:i,sectionListRef:a,classes:l}=n,c=d(n,JK),u=(e=>wm({root:["root"],section:["section"],sectionContent:["sectionContent"]},QK,e))(l),{ownerState:p}=lG(),h=s.useRef(null),m=Tg(t,h),g=e=>{if(!h.current)throw new Error(`MUI X: Cannot call sectionListRef.${e} before the mount of the component.`);return h.current};s.useImperativeHandle(a,()=>({getRoot:()=>g("getRoot"),getSectionContainer:e=>g("getSectionContainer").querySelector(`.${ZK.section}[data-sectionindex="${e}"]`),getSectionContent:e=>g("getSectionContent").querySelector(`.${ZK.section}[data-sectionindex="${e}"] .${ZK.sectionContent}`),getSectionIndexFromDOMElement(e){const t=g("getSectionIndexFromDOMElement");if(null==e||!t.contains(e))return null;let n=null;return e.classList.contains(ZK.section)?n=e:e.classList.contains(ZK.sectionContent)&&(n=e.parentElement),null==n?null:Number(n.dataset.sectionindex)}}));const v=r?.root??eq,b=yy({elementType:v,externalSlotProps:o?.root,externalForwardedProps:c,additionalProps:{ref:m,suppressContentEditableWarning:!0},className:u.root,ownerState:p});return Xp.jsx(v,f({},b,{children:b.contentEditable?i.map(({content:e,before:t,after:n})=>`${t.children}${e.children}${n.children}`).join(""):Xp.jsx(s.Fragment,{children:i.map((e,t)=>Xp.jsx(oq,{slots:r,slotProps:o,element:e,classes:u},t))})}))}),aq=s.createContext(null),lq=()=>{const e=s.useContext(aq);if(null==e)throw new Error(["MUI X: The `usePickerTextFieldOwnerState` can only be called in components that are used inside a PickerTextField component"].join("\n"));return e},sq=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef","onFocus","onBlur","classes","ownerState"],cq=pg("div",{name:"MuiPickersInputBase",slot:"Root"})(({theme:e})=>{return f({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:(t=.15/16,Math.round(1e5*t)/1e5)+"em",variants:[{props:{isInputInFullWidth:!0},style:{width:"100%"}}]});var t}),uq=pg(eq,{name:"MuiPickersInputBase",slot:"SectionsContainer"})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{fieldDirection:"rtl"},style:{justifyContent:"end"}},{props:{inputSize:"small"},style:{paddingTop:1}},{props:{hasStartAdornment:!1,isFieldFocused:!1,isFieldValueEmpty:!0},style:{color:"currentColor",opacity:0}},{props:{hasStartAdornment:!1,isFieldFocused:!1,isFieldValueEmpty:!0,inputHasLabel:!1},style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:"light"===e.palette.mode?.42:.5}},{props:{hasStartAdornment:!1,isFieldFocused:!1,isFieldValueEmpty:!0,inputHasLabel:!0,isLabelShrunk:!0},style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:"light"===e.palette.mode?.42:.5}}]})),dq=pg(tq,{name:"MuiPickersInputBase",slot:"Section"})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),pq=pg(rq,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),fq=pg(nq,{name:"MuiPickersInputBase",slot:"Separator"})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),hq=pg("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(f({},{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"})),mq=pg("div",{name:"MuiPickersInputBase",slot:"ActiveBar"})(({theme:e,ownerState:t})=>({display:"none",position:"absolute",height:2,bottom:2,borderTopLeftRadius:2,borderTopRightRadius:2,transition:e.transitions.create(["width","left"],{duration:e.transitions.duration.shortest}),backgroundColor:(e.vars||e).palette.primary.main,'[data-active-range-position="start"] &, [data-active-range-position="end"] &':{display:"block"},'[data-active-range-position="start"] &':{left:t.sectionOffsets[0]},'[data-active-range-position="end"] &':{left:t.sectionOffsets[1]}}));function gq(e,t,n,r){if(e.content.id){const e=t.current?.querySelectorAll(`[data-sectionindex="${n}"] [data-range-position="${r}"]`);if(e)return Array.from(e).reduce((e,t)=>e+t.offsetWidth,0)}return 0}const vq=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersInputBase"}),{elements:r,areAllSectionsEmpty:o,value:i,onChange:a,id:l,endAdornment:c,startAdornment:u,renderSuffix:p,slots:h,slotProps:m,contentEditable:g,tabIndex:v,onInput:b,onPaste:y,onKeyDown:w,name:x,readOnly:S,inputProps:C,inputRef:k,sectionListRef:E,onFocus:R,onBlur:P,classes:M,ownerState:T}=n,I=d(n,sq),O=lq(),D=s.useRef(null),F=s.useRef(null),L=s.useRef([]),A=Tg(t,D),N=Tg(C?.ref,k),$=Uy();if(!$)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const z=T??O,j=e=>{$.onFocus?.(e),R?.(e)};s.useEffect(()=>{$&&$.setAdornedStart(Boolean(u))},[$,u]),s.useEffect(()=>{$&&(o?$.onEmpty():$.onFilled())},[$,o]);const B=((e,t)=>{const{isFieldFocused:n,isFieldDisabled:r,isFieldReadOnly:o,hasFieldError:i,inputSize:a,isInputInFullWidth:l,inputColor:s,hasStartAdornment:c,hasEndAdornment:u}=t;return wm({root:["root",n&&!r&&"focused",r&&"disabled",o&&"readOnly",i&&"error",l&&"fullWidth",`color${xf(s)}`,"small"===a&&"inputSizeSmall",c&&"adornedStart",u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"],activeBar:["activeBar"]},YK,e)})(M,z),_=h?.root||cq,H=yy({elementType:_,externalSlotProps:m?.root,externalForwardedProps:I,additionalProps:{"aria-invalid":$.error,ref:A},className:B.root,ownerState:z}),V=h?.input||uq,W=r.some(e=>void 0!==e.content["data-range-position"]);return s.useEffect(()=>{if(!W||!z.isPickerOpen)return;const{activeBarWidth:e,sectionOffsets:t}=function(e,t){let n=0;const r=t.current?.getAttribute("data-active-range-position");if("end"===r)for(let r=e.length-1;r>=e.length/2;r-=1)n+=gq(e[r],t,r,"end");else for(let r=0;r<e.length/2;r+=1)n+=gq(e[r],t,r,"start");return{activeBarWidth:n,sectionOffsets:[t.current?.querySelector('[data-sectionindex="0"]')?.offsetLeft||0,t.current?.querySelector(`[data-sectionindex="${e.length/2}"]`)?.offsetLeft||0]}}(r,D);L.current=[t[0],t[1]],F.current&&(F.current.style.width=`${e}px`)},[r,W,z.isPickerOpen]),Xp.jsxs(_,f({},H,{children:[u,Xp.jsx(iq,{sectionListRef:E,elements:r,contentEditable:g,tabIndex:v,className:B.sectionsContainer,onFocus:j,onBlur:e=>{$.onBlur?.(e),P?.(e)},onInput:b,onPaste:y,onKeyDown:e=>{if(w?.(e),"Enter"===e.key&&!e.defaultMuiPrevented){if(D.current?.dataset.multiInput)return;const t=D.current?.closest("form"),n=t?.querySelector('[type="submit"]');if(!t||!n)return;e.preventDefault(),t.requestSubmit(n)}},slots:{root:V,section:dq,sectionContent:pq,sectionSeparator:fq},slotProps:{root:f({},m?.input,{ownerState:z}),sectionContent:{className:XK.sectionContent},sectionSeparator:({separatorPosition:e})=>({className:"before"===e?XK.sectionBefore:XK.sectionAfter})}}),c,p?p(f({},$)):null,Xp.jsx(hq,f({name:x,className:B.input,value:i,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:S,required:$.required,disabled:$.disabled,onFocus:e=>{j(e)}},C,{ref:N})),W&&Xp.jsx(mq,{className:B.activeBar,ref:F,ownerState:{sectionOffsets:L.current}})]}))});function bq(e){return Ph("MuiPickersOutlinedInput",e)}const yq=f({},XK,Mh("MuiPickersOutlinedInput",["root","notchedOutline","input"])),wq=["children","className","label","notched","shrink"],xq=pg("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline"})(({theme:e})=>{const t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),Sq=pg("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),Cq=pg("legend",{shouldForwardProp:e=>Oh(e)&&"notched"!==e})(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{inputHasLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{inputHasLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{inputHasLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function kq(e){const{className:t,label:n,notched:r}=e,o=d(e,wq),i=lq();return Xp.jsx(xq,f({"aria-hidden":!0,className:t},o,{ownerState:i,children:Xp.jsx(Cq,{ownerState:i,notched:r,children:n?Xp.jsx(Sq,{children:n}):Xp.jsx(Sq,{className:"notranslate",children:"​"})})}))}const Eq=["label","autoFocus","ownerState","classes","notched"],Rq=pg(cq,{name:"MuiPickersOutlinedInput",slot:"Root"})(({theme:e})=>{const t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${yq.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${yq.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${yq.focused} .${yq.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${yq.disabled}`]:{[`& .${yq.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${yq.error} .${yq.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t]?.main??!1).map(t=>({props:{inputColor:t},style:{[`&.${yq.focused}:not(.${yq.error}) .${yq.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}}))}}),Pq=pg(uq,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer"})({padding:"16.5px 0",variants:[{props:{inputSize:"small"},style:{padding:"8.5px 0"}}]}),Mq=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersOutlinedInput"}),{label:r,classes:o,notched:i}=n,a=d(n,Eq),l=Uy(),c=(e=>f({},e,wm({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},bq,e)))(o);return Xp.jsx(vq,f({slots:{root:Rq,input:Pq},renderSuffix:e=>Xp.jsx(kq,{shrink:Boolean(i||e.adornedStart||e.focused||e.filled),notched:Boolean(i||e.adornedStart||e.focused||e.filled),className:c.notchedOutline,label:null!=r&&""!==r&&l?.required?Xp.jsxs(s.Fragment,{children:[r," ","*"]}):r})},a,{label:r,classes:c,ref:t}))});function Tq(e){return Ph("MuiPickersFilledInput",e)}Mq.muiName="Input";const Iq=f({},XK,Mh("MuiPickersFilledInput",["root","underline","input"])),Oq=["label","autoFocus","disableUnderline","hiddenLabel","classes"],Dq=pg(cq,{name:"MuiPickersFilledInput",slot:"Root",shouldForwardProp:e=>Oh(e)&&"disableUnderline"!==e})(({theme:e})=>{const t="light"===e.palette.mode,n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${Iq.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${Iq.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{inputColor:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t]?.main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Iq.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Iq.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Iq.disabled}, .${Iq.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Iq.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:{hasStartAdornment:!0},style:{paddingLeft:12}},{props:{hasEndAdornment:!0},style:{paddingRight:12}}]}}),Fq=pg(uq,{name:"MuiPickersFilledInput",slot:"sectionsContainer",shouldForwardProp:e=>Oh(e)&&"hiddenLabel"!==e})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{inputSize:"small"},style:{paddingTop:21,paddingBottom:4}},{props:{hasStartAdornment:!0},style:{paddingLeft:0}},{props:{hasEndAdornment:!0},style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,inputSize:"small"},style:{paddingTop:8,paddingBottom:9}}]}),Lq=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersFilledInput"}),{label:r,disableUnderline:o=!1,hiddenLabel:i=!1,classes:a}=n,l=d(n,Oq),s=f({},lq(),{inputHasUnderline:!o}),c=((e,t)=>{const{inputHasUnderline:n}=t;return f({},e,wm({root:["root",n&&"underline"],input:["input"]},Tq,e))})(a,s);return Xp.jsx(vq,f({slots:{root:Dq,input:Fq},slotProps:{root:{disableUnderline:o},input:{hiddenLabel:i}}},l,{label:r,classes:c,ref:t,ownerState:s}))});function Aq(e){return Ph("MuiPickersFilledInput",e)}Lq.muiName="Input";const Nq=f({},XK,Mh("MuiPickersInput",["root","underline","input"])),$q=["label","autoFocus","disableUnderline","ownerState","classes"],zq=pg(cq,{name:"MuiPickersInput",slot:"Root",shouldForwardProp:e=>Oh(e)&&"disableUnderline"!==e})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{inputColor:t,inputHasUnderline:!0},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].main}`}}})),{props:{inputHasUnderline:!0},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Nq.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Nq.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Nq.disabled}, .${Nq.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${Nq.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),jq=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersInput"}),{label:r,disableUnderline:o=!1,classes:i}=n,a=d(n,$q),l=f({},lq(),{inputHasUnderline:!o}),s=((e,t)=>{const{inputHasUnderline:n}=t;return f({},e,wm({root:["root",!n&&"underline"],input:["input"]},Aq,e))})(i,l);return Xp.jsx(vq,f({slots:{root:zq},slotProps:{root:{disableUnderline:o}}},a,{ownerState:l,label:r,classes:s,ref:t}))});jq.muiName="Input";const Bq=["onFocus","onBlur","className","classes","color","disabled","error","variant","required","hiddenLabel","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps","data-active-range-position"],_q={standard:jq,filled:Lq,outlined:Mq},Hq=pg(sS,{name:"MuiPickersTextField",slot:"Root"})({maxWidth:"100%"}),Vq=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersTextField"}),{onFocus:r,onBlur:o,className:i,classes:a,color:l="primary",disabled:c=!1,error:u=!1,variant:p="outlined",required:h=!1,hiddenLabel:m=!1,InputProps:g,inputProps:v,inputRef:b,sectionListRef:y,elements:w,areAllSectionsEmpty:x,onClick:S,onKeyDown:C,onKeyUp:k,onPaste:E,onInput:R,endAdornment:P,startAdornment:M,tabIndex:T,contentEditable:I,focused:O,value:D,onChange:F,fullWidth:L,id:A,name:N,helperText:$,FormHelperTextProps:z,label:j,InputLabelProps:B,"data-active-range-position":_}=n,H=d(n,Bq),V=Tg(t,s.useRef(null)),W=mm(A),U=$&&W?`${W}-helper-text`:void 0,G=j&&W?`${W}-label`:void 0,K=HK({disabled:n.disabled,required:n.required,readOnly:g?.readOnly}),q=s.useMemo(()=>f({},K,{isFieldValueEmpty:x,isFieldFocused:O??!1,hasFieldError:u??!1,inputSize:n.size??"medium",inputColor:l??"primary",isInputInFullWidth:L??!1,hasStartAdornment:Boolean(M??g?.startAdornment),hasEndAdornment:Boolean(P??g?.endAdornment),inputHasLabel:!!j,isLabelShrunk:Boolean(B?.shrink)}),[K,x,O,u,n.size,l,L,M,P,g?.startAdornment,g?.endAdornment,j,B?.shrink]),Y=((e,t)=>{const{isFieldFocused:n,isFieldDisabled:r,isFieldRequired:o}=t;return wm({root:["root",n&&!r&&"focused",r&&"disabled",o&&"required"]},qK,e)})(a,q),X=_q[p],Q={};return"outlined"===p?(B&&void 0!==B.shrink&&(Q.notched=B.shrink),Q.label=j):"filled"===p&&(Q.hiddenLabel=m),Xp.jsx(aq.Provider,{value:q,children:Xp.jsxs(Hq,f({className:QU(Y.root,i),ref:V,focused:O,disabled:c,variant:p,error:u,color:l,fullWidth:L,required:h,ownerState:q},H,{children:[null!=j&&""!==j&&Xp.jsx(zS,f({htmlFor:W,id:G},B,{children:j})),Xp.jsx(X,f({elements:w,areAllSectionsEmpty:x,onClick:S,onKeyDown:C,onKeyUp:k,onInput:R,onPaste:E,onFocus:r,onBlur:o,endAdornment:P,startAdornment:M,tabIndex:T,contentEditable:I,value:D,onChange:F,id:W,fullWidth:L,inputProps:v,inputRef:b,sectionListRef:y,label:j,name:N,role:"group","aria-labelledby":G,"aria-describedby":U,"aria-live":U?"polite":void 0,"data-active-range-position":_},Q,g)),$&&Xp.jsx(bS,f({id:U},z,{children:$}))]}))})}),Wq=["enableAccessibleFieldDOMStructure"],Uq=["InputProps","readOnly","onClear","clearable","clearButtonPosition","openPickerButtonPosition","openPickerAriaLabel"],Gq=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef","onClear","clearable","clearButtonPosition","openPickerButtonPosition","openPickerAriaLabel"],Kq=["ownerState"],qq=["ownerState"],Yq=["ownerState"],Xq=["ownerState"],Qq=["InputProps","inputProps"],Zq=()=>{},Jq=s.createContext({slots:{},slotProps:{},inputRef:void 0});function eY(e){const{fieldResponse:t,defaultOpenPickerIcon:n}=e,r=vG(),o=MG(),i=s.useContext(Jq),{textFieldProps:a,onClear:l,clearable:c,openPickerAriaLabel:u,clearButtonPosition:p="end",openPickerButtonPosition:h="end"}=(e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=d(e,Wq);if(t){const{InputProps:e,readOnly:t,onClear:r,clearable:o,clearButtonPosition:i,openPickerButtonPosition:a,openPickerAriaLabel:l}=n,s=d(n,Uq),c=rR>=6&&s?.slotProps?.input?tY(s?.slotProps?.input,e):Zq;return{clearable:o,onClear:r,clearButtonPosition:i,openPickerButtonPosition:a,openPickerAriaLabel:l,textFieldProps:f({},s,rR>=6&&s?.slotProps?.input?{slotProps:f({},s?.slotProps,{input:e=>f({},_g(c,e),{readOnly:t})})}:{InputProps:f({},e??{},{readOnly:t})})}}const{onPaste:r,onKeyDown:o,inputMode:i,readOnly:a,InputProps:l,inputProps:s,inputRef:c,onClear:u,clearable:p,clearButtonPosition:h,openPickerButtonPosition:m,openPickerAriaLabel:g}=n,v=d(n,Gq),b=rR>=6&&v?.slotProps?.input?tY(v?.slotProps?.input,l):Zq,y=rR>=6&&v?.slotProps?.htmlInput?tY(v?.slotProps?.htmlInput,s):Zq;return{clearable:p,onClear:u,clearButtonPosition:h,openPickerButtonPosition:m,openPickerAriaLabel:g,textFieldProps:f({},v,rR>=6&&(v?.slotProps?.input||v?.slotProps?.htmlInput)?{slotProps:f({},v?.slotProps,{input:e=>f({},_g(b,e),{readOnly:a}),htmlInput:e=>f({},_g(y,e),{inputMode:i,onPaste:r,onKeyDown:o,ref:c})})}:{InputProps:f({},l??{},{readOnly:a}),inputProps:f({},s??{},{inputMode:i,onPaste:r,onKeyDown:o,ref:c})})}})(t),m=HK(a),g=Mg(e=>{e.preventDefault(),o?.setOpen(e=>!e)}),v=o?o.triggerStatus:"hidden",b=c?p:null,y="hidden"!==v?h:null,w=i.slots.textField??(!1===t.enableAccessibleFieldDOMStructure?qE:Vq),x=i.slots.inputAdornment??AS,S=d(yy({elementType:x,externalSlotProps:i.slotProps.inputAdornment,additionalProps:{position:"start"},ownerState:f({},m,{position:"start"})}),Kq),C=d(yy({elementType:x,externalSlotProps:i.slotProps.inputAdornment,additionalProps:{position:"end"},ownerState:f({},m,{position:"end"})}),qq),k=i.slots.openPickerButton??Mv,E=d(yy({elementType:k,externalSlotProps:i.slotProps.openPickerButton,additionalProps:{disabled:"disabled"===v,onClick:g,"aria-label":u,edge:"standard"!==a.variant&&y},ownerState:m}),Yq),R=i.slots.openPickerIcon??n,P=yy({elementType:R,externalSlotProps:i.slotProps.openPickerIcon,ownerState:m}),M=i.slots.clearButton??Mv,T=d(yy({elementType:M,externalSlotProps:i.slotProps.clearButton,className:"clearButton",additionalProps:{title:r.fieldClearLabel,tabIndex:-1,onClick:l,disabled:t.disabled||t.readOnly,edge:"standard"!==a.variant&&b!==y&&b},ownerState:m}),Xq),I=i.slots.clearIcon??KK,O=yy({elementType:I,externalSlotProps:i.slotProps.clearIcon,additionalProps:{fontSize:"small"},ownerState:m});a.ref=Tg(a.ref,o?.rootRef);const D={},F=_g((rR>=6&&a?.slotProps?.input)??a.InputProps,m);o&&(D.ref=o.triggerRef),F?.startAdornment||"start"!==b&&"start"!==y||(D.startAdornment=Xp.jsxs(x,f({},S,{children:["start"===y&&Xp.jsx(k,f({},E,{children:Xp.jsx(R,f({},P))})),"start"===b&&Xp.jsx(M,f({},T,{children:Xp.jsx(I,f({},O))}))]}))),F?.endAdornment||"end"!==b&&"end"!==y||(D.endAdornment=Xp.jsxs(x,f({},C,{children:["end"===b&&Xp.jsx(M,f({},T,{children:Xp.jsx(I,f({},O))})),"end"===y&&Xp.jsx(k,f({},E,{children:Xp.jsx(R,f({},P))}))]}))),D?.endAdornment||D?.startAdornment||!i.slots.inputAdornment||(D.endAdornment=Xp.jsx(x,f({},C))),null!=b&&(a.sx=[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(a.sx)?a.sx:[a.sx]]);const L=rR>=6&&a?.slotProps?.input?_g(tY(F,D),m):f({},F,D);return a.inputProps=rR>=6&&a?.slotProps?.htmlInput?_g(a.slotProps.htmlInput,m):a.inputProps,delete a?.slotProps?.input,t.enableAccessibleFieldDOMStructure&&delete a?.slotProps,Xp.jsx(w,f({},a,{InputProps:L}))}function tY(e,t){return e?t?n=>f({},_g(t,n),_g(e,n)):e:t}function nY(e){const{slots:t={},slotProps:n={},inputRef:r,children:o}=e,i=s.useMemo(()=>({inputRef:r,slots:{openPickerButton:t.openPickerButton,openPickerIcon:t.openPickerIcon,textField:t.textField,inputAdornment:t.inputAdornment,clearIcon:t.clearIcon,clearButton:t.clearButton},slotProps:{openPickerButton:n.openPickerButton,openPickerIcon:n.openPickerIcon,textField:n.textField,inputAdornment:n.inputAdornment,clearIcon:n.clearIcon,clearButton:n.clearButton}}),[r,t.openPickerButton,t.openPickerIcon,t.textField,t.inputAdornment,t.clearIcon,t.clearButton,n.openPickerButton,n.openPickerIcon,n.textField,n.inputAdornment,n.clearIcon,n.clearButton]);return Xp.jsx(Jq.Provider,{value:i,children:o})}const rY=["slots","slotProps"],oY=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiDateField"}),{slots:r,slotProps:o}=n,i=d(n,rY),a=function(e){const{ref:t,externalForwardedProps:n,slotProps:r}=e,o=s.useContext(Jq),i=MG(),a=HK(n),{InputProps:l,inputProps:c}=n,u=d(n,Qq),p=yy({elementType:Vq,externalSlotProps:tY(o.slotProps.textField,r?.textField),externalForwardedProps:u,additionalProps:{ref:t,sx:i?.rootSx,label:i?.label,name:i?.name,className:i?.rootClassName,inputRef:o.inputRef},ownerState:a});return p.inputProps=f({},c,p.inputProps),p.InputProps=f({},l,p.InputProps),p}({slotProps:o,ref:t,externalForwardedProps:i}),l=_K(a);return Xp.jsx(nY,{slots:r,slotProps:o,inputRef:i.inputRef,children:Xp.jsx(eY,{fieldResponse:l,defaultOpenPickerIcon:GK})})}),iY=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:a,timezone:l})=>{const c=gG();return s.useCallback(s=>null!==LG({adapter:c,value:s,timezone:l,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:a}}),[c,e,t,n,r,o,i,a,l])},aY=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:o,maxDate:i,minDate:a,onMonthChange:l,onYearChange:c,reduceAnimations:u,shouldDisableDate:d,timezone:p,getCurrentMonthFromVisibleDate:h}=e,m=gG(),g=s.useRef(((e,t)=>(n,r)=>{switch(r.type){case"setVisibleDate":return f({},n,{slideDirection:r.direction,currentMonth:r.month,isMonthSwitchingAnimating:!t.isSameMonth(r.month,n.currentMonth)&&!e&&!r.skipAnimation,focusedDay:r.focusedDay});case"changeMonthTimezone":{const e=r.newTimezone;if(t.getTimezone(n.currentMonth)===e)return n;let o=t.setTimezone(n.currentMonth,e);return t.getMonth(o)!==t.getMonth(n.currentMonth)&&(o=t.setMonth(o,t.getMonth(n.currentMonth))),f({},n,{currentMonth:o})}case"finishMonthSwitchingAnimation":return f({},n,{isMonthSwitchingAnimating:!1});default:throw new Error("missing support")}})(Boolean(u),m)).current,v=s.useMemo(()=>qU.getInitialReferenceValue({value:t,adapter:m,timezone:p,props:e,referenceDate:n,granularity:MU.day}),[n,p]),[b,y]=s.useReducer(g,{isMonthSwitchingAnimating:!1,focusedDay:v,currentMonth:m.startOfMonth(v),slideDirection:"left"}),w=iY({shouldDisableDate:d,minDate:a,maxDate:i,disableFuture:r,disablePast:o,timezone:p});s.useEffect(()=>{y({type:"changeMonthTimezone",newTimezone:m.getTimezone(v)})},[v,m]);const x=Mg(({target:e,reason:t})=>{if("cell-interaction"===t&&null!=b.focusedDay&&m.isSameDay(e,b.focusedDay))return;const n="cell-interaction"===t;let s,u;if("cell-interaction"===t)s=h(e,b.currentMonth),u=e;else if(s=m.isSameMonth(e,b.currentMonth)?b.currentMonth:m.startOfMonth(e),u=e,w(u)){const t=m.startOfMonth(e),n=m.endOfMonth(e);u=bU({adapter:m,date:u,minDate:m.isBefore(a,t)?t:a,maxDate:m.isAfter(i,n)?n:i,disablePast:o,disableFuture:r,isDateDisabled:w,timezone:p})}const d=!m.isSameMonth(b.currentMonth,s),f=!m.isSameYear(b.currentMonth,s);d&&l?.(s),f&&c?.(m.startOfYear(s)),y({type:"setVisibleDate",month:s,direction:m.isAfterDay(s,b.currentMonth)?"left":"right",focusedDay:null!=b.focusedDay&&null!=u&&m.isSameDay(u,b.focusedDay)?b.focusedDay:u,skipAnimation:n})}),S=s.useCallback(()=>{y({type:"finishMonthSwitchingAnimation"})},[]);return{referenceDate:v,calendarState:b,setVisibleDate:x,isDateDisabled:w,onMonthSwitchingAnimationEnd:S}},lY=e=>Ph("MuiPickersFadeTransitionGroup",e);Mh("MuiPickersFadeTransitionGroup",["root"]);const sY=["children"],cY=pg(Zo,{name:"MuiPickersFadeTransitionGroup",slot:"Root"})({display:"block",position:"relative"});function uY(e){const t=cg({props:e,name:"MuiPickersFadeTransitionGroup"}),{className:n,reduceAnimations:r,transKey:o,classes:i}=t,{children:a}=t,l=d(t,sY),s=(e=>wm({root:["root"]},lY,e))(i),c=sg();return r?a:Xp.jsx(cY,{className:QU(s.root,n),ownerState:l,children:Xp.jsx(Pw,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:c.transitions.duration.enteringScreen,enter:c.transitions.duration.enteringScreen,exit:0},children:a},o)})}function dY(e){return Ph("MuiPickersDay",e)}const pY=Mh("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]);function fY(e){const{disabled:t,selected:n,today:r,outsideCurrentMonth:o,day:i,disableMargin:a,disableHighlightToday:l,showDaysOutsideCurrentMonth:c}=e,u=gG(),{ownerState:d}=lG();return s.useMemo(()=>f({},d,{day:i,isDaySelected:n??!1,isDayDisabled:t??!1,isDayCurrent:r??!1,isDayOutsideMonth:o??!1,isDayStartOfWeek:u.isSameDay(i,u.startOfWeek(i)),isDayEndOfWeek:u.isSameDay(i,u.endOfWeek(i)),disableMargin:a??!1,disableHighlightToday:l??!1,showDaysOutsideCurrentMonth:c??!1}),[u,d,i,n,t,r,o,a,l,c])}const hY=["autoFocus","className","classes","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","children","isFirstVisibleCell","isLastVisibleCell","day","selected","disabled","today","outsideCurrentMonth","disableMargin","disableHighlightToday","showDaysOutsideCurrentMonth"],mY=({theme:e})=>f({},e.typography.caption,{width:36,height:36,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:tm(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:tm(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${pY.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${pY.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${pY.disabled}:not(.${pY.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${pY.disabled}&.${pY.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:"0 2px"}},{props:{isDayOutsideMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,isDayCurrent:!0},style:{[`&:not(.${pY.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),gY=(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.isDayCurrent&&t.today,!n.isDayOutsideMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.isDayOutsideMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},vY=pg(sv,{name:"MuiPickersDay",slot:"Root",overridesResolver:gY})(mY),bY=pg("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:gY})(({theme:e})=>f({},mY({theme:e}),{opacity:0,pointerEvents:"none"})),yY=()=>{},wY=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersDay"}),{autoFocus:r=!1,className:o,classes:i,isAnimating:a,onClick:l,onDaySelect:c,onFocus:u=yY,onBlur:p=yY,onKeyDown:h=yY,onMouseDown:m=yY,onMouseEnter:g=yY,children:v,day:b,selected:y,disabled:w,today:x,outsideCurrentMonth:S,disableMargin:C,disableHighlightToday:k,showDaysOutsideCurrentMonth:E}=n,R=d(n,hY),P=fY({day:b,selected:y,disabled:w,today:x,outsideCurrentMonth:S,disableMargin:C,disableHighlightToday:k,showDaysOutsideCurrentMonth:E}),M=((e,t)=>{const{isDaySelected:n,isDayDisabled:r,isDayCurrent:o,isDayOutsideMonth:i,disableMargin:a,disableHighlightToday:l,showDaysOutsideCurrentMonth:s}=t,c=i&&!s;return wm({root:["root",n&&!c&&"selected",r&&"disabled",!a&&"dayWithMargin",!l&&o&&"today",i&&s&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},dY,e)})(i,P),T=gG(),I=s.useRef(null),O=Tg(I,t);Wh(()=>{!r||w||a||S||I.current.focus()},[r,w,a,S]);return S&&!E?Xp.jsx(bY,{className:QU(M.root,M.hiddenDaySpacingFiller,o),ownerState:P,role:R.role}):Xp.jsx(vY,f({className:QU(M.root,o),ref:O,centerRipple:!0,disabled:w,tabIndex:y?0:-1,onKeyDown:e=>h(e,b),onFocus:e=>u(e,b),onBlur:e=>p(e,b),onMouseEnter:e=>g(e,b),onClick:e=>{e.defaultMuiPrevented=!0,w||c(b),S&&e.currentTarget.focus(),l&&l(e)},onMouseDown:e=>{m(e),S&&e.preventDefault()}},R,{ownerState:P,children:v??T.format(b,"dayOfMonth")}))}),xY=s.memo(wY),SY=e=>Ph("MuiPickersSlideTransition",e),CY=Mh("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),kY=["children","className","reduceAnimations","slideDirection","transKey","classes"],EY=pg(Zo,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${CY["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${CY["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${CY.slideEnterActive}`]:t.slideEnterActive},{[`.${CY.slideExit}`]:t.slideExit},{[`.${CY["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${CY["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{const t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${CY["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${CY["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${CY.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${CY.slideExit}`]:{transform:"translate(0%)"},[`& .${CY["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${CY["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});const RY=e=>Ph("MuiDayCalendar",e);Mh("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const PY=["parentProps","day","focusedDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],MY=["ownerState"],TY=pg("div",{name:"MuiDayCalendar",slot:"Root"})({}),IY=pg("div",{name:"MuiDayCalendar",slot:"Header"})({display:"flex",justifyContent:"center",alignItems:"center"}),OY=pg(Gv,{name:"MuiDayCalendar",slot:"WeekDayLabel"})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),DY=pg(Gv,{name:"MuiDayCalendar",slot:"WeekNumberLabel"})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.disabled})),FY=pg(Gv,{name:"MuiDayCalendar",slot:"WeekNumber"})(({theme:e})=>f({},e.typography.caption,{width:36,height:36,padding:0,margin:"0 2px",color:(e.vars||e).palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),LY=pg("div",{name:"MuiDayCalendar",slot:"LoadingContainer"})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:240}),AY=pg(function(e){const t=cg({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,slideDirection:i,transKey:a,classes:l}=t,c=d(t,kY),{ownerState:u}=lG(),p=f({},u,{slideDirection:i}),h=((e,t)=>{const{slideDirection:n}=t;return wm({root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]},SY,e)})(l,p),m=sg();if(o)return Xp.jsx("div",{className:QU(h.root,r),children:n});const g={exit:h.exit,enterActive:h.enterActive,enter:h.enter,exitActive:h.exitActive};return Xp.jsx(EY,{className:QU(h.root,r),childFactory:e=>s.cloneElement(e,{classNames:g}),role:"presentation",ownerState:p,children:Xp.jsx(Ko,f({mountOnEnter:!0,unmountOnExit:!0,timeout:m.transitions.duration.complex,classNames:g},c,{children:n}),a)})},{name:"MuiDayCalendar",slot:"SlideTransition"})({minHeight:240}),NY=pg("div",{name:"MuiDayCalendar",slot:"MonthContainer"})({overflow:"hidden"}),$Y=pg("div",{name:"MuiDayCalendar",slot:"WeekContainer"})({margin:"2px 0",display:"flex",justifyContent:"center"});function zY(e){let{parentProps:t,day:n,focusedDay:r,selectedDays:o,isDateDisabled:i,currentMonthNumber:a,isViewFocused:l}=e,c=d(e,PY);const{disabled:u,disableHighlightToday:p,isMonthSwitchingAnimating:h,showDaysOutsideCurrentMonth:m,slots:g,slotProps:v,timezone:b}=t,y=gG(),w=NG(b),x=null!=r&&y.isSameDay(n,r),S=l&&x,C=o.some(e=>y.isSameDay(e,n)),k=y.isSameDay(n,w),E=s.useMemo(()=>u||i(n),[u,i,n]),R=s.useMemo(()=>y.getMonth(n)!==a,[y,n,a]),P=fY({day:n,selected:C,disabled:E,today:k,outsideCurrentMonth:R,disableMargin:void 0,disableHighlightToday:p,showDaysOutsideCurrentMonth:m}),M=g?.day??xY,T=d(yy({elementType:M,externalSlotProps:v?.day,additionalProps:f({disableHighlightToday:p,showDaysOutsideCurrentMonth:m,role:"gridcell",isAnimating:h,"data-timestamp":y.toJsDate(n).valueOf()},c),ownerState:f({},P,{day:n,isDayDisabled:E,isDaySelected:C})}),MY),I=s.useMemo(()=>{const e=y.startOfMonth(y.setMonth(n,a));return m?y.isSameDay(n,y.startOfWeek(e)):y.isSameDay(n,e)},[a,n,m,y]),O=s.useMemo(()=>{const e=y.endOfMonth(y.setMonth(n,a));return m?y.isSameDay(n,y.endOfWeek(e)):y.isSameDay(n,e)},[a,n,m,y]);return Xp.jsx(M,f({},T,{day:n,disabled:E,autoFocus:!R&&S,today:k,outsideCurrentMonth:R,isFirstVisibleCell:I,isLastVisibleCell:O,selected:C,tabIndex:x?0:-1,"aria-selected":C,"aria-current":k?"date":void 0}))}function jY(e){const t=cg({props:e,name:"MuiDayCalendar"}),n=gG(),{onFocusedDayChange:r,className:o,classes:i,currentMonth:a,selectedDays:l,focusedDay:c,loading:u,onSelectedDaysChange:d,onMonthSwitchingAnimationEnd:p,readOnly:h,reduceAnimations:m,renderLoading:g=()=>Xp.jsx("span",{children:"..."}),slideDirection:v,TransitionProps:b,disablePast:y,disableFuture:w,minDate:x,maxDate:S,shouldDisableDate:C,shouldDisableMonth:k,shouldDisableYear:E,dayOfWeekFormatter:R=e=>n.format(e,"weekdayShort").charAt(0).toUpperCase(),hasFocus:P,onFocusedViewChange:M,gridLabelId:T,displayWeekNumber:I,fixedWeekNumber:O,timezone:D}=t,F=NG(D),L=(e=>wm({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},RY,e))(i),A=um(),N=iY({shouldDisableDate:C,shouldDisableMonth:k,shouldDisableYear:E,minDate:x,maxDate:S,disablePast:y,disableFuture:w,timezone:D}),$=vG(),z=Mg(e=>{h||d(e)}),j=e=>{N(e)||(r(e),M?.(!0))},B=Mg((e,t)=>{switch(e.key){case"ArrowUp":j(n.addDays(t,-7)),e.preventDefault();break;case"ArrowDown":j(n.addDays(t,7)),e.preventDefault();break;case"ArrowLeft":{const r=n.addDays(t,A?1:-1),o=n.addMonths(t,A?1:-1),i=bU({adapter:n,date:r,minDate:A?r:n.startOfMonth(o),maxDate:A?n.endOfMonth(o):r,isDateDisabled:N,timezone:D});j(i||r),e.preventDefault();break}case"ArrowRight":{const r=n.addDays(t,A?-1:1),o=n.addMonths(t,A?-1:1),i=bU({adapter:n,date:r,minDate:A?n.startOfMonth(o):r,maxDate:A?r:n.endOfMonth(o),isDateDisabled:N,timezone:D});j(i||r),e.preventDefault();break}case"Home":j(n.startOfWeek(t)),e.preventDefault();break;case"End":j(n.endOfWeek(t)),e.preventDefault();break;case"PageUp":j(n.addMonths(t,1)),e.preventDefault();break;case"PageDown":j(n.addMonths(t,-1)),e.preventDefault()}}),_=Mg((e,t)=>j(t)),H=Mg((e,t)=>{null!=c&&n.isSameDay(c,t)&&M?.(!1)}),V=n.getMonth(a),W=n.getYear(a),U=s.useMemo(()=>l.filter(e=>!!e).map(e=>n.startOfDay(e)),[n,l]),G=`${W}-${V}`,K=s.useMemo(()=>s.createRef(),[G]),q=s.useMemo(()=>{const e=n.getWeekArray(a);let t=n.addMonths(a,1);for(;O&&e.length<O;){const r=n.getWeekArray(t),o=n.isSameDay(e[e.length-1][0],r[0][0]);r.slice(o?1:0).forEach(t=>{e.length<O&&e.push(t)}),t=n.addMonths(t,1)}return e},[a,O,n]);return Xp.jsxs(TY,{role:"grid","aria-labelledby":T,className:L.root,children:[Xp.jsxs(IY,{role:"row",className:L.header,children:[I&&Xp.jsx(DY,{variant:"caption",role:"columnheader","aria-label":$.calendarWeekNumberHeaderLabel,className:L.weekNumberLabel,children:$.calendarWeekNumberHeaderText}),EU(n,F).map((e,t)=>Xp.jsx(OY,{variant:"caption",role:"columnheader","aria-label":n.format(e,"weekday"),className:L.weekDayLabel,children:R(e)},t.toString()))]}),u?Xp.jsx(LY,{className:L.loadingContainer,children:g()}):Xp.jsx(AY,f({transKey:G,onExited:p,reduceAnimations:m,slideDirection:v,className:QU(o,L.slideTransition)},b,{nodeRef:K,children:Xp.jsx(NY,{ref:K,role:"rowgroup",className:L.monthContainer,children:q.map((e,r)=>Xp.jsxs($Y,{role:"row",className:L.weekContainer,"aria-rowindex":r+1,children:[I&&Xp.jsx(FY,{className:L.weekNumber,role:"rowheader","aria-label":$.calendarWeekNumberAriaLabelText(n.getWeekNumber(e[0])),children:$.calendarWeekNumberText(n.getWeekNumber(e[0]))}),e.map((e,n)=>Xp.jsx(zY,{parentProps:t,day:e,selectedDays:U,isViewFocused:P,focusedDay:c,onKeyDown:B,onFocus:_,onBlur:H,onDaySelect:z,isDateDisabled:N,currentMonthNumber:V,"aria-colindex":n+1},e.toString()))]},`week-${e[0]}`))})}))]})}function BY(e){return Ph("MuiMonthCalendar",e)}const _Y=Mh("MuiMonthCalendar",["root","button","disabled","selected"]),HY=["autoFocus","classes","disabled","selected","value","onClick","onKeyDown","onFocus","onBlur","slots","slotProps"],VY=pg("button",{name:"MuiMonthCalendar",slot:"Button",overridesResolver:(e,t)=>[t.button,{[`&.${_Y.disabled}`]:t.disabled},{[`&.${_Y.selected}`]:t.selected}]})(({theme:e})=>f({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:tm(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:tm(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${_Y.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${_Y.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),WY=s.memo(function(e){const{autoFocus:t,classes:n,disabled:r,selected:o,value:i,onClick:a,onKeyDown:l,onFocus:c,onBlur:u,slots:p,slotProps:h}=e,m=d(e,HY),g=s.useRef(null),{ownerState:v}=lG(),b=f({},v,{isMonthDisabled:r,isMonthSelected:o}),y=((e,t)=>wm({button:["button",t.isMonthDisabled&&"disabled",t.isMonthSelected&&"selected"]},BY,e))(n,b);Wh(()=>{t&&g.current?.focus()},[t]);const w=p?.monthButton??VY,x=yy({elementType:w,externalSlotProps:h?.monthButton,externalForwardedProps:m,additionalProps:{disabled:r,ref:g,type:"button",role:"radio","aria-checked":o,onClick:e=>a(e,i),onKeyDown:e=>l(e,i),onFocus:e=>c(e,i),onBlur:e=>u(e,i)},ownerState:b,className:y.button});return Xp.jsx(w,f({},x))}),UY=["autoFocus","className","currentMonth","classes","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"];const GY=(e,t,n,r,o)=>Boolean(e===t&&r&&o.isSameYear(n,r)),KY=pg("div",{name:"MuiMonthCalendar",slot:"Root",shouldForwardProp:e=>Oh(e)&&"monthsPerRow"!==e})({display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",rowGap:16,padding:"8px 0",width:hK,boxSizing:"border-box",variants:[{props:{monthsPerRow:3},style:{columnGap:24}},{props:{monthsPerRow:4},style:{columnGap:0}}]}),qY=s.forwardRef(function(e,t){const n=function(e,t){const n=cg({props:e,name:t});return f({},n,jG(n),{monthsPerRow:n.monthsPerRow??3})}(e,"MuiMonthCalendar"),{autoFocus:r,className:o,currentMonth:i,classes:a,value:l,defaultValue:c,referenceDate:u,disabled:p,disableFuture:h,disablePast:m,maxDate:g,minDate:v,onChange:b,shouldDisableMonth:y,readOnly:w,onMonthFocus:x,hasFocus:S,onFocusedViewChange:C,monthsPerRow:k,timezone:E,gridLabelId:R,slots:P,slotProps:M}=n,T=d(n,UY),{value:I,handleValueChange:O,timezone:D}=iK({name:"MonthCalendar",timezone:E,value:l,defaultValue:c,referenceDate:u,onChange:b,valueManager:qU}),F=NG(D),L=um(),A=gG(),{ownerState:N}=lG(),$=s.useMemo(()=>qU.getInitialReferenceValue({value:I,adapter:A,props:n,timezone:D,referenceDate:u,granularity:MU.month}),[]),z=(e=>wm({root:["root"]},BY,e))(a),j=s.useMemo(()=>A.getMonth(F),[A,F]),B=s.useMemo(()=>null!=I?A.getMonth(I):null,[I,A]),[_,H]=s.useState(()=>B||A.getMonth($)),[V,W]=Pg({name:"MonthCalendar",state:"hasFocus",controlled:S,default:r??!1}),U=Mg(e=>{W(e),C&&C(e)}),G=s.useCallback(e=>{const t=A.startOfMonth(m&&A.isAfter(F,v)?F:v),n=A.startOfMonth(h&&A.isBefore(F,g)?F:g),r=A.startOfMonth(e);return!!A.isBefore(r,t)||(!!A.isAfter(r,n)||!!y&&y(r))},[h,m,g,v,F,y,A]),K=Mg((e,t)=>{if(w)return;const n=I&&i&&!A.isSameYear(I,i)?A.setYear(I,A.getYear(i)):I,r=A.setMonth(n??$,t);O(r)}),q=Mg(e=>{G(A.setMonth(I??i??$,e))||(H(e),U(!0),x&&x(e))});s.useEffect(()=>{H(e=>null!==B&&e!==B?B:e)},[B]);const Y=Mg((e,t)=>{const n=12;switch(e.key){case"ArrowUp":q((n+t-3)%n),e.preventDefault();break;case"ArrowDown":q((n+t+3)%n),e.preventDefault();break;case"ArrowLeft":q((n+t+(L?1:-1))%n),e.preventDefault();break;case"ArrowRight":q((n+t+(L?-1:1))%n),e.preventDefault()}}),X=Mg((e,t)=>{q(t)}),Q=Mg((e,t)=>{_===t&&U(!1)});return Xp.jsx(KY,f({ref:t,className:QU(z.root,o),ownerState:N,role:"radiogroup","aria-labelledby":R,monthsPerRow:k},T,{children:wU(A,i??I??$).map(e=>{const t=A.getMonth(e),n=A.format(e,"monthShort"),r=A.format(e,"month"),o=GY(t,B,e,I,A),i=p||G(e);return Xp.jsx(WY,{selected:o,value:t,onClick:K,onKeyDown:Y,autoFocus:V&&t===_,disabled:i,tabIndex:t!==_||i?-1:0,onFocus:X,onBlur:Q,"aria-current":GY(t,j,e,F,A)?"date":void 0,"aria-label":r,slots:P,slotProps:M,classes:a,children:n},n)})}))});function YY(e){return Ph("MuiYearCalendar",e)}const XY=Mh("MuiYearCalendar",["root","button","disabled","selected"]),QY=["autoFocus","classes","disabled","selected","value","onClick","onKeyDown","onFocus","onBlur","slots","slotProps"],ZY=pg("button",{name:"MuiYearCalendar",slot:"Button",overridesResolver:(e,t)=>[t.button,{[`&.${XY.disabled}`]:t.disabled},{[`&.${XY.selected}`]:t.selected}]})(({theme:e})=>f({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:tm(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:tm(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${XY.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${XY.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),JY=s.memo(function(e){const{autoFocus:t,classes:n,disabled:r,selected:o,value:i,onClick:a,onKeyDown:l,onFocus:c,onBlur:u,slots:p,slotProps:h}=e,m=d(e,QY),g=s.useRef(null),{ownerState:v}=lG(),b=f({},v,{isYearDisabled:r,isYearSelected:o}),y=((e,t)=>wm({button:["button",t.isYearDisabled&&"disabled",t.isYearSelected&&"selected"]},YY,e))(n,b);Wh(()=>{t&&g.current?.focus()},[t]);const w=p?.yearButton??ZY,x=yy({elementType:w,externalSlotProps:h?.yearButton,externalForwardedProps:m,additionalProps:{disabled:r,ref:g,type:"button",role:"radio","aria-checked":o,onClick:e=>a(e,i),onKeyDown:e=>l(e,i),onFocus:e=>c(e,i),onBlur:e=>u(e,i)},ownerState:b,className:y.button});return Xp.jsx(w,f({},x))}),eX=["autoFocus","className","classes","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"];const tX=pg("div",{name:"MuiYearCalendar",slot:"Root",shouldForwardProp:e=>Oh(e)&&"yearsPerRow"!==e})({display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",rowGap:12,padding:"6px 0",overflowY:"auto",height:"100%",width:hK,maxHeight:280,boxSizing:"border-box",position:"relative",variants:[{props:{yearsPerRow:3},style:{columnGap:24}},{props:{yearsPerRow:4},style:{columnGap:0,padding:"0 2px"}}]}),nX=pg("div",{name:"MuiYearCalendar",slot:"ButtonFiller"})({height:36,width:72}),rX=s.forwardRef(function(e,t){const n=function(e,t){const n=cg({props:e,name:t});return f({},n,jG(n),{yearsPerRow:n.yearsPerRow??3,yearsOrder:n.yearsOrder??"asc"})}(e,"MuiYearCalendar"),{autoFocus:r,className:o,classes:i,value:a,defaultValue:l,referenceDate:c,disabled:u,disableFuture:p,disablePast:h,maxDate:m,minDate:g,onChange:v,readOnly:b,shouldDisableYear:y,onYearFocus:w,hasFocus:x,onFocusedViewChange:S,yearsOrder:C,yearsPerRow:k,timezone:E,gridLabelId:R,slots:P,slotProps:M}=n,T=d(n,eX),{value:I,handleValueChange:O,timezone:D}=iK({name:"YearCalendar",timezone:E,value:a,defaultValue:l,referenceDate:c,onChange:v,valueManager:qU}),F=NG(D),L=um(),A=gG(),{ownerState:N}=lG(),$=s.useMemo(()=>qU.getInitialReferenceValue({value:I,adapter:A,props:n,timezone:D,referenceDate:c,granularity:MU.year}),[]),z=(e=>wm({root:["root"]},YY,e))(i),j=s.useMemo(()=>A.getYear(F),[A,F]),B=s.useMemo(()=>null!=I?A.getYear(I):null,[I,A]),[_,H]=s.useState(()=>B||A.getYear($)),[V,W]=Pg({name:"YearCalendar",state:"hasFocus",controlled:x,default:r??!1}),U=Mg(e=>{W(e),S&&S(e)}),G=s.useCallback(e=>{if(h&&A.isBeforeYear(e,F))return!0;if(p&&A.isAfterYear(e,F))return!0;if(g&&A.isBeforeYear(e,g))return!0;if(m&&A.isAfterYear(e,m))return!0;if(!y)return!1;const t=A.startOfYear(e);return y(t)},[p,h,m,g,F,y,A]),K=Mg((e,t)=>{if(b)return;const n=A.setYear(I??$,t);O(n)}),q=Mg(e=>{G(A.setYear(I??$,e))||(H(e),U(!0),w?.(e))});s.useEffect(()=>{H(e=>null!==B&&e!==B?B:e)},[B]);const Y="desc"!==C?1*k:-1*k,X=L&&"asc"===C||!L&&"desc"===C?-1:1,Q=Mg((e,t)=>{switch(e.key){case"ArrowUp":q(t-Y),e.preventDefault();break;case"ArrowDown":q(t+Y),e.preventDefault();break;case"ArrowLeft":q(t-X),e.preventDefault();break;case"ArrowRight":q(t+X),e.preventDefault()}}),Z=Mg((e,t)=>{q(t)}),J=Mg((e,t)=>{_===t&&U(!1)}),ee=s.useRef(null),te=Tg(t,ee);s.useEffect(()=>{if(r||null===ee.current)return;const e=ee.current.querySelector('[tabindex="0"]');if(!e)return;const t=e.offsetHeight,n=e.offsetTop,o=ee.current.clientHeight,i=ee.current.scrollTop,a=n+t;t>o||n<i||(ee.current.scrollTop=a-o/2-t/2)},[r]);const ne=A.getYearRange([g,m]);"desc"===C&&ne.reverse();let re=k-ne.length%k;return re===k&&(re=0),Xp.jsxs(tX,f({ref:te,className:QU(z.root,o),ownerState:N,role:"radiogroup","aria-labelledby":R,yearsPerRow:k},T,{children:[ne.map(e=>{const t=A.getYear(e),n=t===B,r=u||G(e);return Xp.jsx(JY,{selected:n,value:t,onClick:K,onKeyDown:Q,autoFocus:V&&t===_,disabled:r,tabIndex:t!==_||r?-1:0,onFocus:Z,onBlur:J,"aria-current":j===t?"date":void 0,slots:P,slotProps:M,classes:i,children:A.format(e,"year")},A.format(e,"year"))}),Array.from({length:re},(e,t)=>Xp.jsx(nX,{},t))]}))}),oX=e=>Ph("MuiPickersCalendarHeader",e),iX=Mh("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function aX(e){return Ph("MuiPickersArrowSwitcher",e)}Mh("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const lX=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId","classes"],sX=["ownerState"],cX=["ownerState"],uX=pg("div",{name:"MuiPickersArrowSwitcher",slot:"Root"})({display:"flex"}),dX=pg("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer"})(({theme:e})=>({width:e.spacing(3)})),pX=pg(Mv,{name:"MuiPickersArrowSwitcher",slot:"Button"})({variants:[{props:{isButtonHidden:!0},style:{visibility:"hidden"}}]}),fX=s.forwardRef(function(e,t){const n=um(),r=cg({props:e,name:"MuiPickersArrowSwitcher"}),{children:o,className:i,slots:a,slotProps:l,isNextDisabled:s,isNextHidden:c,onGoToNext:u,nextLabel:p,isPreviousDisabled:h,isPreviousHidden:m,onGoToPrevious:g,previousLabel:v,labelId:b,classes:y}=r,w=d(r,lX),{ownerState:x}=lG(),S=(e=>wm({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},aX,e))(y),C={isDisabled:s,isHidden:c,goTo:u,label:p},k={isDisabled:h,isHidden:m,goTo:g,label:v},E=a?.previousIconButton??pX,R=yy({elementType:E,externalSlotProps:l?.previousIconButton,additionalProps:{size:"medium",title:k.label,"aria-label":k.label,disabled:k.isDisabled,edge:"end",onClick:k.goTo},ownerState:f({},x,{isButtonHidden:k.isHidden??!1}),className:QU(S.button,S.previousIconButton)}),P=a?.nextIconButton??pX,M=yy({elementType:P,externalSlotProps:l?.nextIconButton,additionalProps:{size:"medium",title:C.label,"aria-label":C.label,disabled:C.isDisabled,edge:"start",onClick:C.goTo},ownerState:f({},x,{isButtonHidden:C.isHidden??!1}),className:QU(S.button,S.nextIconButton)}),T=a?.leftArrowIcon??WK,I=d(yy({elementType:T,externalSlotProps:l?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:x,className:S.leftArrowIcon}),sX),O=a?.rightArrowIcon??UK,D=d(yy({elementType:O,externalSlotProps:l?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:x,className:S.rightArrowIcon}),cX);return Xp.jsxs(uX,f({ref:t,className:QU(S.root,i),ownerState:x},w,{children:[Xp.jsx(E,f({},R,{children:n?Xp.jsx(O,f({},D)):Xp.jsx(T,f({},I))})),o?Xp.jsx(Gv,{variant:"subtitle1",component:"span",id:b,children:o}):Xp.jsx(dX,{className:S.spacer,ownerState:x}),Xp.jsx(P,f({},M,{children:n?Xp.jsx(T,f({},I)):Xp.jsx(O,f({},D))}))]}))});const hX=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","classes","timezone","format"],mX=["ownerState"],gX=pg("div",{name:"MuiPickersCalendarHeader",slot:"Root"})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),vX=pg("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer"})(({theme:e})=>f({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),bX=pg("div",{name:"MuiPickersCalendarHeader",slot:"Label"})({marginRight:6}),yX=pg(Mv,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton"})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${iX.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),wX=pg(VK,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon"})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),xX=s.forwardRef(function(e,t){const n=vG(),r=gG(),o=cg({props:e,name:"MuiPickersCalendarHeader"}),{slots:i,slotProps:a,currentMonth:l,disabled:c,disableFuture:u,disablePast:p,maxDate:h,minDate:m,onMonthChange:g,onViewChange:v,view:b,reduceAnimations:y,views:w,labelId:x,className:S,classes:C,timezone:k,format:E=`${r.formats.month} ${r.formats.year}`}=o,R=d(o,hX),{ownerState:P}=lG(),M=(e=>wm({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},oX,e))(C),T=i?.switchViewButton??yX,I=yy({elementType:T,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(b)},ownerState:f({},P,{view:b}),className:M.switchViewButton}),O=i?.switchViewIcon??wX,D=d(yy({elementType:O,externalSlotProps:a?.switchViewIcon,ownerState:P,className:M.switchViewIcon}),mX),F=function(e,{disableFuture:t,maxDate:n,timezone:r}){const o=gG();return s.useMemo(()=>{const i=o.date(void 0,r),a=o.startOfMonth(t&&o.isBefore(i,n)?i:n);return!o.isAfter(a,e)},[t,n,e,o,r])}(l,{disableFuture:u,maxDate:h,timezone:k}),L=function(e,{disablePast:t,minDate:n,timezone:r}){const o=gG();return s.useMemo(()=>{const i=o.date(void 0,r),a=o.startOfMonth(t&&o.isAfter(i,n)?i:n);return!o.isBefore(a,e)},[t,n,e,o,r])}(l,{disablePast:p,minDate:m,timezone:k});if(1===w.length&&"year"===w[0])return null;const A=r.formatByString(l,E);return Xp.jsxs(gX,f({},R,{ownerState:P,className:QU(M.root,S),ref:t,children:[Xp.jsxs(vX,{role:"presentation",onClick:()=>{if(1!==w.length&&v&&!c)if(2===w.length)v(w.find(e=>e!==b)||w[0]);else{const e=0!==w.indexOf(b)?0:1;v(w[e])}},ownerState:P,"aria-live":"polite",className:M.labelContainer,children:[Xp.jsx(uY,{reduceAnimations:y,transKey:A,children:Xp.jsx(bX,{id:x,ownerState:P,className:M.label,children:A})}),w.length>1&&!c&&Xp.jsx(T,f({},I,{children:Xp.jsx(O,f({},D))}))]}),Xp.jsx(Pw,{in:"day"===b,appear:!y,enter:!y,children:Xp.jsx(fX,{slots:i,slotProps:a,onGoToPrevious:()=>g(r.addMonths(l,-1)),isPreviousDisabled:L,previousLabel:n.previousMonth,onGoToNext:()=>g(r.addMonths(l,1)),isNextDisabled:F,nextLabel:n.nextMonth})})]}))}),SX=pg("div")({overflow:"hidden",width:hK,maxHeight:336,display:"flex",flexDirection:"column",margin:"0 auto"}),CX=e=>Ph("MuiDateCalendar",e);Mh("MuiDateCalendar",["root","viewTransitionContainer"]);const kX=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","classes","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"];const EX=pg(SX,{name:"MuiDateCalendar",slot:"Root"})({display:"flex",flexDirection:"column",height:336}),RX=pg(uY,{name:"MuiDateCalendar",slot:"ViewTransitionContainer"})({}),PX=s.forwardRef(function(e,t){const n=gG(),{ownerState:r}=lG(),o=mm(),i=function(e,t){const n=cg({props:e,name:t}),r=eK(n.reduceAnimations);return f({},n,jG(n),{loading:n.loading??!1,openTo:n.openTo??"day",views:n.views??["year","day"],reduceAnimations:r,renderLoading:n.renderLoading??(()=>Xp.jsx("span",{children:"..."}))})}(e,"MuiDateCalendar"),{autoFocus:a,onViewChange:l,value:c,defaultValue:u,referenceDate:p,disableFuture:h,disablePast:m,onChange:g,onMonthChange:v,reduceAnimations:b,shouldDisableDate:y,shouldDisableMonth:w,shouldDisableYear:x,view:S,views:C,openTo:k,className:E,classes:R,disabled:P,readOnly:M,minDate:T,maxDate:I,disableHighlightToday:O,focusedView:D,onFocusedViewChange:F,showDaysOutsideCurrentMonth:L,fixedWeekNumber:A,dayOfWeekFormatter:N,slots:$,slotProps:z,loading:j,renderLoading:B,displayWeekNumber:_,yearsOrder:H,yearsPerRow:V,monthsPerRow:W,timezone:U}=i,G=d(i,kX),{value:K,handleValueChange:q,timezone:Y}=iK({name:"DateCalendar",timezone:U,value:c,defaultValue:u,referenceDate:p,onChange:g,valueManager:qU}),{view:X,setView:Q,focusedView:Z,setFocusedView:J,goToNextView:ee,setValueAndGoToNextView:te}=nK({view:S,views:C,openTo:k,onChange:q,onViewChange:l,autoFocus:a,focusedView:D,onFocusedViewChange:F}),{referenceDate:ne,calendarState:re,setVisibleDate:oe,isDateDisabled:ie,onMonthSwitchingAnimationEnd:ae}=aY({value:K,referenceDate:p,reduceAnimations:b,onMonthChange:v,minDate:T,maxDate:I,shouldDisableDate:y,disablePast:m,disableFuture:h,timezone:Y,getCurrentMonthFromVisibleDate:(e,t)=>n.isSameMonth(e,t)?t:n.startOfMonth(e)}),le=P&&K||T,se=P&&K||I,ce=`${o}-grid-label`,ue=null!==Z,de=$?.calendarHeader??xX,pe=yy({elementType:de,externalSlotProps:z?.calendarHeader,additionalProps:{views:C,view:X,currentMonth:re.currentMonth,onViewChange:Q,onMonthChange:e=>oe({target:e,reason:"header-navigation"}),minDate:le,maxDate:se,disabled:P,disablePast:m,disableFuture:h,reduceAnimations:b,timezone:Y,labelId:ce},ownerState:r}),fe=Mg(e=>{const t=n.startOfMonth(e),r=n.endOfMonth(e),o=ie(e)?bU({adapter:n,date:e,minDate:n.isBefore(T,t)?t:T,maxDate:n.isAfter(I,r)?r:I,disablePast:m,disableFuture:h,isDateDisabled:ie,timezone:Y}):e;o?(te(o,"finish"),oe({target:o,reason:"cell-interaction"})):(ee(),oe({target:t,reason:"cell-interaction"}))}),he=Mg(e=>{const t=n.startOfYear(e),r=n.endOfYear(e),o=ie(e)?bU({adapter:n,date:e,minDate:n.isBefore(T,t)?t:T,maxDate:n.isAfter(I,r)?r:I,disablePast:m,disableFuture:h,isDateDisabled:ie,timezone:Y}):e;o?(te(o,"finish"),oe({target:o,reason:"cell-interaction"})):(ee(),oe({target:t,reason:"cell-interaction"}))}),me=Mg(e=>q(e?vU(n,e,K??ne):e,"finish",X));s.useEffect(()=>{n.isValid(K)&&oe({target:K,reason:"controlled-value-change"})},[K]);const ge=(e=>wm({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},CX,e))(R),ve={disablePast:m,disableFuture:h,maxDate:I,minDate:T},be={disableHighlightToday:O,readOnly:M,disabled:P,timezone:Y,gridLabelId:ce,slots:$,slotProps:z},ye=s.useRef(X);s.useEffect(()=>{ye.current!==X&&(Z===ye.current&&J(X,!0),ye.current=X)},[Z,J,X]);const we=s.useMemo(()=>[K],[K]);return Xp.jsxs(EX,f({ref:t,className:QU(ge.root,E),ownerState:r},G,{children:[Xp.jsx(de,f({},pe,{slots:$,slotProps:z})),Xp.jsx(RX,{reduceAnimations:b,className:ge.viewTransitionContainer,transKey:X,ownerState:r,children:Xp.jsxs("div",{children:["year"===X&&Xp.jsx(rX,f({},ve,be,{value:K,onChange:he,shouldDisableYear:x,hasFocus:ue,onFocusedViewChange:e=>J("year",e),yearsOrder:H,yearsPerRow:V,referenceDate:ne})),"month"===X&&Xp.jsx(qY,f({},ve,be,{currentMonth:re.currentMonth,hasFocus:ue,className:E,value:K,onChange:fe,shouldDisableMonth:w,onFocusedViewChange:e=>J("month",e),monthsPerRow:W,referenceDate:ne})),"day"===X&&Xp.jsx(jY,f({},re,ve,be,{onMonthSwitchingAnimationEnd:ae,hasFocus:ue,onFocusedDayChange:e=>oe({target:e,reason:"cell-interaction"}),reduceAnimations:b,selectedDays:we,onSelectedDaysChange:me,shouldDisableDate:y,shouldDisableMonth:w,shouldDisableYear:x,onFocusedViewChange:e=>J("day",e),showDaysOutsideCurrentMonth:L,fixedWeekNumber:A,dayOfWeekFormatter:N,displayWeekNumber:_,loading:j,renderLoading:B}))]})})]}))}),MX=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:o,value:i,defaultValue:a,referenceDate:l,onChange:s,className:c,classes:u,disableFuture:d,disablePast:p,minDate:f,maxDate:h,shouldDisableDate:m,shouldDisableMonth:g,shouldDisableYear:v,reduceAnimations:b,onMonthChange:y,monthsPerRow:w,onYearChange:x,yearsOrder:S,yearsPerRow:C,slots:k,slotProps:E,loading:R,renderLoading:P,disableHighlightToday:M,readOnly:T,disabled:I,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:D,sx:F,autoFocus:L,fixedWeekNumber:A,displayWeekNumber:N,timezone:$})=>Xp.jsx(PX,{view:e,onViewChange:t,views:n.filter(CU),focusedView:r&&CU(r)?r:null,onFocusedViewChange:o,value:i,defaultValue:a,referenceDate:l,onChange:s,className:c,classes:u,disableFuture:d,disablePast:p,minDate:f,maxDate:h,shouldDisableDate:m,shouldDisableMonth:g,shouldDisableYear:v,reduceAnimations:b,onMonthChange:y,monthsPerRow:w,onYearChange:x,yearsOrder:S,yearsPerRow:C,slots:k,slotProps:E,loading:R,renderLoading:P,disableHighlightToday:M,readOnly:T,disabled:I,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:D,sx:F,autoFocus:L,fixedWeekNumber:A,displayWeekNumber:N,timezone:$}),TX=s.forwardRef(function(e,t){const n=gG(),r=BG(e,"MuiDesktopDatePicker"),o=f({day:MX,month:MX,year:MX},r.viewRenderers),i=f({},r,{closeOnSelect:r.closeOnSelect??!0,viewRenderers:o,format:kU(n,r,!1),yearsPerRow:r.yearsPerRow??4,slots:f({field:oY},r.slots),slotProps:f({},r.slotProps,{field:e=>f({},_g(r.slotProps?.field,e),SG(r)),toolbar:f({hidden:!0},r.slotProps?.toolbar)})}),{renderPicker:a}=(e=>{let{props:t,steps:n}=e,r=d(e,EK);const{slots:o,slotProps:i,label:a,inputRef:l,localeText:s}=t,c=kK({steps:n}),{providerProps:u,renderCurrentView:p,ownerState:h}=lK(f({},r,{props:t,localeText:s,autoFocusView:!0,viewContainerRole:"dialog",variant:"desktop",getStepNavigation:c})),m=u.privateContextValue.labelId,g=i?.toolbar?.hidden??!1,v=o.field,b=d(yy({elementType:v,externalSlotProps:i?.field,additionalProps:f({},g&&{id:m}),ownerState:h}),RK),y=o.layout??CK;let w=m;g&&(w=a?`${m}-label`:void 0);const x=f({},i,{toolbar:f({},i?.toolbar,{titleId:m}),popper:f({"aria-labelledby":w},i?.popper)});return{renderPicker:()=>Xp.jsxs(aG,f({},u,{children:[Xp.jsx(v,f({},b,{slots:f({},o,b.slots),slotProps:f({},x,b.slotProps),inputRef:l})),Xp.jsx(YG,{slots:o,slotProps:x,children:Xp.jsx(y,f({},x?.layout,{slots:o,slotProps:x,children:p()}))})]}))}})({ref:t,props:i,valueManager:qU,valueType:"date",validator:LG,steps:null});return a()});TX.propTypes={autoFocus:C.bool,className:C.string,closeOnSelect:C.bool,dayOfWeekFormatter:C.func,defaultValue:C.object,disabled:C.bool,disableFuture:C.bool,disableHighlightToday:C.bool,disableOpenPicker:C.bool,disablePast:C.bool,displayWeekNumber:C.bool,enableAccessibleFieldDOMStructure:C.any,fixedWeekNumber:C.number,format:C.string,formatDensity:C.oneOf(["dense","spacious"]),inputRef:Yg,label:C.node,loading:C.bool,localeText:C.object,maxDate:C.object,minDate:C.object,monthsPerRow:C.oneOf([3,4]),name:C.string,onAccept:C.func,onChange:C.func,onClose:C.func,onError:C.func,onMonthChange:C.func,onOpen:C.func,onSelectedSectionsChange:C.func,onViewChange:C.func,onYearChange:C.func,open:C.bool,openTo:C.oneOf(["day","month","year"]),orientation:C.oneOf(["landscape","portrait"]),readOnly:C.bool,reduceAnimations:C.bool,referenceDate:C.object,renderLoading:C.func,selectedSections:C.oneOfType([C.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),C.number]),shouldDisableDate:C.func,shouldDisableMonth:C.func,shouldDisableYear:C.func,showDaysOutsideCurrentMonth:C.bool,slotProps:C.object,slots:C.object,sx:C.oneOfType([C.arrayOf(C.oneOfType([C.func,C.object,C.bool])),C.func,C.object]),timezone:C.string,value:C.object,view:C.oneOf(["day","month","year"]),viewRenderers:C.shape({day:C.func,month:C.func,year:C.func}),views:C.arrayOf(C.oneOf(["day","month","year"]).isRequired),yearsOrder:C.oneOf(["asc","desc"]),yearsPerRow:C.oneOf([3,4])};const IX=pg(zx)({[`& .${Dx.container}`]:{outline:0},[`& .${Dx.paper}`]:{outline:0,minWidth:hK}}),OX=pg(Gx)({"&:first-of-type":{padding:0}});function DX(e){const{children:t,slots:n,slotProps:r}=e,{open:o}=rG(),{dismissViews:i,onPopperExited:a}=lG(),l=n?.dialog??IX,s=n?.mobileTransition??Pw;return Xp.jsx(l,f({open:o,onClose:()=>{i(),a?.()}},r?.dialog,{TransitionComponent:s,TransitionProps:r?.mobileTransition,PaperComponent:n?.mobilePaper,PaperProps:r?.mobilePaper,children:Xp.jsx(OX,{children:t})}))}const FX=["props","steps"],LX=["ownerState"],AX=s.forwardRef(function(e,t){const n=gG(),r=BG(e,"MuiMobileDatePicker"),o=f({day:MX,month:MX,year:MX},r.viewRenderers),i=f({},r,{viewRenderers:o,format:kU(n,r,!1),slots:f({field:oY},r.slots),slotProps:f({},r.slotProps,{field:e=>f({},_g(r.slotProps?.field,e),SG(r)),toolbar:f({hidden:!1},r.slotProps?.toolbar)})}),{renderPicker:a}=(e=>{let{props:t,steps:n}=e,r=d(e,FX);const{slots:o,slotProps:i,label:a,inputRef:l,localeText:s}=t,c=kK({steps:n}),{providerProps:u,renderCurrentView:p,ownerState:h}=lK(f({},r,{props:t,localeText:s,autoFocusView:!0,viewContainerRole:"dialog",variant:"mobile",getStepNavigation:c})),m=u.privateContextValue.labelId,g=i?.toolbar?.hidden??!1,v=o.field,b=d(yy({elementType:v,externalSlotProps:i?.field,additionalProps:f({},g&&{id:m}),ownerState:h}),LX),y=o.layout??CK;let w=m;g&&(w=a?`${m}-label`:void 0);const x=f({},i,{toolbar:f({},i?.toolbar,{titleId:m}),mobilePaper:f({"aria-labelledby":w},i?.mobilePaper)});return{renderPicker:()=>Xp.jsxs(aG,f({},u,{children:[Xp.jsx(v,f({},b,{slots:f({},o,b.slots),slotProps:f({},x,b.slotProps),inputRef:l})),Xp.jsx(DX,{slots:o,slotProps:x,children:Xp.jsx(y,f({},x?.layout,{slots:o,slotProps:x,children:p()}))})]}))}})({ref:t,props:i,valueManager:qU,valueType:"date",validator:LG,steps:null});return a()});AX.propTypes={autoFocus:C.bool,className:C.string,closeOnSelect:C.bool,dayOfWeekFormatter:C.func,defaultValue:C.object,disabled:C.bool,disableFuture:C.bool,disableHighlightToday:C.bool,disableOpenPicker:C.bool,disablePast:C.bool,displayWeekNumber:C.bool,enableAccessibleFieldDOMStructure:C.any,fixedWeekNumber:C.number,format:C.string,formatDensity:C.oneOf(["dense","spacious"]),inputRef:Yg,label:C.node,loading:C.bool,localeText:C.object,maxDate:C.object,minDate:C.object,monthsPerRow:C.oneOf([3,4]),name:C.string,onAccept:C.func,onChange:C.func,onClose:C.func,onError:C.func,onMonthChange:C.func,onOpen:C.func,onSelectedSectionsChange:C.func,onViewChange:C.func,onYearChange:C.func,open:C.bool,openTo:C.oneOf(["day","month","year"]),orientation:C.oneOf(["landscape","portrait"]),readOnly:C.bool,reduceAnimations:C.bool,referenceDate:C.object,renderLoading:C.func,selectedSections:C.oneOfType([C.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),C.number]),shouldDisableDate:C.func,shouldDisableMonth:C.func,shouldDisableYear:C.func,showDaysOutsideCurrentMonth:C.bool,slotProps:C.object,slots:C.object,sx:C.oneOfType([C.arrayOf(C.oneOfType([C.func,C.object,C.bool])),C.func,C.object]),timezone:C.string,value:C.object,view:C.oneOf(["day","month","year"]),viewRenderers:C.shape({day:C.func,month:C.func,year:C.func}),views:C.arrayOf(C.oneOf(["day","month","year"]).isRequired),yearsOrder:C.oneOf(["asc","desc"]),yearsPerRow:C.oneOf([3,4])};const NX=["desktopModeMediaQuery"],$X=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiDatePicker"}),{desktopModeMediaQuery:r=WG}=n,o=d(n,NX);return nR(r,{defaultMatches:!0})?Xp.jsx(TX,f({ref:t},o)):Xp.jsx(AX,f({ref:t},o))});var zX,jX={exports:{}};var BX,_X=(zX||(zX=1,function(e){e.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",i="minute",a="hour",l="day",s="week",c="month",u="quarter",d="year",p="date",f="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={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(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},v=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},b={s:v,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+v(r,2,"0")+":"+v(o,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),o=t.clone().add(r,c),i=n-o<0,a=t.clone().add(r+(i?-1:1),c);return+(-(r+(n-o)/(i?o-a:a-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:s,d:l,D:p,h:a,m:i,s:o,ms:r,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",w={};w[y]=g;var x="$isDayjsObject",S=function(e){return e instanceof R||!(!e||!e[x])},C=function e(t,n,r){var o;if(!t)return y;if("string"==typeof t){var i=t.toLowerCase();w[i]&&(o=i),n&&(w[i]=n,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var l=t.name;w[l]=t,o=l}return!r&&o&&(y=o),o||!r&&y},k=function(e,t){if(S(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new R(n)},E=b;E.l=C,E.i=S,E.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var R=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var v=g.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(h);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return E},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},v.isAfter=function(e,t){return k(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<k(e)},v.$g=function(e,t,n){return E.u(e)?this[t]:this.set(n,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var n=this,r=!!E.u(t)||t,u=E.p(e),f=function(e,t){var o=E.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?o:o.endOf(l)},h=function(e,t){return E.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},m=this.$W,g=this.$M,v=this.$D,b="set"+(this.$u?"UTC":"");switch(u){case d:return r?f(1,0):f(31,11);case c:return r?f(1,g):f(0,g+1);case s:var y=this.$locale().weekStart||0,w=(m<y?m+7:m)-y;return f(r?v-w:v+(6-w),g);case l:case p:return h(b+"Hours",0);case a:return h(b+"Minutes",1);case i:return h(b+"Seconds",2);case o:return h(b+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var n,s=E.p(e),u="set"+(this.$u?"UTC":""),f=(n={},n[l]=u+"Date",n[p]=u+"Date",n[c]=u+"Month",n[d]=u+"FullYear",n[a]=u+"Hours",n[i]=u+"Minutes",n[o]=u+"Seconds",n[r]=u+"Milliseconds",n)[s],h=s===l?this.$D+(t-this.$W):t;if(s===c||s===d){var m=this.clone().set(p,1);m.$d[f](h),m.init(),this.$d=m.set(p,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](h);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[E.p(e)]()},v.add=function(r,u){var p,f=this;r=Number(r);var h=E.p(u),m=function(e){var t=k(f);return E.w(t.date(t.date()+Math.round(e*r)),f)};if(h===c)return this.set(c,this.$M+r);if(h===d)return this.set(d,this.$y+r);if(h===l)return m(1);if(h===s)return m(7);var g=(p={},p[i]=t,p[a]=n,p[o]=e,p)[h]||1,v=this.$d.getTime()+r*g;return E.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=E.z(this),i=this.$H,a=this.$m,l=this.$M,s=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,o,i){return e&&(e[n]||e(t,r))||o[n].slice(0,i)},p=function(e){return E.s(i%12||12,e,"0")},h=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(m,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return E.s(t.$y,4,"0");case"M":return l+1;case"MM":return E.s(l+1,2,"0");case"MMM":return d(n.monthsShort,l,c,3);case"MMMM":return d(c,l);case"D":return t.$D;case"DD":return E.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,s,2);case"ddd":return d(n.weekdaysShort,t.$W,s,3);case"dddd":return s[t.$W];case"H":return String(i);case"HH":return E.s(i,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return h(i,a,!0);case"A":return h(i,a,!1);case"m":return String(a);case"mm":return E.s(a,2,"0");case"s":return String(t.$s);case"ss":return E.s(t.$s,2,"0");case"SSS":return E.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(r,p,f){var h,m=this,g=E.p(p),v=k(r),b=(v.utcOffset()-this.utcOffset())*t,y=this-v,w=function(){return E.m(m,v)};switch(g){case d:h=w()/12;break;case c:h=w();break;case u:h=w()/3;break;case s:h=(y-b)/6048e5;break;case l:h=(y-b)/864e5;break;case a:h=y/n;break;case i:h=y/t;break;case o:h=y/e;break;default:h=y}return f?h:E.a(h)},v.daysInMonth=function(){return this.endOf(c).$D},v.$locale=function(){return w[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},v.clone=function(){return E.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},g}(),P=R.prototype;return k.prototype=P,[["$ms",r],["$s",o],["$m",i],["$H",a],["$W",l],["$M",c],["$y",d],["$D",p]].forEach(function(e){P[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),k.extend=function(e,t){return e.$i||(e(t,R,k),e.$i=!0),k},k.locale=C,k.isDayjs=S,k.unix=function(e){return k(1e3*e)},k.en=w[y],k.Ls=w,k.p={},k}()}(jX)),jX.exports),HX=t(_X),VX={exports:{}};var WX,UX=(BX||(BX=1,function(e){var t,n;e.exports=(t="week",n="year",function(e,r,o){var i=r.prototype;i.week=function(e){if(void 0===e&&(e=null),null!==e)return this.add(7*(e-this.week()),"day");var r=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var i=o(this).startOf(n).add(1,n).date(r),a=o(this).endOf(t);if(i.isBefore(a))return 1}var l=o(this).startOf(n).date(r).startOf(t).subtract(1,"millisecond"),s=this.diff(l,t,!0);return s<0?o(this).startOf("week").week():Math.ceil(s)},i.weeks=function(e){return void 0===e&&(e=null),this.week(e)}})}(VX)),VX.exports),GX=t(UX),KX={exports:{}};var qX,YX=(WX||(WX=1,function(e){e.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,o=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},l=function(e){return(e=+e)+(e>68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],u=function(e){var t=a[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=a.meridiem;if(r){for(var o=1;o<=24;o+=1)if(e.indexOf(r(o,0,t))>-1){n=o>12;break}}else n=e===(t?"pm":"PM");return n},p={A:[i,function(e){this.afternoon=d(e,!1)}],a:[i,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[o,s("seconds")],ss:[o,s("seconds")],m:[o,s("minutes")],mm:[o,s("minutes")],H:[o,s("hours")],h:[o,s("hours")],HH:[o,s("hours")],hh:[o,s("hours")],D:[o,s("day")],DD:[r,s("day")],Do:[i,function(e){var t=a.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],w:[o,s("week")],ww:[r,s("week")],M:[o,s("month")],MM:[r,s("month")],MMM:[i,function(e){var t=u("months"),n=(u("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=u("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[r,function(e){this.year=l(e)}],YYYY:[/\d{4}/,s("year")],Z:c,ZZ:c};function f(n){var r,o;r=n,o=a&&a.formats;for(var i=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,n,r){var i=r&&r.toUpperCase();return n||o[r]||e[r]||o[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,n){return t||n.slice(1)})})).match(t),l=i.length,s=0;s<l;s+=1){var c=i[s],u=p[c],d=u&&u[0],f=u&&u[1];i[s]=f?{regex:d,parser:f}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},n=0,r=0;n<l;n+=1){var o=i[n];if("string"==typeof o)r+=o.length;else{var a=o.regex,s=o.parser,c=e.slice(r),u=a.exec(c)[0];s.call(t,u),e=e.replace(u,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(l=e.parseTwoDigitYear);var r=t.prototype,o=r.parse;r.parse=function(e){var t=e.date,r=e.utc,i=e.args;this.$u=r;var l=i[1];if("string"==typeof l){var s=!0===i[2],c=!0===i[3],u=s||c,d=i[2];c&&(d=i[2]),a=this.$locale(),!s&&d&&(a=n.Ls[d]),this.$d=function(e,t,n,r){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var o=f(t)(e),i=o.year,a=o.month,l=o.day,s=o.hours,c=o.minutes,u=o.seconds,d=o.milliseconds,p=o.zone,h=o.week,m=new Date,g=l||(i||a?1:m.getDate()),v=i||m.getFullYear(),b=0;i&&!a||(b=a>0?a-1:m.getMonth());var y,w=s||0,x=c||0,S=u||0,C=d||0;return p?new Date(Date.UTC(v,b,g,w,x,S,C+60*p.offset*1e3)):n?new Date(Date.UTC(v,b,g,w,x,S,C)):(y=new Date(v,b,g,w,x,S,C),h&&(y=r(y).week(h).toDate()),y)}catch(e){return new Date("")}}(t,l,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(l)&&(this.$d=new Date("")),a={}}else if(l instanceof Array)for(var p=l.length,h=1;h<=p;h+=1){i[1]=l[h-1];var m=n.apply(this,i);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}h===p&&(this.$d=new Date(""))}else o.call(this,e)}}}()}(KX)),KX.exports),XX=t(YX),QX={exports:{}};var ZX,JX=(qX||(qX=1,function(e){var t;e.exports=(t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},function(e,n,r){var o=n.prototype,i=o.format;r.en.formats=t,o.format=function(e){void 0===e&&(e="YYYY-MM-DDTHH:mm:ssZ");var n=this.$locale().formats,r=function(e,n){return e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(e,r,o){var i=o&&o.toUpperCase();return r||n[o]||t[o]||n[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,n){return t||n.slice(1)})})}(e,void 0===n?{}:n);return i.call(this,r)}})}(QX)),QX.exports),eQ=t(JX),tQ={exports:{}};var nQ,rQ=(ZX||(ZX=1,function(e){e.exports=function(e,t,n){t.prototype.isBetween=function(e,t,r,o){var i=n(e),a=n(t),l="("===(o=o||"()")[0],s=")"===o[1];return(l?this.isAfter(i,r):!this.isBefore(i,r))&&(s?this.isBefore(a,r):!this.isAfter(a,r))||(l?this.isBefore(i,r):!this.isAfter(i,r))&&(s?this.isAfter(a,r):!this.isBefore(a,r))}}}(tQ)),tQ.exports),oQ=t(rQ),iQ={exports:{}};var aQ=(nQ||(nQ=1,function(e){e.exports=function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var o=this.$utils(),i=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return n.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return n.ordinal(t.week(),"W");case"w":case"ww":return o.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return o.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return o.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}});return r.bind(this)(i)}}}(iQ)),iQ.exports),lQ=t(aQ);HX.extend(eQ),HX.extend(GX),HX.extend(oQ),HX.extend(lQ);const sQ={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},cQ={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",dayOfMonthFull:"Do",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},uQ=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join("\n"),dQ=["Missing timezone plugin","To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join("\n");class pQ{isMUIAdapter=!0;isTimezoneCompatible=!0;lib="dayjs";escapedCharacters={start:"[",end:"]"};formatTokenMap=(()=>sQ)();constructor({locale:e,formats:t}={}){this.locale=e,this.formats=f({},cQ,t),HX.extend(XX)}setLocaleToValue=e=>{const t=this.getCurrentLocaleCode();return t===e.locale()?e:e.locale(t)};hasUTCPlugin=()=>void 0!==HX.utc;hasTimezonePlugin=()=>void 0!==HX.tz;isSame=(e,t,n)=>{const r=this.setTimezone(t,this.getTimezone(e));return e.format(n)===r.format(n)};cleanTimezone=e=>{switch(e){case"default":return;case"system":return HX.tz.guess();default:return e}};createSystemDate=e=>{let t;if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const n=HX.tz.guess();t="UTC"===n?HX(e):HX.tz(e,n)}else t=HX(e);return this.setLocaleToValue(t)};createUTCDate=e=>{if(!this.hasUTCPlugin())throw new Error(uQ);return this.setLocaleToValue(HX.utc(e))};createTZDate=(e,t)=>{if(!this.hasUTCPlugin())throw new Error(uQ);if(!this.hasTimezonePlugin())throw new Error(dQ);const n=void 0!==e&&!e.endsWith("Z");return this.setLocaleToValue(HX(e).tz(this.cleanTimezone(t),n))};getLocaleFormats=()=>{const e=HX.Ls;let t=e[this.locale||"en"];return void 0===t&&(t=e.en),t.formats};adjustOffset=e=>{if(!this.hasTimezonePlugin())return e;const t=this.getTimezone(e);if("UTC"!==t){const n=e.tz(this.cleanTimezone(t),!0);if(n.$offset===(e.$offset??0))return e;e.$offset=n.$offset}return e};date=(e,t="default")=>null===e?null:"UTC"===t?this.createUTCDate(e):"system"===t||"default"===t&&!this.hasTimezonePlugin()?this.createSystemDate(e):this.createTZDate(e,t);getInvalidDate=()=>HX(new Date("Invalid date"));getTimezone=e=>{if(this.hasTimezonePlugin()){const t=e.$x?.$timezone;if(t)return t}return this.hasUTCPlugin()&&e.isUTC()?"UTC":"system"};setTimezone=(e,t)=>{if(this.getTimezone(e)===t)return e;if("UTC"===t){if(!this.hasUTCPlugin())throw new Error(uQ);return e.utc()}if("system"===t)return e.local();if(!this.hasTimezonePlugin()){if("default"===t)return e;throw new Error(dQ)}return this.setLocaleToValue(HX.tz(e,this.cleanTimezone(t)))};toJsDate=e=>e.toDate();parse=(e,t)=>""===e?null:HX(e,t,this.locale,!0);getCurrentLocaleCode=()=>this.locale||"en";is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||"");expandFormat=e=>{const t=this.getLocaleFormats();return e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(e,n,r)=>{const o=r&&r.toUpperCase();return n||t[r]||t[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(e,t,n)=>t||n.slice(1))})};isValid=e=>null!=e&&e.isValid();format=(e,t)=>this.formatByString(e,this.formats[t]);formatByString=(e,t)=>this.setLocaleToValue(e).format(t);formatNumber=e=>e;isEqual=(e,t)=>null===e&&null===t||null!==e&&null!==t&&e.toDate().getTime()===t.toDate().getTime();isSameYear=(e,t)=>this.isSame(e,t,"YYYY");isSameMonth=(e,t)=>this.isSame(e,t,"YYYY-MM");isSameDay=(e,t)=>this.isSame(e,t,"YYYY-MM-DD");isSameHour=(e,t)=>e.isSame(t,"hour");isAfter=(e,t)=>e>t;isAfterYear=(e,t)=>this.hasUTCPlugin()?!this.isSameYear(e,t)&&e.utc()>t.utc():e.isAfter(t,"year");isAfterDay=(e,t)=>this.hasUTCPlugin()?!this.isSameDay(e,t)&&e.utc()>t.utc():e.isAfter(t,"day");isBefore=(e,t)=>e<t;isBeforeYear=(e,t)=>this.hasUTCPlugin()?!this.isSameYear(e,t)&&e.utc()<t.utc():e.isBefore(t,"year");isBeforeDay=(e,t)=>this.hasUTCPlugin()?!this.isSameDay(e,t)&&e.utc()<t.utc():e.isBefore(t,"day");isWithinRange=(e,[t,n])=>e>=t&&e<=n;startOfYear=e=>this.adjustOffset(e.startOf("year"));startOfMonth=e=>this.adjustOffset(e.startOf("month"));startOfWeek=e=>this.adjustOffset(this.setLocaleToValue(e).startOf("week"));startOfDay=e=>this.adjustOffset(e.startOf("day"));endOfYear=e=>this.adjustOffset(e.endOf("year"));endOfMonth=e=>this.adjustOffset(e.endOf("month"));endOfWeek=e=>this.adjustOffset(this.setLocaleToValue(e).endOf("week"));endOfDay=e=>this.adjustOffset(e.endOf("day"));addYears=(e,t)=>this.adjustOffset(e.add(t,"year"));addMonths=(e,t)=>this.adjustOffset(e.add(t,"month"));addWeeks=(e,t)=>this.adjustOffset(e.add(t,"week"));addDays=(e,t)=>this.adjustOffset(e.add(t,"day"));addHours=(e,t)=>this.adjustOffset(e.add(t,"hour"));addMinutes=(e,t)=>this.adjustOffset(e.add(t,"minute"));addSeconds=(e,t)=>this.adjustOffset(e.add(t,"second"));getYear=e=>e.year();getMonth=e=>e.month();getDate=e=>e.date();getHours=e=>e.hour();getMinutes=e=>e.minute();getSeconds=e=>e.second();getMilliseconds=e=>e.millisecond();setYear=(e,t)=>this.adjustOffset(e.set("year",t));setMonth=(e,t)=>this.adjustOffset(e.set("month",t));setDate=(e,t)=>this.adjustOffset(e.set("date",t));setHours=(e,t)=>this.adjustOffset(e.set("hour",t));setMinutes=(e,t)=>this.adjustOffset(e.set("minute",t));setSeconds=(e,t)=>this.adjustOffset(e.set("second",t));setMilliseconds=(e,t)=>this.adjustOffset(e.set("millisecond",t));getDaysInMonth=e=>e.daysInMonth();getWeekArray=e=>{const t=this.startOfWeek(this.startOfMonth(e)),n=this.endOfWeek(this.endOfMonth(e));let r=0,o=t;const i=[];for(;o<n;){const e=Math.floor(r/7);i[e]=i[e]||[],i[e].push(o),o=this.addDays(o,1),r+=1}return i};getWeekNumber=e=>e.week();getDayOfWeek(e){return e.day()+1}getYearRange=([e,t])=>{const n=this.startOfYear(e),r=this.endOfYear(t),o=[];let i=n;for(;this.isBefore(i,r);)o.push(i),i=this.addYears(i,1);return o}}const fQ=({providersData:e,rootProvider:t,savedFilters:n={},onSaveFilter:r,onRemoveFilter:o,existingDimensions:i=[],existingMetrics:a=[],titleOverrides:l={},onUpdateTitle:u,onResetTitle:d})=>{const p=SR(),[f,h]=s.useState(!1),[m,g]=s.useState([]),[v,b]=s.useState(""),[y,w]=s.useState([]),[x,S]=s.useState([]),[C,k]=s.useState(!1),[E,R]=s.useState(null),[P,M]=s.useState(null),[T,I]=s.useState(null),[O,D]=s.useState(null),[F,L]=s.useState("");s.useEffect(()=>{b(""),w([]),S([]),M(null),I(null)},[m]);const A=e=>e&&("date"===e.type||"timestamp"===e.type),N=()=>{const n=t?0===m.length?t:m[m.length-1].targetKey:null;if(!n||!e||!e[n])return[];const r=e[n];if(!r.dimensions)return[];const o=[];return Object.keys(r.dimensions).forEach(e=>{const t=r.dimensions[e];Object.keys(t).forEach(r=>{const i=t[r];(e=>!!e.column&&/^[a-zA-Z0-9_.]+$/.test(e.column))(i)&&o.push({key:`${n}_${e}.${r}`,value:i.title||r,dimensionKey:r,alias:e,dimension:i})})}),o},$=()=>{h(!1),g([]),b(""),w([]),S([]),M(null),I(null),R(null)},z=()=>{R(null),w([]),S([]),M(null),I(null)},j=e=>{const t=F.trim();""!==t?(u(e,t),D(null),L("")):B()},B=()=>{D(null),L("")},_=async e=>{k(!0);try{const n={provider:t,doc:{query:{dimensions:[e],metrics:[],order_by:[{name:e}]}},parameters:p?.parameters||{base_currency:"EUR"}};console.log("Fetching filter values with payload:",n);const r=await jc.runAdHocReport({report:n});console.log("Filter values results:",r);const o=(Array.isArray(r)?r:r.data||[]).map(t=>{let n=t[e];if(void 0===n){n=t[e.replace(/\./g,"_")]}if(void 0===n){const e=Object.keys(t);e.length>0&&(n=t[e[0]])}return{key:String(n),value:String(n)}});console.log("Transformed distinct values:",o),w(o)}catch(e){console.error("Error fetching filter values:",e),w([])}finally{k(!1)}},H=e=>{const n=[t];return e.relationNames&&e.relationNames.length>0&&n.push(...e.relationNames),n.join(" → ")},V=Object.entries(n);return c.createElement("div",null,c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:2,marginBottom:2}},f?c.createElement(c.Fragment,null,c.createElement(Xw,{variant:"outlined",onClick:$},"Cancel"),c.createElement(Xw,{variant:"contained",onClick:()=>{const n=N().find(e=>e.key===v);if(!n)return;const o=A(n.dimension);if(o){if(!P&&!T)return}else if(0===x.length)return;if(!v)return;const i=[],a=[t],l=[];let s=t;m.forEach(t=>{const n=e[s];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&(i.push(e),l.push(e.name))}a.push(t.targetKey),s=t.targetKey});const c=[e[t].default_alias];i.forEach(e=>{c.push(e.alias)});const u=`${c.join("_")}.${n.dimensionKey}`;let d;o?(d={},P&&(d.gte=P.format("YYYY-MM-DD")),T&&(d.lte=T.format("YYYY-MM-DD"))):d=x;const p={dimension:n.dimension,relations:i,providerPath:a,relationNames:l,dimensionKey:n.dimensionKey,dimensionTitle:n.value,fullPath:u,values:d};r(u,p),$()},disabled:(()=>{if(!v)return!0;const e=N().find(e=>e.key===v);if(!e)return!0;return A(e.dimension)?!P&&!T:0===x.length})()},"Save Filter")):c.createElement(Xw,{variant:"contained",onClick:()=>{h(!0),g([]),b(""),w([]),S([]),M(null),I(null),R(null)}},"Add Filter")),f&&c.createElement(qg,{sx:{padding:3,marginBottom:3}},c.createElement(Gv,{variant:"h6",sx:{marginBottom:2}},"Select Provider Path"),c.createElement(kH,{providersData:e,rootProvider:t,onSelectionChange:g,existingDimensions:i,existingMetrics:a,existingFilters:n}),c.createElement(Gv,{variant:"h6",sx:{marginTop:3,marginBottom:2}},"Select Dimension for Filter"),c.createElement(uR,{items:N(),value:v,label:"Choose Dimension",onChange:n=>{const r=n.target.value;if(b(r),S([]),M(null),I(null),r){const n=N().find(e=>e.key===r);if(n){if(!A(n.dimension)){const r=[];let o=t;m.forEach(t=>{const n=e[o];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&r.push(e)}o=t.targetKey});const i=[e[t].default_alias];r.forEach(e=>{i.push(e.alias)});const a=`${i.join("_")}.${n.dimensionKey}`;_(a)}}}else w([])},sx:{width:"400px"}}),v&&(()=>{const e=N().find(e=>e.key===v),t=e&&A(e.dimension);return c.createElement(c.Fragment,null,c.createElement(Gv,{variant:"h6",sx:{marginTop:3,marginBottom:2}},t?"Select Date Range":"Select Filter Values"),t?c.createElement(mU,{dateAdapter:pQ},c.createElement(jw,{sx:{display:"flex",gap:2,width:"400px"}},c.createElement($X,{label:"From Date",value:P,onChange:e=>M(e),slotProps:{textField:{size:"small",fullWidth:!0},field:{clearable:!0}}}),c.createElement($X,{label:"To Date",value:T,onChange:e=>I(e),slotProps:{textField:{size:"small",fullWidth:!0},field:{clearable:!0}}}))):c.createElement(jw,{sx:{width:"400px"}},c.createElement(sR,{items:y,selectedKeys:x,onChange:e=>S(e),label:"Choose Values",placeholder:"Select one or more values...",loading:C,helperText:x.length>0?`${x.length} value(s) selected`:"Select at least one value"})))})()),V.length>0&&c.createElement(jw,{sx:{marginTop:3}},c.createElement(Gv,{variant:"h6",sx:{marginBottom:2}},"Saved Filters"),c.createElement(jw,{sx:{display:"flex",flexDirection:"column",gap:2}},V.map(([e,t])=>{const i=A(t.dimension),a=E===e,s=O===e;let u,p,f;i&&t.values&&"object"==typeof t.values&&!Array.isArray(t.values)?(p=t.values.gte&&t.values.lte?`${t.values.gte} to ${t.values.lte}`:t.values.gte?`From ${t.values.gte}`:t.values.lte?`Until ${t.values.lte}`:"No dates",f="📅"):(u=t.values?.length||0,p=t.values?.join(", ")||"No values",f=u);const m=l[e]||t.dimensionTitle,g=!!l[e];return c.createElement(jw,{key:e},c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:1,marginBottom:a?2:0}},s?c.createElement(c.Fragment,null,c.createElement(qE,{value:F,onChange:e=>L(e.target.value),onKeyDown:t=>((e,t)=>{"Enter"===e.key?j(t):"Escape"===e.key&&B()})(t,e),size:"small",autoFocus:!0,placeholder:"Enter custom title",sx:{width:"300px"}}),c.createElement(Hk,{title:"Save",arrow:!0},c.createElement(Mv,{size:"small",onClick:()=>j(e),color:"primary"},c.createElement(oU,{fontSize:"small"}))),c.createElement(Hk,{title:"Cancel",arrow:!0},c.createElement(Mv,{size:"small",onClick:B,color:"default"},c.createElement(iU,{fontSize:"small"}))),g&&c.createElement(Hk,{title:"Reset to default",arrow:!0},c.createElement(Mv,{size:"small",onClick:()=>(e=>{d(e),D(null),L("")})(e),color:"warning"},c.createElement(aU,{fontSize:"small"})))):c.createElement(c.Fragment,null,c.createElement(Hk,{title:c.createElement("div",null,c.createElement("div",null,c.createElement("strong",null,"Path:")," ",H(t)," → ",t.dimensionTitle),c.createElement("div",null,c.createElement("strong",null,"Full Path:")," ",e),c.createElement("div",null,c.createElement("strong",null,i?"Date Range":`Values (${u})`,":")," ",p)),arrow:!0,placement:"top"},c.createElement(Nw,{badgeContent:f,color:"secondary"},c.createElement(zy,{label:m,onDelete:()=>o(e),color:"secondary",variant:"outlined",sx:{fontWeight:g?"bold":"normal",fontStyle:g?"italic":"normal"}}))),c.createElement(Hk,{title:"Rename filter",arrow:!0},c.createElement(Mv,{size:"small",onClick:()=>((e,t)=>{D(e),L(l[e]||t||"")})(e,t.dimensionTitle),color:"primary",disabled:a},c.createElement(mH,{fontSize:"small"}))),c.createElement(Hk,{title:"Edit filter values",arrow:!0},c.createElement(Mv,{size:"small",onClick:()=>(async(e,t)=>{h(!1),R(e),A(t.dimension)?t.values&&"object"==typeof t.values&&!Array.isArray(t.values)&&(M(t.values.gte?HX(t.values.gte):null),I(t.values.lte?HX(t.values.lte):null)):(S(t.values||[]),await _(e))})(e,t),color:"primary",disabled:a},c.createElement(pU,{fontSize:"small"}))))),a&&c.createElement(qg,{sx:{padding:2,marginLeft:2}},c.createElement(Gv,{variant:"subtitle2",sx:{marginBottom:1}},"Edit Filter ",i?"Date Range":"Values"," for: ",t.dimensionTitle),i?c.createElement(mU,{dateAdapter:pQ},c.createElement(jw,{sx:{display:"flex",gap:2,width:"400px",marginBottom:2}},c.createElement($X,{label:"From Date",value:P,onChange:e=>M(e),slotProps:{textField:{size:"small",fullWidth:!0},field:{clearable:!0}}}),c.createElement($X,{label:"To Date",value:T,onChange:e=>I(e),slotProps:{textField:{size:"small",fullWidth:!0},field:{clearable:!0}}}))):c.createElement(jw,{sx:{width:"400px",marginBottom:2}},c.createElement(sR,{items:y,selectedKeys:x,onChange:e=>S(e),label:"Choose Values",placeholder:"Select one or more values...",loading:C,helperText:x.length>0?`${x.length} value(s) selected`:"Select at least one value"})),c.createElement(jw,{sx:{display:"flex",gap:1}},c.createElement(Xw,{variant:"outlined",size:"small",onClick:z},"Cancel"),c.createElement(Xw,{variant:"contained",size:"small",onClick:()=>(e=>{const t=n[e];if(A(t.dimension)){if(!P&&!T)return;const n={};P&&(n.gte=P.format("YYYY-MM-DD")),T&&(n.lte=T.format("YYYY-MM-DD"));const o={...t,values:n};r(e,o)}else{if(0===x.length)return;const n={...t,values:x};r(e,n)}R(null),w([]),S([]),M(null),I(null)})(e),disabled:i?!P&&!T:0===x.length},"Save Changes"))))}))))},hQ=({reportData:e,dimensions:t,metrics:n,loading:r,onPageChange:o,totalRows:i=0,titleOverrides:a={dimensions:{},metrics:{}}})=>{const[l,u]=s.useState({page:0,pageSize:50}),d=c.useMemo(()=>{const e=[];return t.forEach(t=>{let n,r;if(t.relations&&t.relations.length>0){const e=t.fullPath.split("."),r=e[0],o=e[1],i=r.split("_");i.shift();const a=i.join("_");n=a?`${a}_${o}`:o}else n=t.fullPath.replace(".","_");r=a.dimensions[t.fullPath]||t.dimensionTitle||n,e.push({field:n,headerName:r,flex:1,minWidth:150})}),n.forEach(t=>{const n=t.metric;let r,o;if(t.relations&&t.relations.length>0){const e=t.fullPath.split("."),n=e[0],o=e[1],i=n.split("_");i.shift();const a=i.join("_");r=a?`${a}_${o}`:o}else r=t.metricName;o=a.metrics[t.fullPath]||t.metricTitle||r,e.push({field:r,headerName:o,flex:1,minWidth:150,type:"integer"===n?.type||"currency"===n?.type?"number":"string",valueFormatter:e=>{if(null==e)return"";if(n?.format){const t=pl(e).format(n.format);return n?.prefix?`${n.prefix} ${t}`:t}return e}})}),e},[t,n,a]),p=c.useMemo(()=>e&&Array.isArray(e)?e.map((e,t)=>({id:t,...e})):[],[e]);return r?c.createElement(jw,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400},c.createElement(Cv,null)):e&&0!==e.length?c.createElement(jw,{sx:{height:600,width:"100%"}},c.createElement(fH,{rows:p,columns:d,paginationModel:l,onPaginationModelChange:e=>{u(e),o&&e.page!==l.page&&o(e.page,e.pageSize)},pageSizeOptions:[10,25,50,100],paginationMode:"server",rowCount:i||p.length,loading:r,disableRowSelectionOnClick:!0,sx:{"& .MuiDataGrid-cell":{padding:"8px"},"& .MuiDataGrid-columnHeader":{backgroundColor:"#f5f5f5",fontWeight:"bold"}}})):c.createElement(jw,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400},c.createElement(Gv,{variant:"body1",color:"textSecondary"},"No data available. Run a report to see results."))};function mQ({children:e,value:t,index:n}){return c.createElement("div",{role:"tabpanel",hidden:t!==n,id:`report-tabpanel-${n}`,"aria-labelledby":`report-tab-${n}`},t===n&&c.createElement(jw,{sx:{py:3}},e))}const gQ=({reportDefinitionId:e,cloneData:t,autoRun:n,onBackToList:r})=>{const o=ER(),i=SR(),[a,l]=s.useState(null),[u,d]=s.useState(""),[p,f]=s.useState(""),[h,m]=s.useState({dimensions:[],metrics:[],filters:{}}),[g,v]=s.useState({dimensions:{},metrics:{},filters:{}}),[b,y]=s.useState(null),[w,x]=s.useState(!1),[S,C]=s.useState(0),[k,E]=s.useState(0),[R,P]=s.useState(50),[M,T]=s.useState(0),[I,O]=s.useState(!1),[D,F]=s.useState(!1);s.useEffect(()=>{(async()=>{const e=await jc.getProviders();console.log({providers:e}),l(e)})()},[]),s.useEffect(()=>{e&&a&&N(e)},[e,a]),s.useEffect(()=>{t&&a&&$(t)},[t,a]),s.useEffect(()=>{n&&D&&u&&h.dimensions.length>0&&B()},[n,D]);const L=(e,t,n)=>{try{const[r,o]=e.split("."),i=r.split("_");let a=n;const l=[],s=[n],c=[];for(let e=1;e<i.length;e++){const n=i[e],r=t[a];if(!r||!r.relations)return console.warn(`Provider ${a} not found or has no relations`),null;const o=r.relations.find(e=>e.alias===n);if(!o)return console.warn(`Relation with alias ${n} not found in provider ${a}`),null;l.push(o),c.push(o.name),a=o.target,s.push(a)}const u=t[a];if(!u)return console.warn(`Final provider ${a} not found`),null;const d=u.default_alias;if(!u.dimensions||!u.dimensions[d])return console.warn(`Dimensions not found for alias ${d} in provider ${a}`),null;const p=u.dimensions[d][o];return p?{dimension:p,relations:l,providerPath:s,relationNames:c,dimensionKey:o,dimensionTitle:p.title||o,fullPath:e}:(console.warn(`Dimension ${o} not found in provider ${a}, alias ${d}`),null)}catch(t){return console.warn(`Error reconstructing dimension from path ${e}:`,t),null}},A=(e,t,n)=>{try{const[r,o]=e.split("."),i=r.split("_");let a=n;const l=[],s=[n],c=[];for(let e=1;e<i.length;e++){const n=i[e],r=t[a];if(!r||!r.relations)return console.warn(`Provider ${a} not found or has no relations`),null;const o=r.relations.find(e=>e.alias===n);if(!o)return console.warn(`Relation with alias ${n} not found in provider ${a}`),null;l.push(o),c.push(o.name),a=o.target,s.push(a)}const u=t[a];if(!u)return console.warn(`Final provider ${a} not found`),null;if(!u.metrics)return console.warn(`Metrics not found in provider ${a}`),null;const d=u.metrics.find(e=>e.name===o);return d?{metric:d,relations:l,providerPath:s,relationNames:c,metricName:o,metricTitle:d.title||o,fullPath:e}:(console.warn(`Metric ${o} not found in provider ${a}`),null)}catch(t){return console.warn(`Error reconstructing metric from path ${e}:`,t),null}},N=async e=>{try{console.log("Loading report definition:",e);const t=await jc.getReportDefinition({id:e});console.log("Loaded report definition:",t),d(t.provider),f(t.title||"");const n=[],r={};if(t.definition?.doc?.query?.order_by)for(const e of t.definition.doc.query.order_by)!0===e.desc?r[e.name]="desc":r[e.name]="asc";if(t.definition?.doc?.query?.dimensions)for(const e of t.definition.doc.query.dimensions){const o=L(e,a,t.provider);o&&(o.sortOrder=r[e]||null,n.push(o))}const o=[];if(t.definition?.doc?.query?.metrics)for(const e of t.definition.doc.query.metrics){const n=A(e,a,t.provider);n&&o.push(n)}const i={dimensions:{},metrics:{},filters:{}};t.definition?.doc?.query?.titles&&(t.definition.doc.query.titles.dimensions&&(i.dimensions=t.definition.doc.query.titles.dimensions),t.definition.doc.query.titles.metrics&&(i.metrics=t.definition.doc.query.titles.metrics),t.definition.doc.query.titles.filters&&(i.filters=t.definition.doc.query.titles.filters));const l={};if(t.definition?.doc?.query?.filter){const e=t.definition.doc.query.filter;(e.and||e.or||[]).forEach(e=>{const[n,r]=Object.entries(e)[0],o=L(n,a,t.provider);o&&(l[n]={...o,values:r})})}m({dimensions:n,metrics:o,filters:l}),v(i),F(!0),console.log("Reconstructed report:",{dimensions:n,metrics:o,filters:l,titleOverrides:i})}catch(e){console.error("Error loading report definition:",e),o.error("Error loading report definition: "+(e.message||"Unknown error"))}},$=e=>{try{console.log("Loading cloned report:",e),d(e.provider),f(e.title||"");const t=[],n={};if(e.definition?.doc?.query?.order_by)for(const t of e.definition.doc.query.order_by)!0===t.desc?n[t.name]="desc":n[t.name]="asc";if(e.definition?.doc?.query?.dimensions)for(const r of e.definition.doc.query.dimensions){const o=L(r,a,e.provider);o&&(o.sortOrder=n[r]||null,t.push(o))}const r=[];if(e.definition?.doc?.query?.metrics)for(const t of e.definition.doc.query.metrics){const n=A(t,a,e.provider);n&&r.push(n)}const o={dimensions:{},metrics:{},filters:{}};e.definition?.doc?.query?.titles&&(e.definition.doc.query.titles.dimensions&&(o.dimensions=e.definition.doc.query.titles.dimensions),e.definition.doc.query.titles.metrics&&(o.metrics=e.definition.doc.query.titles.metrics),e.definition.doc.query.titles.filters&&(o.filters=e.definition.doc.query.titles.filters));const i={};if(e.definition?.doc?.query?.filter){const t=e.definition.doc.query.filter;(t.and||t.or||[]).forEach(t=>{const[n,r]=Object.entries(t)[0],o=L(n,a,e.provider);o&&(i[n]={...o,values:r})})}m({dimensions:t,metrics:r,filters:i}),v(o),console.log("Loaded cloned report:",{dimensions:t,metrics:r,filters:i,titleOverrides:o})}catch(e){console.error("Error loading cloned report:",e),o.error("Error loading cloned report: "+(e.message||"Unknown error"))}},z=(e=0,t=50)=>{const n=h.dimensions.map(e=>{const t={name:e.fullPath};return"desc"===e.sortOrder&&(t.desc=!0),t}),r=[];h.filters&&Object.keys(h.filters).length>0&&Object.entries(h.filters).forEach(([e,t])=>{t.values&&(Array.isArray(t.values)?t.values.length>0&&r.push({[e]:t.values}):"object"==typeof t.values&&r.push({[e]:t.values}))});const o=r.length>0?{and:r}:null,a={};Object.keys(g.dimensions).length>0&&(a.dimensions=g.dimensions),Object.keys(g.metrics).length>0&&(a.metrics=g.metrics),Object.keys(g.filters).length>0&&(a.filters=g.filters);const l={dimensions:h.dimensions.map(e=>e.fullPath),metrics:h.metrics.map(e=>e.fullPath),order_by:n,limit:t,offset:e*t};Object.keys(a).length>0&&(l.titles=a),o&&(l.filter=o);return{provider:u,doc:{query:l},parameters:i?.parameters||{base_currency:"EUR"}}},j=async(e,t)=>{try{x(!0);const n=z(e,t);console.log("Running report with:",n);const r=await jc.runAdHocReport({report:n});console.log("Report result:",r),y(r),r&&r.length<t?C(e*t+r.length):C((e+2)*t)}catch(e){console.error("Error running report:",e),o.error("Error running report: "+(e.message||"Unknown error")),y(null)}finally{x(!1)}},B=async()=>{E(0),await j(0,R),T(3)},_=u,H=u&&p.trim()&&(h.dimensions.length>0||h.metrics.length>0);return c.createElement(jw,{sx:{p:3}},c.createElement(jw,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2}},c.createElement("h1",null,e?"Edit Report":"Create New Report"),r&&c.createElement(Xw,{variant:"outlined",startIcon:c.createElement(xH,null),onClick:r},"Back to List")),c.createElement(jw,{sx:{mt:2,display:"flex",gap:2,alignItems:"flex-start",flexWrap:"wrap"}},c.createElement(qE,{label:"Report Title",value:p,onChange:e=>f(e.target.value),placeholder:"Enter report title",sx:{width:"300px"},size:"small"}),c.createElement(uR,{items:a?Object.keys(a).map(e=>({key:e,value:a[e].name||e})):[],value:u,label:"Select Root Provider",onChange:e=>{d(e.target.value),m({dimensions:[],metrics:[],filters:{}}),v({dimensions:{},metrics:{},filters:{}}),console.log("Selected root provider:",e.target.value)},sx:{width:"300px"},disabled:!!e}),c.createElement(Xw,{variant:"contained",onClick:B,disabled:!_,sx:{height:"40px"}},"Run Report"),c.createElement(Xw,{variant:"contained",color:"secondary",startIcon:c.createElement(CH,null),onClick:async()=>{try{x(!0);const e=z();console.log("Downloading report with:",e);const t=(new Date).toISOString().split("T")[0],n=`${(p||"report").replace(/[^a-z0-9]/gi,"_").toLowerCase()}_${t}.csv`;await jc.downloadAdHocReport({report:e,filename:n}),o.success("Report downloaded successfully!")}catch(e){console.error("Error downloading report:",e),o.error("Error downloading report: "+(e.message||"Unknown error"))}finally{x(!1)}},disabled:!_||w,sx:{height:"40px"}},"Download CSV"),c.createElement(Xw,{variant:"contained",color:"success",startIcon:c.createElement(SH,null),onClick:async()=>{if(u)if(p.trim())if(0!==h.dimensions.length||0!==h.metrics.length)try{O(!0);const t=h.dimensions.map(e=>{const t={name:e.fullPath};return"desc"===e.sortOrder&&(t.desc=!0),t}),n={};Object.keys(g.dimensions).length>0&&(n.dimensions=g.dimensions),Object.keys(g.metrics).length>0&&(n.metrics=g.metrics),Object.keys(g.filters).length>0&&(n.filters=g.filters);const i={dimensions:h.dimensions.map(e=>e.fullPath),metrics:h.metrics.map(e=>e.fullPath),order_by:t};if(Object.keys(n).length>0&&(i.titles=n),Object.keys(h.filters).length>0){const e=[];Object.entries(h.filters).forEach(([t,n])=>{n.values&&(Array.isArray(n.values)?n.values.length>0&&e.push({[t]:n.values}):"object"==typeof n.values&&e.push({[t]:n.values}))}),e.length>0&&(i.filter={and:e})}const a={query:i},l={provider:u,title:p.trim(),definition:{provider:u,doc:a,parameters:{base_currency:"EUR"}}};console.log("Saving report definition:",l),e?(await jc.updateReportDefinition({id:e,reportDefinition:l}),o.success("Report definition updated successfully!")):(await jc.createReportDefinition({reportDefinition:l}),o.success("Report definition created successfully!")),r&&r()}catch(e){console.error("Error saving report definition:",e),o.error("Error saving report definition: "+(e.message||"Unknown error"))}finally{O(!1)}else o.warning("Please add at least one dimension or metric");else o.warning("Please enter a report title");else o.warning("Please select a provider first")},disabled:!H||I,sx:{height:"40px"}},I?"Saving...":e?"Update Report":"Save Report")),u&&c.createElement(jw,{sx:{mt:4}},c.createElement(jw,{sx:{borderBottom:1,borderColor:"divider"}},c.createElement(WE,{value:M,onChange:(e,t)=>{T(t)},"aria-label":"report builder tabs"},c.createElement(Jk,{label:c.createElement(Nw,{badgeContent:h.dimensions.length,color:"primary"},c.createElement("span",{style:{marginRight:h.dimensions.length>0?"12px":"0"}},"Dimensions")),id:"report-tab-0","aria-controls":"report-tabpanel-0"}),c.createElement(Jk,{label:c.createElement(Nw,{badgeContent:h.metrics.length,color:"primary"},c.createElement("span",{style:{marginRight:h.metrics.length>0?"12px":"0"}},"Metrics")),id:"report-tab-1","aria-controls":"report-tabpanel-1"}),c.createElement(Jk,{label:c.createElement(Nw,{badgeContent:Object.keys(h.filters).length,color:"secondary"},c.createElement("span",{style:{marginRight:Object.keys(h.filters).length>0?"12px":"0"}},"Filters")),id:"report-tab-2","aria-controls":"report-tabpanel-2"}),c.createElement(Jk,{label:b?"Results":"Results (Run report first)",id:"report-tab-3","aria-controls":"report-tabpanel-3",disabled:!b}))),c.createElement(mQ,{value:M,index:0},c.createElement(cU,{providersData:a,rootProvider:u,savedDimensions:h.dimensions,onSaveDimension:e=>{m(t=>{const n={...t,dimensions:[...t.dimensions,e]};return console.log("Dimension saved:",e),console.log("Complete report:",n),n})},onRemoveDimension:e=>{m(t=>({...t,dimensions:t.dimensions.filter((t,n)=>n!==e)}))},onReorderDimensions:e=>{m(t=>({...t,dimensions:e}))},titleOverrides:g.dimensions,onUpdateTitle:(e,t)=>{v(n=>({...n,dimensions:{...n.dimensions,[e]:t}}))},onResetTitle:e=>{v(t=>{const n={...t.dimensions};return delete n[e],{...t,dimensions:n}})},existingMetrics:h.metrics,existingFilters:h.filters})),c.createElement(mQ,{value:M,index:1},c.createElement(dU,{providersData:a,rootProvider:u,savedMetrics:h.metrics,onSaveMetric:e=>{m(t=>{const n={...t,metrics:[...t.metrics,e]};return console.log("Metric saved:",e),console.log("Complete report:",n),n})},onRemoveMetric:e=>{m(t=>({...t,metrics:t.metrics.filter((t,n)=>n!==e)}))},onReorderMetrics:e=>{m(t=>({...t,metrics:e}))},titleOverrides:g.metrics,onUpdateTitle:(e,t)=>{v(n=>({...n,metrics:{...n.metrics,[e]:t}}))},onResetTitle:e=>{v(t=>{const n={...t.metrics};return delete n[e],{...t,metrics:n}})},existingDimensions:h.dimensions,existingFilters:h.filters})),c.createElement(mQ,{value:M,index:2},c.createElement(fQ,{providersData:a,rootProvider:u,savedFilters:h.filters,existingDimensions:h.dimensions,existingMetrics:h.metrics,onSaveFilter:(e,t)=>{m(n=>{const r={...n,filters:{...n.filters,[e]:t}};return console.log("Filter saved:",{fullPath:e,filterData:t}),console.log("Complete report:",r),r})},onRemoveFilter:e=>{m(t=>{const n={...t.filters};return delete n[e],{...t,filters:n}})},titleOverrides:g.filters,onUpdateTitle:(e,t)=>{v(n=>({...n,filters:{...n.filters,[e]:t}}))},onResetTitle:e=>{v(t=>{const n={...t.filters};return delete n[e],{...t,filters:n}})}})),c.createElement(mQ,{value:M,index:3},b&&c.createElement(hQ,{reportData:b,dimensions:h.dimensions,metrics:h.metrics,loading:w,onPageChange:async(e,t)=>{E(e),t!==R&&P(t),await j(e,t)},totalRows:S,titleOverrides:g}))))},vQ=()=>{const[e,t]=s.useState("list"),[n,r]=s.useState(null),[o,i]=s.useState(null),[a,l]=s.useState(!1),[u,d]=s.useState(0),p=e=>{r(e),i(null),l(!1),t("builder")},f=()=>{r(null),i(null),l(!1),t("builder")},h=e=>{r(e),i(null),l(!0),t("builder")},m=e=>{r(null),i(e),l(!1),t("builder")};return"list"===e?c.createElement(wH,{onSelectReport:p,onAddNew:f,onCloneReport:m,onRunReport:h,refreshTrigger:u}):c.createElement(gQ,{reportDefinitionId:n,cloneData:o,autoRun:a,onBackToList:()=>{r(null),i(null),l(!1),t("list"),d(e=>e+1)}})};var bQ={Chart:yR,Dashboard:function({id:e="sample_dashboard",api:t,params:n}){const r=SR(),o=t||r?.api||{},i=n||r?.parameters||{},[a,l]=c.useState(),[u]=c.useState(),[d,p]=c.useState([]),f=c.useRef({}),h=vR();bR(h),console.log({rows:d},{dashboard:a},{schema:u},{params:i}),s.useEffect(()=>{jc.setBaseUrl(o.base_url),jc.setToken(o.token)},[o]);const m=async e=>{const t=e?.doc?.rows||[],n=[];for(let e=0;e<t.length;e++){const r=t[e];r.columns?.forEach(e=>{if(e.override?.filter?.length){const t={};e.override.filter.forEach(e=>{e.hasOwnProperty("value")&&(t[e.field]=[e.value])}),e.filter=t}}),n.push(r)}p(n)};return c.useEffect(()=>{e&&(async()=>{jc.setBaseUrl(o.base_url),jc.setToken(o.token),await jc.loadDashboardMeta({dashboardId:e});const t=await jc.getDashboard({id:e});f.current[t?.id]=t,l(t),await m(t)})().catch(e=>console.error(e.message))},[e]),c.createElement(mi,{maxWidth:!1,disableGutters:!0},c.createElement(qi,{container:!0,spacing:3},d?.map((e,t)=>{const n=(e=>0===e?12:12/e)(e.columns.length);return c.createElement(c.Fragment,{key:t},1===t?c.createElement(qi,{item:!0,xs:12},c.createElement(qi,{container:!0,spacing:3},e.columns.map((e,t)=>c.createElement(qi,{key:t,item:!0,xs:12,md:n},c.createElement(yR,{api:o,cache:f.current,id:e.id,dashboard:a,schema:u,title:e.title,filter:e.filter,params:i}))))):e.columns.map((e,t)=>c.createElement(qi,{key:t,item:!0,xs:12,md:n},c.createElement(yR,{api:o,cache:f.current,id:e.id,dashboard:a,schema:u,title:e.title,filter:e.filter,params:i}))))})))},ReportApp:({params:e,api:t})=>(jc._initialized||(jc.setBaseUrl(t.base_url),jc.setToken(t.token),jc._initialized=!0),s.useEffect(()=>{jc.setBaseUrl(t.base_url),jc.setToken(t.token)},[t]),c.createElement(kR,null,c.createElement(xR,{defaultParameters:e,defaultApi:t},c.createElement(vQ,null))))};return bQ}();
257
+ `,Lz=TR(function(e,t){const{children:n}=e,r=d(e,Iz);return Xp.jsx(Fz,f({},r,{ref:t,children:n}))}),Az=new Intl.Collator;const Nz=pg("div",{name:"MuiDataGrid",slot:"ColumnsManagement"})({display:"flex",flexDirection:"column",padding:bP.spacing(.5,1.5)}),$z=pg(Lz,{name:"MuiDataGrid",slot:"ColumnsManagementScrollArea"})({maxHeight:300}),zz=pg("div",{name:"MuiDataGrid",slot:"ColumnsManagementHeader"})({padding:bP.spacing(1.5,2),borderBottom:`1px solid ${bP.colors.border.base}`}),jz=pg(gI,{name:"MuiDataGrid",slot:"ColumnsManagementSearchInput"})({[`& .${Yy.input}::-webkit-search-decoration,\n & .${Yy.input}::-webkit-search-cancel-button,\n & .${Yy.input}::-webkit-search-results-button,\n & .${Yy.input}::-webkit-search-results-decoration`]:{display:"none"}}),Bz=pg("div",{name:"MuiDataGrid",slot:"ColumnsManagementFooter"})({padding:bP.spacing(1,1,1,1.5),display:"flex",justifyContent:"space-between",borderTop:`1px solid ${bP.colors.border.base}`}),_z=pg("div",{name:"MuiDataGrid",slot:"ColumnsManagementEmptyText"})({padding:bP.spacing(1,0),alignSelf:"center",font:bP.typography.font.body}),Hz=pg(gI,{name:"MuiDataGrid",slot:"ColumnsManagementRow"})({}),Vz=TR(function(e,t){const{children:n,slotProps:r={}}=e,o=r.button||{},i=r.tooltip||{},a=lP(),l=rP(),c=mm(),u=mm(),[d,p]=s.useState(!1),h=s.useRef(null),m=Tg(t,h),g=()=>p(!1);return null==n?null:Xp.jsxs(s.Fragment,{children:[Xp.jsx(l.slots.baseTooltip,f({title:a.current.getLocaleText("toolbarExportLabel"),enterDelay:1e3},l.slotProps?.baseTooltip,i,{children:Xp.jsx(l.slots.baseButton,f({size:"small",startIcon:Xp.jsx(l.slots.exportIcon,{}),"aria-expanded":d,"aria-label":a.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-controls":d?u:void 0,id:c},l.slotProps?.baseButton,o,{onClick:e=>{p(e=>!e),o.onClick?.(e)},ref:m,children:a.current.getLocaleText("toolbarExport")}))})),Xp.jsx(UO,{open:d,target:h.current,onClose:g,position:"bottom-end",children:Xp.jsx(l.slots.baseMenuList,{id:u,className:XT.menuList,"aria-labelledby":c,autoFocusItem:d,children:s.Children.map(n,e=>s.isValidElement(e)?s.cloneElement(e,{hideMenu:g}):e)})})]})}),Wz=["hideMenu","options"],Uz=["hideMenu","options"],Gz=["csvOptions","printOptions","excelOptions"];function Kz(e){const t=lP(),n=rP(),{hideMenu:r,options:o}=e,i=d(e,Wz);return Xp.jsx(n.slots.baseMenuItem,f({onClick:()=>{t.current.exportDataAsCsv(o),r?.()}},i,{children:t.current.getLocaleText("toolbarExportCSV")}))}function qz(e){const t=lP(),n=rP(),{hideMenu:r,options:o}=e,i=d(e,Uz);return Xp.jsx(n.slots.baseMenuItem,f({onClick:()=>{t.current.exportDataAsPrint(o),r?.()}},i,{children:t.current.getLocaleText("toolbarExportPrint")}))}TR(function(e,t){const n=e,{csvOptions:r={},printOptions:o={},excelOptions:i}=n,a=d(n,Gz),l=lP().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:i,csvOptions:r,printOptions:o}).sort((e,t)=>e.componentName>t.componentName?1:-1);return 0===l.length?null:Xp.jsx(Vz,f({},a,{ref:t,children:l.map((e,t)=>s.cloneElement(e.component,{key:t}))}))});const Yz=s.createContext(void 0);function Xz(){const e=s.useContext(Yz);if(void 0===e)throw new Error("MUI X: Missing context. Quick Filter subcomponents must be placed within a <QuickFilter /> component.");return e}const Qz=["render","className","parser","formatter","debounceMs","defaultExpanded","expanded","onExpandedChange"],Zz=e=>e.split(" ").filter(e=>""!==e),Jz=e=>e.join(" ");function ej(e){const t=rP(),{render:n,className:r,parser:o=Zz,formatter:i=Jz,debounceMs:a=t.filterDebounceMs,defaultExpanded:l,expanded:c,onExpandedChange:u}=e,p=d(e,Qz),h=lP(),m=s.useRef(null),g=s.useRef(null),v=pI(h,wD),[b,y]=s.useState(i(v??[])),[w,x]=s.useState(l??b.length>0),S=c??w,C=s.useMemo(()=>({value:b,expanded:S}),[b,S]),k="function"==typeof r?r(C):r,E=s.useRef(null),R=mm(),P=s.useCallback(e=>{u&&u(e),void 0===c&&x(e)},[u,c]),M=s.useRef(v);s.useEffect(()=>{JL(M.current,v)||(M.current=v,y(e=>JL(o(e),v)?e:i(v??[])))},[v,i,o]);const T=s.useRef(!0),I=s.useRef(S);s.useEffect(()=>{T.current?T.current=!1:I.current!==S&&(S?requestAnimationFrame(()=>{m.current?.focus({preventScroll:!0})}):g.current?.focus({preventScroll:!0}),I.current=S)},[S]);const O=s.useMemo(()=>Cg(e=>{const t=o(e);M.current=t,h.current.setQuickFilterValues(t)},a),[h,a,o]);s.useEffect(()=>O.clear,[O]);const D=s.useCallback(e=>{const t=e.target.value;y(t),O(t)},[O]),F=s.useCallback(()=>{y(""),h.current.setQuickFilterValues([]),m.current?.focus()},[h,m]),L=s.useMemo(()=>({controlRef:m,triggerRef:g,state:C,controlId:R,clearValue:F,onValueChange:D,onExpandedChange:P}),[R,C,D,F,P]);Wh(()=>{E.current&&g.current&&E.current.style.setProperty("--trigger-width",`${g.current?.offsetWidth}px`)},[]);const A=o$("div",n,f({className:k},p,{ref:E}),C);return Xp.jsx(Yz.Provider,{value:L,children:A})}const tj=["render","className","slotProps","onKeyDown","onChange"],nj=TR(function(e,t){const{render:n,className:r,slotProps:o,onKeyDown:i,onChange:a}=e,l=d(e,tj),c=rP(),{state:u,controlId:p,controlRef:h,onValueChange:m,onExpandedChange:g,clearValue:v}=Xz(),b="function"==typeof r?r(u):r,y=Tg(h,t),w=o$(c.slots.baseTextField,n,f({},c.slotProps?.baseTextField,{slotProps:f({htmlInput:f({role:"searchbox",id:p,tabIndex:u.expanded?void 0:-1},o?.htmlInput,{onBlur:e=>{""===u.value&&g(!1),o?.htmlInput?.onBlur?.(e)}})},o),value:u.value,className:b},l,{onChange:e=>{u.expanded||g(!0),m(e),a?.(e)},onKeyDown:e=>{"Escape"===e.key&&(""===u.value?g(!1):v()),i?.(e)},ref:y}),u);return Xp.jsx(s.Fragment,{children:w})}),rj=["render","className","onClick"],oj=TR(function(e,t){const{render:n,className:r,onClick:o}=e,i=d(e,rj),a=rP(),{state:l,clearValue:c}=Xz(),u="function"==typeof r?r(l):r,p=o$(a.slots.baseIconButton,n,f({},a.slotProps?.baseIconButton,{className:u,tabIndex:-1},i,{onClick:e=>{c(),o?.(e)},ref:t}),l);return Xp.jsx(s.Fragment,{children:p})}),ij=["render","className","onClick"],aj=TR(function(e,t){const{render:n,className:r,onClick:o}=e,i=d(e,ij),a=rP(),{state:l,controlId:c,onExpandedChange:u,triggerRef:p}=Xz(),h="function"==typeof r?r(l):r,m=Tg(p,t),g=o$(a.slots.baseButton,n,f({},a.slotProps?.baseButton,{className:h,"aria-controls":c,"aria-expanded":l.expanded},i,{onClick:e=>{u(!l.expanded),o?.(e)},ref:m}),l);return Xp.jsx(s.Fragment,{children:g})}),lj=["quickFilterParser","quickFilterFormatter","debounceMs","className","slotProps"],sj=["ref","slotProps"],cj=jh("div",{name:"MuiDataGrid",slot:"ToolbarQuickFilter"})({display:"grid",alignItems:"center"}),uj=jh(d$,{name:"MuiDataGrid",slot:"ToolbarQuickFilterTrigger"})(({ownerState:e})=>({gridArea:"1 / 1",width:"min-content",height:"min-content",zIndex:1,opacity:e.expanded?0:1,pointerEvents:e.expanded?"none":"auto",transition:bP.transition(["opacity"])})),dj=jh(e=>{throw new Error("Failed assertion: should not be rendered")},{name:"MuiDataGrid",slot:"ToolbarQuickFilterControl"})(({ownerState:e})=>({gridArea:"1 / 1",overflowX:"clip",width:e.expanded?260:"var(--trigger-width)",opacity:e.expanded?1:0,transition:bP.transition(["width","opacity"])}));function pj(e){const t=lP(),n=rP(),r={classes:n.classes,expanded:!1},o=(e=>{const{classes:t}=e;return wm({root:["toolbarQuickFilter"],trigger:["toolbarQuickFilterTrigger"],control:["toolbarQuickFilterControl"]},YT,t)})(r),{quickFilterParser:i,quickFilterFormatter:a,debounceMs:l,className:s,slotProps:c}=e,u=d(e,lj);return Xp.jsx(ej,{parser:i,formatter:a,debounceMs:l,render:(e,i)=>{const a=f({},r,{expanded:i.expanded});return Xp.jsxs(cj,f({},e,{className:PR(o.root,s),children:[Xp.jsx(aj,{render:e=>Xp.jsx(n.slots.baseTooltip,{title:t.current.getLocaleText("toolbarQuickFilterLabel"),enterDelay:0,children:Xp.jsx(uj,f({className:o.trigger},e,{ownerState:a,color:"default","aria-disabled":i.expanded,children:Xp.jsx(n.slots.quickFilterIcon,{fontSize:"small"})}))})}),Xp.jsx(nj,{render:e=>{let{ref:r,slotProps:i}=e,l=d(e,sj);return Xp.jsx(dj,f({as:n.slots.baseTextField,className:o.control,ownerState:a,inputRef:r,"aria-label":t.current.getLocaleText("toolbarQuickFilterLabel"),placeholder:t.current.getLocaleText("toolbarQuickFilterPlaceholder"),size:"small",slotProps:f({input:f({startAdornment:Xp.jsx(n.slots.quickFilterIcon,{fontSize:"small"}),endAdornment:l.value?Xp.jsx(oj,{render:Xp.jsx(n.slots.baseIconButton,{size:"small",edge:"end","aria-label":t.current.getLocaleText("toolbarQuickFilterDeleteIconLabel"),children:Xp.jsx(n.slots.quickFilterClearIcon,{fontSize:"small"})})}):null},i?.input)},i)},n.slotProps?.baseTextField,l,c?.root,u))}})]}))}})}const fj=["render","className","onClick","onPointerUp"],hj=TR(function(e,t){const{render:n,className:r,onClick:o,onPointerUp:i}=e,a=d(e,fj),l=rP(),c=mm(),u=mm(),p=lP(),h=pI(p,KL),m=h.open&&h.openedPanelValue===YL.filters,g=pI(p,OD).length,v={open:m,filterCount:g},b="function"==typeof r?r(v):r,{filterPanelTriggerRef:y}=UN(),w=Tg(t,y),x=o$(l.slots.baseButton,n,f({},l.slotProps?.baseButton,{id:c,"aria-haspopup":"true","aria-expanded":m?"true":void 0,"aria-controls":m?u:void 0,onClick:e=>{m?p.current.hidePreferences():p.current.showPreferences(YL.filters,u,c),o?.(e)},onPointerUp:e=>{m&&e.stopPropagation(),i?.(e)},className:b},a,{ref:w}),v);return Xp.jsx(s.Fragment,{children:x})}),mj=["render","className","onClick","onPointerUp"],gj=TR(function(e,t){const{render:n,className:r,onClick:o,onPointerUp:i}=e,a=d(e,mj),l=rP(),c=mm(),u=mm(),p=lP(),h=pI(p,KL),m=h.open&&h.openedPanelValue===YL.columns,g={open:m},v="function"==typeof r?r(g):r,{columnsPanelTriggerRef:b}=UN(),y=Tg(t,b),w=o$(l.slots.baseButton,n,f({},l.slotProps?.baseButton,{id:c,"aria-haspopup":"true","aria-expanded":m?"true":void 0,"aria-controls":m?u:void 0,className:v},a,{onPointerUp:e=>{m&&e.stopPropagation(),i?.(e)},onClick:e=>{m?p.current.hidePreferences():p.current.showPreferences(YL.columns,u,c),o?.(e)},ref:y}),g);return Xp.jsx(s.Fragment,{children:w})}),vj=["render","options","onClick"],bj=TR(function(e,t){const{render:n,options:r,onClick:o}=e,i=d(e,vj),a=rP(),l=lP(),c=o$(a.slots.baseButton,n,f({},a.slotProps?.baseButton,{onClick:e=>{l.current.exportDataAsCsv(r),o?.(e)}},i,{ref:t}));return Xp.jsx(s.Fragment,{children:c})}),yj=["render","options","onClick"],wj=TR(function(e,t){const{render:n,options:r,onClick:o}=e,i=d(e,yj),a=rP(),l=lP(),c=o$(a.slots.baseButton,n,f({},a.slotProps?.baseButton,{onClick:e=>{l.current.exportDataAsPrint(r),o?.(e)}},i,{ref:t}));return Xp.jsx(s.Fragment,{children:c})}),xj=["className"],Sj=["className"],Cj=["showQuickFilter","quickFilterProps","csvOptions","printOptions","additionalItems","additionalExportMenuItems"],kj=e=>{const{classes:t}=e;return wm({divider:["toolbarDivider"],label:["toolbarLabel"]},YT,t)},Ej=jh(gI,{name:"MuiDataGrid",slot:"ToolbarDivider"})({height:"50%",margin:bP.spacing(0,.5)}),Rj=jh("span",{name:"MuiDataGrid",slot:"ToolbarLabel"})({flex:1,font:bP.typography.font.large,fontWeight:bP.typography.fontWeight.medium,margin:bP.spacing(0,.5),textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"});function Pj(e){const t=d(e,xj),n=rP(),r=kj(n);return Xp.jsx(Ej,f({as:n.slots.baseDivider,orientation:"vertical",className:r.divider},t))}function Mj(e){const t=d(e,Sj),n=rP(),r=kj(n);return Xp.jsx(Rj,f({className:r.label},t))}const Tj=["className","selectedRowCount"],Ij=jh("div",{name:"MuiDataGrid",slot:"SelectedRowCount"})({alignItems:"center",display:"flex",margin:bP.spacing(0,2),visibility:"hidden",width:0,height:0,[bP.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}}),Oj=TR(function(e,t){const{className:n,selectedRowCount:r}=e,o=d(e,Tj),i=lP(),a=rP(),l=(e=>{const{classes:t}=e;return wm({root:["selectedRowCount"]},YT,t)})(a),s=i.current.getLocaleText("footerRowSelected")(r);return Xp.jsx(Ij,f({className:PR(l.root,n),ownerState:a},o,{ref:t,children:s}))}),Dj=TR(function(e,t){const n=lP(),r=rP(),o=pI(n,yT),i=pI(n,ND),a=pI(n,TD),l=!r.hideFooterSelectedRowCount&&i>0?Xp.jsx(Oj,{selectedRowCount:i}):Xp.jsx("div",{}),s=r.hideFooterRowCount||r.pagination?null:Xp.jsx(r.slots.footerRowCount,f({},r.slotProps?.footerRowCount,{rowCount:o,visibleRowCount:a})),c=r.pagination&&!r.hideFooterPagination&&r.slots.pagination&&Xp.jsx(r.slots.pagination,f({},r.slotProps?.pagination));return Xp.jsxs(e$,f({},e,{ref:t,children:[l,s,c]}))}),Fj=(e,t,n,r,o,i)=>{let a;switch(e){case nD.LEFT:a=r[n];break;case nD.RIGHT:a=o-r[n]-t+i;break;default:a=void 0}return Number.isNaN(a)&&(a=void 0),a},Lj=(e,t,n,r,o,i)=>{const a=t===n-1;return!(!i?.startsWith("border")||e!==nD.LEFT||!a)||!!r&&(e===nD.LEFT||(e===nD.RIGHT?!a:!a||o))},Aj=(e,t,n,r)=>r?.startsWith("border")?e===nD.RIGHT&&0===t:n&&e===nD.RIGHT&&0===t,Nj=["skeletonRowsCount","visibleColumns","showFirstRowBorder"],$j=jh("div",{name:"MuiDataGrid",slot:"SkeletonLoadingOverlay"})({minWidth:"100%",width:"max-content",height:"100%",overflow:"clip"}),zj=e=>parseInt(e.getAttribute("data-colindex"),10),jj=TR(function(e,t){const n=rP(),{slots:r}=n,o=um(),i=(e=>{const{classes:t}=e;return wm({root:["skeletonLoadingOverlay"]},YT,t)})({classes:n.classes}),a=s.useRef(null),l=Tg(a,t),c=lP(),u=pI(c,oT),p=pI(c,iT),h=pI(c,hO),m=s.useMemo(()=>h.filter(e=>e<=p).length,[p,h]),{skeletonRowsCount:g,visibleColumns:v,showFirstRowBorder:b}=e,y=d(e,Nj),w=pI(c,cO),x=s.useMemo(()=>w.slice(0,m),[w,m]),S=pI(c,pO),C=s.useCallback(e=>-1!==S.left.findIndex(t=>t.field===e)?nD.LEFT:-1!==S.right.findIndex(t=>t.field===e)?nD.RIGHT:void 0,[S.left,S.right]),k=s.useMemo(()=>{const e=[];for(let t=0;t<g;t+=1){const i=[];for(let e=0;e<x.length;e+=1){const a=x[e],l=C(a.field),s=l===nD.LEFT,c=l===nD.RIGHT,d=kN(l,o),p=d?S[d].length:x.length-S.left.length-S.right.length,m=d?S[d].findIndex(e=>e.field===a.field):e-S.left.length,g=u.hasScrollY?u.scrollbarSize:0,b=EN({},o,l,Fj(l,a.computedWidth,e,h,u.columnsTotalWidth,g)),y=u.columnsTotalWidth<u.viewportOuterSize.width,w=Lj(l,m,p,n.showCellVerticalBorder,y,n.pinnedColumnsSectionSeparator),k=Aj(l,m,n.showCellVerticalBorder,n.pinnedColumnsSectionSeparator),E=c&&0===m,R=E&&y,P=e===x.length-1&&!E&&y,M=u.viewportOuterSize.width-u.columnsTotalWidth,T=Math.max(0,M),I=Xp.jsx(r.skeletonCell,{width:T,empty:!0},`skeleton-filler-column-${t}`);R&&i.push(I),i.push(Xp.jsx(r.skeletonCell,{field:a.field,type:a.type,align:a.align,width:"var(--width)",height:u.rowHeight,"data-colindex":e,empty:v&&!v.has(a.field),className:PR(s&&XT["cell--pinnedLeft"],c&&XT["cell--pinnedRight"],w&&XT["cell--withRightBorder"],k&&XT["cell--withLeftBorder"]),style:f({"--width":`${a.computedWidth}px`},b)},`skeleton-column-${t}-${a.field}`)),P&&i.push(I)}e.push(Xp.jsx("div",{className:PR(XT.row,XT.rowSkeleton,0===t&&!b&&XT["row--firstVisible"]),children:i},`skeleton-row-${t}`))}return e},[g,x,C,o,S,u.hasScrollY,u.scrollbarSize,u.columnsTotalWidth,u.viewportOuterSize.width,u.rowHeight,h,n.showCellVerticalBorder,n.pinnedColumnsSectionSeparator,r,v,b]);return rI(c,"columnResize",e=>{const{colDef:t,width:n}=e,r=a.current?.querySelectorAll(`[data-field="${m$(t.field)}"]`);if(!r)throw new Error("MUI X: Expected skeleton cells to be defined with `data-field` attribute.");const o=x.findIndex(e=>e.field===t.field),i=C(t.field),l=i===nD.LEFT,s=i===nD.RIGHT,c=getComputedStyle(r[0]).getPropertyValue("--width"),u=parseInt(c,10)-n;if(r&&r.forEach(e=>{e.style.setProperty("--width",`${n}px`)}),l){const e=a.current?.querySelectorAll(`.${XT["cell--pinnedLeft"]}`);e?.forEach(e=>{zj(e)>o&&(e.style.left=parseInt(getComputedStyle(e).left,10)-u+"px")})}if(s){const e=a.current?.querySelectorAll(`.${XT["cell--pinnedRight"]}`);e?.forEach(e=>{zj(e)<o&&(e.style.right=`${parseInt(getComputedStyle(e).right,10)+u}px`)})}}),Xp.jsx($j,f({className:i.root},y,{ref:l,children:k}))}),Bj=TR(function(e,t){const n=pI(lP(),oT),r=n?.viewportInnerSize.height??0,o=Math.ceil(r/n.rowHeight);return Xp.jsx(jj,f({},e,{skeletonRowsCount:o,ref:t}))}),_j=["variant","noRowsVariant","style"],Hj={"circular-progress":{component:e=>e.slots.baseCircularProgress,style:{}},"linear-progress":{component:e=>e.slots.baseLinearProgress,style:{display:"block"}},skeleton:{component:()=>Bj,style:{display:"block"}}},Vj=TR(function(e,t){const{variant:n="linear-progress",noRowsVariant:r="skeleton",style:o}=e,i=d(e,_j),a=lP(),l=rP(),s=pI(a,vT),c=Hj[0===s?r:n],u=c.component(l);return Xp.jsx(r$,f({style:f({},c.style,o)},i,{ref:t,children:Xp.jsx(u,{})}))}),Wj=TR(function(e,t){const n=lP().current.getLocaleText("noRowsLabel");return Xp.jsx(r$,f({},e,{ref:t,children:n}))}),Uj=TR(function(e,t){const n=rP(),r=lP(),o=pI(r,oO),i=!n.disableColumnSelector&&o.length>0;return Xp.jsxs(r$,f({},e,{ref:t,children:[r.current.getLocaleText("noColumnsOverlayLabel"),i&&Xp.jsx(n.slots.baseButton,f({size:"small"},n.slotProps?.baseButton,{onClick:()=>{r.current.showPreferences(YL.columns)},children:r.current.getLocaleText("noColumnsOverlayManageColumns")}))]}))}),Gj=pg(gI)({maxHeight:"calc(100% + 1px)",flexGrow:1});const Kj=["className","rowCount","visibleRowCount"],qj=jh("div",{name:"MuiDataGrid",slot:"RowCount"})({alignItems:"center",display:"flex",margin:bP.spacing(0,2)}),Yj=TR(function(e,t){const{className:n,rowCount:r,visibleRowCount:o}=e,i=d(e,Kj),a=lP(),l=rP(),s=(e=>{const{classes:t}=e;return wm({root:["rowCount"]},YT,t)})(l);if(0===r)return null;const c=o<r?a.current.getLocaleText("footerTotalVisibleRows")(o,r):r.toLocaleString();return Xp.jsxs(qj,f({className:PR(s.root,n),ownerState:l},i,{ref:t,children:[a.current.getLocaleText("footerTotalRows")," ",c]}))});const Xj=nT(e=>e.rowReorder),Qj=eT(Xj,e=>e?.isActive??!1),Zj=eT(Xj,e=>e?.dropTarget??{rowId:null,position:null});eT(Zj,e=>e.rowId??null);const Jj=eT(Zj,(e,t)=>e.rowId===t?e.position:null);eT(Xj,e=>e?.draggedRowId??null);const eB=pg("div",{name:"MuiDataGrid",slot:"RowDragOverlay",shouldForwardProp:e=>Oh(e)&&"action"!==e})(({theme:e,action:t})=>f({position:"absolute",left:0,right:0,top:0,bottom:0,pointerEvents:"none",zIndex:1},"above"===t&&{"&::before":{pointerEvents:"none",content:'""',position:"absolute",top:0,left:0,right:0,height:"2px",backgroundColor:(e.vars||e).palette.primary.main}},"below"===t&&{"&::after":{pointerEvents:"none",content:'""',position:"absolute",bottom:"-2px",left:0,right:0,height:"2px",backgroundColor:(e.vars||e).palette.primary.main}},"inside"===t&&{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.1)`:tm(e.palette.primary.main,.1)})),tB=s.memo(function(e){const{rowId:t,className:n}=e,r=pI(mL(),Jj,t);return r?Xp.jsx(eB,{action:r,className:n}):null}),nB=["selected","rowId","row","index","style","rowHeight","className","visibleColumns","pinnedColumns","offsetLeft","columnsTotalWidth","firstColumnIndex","lastColumnIndex","focusedColumnIndex","isFirstVisible","isLastVisible","isNotVisible","showBottomBorder","scrollbarWidth","gridHasFiller","onClick","onDoubleClick","onMouseEnter","onMouseLeave","onMouseOut","onMouseOver"],rB=eT(WL,(e,{rowReordering:t,treeData:n})=>{if(!t||n)return!1;return!!pD(e)}),oB=TR(function(e,t){const{selected:n,rowId:r,row:o,index:i,style:a,rowHeight:l,className:c,visibleColumns:u,pinnedColumns:p,offsetLeft:h,columnsTotalWidth:m,firstColumnIndex:g,lastColumnIndex:v,focusedColumnIndex:b,isFirstVisible:y,isLastVisible:w,isNotVisible:x,showBottomBorder:S,scrollbarWidth:C,gridHasFiller:k,onClick:E,onDoubleClick:R,onMouseEnter:P,onMouseLeave:M,onMouseOut:T,onMouseOver:I}=e,O=d(e,nB),D=mL(),F=jO(),L=s.useRef(null),A=rP(),N=sN(D),$=pI(D,gD),z=pI(D,hO),j=A.rowReordering,B=A.treeData,_=pI(D,rB,{rowReordering:j,treeData:B}),H=pI(D,Qj),V=Tg(L,t),W=ST(D,r),U=pI(D,UL,{rowId:r,editMode:A.editMode}),G=A.editMode===$I.Row,K=void 0!==b,q=K&&b>=p.left.length&&b<g,Y=K&&b<u.length-p.right.length&&b>=v,X=function(e,t){return wm(t,YT,e)}(A.classes,{root:["row",n&&"selected",G&&"row--editable",U&&"row--editing",y&&"row--firstVisible",w&&"row--lastVisible",S&&"row--borderBottom","auto"===l&&"row--dynamicHeight"]}),Q=F.hooks.useGridRowAriaAttributes();s.useLayoutEffect(()=>{if(N.range){const e=D.current.getRowIndexRelativeToVisibleRows(r);void 0!==e&&D.current.unstable_setLastMeasuredRowIndex(e)}if(L.current&&"auto"===l)return D.current.observeRowHeight(L.current,r)},[D,N.range,l,r]);const Z=s.useCallback((e,t)=>n=>{v$(n)||D.current.getRow(r)&&(D.current.publishEvent(e,D.current.getRowParams(r),n),t&&t(n))},[D,r]),J=s.useCallback(e=>{const t=h$(e.target,XT.cell),n=t?.getAttribute("data-field");if(n){if(n===wF.field)return;if(n===tD)return;if("__reorder__"===n)return;if(D.current.getCellMode(r,n)===zI.Edit)return;const e=D.current.getColumn(n);if(e?.type===ZO)return}Z("rowClick",E)(e)},[D,E,Z,r]),{slots:ee,slotProps:te,disableColumnReorder:ne}=A,re=pI(D,()=>f({},D.current.getRowHeightEntry(r)),void 0,lI),oe=s.useMemo(()=>{if(x)return{opacity:0,width:0,height:0};const e=f({},a,{maxHeight:"auto"===l?"none":l,minHeight:l,"--height":"number"==typeof l?`${l}px`:l});if(re.spacingTop){e["border"===A.rowSpacingType?"borderTopWidth":"marginTop"]=re.spacingTop}if(re.spacingBottom){const t="border"===A.rowSpacingType?"borderBottomWidth":"marginBottom";let n=e[t];"number"!=typeof n&&(n=parseInt(n||"0",10)),n+=re.spacingBottom,e[t]=n}return e},[x,l,a,re.spacingTop,re.spacingBottom,A.rowSpacingType]);if(!W)return null;const ie=D.current.unstable_applyPipeProcessors("rowClassName",[],r),ae=Q(W,i);if("function"==typeof A.getRowClassName){const e=i-(N.range?.firstRowIndex||0),t=f({},D.current.getRowParams(r),{isFirstVisible:0===e,isLastVisible:e===N.rows.length-1,indexRelativeToCurrentPage:e});ie.push(A.getRowClassName(t))}const le=(e,t,n,i,a=nD.NONE)=>{const s=D.current.unstable_getCellColSpanInfo(r,n);if(s?.spannedByColSpan)return null;const c=s?.cellProps.width??e.computedWidth,u=s?.cellProps.colSpan??1,d=Fj(a,e.computedWidth,n,z,m,C);if("skeletonRow"===W.type)return Xp.jsx(ee.skeletonCell,{type:e.type,width:c,height:l,field:e.field,align:e.align},e.field);const p="__reorder__"===e.field,h=!(ne||e.disableReorder),g=_&&!$.length,v=!(h||p&&g||H),b=a===nD.VIRTUAL,y=Aj(a,t,A.showCellVerticalBorder,A.pinnedColumnsSectionSeparator),w=Lj(a,t,i,A.showCellVerticalBorder,k,A.pinnedColumnsSectionSeparator);return Xp.jsx(ee.cell,f({column:e,width:c,rowId:r,align:e.align||"left",colIndex:n,colSpan:u,disableDragEvents:v,isNotVisible:b,pinnedOffset:d,pinnedPosition:a,showLeftBorder:y,showRightBorder:w,row:o,rowNode:W},te?.cell),e.field)},se=p.left.map((e,t)=>le(e,t,t,p.left.length,nD.LEFT)),ce=p.right.map((e,t)=>{const n=u.length-p.right.length+t;return le(e,t,n,p.right.length,nD.RIGHT)}),ue=u.length-p.left.length-p.right.length,de=[];q&&de.push(le(u[b],b-p.left.length,b,ue,nD.VIRTUAL));for(let e=g;e<v;e+=1){const t=u[e],n=e-p.left.length;t&&de.push(le(t,n,e,ue))}Y&&de.push(le(u[b],b-p.left.length,b,ue,nD.VIRTUAL));const pe=o?{onClick:J,onDoubleClick:Z("rowDoubleClick",R),onMouseEnter:Z("rowMouseEnter",P),onMouseLeave:Z("rowMouseLeave",M),onMouseOut:Z("rowMouseOut",T),onMouseOver:Z("rowMouseOver",I)}:null;return Xp.jsxs("div",f({"data-id":r,"data-rowindex":i,role:"row",className:PR(...ie,X.root,c),style:oe},ae,pe,O,{ref:V,children:[se,Xp.jsx("div",{role:"presentation",className:XT.cellOffsetLeft,style:{width:h}}),de,Xp.jsx("div",{role:"presentation",className:PR(XT.cell,XT.cellEmpty)}),ce,Xp.jsx(tB,{rowId:r})]}))}),iB=KT(oB);function aB({privateApiRef:e,configuration:t,props:n,children:r}){const o=s.useRef(e.current.getPublicApi());return Xp.jsx(zO.Provider,{value:t,children:Xp.jsx(nP.Provider,{value:n,children:Xp.jsx(hL.Provider,{value:e,children:Xp.jsx(aP.Provider,{value:o,children:Xp.jsx(GN,{children:Xp.jsx(HO,{children:r})})})})})})}const lB=function(){try{const e="__some_random_key_you_are_not_going_to_use__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}()&&null!=window.localStorage.getItem("DEBUG"),sB=()=>{},cB={debug:sB,info:sB,warn:sB,error:sB},uB=["debug","info","warn","error"];function dB(e,t,n=console){const r=uB.indexOf(t);if(-1===r)throw new Error(`MUI X: Log level ${t} not recognized.`);return uB.reduce((t,o,i)=>(t[o]=i>=r?(...t)=>{const[r,...i]=t;n[o](`MUI X: ${e} - ${r}`,...i)}:sB,t),{})}let pB=function(e){return e.DataSource="dataSource",e.RowTree="rowTree",e}({});const fB=(e,t,n,r)=>{const o=s.useCallback(()=>{e.current.registerStrategyProcessor(t,n,r)},[e,r,n,t]);wL(()=>{o()});const i=s.useRef(!0);s.useEffect(()=>{i.current?i.current=!1:o()},[o])},hB="none",mB={dataSourceRowsUpdate:pB.DataSource,rowTreeCreation:pB.RowTree,filtering:pB.RowTree,sorting:pB.RowTree,visibleRowsLookupCreation:pB.RowTree},gB=(e,t)=>f({},e,{props:{listView:t.listView,getRowId:t.getRowId,isCellEditable:t.isCellEditable}}),vB=(e,t)=>{(e=>{const t=s.useRef(null),n=s.useRef(null),r=s.useRef(null),o=s.useRef(null),i=s.useRef(null),a=s.useRef(null);e.current.register("public",{rootElementRef:t}),e.current.register("private",{mainElementRef:n,virtualScrollerRef:r,virtualScrollbarVerticalRef:o,virtualScrollbarHorizontalRef:i,columnHeadersContainerRef:a})})(e),((e,t)=>{const n=s.useRef(!0);s.useEffect(()=>{n.current?n.current=!1:e.current.setState(e=>f({},e,{props:{listView:t.listView,getRowId:t.getRowId,isCellEditable:t.isCellEditable,isRowSelectable:t.isRowSelectable}}))},[e,t.listView,t.getRowId,t.isCellEditable,t.isRowSelectable])})(e,t),(e=>{const t=um();void 0===e.current.state.isRtl&&(e.current.state.isRtl=t);const n=s.useRef(!0);s.useEffect(()=>{n.current?n.current=!1:e.current.setState(e=>f({},e,{isRtl:t}))},[e,t])})(e),((e,t)=>{vL(e,{getLogger:s.useCallback(e=>lB?dB(e,"debug",t.logger):t.logLevel?dB(e,t.logLevel.toString(),t.logger):cB,[t.logLevel,t.logger])},"private")})(e,t),(e=>{const t=s.useRef({}),n=s.useCallback(e=>{t.current[e.stateId]=e},[]),r=s.useCallback((n,r)=>{let o;if(o="function"==typeof n?n(e.current.state):n,e.current.state===o)return!1;const i={current:{state:o}};let a=!1;const l=[];if(Object.keys(t.current).forEach(n=>{const r=t.current[n],o=r.stateSelector(e),s=r.stateSelector(i);s!==o&&(l.push({stateId:r.stateId,hasPropChanged:s!==r.propModel}),void 0!==r.propModel&&s!==r.propModel&&(a=!0))}),l.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${l[0].stateId}, therefore, you're not allowed to update ${l.map(e=>e.stateId).join(", ")} in the same transaction.`);if(a||(e.current.state=o,e.current.publishEvent("stateChange",o),e.current.store.update(o)),1===l.length){const{stateId:n,hasPropChanged:o}=l[0],s=t.current[n],c=s.stateSelector(i);s.propOnChange&&o&&s.propOnChange(c,{reason:r,api:e.current}),a||e.current.publishEvent(s.changeEvent,c,{reason:r})}return!a},[e]),o=s.useCallback((t,n,r)=>e.current.setState(e=>f({},e,{[t]:n(e[t])}),r),[e]),i={updateControlState:o,registerControlState:n};vL(e,{setState:r},"public"),vL(e,i,"private")})(e),(e=>{const t=s.useRef({}),n=s.useRef(!1),r=s.useCallback(e=>{!n.current&&e&&(n.current=!0,Object.values(e.appliers).forEach(e=>{e()}),n.current=!1)},[]),o=s.useCallback((e,n,r)=>{t.current[e]||(t.current[e]={processors:new Map,processorsAsArray:[],appliers:{},processorsUpdated:!1});const o=t.current[e];return o.processors.get(n)!==r&&(o.processors.set(n,r),o.processorsAsArray=Array.from(t.current[e].processors.values()).filter(e=>null!==e),o.processorsUpdated=!0),()=>{t.current[e].processors.set(n,null),t.current[e].processorsAsArray=Array.from(t.current[e].processors.values()).filter(e=>null!==e)}},[]),i=s.useCallback((e,n,r)=>(t.current[e]||(t.current[e]={processors:new Map,processorsAsArray:[],appliers:{},processorsUpdated:!1}),t.current[e].appliers[n]=r,()=>{const r=d(t.current[e].appliers,[n].map(T));t.current[e].appliers=r}),[]),a=s.useCallback(e=>{r(t.current[e])},[r]),l=s.useCallback(()=>{for(const e in t.current){if(!Object.prototype.hasOwnProperty.call(t.current,e))continue;const n=t.current[e];n.processorsUpdated&&(n.processorsUpdated=!1,r(n))}},[r]),c={unstable_applyPipeProcessors:s.useCallback((...e)=>{const[n,r,o]=e;if(!t.current[n])return r;const i=t.current[n].processorsAsArray;let a=r;for(let e=0;e<i.length;e+=1)a=i[e](a,o);return a},[])};vL(e,{registerPipeProcessor:o,registerPipeApplier:i,requestPipeProcessorsApplication:a,runAppliersForPendingProcessors:l},"private"),vL(e,c,"public")})(e),(e=>{const t=s.useRef(new Map),n=s.useRef({}),r=s.useCallback((t,r,o)=>{const i=()=>{const e=d(n.current[r],[t].map(T));n.current[r]=e};n.current[r]||(n.current[r]={});const a=n.current[r],l=a[t];return a[t]=o,l&&l!==o?(t===e.current.getActiveStrategy(mB[r])&&e.current.publishEvent("activeStrategyProcessorChange",r),i):i},[e]),o=s.useCallback((t,r)=>{const o=e.current.getActiveStrategy(mB[t]);if(null==o)throw new Error("Can't apply a strategy processor before defining an active strategy");const i=n.current[t];if(!i||!i[o])throw new Error(`No processor found for processor "${t}" on strategy "${o}"`);return(0,i[o])(r)},[e]),i=s.useCallback(e=>{const n=Array.from(t.current.entries()).find(([,t])=>t.group===e&&t.isAvailable());return n?.[0]??hB},[]),a=s.useCallback((n,r,o)=>{t.current.set(r,{group:n,isAvailable:o}),e.current.publishEvent("strategyAvailabilityChange")},[e]);vL(e,{registerStrategyProcessor:r,applyStrategyProcessor:o,getActiveStrategy:i,setStrategyAvailability:a},"private")})(e),((e,t)=>{const n=s.useCallback(e=>{if(null==t.localeText[e])throw new Error(`Missing translation for key ${e}.`);return t.localeText[e]},[t.localeText]);e.current.register("public",{getLocaleText:n})})(e,t),e.current.register("private",{rootProps:t})},bB=(e,t,n,r)=>{const o=s.useRef(r),i=s.useRef(!1);r!==o.current&&(i.current=!1,o.current=r),i.current||(t.current.state=e(t.current.state,n,t),i.current=!0)};function yB(e,t){if(null==e)return"";const n="string"==typeof e?e:`${e}`;if(t.shouldAppendQuotes||t.escapeFormulas){const e=n.replace(/"/g,'""');return t.escapeFormulas&&["=","+","-","@","\t","\r"].includes(e[0])?`"'${e}"`:[t.delimiter,"\n","\r",'"'].some(e=>n.includes(e))?`"${e}"`:e}return n}const wB=(e,t)=>{const{csvOptions:n,ignoreValueFormatter:r}=t;let o;if(r){const t=e.colDef.type;o="number"===t?String(e.value):"date"===t||"dateTime"===t?e.value?.toISOString():"function"==typeof e.value?.toString?e.value.toString():e.value}else o=e.formattedValue;return yB(o,n)};class xB{rowString="";isEmpty=!0;constructor(e){this.options=e}addValue(e){this.isEmpty||(this.rowString+=this.options.csvOptions.delimiter),"function"==typeof this.options.sanitizeCellValue?this.rowString+=this.options.sanitizeCellValue(e,this.options.csvOptions):this.rowString+=e,this.isEmpty=!1}getRowString(){return this.rowString}}function SB(e){const{columns:t,rowIds:n,csvOptions:r,ignoreValueFormatter:o,apiRef:i}=e,a=n.reduce((e,n)=>`${e}${(({id:e,columns:t,getCellParams:n,csvOptions:r,ignoreValueFormatter:o})=>{const i=new xB({csvOptions:r});return t.forEach(t=>{const a=n(e,t.field);String(a.formattedValue),i.addValue(wB(a,{ignoreValueFormatter:o,csvOptions:r}))}),i.getRowString()})({id:n,columns:t,getCellParams:i.current.getCellParams,ignoreValueFormatter:o,csvOptions:r})}\r\n`,"").trim();if(!r.includeHeaders)return a;const l=t.filter(e=>e.field!==wF.field),s=[];if(r.includeColumnGroupsHeaders){const e=i.current.getAllGroupDetails();let t=0;const n=l.reduce((e,n)=>{const r=i.current.getColumnGroupPath(n.field);return e[n.field]=r,t=Math.max(t,r.length),e},{});for(let o=0;o<t;o+=1){const t=new xB({csvOptions:r,sanitizeCellValue:yB});s.push(t),l.forEach(r=>{const i=(n[r.field]||[])[o],a=e[i];t.addValue(a?a.headerName||a.groupId:"")})}}const c=new xB({csvOptions:r,sanitizeCellValue:yB});l.forEach(e=>{c.addValue(e.headerName||e.field)}),s.push(c);return`${`${s.map(e=>e.getRowString()).join("\r\n")}\r\n`}${a}`.trim()}function CB(e){const t=document.createElement("span");t.style.whiteSpace="pre",t.style.userSelect="all",t.style.opacity="0px",t.textContent=e,document.body.appendChild(t);const n=document.createRange();n.selectNode(t);const r=window.getSelection();r.removeAllRanges(),r.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(t)}}const kB=(e,t)=>{const n=t.ignoreValueFormatterDuringExport,r=("object"==typeof n?n?.clipboardExport:n)||!1,o=t.clipboardCopyCellDelimiter,i=s.useCallback(t=>{if(!function(e){return(e.ctrlKey||e.metaKey)&&"C"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey}(t))return;if(n=t.target,window.getSelection()?.toString()||n&&(n.selectionEnd||0)-(n.selectionStart||0)>0)return;var n;let i="";if(ND(e)>0)i=e.current.getDataAsCsv({includeHeaders:!1,delimiter:o,shouldAppendQuotes:!1,escapeFormulas:!1});else{const t=YD(e);if(t){const n=e.current.getCellParams(t.id,t.field);i=wB(n,{csvOptions:{delimiter:o,shouldAppendQuotes:!1,escapeFormulas:!1},ignoreValueFormatter:r})}}var a;i=e.current.unstable_applyPipeProcessors("clipboardCopy",i),i&&(a=i,navigator.clipboard?navigator.clipboard.writeText(a).catch(()=>{CB(a)}):CB(a),e.current.publishEvent("clipboardCopy",i))},[e,r,o]);yL(e,()=>e.current.rootElementRef.current,"keydown",i),iI(e,"clipboardCopy",t.onClipboardCopy)},EB=e=>f({},e,{columnMenu:{open:!1}}),RB=(e,t,n)=>{n.current.caches.columns={lastColumnsProp:t.columns};return f({},e,{columns:aL({apiRef:n,columnsToUpsert:t.columns,initialState:t.initialState?.columns,columnVisibilityModel:t.columnVisibilityModel??t.initialState?.columns?.columnVisibilityModel??{},keepOnlyColumnsToUpsert:!0}),pinnedColumns:e.pinnedColumns??JI})};function PB(e,t){const n=bL(e,"useGridColumns");e.current.registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:lO,changeEvent:"columnVisibilityModelChange"});const r=s.useCallback(t=>{n.debug("Updating columns state."),e.current.setState(function(e){return t=>f({},t,{columns:e})}(t)),e.current.publishEvent("columnsChange",t.orderedFields)},[n,e]),o=s.useCallback(t=>iO(e)[t],[e]),i=s.useCallback(()=>aO(e),[e]),a=s.useCallback(()=>cO(e),[e]),l=s.useCallback((t,n=!0)=>(n?cO(e):aO(e)).findIndex(e=>e.field===t),[e]),c=s.useCallback(t=>{const n=l(t);return hO(e)[n]},[e,l]),u=s.useCallback(t=>{lO(e)!==t&&(e.current.setState(n=>f({},n,{columns:aL({apiRef:e,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:t,keepOnlyColumnsToUpsert:!1})})),e.current.updateRenderContext?.())},[e]),d=s.useCallback(t=>{let n=t;if(SL(e)){const r=[],o=[],i=kL(e);if(t.forEach(e=>{i.has(e.field)?r.push(e):o.push(e)}),r.length>0&&e.current.updateNonPivotColumns(r),0===o.length)return;n=o}const o=aL({apiRef:e,columnsToUpsert:n,initialState:void 0,keepOnlyColumnsToUpsert:!1,updateInitialVisibilityModel:!0});r(o)},[e,r]),p=s.useCallback((t,n)=>{const r=lO(e);if(n!==(r[t]??!0)){const o=f({},r,{[t]:n});e.current.setColumnVisibilityModel(o)}},[e]),h=s.useCallback(t=>oO(e).findIndex(e=>e===t),[e]),m=s.useCallback((t,o)=>{const i=oO(e),a=h(t);if(a===o)return;n.debug(`Moving column ${t} to index ${o}`);const l=[...i],s=l.splice(a,1)[0];l.splice(o,0,s),r(f({},rO(e),{orderedFields:l}));const c={column:e.current.getColumn(t),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(t),oldIndex:a};e.current.publishEvent("columnIndexChange",c)},[e,n,r,h]),g=s.useCallback((t,o)=>{n.debug(`Updating column ${t} width to ${o}`);const i=rO(e),a=f({},i.lookup[t],{width:o,hasBeenResized:!0});r(oL(f({},i,{lookup:f({},i.lookup,{[t]:a})}),e.current.getRootDimensions())),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(t),colDef:a,width:o})},[e,n,r]),v={setColumnIndex:m};vL(e,{getColumn:o,getAllColumns:i,getColumnIndex:l,getColumnPosition:c,getVisibleColumns:a,getColumnIndexRelativeToVisibleColumns:h,updateColumns:d,setColumnVisibilityModel:u,setColumnVisibility:p,setColumnWidth:g},"public"),vL(e,v,t.signature===QT.DataGrid?"private":"public");const b=s.useCallback((n,r)=>{const o={},i=lO(e);(!r.exportOnlyDirtyModels||null!=t.columnVisibilityModel||Object.keys(t.initialState?.columns?.columnVisibilityModel??{}).length>0||Object.keys(i).length>0)&&(o.columnVisibilityModel=i),o.orderedFields=oO(e);const a=aO(e),l={};return a.forEach(e=>{if(e.hasBeenResized){const t={};nL.forEach(n=>{let r=e[n];r===1/0&&(r=-1),t[n]=r}),l[e.field]=t}}),Object.keys(l).length>0&&(o.dimensions=l),f({},n,{columns:o})},[e,t.columnVisibilityModel,t.initialState?.columns]),y=s.useCallback((t,n)=>{const r=n.stateToRestore.columns,o=r?.columnVisibilityModel;if(null==r)return t;const i=aL({apiRef:e,columnsToUpsert:[],initialState:r,columnVisibilityModel:o,keepOnlyColumnsToUpsert:!1});return null!=r&&e.current.setState(e=>f({},e,{columns:f({},e.columns,{lookup:i.lookup,orderedFields:i.orderedFields,initialColumnVisibilityModel:i.initialColumnVisibilityModel})})),null!=o&&e.current.setState(e=>f({},e,{columns:f({},e.columns,{columnVisibilityModel:o})})),null!=r&&e.current.publishEvent("columnsChange",i.orderedFields),t},[e]),w=s.useCallback((e,n)=>{if(n===YL.columns){const e=t.slots.columnsPanel;return Xp.jsx(e,f({},t.slotProps?.columnsPanel))}return e},[t.slots.columnsPanel,t.slotProps?.columnsPanel]),x=s.useCallback(n=>{const r=SL(e);return t.disableColumnSelector||r?n:[...n,"columnMenuColumnsItem"]},[t.disableColumnSelector,e]);pN(e,"columnMenu",x),pN(e,"exportState",b),pN(e,"restoreState",y),pN(e,"preferencePanel",w);const S=s.useRef(null);rI(e,"viewportInnerSizeChange",t=>{if(S.current!==t.width){S.current=t.width;if(!cO(e).some(e=>e.flex&&e.flex>0))return;r(oL(rO(e),e.current.getRootDimensions()))}});const C=s.useCallback(()=>{n.info("Columns pipe processing have changed, regenerating the columns");const t=aL({apiRef:e,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1});r(t)},[e,n,r]);fN(e,"hydrateColumns",C),s.useEffect(()=>{if(e.current.caches.columns.lastColumnsProp===t.columns)return;e.current.caches.columns.lastColumnsProp=t.columns,n.info(`GridColumns have changed, new length ${t.columns.length}`);const o=aL({apiRef:e,initialState:void 0,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0,updateInitialVisibilityModel:!0,columnVisibilityModel:t.columnVisibilityModel});r(o)},[n,e,r,t.columns,t.columnVisibilityModel]),s.useEffect(()=>{void 0!==t.columnVisibilityModel&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,n,t.columnVisibilityModel])}const MB=(e,t)=>f({},e,{density:t.initialState?.density??t.density??"standard"});const TB=({apiRef:e,options:t})=>{const n=aO(e);if(t.fields)return t.fields.reduce((e,t)=>{const r=n.find(e=>e.field===t);return r&&e.push(r),e},[]);return(t.allColumns?n:cO(e)).filter(e=>!0!==e.disableExport)},IB=({apiRef:e})=>{const t=RD(e),n=xT(e),r=ND(e),o=t.filter(e=>"footer"!==n[e].type),i=TT(e),a=i?.top?.map(e=>e.id)||[],l=i?.bottom?.map(e=>e.id)||[];if(o.unshift(...a),o.push(...l),r>0){const t=$D(e);return o.filter(e=>t.has(e))}return o},OB=(e,t)=>{const n=bL(e,"useGridCsvExport"),r=t.ignoreValueFormatterDuringExport,o=("object"==typeof r?r?.csvExport:r)||!1,i=s.useCallback((t={})=>{n.debug("Get data as CSV");return SB({columns:TB({apiRef:e,options:t}),rowIds:(t.getRowsToExport??IB)({apiRef:e}),csvOptions:{delimiter:t.delimiter||",",shouldAppendQuotes:t.shouldAppendQuotes??!0,includeHeaders:t.includeHeaders??!0,includeColumnGroupsHeaders:t.includeColumnGroupsHeaders??!0,escapeFormulas:t.escapeFormulas??!0},ignoreValueFormatter:o,apiRef:e})},[n,e,o]),a=s.useCallback(e=>{n.debug("Export data as CSV");const t=i(e);!function(e,t="csv",n=document.title||"untitled"){const r=`${n}.${t}`;if("download"in HTMLAnchorElement.prototype){const t=URL.createObjectURL(e),n=document.createElement("a");return n.href=t,n.download=r,n.click(),void setTimeout(()=>{URL.revokeObjectURL(t)})}throw new Error("MUI X: exportAs not supported.")}(new Blob([e?.utf8WithBom?new Uint8Array([239,187,191]):"",t],{type:"text/csv"}),"csv",e?.fileName)},[n,i]);vL(e,{getDataAsCsv:i,exportDataAsCsv:a},"public");const l=s.useCallback((e,t)=>t.csvOptions?.disableToolbarButton?e:[...e,{component:Xp.jsx(Kz,{options:t.csvOptions}),componentName:"csvExport"}],[]);pN(e,"exportMenu",l)};const DB=(e,t,n)=>{let r=e.paginationModel;const o=e.rowCount,i=n?.pageSize??r.pageSize,a=n?.page??r.page,l=nF(o,i,a);!n||n?.page===r.page&&n?.pageSize===r.pageSize||(r=n);const s=-1===i?0:((e,t=0)=>0===t?e:Math.max(Math.min(e,t-1),0))(r.page,l);return s!==r.page&&(r=f({},r,{page:s})),oF(r.pageSize,t),r};const FB=(e,t)=>{const n=null!==e.current.rootElementRef.current,r=bL(e,"useGridPrintExport"),o=s.useRef(null),i=s.useRef(null),a=s.useRef({}),l=s.useRef([]),c=s.useRef(null);s.useEffect(()=>{o.current=kg(e.current.rootElementRef.current)},[e,n]);const u=s.useCallback((t,n,r)=>new Promise(o=>{const i=TB({apiRef:e,options:{fields:t,allColumns:n}}).map(e=>e.field),a=aO(e),l={};a.forEach(e=>{l[e.field]=i.includes(e.field)}),r&&(l[wF.field]=!0),e.current.setColumnVisibilityModel(l),o()}),[e]),d=s.useCallback(t=>{const n=t({apiRef:e}).reduce((t,n)=>{const r=e.current.getRow(n);return r[DT]||t.push(r),t},[]);e.current.setRows(n)},[e]),p=s.useCallback((t,n)=>{const r=f({copyStyles:!0,hideToolbar:!1,hideFooter:!1,includeCheckboxes:!1},n),i=t.contentDocument;if(!i)return;const a=e.current.rootElementRef.current,l=a.cloneNode(!0),s=l.querySelector(`.${XT.virtualScrollerContent}`);if(l.querySelector(`.${XT.main}`).style.overflow="visible",l.querySelector(`.${XT.virtualScrollerRenderZone}`).style.position="static",s.style.flexBasis="auto",l.querySelector(`.${XT["scrollbar--vertical"]}`)?.remove(),!(s.nextSibling instanceof HTMLElement&&s.nextSibling.classList.contains(XT.filler))){const e=document.createElement("div");e.style.height=XA,s.insertAdjacentElement("afterend",e)}const c=l.querySelector(`.${XT.footerContainer}`);r.hideToolbar&&l.querySelector(`.${XT.toolbar}`)?.remove(),r.hideFooter&&c&&c.remove(),l.style.height="auto",l.style.boxSizing="content-box",!r.hideFooter&&c&&(c.style.width="100%");const u=document.createElement("div");u.appendChild(l),i.body.style.marginTop="0px",i.body.innerHTML=u.innerHTML;const d="function"==typeof r.pageStyle?r.pageStyle():r.pageStyle;if("string"==typeof d){const e=i.createElement("style");e.appendChild(i.createTextNode(d)),i.head.appendChild(e)}r.bodyClassName&&i.body.classList.add(...r.bodyClassName.split(" "));let p=[];if(r.copyStyles){const e=a.getRootNode();p=function(e,t){const n=[],r=t.querySelectorAll("style, link[rel='stylesheet']");for(let t=0;t<r.length;t+=1){const o=r[t],i=e.createElement(o.tagName);if("STYLE"===o.tagName){const t=o.sheet;if(t){let n="";for(let e=0;e<t.cssRules.length;e+=1)"string"==typeof t.cssRules[e].cssText&&(n+=`${t.cssRules[e].cssText}\r\n`);i.appendChild(e.createTextNode(n))}}else if(o.getAttribute("href")){for(let e=0;e<o.attributes.length;e+=1){const t=o.attributes[e];t&&i.setAttribute(t.nodeName,t.nodeValue||"")}n.push(new Promise(e=>{i.addEventListener("load",()=>e())}))}e.head.appendChild(i)}return n}(i,"ShadowRoot"===e.constructor.name?e:o.current)}Promise.all(p).then(()=>{t.contentWindow.print()})},[e,o]),h=s.useCallback(t=>{o.current.body.removeChild(t),e.current.restoreState(i.current||{}),i.current?.columns?.columnVisibilityModel||e.current.setColumnVisibilityModel(a.current),e.current.setState(e=>f({},e,{virtualization:c.current})),e.current.setRows(l.current),i.current=null,a.current={},l.current=[]},[e]),m=s.useCallback(async n=>{if(r.debug("Export data as Print"),!e.current.rootElementRef.current)throw new Error("MUI X: No grid root element available.");if(i.current=e.current.exportState(),a.current=lO(e),l.current=e.current.getSortedRows().filter(e=>!e[DT]),t.pagination){const t={page:0,pageSize:MD(e)};e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{paginationModel:DB(e.pagination,"DataGridPro",t)})}))}c.current=e.current.state.virtualization,e.current.unstable_setVirtualization(!1),await u(n?.fields,n?.allColumns,n?.includeCheckboxes),d(n?.getRowsToExport??IB),await new Promise(e=>{requestAnimationFrame(()=>{e()})});const s=function(e){const t=document.createElement("iframe");return t.style.position="absolute",t.style.width="0px",t.style.height="0px",t.title=e||document.title,t}(n?.fileName);s.onload=()=>{p(s,n);s.contentWindow.matchMedia("print").addEventListener("change",e=>{!1===e.matches&&h(s)})},o.current.body.appendChild(s)},[t,r,e,p,h,u,d]);vL(e,{exportDataAsPrint:m},"public");const g=s.useCallback((e,t)=>t.printOptions?.disableToolbarButton?e:[...e,{component:Xp.jsx(qz,{options:t.printOptions}),componentName:"printExport"}],[]);pN(e,"exportMenu",g)},LB=(e,t,n)=>{const r=t.filterModel??t.initialState?.filter?.filterModel??XI();return f({},e,{filter:f({filterModel:wO(r,t.disableMultipleColumnsFiltering,n)},YI),visibleRowsLookup:{}})},AB=e=>e.filteredRowsLookup;function NB(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}function $B(){return PM(Object.values)}const zB=e=>f({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),jB=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(e<n)return e+1}else if(!r&&e>t)return e-1;return null},BB=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(e>t)return e-1}else if(!r&&e<n)return e+1;return null};const _B=tT(gF,TT,(e,t)=>(t.top||[]).concat(e.rows,t.bottom||[])),HB=(e,t)=>{const n=bL(e,"useGridKeyboardNavigation"),r=um(),o=s.useCallback(()=>_B(e),[e]),i="DataGrid"!==t.signature&&t.headerFilters,a=s.useCallback((t,r,o="left",i="up")=>{const a=CD(e),l=e.current.unstable_getCellColSpanInfo(r,t);l&&l.spannedByColSpan&&("left"===o?t=l.leftVisibleCellIndex:"right"===o&&(t=l.rightVisibleCellIndex));const s=uO(e)[t],c=function(e,t,n,r){const o=AA.selectors.hiddenCells(e.current.virtualizer.store.state);if(!o[t]?.[n])return t;const i=RD(e);let a=i.indexOf(t)+("down"===r?1:-1);for(;a>=0&&a<i.length;){const e=i[a];if(!o[e]?.[n])return e;a+="down"===r?1:-1}return t}(e,r,t,i),u=a.findIndex(e=>e.id===c);n.debug(`Navigating to cell row ${u}, col ${t}`),e.current.scrollToIndexes({colIndex:t,rowIndex:u}),e.current.setCellFocus(c,s)},[e,n]),l=s.useCallback((t,r)=>{n.debug(`Navigating to header col ${t}`),e.current.scrollToIndexes({colIndex:t});const o=e.current.getVisibleColumns()[t].field;e.current.setColumnHeaderFocus(o,r)},[e,n]),c=s.useCallback((t,r)=>{n.debug(`Navigating to header filter col ${t}`),e.current.scrollToIndexes({colIndex:t});const o=e.current.getVisibleColumns()[t].field;e.current.setColumnHeaderFilterFocus(o,r)},[e,n]),u=s.useCallback((t,r,o)=>{n.debug(`Navigating to header col ${t}`),e.current.scrollToIndexes({colIndex:t});const{field:i}=e.current.getVisibleColumns()[t];e.current.setColumnGroupHeaderFocus(i,r,o)},[e,n]),d=s.useCallback(e=>o()[e]?.id,[o]),p=s.useCallback((n,s)=>{const p=s.currentTarget.querySelector(`.${XT.columnHeaderTitleContainerContent}`);if(!!p&&p.contains(s.target)&&n.field!==wF.field)return;if(!AO(s.key)&&"Tab"!==s.key)return;if("Tab"===s.key&&("none"===t.tabNavigation||"content"===t.tabNavigation&&s.shiftKey))return;const f=o(),h=e.current.getViewportPageSize(),m=n.field?e.current.getColumnIndex(n.field):0,g=f.length>0?0:null,v=f.length>0?f.length-1:null,b=Math.max(0,cO(e).length-1),y=tL(e);let w=!0;if("Tab"!==s.key||"content"!==t.tabNavigation||s.shiftKey){switch(s.key){case"ArrowDown":i?c(m,s):null!==g&&a(m,d(g));break;case"ArrowRight":{const e=BB({currentColIndex:m,firstColIndex:0,lastColIndex:b,isRtl:r});null!==e&&l(e,s);break}case"ArrowLeft":{const e=jB({currentColIndex:m,firstColIndex:0,lastColIndex:b,isRtl:r});null!==e&&l(e,s);break}case"ArrowUp":y>0&&u(m,y-1,s);break;case"PageDown":null!==g&&null!==v&&a(m,d(Math.min(g+h,v)));break;case"Home":l(0,s);break;case"End":l(b,s);break;case"Enter":(s.ctrlKey||s.metaKey)&&e.current.toggleColumnMenu(n.field);break;case"Tab":s.shiftKey?0===m?y>0?u(b,y-1,s):w=!1:l(m-1,s):m===b?i?c(0,s):"all"===t.tabNavigation&&null!==g?a(0,d(g)):w=!1:l(m+1,s);break;case" ":break;default:w=!1}w&&s.preventDefault()}else null!==g&&(a(0,d(g)),s.preventDefault())},[e,t.tabNavigation,o,i,c,a,d,r,l,u]),f=s.useCallback((n,i)=>{const s=YF(e)===n.field;if(XF(e)===n.field||s&&"Tab"!==i.key)return;if(!AO(i.key)&&"Tab"!==i.key)return;if("Tab"===i.key&&("none"===t.tabNavigation||"content"===t.tabNavigation&&i.shiftKey))return;const u=o(),p=e.current.getViewportPageSize(),f=n.field?e.current.getColumnIndex(n.field):0,h=u.length>0?0:null,m=u.length>0?u.length-1:null,g=Math.max(0,cO(e).length-1);let v=!0;if("Tab"!==i.key||"content"!==t.tabNavigation||i.shiftKey){switch(i.key){case"ArrowDown":null!==h&&a(f,d(h));break;case"ArrowRight":{const e=BB({currentColIndex:f,firstColIndex:0,lastColIndex:g,isRtl:r});null!==e&&c(e,i);break}case"ArrowLeft":{const t=jB({currentColIndex:f,firstColIndex:0,lastColIndex:g,isRtl:r});null!==t?c(t,i):e.current.setColumnHeaderFilterFocus(n.field,i);break}case"ArrowUp":l(f,i);break;case"PageDown":null!==h&&null!==m&&a(f,d(Math.min(h+p,m)));break;case"Home":c(0,i);break;case"End":c(g,i);break;case"Tab":i.shiftKey?0===f?l(g,i):c(f-1,i):f===g?"all"===t.tabNavigation&&null!==h?a(0,d(h)):v=!1:c(f+1,i);break;case" ":break;default:v=!1}v&&i.preventDefault()}else null!==h&&(a(0,d(h)),i.preventDefault())},[e,t.tabNavigation,o,c,r,l,a,d]),h=s.useCallback((n,r)=>{const i=QD(e);if(null===i)return;const{field:s,depth:c}=i,{fields:p,depth:f,maxDepth:h}=n;if(!AO(r.key)&&"Tab"!==r.key)return;if("Tab"===r.key&&("none"===t.tabNavigation||"content"===t.tabNavigation&&r.shiftKey))return;const m=o(),g=e.current.getViewportPageSize(),v=e.current.getColumnIndex(s),b=s?e.current.getColumnIndex(s):0,y=m.length>0?0:null,w=m.length>0?m.length-1:null,x=Math.max(0,cO(e).length-1);let S=!0;if("Tab"!==r.key||"content"!==t.tabNavigation||r.shiftKey){switch(r.key){case"ArrowDown":f===h-1?l(v,r):u(v,c+1,r);break;case"ArrowUp":f>0&&u(v,c-1,r);break;case"ArrowRight":{const e=p.length-p.indexOf(s)-1;v+e+1<=x&&u(v+e+1,c,r);break}case"ArrowLeft":{const e=p.indexOf(s);v-e-1>=0&&u(v-e-1,c,r);break}case"PageDown":null!==y&&null!==w&&a(b,d(Math.min(y+g,w)));break;case"Home":u(0,c,r);break;case"End":u(x,c,r);break;case"Tab":if(r.shiftKey){const e=v-p.indexOf(s)-1;e<0?0===f?S=!1:u(x,c-1,r):u(e,c,r)}else{const e=v+(p.length-p.indexOf(s)-1)+1;e>x&&f===h-1?l(0,r):e>x?u(0,c+1,r):u(e,c,r)}break;case" ":break;default:S=!1}S&&r.preventDefault()}else null!==y&&(a(0,d(y)),r.preventDefault())},[e,t.tabNavigation,o,l,u,a,d]),m=s.useCallback((n,s)=>{if(v$(s))return;const u=e.current.getCellParams(n.id,n.field);if(u.cellMode===zI.Edit||!AO(s.key)&&"Tab"!==s.key)return;if("Tab"===s.key&&("none"===t.tabNavigation||"header"===t.tabNavigation&&!s.shiftKey))return;if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:s,cell:u}))return;const p=o();if(0===p.length)return;const f=i?c:l,h=e.current.getViewportPageSize(),m=n.field?e.current.getColumnIndex(n.field):0,g=p.findIndex(e=>e.id===n.id),v=p.length-1,b=Math.max(0,cO(e).length-1);let y=!0;if("Tab"===s.key&&"header"===t.tabNavigation&&s.shiftKey)return f(b,s),void s.preventDefault();switch(s.key){case"ArrowDown":g<v&&a(m,d(g+1),r?"right":"left","down");break;case"ArrowUp":g>0?a(m,d(g-1)):f(m,s);break;case"ArrowRight":{const e=BB({currentColIndex:m,firstColIndex:0,lastColIndex:b,isRtl:r});null!==e&&a(e,d(g),r?"left":"right");break}case"ArrowLeft":{const e=jB({currentColIndex:m,firstColIndex:0,lastColIndex:b,isRtl:r});null!==e&&a(e,d(g),r?"right":"left");break}case"Tab":s.shiftKey?0===m&&0===g?"all"===t.tabNavigation?f(b,s):y=!1:0===m?a(b,d(g-1)):a(m-1,d(g),"left"):m===b?g!==v?a(0,d(g+1)):y=!1:a(m+1,d(g),"right");break;case" ":{if(n.field===tD)break;const e=n.colDef;if(e&&("__tree_data_group__"===e.field||(e=>e===eD||null!==(e=>{const t=e.match(/^__row_group_by_columns_group_(.*)__$/);return t?t[1]:null})(e))(e.field)))break;!s.shiftKey&&g<v&&a(m,d(Math.min(g+h,v)));break}case"PageDown":g<v&&a(m,d(Math.min(g+h,v)));break;case"PageUp":{const e=Math.max(g-h,0);e!==g&&e>=0?a(m,d(e)):l(m,s);break}case"Home":s.ctrlKey||s.metaKey||s.shiftKey?a(0,d(0)):a(0,d(g));break;case"End":s.ctrlKey||s.metaKey||s.shiftKey?a(b,d(v)):a(b,d(g));break;default:y=!1}y&&s.preventDefault()},[e,t.tabNavigation,o,r,a,d,i,c,l]),g=s.useCallback((e,{event:t})=>" "!==t.key&&e,[]);pN(e,"canStartEditing",g),rI(e,"columnHeaderKeyDown",p),rI(e,"headerFilterKeyDown",f),rI(e,"columnGroupHeaderKeyDown",h),rI(e,"cellKeyDown",m)},VB=(e,t)=>{const n=f({},rF(t.autoPageSize),t.paginationModel??t.initialState?.pagination?.paginationModel);oF(n.pageSize,t.signature);const r=t.rowCount??t.initialState?.pagination?.rowCount??("client"===t.paginationMode?e.rows?.totalRowCount:void 0),o=t.paginationMeta??t.initialState?.pagination?.meta??{};return f({},e,{pagination:f({},e.pagination,{paginationModel:n,rowCount:r,meta:o,enabled:!0===t.pagination,paginationMode:t.paginationMode})})},WB=(e,t)=>{((e,t)=>{const n=bL(e,"useGridPaginationMeta");e.current.registerControlState({stateId:"paginationMeta",propModel:t.paginationMeta,propOnChange:t.onPaginationMetaChange,stateSelector:cF,changeEvent:"paginationMetaChange"});const r=s.useCallback(t=>{cF(e)!==t&&(n.debug("Setting 'paginationMeta' to",t),e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{meta:t})})))},[e,n]);vL(e,{setPaginationMeta:r},"public");const o=s.useCallback((n,r)=>{const o=cF(e);return r.exportOnlyDirtyModels&&null==t.paginationMeta&&null==t.initialState?.pagination?.meta?n:f({},n,{pagination:f({},n.pagination,{meta:o})})},[e,t.paginationMeta,t.initialState?.pagination?.meta]),i=s.useCallback((t,n)=>{const r=n.stateToRestore.pagination?.meta?n.stateToRestore.pagination.meta:cF(e);return e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{meta:r})})),t},[e]);pN(e,"exportState",o),pN(e,"restoreState",i),s.useEffect(()=>{t.paginationMeta&&e.current.setPaginationMeta(t.paginationMeta)},[e,t.paginationMeta])})(e,t),((e,t)=>{const n=bL(e,"useGridPaginationModel"),r=pI(e,mI),o=s.useRef(yD(e)),i=Math.floor(t.rowHeight*r);e.current.registerControlState({stateId:"paginationModel",propModel:t.paginationModel,propOnChange:t.onPaginationModelChange,stateSelector:lF,changeEvent:"paginationModelChange"});const a=s.useCallback(t=>{const r=lF(e);t!==r.page&&(n.debug(`Setting page to ${t}`),e.current.setPaginationModel({page:t,pageSize:r.pageSize}))},[e,n]),l=s.useMemo(()=>Cg(a,0),[a]),c=s.useCallback(t=>{const r=lF(e);t!==r.pageSize&&(n.debug(`Setting page size to ${t}`),e.current.setPaginationModel({pageSize:t,page:r.page}))},[e,n]),u=s.useCallback(r=>{const o=lF(e);r!==o&&(n.debug("Setting 'paginationModel' to",r),e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{paginationModel:DB(e.pagination,t.signature,r)})}),"setPaginationModel"))},[e,n,t.signature]);vL(e,{setPage:a,setPageSize:c,setPaginationModel:u},"public");const d=s.useCallback((n,r)=>{const o=lF(e);return!r.exportOnlyDirtyModels||null!=t.paginationModel||null!=t.initialState?.pagination?.paginationModel||0!==o.page&&o.pageSize!==(t.autoPageSize?0:100)?f({},n,{pagination:f({},n.pagination,{paginationModel:o})}):n},[e,t.paginationModel,t.initialState?.pagination?.paginationModel,t.autoPageSize]),p=s.useCallback((n,r)=>{const o=r.stateToRestore.pagination?.paginationModel?f({},rF(t.autoPageSize),r.stateToRestore.pagination?.paginationModel):lF(e);return e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{paginationModel:DB(e.pagination,t.signature,o)})}),"stateRestorePreProcessing"),n},[e,t.autoPageSize,t.signature]);pN(e,"exportState",d),pN(e,"restoreState",p);const h=s.useCallback(()=>{if(!t.autoPageSize)return;const n=e.current.getRootDimensions(),r=Math.max(1,Math.floor(n.viewportInnerSize.height/i));e.current.setPageSize(r)},[e,t.autoPageSize,i]),m=s.useCallback(t=>{if(null==t)return;const n=lF(e);if(0===n.page)return;const r=pF(e);n.page>r-1&&queueMicrotask(()=>{l(Math.max(0,r-1))})},[e,l]),g=s.useCallback(()=>{0!==lF(e).page&&l(0),0!==e.current.getScrollPosition().top&&e.current.scroll({top:0})},[e,l]),v=s.useMemo(()=>Cg(g,0),[g]),b=s.useCallback(t=>{const n=f({},t,{items:OD(e)});JL(n,o.current)||(o.current=n,v())},[e,v]);rI(e,"viewportInnerSizeChange",h),rI(e,"paginationModelChange",()=>{const t=lF(e);e.current.virtualScrollerRef?.current&&e.current.scrollToIndexes({rowIndex:t.page*t.pageSize})}),rI(e,"rowCountChange",m),rI(e,"sortModelChange",v),rI(e,"filterModelChange",b);const y=s.useRef(!0);s.useEffect(()=>{y.current?y.current=!1:t.pagination&&e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{paginationModel:DB(e.pagination,t.signature,t.paginationModel)})}))},[e,t.paginationModel,t.signature,t.pagination]),s.useEffect(()=>{e.current.setState(e=>{const n=!0===t.pagination;return e.pagination.paginationMode===t.paginationMode&&e.pagination.enabled===n?e:f({},e,{pagination:f({},e.pagination,{paginationMode:t.paginationMode,enabled:n})})})},[e,t.paginationMode,t.pagination]),s.useEffect(h,[h])})(e,t),((e,t)=>{const n=bL(e,"useGridRowCount"),r=Dg(()=>lF(e).pageSize);e.current.registerControlState({stateId:"paginationRowCount",propModel:t.rowCount,propOnChange:t.onRowCountChange,stateSelector:sF,changeEvent:"rowCountChange"});const o=s.useCallback(t=>{sF(e)!==t&&(n.debug("Setting 'rowCount' to",t),e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{rowCount:t})})))},[e,n]);vL(e,{setRowCount:o},"public");const i=s.useCallback((n,r)=>{const o=sF(e);return r.exportOnlyDirtyModels&&null==t.rowCount&&null==t.initialState?.pagination?.rowCount?n:f({},n,{pagination:f({},n.pagination,{rowCount:o})})},[e,t.rowCount,t.initialState?.pagination?.rowCount]),a=s.useCallback((t,n)=>{const r=n.stateToRestore.pagination?.rowCount?n.stateToRestore.pagination.rowCount:sF(e);return e.current.setState(e=>f({},e,{pagination:f({},e.pagination,{rowCount:r})})),t},[e]);pN(e,"exportState",i),pN(e,"restoreState",a);const l=s.useCallback(n=>{"client"!==t.paginationMode&&r.current&&n.pageSize!==r.current&&(r.current=n.pageSize,-1===sF(e)&&e.current.setPage(0))},[t.paginationMode,r,e]);rI(e,"paginationModelChange",l),s.useEffect(()=>{"server"===t.paginationMode&&null!=t.rowCount&&e.current.setRowCount(t.rowCount)},[e,t.paginationMode,t.rowCount]),QM(e.current.store,()=>!(!1!==cF(e).hasNextPage)||("client"===t.paginationMode?TD(e):void 0),(t,n)=>{if(!0===n&&-1!==sF(e)){const t=TD(e),n=lF(e);e.current.setRowCount(n.pageSize*n.page+t)}else"number"==typeof n&&e.current.setRowCount(n)}),s.useEffect(()=>{"client"===t.paginationMode&&e.current.setRowCount(TD(e))},[e,t.paginationMode])})(e,t)},UB=(e,t)=>f({},e,{preferencePanel:t.initialState?.preferencePanel??{open:!1}}),GB=e=>{switch(e.type){case"boolean":return!1;case"date":case"dateTime":case"number":return;case"singleSelect":return null;default:return""}},KB=["id","field"],qB=["id","field"],YB=["id"],XB=["id"],QB=e=>f({},e,{editRows:{}}),ZB=(e,t,n)=>{((e,t)=>{const[n,r]=s.useState({}),o=s.useRef(n),i=s.useRef({}),{processRowUpdate:a,onProcessRowUpdateError:l,cellModesModel:c,onCellModesModelChange:u}=t,p=e=>(...n)=>{t.editMode===$I.Cell&&e(...n)},h=s.useCallback((t,n)=>{const r=e.current.getCellParams(t,n);if(!e.current.isCellEditable(r))throw new Error(`MUI X: The cell with id=${t} and field=${n} is not editable.`)},[e]),m=s.useCallback((t,n,r)=>{if(e.current.getCellMode(t,n)!==r)throw new Error(`MUI X: The cell with id=${t} and field=${n} is not in ${r} mode.`)},[e]),g=s.useCallback((t,n)=>{if(!t.isEditable)return;if(t.cellMode===zI.Edit)return;const r=f({},t,{reason:WI.cellDoubleClick});e.current.publishEvent("cellEditStart",r,n)},[e]),v=s.useCallback((t,n)=>{if(t.cellMode===zI.View)return;if(e.current.getCellMode(t.id,t.field)===zI.View)return;const r=f({},t,{reason:UI.cellFocusOut});e.current.publishEvent("cellEditStop",r,n)},[e]),b=s.useCallback((t,n)=>{if(t.cellMode===zI.Edit){if(229===n.which)return;let r;if("Escape"===n.key?r=UI.escapeKeyDown:"Enter"===n.key?r=UI.enterKeyDown:"Tab"===n.key&&(r=n.shiftKey?UI.shiftTabKeyDown:UI.tabKeyDown,n.preventDefault()),r){const o=f({},t,{reason:r});e.current.publishEvent("cellEditStop",o,n)}}else if(t.isEditable){let r;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:n,cellParams:t,editMode:"cell"}))return;if(LO(n)?r=WI.printableKeyDown:$O(n)?r=WI.pasteKeyDown:"Enter"===n.key?r=WI.enterKeyDown:"Backspace"!==n.key&&"Delete"!==n.key||(r=WI.deleteKeyDown),r){const o=f({},t,{reason:r,key:n.key});e.current.publishEvent("cellEditStart",o,n)}}},[e]),y=s.useCallback(t=>{const{id:n,field:r,reason:o}=t,i={id:n,field:r};o!==WI.printableKeyDown&&o!==WI.deleteKeyDown&&o!==WI.pasteKeyDown||(i.deleteValue=!0),e.current.startCellEditMode(i)},[e]),w=s.useCallback(t=>{const{id:n,field:r,reason:o}=t;let i;e.current.runPendingEditCellValueMutation(n,r),o===UI.enterKeyDown?i="below":o===UI.tabKeyDown?i="right":o===UI.shiftTabKeyDown&&(i="left");const a="escapeKeyDown"===o;e.current.stopCellEditMode({id:n,field:r,ignoreModifications:a,cellToFocusAfter:i})},[e]);var x;rI(e,"cellDoubleClick",p(g)),rI(e,"cellFocusOut",p(v)),rI(e,"cellKeyDown",p(b)),rI(e,"cellEditStart",p(y)),rI(e,"cellEditStop",p(w)),iI(e,"cellEditStart",t.onCellEditStart),iI(e,"cellEditStop",(x=t.onCellEditStop,async(...t)=>{if(x){const{id:n,field:r}=t[0],o=e.current.state.editRows,i=o[n][r]?.error;i||x(...t)}}));const S=s.useCallback((t,n)=>{const r=WL(e);return r[t]&&r[t][n]?zI.Edit:zI.View},[e]),C=Mg(n=>{const i=n!==t.cellModesModel;u&&i&&u(n,{api:e.current}),t.cellModesModel&&i||(r(n),o.current=n,e.current.publishEvent("cellModesModelChange",n))}),k=s.useCallback((e,t,n)=>{const r=f({},o.current);if(null!==n)r[e]=f({},r[e],{[t]:f({},n)});else{const n=d(r[e],[t].map(T));r[e]=n,0===Object.keys(r[e]).length&&delete r[e]}C(r)},[C]),E=s.useCallback((t,n,r)=>{e.current.setState(e=>{const o=f({},e.editRows);return null!==r?o[t]=f({},o[t],{[n]:f({},r)}):(delete o[t][n],0===Object.keys(o[t]).length&&delete o[t]),f({},e,{editRows:o})})},[e]),R=s.useCallback(e=>{const{id:t,field:n}=e,r=d(e,KB);h(t,n),m(t,n,zI.View),k(t,n,f({mode:zI.Edit},r))},[h,m,k]),P=Mg(async t=>{const{id:n,field:r,deleteValue:o,initialValue:i}=t,a=e.current.getCellValue(n,r);let l=a;o?l=GB(e.current.getColumn(r)):i&&(l=i);const s=e.current.getColumn(r),c=!!s.preProcessEditCellProps&&o;let u={value:l,error:!1,isProcessingProps:c};if(E(n,r,u),e.current.setCellFocus(n,r),c&&(u=await Promise.resolve(s.preProcessEditCellProps({id:n,row:e.current.getRow(n),props:u,hasChanged:l!==a})),e.current.getCellMode(n,r)===zI.Edit)){const t=WL(e);E(n,r,f({},u,{value:t[n][r].value,isProcessingProps:!1}))}}),M=s.useCallback(e=>{const{id:t,field:n}=e,r=d(e,qB);m(t,n,zI.Edit),k(t,n,f({mode:zI.View},r))},[m,k]),I=Mg(async n=>{const{id:r,field:o,ignoreModifications:s,cellToFocusAfter:c="none"}=n;m(r,o,zI.Edit),e.current.runPendingEditCellValueMutation(r,o);const u=()=>{E(r,o,null),k(r,o,null),"none"!==c&&e.current.moveFocusToRelativeCell(r,o,c)};if(s)return void u();const d=WL(e),{error:p,isProcessingProps:f}=d[r][o],h=e.current.getRow(r);if(p||f)return i.current[r][o].mode=zI.Edit,void k(r,o,{mode:zI.Edit});const g=e.current.getRowWithUpdatedValuesFromCellEditing(r,o);if(t.dataSource?.updateRow){if(JL(h,g))return void u();const t=()=>{i.current[r][o].mode=zI.Edit,k(r,o,{mode:zI.Edit})},n={rowId:r,updatedRow:g,previousRow:h};try{await e.current.dataSource.editRow(n),u()}catch{t()}}else if(a){const t=e=>{i.current[r][o].mode=zI.Edit,k(r,o,{mode:zI.Edit}),l&&l(e)};try{Promise.resolve(a(g,h,{rowId:r})).then(t=>{e.current.updateRows([t]),u()}).catch(t)}catch(e){t(e)}}else e.current.updateRows([g]),u()}),O=s.useCallback(async t=>{const{id:n,field:r,value:o,debounceMs:i,unstable_skipValueParser:a}=t;h(n,r),m(n,r,zI.Edit);const l=e.current.getColumn(r),s=e.current.getRow(n);let c=o;l.valueParser&&!a&&(c=l.valueParser(o,s,l,e));let u=WL(e),d=f({},u[n][r],{value:c,changeReason:i?"debouncedSetEditCellValue":"setEditCellValue"});if(l.preProcessEditCellProps){const e=o!==u[n][r].value;d=f({},d,{isProcessingProps:!0}),E(n,r,d),d=await Promise.resolve(l.preProcessEditCellProps({id:n,row:s,props:d,hasChanged:e}))}return e.current.getCellMode(n,r)!==zI.View&&(u=WL(e),d=f({},d,{isProcessingProps:!1}),d.value=l.preProcessEditCellProps?u[n][r].value:c,E(n,r,d),u=WL(e),!u[n]?.[r]?.error)},[e,h,m,E]),D=s.useCallback((t,n)=>{const r=e.current.getColumn(n),o=WL(e),i=e.current.getRow(t);if(!o[t]||!o[t][n])return e.current.getRow(t);const{value:a}=o[t][n];return r.valueSetter?r.valueSetter(a,i,r,e):f({},i,{[n]:a})},[e]),F={setCellEditingEditCellValue:O,getRowWithUpdatedValuesFromCellEditing:D};vL(e,{getCellMode:S,startCellEditMode:R,stopCellEditMode:M},"public"),vL(e,F,"private"),s.useEffect(()=>{c&&C(c)},[c,C]),Wh(()=>{const t=wT(e),r=i.current;i.current=LI(n),Object.entries(n).forEach(([n,o])=>{Object.entries(o).forEach(([o,i])=>{const a=r[n]?.[o]?.mode||zI.View,l=t[n]?e.current.getRowId(t[n]):n;i.mode===zI.Edit&&a===zI.View?P(f({id:l,field:o},i)):i.mode===zI.View&&a===zI.Edit&&I(f({id:l,field:o},i))})})},[e,n,P,I])})(e,t),((e,t)=>{const[n,r]=s.useState({}),o=s.useRef(n),i=s.useRef({}),a=s.useRef({}),l=s.useRef(void 0),c=s.useRef(null),{processRowUpdate:u,onProcessRowUpdateError:p,rowModesModel:h,onRowModesModelChange:m}=t,g=e=>(...n)=>{t.editMode===$I.Row&&e(...n)},v=s.useCallback((t,n)=>{const r=e.current.getCellParams(t,n);if(!e.current.isCellEditable(r))throw new Error(`MUI X: The cell with id=${t} and field=${n} is not editable.`)},[e]),b=s.useCallback((t,n)=>{if(e.current.getRowMode(t)!==n)throw new Error(`MUI X: The row with id=${t} is not in ${n} mode.`)},[e]),y=s.useCallback(t=>{const n=WL(e);return Object.values(n[t]).some(e=>e.error)},[e]),w=s.useCallback((t,n)=>{if(!t.isEditable)return;if(e.current.getRowMode(t.id)===jI.Edit)return;const r=f({},e.current.getRowParams(t.id),{field:t.field,reason:GI.cellDoubleClick});e.current.publishEvent("rowEditStart",r,n)},[e]),x=s.useCallback(e=>{c.current=e},[]),S=s.useCallback((t,n)=>{t.isEditable&&e.current.getRowMode(t.id)!==jI.View&&(c.current=null,l.current=setTimeout(()=>{if(c.current?.id!==t.id){if(!e.current.getRow(t.id))return;if(e.current.getRowMode(t.id)===jI.View)return;if(y(t.id))return;const r=f({},e.current.getRowParams(t.id),{field:t.field,reason:KI.rowFocusOut});e.current.publishEvent("rowEditStop",r,n)}}))},[e,y]);s.useEffect(()=>()=>{clearTimeout(l.current)},[]);const C=s.useCallback((t,n)=>{if(t.cellMode===jI.Edit){if(229===n.which)return;let r;if("Escape"===n.key)r=KI.escapeKeyDown;else if("Enter"===n.key)r=KI.enterKeyDown;else if("Tab"===n.key){const o=uO(e).filter(n=>e.current.getColumn(n).type===ZO||e.current.isCellEditable(e.current.getCellParams(t.id,n)));if(n.shiftKey?t.field===o[0]&&(r=KI.shiftTabKeyDown):t.field===o[o.length-1]&&(r=KI.tabKeyDown),n.preventDefault(),!r){const r=o.findIndex(e=>e===t.field),i=o[n.shiftKey?r-1:r+1];e.current.setCellFocus(t.id,i)}}if(r){if(r!==KI.escapeKeyDown&&y(t.id))return;const o=f({},e.current.getRowParams(t.id),{reason:r,field:t.field});e.current.publishEvent("rowEditStop",o,n)}}else if(t.isEditable){let r;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:n,cellParams:t,editMode:"row"}))return;if(LO(n)||$O(n)?r=GI.printableKeyDown:"Enter"===n.key?r=GI.enterKeyDown:"Backspace"!==n.key&&"Delete"!==n.key||(r=GI.deleteKeyDown),r){const o=f({},e.current.getRowParams(t.id),{field:t.field,reason:r});e.current.publishEvent("rowEditStart",o,n)}}},[e,y]),k=s.useCallback(t=>{const{id:n,field:r,reason:o}=t,i={id:n,fieldToFocus:r};o!==GI.printableKeyDown&&o!==GI.deleteKeyDown||(i.deleteValue=!!r),e.current.startRowEditMode(i)},[e]),E=s.useCallback(t=>{const{id:n,reason:r,field:o}=t;let i;e.current.runPendingEditCellValueMutation(n),r===KI.enterKeyDown?i="below":r===KI.tabKeyDown?i="right":r===KI.shiftTabKeyDown&&(i="left");const a="escapeKeyDown"===r;e.current.stopRowEditMode({id:n,ignoreModifications:a,field:o,cellToFocusAfter:i})},[e]);rI(e,"cellDoubleClick",g(w)),rI(e,"cellFocusIn",g(x)),rI(e,"cellFocusOut",g(S)),rI(e,"cellKeyDown",g(C)),rI(e,"rowEditStart",g(k)),rI(e,"rowEditStop",g(E)),iI(e,"rowEditStart",t.onRowEditStart),iI(e,"rowEditStop",t.onRowEditStop);const R=s.useCallback(n=>UL(e,{rowId:n,editMode:t.editMode})?jI.Edit:jI.View,[e,t.editMode]),P=Mg(n=>{const i=n!==t.rowModesModel;m&&i&&m(n,{api:e.current}),t.rowModesModel&&i||(r(n),o.current=n,e.current.publishEvent("rowModesModelChange",n))}),M=s.useCallback((e,t)=>{const n=f({},o.current);null!==t?n[e]=f({},t):delete n[e],P(n)},[P]),I=s.useCallback((t,n)=>{e.current.setState(e=>{const r=f({},e.editRows);return null!==n?r[t]=n:delete r[t],f({},e,{editRows:r})})},[e]),O=s.useCallback((t,n,r)=>{e.current.setState(e=>{const o=f({},e.editRows);return null!==r?o[t]=f({},o[t],{[n]:f({},r)}):(delete o[t][n],0===Object.keys(o[t]).length&&delete o[t]),f({},e,{editRows:o})})},[e]),D=s.useCallback(e=>{const{id:t}=e,n=d(e,YB);b(t,jI.View),M(t,f({mode:jI.Edit},n))},[b,M]),F=Mg(t=>{const{id:n,fieldToFocus:r,deleteValue:o,initialValue:i}=t,l=e.current.getRow(n),s=aO(e),c=s.reduce((t,a)=>{const l=a.field;if(!e.current.getCellParams(n,l).isEditable)return t;const s=e.current.getColumn(l);let c=e.current.getCellValue(n,l);return r===l&&(o||i)&&(o?c=GB(s):i&&(c=i)),t[l]={value:c,error:!1,isProcessingProps:s.editable&&!!s.preProcessEditCellProps&&o},t},{});a.current[n]=l,I(n,c),r&&e.current.setCellFocus(n,r),s.filter(t=>e.current.getCellParams(n,t.field).isEditable&&t.editable&&!!t.preProcessEditCellProps&&o).forEach(t=>{const r=t.field,a=e.current.getCellValue(n,r),s=o?GB(t):i??a;Promise.resolve(t.preProcessEditCellProps({id:n,row:l,props:c[r],hasChanged:s!==a})).then(t=>{if(e.current.getRowMode(n)===jI.Edit){const o=WL(e);O(n,r,f({},t,{value:o[n][r].value,isProcessingProps:!1}))}})})}),L=s.useCallback(e=>{const{id:t}=e,n=d(e,XB);b(t,jI.Edit),M(t,f({mode:jI.View},n))},[b,M]),A=Mg(async n=>{const{id:r,ignoreModifications:o,field:l,cellToFocusAfter:s="none"}=n;e.current.runPendingEditCellValueMutation(r);const c=()=>{"none"!==s&&l&&e.current.moveFocusToRelativeCell(r,l,s),I(r,null),M(r,null),delete a.current[r]};if(o)return void c();const d=WL(e),f=a.current[r];if(Object.values(d[r]).some(e=>e.isProcessingProps))return void(i.current[r].mode=jI.Edit);if(y(r))return i.current[r].mode=jI.Edit,void M(r,{mode:jI.Edit});const h=e.current.getRowWithUpdatedValuesFromRowEditing(r);if(t.dataSource?.updateRow){if(JL(f,h))return void c();const t=()=>{i.current[r].mode=jI.Edit,M(r,{mode:jI.Edit})},n={rowId:r,updatedRow:h,previousRow:f};try{await e.current.dataSource.editRow(n),c()}catch{t()}}else if(u){const t=e=>{i.current[r]&&(i.current[r].mode=jI.Edit,M(r,{mode:jI.Edit})),p&&p(e)};try{Promise.resolve(u(h,f,{rowId:r})).then(t=>{e.current.updateRows([t]),c()}).catch(t)}catch(e){t(e)}}else e.current.updateRows([h]),c()}),N=s.useCallback(t=>{const{id:n,field:r,value:o,debounceMs:i,unstable_skipValueParser:a}=t;v(n,r);const l=e.current.getColumn(r),s=e.current.getRow(n);let c=o;l.valueParser&&!a&&(c=l.valueParser(o,s,l,e));let u=WL(e),p=f({},u[n][r],{value:c,changeReason:i?"debouncedSetEditCellValue":"setEditCellValue"});return l.preProcessEditCellProps||O(n,r,p),new Promise(t=>{const o=[];if(l.preProcessEditCellProps){const i=p.value!==u[n][r].value;p=f({},p,{isProcessingProps:!0}),O(n,r,p);const a=d(u[n],[r].map(T)),h=Promise.resolve(l.preProcessEditCellProps({id:n,row:s,props:p,hasChanged:i,otherFieldsProps:a})).then(o=>{e.current.getRowMode(n)!==jI.View?(u=WL(e),(o=f({},o,{isProcessingProps:!1})).value=l.preProcessEditCellProps?u[n][r].value:c,O(n,r,o)):t(!1)});o.push(h)}Object.entries(u[n]).forEach(([i,a])=>{if(i===r)return;const l=e.current.getColumn(i);if(!l.preProcessEditCellProps)return;a=f({},a,{isProcessingProps:!0}),O(n,i,a),u=WL(e);const c=d(u[n],[i].map(T)),p=Promise.resolve(l.preProcessEditCellProps({id:n,row:s,props:a,hasChanged:!1,otherFieldsProps:c})).then(r=>{e.current.getRowMode(n)!==jI.View?(r=f({},r,{isProcessingProps:!1}),O(n,i,r)):t(!1)});o.push(p)}),Promise.all(o).then(()=>{e.current.getRowMode(n)===jI.Edit?(u=WL(e),t(!u[n][r].error)):t(!1)})})},[e,v,O]),$=s.useCallback(t=>{const n=WL(e),r=e.current.getRow(t);if(!n[t])return e.current.getRow(t);let o=f({},a.current[t],r);return Object.entries(n[t]).forEach(([t,n])=>{const r=e.current.getColumn(t);r?.valueSetter?o=r.valueSetter(n.value,o,r,e):o[t]=n.value}),o},[e]),z={setRowEditingEditCellValue:N,getRowWithUpdatedValuesFromRowEditing:$};vL(e,{getRowMode:R,startRowEditMode:D,stopRowEditMode:L},"public"),vL(e,z,"private"),s.useEffect(()=>{h&&P(h)},[h,P]),Wh(()=>{const t=wT(e),r=i.current;i.current=LI(n);const o=new Set([...Object.keys(n),...Object.keys(r)]);Array.from(o).forEach(o=>{const i=n[o]??{mode:jI.View},a=r[o]?.mode||jI.View,l=t[o]?e.current.getRowId(t[o]):o;i.mode===jI.Edit&&a===jI.View?F(f({id:l},i)):i.mode===jI.View&&a===jI.Edit&&A(f({id:l},i))})},[e,n,F,A])})(e,t);const r=s.useRef({}),{isCellEditable:o}=t,i=n.hooks.useIsCellEditable(e,t),a=s.useCallback(e=>!!i(e)&&(!!e.colDef.editable&&(!!e.colDef.renderEditCell&&(!o||o(e)))),[o,i]);s.useEffect(()=>{const e=r.current;return()=>{Object.entries(e).forEach(([t,n])=>{Object.keys(n).forEach(n=>{const[r]=e[t][n];clearTimeout(r),delete e[t][n]})})}},[]);const l=s.useCallback((e,t)=>{if(r.current[e])if(t){if(r.current[e][t]){const[,n]=r.current[e][t];n()}}else Object.keys(r.current[e]).forEach(t=>{const[,n]=r.current[e][t];n()})},[]),c=s.useCallback(n=>{const{id:o,field:i,debounceMs:a}=n;return new Promise(l=>{((e,t,n,o)=>{if(!n)return void o();if(r.current[e]||(r.current[e]={}),r.current[e][t]){const[n]=r.current[e][t];clearTimeout(n)}const i=setTimeout(()=>{o(),delete r.current[e][t]},n);r.current[e][t]=[i,()=>{const[n]=r.current[e][t];clearTimeout(n),o(),delete r.current[e][t]}]})(o,i,a,async()=>{const r=t.editMode===$I.Row?e.current.setRowEditingEditCellValue:e.current.setCellEditingEditCellValue;if(e.current.getCellMode(o,i)===zI.Edit){const e=await r(n);l(e)}})})},[e,t.editMode]),u=s.useCallback((n,r)=>t.editMode===$I.Cell?e.current.getRowWithUpdatedValuesFromCellEditing(n,r):e.current.getRowWithUpdatedValuesFromRowEditing(n),[e,t.editMode]),p=s.useCallback((t,n)=>{const r=WL(e);return r[t]?.[n]??null},[e]),h={runPendingEditCellValueMutation:l};vL(e,{isCellEditable:a,setEditCellValue:c,getRowWithUpdatedValues:u,unstable_getEditCellMeta:p},"public"),vL(e,h,"private")},JB=(e,t,n)=>{const r=!!t.dataSource;return n.current.caches.rows=AT({rows:r?[]:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),f({},e,{rows:$T({apiRef:n,rowCountProp:t.rowCount,loadingProp:!!r||t.loading,previousTree:null,previousTreeDepths:null})})},e_=e=>"full"===e.updates.type?(e=>{const t={[OT]:f({},{type:"group",id:OT,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null},{children:e})};for(let n=0;n<e.length;n+=1){const r=e[n];t[r]={id:r,depth:0,parent:OT,type:"leaf",groupingKey:null}}return{groupingName:hB,tree:t,treeDepths:{0:e.length},dataRowIds:e}})(e.updates.rows):(({previousTree:e,actions:t})=>{const n=f({},e),r={};for(let e=0;e<t.remove.length;e+=1){const o=t.remove[e];r[o]=!0,delete n[o]}for(let e=0;e<t.insert.length;e+=1){const r=t.insert[e];n[r]={id:r,depth:0,parent:OT,type:"leaf",groupingKey:null}}const o=n[OT];let i=[...o.children,...t.insert];return Object.values(r).length&&(i=i.filter(e=>!r[e])),n[OT]=f({},o,{children:i}),{groupingName:hB,tree:n,treeDepths:{0:i.length},dataRowIds:i}})({previousTree:e.previousTree,actions:e.updates.actions});class t_ extends Error{}function n_(e,t,n){const r=s.useCallback(t=>({field:t,colDef:e.current.getColumn(t)}),[e]),o=s.useCallback(t=>{const n=e.current.getRow(t);if(!n)throw new t_(`No row with id #${t} found`);return{id:t,columns:e.current.getAllColumns(),row:n}},[e]),i=s.useCallback((t,n,r,{cellMode:o,colDef:i,hasFocus:a,rowNode:l,tabIndex:s,value:c,formattedValue:u})=>{const d={id:t,field:n,row:r,rowNode:l,colDef:i,cellMode:o,hasFocus:a,tabIndex:s,value:void 0!==c?c:e.current.getRowValue(r,i),formattedValue:void 0!==u?u:e.current.getRowFormattedValue(r,i),isEditable:!1,api:e.current};return d.isEditable=i&&e.current.isCellEditable(d),d},[e]),a=s.useCallback((n,r)=>{const o=e.current.getRow(n),i=ST(e,n);if(!o||!i)throw new t_(`No row with id #${n} found`);const a=YD(e),l=JD(e),s=e.current.getCellMode(n,r);return e.current.getCellParamsForRow(n,r,o,{colDef:t.listView&&t.listViewColumn?.field===r?nO(e):e.current.getColumn(r),rowNode:i,hasFocus:null!==a&&a.field===r&&a.id===n,tabIndex:l&&l.field===r&&l.id===n?0:-1,cellMode:s})},[e,t.listView,t.listViewColumn?.field]),l=s.useCallback(t=>e.current.rootElementRef.current?function(e,t){return e.querySelector(`[role="columnheader"][data-field="${m$(t)}"]`)}(e.current.rootElementRef.current,t):null,[e]),c=s.useCallback(t=>e.current.rootElementRef.current?function(e,t){return e.querySelector(g$(t))}(e.current.rootElementRef.current,t):null,[e]),u=s.useCallback((t,n)=>e.current.rootElementRef.current?function(e,{id:t,field:n}){const r=`${g$(t)} .${XT.cell}[data-field="${m$(n)}"]`;return e.querySelector(r)}(e.current.rootElementRef.current,{id:t,field:n}):null,[e]),d=n.hooks.useGridParamsOverridableMethods(e),p={getCellValue:d.getCellValue,getCellParams:a,getCellElement:u,getRowValue:d.getRowValue,getRowFormattedValue:d.getRowFormattedValue,getRowParams:o,getRowElement:c,getColumnHeaderParams:r,getColumnHeaderElement:l},f={getCellParamsForRow:i};vL(e,p,"public"),vL(e,f,"private")}const r_={type:"include",ids:new Set},o_=(e,t)=>f({},e,{rowSelection:t.rowSelection?t.rowSelectionModel??r_:r_}),i_=(e,t)=>{const n=(e=>{const{classes:t}=e;return s.useMemo(()=>wm({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},YT,t),[t])})({classes:t.classes}),r=s.useCallback(r=>{const o=f({},wF,{cellClassName:n.cellCheckbox,headerClassName:n.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),i=t.checkboxSelection,a=null!=r.lookup[yF];return i&&!a?(r.lookup[yF]=o,r.orderedFields=[yF,...r.orderedFields]):!i&&a?(delete r.lookup[yF],r.orderedFields=r.orderedFields.filter(e=>e!==yF)):i&&a&&(r.lookup[yF]=f({},o,r.lookup[yF]),t.columns.some(e=>e.field===yF)||(r.orderedFields=[yF,...r.orderedFields.filter(e=>e!==yF)])),r},[e,n,t.columns,t.checkboxSelection]);pN(e,"hydrateColumns",r)},a_=(e,t)=>{const n=t.sortModel??t.initialState?.sorting?.sortModel??[];return f({},e,{sorting:{sortModel:wI(n,t.disableMultipleColumnsSorting),sortedRows:[]}})};function l_(e){const{containerSize:t,scrollPosition:n,elementSize:r,elementOffset:o}=e,i=o+r;return r>t?o:i-t>n?i-t:o<n?o:void 0}const s_={width:0,height:0},c_={isReady:!1,root:s_,viewportOuterSize:s_,viewportInnerSize:s_,contentSize:s_,minimumSize:s_,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,headerHeight:0,groupHeaderHeight:0,headerFilterHeight:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,headersTotalHeight:0,topContainerHeight:0,bottomContainerHeight:0,autoHeight:!1,minimalContentHeight:void 0},u_=(e,t,n)=>{const r=f({},c_,function(e,t,n,r){const o=WT(e.rowHeight,dN.rowHeight);return{rowHeight:Math.floor(o*n),headerHeight:Math.floor(e.columnHeaderHeight*n),groupHeaderHeight:Math.floor((e.columnGroupHeaderHeight??e.columnHeaderHeight)*n),headerFilterHeight:Math.floor((e.headerFilterHeight??e.columnHeaderHeight)*n),columnsTotalWidth:d_(t),headersTotalHeight:lL(t,e),leftPinnedWidth:r.left.reduce((e,t)=>e+t.computedWidth,0),rightPinnedWidth:r.right.reduce((e,t)=>e+t.computedWidth,0)}}(t,n,mI(n),pO(n)));return n.current.store.state.dimensions=r,f({},e,{dimensions:r})},d_=eT(cO,hO,(e,t)=>{const n=e.length;return 0===n?0:eA(t[n-1]+e[n-1].computedWidth,1)});function p_(e,t){const n=(t,n)=>e.style.setProperty(t,n);n("--DataGrid-hasScrollX",`${Number(t.hasScrollX)}`),n("--DataGrid-hasScrollY",`${Number(t.hasScrollY)}`),n("--DataGrid-scrollbarSize",`${t.scrollbarSize}px`),n("--DataGrid-rowWidth",`${t.rowWidth}px`),n("--DataGrid-columnsTotalWidth",`${t.columnsTotalWidth}px`),n("--DataGrid-leftPinnedWidth",`${t.leftPinnedWidth}px`),n("--DataGrid-rightPinnedWidth",`${t.rightPinnedWidth}px`),n("--DataGrid-headerHeight",`${t.headerHeight}px`),n("--DataGrid-headersTotalHeight",`${t.headersTotalHeight}px`),n("--DataGrid-topContainerHeight",`${t.topContainerHeight}px`),n("--DataGrid-bottomContainerHeight",`${t.bottomContainerHeight}px`),n("--height",`${t.rowHeight}px`)}const f_=["groupId","children"],h_=e=>{const t={};for(let n=0;n<e.length;n+=1){const r=e[n];if(qI(r))continue;const{groupId:o,children:i}=r,a=d(r,f_);if(!o)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");const l=f({},a,{groupId:o}),s=h_(i);if(void 0!==s[o]||void 0!==t[o])throw new Error(`MUI X: The groupId ${o} is used multiple times in the columnGroupingModel.`);Object.assign(t,s),t[o]=l}return t},m_=(e,t,n)=>{if(qI(e)){if(void 0!==n[e.field])throw new Error(["MUI X: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join("\n"));return void(n[e.field]=t)}const{groupId:r,children:o}=e;o.forEach(e=>{m_(e,[...t,r],n)})},g_=e=>{if(!e)return{};const t={};return e.forEach(e=>{m_(e,[],t)}),t},v_=(e,t,n)=>{const r=e=>t[e]??[],o=[],i=Math.max(0,...e.map(e=>r(e).length)),a=(e,t,n)=>{const o=r(e),i=r(t);for(let e=0;e<=n;e+=1)if(o[e]!==i[e])return!1;return!0},l=(e,t)=>{const r=n?.left,o=n?.right,i=!!r?.includes(e),a=!!r?.includes(t),l=!!o?.includes(e),s=!!o?.includes(t);return i!==a||l!==s};for(let t=0;t<i;t+=1){const n=[];for(let o=0;o<e.length;o+=1){const i=e[o],s=r(i)[t]??null;if(0===n.length){n.push({columnFields:[i],groupId:s});continue}const c=n[n.length-1],u=c.columnFields[c.columnFields.length-1];c.groupId!==s||!a(u,i,t)||l(u,i)?n.push({columnFields:[i],groupId:s}):c.columnFields.push(i)}o.push(n)}return o},b_=(e,t,n)=>{if(n.current.caches.columnGrouping={lastColumnGroupingModel:t.columnGroupingModel},!t.columnGroupingModel)return f({},e,{columnGrouping:void 0});const r=oO(n),o=uO(n),i=h_(t.columnGroupingModel??[]),a=g_(t.columnGroupingModel??[]),l=v_(r,a,n.current.state.pinnedColumns??{}),s=0===o.length?0:Math.max(...o.map(e=>a[e]?.length??0));return f({},e,{columnGrouping:{lookup:i,unwrappedGroupingModel:a,headerStructure:l,maxDepth:s}})};function y_(e,t){if(void 0!==t&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){const r=e.changedTouches[n];if(r.identifier===t)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function w_(e,t,n,r){let o=e;return o+="Right"===r?t-n.left:n.right-t,Math.round(o)}function x_(e,t){return t===ZI.LEFT?e?"--DataGrid-rightPinnedWidth":"--DataGrid-leftPinnedWidth":e?"--DataGrid-leftPinnedWidth":"--DataGrid-rightPinnedWidth"}function S_(e,t,n){return n===ZI.LEFT?t?e.rightPinnedWidth:e.leftPinnedWidth:t?e.leftPinnedWidth:e.rightPinnedWidth}function C_(e){e.preventDefault(),e.stopImmediatePropagation()}function k_(e){const t=s.useRef(void 0),n=()=>VA(e),r=pI(e,n);s.useEffect(()=>{t.current&&!1===r&&(t.current.resolve(),t.current=void 0)});return()=>{if(!t.current){if(!1===n())return Promise.resolve();t.current=function(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}()}return t.current}}function E_(e,t,n){const r={},o=e.current.rootElementRef.current;return o.classList.add(XT.autosizing),n.forEach(n=>{const o=function(e,t){const n=e.virtualScrollerRef.current;return Array.from(n.querySelectorAll(`:scope > div > div > div > [data-field="${m$(t)}"][role="gridcell"]`))}(e.current,n.field),i=o.map(e=>e.getBoundingClientRect().width??0),a=t.includeOutliers?i:function(e,t){if(e.length<4)return e;const n=e.slice();n.sort((e,t)=>e-t);const r=n[Math.floor(.25*n.length)],o=n[Math.floor(.75*n.length)-1],i=o-r,a=i<5?5:i*t;return n.filter(e=>e>r-a&&e<o+a)}(i,t.outliersFactor);if(t.includeHeaders){const t=(l=e.current,s=n.field,l.columnHeadersContainerRef.current.querySelector(`:scope > div > [data-field="${m$(s)}"][role="columnheader"]`));if(t){const e=t.querySelector(`.${XT.columnHeaderTitleContainer}`),n=Array.from(e.children),r=t.querySelector(`.${XT.menuIcon}`),o=window.getComputedStyle(e,null),i=parseInt(o.gap,10)||0,l=window.getComputedStyle(t,null),s=parseInt(l.paddingLeft,10)+parseInt(l.paddingRight,10);let c=0,u=0;for(let e=0;e<n.length;e+=1){const t=n[e];t.clientWidth>0&&(c+=1,u+=t.scrollWidth)}u+=1;const d=u+i*(c-1)+s+(r?.clientWidth??0);a.push(d)}}var l,s;const c=n.minWidth!==-1/0&&void 0!==n.minWidth,u=n.maxWidth!==1/0&&void 0!==n.maxWidth,d=c?n.minWidth:0,p=u?n.maxWidth:1/0,f=0===a.length?0:Math.max(...a);r[n.field]=FI(f,d,p)}),o.classList.remove(XT.autosizing),r}const R_=e=>f({},e,{columnResize:{resizingColumnField:""}});function P_(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const M_=(e,t)=>{const n=um(),r=bL(e,"useGridColumnResize"),o=Dg(P_).current,i=s.useRef(null),a=s.useRef(null),l=Ng(),c=s.useRef(void 0),u=t=>{r.debug(`Updating width to ${t} for col ${o.colDef.field}`);const i=o.columnHeaderElement.offsetWidth,a=t-i,l=t-o.initialColWidth;if(l>0){const t=o.initialTotalWidth+l;e.current.rootElementRef?.current?.style.setProperty("--DataGrid-rowWidth",`${t}px`)}o.colDef.computedWidth=t,o.colDef.width=t,o.colDef.flex=0,o.columnHeaderElement.style.width=`${t}px`;const s=o.headerFilterElement;s&&(s.style.width=`${t}px`),o.groupHeaderElements.forEach(e=>{const n=e;let r;r="1"===n.getAttribute("aria-colspan")?`${t}px`:`${n.offsetWidth+a}px`,n.style.width=r}),o.cellElements.forEach(e=>{const n=e;let r;r="1"===n.getAttribute("aria-colspan")?`${t}px`:`${n.offsetWidth+a}px`,n.style.setProperty("--width",r)});const c=oT(e),u=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);u===ZI.LEFT&&(T_(o.fillerLeft,"width",a),o.leftPinnedCellsAfter.forEach(e=>{T_(e,"left",a)}),o.leftPinnedHeadersAfter.forEach(e=>{T_(e,"left",a)}),e.current.rootElementRef?.current?.style.setProperty(x_(n,u),`${S_(c,n,u)+l}px`)),u===ZI.RIGHT&&(T_(o.fillerRight,"width",a),o.rightPinnedCellsBefore.forEach(e=>{T_(e,"right",a)}),o.rightPinnedHeadersBefore.forEach(e=>{T_(e,"right",a)}),e.current.rootElementRef?.current?.style.setProperty(x_(n,u),`${S_(c,n,u)+l}px`))},d=t=>{if(y(),o.previousMouseClickEvent){const n=o.previousMouseClickEvent,r=n.timeStamp,i=n.clientX,a=n.clientY;if(t.timeStamp-r<300&&t.clientX===i&&t.clientY===a)return o.previousMouseClickEvent=void 0,void e.current.publishEvent("columnResizeStop",null,t)}if(o.colDef){e.current.setColumnWidth(o.colDef.field,o.colDef.width),r.debug(`Updating col ${o.colDef.field} with new width: ${o.colDef.width}`);const t=rO(e);o.groupHeaderElements.forEach(e=>{const n=e,r=`${e.getAttribute("data-fields").slice(2,-2).split("-|-").reduce((e,n)=>!1!==t.columnVisibilityModel[n]?e+t.lookup[n].computedWidth:e,0)}px`;n.style.width=r})}l.start(0,()=>{e.current.publishEvent("columnResizeStop",null,t)})},p=(t,r,l)=>{const s=e.current.rootElementRef.current;var c,u;o.initialColWidth=t.computedWidth,o.initialTotalWidth=e.current.getRootDimensions().rowWidth,o.colDef=t,o.columnHeaderElement=(c=e.current.columnHeadersContainerRef.current,u=t.field,c.querySelector(`[data-field="${m$(u)}"]`));const d=s.querySelector(`.${XT.headerFilterRow} [data-field="${m$(t.field)}"]`);d&&(o.headerFilterElement=d),o.groupHeaderElements=function(e,t){return Array.from(e.querySelectorAll(`[data-fields*="|-${m$(t)}-|"]`)??[])}(e.current.columnHeadersContainerRef?.current,t.field),o.cellElements=function(e,t){if(!h$(e,XT.root))throw new Error("MUI X: The root element is not found.");const n=e.getAttribute("aria-colindex");if(!n)return[];const r=Number(n)-1,o=[];return t.virtualScrollerRef?.current?(x$(t).forEach(e=>{const n=e.getAttribute("data-id");if(!n)return;let i=r;const a=t.unstable_getCellColSpanInfo(n,r);a&&a.spannedByColSpan&&(i=a.leftVisibleCellIndex);const l=e.querySelector(`[data-colindex="${i}"]`);l&&o.push(l)}),o):[]}(o.columnHeaderElement,e.current),o.fillerLeft=b$(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),o.fillerRight=b$(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const p=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);o.leftPinnedCellsAfter=p!==ZI.LEFT?[]:function(e,t,n){const r=S$(t);return y$({api:e,colIndex:r,position:n?"right":"left",filterFn:e=>n?e<r:e>r})}(e.current,o.columnHeaderElement,n),o.rightPinnedCellsBefore=p!==ZI.RIGHT?[]:function(e,t,n){const r=S$(t);return y$({api:e,colIndex:r,position:n?"left":"right",filterFn:e=>n?e>r:e<r})}(e.current,o.columnHeaderElement,n),o.leftPinnedHeadersAfter=p!==ZI.LEFT?[]:function(e,t,n){const r=S$(t);return w$({api:e,position:n?"right":"left",colIndex:r,filterFn:e=>n?e<r:e>r})}(e.current,o.columnHeaderElement,n),o.rightPinnedHeadersBefore=p!==ZI.RIGHT?[]:function(e,t,n){const r=S$(t);return w$({api:e,position:n?"left":"right",colIndex:r,filterFn:(e,t)=>!t.classList.contains(XT["columnHeader--last"])&&(n?e>r:e<r)})}(e.current,o.columnHeaderElement,n),a.current=function(e,t){const n=e.classList.contains(XT["columnSeparator--sideRight"])?"Right":"Left";return t?function(e){return"Right"===e?"Left":"Right"}(n):n}(r,n),i.current=function(e,t,n){return"Left"===n?e-t.left:t.right-e}(l,o.columnHeaderElement.getBoundingClientRect(),a.current)},h=Mg(d),m=Mg(t=>{if(0===t.buttons)return void h(t);let n=w_(i.current,t.clientX,o.columnHeaderElement.getBoundingClientRect(),a.current);n=FI(n,o.colDef.minWidth,o.colDef.maxWidth),u(n);const r={element:o.columnHeaderElement,colDef:o.colDef,width:n};e.current.publishEvent("columnResize",r,t)}),g=Mg(e=>{y_(e,c.current)&&d(e)}),v=Mg(t=>{const n=y_(t,c.current);if(!n)return;if("mousemove"===t.type&&0===t.buttons)return void g(t);let r=w_(i.current,n.x,o.columnHeaderElement.getBoundingClientRect(),a.current);r=FI(r,o.colDef.minWidth,o.colDef.maxWidth),u(r);const l={element:o.columnHeaderElement,colDef:o.colDef,width:r};e.current.publishEvent("columnResize",l,t)}),b=Mg(t=>{const n=h$(t.target,XT["columnSeparator--resizable"]);if(!n)return;const o=t.changedTouches[0];null!=o&&(c.current=o.identifier);const i=h$(t.target,XT.columnHeader),a=i.getAttribute("data-field");const l=e.current.getColumn(a);r.debug(`Start Resize on col ${l.field}`),e.current.publishEvent("columnResizeStart",{field:a},t),p(l,n,o.clientX);const s=kg(t.currentTarget);s.addEventListener("touchmove",v),s.addEventListener("touchend",g)}),y=s.useCallback(()=>{const t=kg(e.current.rootElementRef.current);t.body.style.removeProperty("cursor"),t.removeEventListener("mousemove",m),t.removeEventListener("mouseup",h),t.removeEventListener("touchmove",v),t.removeEventListener("touchend",g),setTimeout(()=>{t.removeEventListener("click",C_,!0)},100),o.columnHeaderElement&&(o.columnHeaderElement.style.pointerEvents="unset")},[e,o,m,h,v,g]),w=s.useCallback(({field:t})=>{e.current.setState(e=>f({},e,{columnResize:f({},e.columnResize,{resizingColumnField:t})}))},[e]),x=s.useCallback(()=>{e.current.setState(e=>f({},e,{columnResize:f({},e.columnResize,{resizingColumnField:""})}))},[e]),S=Mg(({colDef:t},n)=>{if(0!==n.button)return;if(!n.currentTarget.classList.contains(XT["columnSeparator--resizable"]))return;n.preventDefault(),r.debug(`Start Resize on col ${t.field}`),e.current.publishEvent("columnResizeStart",{field:t.field},n),p(t,n.currentTarget,n.clientX);const i=kg(e.current.rootElementRef.current);i.body.style.cursor="col-resize",o.previousMouseClickEvent=n.nativeEvent,i.addEventListener("mousemove",m),i.addEventListener("mouseup",h),i.addEventListener("click",C_,!0)}),C=Mg((n,r)=>{if(t.disableAutosize)return;if(0!==r.button)return;const o=e.current.state.columns.lookup[n.field];!1!==o.resizable&&e.current.autosizeColumns(f({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[o.field]}))}),k=k_(e),E=s.useRef(!1),R=s.useCallback(async n=>{const r=e.current.rootElementRef?.current;if(!r)return;if(E.current)return;E.current=!0;const o=rO(e),i=f({},VL,n,{columns:n?.columns??o.orderedFields});i.columns=i.columns.filter(e=>!1!==o.columnVisibilityModel[e]);const a=i.columns.map(t=>e.current.state.columns.lookup[t]);try{!t.disableVirtualization&&i.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await k());const n=E_(e,i,a),r=a.map(e=>f({},e,{width:n[e.field],computedWidth:n[e.field],flex:0}));if(i.expand){const t=o.orderedFields.map(e=>o.lookup[e]).filter(e=>!1!==o.columnVisibilityModel[e.field]).reduce((e,t)=>e+(n[t.field]??t.computedWidth??t.width),0),i=e.current.getRootDimensions(),a=i.viewportInnerSize.width-t;if(a>0){const e=a/(r.length||1);r.forEach(t=>{t.width+=e,t.computedWidth+=e})}}e.current.updateColumns(r),r.forEach((t,n)=>{if(t.width!==a[n].width){const n=t.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(t.field),colDef:t,width:n})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),E.current=!1}},[e,k,t.disableVirtualization]);s.useEffect(()=>y,[y]),Lg(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),yL(e,()=>e.current.columnHeadersContainerRef?.current,"touchstart",b,{passive:!0}),vL(e,{autosizeColumns:R},"public"),rI(e,"columnResizeStop",x),rI(e,"columnResizeStart",w),rI(e,"columnSeparatorMouseDown",S),rI(e,"columnSeparatorDoubleClick",C),iI(e,"columnResize",t.onColumnResize),iI(e,"columnWidthChange",t.onColumnWidthChange)};function T_(e,t,n){e&&(e.style[t]=`${Math.round(parseFloat(e.style[t]))+n}px`)}function I_(e){return 0!==e.firstRowIndex||0!==e.lastRowIndex}const O_=(e,t,n)=>{if(!e)return null;const r=e[t.field];return t.rowSpanValueGetter?t.rowSpanValueGetter(r,e,t,n):LT(e,t,n)},D_={caches:{spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},processedRange:{firstRowIndex:0,lastRowIndex:0}},F_=e=>f({},e,{rowSpanning:D_}),L_=(e,t)=>{const n=s.useCallback((t,n=!1)=>{const r=e.current.virtualizer.store,{range:o,rows:i}=lN(e);if(n&&r.set("rowSpanning",D_),null===o||!I_(t))return;const a=n?D_:AA.selectors.state(r.state),l=(s={firstRowIndex:t.firstRowIndex,lastRowIndex:Math.min(t.lastRowIndex,o.lastRowIndex-o.firstRowIndex+1)},c=a.processedRange,s.firstRowIndex>=c.firstRowIndex&&s.lastRowIndex<=c.lastRowIndex?null:s.firstRowIndex>=c.firstRowIndex&&s.lastRowIndex>c.lastRowIndex?{firstRowIndex:c.lastRowIndex,lastRowIndex:s.lastRowIndex}:s.firstRowIndex<c.firstRowIndex&&s.lastRowIndex<=c.lastRowIndex?{firstRowIndex:s.firstRowIndex,lastRowIndex:c.firstRowIndex-1}:s);var s,c;if(null===l)return;const u=cO(e),d=((e,t,n,r,o,i)=>{const a=e.current.virtualizer,l=i?D_:AA.selectors.state(a.store.state),s=f({},l.caches.spannedCells),c=f({},l.caches.hiddenCells),u=f({},l.caches.hiddenCellOriginMap),d={firstRowIndex:Math.min(l.processedRange.firstRowIndex,o.firstRowIndex),lastRowIndex:Math.max(l.processedRange.lastRowIndex,o.lastRowIndex)};return t.forEach((t,i)=>{for(let a=o.firstRowIndex;a<o.lastRowIndex;a+=1){const l=n[a];if(c[l.id]?.[i])continue;const d=O_(l.model,t,e);if(null==d)continue;let p=l.id,f=a,h=0;const m=[];if(a===o.firstRowIndex){let o=a-1,l=n[o];for(;o>=r.firstRowIndex&&l&&O_(l.model,t,e)===d;){const e=n[o+1];c[e.id]?c[e.id][i]=!0:c[e.id]={[i]:!0},m.push(a),h+=1,p=l.id,f=o,o-=1,l=n[o]}}m.forEach(e=>{u[e]?u[e][i]=f:u[e]={[i]:f}});let g=a+1;for(;g<=r.lastRowIndex&&n[g]&&O_(n[g].model,t,e)===d;){const e=n[g];c[e.id]?c[e.id][i]=!0:c[e.id]={[i]:!0},u[g]?u[g][i]=f:u[g]={[i]:f},g+=1,h+=1}h>0&&(s[p]?s[p][i]=h+1:s[p]={[i]:h+1})}}),{caches:{spannedCells:s,hiddenCells:c,hiddenCellOriginMap:u},processedRange:d}})(e,u,i,o,l,n),p=Object.keys(d.caches.spannedCells).length,h=Object.keys(d.caches.hiddenCells).length,m=Object.keys(a.caches.spannedCells).length,g=Object.keys(a.caches.hiddenCells).length;(n||p!==m||h!==g)&&!(0===p&&0===m)&&r.set("rowSpanning",d)},[e]),{schedule:r,cancel:o}=function(e){const t=s.useRef(null),n=s.useCallback((...n)=>{t.current||queueMicrotask(()=>{t.current&&t.current()}),t.current=()=>{t.current=null,e(...n)}},[e]);return s.useLayoutEffect(()=>{t.current&&t.current()}),{schedule:n,cancel:()=>!!t.current&&(t.current=null,!0)}}(n),i=s.useCallback(()=>{const t=WA(e);I_(t)&&r(t,!0)},[e,r]);rI(e,"renderedRowsIntervalChange",AI(t.rowSpanning,e=>{const t=o();n(e,t)})),rI(e,"sortedRowsSet",AI(t.rowSpanning,i)),rI(e,"paginationModelChange",AI(t.rowSpanning,i)),rI(e,"filteredRowsSet",AI(t.rowSpanning,i)),rI(e,"columnsChange",AI(t.rowSpanning,i)),s.useEffect(()=>{const r=e.current.virtualizer?.store;r&&(t.rowSpanning?r.state.rowSpanning===D_&&n(WA(e)):r.state.rowSpanning!==D_&&r.set("rowSpanning",D_))},[e,t.rowSpanning,n])},A_=(e,t,n)=>f({},e,{listViewColumn:t.listViewColumn?f({},t.listViewColumn,{computedWidth:N_(n)}):void 0});function N_(e){return oT(e).viewportInnerSize.width}const $_=eT(yD,gD,lF,(e,t,n)=>({groupKeys:[],paginationModel:n,sortModel:t,filterModel:e,start:n.page*n.pageSize,end:n.page*n.pageSize+n.pageSize-1}));let z_=function(e){return e.Default="set-flat-rows",e.LazyLoading="replace-row-range",e.GroupedData="set-grouped-rows",e}({});class j_{constructor(e){this.chunkSize=e}getCacheKeys=e=>{if(this.chunkSize<1||"number"!=typeof e.start)return[e];const t=[];for(let n=e.start;n<=e.end;n+=this.chunkSize){const r=Math.min(n+this.chunkSize-1,e.end);t.push(f({},e,{start:n,end:r}))}return t};splitResponse=(e,t)=>{const n=this.getCacheKeys(e);if(1===n.length)return new Map([[e,t]]);const r=new Map;return n.forEach(n=>{const o=n.end===e.end,i=f({},t,{pageInfo:f({},t.pageInfo,{hasNextPage:void 0!==t.pageInfo?.hasNextPage&&!o||t.pageInfo?.hasNextPage,nextCursor:void 0===t.pageInfo?.nextCursor||o?t.pageInfo?.nextCursor:t.rows[n.end+1].id}),rows:"number"!=typeof n.start||"number"!=typeof e.start?t.rows:t.rows.slice(n.start-e.start,n.end-e.start+1)});r.set(n,i)}),r};static mergeResponses=e=>1===e.length?e[0]:e.reduce((e,t)=>f({},t,{rows:[...e.rows,...t.rows]}),{rows:[],rowCount:0,pageInfo:{}})}const B_=["skipCache","keepChildrenExpanded"],__={clear:()=>{},get:()=>{},set:()=>{}};function H_(e,t={}){return null===e?__:e??new KA(t)}const V_=(e,t)=>{const{api:n,strategyProcessor:r,events:o,setStrategyAvailability:i}=((e,t,n={})=>{const r=s.useCallback(()=>{e.current.setStrategyAvailability(pB.DataSource,z_.Default,t.dataSource?()=>!0:()=>!1)},[e,t.dataSource]),[o,i]=s.useState(e.current.getActiveStrategy(pB.DataSource)),a=s.useMemo(()=>o===z_.Default||o===z_.GroupedData,[o]),l=pI(e,lF),c=s.useRef(0),u=t.onDataSourceError,p=Dg(()=>{if(!t.pagination)return new j_(l.pageSize);const e=t.pageSizeOptions.map(e=>"number"==typeof e?e:e.value).sort((e,t)=>e-t),n=Math.min(l.pageSize,e[0]);return new j_(n)}).current,[h,m]=s.useState(()=>H_(t.dataSourceCache,n.cacheOptions)),g=s.useCallback(async(r,o)=>{const i=t.dataSource?.getRows;if(!i)return;if(r&&r!==OT&&"DataGrid"!==t.signature)return void n.fetchRowChildren?.([r]);n.clearDataSourceState?.();const l=o||{},{skipCache:s,keepChildrenExpanded:m}=l,g=d(l,B_),v=f({},$_(e),e.current.unstable_applyPipeProcessors("getRowsParams",{}),g),b=p.getCacheKeys(v).map(e=>h.get(e));if(!s&&b.every(e=>void 0!==e))return void e.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:j_.mergeResponses(b),fetchParams:v,options:{skipCache:s,keepChildrenExpanded:m}});(a||0===e.current.getRowsCount())&&e.current.setLoading(!0);const y=c.current+1;c.current=y;try{const t=await i(v);p.splitResponse(v,t).forEach((e,t)=>h.set(t,e)),c.current===y&&e.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:t,fetchParams:v,options:{skipCache:s,keepChildrenExpanded:m}})}catch(t){c.current===y&&(e.current.applyStrategyProcessor("dataSourceRowsUpdate",{error:t,fetchParams:v,options:{skipCache:s,keepChildrenExpanded:m}}),"function"==typeof u&&u(new qA({message:t?.message,params:v,cause:t})))}finally{a&&c.current===y&&e.current.setLoading(!1)}},[p,h,e,a,t.dataSource?.getRows,u,n,t.signature]),v=s.useCallback(()=>{i(e.current.getActiveStrategy(pB.DataSource))},[e]),b=s.useCallback(t=>{if("error"in t)return void e.current.setRows([]);const{response:n}=t;void 0!==n.rowCount&&e.current.setRowCount(n.rowCount),e.current.setRows(n.rows),e.current.unstable_applyPipeProcessors("processDataSourceRows",{params:t.fetchParams,response:n},!0)},[e]),y=t.dataSource?.updateRow,w=n.handleEditRow,x=s.useCallback(async t=>{if(y)try{const n=await y(t);return"function"==typeof w?(w(t,n),n):(n&&!JL(n,t.previousRow)&&e.current.dataSource.cache.clear(),e.current.updateNestedRows([n],[]),n)}catch(e){throw"function"==typeof u&&u(new YA({message:e?.message,params:t,cause:e})),e}},[e,y,u,w]),S={dataSource:{fetchRows:g,cache:h,editRow:x}},C=s.useMemo(()=>Cg(g,0),[g]),k=s.useRef(!0);return s.useEffect(()=>{if(k.current)return void(k.current=!1);if(void 0===t.dataSourceCache)return;const e=H_(t.dataSourceCache,n.cacheOptions);m(t=>t!==e?e:t)},[t.dataSourceCache,n.cacheOptions]),s.useEffect(()=>{if(o===z_.Default||o===z_.LazyLoading||o===z_.GroupedData)return t.dataSource&&(e.current.dataSource.cache.clear(),e.current.dataSource.fetchRows()),()=>{c.current+=1}},[e,t.dataSource,o]),{api:{public:S},debouncedFetchRows:C,strategyProcessor:{strategyName:z_.Default,group:"dataSourceRowsUpdate",processor:b},setStrategyAvailability:r,cacheChunkManager:p,cache:h,events:{strategyAvailabilityChange:v,sortModelChange:AI(a,()=>C()),filterModelChange:AI(a,()=>C()),paginationModelChange:AI(a,()=>C())}}})(e,t);vL(e,n.public,"public"),fB(e,r.strategyName,r.group,r.processor),Object.entries(o).forEach(([t,n])=>{rI(e,t,n)}),s.useEffect(()=>{i()},[i])},W_=(e,t,n)=>{vB(e,t),i_(e,t),(e=>{fB(e,hB,"rowTreeCreation",e_)})(e),bB(gB,e,t),bB(o_,e,t),bB(RB,e,t),bB(JB,e,t),bB(VB,e,t),bB(QB,e,t),bB(zB,e,t),bB(a_,e,t),bB(UB,e,t),bB(LB,e,t),bB(F_,e,t),bB(MB,e,t),bB(R_,e,t),bB(EB,e,t),bB(b_,e,t),bB(_A,e,t),bB(u_,e,t),bB(hN,e,t),bB(A_,e,t),HB(e,t),((e,t)=>{const n=bL(e,"useGridSelection"),r=s.useCallback(e=>(...n)=>{t.rowSelection&&e(...n)},[t.rowSelection]),o=pI(e,RT)>1,i=t.signature!==QT.DataGrid&&(t.rowSelectionPropagation?.parents||t.rowSelectionPropagation?.descendants)&&o,a=s.useMemo(()=>t.rowSelectionModel,[t.rowSelectionModel]),l=s.useRef(null);e.current.registerControlState({stateId:"rowSelection",propModel:a,propOnChange:t.onRowSelectionModelChange,stateSelector:LD,changeEvent:"rowSelectionChange"});const{checkboxSelection:c,disableRowSelectionOnClick:u,isRowSelectable:d}=t,p=HD(t),h=s.useCallback(t=>{let n=t;const r=l.current??t,o=e.current.isRowSelected(t);if(o){const t=kD(e),o=t.findIndex(e=>e===r),i=t.findIndex(e=>e===n);if(o===i)return;n=o>i?t[i+1]:t[i-1]}l.current=t,e.current.selectRowRange({startId:r,endId:n},!o)},[e]),m=Mg(()=>t.pagination&&t.checkboxSelectionVisibleOnly&&"client"===t.paginationMode?mF(e):kD(e)),g=s.useCallback((r,o)=>{if(t.signature===QT.DataGrid&&!p&&("include"!==r.type||r.ids.size>1))throw new Error(["MUI X: `rowSelectionModel` can only contain 1 item in DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection."].join("\n"));if(LD(e)!==r){if(n.debug("Setting selection model"),null!==l.current){const e=r.ids.has(l.current);("include"===r.type&&!e||"exclude"===r.type&&e)&&(l.current=null)}e.current.setState(e=>f({},e,{rowSelection:t.rowSelection?r:r_}),o)}},[e,n,t.rowSelection,t.signature,p]),v=s.useCallback(t=>AD(e).has(t),[e]),b=s.useCallback(n=>{if(!1===t.rowSelection)return!1;if(d&&!d(e.current.getRowParams(n)))return!1;const r=ST(e,n);return"footer"!==r?.type&&"pinnedRow"!==r?.type},[e,t.rowSelection,d]),y=s.useCallback(()=>$D(e),[e]),w=s.useCallback((r,o=!0,a=!1)=>{if(!e.current.isRowSelectable(r))return;const s=xT(e);if(l.current=o?r:null,a){n.debug(`Setting selection for row ${r}`);const a={type:"include",ids:new Set},l=e=>{a.ids.add(e)};o&&(l(r),i&&VD(e,s,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,l)),e.current.setRowSelectionModel(a,"singleRowSelection")}else{n.debug(`Toggling selection for row ${r}`);const a=LD(e),l={type:a.type,ids:new Set(a.ids)},c=VI(l);c.unselect(r);const u=e=>{c.select(e)},d=e=>{c.unselect(e)};o?(u(r),i&&VD(e,s,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,u)):i&&WD(e,s,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,d),("include"===l.type&&l.ids.size<2||p)&&e.current.setRowSelectionModel(l,"singleRowSelection")}},[e,n,i,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents,p]),x=s.useCallback((r,o=!0,a=!1)=>{if(n.debug("Setting selection for several rows"),!1===t.rowSelection)return;const l=xT(e),s=new Set;for(let t=0;t<r.length;t+=1){const n=r[t];e.current.isRowSelectable(n)&&s.add(n)}const c=LD(e);let u;if(a){if(u={type:"include",ids:s},o){const n=VI(u);if(i){const r=e=>{n.select(e)};for(const n of s)VD(e,l,n,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,r)}}else u.ids=new Set;if(c.type===u.type&&u.ids.size===c.ids.size&&Array.from(u.ids).every(e=>c.ids.has(e)))return}else{u={type:c.type,ids:new Set(c.ids)};const n=VI(u),r=e=>{n.select(e)},a=e=>{n.unselect(e)};for(const c of s)o?(n.select(c),i&&VD(e,l,c,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,r)):(a(c),i&&WD(e,l,c,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,a))}("include"===u.type&&u.ids.size<2||p)&&e.current.setRowSelectionModel(u,"multipleRowsSelection")},[n,i,p,e,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents,t.rowSelection]),S=s.useCallback(n=>{if(!o||!i||"exclude"===n.type||0===n.ids.size&&"include"===n.type)return n;const r={type:n.type,ids:new Set(n.ids)},a=xT(e),l=VI(r),s=e=>{l.select(e)};for(const r of n.ids)VD(e,a,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,s,l);return r},[e,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents,o,i]),C=s.useCallback(({startId:t,endId:r},o=!0,i=!1)=>{if(!e.current.getRow(t)||!e.current.getRow(r))return;n.debug(`Expanding selection from row ${t} to row ${r}`);const a=kD(e),l=a.indexOf(t),s=a.indexOf(r),[c,u]=l>s?[s,l]:[l,s],d=a.slice(c,u+1);e.current.selectRows(d,o,i)},[e,n]),k={selectRows:x,selectRowRange:C,getPropagatedRowSelectionModel:S};vL(e,{selectRow:w,setRowSelectionModel:g,getSelectedRows:y,isRowSelected:v,isRowSelectable:b},"public"),vL(e,k,t.signature===QT.DataGrid?"private":"public");const E=s.useRef(!0),R=s.useCallback((n=!1)=>{if(E.current)return;const r=LD(e),i=wT(e),a=xT(e),l=SD(e),s=e=>"server"===t.filterMode?!i[e]:!a[e]||!1===l[e],c={type:r.type,ids:new Set(r.ids)},u=VI(c);let d=!1;for(const e of r.ids){if(s(e)){if(t.keepNonExistentRowsSelected)continue;u.unselect(e),d=!0;continue}if(!t.rowSelectionPropagation?.parents)continue;const n=a[e];if("group"===n?.type){if(n.isAutoGenerated){u.unselect(e),d=!0;continue}n.children.every(e=>!1===l[e])||(u.unselect(e),d=!0)}}const p=o&&t.rowSelectionPropagation?.parents&&(c.ids.size>0||"exclude"===c.type);if(d||p&&!n)if(p)if("exclude"===c.type){const n=m(),r=[];for(let e=0;e<n.length;e+=1){const o=n[e];!t.keepNonExistentRowsSelected&&s(o)||!u.has(o)||r.push(o)}e.current.selectRows(r,!0,!0)}else e.current.selectRows(Array.from(c.ids),!0,!0);else e.current.setRowSelectionModel(c,"multipleRowsSelection")},[e,o,t.rowSelectionPropagation?.parents,t.keepNonExistentRowsSelected,t.filterMode,m]),P=s.useCallback((t,n)=>{const r=n.metaKey||n.ctrlKey,o=!c&&!r&&!(e=>!!e.key)(n),i=!p||o,a=e.current.isRowSelected(t),l=ND(e)>1&&i||!a;e.current.selectRow(t,l,i)},[e,p,c]),M=s.useCallback((t,n)=>{if(u)return;const r=n.target.closest(`.${XT.cell}`)?.getAttribute("data-field");if(r!==wF.field&&r!==tD){if(r){const t=e.current.getColumn(r);if(t?.type===ZO)return}"pinnedRow"!==ST(e,t.id).type&&(n.shiftKey&&p?h(t.id):P(t.id,n))}},[u,p,e,h,P]),T=s.useCallback((e,t)=>{p&&t.shiftKey&&window.getSelection()?.removeAllRanges()},[p]),I=s.useCallback((t,n)=>{p&&n.nativeEvent.shiftKey?h(t.id):e.current.selectRow(t.id,t.value,!p)},[e,h,p]),O=s.useCallback(n=>{const r=yD(e),i=wD(e),a=r.items.length>0||i?.some(e=>e.length);t.isRowSelectable||t.checkboxSelectionVisibleOnly||o&&!t.rowSelectionPropagation?.descendants||a||t.disableRowSelectionExcludeModel?e.current.selectRows(m(),n):e.current.setRowSelectionModel({type:n?"exclude":"include",ids:new Set},"multipleRowsSelection")},[e,m,t.checkboxSelectionVisibleOnly,t.isRowSelectable,t.rowSelectionPropagation?.descendants,t.disableRowSelectionExcludeModel,o]),D=s.useCallback(e=>{O(e.value)},[O]),F=s.useCallback((t,n)=>{if(e.current.getCellMode(t.id,t.field)!==zI.Edit&&!v$(n)){if(AO(n.key)&&n.shiftKey){const r=YD(e);if(r&&r.id!==t.id){n.preventDefault();const o=e.current.isRowSelected(r.id);if(!p)return void e.current.selectRow(r.id,!o,!0);const i=e.current.getRowIndexRelativeToVisibleRows(r.id),a=e.current.getRowIndexRelativeToVisibleRows(t.id);let l,s;i>a?o?(l=a,s=i-1):(l=a,s=i):o?(l=i+1,s=a):(l=i,s=a);const c=lN(e),u=[];for(let e=l;e<=s;e+=1)u.push(c.rows[e].id);return void e.current.selectRows(u,!o)}}if(" "===n.key&&n.shiftKey)return n.preventDefault(),void P(t.id,n);"A"===String.fromCharCode(n.keyCode)&&(n.ctrlKey||n.metaKey)&&(n.preventDefault(),p&&O(!0))}},[e,p,P,O]),L=Mg(()=>{if(!t.rowSelection)return void e.current.setRowSelectionModel(r_);if(void 0===a)return;if(!i||!o||"include"===a.type&&0===a.ids.size)return void e.current.setRowSelectionModel(a);const n=e.current.getPropagatedRowSelectionModel(a);n.type===a.type&&n.ids.size===a.ids.size&&Array.from(a.ids).every(e=>n.ids.has(e))?e.current.setRowSelectionModel(a):e.current.setRowSelectionModel(n)});rI(e,"filteredRowsSet",r(()=>R())),rI(e,"rowClick",r(M)),rI(e,"rowSelectionCheckboxChange",r(I)),rI(e,"headerSelectionCheckboxChange",D),rI(e,"cellMouseDown",r(T)),rI(e,"cellKeyDown",r(F)),s.useEffect(()=>{L()},[e,a,t.rowSelection,L]);const A=null!=a;s.useEffect(()=>{if(A||!t.rowSelection||"function"!=typeof b)return;const n=LD(e);if("include"!==n.type)return;const r=new Set;for(const e of n.ids)b(e)&&r.add(e);r.size<n.ids.size&&e.current.setRowSelectionModel({type:n.type,ids:r})},[e,b,A,t.rowSelection]),s.useEffect(()=>{if(!t.rowSelection||A)return;const n=LD(e);!p&&("include"===n.type&&n.ids.size>1||"exclude"===n.type)&&e.current.setRowSelectionModel(r_)},[e,p,c,A,t.rowSelection]),s.useEffect(()=>{r(R)},[R,r]),s.useEffect(()=>{E.current&&(E.current=!1)},[])})(e,t),PB(e,t),((e,t,n)=>{const r=bL(e,"useGridRows"),o=s.useRef(Date.now()),i=s.useRef(t.rowCount),a=Ng(),{setRowIndex:l,setRowPosition:c}=n.hooks.useGridRowsOverridableMethods(e,t),u=s.useCallback(t=>{const n=wT(e)[t];if(n)return n;const r=ST(e,t);return r&&jT(r)?{[DT]:t}:null},[e]),d=s.useCallback(t=>zD(e,t),[e]),p=s.useCallback(({cache:n,throttle:r})=>{const i=()=>{o.current=Date.now(),e.current.setState(n=>f({},n,{rows:$T({apiRef:e,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:xT(e),previousTreeDepths:ET(e),previousGroupsToFetch:CT(e)})})),e.current.publishEvent("rowsSet")};if(a.clear(),e.current.caches.rows=n,!r)return void i();const l=t.throttleRowsMs-(Date.now()-o.current);l>0?a.start(l,i):i()},[t.throttleRowsMs,t.rowCount,t.loading,e,a]),h=s.useCallback(n=>{if(r.debug(`Updating all rows, new length ${n.length}`),!t.dataSource&&SL(e))return void e.current.updateNonPivotRows(n,!1);const o=AT({rows:n,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),i=e.current.caches.rows;o.rowsBeforePartialUpdates=i.rowsBeforePartialUpdates,p({cache:o,throttle:!0})},[r,t.getRowId,t.dataSource,t.loading,t.rowCount,p,e]),m=s.useCallback(n=>{if(t.signature===QT.DataGrid&&n.length>1)throw new Error(["MUI X: You cannot update several rows at once in `apiRef.current.updateRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join("\n"));if(!t.dataSource&&SL(e))return void e.current.updateNonPivotRows(n);const r=VT(e,n,t.getRowId),o=_T({updates:r,getRowId:t.getRowId,previousCache:e.current.caches.rows});p({cache:o,throttle:!0})},[t.signature,t.dataSource,t.getRowId,p,e]),g=s.useCallback((n,r)=>{const o=VT(e,n,t.getRowId),i=_T({updates:o,getRowId:t.getRowId,previousCache:e.current.caches.rows,groupKeys:r??[]});p({cache:i,throttle:!1})},[t.getRowId,p,e]),v=s.useCallback(t=>{r.debug(`Setting loading to ${t}`),e.current.setState(e=>f({},e,{rows:f({},e.rows,{loading:t})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t},[e,r]),b=s.useCallback(()=>{const t=PT(e),n=wT(e);return new Map(t.map(e=>[e,n[e]??{}]))},[e]),y=s.useCallback(()=>vT(e),[e]),w=s.useCallback(()=>PT(e),[e]),x=s.useCallback(t=>{const{rowIdToIndexMap:n}=lN(e);return n.get(t)},[e]),S=s.useCallback((t,n)=>{const r=ST(e,t);if(!r)throw new Error(`MUI X: No row with id #${t} found.`);if("group"!==r.type)throw new Error("MUI X: Only group nodes can be expanded or collapsed.");const o=f({},r,{childrenExpanded:n});e.current.setState(e=>f({},e,{rows:f({},e.rows,{tree:f({},e.rows.tree,{[t]:o})})})),e.current.publishEvent("rowExpansionChange",o)},[e]),C=s.useCallback(()=>{const t=f({},xT(e)),n=e=>{const r=t[e];"group"===r?.type&&(t[e]=f({},r,{childrenExpanded:!0}),r.children.forEach(n))};n(OT),e.current.setState(e=>f({},e,{rows:f({},e.rows,{tree:t})})),e.current.publishEvent("rowExpansionChange",t[OT])},[e]),k=s.useCallback(()=>{const t=f({},xT(e)),n=e=>{const r=t[e];"group"===r?.type&&(t[e]=f({},r,{childrenExpanded:!1}),r.children.forEach(n))};n(OT),e.current.setState(e=>f({},e,{rows:f({},e.rows,{tree:t})})),e.current.publishEvent("rowExpansionChange",t[OT])},[e]),E=s.useCallback(t=>ST(e,t)??null,[e]),R=s.useCallback(({skipAutoGeneratedRows:t=!0,groupId:n,applySorting:r,applyFiltering:o,directChildrenOnly:i=!1})=>{const a=xT(e);let l;if(r){const r=a[n];if(!r)return[];const o=hD(e);l=[];for(let e=o.findIndex(e=>e===n)+1;e<o.length&&(i?a[o[e]].depth===r.depth+1:a[o[e]].depth>r.depth);e+=1){const n=o[e];t&&jT(a[n])||l.push(n)}}else l=BT(a,n,t,i);if(o){const t=SD(e);l=pD(t)?l:l.filter(e=>!1!==t[e])}return l},[e]),P={getRow:u,setLoading:v,getRowId:d,getRowModels:b,getRowsCount:y,getAllRowIds:w,setRows:h,updateRows:m,getRowNode:E,getRowIndexRelativeToVisibleRows:x,unstable_replaceRows:s.useCallback((n,r)=>{if(t.signature===QT.DataGrid&&r.length>1)throw new Error(["MUI X: You cannot replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join("\n"));if(0===r.length)return;if(RT(e)>1)throw new Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");const o=f({},xT(e)),i=f({},wT(e)),a=o[OT],l=[...a.children],s=new Set;for(let e=0;e<r.length;e+=1){const a=r[e],c=FT(a,t.getRowId,"A row was provided without id when calling replaceRows()."),[u]=l.splice(n+e,1,c);s.has(u)||(delete i[u],delete o[u]);const d={id:c,depth:0,parent:OT,type:"leaf",groupingKey:null};i[c]=a,o[c]=d,s.add(c)}o[OT]=f({},a,{children:l});const c=l.filter(e=>"leaf"===o[e]?.type);e.current.caches.rows.dataRowIdToModelLookup=i,e.current.setState(e=>f({},e,{rows:f({},e.rows,{loading:t.loading,totalRowCount:Math.max(t.rowCount||0,l.length),dataRowIdToModelLookup:i,dataRowIds:c,tree:o})})),e.current.publishEvent("rowsSet")},[e,t.signature,t.getRowId,t.loading,t.rowCount])},M={setRowIndex:l,setRowPosition:c,setRowChildrenExpansion:S,getRowGroupChildren:R,expandAllRows:C,collapseAllRows:k},T={updateNestedRows:g},I=s.useCallback(()=>{let n;r.info("Row grouping pre-processing have changed, regenerating the row tree"),n=e.current.caches.rows.rowsBeforePartialUpdates===t.rows?f({},e.current.caches.rows,{updates:{type:"full",rows:PT(e)}}):AT({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),p({cache:n,throttle:!1})},[r,e,t.rows,t.getRowId,t.loading,t.rowCount,p]),O=Dg(()=>t.dataSource),D=s.useCallback(e=>{t.dataSource&&t.dataSource!==O.current?O.current=t.dataSource:"rowTreeCreation"===e&&I()},[I,O,t.dataSource]),F=s.useCallback(()=>{e.current.getActiveStrategy(pB.RowTree)!==kT(e)&&I()},[e,I]);rI(e,"activeStrategyProcessorChange",D),rI(e,"strategyAvailabilityChange",F);const L=s.useCallback(()=>{e.current.setState(n=>{const r=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:xT(e),treeDepths:ET(e),dataRowIds:PT(e),dataRowIdToModelLookup:wT(e)});return f({},n,{rows:f({},n.rows,r,{totalTopLevelRowCount:NT({tree:r.tree,rowCountProp:t.rowCount})})})}),e.current.publishEvent("rowsSet")},[e,t.rowCount]);fN(e,"hydrateRows",L),vL(e,P,"public"),vL(e,M,t.signature===QT.DataGrid?"private":"public"),vL(e,T,"private");const A=s.useRef(!0);s.useEffect(()=>{if(A.current)return void(A.current=!1);let n=!1;t.rowCount!==i.current&&(n=!0,i.current=t.rowCount);const o=t.dataSource?MT(e):t.rows,a=e.current.caches.rows.rowsBeforePartialUpdates===o,l=e.current.caches.rows.loadingPropBeforePartialUpdates===t.loading,s=e.current.caches.rows.rowCountPropBeforePartialUpdates===t.rowCount;a&&(l||(e.current.setState(e=>f({},e,{rows:f({},e.rows,{loading:t.loading})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t.loading),s||(e.current.setState(e=>f({},e,{rows:f({},e.rows,{totalRowCount:Math.max(t.rowCount||0,e.rows.totalRowCount),totalTopLevelRowCount:Math.max(t.rowCount||0,e.rows.totalTopLevelRowCount)})})),e.current.caches.rows.rowCountPropBeforePartialUpdates=t.rowCount),!n)||(r.debug(`Updating all rows, new length ${o?.length}`),p({cache:AT({rows:o,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),throttle:!1}))},[t.rows,t.rowCount,t.getRowId,t.loading,t.dataSource,r,p,e])})(e,t,n),L_(e,t),n_(e,t,n),(e=>{const t=()=>e.current.virtualizer.api.resetColSpan(),n={unstable_getCellColSpanInfo:(...t)=>e.current.virtualizer.api.getCellColSpanInfo(...t)},r={resetColSpan:t,calculateColSpan:(...t)=>{e.current.virtualizer.api.calculateColSpan(...t)}};vL(e,n,"public"),vL(e,r,"private"),rI(e,"columnOrderChange",t)})(e),((e,t)=>{const n=s.useCallback(t=>ZF(e)[t]??[],[e]),r=s.useCallback(()=>JF(e),[e]);vL(e,{getColumnGroupPath:n,getAllGroupDetails:r},"public");const o=s.useCallback(()=>{const n=g_(t.columnGroupingModel??[]);e.current.setState(e=>{const t=e.columns?.orderedFields??[],r=e.pinnedColumns??{},o=v_(t,n,r);return f({},e,{columnGrouping:f({},e.columnGrouping,{headerStructure:o})})})},[e,t.columnGroupingModel]),i=s.useCallback(t=>{if(!t&&!e.current.caches.columnGrouping.lastColumnGroupingModel)return;e.current.caches.columnGrouping.lastColumnGroupingModel=t;const n=e.current.getPinnedColumns?.()??{},r=oO(e),o=uO(e),i=h_(t??[]),a=g_(t??[]),l=v_(r,a,n),s=0===o.length?0:Math.max(...o.map(e=>a[e]?.length??0));e.current.setState(e=>f({},e,{columnGrouping:{lookup:i,unwrappedGroupingModel:a,headerStructure:l,maxDepth:s}}))},[e]);rI(e,"columnIndexChange",o),rI(e,"columnsChange",()=>{i(t.columnGroupingModel)}),rI(e,"columnVisibilityModelChange",()=>{i(t.columnGroupingModel)}),s.useEffect(()=>{t.columnGroupingModel!==e.current.caches.columnGrouping.lastColumnGroupingModel&&i(t.columnGroupingModel)},[e,i,t.columnGroupingModel])})(e,t),ZB(e,t,n),((e,t)=>{const n=bL(e,"useGridFocus"),r=s.useRef(null),o=null!==e.current.rootElementRef.current,i=s.useCallback((t,n)=>{t&&e.current.getRow(t.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(t.id,t.field),n)},[e]),a=s.useCallback((t,r)=>{const o=YD(e);o?.id===t&&o?.field===r||(e.current.setState(e=>(n.debug(`Focusing on cell with id=${t} and field=${r}`),f({},e,{tabIndex:{cell:{id:t,field:r},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},focus:{cell:{id:t,field:r},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))),e.current.getRow(t)&&(o&&i(o,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(t,r))))},[e,n,i]),l=s.useCallback((t,r={})=>{const o=YD(e);i(o,r),e.current.setState(e=>(n.debug(`Focusing on column header with colIndex=${t}`),f({},e,{tabIndex:{columnHeader:{field:t},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:t},columnHeaderFilter:null,cell:null,columnGroupHeader:null}})))},[e,n,i]),c=s.useCallback((t,r={})=>{const o=YD(e);i(o,r),e.current.setState(e=>(n.debug(`Focusing on column header filter with colIndex=${t}`),f({},e,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:t},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:t},cell:null,columnGroupHeader:null}})))},[e,n,i]),u=s.useCallback((t,n,r={})=>{const o=YD(e);o&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(o.id,o.field),r),e.current.setState(e=>f({},e,{tabIndex:{columnGroupHeader:{field:t,depth:n},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:t,depth:n},columnHeader:null,columnHeaderFilter:null,cell:null}}))},[e]),d=s.useCallback(()=>QD(e),[e]),p=s.useCallback((n,r,o)=>{let i=e.current.getColumnIndex(r);const a=cO(e),l=lN(e,(t.pagination,t.paginationMode)),s=TT(e),c=[].concat(s.top||[],l.rows,s.bottom||[]);let u=c.findIndex(e=>e.id===n);"right"===o?i+=1:"left"===o?i-=1:u+=1,i>=a.length?(u+=1,u<c.length&&(i=0)):i<0&&(u-=1,u>=0&&(i=a.length-1)),u=FI(u,0,c.length-1);const d=c[u];if(!d)return;const p=e.current.unstable_getCellColSpanInfo(d.id,i);p&&p.spannedByColSpan&&("left"===o||"below"===o?i=p.leftVisibleCellIndex:"right"===o&&(i=p.rightVisibleCellIndex)),i=FI(i,0,a.length-1);const f=a[i];e.current.setCellFocus(d.id,f.field)},[e,t.pagination,t.paginationMode]),h=s.useCallback(({id:t,field:n})=>{e.current.setCellFocus(t,n)},[e]),m=s.useCallback((t,n)=>{"Enter"===n.key||"Tab"===n.key||"Shift"===n.key||AO(n.key)||e.current.setCellFocus(t.id,t.field)},[e]),g=s.useCallback(({field:t},n)=>{n.target===n.currentTarget&&e.current.setColumnHeaderFocus(t,n)},[e]),v=s.useCallback(({fields:t,depth:n},r)=>{if(r.target!==r.currentTarget)return;const o=QD(e);null!==o&&o.depth===n&&t.includes(o.field)||e.current.setColumnGroupHeaderFocus(t[0],n,r)},[e]),b=s.useCallback((t,r)=>{r.relatedTarget?.getAttribute("class")?.includes(XT.columnHeader)||(n.debug("Clearing focus"),e.current.setState(e=>f({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[n,e]),y=s.useCallback(e=>{r.current=e},[]),w=s.useCallback(t=>{const n=r.current;r.current=null;const o=YD(e);if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:t,cell:n}))return;if(!o)return void(n&&e.current.setCellFocus(n.id,n.field));if(n?.id===o.id&&n?.field===o.field)return;const a=e.current.getCellElement(o.id,o.field);a?.contains(t.target)||(n?e.current.setCellFocus(n.id,n.field):(e.current.setState(e=>f({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),i(o,t)))},[e,i]),x=s.useCallback(t=>{if("view"===t.cellMode)return;const n=YD(e);n?.id===t.id&&n?.field===t.field||e.current.setCellFocus(t.id,t.field)},[e]),S=s.useCallback(()=>{const n=YD(e);if(n&&!e.current.getRow(n.id)){const r=n.id;let o=null;if(void 0!==r){const n=e.current.getRowElement(r),i=n?.dataset.rowindex?Number(n?.dataset.rowindex):0,a=lN(e,(t.pagination,t.paginationMode)),l=a.rows[FI(i,0,a.rows.length-1)];o=l?.id??null}e.current.setState(e=>f({},e,{focus:{cell:null===o?null:{id:o,field:n.field},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))}},[e,t.pagination,t.paginationMode]),C=s.useMemo(()=>Cg(S,0),[S]),k=Mg(()=>{const n=YD(e);if(!n)return;const r=lN(e,(t.pagination,t.paginationMode));if(r.rows.find(e=>e.id===n.id)||0===r.rows.length)return;const o=cO(e);e.current.setState(e=>f({},e,{tabIndex:{cell:{id:r.rows[0].id,field:o[0].field},columnGroupHeader:null,columnHeader:null,columnHeaderFilter:null}}))}),E={moveFocusToRelativeCell:p,setColumnGroupHeaderFocus:u,getColumnGroupHeaderFocus:d};vL(e,{setCellFocus:a,setColumnHeaderFocus:l,setColumnHeaderFilterFocus:c},"public"),vL(e,E,"private"),s.useEffect(()=>{const t=kg(e.current.rootElementRef.current);return t.addEventListener("mouseup",w),()=>{t.removeEventListener("mouseup",w)}},[e,o,w]),rI(e,"columnHeaderBlur",b),rI(e,"cellDoubleClick",h),rI(e,"cellMouseDown",y),rI(e,"cellKeyDown",m),rI(e,"cellModeChange",x),rI(e,"columnHeaderFocus",g),rI(e,"columnGroupHeaderFocus",v),rI(e,"rowsSet",C),rI(e,"paginationModelChange",k)})(e,t),((e,t)=>{const n=bL(e,"useGridPreferencesPanel"),r=s.useCallback(()=>{e.current.setState(t=>{if(!t.preferencePanel.open)return t;n.debug("Hiding Preferences Panel");const r=KL(e);return e.current.publishEvent("preferencePanelClose",{openedPanelValue:r.openedPanelValue}),f({},t,{preferencePanel:{open:!1}})})},[e,n]),o=s.useCallback((t,r,o)=>{n.debug("Opening Preferences Panel"),e.current.setState(e=>f({},e,{preferencePanel:f({},e.preferencePanel,{open:!0,openedPanelValue:t,panelId:r,labelId:o})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:t})},[n,e]);vL(e,{showPreferences:o,hidePreferences:r},"public");const i=s.useCallback((n,r)=>{const o=KL(e);return!r.exportOnlyDirtyModels||null!=t.initialState?.preferencePanel||o.open?f({},n,{preferencePanel:o}):n},[e,t.initialState?.preferencePanel]),a=s.useCallback((t,n)=>{const r=n.stateToRestore.preferencePanel;return null!=r&&e.current.setState(e=>f({},e,{preferencePanel:r})),t},[e]);pN(e,"exportState",i),pN(e,"restoreState",a)})(e,t),((e,t,n)=>{const r=bL(e,"useGridFilter");e.current.registerControlState({stateId:"filter",propModel:t.filterModel,propOnChange:t.onFilterModelChange,stateSelector:yD,changeEvent:"filterModelChange"});const o=s.useCallback(()=>{e.current.setState(t=>{const n=yD(e),r=e.current.getFilterState(n),o=f({},t,{filter:f({},t.filter,r)});return f({},o,{visibleRowsLookup:NB(e,o)})}),e.current.publishEvent("filteredRowsSet")},[e]),i=s.useCallback((e,n)=>null==n||!1===n.filterable||t.disableColumnFilter?e:[...e,"columnMenuFilterItem"],[t.disableColumnFilter]),a=s.useCallback(t=>{const n=yD(e),r=[...n.items],o=r.findIndex(e=>e.id===t.id);-1===o?r.push(t):r[o]=t,e.current.setFilterModel(f({},n,{items:r}),"upsertFilterItem")},[e]),l=s.useCallback(t=>{const n=yD(e),r=[...n.items];t.forEach(e=>{const t=r.findIndex(t=>t.id===e.id);-1===t?r.push(e):r[t]=e}),e.current.setFilterModel(f({},n,{items:r}),"upsertFilterItems")},[e]),c=s.useCallback(t=>{const n=yD(e),r=n.items.filter(e=>e.id!==t.id);r.length!==n.items.length&&e.current.setFilterModel(f({},n,{items:r}),"deleteFilterItem")},[e]),u=s.useCallback((n,o,i)=>{if(r.debug("Displaying filter panel"),n){const r=yD(e),o=r.items.filter(t=>{if(void 0!==t.value)return!Array.isArray(t.value)||0!==t.value.length;const n=e.current.getColumn(t.field),r=n.filterOperators?.find(e=>e.value===t.operator);return!(void 0===r?.requiresFilterValue||r?.requiresFilterValue)});let i;const a=o.find(e=>e.field===n),l=e.current.getColumn(n);i=a?o:t.disableMultipleColumnsFiltering?[yO({field:n,operator:l.filterOperators[0].value},e)]:[...o,yO({field:n,operator:l.filterOperators[0].value},e)],e.current.setFilterModel(f({},r,{items:i}))}e.current.showPreferences(YL.filters,o,i)},[e,r,t.disableMultipleColumnsFiltering]),d=s.useCallback(()=>{r.debug("Hiding filter panel"),e.current.hidePreferences()},[e,r]),p=s.useCallback(t=>{const n=yD(e);n.logicOperator!==t&&e.current.setFilterModel(f({},n,{logicOperator:t}),"changeLogicOperator")},[e]),h=s.useCallback(t=>{const n=yD(e);JL(n.quickFilterValues,t)||e.current.setFilterModel(f({},n,{quickFilterValues:[...t]}))},[e]),m=s.useCallback((n,o)=>{yD(e)!==n&&(r.debug("Setting filter model"),e.current.updateControlState("filter",xO(n,t.disableMultipleColumnsFiltering,e),o),e.current.unstable_applyFilters())},[e,r,t.disableMultipleColumnsFiltering]),g=s.useCallback(r=>{const o=wO(r,t.disableMultipleColumnsFiltering,e),i=n.hooks.useFilterValueGetter(e,t),a="client"===t.filterMode?PO(o,i,e,t.disableEval):null;return f({},e.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:a,filterModel:o??XI(),filterValueGetter:i}),{filterModel:o})},[e,n.hooks,t]),v={setFilterLogicOperator:p,unstable_applyFilters:o,deleteFilterItem:c,upsertFilterItem:a,upsertFilterItems:l,setFilterModel:m,showFilterPanel:u,hideFilterPanel:d,setQuickFilterValues:h,ignoreDiacritics:t.ignoreDiacritics,getFilterState:g};vL(e,v,"public");const b=s.useCallback((n,r)=>{const o=yD(e);return o.items.forEach(e=>{delete e.fromInput}),r.exportOnlyDirtyModels&&null==t.filterModel&&null==t.initialState?.filter?.filterModel&&JL(o,XI())?n:f({},n,{filter:{filterModel:o}})},[e,t.filterModel,t.initialState?.filter?.filterModel]),y=s.useCallback((n,r)=>{const o=r.stateToRestore.filter?.filterModel;return null==o?n:(e.current.updateControlState("filter",xO(o,t.disableMultipleColumnsFiltering,e),"restoreState"),f({},n,{callbacks:[...n.callbacks,e.current.unstable_applyFilters]}))},[e,t.disableMultipleColumnsFiltering]),w=s.useCallback((e,n)=>{if(n===YL.filters){const e=t.slots.filterPanel;return Xp.jsx(e,f({},t.slotProps?.filterPanel))}return e},[t.slots.filterPanel,t.slotProps?.filterPanel]),{getRowId:x}=t,S=Dg($B),C=s.useCallback(n=>{if("client"!==t.filterMode||!n.isRowMatchingFilters||!n.filterModel.items.length&&!n.filterModel.quickFilterValues?.length)return YI;const r=wT(e),o={},{isRowMatchingFilters:i}=n,a={},l={passingFilterItems:null,passingQuickFilterValues:null},s=S.current(e.current.state.rows.dataRowIdToModelLookup);for(let t=0;t<s.length;t+=1){const r=s[t],c=x?x(r):r.id;i(r,void 0,l);const u=TO([l.passingFilterItems],[l.passingQuickFilterValues],n.filterModel,n.filterValueGetter,e,a);u||(o[c]=u)}const c="auto-generated-group-footer-root";return r[c]&&(o[c]=!0),{filteredRowsLookup:o,filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}}},[e,t.filterMode,x,S]);pN(e,"columnMenu",i),pN(e,"exportState",b),pN(e,"restoreState",y),pN(e,"preferencePanel",w),fB(e,hB,"filtering",C),fB(e,hB,"visibleRowsLookupCreation",AB);const k=s.useCallback(()=>{r.debug("onColUpdated - GridColumns changed, applying filters");const t=yD(e),n=iO(e),o=t.items.filter(e=>e.field&&n[e.field]);o.length<t.items.length&&e.current.setFilterModel(f({},t,{items:o}))},[e,r]),E=s.useCallback(t=>{"filtering"===t&&e.current.unstable_applyFilters()},[e]),R=s.useCallback(()=>{e.current.setState(t=>f({},t,{visibleRowsLookup:NB(e,t)}))},[e]);rI(e,"rowsSet",o),rI(e,"columnsChange",k),rI(e,"activeStrategyProcessorChange",E),rI(e,"rowExpansionChange",R),rI(e,"columnVisibilityModelChange",()=>{const t=yD(e);t.quickFilterValues?.length&&RO(t)&&o()}),wL(()=>{"DataGrid"===t.signature&&o()}),Wh(()=>{void 0!==t.filterModel&&e.current.setFilterModel(t.filterModel)},[e,r,t.filterModel])})(e,t,n),((e,t)=>{const n=bL(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:gD,changeEvent:"sortModelChange"});const r=s.useCallback((t,n)=>{const r=gD(e),o=r.findIndex(e=>e.field===t);let i=[...r];return o>-1?null==n?.sort?i.splice(o,1):i.splice(o,1,n):i=[...r,n],i},[e]),o=s.useCallback((n,r)=>{const o=gD(e).find(e=>e.field===n.field);if(o){const e=void 0===r?CI(n.sortingOrder??t.sortingOrder,o.sort):r;return void 0===e?void 0:f({},o,{sort:e})}return{field:n.field,sort:void 0===r?CI(n.sortingOrder??t.sortingOrder):r}},[e,t.sortingOrder]),i=s.useCallback((e,n)=>null==n||!1===n.sortable||t.disableColumnSorting?e:(n.sortingOrder||t.sortingOrder).some(e=>!!e)?[...e,"columnMenuSortItem"]:e,[t.sortingOrder,t.disableColumnSorting]),a=s.useCallback(()=>{e.current.setState(r=>{if("server"===t.sortingMode)return n.debug("Skipping sorting rows as sortingMode = server"),f({},r,{sorting:f({},r.sorting,{sortedRows:BT(xT(e),OT,!1)})});const o=gD(e),i=SI(o,e),a=e.current.applyStrategyProcessor("sorting",{sortRowList:i});return f({},r,{sorting:f({},r.sorting,{sortedRows:a})})}),e.current.publishEvent("sortedRowsSet")},[e,n,t.sortingMode]),l=s.useCallback(r=>{gD(e)!==r&&(n.debug("Setting sort model"),e.current.setState(xI(r,t.disableMultipleColumnsSorting)),e.current.applySorting())},[e,n,t.disableMultipleColumnsSorting]),c=s.useCallback((n,i,a)=>{const l=e.current.getColumn(n),s=o(l,i);let c;c=!a||t.disableMultipleColumnsSorting?null==s?.sort?[]:[s]:r(l.field,s),e.current.setSortModel(c)},[e,r,o,t.disableMultipleColumnsSorting]),u=s.useCallback(()=>gD(e),[e]),d=s.useCallback(()=>mD(e).map(e=>e.model),[e]),p=s.useCallback(()=>hD(e),[e]),h=s.useCallback(t=>e.current.getSortedRowIds()[t],[e]);vL(e,{getSortModel:u,getSortedRows:d,getSortedRowIds:p,getRowIdFromRowIndex:h,setSortModel:l,sortColumn:c,applySorting:a},"public");const m=s.useCallback((n,r)=>{const o=gD(e);return!r.exportOnlyDirtyModels||null!=t.sortModel||null!=t.initialState?.sorting?.sortModel||o.length>0?f({},n,{sorting:{sortModel:o}}):n},[e,t.sortModel,t.initialState?.sorting?.sortModel]),g=s.useCallback((n,r)=>{const o=r.stateToRestore.sorting?.sortModel;return null==o?n:(e.current.setState(xI(o,t.disableMultipleColumnsSorting)),f({},n,{callbacks:[...n.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),v=s.useCallback(t=>{const n=xT(e),r=n[OT],o=t.sortRowList?t.sortRowList(r.children.map(e=>n[e])):[...r.children];return null!=r.footerId&&o.push(r.footerId),o},[e]);pN(e,"exportState",m),pN(e,"restoreState",g),fB(e,hB,"sorting",v);const b=s.useCallback(({field:e,colDef:n},r)=>{if(!n.sortable||t.disableColumnSorting)return;const o="always"===t.multipleColumnsSortingMode||r.shiftKey||r.metaKey||r.ctrlKey;c(e,void 0,o)},[c,t.disableColumnSorting,t.multipleColumnsSortingMode]),y=s.useCallback(({field:e,colDef:n},r)=>{n.sortable&&!t.disableColumnSorting&&("Enter"!==r.key||r.ctrlKey||r.metaKey||c(e,void 0,"always"===t.multipleColumnsSortingMode||r.shiftKey))},[c,t.disableColumnSorting,t.multipleColumnsSortingMode]),w=s.useCallback(()=>{const t=gD(e),n=iO(e);if(t.length>0){const r=t.filter(e=>n[e.field]);r.length<t.length&&e.current.setSortModel(r)}},[e]),x=s.useCallback(t=>{"sorting"===t&&e.current.applySorting()},[e]);pN(e,"columnMenu",i),rI(e,"columnHeaderClick",b),rI(e,"columnHeaderKeyDown",y),rI(e,"rowsSet",e.current.applySorting),rI(e,"columnsChange",w),rI(e,"activeStrategyProcessorChange",x),wL(()=>{"DataGrid"===t.signature&&e.current.applySorting()}),Wh(()=>{void 0!==t.sortModel&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])})(e,t),((e,t)=>{const n=bL(e,"useDensity");e.current.registerControlState({stateId:"density",propModel:t.density,propOnChange:t.onDensityChange,stateSelector:hI,changeEvent:"densityChange"});const r=Mg(t=>{hI(e)!==t&&(n.debug(`Set grid density to ${t}`),e.current.setState(e=>f({},e,{density:t})))});vL(e,{setDensity:r},"public");const o=s.useCallback((n,r)=>{const o=hI(e);return r.exportOnlyDirtyModels&&null==t.density&&null==t.initialState?.density?n:f({},n,{density:o})},[e,t.density,t.initialState?.density]),i=s.useCallback((t,n)=>{const r=n.stateToRestore?.density?n.stateToRestore.density:hI(e);return e.current.setState(e=>f({},e,{density:r})),t},[e]);pN(e,"exportState",o),pN(e,"restoreState",i),s.useEffect(()=>{t.density&&e.current.setDensity(t.density)},[e,t.density])})(e,t),M_(e,t),WB(e,t),((e,t)=>{const n=um(),r=bL(e,"useGridScroll"),o=e.current.columnHeadersContainerRef,i=e.current.virtualScrollerRef,a=s.useCallback(n=>{const o=oT(e),a=vT(e),l=cO(e);if(null!=n.rowIndex&&0===a||0===l.length)return!1;r.debug(`Scrolling to cell at row ${n.rowIndex}, col: ${n.colIndex} `);let s={};if(void 0!==n.colIndex){const t=hO(e);let r;if(void 0!==n.rowIndex){const t=CD(e),o=t[n.rowIndex]?.id,i=e.current.unstable_getCellColSpanInfo(o,n.colIndex);i&&!i.spannedByColSpan&&(r=i.cellProps.width)}void 0===r&&(r=l[n.colIndex].computedWidth),s.left=l_({containerSize:o.viewportOuterSize.width,scrollPosition:Math.abs(i.current.scrollLeft),elementSize:r,elementOffset:t[n.colIndex]})}if(void 0!==n.rowIndex){const r=mT(e),a=uF(e),l=dF(e),c=t.pagination?n.rowIndex-a*l:n.rowIndex,u=r.positions[c+1]?r.positions[c+1]-r.positions[c]:r.currentPageTotalHeight-r.positions[c];s.top=l_({containerSize:o.viewportInnerSize.height,scrollPosition:i.current.scrollTop,elementSize:u,elementOffset:r.positions[c]})}return s=e.current.unstable_applyPipeProcessors("scrollToIndexes",s,n),(void 0!==s.left||void 0!==s.top)&&(e.current.scroll(s),!0)},[r,e,i,t.pagination]),l=s.useCallback(e=>{if(i.current&&void 0!==e.left&&o.current){const t=n?-1:1;o.current.scrollLeft=e.left,i.current.scrollLeft=t*e.left,r.debug(`Scrolling left: ${e.left}`)}i.current&&void 0!==e.top&&(i.current.scrollTop=e.top,r.debug(`Scrolling top: ${e.top}`)),r.debug("Scrolling, updating container, and viewport")},[i,n,o,r]),c=s.useCallback(()=>i?.current?{top:i.current.scrollTop,left:i.current.scrollLeft}:{top:0,left:0},[i]);vL(e,{scroll:l,scrollToIndexes:a,getScrollPosition:c},"public")})(e,t),(e=>{const t=bL(e,"useGridColumnMenu"),n=s.useRef({}),r=s.useCallback(()=>{n.current.wheel?.(),n.current.touchMove?.()},[]),o=s.useCallback(()=>{r(),n.current.wheel=e.current.subscribeEvent("virtualScrollerWheel",e.current.hideColumnMenu),n.current.touchMove=e.current.subscribeEvent("virtualScrollerTouchMove",e.current.hideColumnMenu)},[e,r]),i=s.useCallback(n=>{const r=RL(e),i=n;(!0!==r.open||i!==r.field)&&(e.current.setState(e=>e.columnMenu.open&&e.columnMenu.field===n?e:(t.debug("Opening Column Menu"),o(),f({},e,{columnMenu:{open:!0,field:n}}))),e.current.hidePreferences())},[e,t,o]),a=s.useCallback(()=>{const n=RL(e);if(n.field){const t=iO(e),r=lO(e),o=oO(e);let i=n.field;if(t[i]||(i=o[0]),!1===r[i]){const e=o.filter(e=>e===i||!1!==r[e]),t=e.indexOf(i);i=e[t+1]||e[t-1]}e.current.setColumnHeaderFocus(i)}const o={open:!1,field:void 0};(o.open!==n.open||o.field!==n.field)&&e.current.setState(e=>(t.debug("Hiding Column Menu"),r(),f({},e,{columnMenu:o})))},[e,t,r]),l=s.useCallback(n=>{t.debug("Toggle Column Menu");const r=RL(e);r.open&&r.field===n?a():i(n)},[e,t,i,a]);vL(e,{showColumnMenu:i,hideColumnMenu:a,toggleColumnMenu:l},"public"),rI(e,"columnResizeStart",a)})(e),OB(e,t),FB(e,t),kB(e,t),function(e,t){const n=s.useCallback(()=>oT(e),[e]),r={updateDimensions:()=>e.current.virtualizer.api.updateDimensions(),getViewportPageSize:()=>e.current.virtualizer.api.getViewportPageSize()};vL(e,{getRootDimensions:n},"public"),vL(e,r,"private"),iI(e,"rootMount",t=>{p_(t,oT(e))}),iI(e,"debouncedResize",t.onResize),QM(e.current.store,e=>e.dimensions,(t,n)=>{var r,o;n.isReady&&(e.current.rootElementRef.current&&p_(e.current.rootElementRef.current,n),r=n.viewportInnerSize,o=t.viewportInnerSize,(r.width!==o.width||r.height!==o.height)&&e.current.publishEvent("viewportInnerSizeChange",n.viewportInnerSize),e.current.publishEvent("debouncedResize",n.root))})}(e,t),function(e,t){iI(e,"columnHeaderClick",t.onColumnHeaderClick),iI(e,"columnHeaderContextMenu",t.onColumnHeaderContextMenu),iI(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),iI(e,"columnHeaderOver",t.onColumnHeaderOver),iI(e,"columnHeaderOut",t.onColumnHeaderOut),iI(e,"columnHeaderEnter",t.onColumnHeaderEnter),iI(e,"columnHeaderLeave",t.onColumnHeaderLeave),iI(e,"cellClick",t.onCellClick),iI(e,"cellDoubleClick",t.onCellDoubleClick),iI(e,"cellKeyDown",t.onCellKeyDown),iI(e,"preferencePanelClose",t.onPreferencePanelClose),iI(e,"preferencePanelOpen",t.onPreferencePanelOpen),iI(e,"menuOpen",t.onMenuOpen),iI(e,"menuClose",t.onMenuClose),iI(e,"rowDoubleClick",t.onRowDoubleClick),iI(e,"rowClick",t.onRowClick),iI(e,"stateChange",t.onStateChange)}(e,t),(e=>{const t=s.useCallback((t={})=>e.current.unstable_applyPipeProcessors("exportState",{},t),[e]),n=s.useCallback(t=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:t}).callbacks.forEach(e=>{e()})},[e]);vL(e,{exportState:t,restoreState:n},"public")})(e),function(e,t){const{autoHeight:n,disableVirtualization:r}=t,o=t=>{const{virtualizer:r}=e.current;t&&=BA;const o=r.store.getSnapshot();o.virtualization.enabled===t&&o.virtualization.enabledForRows===t&&o.virtualization.enabledForColumns===t||r.store.set("virtualization",f({},r.store.state.virtualization,{enabled:t,enabledForColumns:t,enabledForRows:t&&!n}))};vL(e,{unstable_setVirtualization:o,unstable_setColumnVirtualization:t=>{const{virtualizer:n}=e.current;t&&=BA,n.store.getSnapshot().virtualization.enabledForColumns!==t&&n.store.set("virtualization",f({},n.store.state.virtualization,{enabledForColumns:t}))}},"public");const i=()=>{const{virtualizer:t}=e.current;t?.api.scheduleUpdateRenderContext()};e.current.register("private",{updateRenderContext:i}),iI(e,"sortedRowsSet",i),iI(e,"paginationModelChange",i),iI(e,"columnsChange",i),s.useEffect(()=>{e.current.virtualizer&&o(!t.disableVirtualization)},[e,r,n])}(e,t),function(e,t){const n=()=>{e.current.setState(t=>t.listViewColumn?f({},t,{listViewColumn:f({},t.listViewColumn,{computedWidth:N_(e)})}):t)},r=s.useRef(null);rI(e,"viewportInnerSizeChange",e=>{r.current!==e.width&&(r.current=e.width,n())}),rI(e,"columnVisibilityModelChange",n),Wh(()=>{const n=t.listViewColumn;n&&e.current.setState(t=>f({},t,{listViewColumn:f({},n,{computedWidth:N_(e)})}))},[e,t.listViewColumn]),s.useEffect(()=>{t.listView&&t.listViewColumn},[t.listView,t.listViewColumn])}(e,t),V_(e,t),wL(()=>{e.current.runAppliersForPendingProcessors()}),s.useEffect(()=>{e.current.runAppliersForPendingProcessors()})};function U_(e){const{groupId:t,width:n,depth:r,maxDepth:o,fields:i,height:a,colIndex:l,hasFocus:c,tabIndex:u,isLastColumn:d,pinnedPosition:p,pinnedOffset:h}=e,m=rP(),g=um(),v=s.useRef(null),b=lP(),y=pI(b,JF),w=t?y[t]:{},{headerName:x=t??"",description:S="",headerAlign:C}=w;let k;const E=t&&y[t]?.renderHeaderGroup,R=s.useMemo(()=>({groupId:t,headerName:x,description:S,depth:r,maxDepth:o,fields:i,colIndex:l,isLastColumn:d}),[t,x,S,r,o,i,l,d]);t&&E&&(k=E(R));const P=f({},e,{classes:m.classes,headerAlign:C,depth:r,isDragging:!1}),M=x??t,T=mm(),I=null===t?`empty-group-cell-${T}`:t,O=(e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:o,showLeftBorder:i,showRightBorder:a,groupId:l,pinnedPosition:s}=e;return wm({root:["columnHeader","left"===n&&"columnHeader--alignLeft","center"===n&&"columnHeader--alignCenter","right"===n&&"columnHeader--alignRight",r&&"columnHeader--moving",a&&"columnHeader--withRightBorder",i&&"columnHeader--withLeftBorder","withBorderColor",null===l?"columnHeader--emptyGroup":"columnHeader--filledGroup",s===nD.LEFT&&"columnHeader--pinnedLeft",s===nD.RIGHT&&"columnHeader--pinnedRight",o&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]},YT,t)})(P);s.useLayoutEffect(()=>{if(c){const e=v.current.querySelector('[tabindex="0"]')||v.current;if(!e)return;if(CN())e.focus({preventScroll:!0});else{const t=b.current.getScrollPosition();e.focus(),b.current.scroll(t)}}},[b,c]);const D=s.useCallback(e=>t=>{v$(t)||b.current.publishEvent(e,R,t)},[b,R]),F=s.useMemo(()=>({onKeyDown:D("columnGroupHeaderKeyDown"),onFocus:D("columnGroupHeaderFocus"),onBlur:D("columnGroupHeaderBlur")}),[D]),L="function"==typeof w.headerClassName?w.headerClassName(R):w.headerClassName,A=s.useMemo(()=>EN(f({},e.style),g,p,h),[p,h,e.style,g]);return Xp.jsx(D$,f({ref:v,classes:O,columnMenuOpen:!1,colIndex:l,height:a,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:u,isDraggable:!1,headerComponent:k,headerClassName:L,description:S,elementId:I,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:M,"aria-colspan":i.length,"data-fields":`|-${i.join("-|-")}-|`,style:A},F))}const G_={root:XT.scrollbarFiller,pinnedRight:XT["scrollbarFiller--pinnedRight"]};function K_({pinnedRight:e}){return Xp.jsx("div",{role:"presentation",className:PR(G_.root,e&&G_.pinnedRight)})}const q_=pg("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow"})({display:"flex"}),Y_=["className"],X_=jh("div",{name:"MuiDataGrid",slot:"ColumnHeaders"})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),Q_=TR(function(e,t){const{className:n}=e,r=d(e,Y_),o=rP(),i=(e=>{const{classes:t}=e;return wm({root:["columnHeaders"]},YT,t)})(o);return Xp.jsx(X_,f({className:PR(i.root,n),ownerState:o},r,{role:"presentation",ref:t}))}),Z_=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],J_=TR(function(e,t){const{visibleColumns:n,sortColumnLookup:r,filterColumnLookup:o,columnHeaderTabIndexState:i,columnGroupHeaderTabIndexState:a,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:p,columnVisibility:h,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:g}=e,v=d(e,Z_),{getInnerProps:b,getColumnHeadersRow:y,getColumnGroupHeadersRows:w}=(e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:r,columnHeaderTabIndexState:o,columnGroupHeaderTabIndexState:i,columnHeaderFocus:a,columnGroupHeaderFocus:l,headerGroupingMaxDepth:c,columnMenuState:u,columnVisibility:d,columnGroupsHeaderStructure:p,hasOtherElementInTabSequence:h}=e,[m,g]=s.useState(""),[v,b]=s.useState(""),y=mL(),w=rP(),x=pI(y,ZF),S=pI(y,hO),C=pI(y,UA),k=pI(y,pO),E=pI(y,iO),R=EA(S,C,k.left.length),P=pI(y,iT),M=pI(y,cT),T=pI(y,uT),I=pI(y,dT),O=pI(y,fT),D=s.useCallback(e=>b(e.field),[]),F=s.useCallback(()=>b(""),[]),L=s.useCallback(e=>g(e.field),[]),A=s.useCallback(()=>g(""),[]),N=s.useMemo(()=>k.left.length?{firstColumnIndex:0,lastColumnIndex:k.left.length}:null,[k.left.length]),$=s.useMemo(()=>k.right.length?{firstColumnIndex:t.length-k.right.length,lastColumnIndex:t.length}:null,[k.right.length,t.length]);rI(y,"columnResizeStart",D),rI(y,"columnResizeStop",F),rI(y,"columnHeaderDragStart",L),rI(y,"columnHeaderDragEndNative",A);const z=e=>{const{renderContext:n=C}=e||{},r=n.firstColumnIndex,o=Math.min(n.lastColumnIndex,t.length);return{renderedColumns:t.slice(r,o),firstColumnToRender:r,lastColumnToRender:o}},j=(e,t,n,r=!1)=>{const o=e?.position===nD.RIGHT,i=void 0===e?.position,a=k.right.length>0&&o||0===k.right.length&&i,l=R-n;return Xp.jsxs(s.Fragment,{children:[i&&Xp.jsx("div",{role:"presentation",style:{width:l}}),t,i&&Xp.jsx("div",{role:"presentation",className:PR(XT.filler,r&&XT["filler--borderBottom"])}),a&&Xp.jsx(K_,{pinnedRight:o})]})},B=(e,t={})=>{const{renderedColumns:i,firstColumnToRender:l}=z(e),s=[];for(let c=0;c<i.length;c+=1){const d=i[c],p=l+c,g=0===p,b=null!==o&&o.field===d.field||g&&!h?0:-1,y=null!==a&&a.field===d.field,x=u.open&&u.field===d.field,C=e?.position,k=Fj(C,d.computedWidth,p,S,P,O),E=C===nD.RIGHT?i[c-1]:i[c+1],R=!!E&&null!==a&&a.field===E.field,I=c,D=i.length,F=Aj(C,I,w.showColumnVerticalBorder,w.pinnedColumnsSectionSeparator),L=Lj(C,I,D,w.showColumnVerticalBorder,M,w.pinnedColumnsSectionSeparator);s.push(Xp.jsx(F$,f({},n[d.field],{columnMenuOpen:x,filterItemsCounter:r[d.field]&&r[d.field].length,headerHeight:T,isDragging:d.field===m,colDef:d,colIndex:p,isResizing:v===d.field,isLast:p===S.length-1,hasFocus:y,tabIndex:b,pinnedPosition:C,pinnedOffset:k,isSiblingFocused:R,showLeftBorder:F,showRightBorder:L},t),d.field))}return j(e,s,0)},_=({depth:e,params:n})=>{const r=z(n);if(0===r.renderedColumns.length)return null;const{firstColumnToRender:o,lastColumnToRender:a}=r,s=p[e],u=t[o].field,h=x[u]?.[e]??null,m=s.findIndex(({groupId:e,columnFields:t})=>e===h&&t.includes(u)),g=t[a-1].field,v=x[g]?.[e]??null,b=s.findIndex(({groupId:e,columnFields:t})=>e===v&&t.includes(g)),y=s.slice(m,b+1).map(e=>f({},e,{columnFields:e.columnFields.filter(e=>!1!==d[e])})).filter(e=>e.columnFields.length>0),C=y[0].columnFields.indexOf(u),k=y[0].columnFields.slice(0,C).reduce((e,t)=>e+(E[t].computedWidth??0),0);let R=o;const T=y.map(({groupId:t,columnFields:r},o)=>{const a=null!==l&&l.depth===e&&r.includes(l.field),s=null!==i&&i.depth===e&&r.includes(i.field)?0:-1,u={width:r.reduce((e,t)=>e+E[t].computedWidth,0),fields:r,colIndex:R},d=n.position,p=Fj(d,u.width,R,S,P,O);R+=r.length;let f=o;return d===nD.LEFT&&(f=R-1),Xp.jsx(U_,{groupId:t,width:u.width,fields:u.fields,colIndex:u.colIndex,depth:e,isLastColumn:o===y.length-1,maxDepth:c,height:I,hasFocus:a,tabIndex:s,pinnedPosition:d,pinnedOffset:p,showLeftBorder:Aj(d,f,w.showColumnVerticalBorder,w.pinnedColumnsSectionSeparator),showRightBorder:Lj(d,f,y.length,w.showColumnVerticalBorder,M,w.pinnedColumnsSectionSeparator)},o)});return j(n,T,k)};return{renderContext:C,leftRenderContext:N,rightRenderContext:$,pinnedColumns:k,visibleColumns:t,columnPositions:S,getFillers:j,getColumnHeadersRow:()=>Xp.jsxs(q_,{role:"row","aria-rowindex":c+1,ownerState:w,className:XT["row--borderBottom"],style:{height:T},children:[N&&B({position:nD.LEFT,renderContext:N},{disableReorder:!0}),B({renderContext:C}),$&&B({position:nD.RIGHT,renderContext:$},{disableReorder:!0,separatorSide:M$.Left})]}),getColumnsToRender:z,getColumnGroupHeadersRows:()=>{if(0===c)return null;const e=[];for(let t=0;t<c;t+=1)e.push(Xp.jsxs(q_,{role:"row","aria-rowindex":t+1,ownerState:w,style:{height:I},children:[N&&_({depth:t,params:{position:nD.LEFT,renderContext:N,maxLastColumn:N.lastColumnIndex}}),_({depth:t,params:{renderContext:C}}),$&&_({depth:t,params:{position:nD.RIGHT,renderContext:$,maxLastColumn:$.lastColumnIndex}})]},t));return e},getPinnedCellOffset:Fj,isDragging:!!m,getInnerProps:()=>({role:"rowgroup"})}})({visibleColumns:n,sortColumnLookup:r,filterColumnLookup:o,columnHeaderTabIndexState:i,columnGroupHeaderTabIndexState:a,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:p,columnVisibility:h,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:g});return Xp.jsxs(Q_,f({},v,b(),{ref:t,children:[w(),y()]}))}),eH=KT(J_);const tH=TR(function(e,t){const n=lP().current.getLocaleText("noResultsOverlayLabel");return Xp.jsx(r$,f({},e,{ref:t,children:n}))}),nH=jh("div")({position:"sticky",zIndex:40,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});const rH=f({},SM,{cell:TN,skeletonCell:AN,columnHeaderFilterIconButton:function(e){return e.counter?Xp.jsx(H$,f({},e)):null},columnHeaderSortIcon:_$,columnMenu:ez,columnHeaders:eH,detailPanels:function(e){return null},bottomContainer:function(e){const t=wm({root:["bottomContainer"]},YT,{});return Xp.jsx(nH,f({},e,{className:PR(t.root,XT["container--bottom"]),role:"presentation"}))},footer:Dj,footerRowCount:Yj,toolbar:function(e){const{showQuickFilter:t=!0,quickFilterProps:n,csvOptions:r,printOptions:o,additionalItems:i,additionalExportMenuItems:a}=e,l=d(e,Cj),c=lP(),u=rP(),[p,h]=s.useState(!1),m=s.useRef(null),g=mm(),v=mm(),b=!r?.disableToolbarButton||!o?.disableToolbarButton||a,y=()=>h(!1);return Xp.jsxs(c$,f({},l,{children:[u.label&&Xp.jsx(Mj,{children:u.label}),!u.disableColumnSelector&&Xp.jsx(u.slots.baseTooltip,{title:c.current.getLocaleText("toolbarColumns"),children:Xp.jsx(gj,{render:Xp.jsx(d$,{}),children:Xp.jsx(u.slots.columnSelectorIcon,{fontSize:"small"})})}),!u.disableColumnFilter&&Xp.jsx(u.slots.baseTooltip,{title:c.current.getLocaleText("toolbarFilters"),children:Xp.jsx(hj,{render:(e,t)=>Xp.jsx(d$,f({},e,{color:t.filterCount>0?"primary":"default",children:Xp.jsx(u.slots.baseBadge,{badgeContent:t.filterCount,color:"primary",variant:"dot",children:Xp.jsx(u.slots.openFilterButtonIcon,{fontSize:"small"})})}))})}),i,b&&(!u.disableColumnFilter||!u.disableColumnSelector)&&Xp.jsx(Pj,{}),b&&Xp.jsxs(s.Fragment,{children:[Xp.jsx(u.slots.baseTooltip,{title:c.current.getLocaleText("toolbarExport"),disableInteractive:p,children:Xp.jsx(d$,{ref:m,id:v,"aria-controls":g,"aria-haspopup":"true","aria-expanded":p?"true":void 0,onClick:()=>h(!p),children:Xp.jsx(u.slots.exportIcon,{fontSize:"small"})})}),Xp.jsx(UO,{target:m.current,open:p,onClose:y,position:"bottom-end",children:Xp.jsxs(u.slots.baseMenuList,f({id:g,"aria-labelledby":v,autoFocusItem:!0},u.slotProps?.baseMenuList,{children:[!o?.disableToolbarButton&&Xp.jsx(wj,{render:Xp.jsx(u.slots.baseMenuItem,f({},u.slotProps?.baseMenuItem)),options:o,onClick:y,children:c.current.getLocaleText("toolbarExportPrint")}),!r?.disableToolbarButton&&Xp.jsx(bj,{render:Xp.jsx(u.slots.baseMenuItem,f({},u.slotProps?.baseMenuItem)),options:r,onClick:y,children:c.current.getLocaleText("toolbarExportCSV")}),a?.(y)]}))})]}),t&&Xp.jsxs(s.Fragment,{children:[Xp.jsx(Pj,{}),Xp.jsx(pj,f({},n))]})]}))},pinnedRows:function(e){return null},loadingOverlay:Vj,noResultsOverlay:tH,noRowsOverlay:Wj,noColumnsOverlay:Uj,pagination:function(){const e=lP(),t=rP(),n=pI(e,lF),r=pI(e,sF),o=pI(e,pF),{paginationMode:i,loading:a}=t,l=-1===r&&"server"===i&&a,c=s.useMemo(()=>Math.max(0,o-1),[o]),u=s.useMemo(()=>-1===r||n.page<=c?n.page:c,[c,n.page,r]),d=s.useCallback(t=>{e.current.setPageSize(t)},[e]),p=s.useCallback((t,n)=>{e.current.setPage(n)},[e]),h=(e=>{for(let n=0;n<t.pageSizeOptions.length;n+=1){const r=t.pageSizeOptions[n];if("number"==typeof r){if(r===e)return!0}else if(r.value===e)return!0}return!1})(n.pageSize)?t.pageSizeOptions:[];return Xp.jsx(Gj,f({as:t.slots.basePagination,count:r,page:u,rowsPerPageOptions:h,rowsPerPage:n.pageSize,onPageChange:p,onRowsPerPageChange:d,disabled:l},t.slotProps?.basePagination))},filterPanel:Mz,columnsPanel:function(e){const t=rP();return Xp.jsx(rz,f({},e,{children:Xp.jsx(t.slots.columnsManagement,f({},t.slotProps?.columnsManagement))}))},columnsManagement:function(e){const t=lP(),n=s.useRef(null),r=pI(t,sO),o=pI(t,lO),i=rP(),[a,l]=s.useState(""),c=(e=>{const{classes:t}=e;return wm({root:["columnsManagement"],header:["columnsManagementHeader"],searchInput:["columnsManagementSearchInput"],footer:["columnsManagementFooter"],row:["columnsManagementRow"]},YT,t)})(i),u=pI(t,aO),d=pI(t,SL),p=pI(t,kL),h=s.useMemo(()=>d?Array.from(p.values()):u,[d,p,u]),{sort:m,searchPredicate:g=Tz,autoFocusSearchField:v=!0,disableShowHideToggle:b=!1,disableResetButton:y=!1,toggleAllMode:w="all",getTogglableColumns:x,searchInputProps:S,searchDebounceMs:C=i.columnFilterDebounceMs}=e,k=s.useMemo(()=>Cg(e=>{l(e)},C??150),[C]),E=s.useMemo(()=>((e,t)=>{const n=new Set(Object.keys(e).filter(t=>!1===e[t])),r=new Set(Object.keys(t).filter(e=>!1===t[e]));if(n.size!==r.size)return!1;let o=!0;return n.forEach(e=>{r.has(e)||(o=!1)}),o})(o,r),[o,r]),R=s.useMemo(()=>{switch(m){case"asc":return[...h].sort((e,t)=>Az.compare(e.headerName||e.field,t.headerName||t.field));case"desc":return[...h].sort((e,t)=>-Az.compare(e.headerName||e.field,t.headerName||t.field));default:return h}},[h,m]),P=e=>{const{name:n}=e.target;t.current.setColumnVisibility(n,!1===o[n])},M=s.useMemo(()=>{const e=x?x(R):null,t=e?R.filter(({field:t})=>e.includes(t)):R;return a?t.filter(e=>g(e,a.toLowerCase())):t},[R,a,g,x]),T=s.useCallback(e=>{const n=f({},lO(t)),r=x?x(h):null;return("filteredOnly"===w?M:h).forEach(t=>{t.hideable&&(null==r||r.includes(t.field))&&(e?delete n[t.field]:n[t.field]=!1)}),t.current.setColumnVisibilityModel(n)},[t,h,x,w,M]),I=s.useCallback(e=>{k(e.target.value)},[k]),O=s.useMemo(()=>M.filter(e=>e.hideable),[M]),D=s.useMemo(()=>O.every(e=>null==o[e.field]||!1!==o[e.field]),[o,O]),F=s.useMemo(()=>O.every(e=>!1===o[e.field]),[o,O]),L=s.useRef(null);s.useEffect(()=>{v?n.current?.focus():L.current&&"function"==typeof L.current.focus&&L.current.focus()},[v]);let A=!1;const N=e=>!1===A&&!1!==e.hideable&&(A=!0,!0),$=s.useCallback(()=>{l(""),n.current&&(n.current.value="",n.current.focus())},[]);return Xp.jsxs(s.Fragment,{children:[Xp.jsx(zz,{className:c.header,ownerState:i,children:Xp.jsx(jz,f({as:i.slots.baseTextField,ownerState:i,placeholder:t.current.getLocaleText("columnsManagementSearchTitle"),inputRef:n,className:c.searchInput,onChange:I,size:"small",type:"search",slotProps:{input:{startAdornment:Xp.jsx(i.slots.quickFilterIcon,{fontSize:"small"}),endAdornment:Xp.jsx(i.slots.baseIconButton,f({size:"small","aria-label":t.current.getLocaleText("columnsManagementDeleteIconLabel"),style:a?{visibility:"visible"}:{visibility:"hidden"},tabIndex:-1,onClick:$,edge:"end"},i.slotProps?.baseIconButton,{children:Xp.jsx(i.slots.quickFilterClearIcon,{fontSize:"small"})}))},htmlInput:{"aria-label":t.current.getLocaleText("columnsManagementSearchTitle")}},autoComplete:"off",fullWidth:!0},i.slotProps?.baseTextField,S))}),Xp.jsx($z,{ownerState:i,children:Xp.jsxs(Nz,{className:c.root,ownerState:i,children:[M.map(e=>Xp.jsx(Hz,f({as:i.slots.baseCheckbox,className:c.row,disabled:!1===e.hideable||d,checked:!1!==o[e.field],onChange:P,name:e.field,inputRef:N(e)?L:void 0,label:e.headerName||e.field,density:"compact",fullWidth:!0},i.slotProps?.baseCheckbox),e.field)),0===M.length&&Xp.jsx(_z,{ownerState:i,children:t.current.getLocaleText("columnsManagementNoColumns")})]})}),b&&y?null:Xp.jsxs(Bz,{ownerState:i,className:c.footer,children:[b?Xp.jsx("span",{}):Xp.jsx(i.slots.baseCheckbox,f({disabled:0===O.length||d,checked:D,indeterminate:!D&&!F,onChange:()=>T(!D),name:t.current.getLocaleText("columnsManagementShowHideAllText"),label:t.current.getLocaleText("columnsManagementShowHideAllText"),density:"compact"},i.slotProps?.baseCheckbox)),y?null:Xp.jsx(i.slots.baseButton,f({onClick:()=>t.current.setColumnVisibilityModel(r),disabled:E||d},i.slotProps?.baseButton,{children:t.current.getLocaleText("columnsManagementReset")}))]})]})},panel:sz,row:iB}),oH={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",listView:!1},iH=rH,aH=e=>{const t=sg(),n=s.useMemo(()=>Vh({props:e,theme:t,name:"MuiDataGrid"}),[t,e]),r=s.useMemo(()=>f({},qT,n.localeText),[n.localeText]),o=s.useMemo(()=>function({defaultSlots:e,slots:t}){const n=t;if(!n||0===Object.keys(n).length)return e;const r=f({},e);return Object.keys(n).forEach(e=>{const t=e;void 0!==n[t]&&(r[t]=n[t])}),r}({defaultSlots:iH,slots:n.slots}),[n.slots]),i=s.useMemo(()=>Object.keys(dN).reduce((e,t)=>(e[t]=n[t]??dN[t],e),{}),[n]);return s.useMemo(()=>f({},n,i,{localeText:r,slots:o},(e=>f({},oH,e.dataSource?{filterMode:"server",sortingMode:"server",paginationMode:"server"}:{}))(n)),[n,r,o,i])};class lH{maxListeners=20;warnOnce=!1;events={};on(e,t,n={}){let r=this.events[e];r||(r={highPriority:new Map,regular:new Map},this.events[e]=r),n.isFirst?r.highPriority.set(t,!0):r.regular.set(t,!0)}removeListener(e,t){this.events[e]&&(this.events[e].regular.delete(t),this.events[e].highPriority.delete(t))}removeAllListeners(){this.events={}}emit(e,...t){const n=this.events[e];if(!n)return;const r=Array.from(n.highPriority.keys()),o=Array.from(n.regular.keys());for(let e=r.length-1;e>=0;e-=1){const o=r[e];n.highPriority.has(o)&&o.apply(this,t)}for(let e=0;e<o.length;e+=1){const r=o[e];n.regular.has(r)&&r.apply(this,t)}}once(e,t){const n=this;this.on(e,function r(...o){n.removeListener(e,r),t.apply(n,o)})}}const sH=Symbol("mui.api_private");let cH=0;function uH(e,t){const n=s.useRef(null),r=s.useRef(null);r.current||(r.current=function(e){const t=e.current?.[sH];if(t)return t;const n={},r={state:n,store:JM.create(n),instanceId:{id:cH}};return cH+=1,r.getPublicApi=()=>e.current,r.register=(t,n)=>{Object.keys(n).forEach(o=>{const i=n[o],a=r[o];if(!0===a?.spying?a.target=i:r[o]=i,"public"===t){const t=e.current,n=t[o];!0===n?.spying?n.target=i:t[o]=i}})},r.register("private",{caches:{},eventManager:new lH}),r}(n)),n.current||(n.current=function(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[sH]:e.current}}(r));const o=s.useCallback((...e)=>{const[n,o,i={}]=e;if(i.defaultMuiPrevented=!1,(e=>void 0!==e.isPropagationStopped)(i)&&i.isPropagationStopped())return;const a=t.signature===QT.DataGridPro||t.signature===QT.DataGridPremium?{api:r.current.getPublicApi()}:{};r.current.eventManager.emit(n,o,i,a)},[r,t.signature]),i=s.useCallback((e,t,n)=>{r.current.eventManager.on(e,t,n);const o=r.current;return()=>{o.eventManager.removeListener(e,t)}},[r]);return vL(r,{subscribeEvent:i,publishEvent:o},"public"),e&&!e.current?.state&&(e.current=n.current),s.useImperativeHandle(e,()=>n.current,[n]),s.useEffect(()=>{const e=r.current;return()=>{e.publishEvent("unmount")}},[r]),r}const dH={hooks:{useCSSVariables:function(){const e=sg();return s.useMemo(()=>{const t=fP(function(e){const t=new WeakSet;return JSON.stringify(e,(e,n)=>{if("undefined"!=typeof window&&n===window||"undefined"!=typeof document&&n===document)return n.toString();if(null!==n&&"object"==typeof n){if(s.isValidElement(n))return null;if(t.has(n))return null;t.add(n)}return n})}(e)),n=function(e){const t=function(e){if(e.vars)return e.vars.palette.TableCell.border;if("light"===e.palette.mode)return im(tm(e.palette.divider,1),.88);return rm(tm(e.palette.divider,1),.68)}(e),n=(e.vars||e).palette.DataGrid,r=n?.bg??("dark"===e.palette.mode?`color-mix(in srgb, ${(e.vars||e).palette.background.paper} 95%, #fff)`:(e.vars||e).palette.background.paper),o=n?.headerBg??r,i=n?.pinnedBg??r,a=e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:tm(e.palette.background.default,e.palette.action.disabledOpacity),l="dark"===e.palette.mode?`color-mix(in srgb, ${(e.vars||e).palette.background.paper} 90%, #fff)`:(e.vars||e).palette.background.paper,s=e.vars?`rgb(${e.vars.palette.primary.mainChannel})`:e.palette.primary.main,c=function(e){if(e.vars)return e.vars.shape.borderRadius;return"number"==typeof e.shape.borderRadius?`${e.shape.borderRadius}px`:e.shape.borderRadius}(e),u=e.vars?.font?.body2??xP(e.typography.body2),d=e.vars?.font?.caption??xP(e.typography.caption),p=e.vars?.font?.body1??xP(e.typography.body1),f=bP.keys;return{[f.spacingUnit]:e.vars?e.vars.spacing??e.spacing(1):e.spacing(1),[f.colors.border.base]:t,[f.colors.background.base]:r,[f.colors.background.overlay]:l,[f.colors.background.backdrop]:a,[f.colors.foreground.base]:(e.vars||e).palette.text.primary,[f.colors.foreground.muted]:(e.vars||e).palette.text.secondary,[f.colors.foreground.accent]:(e.vars||e).palette.primary.dark,[f.colors.foreground.disabled]:(e.vars||e).palette.text.disabled,[f.colors.foreground.error]:(e.vars||e).palette.error.dark,[f.colors.interactive.hover]:(e.vars||e).palette.action.hover,[f.colors.interactive.hoverOpacity]:(e.vars||e).palette.action.hoverOpacity,[f.colors.interactive.focus]:wP((e.vars||e).palette.primary.main),[f.colors.interactive.focusOpacity]:(e.vars||e).palette.action.focusOpacity,[f.colors.interactive.disabled]:wP((e.vars||e).palette.action.disabled),[f.colors.interactive.disabledOpacity]:(e.vars||e).palette.action.disabledOpacity,[f.colors.interactive.selected]:s,[f.colors.interactive.selectedOpacity]:(e.vars||e).palette.action.selectedOpacity,[f.header.background.base]:o,[f.cell.background.pinned]:i,[f.radius.base]:c,[f.typography.fontFamily.base]:e.typography.fontFamily,[f.typography.fontWeight.light]:e.typography.fontWeightLight,[f.typography.fontWeight.regular]:e.typography.fontWeightRegular,[f.typography.fontWeight.medium]:e.typography.fontWeightMedium,[f.typography.fontWeight.bold]:e.typography.fontWeightBold,[f.typography.font.body]:u,[f.typography.font.small]:d,[f.typography.font.large]:p,[f.transitions.easing.easeIn]:e.transitions.easing.easeIn,[f.transitions.easing.easeOut]:e.transitions.easing.easeOut,[f.transitions.easing.easeInOut]:e.transitions.easing.easeInOut,[f.transitions.duration.short]:`${e.transitions.duration.shorter}ms`,[f.transitions.duration.base]:`${e.transitions.duration.short}ms`,[f.transitions.duration.long]:`${e.transitions.duration.standard}ms`,[f.shadows.base]:(e.vars||e).shadows[2],[f.shadows.overlay]:(e.vars||e).shadows[8],[f.zIndex.panel]:(e.vars||e).zIndex.modal,[f.zIndex.menu]:(e.vars||e).zIndex.modal}}(e);return{id:t,variables:n}},[e])},useGridAriaAttributes:()=>{const e=mL(),t=rP(),n=pI(e,cO),r=pI(e,MD),o=pI(e,tL),i=pI(e,IT),a=t["aria-label"],l=t["aria-labelledby"];return{role:"grid","aria-label":!a&&!l&&t.label?t.label:a,"aria-labelledby":l,"aria-colcount":n.length,"aria-rowcount":o+1+i+r,"aria-multiselectable":HD(t)}},useGridRowAriaAttributes:()=>{const e=mL(),t=pI(e,tL);return s.useCallback((n,r)=>{const o={},i=r+t+2;return o["aria-rowindex"]=i,n&&e.current.isRowSelectable(n.id)&&(o["aria-selected"]=e.current.isRowSelected(n.id)),o},[e,t])},useGridRowsOverridableMethods:e=>{const t=s.useCallback((t,n,r)=>{const o=ST(e,t),i=ST(e,n);if(!o)throw new Error(`MUI X: No row with id #${t} found.`);if(!i)throw new Error(`MUI X: No row with id #${n} found.`);if("leaf"!==o.type)throw new Error("MUI X: The row reordering does not support reordering of footer or grouping rows.");if("inside"===r)throw new Error("MUI X: The 'inside' position is only supported for tree data. Use 'above' or 'below' for flat data.");const a=FD(e),l=a[n];if(void 0===l)throw new Error(`MUI X: Target row with id #${n} not found in current view.`);const s=a[t];if(void 0===s)throw new Error(`MUI X: Source row with id #${t} not found in current view.`);let c;c="up"===(l<s?"up":"down")?"above"===r?l:l+1:"above"===r?l-1:l,c!==s&&(e.current.setState(t=>{const n=xT(e)[OT],r=[...n.children];return r.splice(c,0,r.splice(s,1)[0]),f({},t,{rows:f({},t.rows,{tree:f({},t.rows.tree,{[OT]:f({},n,{children:r})})})})}),e.current.publishEvent("rowsSet"))},[e]),n=s.useCallback((t,n)=>{const r=ST(e,t);if(!r)throw new Error(`MUI X: No row with id #${t} found.`);if("leaf"!==r.type)throw new Error("MUI X: The row reordering does not support reordering of footer or grouping rows.");e.current.setState(r=>{const o=xT(e)[OT],i=o.children,a=i.findIndex(e=>e===t);if(-1===a||a===n)return r;const l=[...i];return l.splice(n,0,l.splice(a,1)[0]),f({},r,{rows:f({},r.rows,{tree:f({},r.rows.tree,{[OT]:f({},o,{children:l})})})})}),e.current.publishEvent("rowsSet")},[e]);return{setRowIndex:n,setRowPosition:t}},useGridParamsOverridableMethods:e=>{const t=s.useCallback((t,n)=>{const r=e.current.getColumn(n),o=e.current.getRow(t);if(!o)throw new Error(`No row with id #${t} found`);return r&&r.valueGetter?r.valueGetter(o[r.field],o,r,e):o[n]},[e]),n=s.useCallback((t,n)=>LT(t,n,e),[e]),r=s.useCallback((t,r)=>{const o=n(t,r);return r&&r.valueFormatter?r.valueFormatter(o,t,r,e):o},[e,n]);return{getCellValue:t,getRowValue:n,getRowFormattedValue:r}},useIsCellEditable:()=>s.useCallback(e=>!jT(e.rowNode),[]),useCellAggregationResult:()=>null,useFilterValueGetter:e=>e.current.getRowValue}},pH=function(e,t){const n=aH(e),r=uH(n.apiRef,n);return W_(r,n,dH),Xp.jsx(aB,{privateApiRef:r,configuration:dH,props:n,children:Xp.jsx(QN,f({className:n.className,style:n.style,sx:n.sx},n.slotProps?.root,{ref:t}))})},fH=s.memo(TR(pH));pH.propTypes={apiRef:C.shape({current:C.object}),"aria-label":C.string,"aria-labelledby":C.string,autoHeight:C.bool,autoPageSize:C.bool,autosizeOnMount:C.bool,autosizeOptions:C.shape({columns:C.arrayOf(C.string),disableColumnVirtualization:C.bool,expand:C.bool,includeHeaders:C.bool,includeOutliers:C.bool,outliersFactor:C.number}),cellModesModel:C.object,checkboxSelection:C.bool,classes:C.object,className:C.string,clipboardCopyCellDelimiter:C.string,columnBufferPx:C.number,columnFilterDebounceMs:C.number,columnGroupHeaderHeight:C.number,columnGroupingModel:C.arrayOf(C.object),columnHeaderHeight:C.number,columns:C.arrayOf(C.object).isRequired,columnVisibilityModel:C.object,dataSource:C.shape({getRows:C.func.isRequired,updateRow:C.func}),dataSourceCache:C.shape({clear:C.func.isRequired,get:C.func.isRequired,set:C.func.isRequired}),density:C.oneOf(["comfortable","compact","standard"]),disableAutosize:C.bool,disableColumnFilter:C.bool,disableColumnMenu:C.bool,disableColumnResize:C.bool,disableColumnSelector:C.bool,disableColumnSorting:C.bool,disableDensitySelector:C.bool,disableEval:C.bool,disableMultipleRowSelection:C.bool,disableRowSelectionExcludeModel:C.bool,disableRowSelectionOnClick:C.bool,disableVirtualization:C.bool,editMode:C.oneOf(["cell","row"]),estimatedRowCount:C.number,experimentalFeatures:C.shape({warnIfFocusStateIsNotSynced:C.bool}),filterDebounceMs:C.number,filterMode:C.oneOf(["client","server"]),filterModel:C.shape({items:C.arrayOf(C.shape({field:C.string.isRequired,id:C.oneOfType([C.number,C.string]),operator:C.string.isRequired,value:C.any})).isRequired,logicOperator:C.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:C.bool,quickFilterLogicOperator:C.oneOf(["and","or"]),quickFilterValues:C.array}),getCellClassName:C.func,getDetailPanelContent:C.func,getEstimatedRowHeight:C.func,getRowClassName:C.func,getRowHeight:C.func,getRowId:C.func,getRowSpacing:C.func,hideFooter:C.bool,hideFooterPagination:C.bool,hideFooterSelectedRowCount:C.bool,ignoreDiacritics:C.bool,ignoreValueFormatterDuringExport:C.oneOfType([C.shape({clipboardExport:C.bool,csvExport:C.bool}),C.bool]),initialState:C.object,isCellEditable:C.func,isRowSelectable:C.func,keepNonExistentRowsSelected:C.bool,label:C.string,loading:C.bool,localeText:C.object,logger:C.shape({debug:C.func.isRequired,error:C.func.isRequired,info:C.func.isRequired,warn:C.func.isRequired}),logLevel:C.oneOf(["debug","error","info","warn",!1]),nonce:C.string,onCellClick:C.func,onCellDoubleClick:C.func,onCellEditStart:C.func,onCellEditStop:C.func,onCellKeyDown:C.func,onCellModesModelChange:C.func,onClipboardCopy:C.func,onColumnHeaderClick:C.func,onColumnHeaderContextMenu:C.func,onColumnHeaderDoubleClick:C.func,onColumnHeaderEnter:C.func,onColumnHeaderLeave:C.func,onColumnHeaderOut:C.func,onColumnHeaderOver:C.func,onColumnOrderChange:C.func,onColumnResize:C.func,onColumnVisibilityModelChange:C.func,onColumnWidthChange:C.func,onDataSourceError:C.func,onDensityChange:C.func,onFilterModelChange:C.func,onMenuClose:C.func,onMenuOpen:C.func,onPaginationMetaChange:C.func,onPaginationModelChange:C.func,onPreferencePanelClose:C.func,onPreferencePanelOpen:C.func,onProcessRowUpdateError:C.func,onResize:C.func,onRowClick:C.func,onRowCountChange:C.func,onRowDoubleClick:C.func,onRowEditStart:C.func,onRowEditStop:C.func,onRowModesModelChange:C.func,onRowSelectionModelChange:C.func,onSortModelChange:C.func,onStateChange:C.func,pageSizeOptions:C.arrayOf(C.oneOfType([C.number,C.shape({label:C.string.isRequired,value:C.number.isRequired})]).isRequired),pagination:C.oneOf([!0]),paginationMeta:C.shape({hasNextPage:C.bool}),paginationMode:C.oneOf(["client","server"]),paginationModel:C.shape({page:C.number.isRequired,pageSize:C.number.isRequired}),processRowUpdate:C.func,resizeThrottleMs:C.number,rowBufferPx:C.number,rowCount:C.number,rowHeight:C.number,rowModesModel:C.object,rows:C.arrayOf(C.object),rowSelection:C.bool,rowSelectionModel:C.shape({ids:C.instanceOf(Set).isRequired,type:C.oneOf(["exclude","include"]).isRequired}),rowSpacingType:C.oneOf(["border","margin"]),rowSpanning:C.bool,scrollbarSize:C.number,showCellVerticalBorder:C.bool,showColumnVerticalBorder:C.bool,showToolbar:C.bool,slotProps:C.object,slots:C.object,sortingMode:C.oneOf(["client","server"]),sortingOrder:C.arrayOf(C.oneOf(["asc","desc"])),sortModel:C.arrayOf(C.shape({field:C.string.isRequired,sort:C.oneOf(["asc","desc"])})),style:C.object,sx:C.oneOfType([C.arrayOf(C.oneOfType([C.func,C.object,C.bool])),C.func,C.object]),virtualizeColumnsWithAutoRowHeight:C.bool};var hH=Sg(Xp.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),mH=Sg(Xp.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"})),gH=Sg(Xp.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"})),vH=Sg(Xp.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"})),bH=Sg(Xp.jsx("path",{d:"M8 5v14l11-7z"}));const yH=({open:e,title:t="Confirm Action",message:n,onConfirm:r,onCancel:o,confirmText:i="Confirm",cancelText:a="Cancel",confirmColor:l="error"})=>c.createElement(zx,{open:e,onClose:o,"aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-description"},c.createElement(Qx,{id:"confirm-dialog-title"},t),c.createElement(Gx,null,c.createElement(Yx,{id:"confirm-dialog-description"},n)),c.createElement(_x,null,c.createElement(Xw,{onClick:o,variant:"outlined"},a),c.createElement(Xw,{onClick:r,variant:"contained",color:l,autoFocus:!0},i))),wH=({onSelectReport:e,onAddNew:t,onCloneReport:n,onRunReport:r,refreshTrigger:o})=>{const i=ER(),[a,l]=s.useState([]),[u,d]=s.useState(!0),[p,f]=s.useState(null),[h,m]=s.useState(!1),[g,v]=s.useState(null);s.useEffect(()=>{b()},[o]);const b=async()=>{try{d(!0),f(null);const e=await jc.getReportDefinitions();l(e)}catch(e){console.error("Error loading report definitions:",e);const t="Failed to load report definitions: "+(e.message||"Unknown error");f(t),i.error(t)}finally{d(!1)}},y=[{field:"title",headerName:"Title",flex:1,minWidth:200},{field:"provider",headerName:"Provider",flex:1,minWidth:200},{field:"actions",headerName:"Actions",width:200,sortable:!1,filterable:!1,disableColumnMenu:!0,renderCell:t=>c.createElement(jw,{sx:{display:"flex",gap:1}},c.createElement(Hk,{title:"Run"},c.createElement(Mv,{size:"small",color:"success",onClick:e=>{return n=t.row.id,e.stopPropagation(),void r(n);var n}},c.createElement(bH,{fontSize:"small"}))),c.createElement(Hk,{title:"Edit"},c.createElement(Mv,{size:"small",color:"primary",onClick:n=>{return r=t.row.id,n.stopPropagation(),void e(r);var r}},c.createElement(mH,{fontSize:"small"}))),c.createElement(Hk,{title:"Clone"},c.createElement(Mv,{size:"small",onClick:e=>(async(e,t)=>{t.stopPropagation();try{const t=await jc.getReportDefinition({id:e}),r={...t,title:`${t.title} (Copy)`};n(r)}catch(e){console.error("Error cloning report:",e),i.error("Failed to clone report: "+(e.message||"Unknown error"))}})(t.row.id,e)},c.createElement(gH,{fontSize:"small"}))),c.createElement(Hk,{title:"Delete"},c.createElement(Mv,{size:"small",color:"error",onClick:e=>((e,t)=>{t.stopPropagation();const n=a.find(t=>t.id===e);v(n),m(!0)})(t.row.id,e)},c.createElement(vH,{fontSize:"small"}))))}],w=a.map(e=>({id:e.id,title:e.title,provider:e.provider}));return u?c.createElement(jw,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400},c.createElement(Cv,null)):p?c.createElement(jw,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:400,gap:2},c.createElement(Gv,{variant:"body1",color:"error"},p),c.createElement(Xw,{variant:"contained",onClick:b},"Retry")):c.createElement(jw,{sx:{p:3}},c.createElement(jw,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3}},c.createElement(Gv,{variant:"h4",component:"h1"},"Report Definitions"),c.createElement(Xw,{variant:"contained",color:"primary",startIcon:c.createElement(hH,null),onClick:t},"Add New Report")),c.createElement(jw,{sx:{height:600,width:"100%"}},c.createElement(fH,{rows:w,columns:y,pageSize:10,rowsPerPageOptions:[10,25,50],disableSelectionOnClick:!0,onRowClick:t=>{e(t.row.id)},sx:{"& .MuiDataGrid-row":{cursor:"pointer"},"& .MuiDataGrid-row:hover":{backgroundColor:"#f5f5f5"},"& .MuiDataGrid-columnHeader":{backgroundColor:"#f5f5f5",fontWeight:"bold"}}})),c.createElement(yH,{open:h,title:"Delete Report Definition",message:g?`Are you sure you want to delete "${g.title}"? This action cannot be undone.`:"",onConfirm:async()=>{if(g)try{await jc.deleteReportDefinition({id:g.id}),i.success(`Report "${g.title}" deleted successfully!`),m(!1),v(null),b()}catch(e){console.error("Error deleting report:",e),i.error("Failed to delete report: "+(e.response?.data?.message||e.message||"Unknown error")),m(!1),v(null)}},onCancel:()=>{m(!1),v(null)},confirmText:"Delete",cancelText:"Cancel",confirmColor:"error"}))};var xH=Sg(Xp.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),SH=Sg(Xp.jsx("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"})),CH=Sg(Xp.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}));const kH=({providersData:e,rootProvider:t,onSelectionChange:n,existingDimensions:r=[],existingMetrics:o=[],existingFilters:i={}})=>{const[a,l]=s.useState([]);s.useEffect(()=>{l([]),n&&n([])},[t]);const u=t=>{if(!e||!t)return[];const n=e[t];if(!n||!n.relations||0===n.relations.length)return[];const a=(()=>{const e=new Map,t=t=>{if(t.relations&&t.providerPath)for(let n=0;n<t.relations.length;n++){const r=t.relations[n],o=t.providerPath[n];r.type&&(e.has(o)||e.set(o,new Set),e.get(o).add(r.name))}};return r.forEach(t),o.forEach(t),Object.values(i).forEach(t),e})().get(t);return n.relations.filter(t=>e[t.target]).map(e=>{let t=!1,n=null;if(!!e.type&&a&&a.size>0){if(!a.has(e.name)&&a.size>0){t=!0;n=`Cannot select: '${Array.from(a)[0]}' is already in use`}}return{key:e.name,value:e.name,targetKey:e.target,disabled:t,disabledReason:n}})},d=(e,r)=>{const o=r.target.value,i=0===e?t:a[e-1].targetKey,s=u(i).find(e=>e.key===o);if(!s)return;const c=a.slice(0,e);c.push({providerKey:o,relationName:o,targetKey:s.targetKey}),l(c),console.log("Selection chain:",c),n&&n(c)};return c.createElement(jw,null,a.length>0&&c.createElement(jw,{sx:{marginBottom:2}},c.createElement(Gv,{variant:"subtitle2",sx:{marginBottom:1,color:"text.secondary"}},"Selected Path:"),c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"}},c.createElement(zy,{label:t,size:"small",color:"primary",variant:"outlined"}),a.map((e,t)=>c.createElement(c.Fragment,{key:t},c.createElement(Gv,{variant:"body2",sx:{color:"text.secondary"}},"→"),c.createElement(zy,{label:e.targetKey,size:"small",color:"primary",onDelete:()=>(e=>{const t=a.slice(0,e);l(t),n&&n(t)})(t),sx:{fontWeight:500}}))))),c.createElement("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"flex-start",gap:"8px"}},(()=>{if(!e||!t)return null;const n=[],r=u(t);r.length>0&&n.push(c.createElement("div",{key:"level-0",style:{marginRight:"16px"}},c.createElement(uR,{items:r,value:a[0]?.providerKey||"",label:`Related to ${t}`,onChange:e=>d(0,e),sx:{width:"300px"}})));for(let e=0;e<a.length;e++){const t=a[e],r=u(t.targetKey);if(r.length>0){const o=a[e+1];n.push(c.createElement("div",{key:`level-${e+1}`,style:{marginRight:"16px"}},c.createElement(uR,{items:r,value:o?.providerKey||"",label:`Related to ${t.targetKey}`,onChange:t=>d(e+1,t),sx:{width:"300px"}})))}}return n})()))};const EH="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function RH(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function PH(e){return"nodeType"in e}function MH(e){var t,n;return e?RH(e)?e:PH(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function TH(e){const{Document:t}=MH(e);return e instanceof t}function IH(e){return!RH(e)&&e instanceof MH(e).HTMLElement}function OH(e){return e instanceof MH(e).SVGElement}function DH(e){return e?RH(e)?e.document:PH(e)?TH(e)?e:IH(e)||OH(e)?e.ownerDocument:document:document:document}const FH=EH?s.useLayoutEffect:s.useEffect;function LH(e){const t=s.useRef(e);return FH(()=>{t.current=e}),s.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function AH(e,t){void 0===t&&(t=[e]);const n=s.useRef(e);return FH(()=>{n.current!==e&&(n.current=e)},t),n}function NH(e,t){const n=s.useRef();return s.useMemo(()=>{const t=e(n.current);return n.current=t,t},[...t])}function $H(e){const t=LH(e),n=s.useRef(null),r=s.useCallback(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function zH(e){const t=s.useRef();return s.useEffect(()=>{t.current=e},[e]),t.current}let jH={};function BH(e,t){return s.useMemo(()=>{if(t)return t;const n=null==jH[e]?0:jH[e]+1;return jH[e]=n,e+"-"+n},[e,t])}function _H(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const HH=_H(1),VH=_H(-1);function WH(e){if(!e)return!1;const{KeyboardEvent:t}=MH(e.target);return t&&e instanceof t}function UH(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=MH(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const GH=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[GH.Translate.toString(e),GH.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),KH="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function qH(e){return e.matches(KH)?e:e.querySelector(KH)}const YH={display:"none"};function XH(e){let{id:t,value:n}=e;return c.createElement("div",{id:t,style:YH},n)}function QH(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return c.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const ZH=s.createContext(null);const JH={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},eV={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function tV(e){let{announcements:t=eV,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=JH}=e;const{announce:i,announcement:a}=function(){const[e,t]=s.useState("");return{announce:s.useCallback(e=>{null!=e&&t(e)},[]),announcement:e}}(),l=BH("DndLiveRegion"),[u,d]=s.useState(!1);if(s.useEffect(()=>{d(!0)},[]),function(e){const t=s.useContext(ZH);s.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(s.useMemo(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!u)return null;const p=c.createElement(c.Fragment,null,c.createElement(XH,{id:r,value:o.draggable}),c.createElement(QH,{id:l,announcement:a}));return n?So.createPortal(p,n):p}var nV;function rV(){}function oV(e,t){return s.useMemo(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}function iV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.useMemo(()=>[...t].filter(e=>null!=e),[...t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(nV||(nV={}));const aV=Object.freeze({x:0,y:0});function lV(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function sV(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function cV(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function uV(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function dV(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}function pV(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const fV=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=pV(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=lV(pV(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(sV)};function hV(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const mV=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=hV(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(cV)};function gV(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:aV}function vV(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const bV=vV(1);const yV={ignoreTransform:!1};function wV(e,t){void 0===t&&(t=yV);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=MH(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,s=e.left-a-(1-o)*parseFloat(n),c=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:s+u,bottom:c+d,left:s}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:s}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:s}}function xV(e){return wV(e,{ignoreTransform:!0})}function SV(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(TH(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!IH(o)||OH(o))return n;if(n.includes(o))return n;const i=MH(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=MH(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=MH(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function CV(e){const[t]=SV(e,1);return null!=t?t:null}function kV(e){return EH&&e?RH(e)?e:PH(e)?TH(e)||e===DH(e).scrollingElement?window:IH(e)?e:null:null:null}function EV(e){return RH(e)?e.scrollX:e.scrollLeft}function RV(e){return RH(e)?e.scrollY:e.scrollTop}function PV(e){return{x:EV(e),y:RV(e)}}var MV;function TV(e){return!(!EH||!e)&&e===document.scrollingElement}function IV(e){const t={x:0,y:0},n=TV(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(MV||(MV={}));const OV={x:.2,y:.2};function DV(e,t,n,r,o){let{top:i,left:a,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=OV);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=IV(e),f={x:0,y:0},h={x:0,y:0},m=t.height*o.y,g=t.width*o.x;return!c&&i<=t.top+m?(f.y=MV.Backward,h.y=r*Math.abs((t.top+m-i)/m)):!u&&s>=t.bottom-m&&(f.y=MV.Forward,h.y=r*Math.abs((t.bottom-m-s)/m)),!p&&l>=t.right-g?(f.x=MV.Forward,h.x=r*Math.abs((t.right-g-l)/g)):!d&&a<=t.left+g&&(f.x=MV.Backward,h.x=r*Math.abs((t.left+g-a)/g)),{direction:f,speed:h}}function FV(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function LV(e){return e.reduce((e,t)=>HH(e,PV(t)),aV)}const AV=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+EV(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+RV(t),0)}]];class NV{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=SV(t),r=LV(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of AV)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class $V{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function zV(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var jV,BV;function _V(e){e.preventDefault()}function HV(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(jV||(jV={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(BV||(BV={}));const VV={start:[BV.Space,BV.Enter],cancel:[BV.Esc],end:[BV.Space,BV.Enter,BV.Tab]},WV=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case BV.Right:return{...n,x:n.x+25};case BV.Left:return{...n,x:n.x-25};case BV.Down:return{...n,y:n.y+25};case BV.Up:return{...n,y:n.y-25}}};class UV{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new $V(DH(t)),this.windowListeners=new $V(MH(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(jV.Resize,this.handleCancel),this.windowListeners.add(jV.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(jV.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=wV),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);CV(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(aV)}handleKeyDown(e){if(WH(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=VV,coordinateGetter:i=WV,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:aV;this.referenceCoordinates||(this.referenceCoordinates=c);const u=i(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=VH(u,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:s,isBottom:c,maxScroll:d,minScroll:p}=IV(n),f=FV(n),h={x:Math.min(o===BV.Right?f.right-f.width/2:f.right,Math.max(o===BV.Right?f.left:f.left+f.width/2,u.x)),y:Math.min(o===BV.Down?f.bottom-f.height/2:f.bottom,Math.max(o===BV.Down?f.top:f.top+f.height/2,u.y))},m=o===BV.Right&&!l||o===BV.Left&&!s,g=o===BV.Down&&!c||o===BV.Up&&!i;if(m&&h.x!==u.x){const e=n.scrollLeft+t.x,i=o===BV.Right&&e<=d.x||o===BV.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===BV.Right?n.scrollLeft-d.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(g&&h.y!==u.y){const e=n.scrollTop+t.y,i=o===BV.Down&&e<=d.y||o===BV.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===BV.Down?n.scrollTop-d.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,HH(VH(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function GV(e){return Boolean(e&&"distance"in e)}function KV(e){return Boolean(e&&"delay"in e)}UV.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=VV,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class qV{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=MH(e);return e instanceof t?e:DH(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=DH(i),this.documentListeners=new $V(this.document),this.listeners=new $V(n),this.windowListeners=new $V(MH(i)),this.initialCoordinates=null!=(r=UH(o))?r:aV,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(jV.Resize,this.handleCancel),this.windowListeners.add(jV.DragStart,_V),this.windowListeners.add(jV.VisibilityChange,this.handleCancel),this.windowListeners.add(jV.ContextMenu,_V),this.documentListeners.add(jV.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(KV(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(GV(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(jV.Click,HV,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(jV.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=UH(e))?t:aV,s=VH(r,l);if(!n&&a){if(GV(a)){if(null!=a.tolerance&&zV(s,a.tolerance))return this.handleCancel();if(zV(s,a.distance))return this.handleStart()}return KV(a)&&zV(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===BV.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const YV={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class XV extends qV{constructor(e){const{event:t}=e,n=DH(t.target);super(e,YV,n)}}XV.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const QV={move:{name:"mousemove"},end:{name:"mouseup"}};var ZV;!function(e){e[e.RightClick=2]="RightClick"}(ZV||(ZV={}));(class extends qV{constructor(e){super(e,QV,DH(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ZV.RightClick&&(null==r||r({event:n}),!0)}}];const JV={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var eW,tW;function nW(e){let{acceleration:t,activator:n=eW.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:l=tW.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:p,threshold:f}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=zH(t);return NH(e=>{if(n||!r||!e)return rW;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[MV.Backward]:e.x[MV.Backward]||-1===o.x,[MV.Forward]:e.x[MV.Forward]||1===o.x},y:{[MV.Backward]:e.y[MV.Backward]||-1===o.y,[MV.Forward]:e.y[MV.Forward]||1===o.y}}},[n,t,r])}({delta:p,disabled:!i}),[m,g]=function(){const e=s.useRef(null),t=s.useCallback((t,n)=>{e.current=setInterval(t,n)},[]);return[t,s.useCallback(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),v=s.useRef({x:0,y:0}),b=s.useRef({x:0,y:0}),y=s.useMemo(()=>{switch(n){case eW.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case eW.DraggableRect:return o}},[n,o,c]),w=s.useRef(null),x=s.useCallback(()=>{const e=w.current;if(!e)return;const t=v.current.x*b.current.x,n=v.current.y*b.current.y;e.scrollBy(t,n)},[]),S=s.useMemo(()=>l===tW.TreeOrder?[...u].reverse():u,[l,u]);s.useEffect(()=>{if(i&&u.length&&y){for(const e of S){if(!1===(null==r?void 0:r(e)))continue;const n=u.indexOf(e),o=d[n];if(!o)continue;const{direction:i,speed:l}=DV(e,o,y,t,f);for(const e of["x","y"])h[e][i[e]]||(l[e]=0,i[e]=0);if(l.x>0||l.y>0)return g(),w.current=e,m(x,a),v.current=l,void(b.current=i)}v.current={x:0,y:0},b.current={x:0,y:0},g()}else g()},[t,x,r,g,i,a,JSON.stringify(y),JSON.stringify(h),m,u,S,d,JSON.stringify(f)])}(class extends qV{constructor(e){super(e,JV)}static setup(){return window.addEventListener(JV.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(JV.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(eW||(eW={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(tW||(tW={}));const rW={x:{[MV.Backward]:!1,[MV.Forward]:!1},y:{[MV.Backward]:!1,[MV.Forward]:!1}};var oW,iW;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(oW||(oW={})),function(e){e.Optimized="optimized"}(iW||(iW={}));const aW=new Map;function lW(e,t){return NH(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function sW(e){let{callback:t,disabled:n}=e;const r=LH(t),o=s.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return s.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function cW(e){return new NV(wV(e),e)}function uW(e,t,n){void 0===t&&(t=cW);const[r,o]=s.useState(null);function i(){o(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const a=function(e){let{callback:t,disabled:n}=e;const r=LH(t),o=s.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return s.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),l=sW({callback:i});return FH(()=>{i(),e?(null==l||l.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==a||a.disconnect())},[e]),r}const dW=[];function pW(e,t){void 0===t&&(t=[]);const n=s.useRef(null);return s.useEffect(()=>{n.current=null},t),s.useEffect(()=>{const t=e!==aV;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?VH(e,n.current):aV}function fW(e){return s.useMemo(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const hW=[];function mW(e){let{measure:t}=e;const[n,r]=s.useState(null),o=s.useCallback(e=>{for(const{target:n}of e)if(IH(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),i=sW({callback:o}),a=s.useCallback(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return IH(t)?t:e}(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)},[t,i]),[l,c]=$H(a);return s.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const gW=[{sensor:XV,options:{}},{sensor:UV,options:{}}],vW={current:{}},bW={draggable:{measure:xV},droppable:{measure:xV,strategy:oW.WhileDragging,frequency:iW.Optimized},dragOverlay:{measure:wV}};class yW extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const wW={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new yW,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:rV},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:bW,measureDroppableContainers:rV,windowRect:null,measuringScheduled:!1},xW={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:rV,draggableNodes:new Map,over:null,measureDroppableContainers:rV},SW=s.createContext(xW),CW=s.createContext(wW);function kW(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new yW}}}function EW(e,t){switch(t.type){case nV.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case nV.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case nV.DragEnd:case nV.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case nV.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new yW(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case nV.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new yW(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case nV.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new yW(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function RW(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=s.useContext(SW),i=zH(r),a=zH(null==n?void 0:n.id);return s.useEffect(()=>{if(!t&&!r&&i&&null!=a){if(!WH(i))return;if(document.activeElement===i.target)return;const e=o.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=qH(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}const PW=s.createContext({...aV,scaleX:1,scaleY:1});var MW;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(MW||(MW={}));const TW=s.memo(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:l=!0,children:u,sensors:d=gW,collisionDetection:p=mV,measuring:f,modifiers:h,...m}=e;const g=s.useReducer(EW,void 0,kW),[v,b]=g,[y,w]=function(){const[e]=s.useState(()=>new Set),t=s.useCallback(t=>(e.add(t),()=>e.delete(t)),[e]),n=s.useCallback(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]);return[n,t]}(),[x,S]=s.useState(MW.Uninitialized),C=x===MW.Initialized,{draggable:{active:k,nodes:E,translate:R},droppable:{containers:P}}=v,M=null!=k?E.get(k):null,T=s.useRef({initial:null,translated:null}),I=s.useMemo(()=>{var e;return null!=k?{id:k,data:null!=(e=null==M?void 0:M.data)?e:vW,rect:T}:null},[k,M]),O=s.useRef(null),[D,F]=s.useState(null),[L,A]=s.useState(null),N=AH(m,Object.values(m)),$=BH("DndDescribedBy",i),z=s.useMemo(()=>P.getEnabled(),[P]),j=function(e){return s.useMemo(()=>({draggable:{...bW.draggable,...null==e?void 0:e.draggable},droppable:{...bW.droppable,...null==e?void 0:e.droppable},dragOverlay:{...bW.dragOverlay,...null==e?void 0:e.dragOverlay}}),[null==e?void 0:e.draggable,null==e?void 0:e.droppable,null==e?void 0:e.dragOverlay])}(f),{droppableRects:B,measureDroppableContainers:_,measuringScheduled:H}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=s.useState(null),{frequency:l,measure:c,strategy:u}=o,d=s.useRef(e),p=function(){switch(u){case oW.Always:return!1;case oW.BeforeDragging:return n;default:return!n}}(),f=AH(p),h=s.useCallback(function(e){void 0===e&&(e=[]),f.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=s.useRef(null),g=NH(t=>{if(p&&!n)return aW;if(!t||t===aW||d.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new NV(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,p,c]);return s.useEffect(()=>{d.current=e},[e]),s.useEffect(()=>{p||h()},[n,p]),s.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),s.useEffect(()=>{p||"number"!=typeof l||null!==m.current||(m.current=setTimeout(()=>{h(),m.current=null},l))},[l,p,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=i}}(z,{dragging:C,dependencies:[R.x,R.y],config:j.droppable}),V=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return NH(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(E,k),W=s.useMemo(()=>L?UH(L):null,[L]),U=function(){const e=!1===(null==D?void 0:D.autoScrollEnabled),t="object"==typeof l?!1===l.enabled:!1===l,n=C&&!e&&!t;if("object"==typeof l)return{...l,enabled:n};return{enabled:n}}(),G=function(e,t){return lW(e,t)}(V,j.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=s.useRef(!1),{x:a,y:l}="boolean"==typeof o?{x:o,y:o}:o;FH(()=>{if(!a&&!l||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=gV(n(e),r);if(a||(o.x=0),l||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=CV(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,l,r,n])}({activeNode:null!=k?E.get(k):null,config:U.layoutShiftCompensation,initialRect:G,measure:j.draggable.measure});const K=uW(V,j.draggable.measure,G),q=uW(V?V.parentElement:null),Y=s.useRef({activatorEvent:null,active:null,activeNode:V,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),X=P.getNodeFor(null==(t=Y.current.over)?void 0:t.id),Q=mW({measure:j.dragOverlay.measure}),Z=null!=(n=Q.nodeRef.current)?n:V,J=C?null!=(r=Q.rect)?r:K:null,ee=Boolean(Q.nodeRef.current&&Q.rect),te=gV(ne=ee?null:K,lW(ne));var ne;const re=fW(Z?MH(Z):null),oe=function(e){const t=s.useRef(e),n=NH(n=>e?n&&n!==dW&&e&&t.current&&e.parentNode===t.current.parentNode?n:SV(e):dW,[e]);return s.useEffect(()=>{t.current=e},[e]),n}(C?null!=X?X:V:null),ie=function(e,t){void 0===t&&(t=wV);const[n]=e,r=fW(n?MH(n):null),[o,i]=s.useState(hW);function a(){i(()=>e.length?e.map(e=>TV(e)?r:new NV(t(e),e)):hW)}const l=sW({callback:a});return FH(()=>{null==l||l.disconnect(),a(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),o}(oe),ae=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(h,{transform:{x:R.x-te.x,y:R.y-te.y,scaleX:1,scaleY:1},activatorEvent:L,active:I,activeNodeRect:K,containerNodeRect:q,draggingNodeRect:J,over:Y.current.over,overlayNodeRect:Q.rect,scrollableAncestors:oe,scrollableAncestorRects:ie,windowRect:re}),le=W?HH(W,R):null,se=function(e){const[t,n]=s.useState(null),r=s.useRef(e),o=s.useCallback(e=>{const t=kV(e.target);t&&n(e=>e?(e.set(t,PV(t)),new Map(e)):null)},[]);return s.useEffect(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=kV(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,PV(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=kV(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),s.useMemo(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>HH(e,t),aV):LV(e):aV,[e,t])}(oe),ce=pW(se),ue=pW(se,[K]),de=HH(ae,ce),pe=J?bV(J,ae):null,fe=I&&pe?p({active:I,collisionRect:pe,droppableRects:B,droppableContainers:z,pointerCoordinates:le}):null,he=dV(fe,"id"),[me,ge]=s.useState(null),ve=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ee?ae:HH(ae,ue),null!=(o=null==me?void 0:me.rect)?o:null,K),be=s.useRef(null),ye=s.useCallback((e,t)=>{let{sensor:n,options:r}=t;if(null==O.current)return;const o=E.get(O.current);if(!o)return;const i=e.nativeEvent,a=new n({active:O.current,activeNode:o,event:i,options:r,context:Y,onAbort(e){if(!E.get(e))return;const{onDragAbort:t}=N.current,n={id:e};null==t||t(n),y({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!E.get(e))return;const{onDragPending:o}=N.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),y({type:"onDragPending",event:i})},onStart(e){const t=O.current;if(null==t)return;const n=E.get(t);if(!n)return;const{onDragStart:r}=N.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:T}};So.unstable_batchedUpdates(()=>{null==r||r(o),S(MW.Initializing),b({type:nV.DragStart,initialCoordinates:e,active:t}),y({type:"onDragStart",event:o}),F(be.current),A(i)})},onMove(e){b({type:nV.DragMove,coordinates:e})},onEnd:l(nV.DragEnd),onCancel:l(nV.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Y.current;let a=null;if(t&&o){const{cancelDrop:l}=N.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===nV.DragEnd&&"function"==typeof l){await Promise.resolve(l(a))&&(e=nV.DragCancel)}}O.current=null,So.unstable_batchedUpdates(()=>{b({type:e}),S(MW.Uninitialized),ge(null),F(null),A(null),be.current=null;const t=e===nV.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=N.current[t];null==e||e(a),y({type:t,event:a})}})}}be.current=a},[E]),we=s.useCallback((e,t)=>(n,r)=>{const o=n.nativeEvent,i=E.get(r);if(null!==O.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},O.current=r,ye(n,t))},[E,ye]),xe=function(e,t){return s.useMemo(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(d,we);!function(e){s.useEffect(()=>{if(!EH)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(d),FH(()=>{K&&x===MW.Initializing&&S(MW.Initialized)},[K,x]),s.useEffect(()=>{const{onDragMove:e}=N.current,{active:t,activatorEvent:n,collisions:r,over:o}=Y.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:de.x,y:de.y},over:o};So.unstable_batchedUpdates(()=>{null==e||e(i),y({type:"onDragMove",event:i})})},[de.x,de.y]),s.useEffect(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Y.current;if(!e||null==O.current||!t||!o)return;const{onDragOver:i}=N.current,a=r.get(he),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};So.unstable_batchedUpdates(()=>{ge(l),null==i||i(s),y({type:"onDragOver",event:s})})},[he]),FH(()=>{Y.current={activatorEvent:L,active:I,activeNode:V,collisionRect:pe,collisions:fe,droppableRects:B,draggableNodes:E,draggingNode:Z,draggingNodeRect:J,droppableContainers:P,over:me,scrollableAncestors:oe,scrollAdjustedTranslate:de},T.current={initial:J,translated:pe}},[I,V,fe,pe,E,Z,J,B,P,me,oe,de]),nW({...U,delta:R,draggingRect:pe,pointerCoordinates:le,scrollableAncestors:oe,scrollableAncestorRects:ie});const Se=s.useMemo(()=>({active:I,activeNode:V,activeNodeRect:K,activatorEvent:L,collisions:fe,containerNodeRect:q,dragOverlay:Q,draggableNodes:E,droppableContainers:P,droppableRects:B,over:me,measureDroppableContainers:_,scrollableAncestors:oe,scrollableAncestorRects:ie,measuringConfiguration:j,measuringScheduled:H,windowRect:re}),[I,V,K,L,fe,q,Q,E,P,B,me,_,oe,ie,j,H,re]),Ce=s.useMemo(()=>({activatorEvent:L,activators:xe,active:I,activeNodeRect:K,ariaDescribedById:{draggable:$},dispatch:b,draggableNodes:E,over:me,measureDroppableContainers:_}),[L,xe,I,K,b,$,E,me,_]);return c.createElement(ZH.Provider,{value:w},c.createElement(SW.Provider,{value:Ce},c.createElement(CW.Provider,{value:Se},c.createElement(PW.Provider,{value:ve},u)),c.createElement(RW,{disabled:!1===(null==a?void 0:a.restoreFocus)})),c.createElement(tV,{...a,hiddenTextDescribedById:$}))}),IW=s.createContext(null),OW="button";function DW(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=BH("Draggable"),{activators:a,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:p,over:f}=s.useContext(SW),{role:h=OW,roleDescription:m="draggable",tabIndex:g=0}=null!=o?o:{},v=(null==c?void 0:c.id)===t,b=s.useContext(v?PW:IW),[y,w]=$H(),[x,S]=$H(),C=function(e,t){return s.useMemo(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),k=AH(n);FH(()=>(p.set(t,{id:t,key:i,node:y,activatorNode:x,data:k}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)}),[p,t]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:s.useMemo(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":!(!v||h!==OW)||void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[r,h,g,v,m,d.draggable]),isDragging:v,listeners:r?void 0:C,node:y,over:f,setNodeRef:w,setActivatorNodeRef:S,transform:b}}const FW={timeout:25};function LW(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function AW(e,t){return e.reduce((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e},Array(e.length))}function NW(e){return null!==e&&e>=0}const $W=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=LW(t,r,n),a=t[o],l=i[o];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},zW={scaleX:1,scaleY:1},jW=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const l=null!=(t=i[n])?t:r;if(!l)return null;if(o===n){const e=i[a];return e?{x:0,y:n<a?e.top+e.height-(l.top+l.height):e.top-l.top,...zW}:null}const s=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0;return i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(i,o,n);return o>n&&o<=a?{x:0,y:-l.height-s,...zW}:o<n&&o>=a?{x:0,y:l.height+s,...zW}:{x:0,y:0,...zW}};const BW="Sortable",_W=c.createContext({activeIndex:-1,containerId:BW,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:$W,disabled:{draggable:!1,droppable:!1}});function HW(e){let{children:t,id:n,items:r,strategy:o=$W,disabled:i=!1}=e;const{active:a,dragOverlay:l,droppableRects:u,over:d,measureDroppableContainers:p}=s.useContext(CW),f=BH(BW,n),h=Boolean(null!==l.rect),m=s.useMemo(()=>r.map(e=>"object"==typeof e&&"id"in e?e.id:e),[r]),g=null!=a,v=a?m.indexOf(a.id):-1,b=d?m.indexOf(d.id):-1,y=s.useRef(m),w=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(m,y.current),x=-1!==b&&-1===v||w,S=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(i);FH(()=>{w&&g&&p(m)},[w,m,g,p]),s.useEffect(()=>{y.current=m},[m]);const C=s.useMemo(()=>({activeIndex:v,containerId:f,disabled:S,disableTransforms:x,items:m,overIndex:b,useDragOverlay:h,sortedRects:AW(m,u),strategy:o}),[v,f,S.draggable,S.droppable,x,m,b,u,h,o]);return c.createElement(_W.Provider,{value:C},t)}const VW=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return LW(n,r,o).indexOf(t)},WW=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:l,previousContainerId:s,transition:c}=e;return!(!c||!r)&&((l===i||o!==a)&&(!!n||a!==o&&t===s))},UW={duration:200,easing:"ease"},GW="transform",KW=GH.Transition.toString({property:GW,duration:0,easing:"linear"}),qW={roleDescription:"sortable"};function YW(e){let{animateLayoutChanges:t=WW,attributes:n,disabled:r,data:o,getNewIndex:i=VW,id:a,strategy:l,resizeObserverConfig:c,transition:u=UW}=e;const{items:d,containerId:p,activeIndex:f,disabled:h,disableTransforms:m,sortedRects:g,overIndex:v,useDragOverlay:b,strategy:y}=s.useContext(_W),w=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,h),x=d.indexOf(a),S=s.useMemo(()=>({sortable:{containerId:p,index:x,items:d},...o}),[p,o,x,d]),C=s.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:k,node:E,isOver:R,setNodeRef:P}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=BH("Droppable"),{active:a,dispatch:l,over:c,measureDroppableContainers:u}=s.useContext(SW),d=s.useRef({disabled:n}),p=s.useRef(!1),f=s.useRef(null),h=s.useRef(null),{disabled:m,updateMeasurementsFor:g,timeout:v}={...FW,...o},b=AH(null!=g?g:r),y=sW({callback:s.useCallback(()=>{p.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),h.current=null},v)):p.current=!0},[v]),disabled:m||!a}),w=s.useCallback((e,t)=>{y&&(t&&(y.unobserve(t),p.current=!1),e&&y.observe(e))},[y]),[x,S]=$H(w),C=AH(t);return s.useEffect(()=>{y&&x.current&&(y.disconnect(),p.current=!1,y.observe(x.current))},[x,y]),s.useEffect(()=>(l({type:nV.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:f,data:C}}),()=>l({type:nV.UnregisterDroppable,key:i,id:r})),[r]),s.useEffect(()=>{n!==d.current.disabled&&(l({type:nV.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,l]),{active:a,rect:f,isOver:(null==c?void 0:c.id)===r,node:x,over:c,setNodeRef:S}}({id:a,data:S,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...c}}),{active:M,activatorEvent:T,activeNodeRect:I,attributes:O,setNodeRef:D,listeners:F,isDragging:L,over:A,setActivatorNodeRef:N,transform:$}=DW({id:a,data:S,attributes:{...qW,...n},disabled:w.draggable}),z=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.useMemo(()=>e=>{t.forEach(t=>t(e))},t)}(P,D),j=Boolean(M),B=j&&!m&&NW(f)&&NW(v),_=!b&&L,H=_&&B?$:null,V=B?null!=H?H:(null!=l?l:y)({rects:g,activeNodeRect:I,activeIndex:f,overIndex:v,index:x}):null,W=NW(f)&&NW(v)?i({id:a,items:d,activeIndex:f,overIndex:v}):x,U=null==M?void 0:M.id,G=s.useRef({activeId:U,items:d,newIndex:W,containerId:p}),K=d!==G.current.items,q=t({active:M,containerId:p,isDragging:L,isSorting:j,id:a,index:x,items:d,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:u,wasDragging:null!=G.current.activeId}),Y=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,a]=s.useState(null),l=s.useRef(n);return FH(()=>{if(!t&&n!==l.current&&r.current){const e=o.current;if(e){const t=wV(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&a(n)}}n!==l.current&&(l.current=n)},[t,n,r,o]),s.useEffect(()=>{i&&a(null)},[i]),i}({disabled:!q,index:x,node:E,rect:k});return s.useEffect(()=>{j&&G.current.newIndex!==W&&(G.current.newIndex=W),p!==G.current.containerId&&(G.current.containerId=p),d!==G.current.items&&(G.current.items=d)},[j,W,p,d]),s.useEffect(()=>{if(U===G.current.activeId)return;if(null!=U&&null==G.current.activeId)return void(G.current.activeId=U);const e=setTimeout(()=>{G.current.activeId=U},50);return()=>clearTimeout(e)},[U]),{active:M,activeIndex:f,attributes:O,data:S,rect:k,index:x,newIndex:W,items:d,isOver:R,isSorting:j,isDragging:L,listeners:F,node:E,overIndex:v,over:A,setNodeRef:z,setActivatorNodeRef:N,setDroppableNodeRef:P,setDraggableNodeRef:D,transform:null!=Y?Y:V,transition:function(){if(Y||K&&G.current.newIndex===x)return KW;if(_&&!WH(T)||!u)return;if(j||q)return GH.Transition.toString({...u,property:GW});return}()}}function XW(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const QW=[BV.Down,BV.Right,BV.Up,BV.Left],ZW=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(QW.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];i.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case BV.Down:r.top<i.top&&t.push(n);break;case BV.Up:r.top>i.top&&t.push(n);break;case BV.Left:r.left>i.left&&t.push(n);break;case BV.Right:r.left<i.left&&t.push(n)}});const s=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=uV(t),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=uV(r),a=o.reduce((e,t,r)=>e+lV(n[r],t),0),l=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:l}})}}return i.sort(sV)})({collisionRect:r,droppableRects:o,droppableContainers:t});let c=dV(s,"id");if(c===(null==a?void 0:a.id)&&s.length>1&&(c=s[1].id),null!=c){const e=i.get(n.id),t=i.get(c),a=t?o.get(t.id):null,s=null==t?void 0:t.node.current;if(s&&a&&e&&t){const n=SV(s).some((e,t)=>l[t]!==e),o=JW(e,t),i=function(e,t){if(!XW(e)||!XW(t))return!1;if(!JW(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),c=n||!o?{x:0,y:0}:{x:i?r.width-a.width:0,y:i?r.height-a.height:0},u={x:a.left,y:a.top};return c.x&&c.y?u:VH(u,c)}}}};function JW(e,t){return!(!XW(e)||!XW(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var eU=Sg(Xp.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})),tU=Sg(Xp.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),nU=Sg(Xp.jsx("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z"})),rU=Sg(Xp.jsx("path",{d:"M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z"})),oU=Sg(Xp.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),iU=Sg(Xp.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),aU=Sg(Xp.jsx("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"})),lU=Sg(Xp.jsx("path",{d:"M14 10H3v2h11zm0-4H3v2h11zm4 8v-4h-2v4h-4v2h4v4h2v-4h4v-2zM3 16h7v-2H3z"}));const sU=({id:e,label:t,fullLabel:n,onDelete:r,onMoveUp:o,onMoveDown:i,isFirst:a,isLast:l,sortOrder:u,onSortOrderChange:d,fullPath:p,defaultTitle:f,customTitle:h,onUpdateTitle:m,onResetTitle:g})=>{const[v,b]=s.useState(!1),[y,w]=s.useState(""),x=s.useRef(null),S=s.useRef(null),{attributes:C,listeners:k,setNodeRef:E,transform:R,transition:P,isDragging:M}=YW({id:e}),T={transform:GH.Transform.toString(R),transition:P,opacity:M?.5:1,display:"flex",alignItems:"center",width:"100%"};s.useEffect(()=>{v&&x.current&&(x.current.focus(),x.current.select())},[v]),s.useEffect(()=>{const e=e=>{v&&S.current&&!S.current.contains(e.target)&&O()};if(v)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[v]);const I=()=>{const e=y.trim();""!==e?(m(p,e),b(!1)):O()},O=()=>{b(!1),w("")},D=h||t,F=!!h;return c.createElement("div",Xr({ref:E,style:T},C),c.createElement(jw,{ref:S,sx:{display:"flex",alignItems:"center",width:"100%",gap:1}},c.createElement(jw,Xr({},k,{sx:{display:"flex",alignItems:"center",cursor:"grab","&:active":{cursor:"grabbing"}}}),c.createElement(eU,{sx:{cursor:"grab"}})),v?c.createElement(c.Fragment,null,c.createElement(qE,{inputRef:x,value:y,onChange:e=>w(e.target.value),onKeyDown:e=>{"Enter"===e.key?I():"Escape"===e.key&&O()},size:"small",sx:{width:"200px"}}),c.createElement(Hk,{title:"Save",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:I,color:"primary","aria-label":"save title"},c.createElement(oU,{fontSize:"small"}))),c.createElement(Hk,{title:"Cancel",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:O,"aria-label":"cancel edit"},c.createElement(iU,{fontSize:"small"}))),F&&c.createElement(Hk,{title:"Reset to default",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:()=>{g(p),b(!1),w("")},color:"warning","aria-label":"reset title"},c.createElement(aU,{fontSize:"small"})))):c.createElement(c.Fragment,null,c.createElement(Hk,{title:n,arrow:!0,placement:"top"},c.createElement(zy,{label:D,onDelete:r,color:"primary",variant:"outlined",sx:{fontWeight:F?"bold":"normal",fontStyle:F?"italic":"normal"}})),c.createElement(Hk,{title:"Edit title",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:()=>{w(h||f),b(!0)},"aria-label":"edit title"},c.createElement(mH,{fontSize:"small"})))),!v&&c.createElement(c.Fragment,null,c.createElement(Hk,{title:null===u?"No sort":"asc"===u?"Ascending":"Descending",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:()=>{d(null===u?"asc":"asc"===u?"desc":null)},"aria-label":"toggle sort order",color:u?"primary":"default"},"asc"===u?c.createElement(tU,{fontSize:"small"}):"desc"===u?c.createElement(nU,{fontSize:"small"}):c.createElement(rU,{fontSize:"small",sx:{opacity:.3}}))),c.createElement(jw,{sx:{flex:1}}),c.createElement(jw,{sx:{display:"flex",gap:.5}},c.createElement(Mv,{size:"small",onClick:o,disabled:a,"aria-label":"move up"},c.createElement(tU,{fontSize:"small"})),c.createElement(Mv,{size:"small",onClick:i,disabled:l,"aria-label":"move down"},c.createElement(nU,{fontSize:"small"}))))))},cU=({providersData:e,rootProvider:t,savedDimensions:n=[],onSaveDimension:r,onRemoveDimension:o,onReorderDimensions:i,titleOverrides:a={},onUpdateTitle:l,onResetTitle:u,existingMetrics:d=[],existingFilters:p={}})=>{const[f,h]=s.useState(!1),[m,g]=s.useState([]),[v,b]=s.useState(""),y=iV(oV(XV),oV(UV,{coordinateGetter:ZW})),w=()=>{const r=t?0===m.length?t:m[m.length-1].targetKey:null;if(!r||!e||!e[r])return[];const o=e[r];if(!o.dimensions)return[];const i=[e[t].default_alias];let a=t;m.forEach(t=>{const n=e[a];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&i.push(e.alias)}a=t.targetKey});const l=new Set(n.map(e=>e.fullPath)),s=[];return Object.keys(o.dimensions).forEach(e=>{const t=o.dimensions[e];Object.keys(t).forEach(n=>{const o=t[n],a=`${i.join("_")}.${n}`,c=l.has(a);s.push({key:`${r}_${e}.${n}`,value:o.title||n,dimensionKey:n,alias:e,dimension:o,disabled:c})})}),s},x=()=>{h(!1),g([]),b("")},S=e=>{const n=[t];return e.relationNames&&e.relationNames.length>0&&n.push(...e.relationNames),n.join(" → ")};return c.createElement("div",null,c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:2,marginBottom:2}},f?c.createElement(c.Fragment,null,c.createElement(Xw,{variant:"outlined",onClick:x},"Cancel"),c.createElement(Xw,{variant:"contained",onClick:()=>{if(!v)return;const n=w().find(e=>e.key===v);if(!n)return;const o=[],i=[t],a=[];let l=t;m.forEach(t=>{const n=e[l];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&(o.push(e),a.push(e.name))}i.push(t.targetKey),l=t.targetKey});const s=[e[t].default_alias];o.forEach(e=>{s.push(e.alias)});const c=`${s.join("_")}.${n.dimensionKey}`,u={dimension:n.dimension,relations:o,providerPath:i,relationNames:a,dimensionKey:n.dimensionKey,dimensionTitle:n.value,fullPath:c};r(u),x()},disabled:!v},"Save Dimension")):c.createElement(Xw,{variant:"contained",onClick:()=>{h(!0),g([]),b("")}},"Add Dimension")),f&&c.createElement(qg,{sx:{padding:3,marginBottom:3}},c.createElement(Gv,{variant:"h6",sx:{marginBottom:2}},"Select Provider Path"),c.createElement(kH,{providersData:e,rootProvider:t,onSelectionChange:g,existingDimensions:n,existingMetrics:d,existingFilters:p}),c.createElement(Gv,{variant:"h6",sx:{marginTop:3,marginBottom:2}},"Select Dimension"),c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:1}},c.createElement(uR,{items:w(),value:v,label:"Choose Dimension",onChange:e=>{b(e.target.value)},sx:{width:"400px"}}),c.createElement(Hk,{title:"Add all available dimensions",arrow:!0,placement:"top"},c.createElement("span",null,c.createElement(Mv,{color:"primary",onClick:()=>{const n=w().filter(e=>!e.disabled);if(0===n.length)return;const o=[],i=[t],a=[];let l=t;m.forEach(t=>{const n=e[l];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&(o.push(e),a.push(e.name))}i.push(t.targetKey),l=t.targetKey});const s=[e[t].default_alias];o.forEach(e=>{s.push(e.alias)}),n.forEach(e=>{const t=`${s.join("_")}.${e.dimensionKey}`,n={dimension:e.dimension,relations:o,providerPath:i,relationNames:a,dimensionKey:e.dimensionKey,dimensionTitle:e.value,fullPath:t};r(n)}),x()},disabled:0===w().filter(e=>!e.disabled).length,"aria-label":"add all dimensions"},c.createElement(lU,null)))))),n.length>0&&c.createElement(jw,{sx:{marginTop:3}},c.createElement(Gv,{variant:"h6",sx:{marginBottom:2}},"Saved Dimensions (Drag to reorder or use arrows)"),c.createElement(TW,{sensors:y,collisionDetection:fV,onDragEnd:e=>{const{active:t,over:r}=e;if(r&&t.id!==r.id){const e=n.findIndex((e,n)=>n===t.id),o=n.findIndex((e,t)=>t===r.id),a=LW(n,e,o);i(a)}}},c.createElement(HW,{items:n.map((e,t)=>t),strategy:jW},c.createElement(jw,{sx:{display:"flex",flexDirection:"column",gap:1}},n.map((e,t)=>c.createElement(sU,{key:t,id:t,label:e.dimensionTitle,fullLabel:`${S(e)} → ${e.dimensionTitle} (${e.fullPath})`,onDelete:()=>o(t),onMoveUp:()=>(e=>{if(e>0){const t=LW(n,e,e-1);i(t)}})(t),onMoveDown:()=>(e=>{if(e<n.length-1){const t=LW(n,e,e+1);i(t)}})(t),isFirst:0===t,isLast:t===n.length-1,sortOrder:e.sortOrder||null,onSortOrderChange:e=>((e,t)=>{const r=[...n];r[e]={...r[e],sortOrder:t},i(r)})(t,e),fullPath:e.fullPath,defaultTitle:e.dimensionTitle,customTitle:a[e.fullPath],onUpdateTitle:l,onResetTitle:u})))))))},uU=({id:e,label:t,fullLabel:n,onDelete:r,onMoveUp:o,onMoveDown:i,isFirst:a,isLast:l,fullPath:u,defaultTitle:d,customTitle:p,onUpdateTitle:f,onResetTitle:h})=>{const[m,g]=s.useState(!1),[v,b]=s.useState(""),y=s.useRef(null),w=s.useRef(null),{attributes:x,listeners:S,setNodeRef:C,transform:k,transition:E,isDragging:R}=YW({id:e}),P={transform:GH.Transform.toString(k),transition:E,opacity:R?.5:1,display:"flex",alignItems:"center",width:"100%"};s.useEffect(()=>{m&&y.current&&(y.current.focus(),y.current.select())},[m]),s.useEffect(()=>{const e=e=>{m&&w.current&&!w.current.contains(e.target)&&T()};if(m)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[m]);const M=()=>{const e=v.trim();""!==e?(f(u,e),g(!1)):T()},T=()=>{g(!1),b("")},I=p||t,O=!!p;return c.createElement("div",Xr({ref:C,style:P},x),c.createElement(jw,{ref:w,sx:{display:"flex",alignItems:"center",width:"100%",gap:1}},c.createElement(jw,Xr({},S,{sx:{display:"flex",alignItems:"center",cursor:"grab","&:active":{cursor:"grabbing"}}}),c.createElement(eU,{sx:{cursor:"grab"}})),m?c.createElement(c.Fragment,null,c.createElement(qE,{inputRef:y,value:v,onChange:e=>b(e.target.value),onKeyDown:e=>{"Enter"===e.key?M():"Escape"===e.key&&T()},size:"small",sx:{width:"200px"}}),c.createElement(Hk,{title:"Save",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:M,color:"primary","aria-label":"save title"},c.createElement(oU,{fontSize:"small"}))),c.createElement(Hk,{title:"Cancel",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:T,"aria-label":"cancel edit"},c.createElement(iU,{fontSize:"small"}))),O&&c.createElement(Hk,{title:"Reset to default",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:()=>{h(u),g(!1),b("")},color:"warning","aria-label":"reset title"},c.createElement(aU,{fontSize:"small"})))):c.createElement(c.Fragment,null,c.createElement(Hk,{title:n,arrow:!0,placement:"top"},c.createElement(zy,{label:I,onDelete:r,color:"secondary",variant:"outlined",sx:{fontWeight:O?"bold":"normal",fontStyle:O?"italic":"normal"}})),c.createElement(Hk,{title:"Edit title",arrow:!0,placement:"top"},c.createElement(Mv,{size:"small",onClick:()=>{b(p||d),g(!0)},"aria-label":"edit title"},c.createElement(mH,{fontSize:"small"})))),!m&&c.createElement(c.Fragment,null,c.createElement(jw,{sx:{flex:1}}),c.createElement(jw,{sx:{display:"flex",gap:.5}},c.createElement(Mv,{size:"small",onClick:o,disabled:a,"aria-label":"move up"},c.createElement(tU,{fontSize:"small"})),c.createElement(Mv,{size:"small",onClick:i,disabled:l,"aria-label":"move down"},c.createElement(nU,{fontSize:"small"}))))))},dU=({providersData:e,rootProvider:t,savedMetrics:n=[],onSaveMetric:r,onRemoveMetric:o,onReorderMetrics:i,titleOverrides:a={},onUpdateTitle:l,onResetTitle:u,existingDimensions:d=[],existingFilters:p={}})=>{const[f,h]=s.useState(!1),[m,g]=s.useState([]),[v,b]=s.useState(""),y=iV(oV(XV),oV(UV,{coordinateGetter:ZW})),w=()=>{const r=t?0===m.length?t:m[m.length-1].targetKey:null;if(!r||!e||!e[r])return[];const o=e[r];if(!o.metrics)return[];const i=[e[t].default_alias];let a=t;m.forEach(t=>{const n=e[a];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&i.push(e.alias)}a=t.targetKey});const l=new Set(n.map(e=>e.fullPath)),s=o.metrics.map((e,t)=>{const n=`${i.join("_")}.${e.name}`,o=l.has(n);return{key:`${r}_${e.name}_${t}`,value:e.title||e.name,metricName:e.name,metric:e,disabled:o}});return s},x=()=>{h(!1),g([]),b("")},S=e=>{const n=[t];return e.relationNames&&e.relationNames.length>0&&n.push(...e.relationNames),n.join(" → ")};return c.createElement("div",null,c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:2,marginBottom:2}},f?c.createElement(c.Fragment,null,c.createElement(Xw,{variant:"outlined",onClick:x},"Cancel"),c.createElement(Xw,{variant:"contained",onClick:()=>{if(!v)return;const n=w().find(e=>e.key===v);if(!n)return;const o=[],i=[t],a=[];let l=t;m.forEach(t=>{const n=e[l];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&(o.push(e),a.push(e.name))}i.push(t.targetKey),l=t.targetKey});const s=[e[t].default_alias];o.forEach(e=>{s.push(e.alias)});const c=`${s.join("_")}.${n.metricName}`,u={metric:n.metric,relations:o,providerPath:i,relationNames:a,metricName:n.metricName,metricTitle:n.value,fullPath:c};r(u),x()},disabled:!v},"Save Metric")):c.createElement(Xw,{variant:"contained",onClick:()=>{h(!0),g([]),b("")}},"Add Metric")),f&&c.createElement(qg,{sx:{padding:3,marginBottom:3}},c.createElement(Gv,{variant:"h6",sx:{marginBottom:2}},"Select Provider Path"),c.createElement(kH,{providersData:e,rootProvider:t,onSelectionChange:g,existingDimensions:d,existingMetrics:n,existingFilters:p}),c.createElement(Gv,{variant:"h6",sx:{marginTop:3,marginBottom:2}},"Select Metric"),c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:1}},c.createElement(uR,{items:w(),value:v,label:"Choose Metric",onChange:e=>{b(e.target.value)},sx:{width:"400px"}}),c.createElement(Hk,{title:"Add all available metrics",arrow:!0,placement:"top"},c.createElement("span",null,c.createElement(Mv,{color:"primary",onClick:()=>{const n=w().filter(e=>!e.disabled);if(0===n.length)return;const o=[],i=[t],a=[];let l=t;m.forEach(t=>{const n=e[l];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&(o.push(e),a.push(e.name))}i.push(t.targetKey),l=t.targetKey});const s=[e[t].default_alias];o.forEach(e=>{s.push(e.alias)}),n.forEach(e=>{const t=`${s.join("_")}.${e.metricName}`,n={metric:e.metric,relations:o,providerPath:i,relationNames:a,metricName:e.metricName,metricTitle:e.value,fullPath:t};r(n)}),x()},disabled:0===w().filter(e=>!e.disabled).length,"aria-label":"add all metrics"},c.createElement(lU,null)))))),n.length>0&&c.createElement(jw,{sx:{marginTop:3}},c.createElement(Gv,{variant:"h6",sx:{marginBottom:2}},"Saved Metrics (Drag to reorder or use arrows)"),c.createElement(TW,{sensors:y,collisionDetection:fV,onDragEnd:e=>{const{active:t,over:r}=e;if(r&&t.id!==r.id){const e=n.findIndex((e,n)=>n===t.id),o=n.findIndex((e,t)=>t===r.id),a=LW(n,e,o);i(a)}}},c.createElement(HW,{items:n.map((e,t)=>t),strategy:jW},c.createElement(jw,{sx:{display:"flex",flexDirection:"column",gap:1}},n.map((e,t)=>c.createElement(uU,{key:t,id:t,label:e.metricTitle,fullLabel:`${S(e)} → ${e.metricTitle} (${e.fullPath})`,onDelete:()=>o(t),onMoveUp:()=>(e=>{if(e>0){const t=LW(n,e,e-1);i(t)}})(t),onMoveDown:()=>(e=>{if(e<n.length-1){const t=LW(n,e,e+1);i(t)}})(t),isFirst:0===t,isLast:t===n.length-1,fullPath:e.fullPath,defaultTitle:e.metricTitle,customTitle:a[e.fullPath],onUpdateTitle:l,onResetTitle:u})))))))};var pU=Sg(Xp.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61"}));const fU=["localeText"],hU=s.createContext(null),mU=function(e){const{localeText:t}=e,n=d(e,fU),{adapter:r,localeText:o}=s.useContext(hU)??{adapter:void 0,localeText:void 0},i=cg({props:n,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:c,dateLibInstance:u,adapterLocale:p,localeText:h}=i,m=s.useMemo(()=>f({},h,o,t),[h,o,t]),g=s.useMemo(()=>{if(!l)return r||null;const e=new l({locale:p,formats:c,instance:u});if(!e.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/quickstart/#installation"].join("\n"));return e},[l,p,c,u,r]),v=s.useMemo(()=>g?{minDate:g.date("1900-01-01T00:00:00.000"),maxDate:g.date("2099-12-31T00:00:00.000")}:null,[g]),b=s.useMemo(()=>({utils:g,adapter:g,defaultDates:v,localeText:m}),[v,g,m]);return Xp.jsx(hU.Provider,{value:b,children:a})},gU=(e,t)=>e.length===t.length&&t.every(t=>e.includes(t)),vU=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},bU=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:o,isDateDisabled:i,adapter:a,timezone:l})=>{const s=vU(a,a.date(void 0,l),e);n&&a.isBefore(o,s)&&(o=s),t&&a.isAfter(r,s)&&(r=s);let c=e,u=e;for(a.isBefore(e,o)&&(c=o,u=null),a.isAfter(e,r)&&(u&&(u=r),c=null);c||u;){if(c&&a.isAfter(c,r)&&(c=null),u&&a.isBefore(u,o)&&(u=null),c){if(!i(c))return c;c=a.addDays(c,1)}if(u){if(!i(u))return u;u=a.addDays(u,-1)}}return null},yU=(e,t,n)=>null!=t&&e.isValid(t)?t:n,wU=(e,t)=>{const n=[e.startOfYear(t)];for(;n.length<12;){const t=n[n.length-1];n.push(e.addMonths(t,1))}return n},xU=(e,t,n)=>"date"===n?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),SU=["year","month","day"],CU=e=>SU.includes(e),kU=(e,{format:t,views:n},r)=>{if(null!=t)return t;const o=e.formats;return gU(n,["year"])?o.year:gU(n,["month"])?o.month:gU(n,["day"])?o.dayOfMonth:gU(n,["month","year"])?`${o.month} ${o.year}`:gU(n,["day","month"])?`${o.month} ${o.dayOfMonth}`:r?/en/.test(e.getCurrentLocaleCode())?o.normalDateWithWeekday:o.normalDate:o.keyboardDate},EU=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(t=>e.addDays(n,t))},RU=["hours","minutes","seconds"],PU=(e,t)=>3600*t.getHours(e)+60*t.getMinutes(e)+t.getSeconds(e),MU={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},TU=(e,t,n)=>{if(t===MU.year)return e.startOfYear(n);if(t===MU.month)return e.startOfMonth(n);if(t===MU.day)return e.startOfDay(n);let r=n;return t<MU.minutes&&(r=e.setMinutes(r,0)),t<MU.seconds&&(r=e.setSeconds(r,0)),t<MU.milliseconds&&(r=e.setMilliseconds(r,0)),r},IU=({props:e,adapter:t,granularity:n,timezone:r,getTodayDate:o})=>{let i=o?o():TU(t,n,xU(t,r));null!=e.minDate&&t.isAfterDay(e.minDate,i)&&(i=TU(t,n,e.minDate)),null!=e.maxDate&&t.isBeforeDay(e.maxDate,i)&&(i=TU(t,n,e.maxDate));const a=((e,t)=>(n,r)=>e?t.isAfter(n,r):PU(n,t)>PU(r,t))(e.disableIgnoringDatePartForTimeValidation??!1,t);return null!=e.minTime&&a(e.minTime,i)&&(i=TU(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:vU(t,i,e.minTime))),null!=e.maxTime&&a(i,e.maxTime)&&(i=TU(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:vU(t,i,e.maxTime))),i},OU=(e,t)=>{const n=e.formatTokenMap[t];if(null==n)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join("\n"));return"string"==typeof n?{type:n,contentType:"meridiem"===n?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},DU=(e,t)=>{const n=[],r=e.date(void 0,"default"),o=e.startOfWeek(r),i=e.endOfWeek(r);let a=o;for(;e.isBefore(a,i);)n.push(a),a=e.addDays(a,1);return n.map(n=>e.formatByString(n,t))},FU=(e,t,n,r)=>{switch(n){case"month":return wU(e,e.date(void 0,t)).map(t=>e.formatByString(t,r));case"weekDay":return DU(e,r);case"meridiem":{const n=e.date(void 0,t);return[e.startOfDay(n),e.endOfDay(n)].map(t=>e.formatByString(t,r))}default:return[]}},LU=["0","1","2","3","4","5","6","7","8","9"],AU=(e,t)=>{if("0"===t[0])return e;const n=[];let r="";for(let o=0;o<e.length;o+=1){r+=e[o];const i=t.indexOf(r);i>-1&&(n.push(i.toString()),r="")}return n.join("")},NU=(e,t)=>"0"===t[0]?e:e.split("").map(e=>t[Number(e)]).join(""),$U=(e,t)=>{const n=AU(e,t);return" "!==n&&!Number.isNaN(Number(n))},zU=(e,t)=>Number(e).toString().padStart(t,"0"),jU=(e,t,n,r,o)=>{if("day"===o.type&&"digit-with-letter"===o.contentType){const r=e.setDate(n.longestMonth,t);return e.formatByString(r,o.format)}let i=t.toString();return o.hasLeadingZerosInInput&&(i=zU(i,o.maxLength)),NU(i,r)},BU=(e,t,n)=>{let r=e.value||e.placeholder;const o="non-input"===t?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;"non-input"===t&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number(AU(r,n)).toString());return["input-rtl","input-ltr"].includes(t)&&"digit"===e.contentType&&!o&&1===r.length&&(r=`${r}‎`),"input-rtl"===t&&(r=`⁨${r}⁩`),r},_U=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),HU=(e,t)=>4===e.formatByString(e.date(void 0,"system"),t).length,VU=(e,t,n,r)=>{if("digit"!==t)return!1;const o=e.date(void 0,"default");switch(n){case"year":return"dayjs"===e.lib&&"YY"===r||e.formatByString(e.setYear(o,1),r).startsWith("0");case"month":return e.formatByString(e.startOfYear(o),r).length>1;case"day":return e.formatByString(e.startOfMonth(o),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(o),r).length>1;case"hours":return e.formatByString(e.setHours(o,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(o,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(o,1),r).length>1;default:throw new Error("Invalid section type")}},WU={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},UU=(e,t,n,r,o)=>[...n].sort((e,t)=>WU[e.type]-WU[t.type]).reduce((n,r)=>!o||r.modified?((e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{let r=e.formatByString(n,t.format);t.hasLeadingZerosInInput&&(r=zU(r,t.maxLength));const o=DU(e,t.format),i=o.indexOf(r),a=o.indexOf(t.value)-i;return e.addDays(n,a)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{const t=e.getHours(n)<12,o=e.getHours(r);return t&&o>=12?e.addHours(r,-12):!t&&o<12?e.addHours(r,12):r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}})(e,r,t,n):n,r),GU=(e,t)=>{if(null==e)return null;if("all"===e)return"all";if("string"==typeof e){const n=t.findIndex(t=>t.type===e);return-1===n?null:n}return e},KU=["value","referenceDate"],qU={emptyValue:null,getTodayValue:xU,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=d(e,KU);return r.adapter.isValid(t)?t:null!=n?n:IU(r)},cleanValue:(e,t)=>e.isValid(t)?t:null,areValuesEqual:(e,t,n)=>!e.isValid(t)&&null!=t&&!e.isValid(n)&&null!=n||e.isEqual(t,n),isSameError:(e,t)=>e===t,hasError:e=>null!=e,defaultErrorState:null,getTimezone:(e,t)=>e.isValid(t)?e.getTimezone(t):null,setTimezone:(e,t,n)=>null==n?null:e.setTimezone(n,t)},YU={updateReferenceValue:(e,t,n)=>e.isValid(t)?t:n,getSectionsFromValue:(e,t)=>t(e),getV7HiddenInputValueFromSections:e=>e.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),getV6InputValueFromSections:(e,t,n)=>{const r=e.map(e=>{const r=BU(e,n?"input-rtl":"input-ltr",t);return`${e.startSeparator}${r}${e.endSeparator}`}).join("");return n?`⁦${r}⁩`:r},parseValueStr:(e,t,n)=>n(e.trim(),t),getDateFromSection:e=>e,getDateSectionsFromValue:e=>e,updateDateInValue:(e,t,n)=>n,clearDateSections:e=>e.map(e=>f({},e,{value:""}))};function XU(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=XU(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function QU(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=XU(e))&&(r&&(r+=" "),r+=t);return r}function ZU(e){return Ph("MuiPickersToolbar",e)}Mh("MuiPickersToolbar",["root","title","content"]);const JU=s.createContext(()=>!0);const eG=s.createContext(null);function tG(){return s.useContext(eG)}const nG=s.createContext(null),rG=()=>{const e=s.useContext(nG);if(null==e)throw new Error("MUI X: The `usePickerContext` hook can only be called inside the context of a Picker component");return e},oG=s.createContext(null),iG=s.createContext({ownerState:{isPickerDisabled:!1,isPickerReadOnly:!1,isPickerValueEmpty:!1,isPickerOpen:!1,pickerVariant:"desktop",pickerOrientation:"portrait"},rootRefObject:{current:null},labelId:void 0,dismissViews:()=>{},hasUIView:!0,getCurrentViewMode:()=>"UI",triggerElement:null,viewContainerRole:null,defaultActionBarActions:[],onPopperExited:void 0});function aG(e){const{contextValue:t,actionsContextValue:n,privateContextValue:r,fieldPrivateContextValue:o,isValidContextValue:i,localeText:a,children:l}=e;return Xp.jsx(nG.Provider,{value:t,children:Xp.jsx(oG.Provider,{value:n,children:Xp.jsx(iG.Provider,{value:r,children:Xp.jsx(eG.Provider,{value:o,children:Xp.jsx(JU.Provider,{value:i,children:Xp.jsx(mU,{localeText:a,children:l})})})})})})}const lG=()=>s.useContext(iG);function sG(){const{ownerState:e}=lG(),t=um();return s.useMemo(()=>f({},e,{toolbarDirection:t?"rtl":"ltr"}),[e,t])}const cG=["children","className","classes","toolbarTitle","hidden","titleId","classes","landscapeDirection"],uG=pg("div",{name:"MuiPickersToolbar",slot:"Root"})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{pickerOrientation:"landscape"},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),dG=pg("div",{name:"MuiPickersToolbar",slot:"Content",shouldForwardProp:e=>Oh(e)&&"landscapeDirection"!==e})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{pickerOrientation:"landscape"},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{pickerOrientation:"landscape",landscapeDirection:"row"},style:{flexDirection:"row"}}]}),pG=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersToolbar"}),{children:r,className:o,classes:i,toolbarTitle:a,hidden:l,titleId:s,landscapeDirection:c}=n,u=d(n,cG),p=sG(),h=(e=>wm({root:["root"],title:["title"],content:["content"]},ZU,e))(i);return l?null:Xp.jsxs(uG,f({ref:t,className:QU(h.root,o),ownerState:p},u,{children:[Xp.jsx(Gv,{color:"text.secondary",variant:"overline",id:s,className:h.title,children:a}),Xp.jsx(dG,{className:h.content,ownerState:p,landscapeDirection:c,children:r})]}))}),fG={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>"year"===e?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",nextStepButtonLabel:"Next",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",timeRangePickerToolbarTitle:"Select time range",clockLabelText:(e,t)=>`Select ${e}. ${t?`Selected time is ${t}`:"No time selected"}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:e=>e?`Choose date, selected date is ${e}`:"Choose date",openTimePickerDialogue:e=>e?`Choose time, selected time is ${e}`:"Choose time",openRangePickerDialogue:e=>e?`Choose range, selected range is ${e}`:"Choose range",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>"letter"===e.contentType?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>"letter"===e.contentType?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},hG=fG;f({},fG);const mG=()=>{const e=s.useContext(hU);if(null===e)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join("\n"));if(null===e.adapter)throw new Error(["MUI X: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join("\n"));const t=s.useMemo(()=>f({},hG,e.localeText),[e.localeText]);return s.useMemo(()=>f({},e,{localeText:t}),[e,t])},gG=()=>mG().adapter,vG=()=>mG().localeText,bG=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],yG=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],wG=["minDateTime","maxDateTime"],xG=[...bG,...yG,...wG],SG=e=>xG.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{}),CG=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","unstableStartFieldRef","unstableEndFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator","autoFocus","focused"],kG=(e,t)=>s.useMemo(()=>{const n=f({},e),r={},o=e=>{n.hasOwnProperty(e)&&(r[e]=n[e],delete n[e])};return CG.forEach(o),"date"===t?bG.forEach(o):"time"===t?yG.forEach(o):"date-time"===t&&(bG.forEach(o),yG.forEach(o),wG.forEach(o)),{forwardedProps:n,internalProps:r}},[e,t]),EG=(e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}},RG=({adapter:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:o,now:i,token:a,startSeparator:l})=>{if(""===a)throw new Error("MUI X: Should not call `commitToken` with an empty token");const s=OU(e,a),c=VU(e,s.contentType,s.type,a),u=n?c:"digit"===s.contentType,d=e.isValid(t);let p=d?e.formatByString(t,a):"",h=null;if(u)if(c)h=""===p?e.formatByString(i,a).length:p.length;else{if(null==s.maxLength)throw new Error(`MUI X: The token ${a} should have a 'maxLength' property on it's adapter`);h=s.maxLength,d&&(p=NU(zU(AU(p,o),h),o))}return f({},s,{format:a,maxLength:h,value:p,placeholder:EG(e,r,s,a),hasLeadingZerosInFormat:c,hasLeadingZerosInInput:u,startSeparator:l,endSeparator:"",modified:!1})},PG=e=>{let t=(({adapter:e,format:t})=>{let n=10,r=t,o=e.expandFormat(t);for(;o!==r;)if(r=o,o=e.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the component.");return o})(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));const n=(({adapter:e,expandedFormat:t})=>{const n=[],{start:r,end:o}=e.escapedCharacters,i=new RegExp(`(\\${r}[^\\${o}]*\\${o})+`,"g");let a=null;for(;a=i.exec(t);)n.push({start:a.index,end:i.lastIndex-1});return n})(f({},e,{expandedFormat:t})),r=(e=>{const{adapter:t,expandedFormat:n,escapedParts:r}=e,o=t.date(void 0),i=[];let a="";const l=Object.keys(t.formatTokenMap).sort((e,t)=>t.length-e.length),s=/^([a-zA-Z]+)/,c=new RegExp(`^(${l.join("|")})*$`),u=new RegExp(`^(${l.join("|")})`),d=e=>r.find(t=>t.start<=e&&t.end>=e);let p=0;for(;p<n.length;){const t=d(p),r=null!=t,l=s.exec(n.slice(p))?.[1];if(!r&&null!=l&&c.test(l)){let t=l;for(;t.length>0;){const n=u.exec(t)[1];t=t.slice(n.length),i.push(RG(f({},e,{now:o,token:n,startSeparator:a}))),a=""}p+=l.length}else{const e=n[p];r&&t?.start===p||t?.end===p||(0===i.length?a+=e:(i[i.length-1].endSeparator+=e,i[i.length-1].isEndFormatSeparator=!0)),p+=1}}return 0===i.length&&a.length>0&&i.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:a,endSeparator:"",modified:!1}),i})(f({},e,{expandedFormat:t,escapedParts:n}));return(({isRtl:e,formatDensity:t,sections:n})=>n.map(n=>{const r=n=>{let r=n;return e&&null!==r&&r.includes(" ")&&(r=`⁩${r}⁦`),"spacious"===t&&["/",".","-"].includes(r)&&(r=` ${r} `),r};return n.startSeparator=r(n.startSeparator),n.endSeparator=r(n.endSeparator),n}))(f({},e,{sections:r}))},MG=()=>s.useContext(nG);function TG(e){return Ph("MuiDatePickerToolbar",e)}Mh("MuiDatePickerToolbar",["root","title"]);const IG=["toolbarFormat","toolbarPlaceholder","className","classes"],OG=pg(pG,{name:"MuiDatePickerToolbar",slot:"Root"})({}),DG=pg(Gv,{name:"MuiDatePickerToolbar",slot:"Title"})({variants:[{props:{pickerOrientation:"landscape"},style:{margin:"auto 16px auto auto"}}]}),FG=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiDatePickerToolbar"}),{toolbarFormat:r,toolbarPlaceholder:o="––",className:i,classes:a}=n,l=d(n,IG),c=gG(),{value:u,views:p,orientation:h}=rG(),m=vG(),g=sG(),v=(e=>wm({root:["root"],title:["title"]},TG,e))(a),b=s.useMemo(()=>{if(!c.isValid(u))return o;const e=kU(c,{format:r,views:p},!0);return c.formatByString(u,e)},[u,r,o,c,p]);return Xp.jsx(OG,f({ref:t,toolbarTitle:m.datePickerToolbarTitle,className:QU(v.root,i)},l,{children:Xp.jsx(DG,{variant:"h4",align:"landscape"===h?"left":"center",ownerState:g,className:v.title,children:b})}))}),LG=({props:e,value:t,timezone:n,adapter:r})=>{if(null===t)return null;const{shouldDisableDate:o,shouldDisableMonth:i,shouldDisableYear:a,disablePast:l,disableFuture:s,minDate:c,maxDate:u}=e,d=r.date(void 0,n);switch(!0){case!r.isValid(t):return"invalidDate";case Boolean(o&&o(t)):return"shouldDisableDate";case Boolean(i&&i(t)):return"shouldDisableMonth";case Boolean(a&&a(t)):return"shouldDisableYear";case Boolean(s&&r.isAfterDay(t,d)):return"disableFuture";case Boolean(l&&r.isBeforeDay(t,d)):return"disablePast";case Boolean(c&&r.isBeforeDay(t,c)):return"minDate";case Boolean(u&&r.isAfterDay(t,u)):return"maxDate";default:return null}};function AG(e){const{props:t,validator:n,value:r,timezone:o,onError:i}=e,a=gG(),l=s.useRef(n.valueManager.defaultErrorState),c=n({adapter:a,value:r,timezone:o,props:t}),u=n.valueManager.hasError(c);s.useEffect(()=>{i&&!n.valueManager.isSameError(c,l.current)&&i(c,r),l.current=c},[n,i,c,r]);const d=Mg(e=>n({adapter:a,value:e,timezone:o,props:t}));return{validationError:c,hasValidationError:u,getValidationErrorForNewValue:d}}LG.valueManager=qU;const NG=e=>{const t=gG(),n=s.useRef(void 0);return void 0===n.current&&(n.current=t.date(void 0,e)),n.current};function $G(e){const t=gG(),n=vG();return s.useMemo(()=>{const r=t.isValid(e)?t.format(e,"fullDate"):null;return n.openDatePickerDialogue(r)},[e,n,t])}function zG(e){const t=gG(),n=jG(e);return s.useMemo(()=>f({},e,n,{format:e.format??t.formats.keyboardDate}),[e,n,t])}function jG(e){const t=gG(),n=mG().defaultDates;return s.useMemo(()=>({disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,minDate:yU(t,e.minDate,n.minDate),maxDate:yU(t,e.maxDate,n.maxDate)}),[e.minDate,e.maxDate,e.disableFuture,e.disablePast,t,n])}function BG(e,t){const n=cg({props:e,name:t}),r=jG(n),o=s.useMemo(()=>null==n.localeText?.toolbarTitle?n.localeText:f({},n.localeText,{datePickerToolbarTitle:n.localeText.toolbarTitle}),[n.localeText]);return f({},n,r,{localeText:o},(({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const o=n??r;let i;if(null!=e)i=e;else if(o.includes(t))i=t;else{if(!(o.length>0))throw new Error("MUI X: The `views` prop must contain at least one view.");i=o[0]}return{views:o,openTo:i}})({views:n.views,openTo:n.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{slots:f({toolbar:FG},n.slots)})}function _G(e){return Ph("MuiPickerPopper",e)}Mh("MuiPickerPopper",["root","paper"]);const HG=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?HG(t.shadowRoot):t:null},VG=e=>HG(kg(e)),WG="@media (pointer: fine)",UG=["PaperComponent","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],GG=pg(My,{name:"MuiPickerPopper",slot:"Root"})(({theme:e})=>({zIndex:e.zIndex.modal})),KG=pg(qg,{name:"MuiPickerPopper",slot:"Paper"})({outline:0,transformOrigin:"top center",variants:[{props:({popperPlacement:e})=>new Set(["top","top-start","top-end"]).has(e),style:{transformOrigin:"bottom center"}}]});const qG=s.forwardRef((e,t)=>{const{PaperComponent:n,ownerState:r,children:o,paperSlotProps:i,paperClasses:a,onPaperClick:l,onPaperTouchStart:s}=e,c=d(e,UG),u=yy({elementType:n,externalSlotProps:i,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:a,ownerState:r});return Xp.jsx(n,f({},c,u,{onClick:e=>{l(e),u.onClick?.(e)},onTouchStart:e=>{s(e),u.onTouchStart?.(e)},ownerState:r,children:o}))});function YG(e){const t=cg({props:e,name:"MuiPickerPopper"}),{children:n,placement:r="bottom-start",slots:o,slotProps:i,classes:a}=t,{open:l,popupRef:c,reduceAnimations:u}=rG(),{ownerState:d,rootRefObject:p}=lG(),{dismissViews:h,getCurrentViewMode:m,onPopperExited:g,triggerElement:v,viewContainerRole:b}=lG();s.useEffect(()=>{function e(e){l&&"Escape"===e.key&&h()}return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[h,l]);const y=s.useRef(null);s.useEffect(()=>{"tooltip"!==b&&"field"!==m()&&(l?y.current=VG(p.current):y.current&&y.current instanceof HTMLElement&&setTimeout(()=>{y.current instanceof HTMLElement&&y.current.focus()}))},[l,b,m,p]);const w=(e=>wm({root:["root"],paper:["paper"]},_G,e))(a),x=Mg(()=>{"tooltip"===b?setTimeout(()=>{p.current?.contains(VG(p.current))||c.current?.contains(VG(c.current))||h()},0):h()}),[S,C,k]=function(e,t){const n=s.useRef(!1),r=s.useRef(!1),o=s.useRef(null),i=s.useRef(!1);s.useEffect(()=>{if(e)return document.addEventListener("mousedown",t,!0),document.addEventListener("touchstart",t,!0),()=>{document.removeEventListener("mousedown",t,!0),document.removeEventListener("touchstart",t,!0),i.current=!1};function t(){i.current=!0}},[e]);const a=Mg(e=>{if(!i.current)return;const a=r.current;r.current=!1;const l=kg(o.current);if(!o.current||"clientX"in e&&function(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}(e,l))return;if(n.current)return void(n.current=!1);let s;s=e.composedPath?e.composedPath().indexOf(o.current)>-1:!l.documentElement.contains(e.target)||o.current.contains(e.target),s||a||t(e)}),l=e=>{e.defaultMuiPrevented||(r.current=!0)};return s.useEffect(()=>{if(e){const e=kg(o.current),t=()=>{n.current=!0};return e.addEventListener("touchstart",a),e.addEventListener("touchmove",t),()=>{e.removeEventListener("touchstart",a),e.removeEventListener("touchmove",t)}}},[e,a]),s.useEffect(()=>{if(e){const e=kg(o.current);return e.addEventListener("click",a),()=>{e.removeEventListener("click",a),r.current=!1}}},[e,a]),[o,l,l]}(l,x),E=Tg(s.useRef(null),c),R=Tg(E,S),P=o?.desktopTransition??u?Pw:PS,M=o?.desktopTrapFocus??Cx,T=o?.desktopPaper??KG,I=o?.popper??GG,O=yy({elementType:I,externalSlotProps:i?.popper,additionalProps:{transition:!0,role:null==b?void 0:b,open:l,placement:r,anchorEl:v,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),h())}},className:w.root,ownerState:d}),D=s.useMemo(()=>f({},d,{popperPlacement:O.placement}),[d,O.placement]);return Xp.jsx(I,f({},O,{children:({TransitionProps:e})=>Xp.jsx(M,f({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:"tooltip"===b,isEnabled:()=>!0},i?.desktopTrapFocus,{children:Xp.jsx(P,f({},e,i?.desktopTransition,{onExited:t=>{g?.(),i?.desktopTransition?.onExited?.(t),e?.onExited?.()},children:Xp.jsx(qG,{PaperComponent:T,ownerState:D,ref:R,onPaperClick:C,onPaperTouchStart:k,paperClasses:w.paper,paperSlotProps:i?.desktopPaper,children:n})}))}))}))}const XG="undefined"!=typeof navigator&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),QG=XG&&XG[1]?parseInt(XG[1],10):null,ZG=XG&&XG[2]?parseInt(XG[2],10):null,JG=QG&&QG<10||ZG&&ZG<13||!1;function eK(e){const t=nR("@media (prefers-reduced-motion: reduce)",{defaultMatches:!1});return null!=e?e:t||JG}const tK={hasNextStep:!1,hasSeveralSteps:!1,goToNextStep:()=>{},areViewsInSameStep:()=>!0};function nK({onChange:e,onViewChange:t,openTo:n,view:r,views:o,autoFocus:i,focusedView:a,onFocusedViewChange:l,getStepNavigation:c}){const u=s.useRef(n),d=s.useRef(o),p=s.useRef(o.includes(n)?n:o[0]),[h,m]=Pg({name:"useViews",state:"view",controlled:r,default:p.current}),g=s.useRef(i?h:null),[v,b]=Pg({name:"useViews",state:"focusedView",controlled:a,default:g.current}),y=c?c({setView:m,view:h,defaultView:p.current,views:o}):tK;s.useEffect(()=>{(u.current&&u.current!==n||d.current&&d.current.some(e=>!o.includes(e)))&&(m(o.includes(n)?n:o[0]),d.current=o,u.current=n)},[n,m,h,o]);const w=o.indexOf(h),x=o[w-1]??null,S=o[w+1]??null,C=Mg((e,t)=>{b(t?e:t=>e===t?null:t),l?.(e,t)}),k=Mg(e=>{C(e,!0),e!==h&&(m(e),t&&t(e))}),E=Mg(()=>{S&&k(S)}),R=Mg((t,n,r)=>{const i="finish"===n,a=r?o.indexOf(r)<o.length-1:Boolean(S);e(t,i&&a?"partial":n,r);let l=null;if(null!=r&&r!==h?l=r:i&&(l=h),null==l)return;const s=o[o.indexOf(l)+1];null!=s&&y.areViewsInSameStep(l,s)&&k(s)});return f({},y,{view:h,setView:k,focusedView:v,setFocusedView:C,nextView:S,previousView:x,defaultView:o.includes(n)?n:o[0],goToNextView:E,setValueAndGoToNextView:R})}function rK(){return"undefined"==typeof window?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?90===Math.abs(window.screen.orientation.angle)?"landscape":"portrait":window.orientation&&90===Math.abs(Number(window.orientation))?"landscape":"portrait"}function oK(e,t){const[n,r]=s.useState(rK);return Wh(()=>{const e=()=>{r(rK())};return window.addEventListener("orientationchange",e),()=>{window.removeEventListener("orientationchange",e)}},[]),o=e,i=["hours","minutes","seconds"],(Array.isArray(i)?i.every(e=>-1!==o.indexOf(e)):-1!==o.indexOf(i))?"portrait":t??n;var o,i}const iK=({name:e,timezone:t,value:n,defaultValue:r,referenceDate:o,onChange:i,valueManager:a})=>{const l=gG(),[c,u]=Pg({name:e,state:"value",controlled:n,default:r??a.emptyValue}),d=s.useMemo(()=>a.getTimezone(l,c),[l,a,c]),p=Mg(e=>null==d?e:a.setTimezone(l,d,e)),f=s.useMemo(()=>t||(d||(o?l.getTimezone(Array.isArray(o)?o[0]:o):"default")),[t,d,o,l]);return{value:s.useMemo(()=>a.setTimezone(l,f,c),[a,l,f,c]),handleValueChange:Mg((e,...t)=>{const n=p(e);u(n),i?.(n,...t)}),timezone:f}};const aK=["className","sx"],lK=({ref:e,props:t,valueManager:n,valueType:r,variant:o,validator:i,onPopperExited:a,autoFocusView:l,rendererInterceptor:c,localeText:u,viewContainerRole:p,getStepNavigation:h})=>{const{views:m,view:g,openTo:v,onViewChange:b,viewRenderers:y,reduceAnimations:w,orientation:x,disableOpenPicker:S,closeOnSelect:C,disabled:k,readOnly:E,formatDensity:R,enableAccessibleFieldDOMStructure:P,selectedSections:M,onSelectedSectionsChange:T,format:I,label:O,autoFocus:D,name:F}=t,{className:L,sx:A}=t,N=d(t,aK),$=mm(),z=gG(),j=eK(w),B=oK(m,x),{current:_}=s.useRef(v??null),[H,V]=s.useState(null),W=s.useRef(null),U=s.useRef(null),G=s.useRef(null),K=Tg(e,G),{timezone:q,state:Y,setOpen:X,setValue:Q,setValueFromView:Z,value:J,viewValue:ee}=function(e){const{props:t,valueManager:n,validator:r}=e,{value:o,defaultValue:i,onChange:a,referenceDate:l,timezone:c,onAccept:u,closeOnSelect:d,open:p,onOpen:h,onClose:m}=t,{current:g}=s.useRef(i),{current:v}=s.useRef(void 0!==o),{current:b}=s.useRef(void 0!==p),y=gG(),{timezone:w,value:x,handleValueChange:S}=iK({name:"a picker component",timezone:c,value:o,defaultValue:g,referenceDate:l,onChange:a,valueManager:n}),[C,k]=s.useState(()=>({open:!1,lastExternalValue:x,clockShallowValue:void 0,lastCommittedValue:x,hasBeenModifiedSinceMount:!1})),{getValidationErrorForNewValue:E}=AG({props:t,validator:r,timezone:w,value:x,onError:t.onError}),R=Mg(e=>{const t="function"==typeof e?e(C.open):e;b||k(e=>f({},e,{open:t})),t&&h&&h(),t||m?.()}),P=Mg((e,t)=>{const{changeImportance:r="accept",skipPublicationIfPristine:o=!1,validationError:i,shortcut:a,source:l,shouldClose:s="accept"===r}=t??{};let c,d;o||v||C.hasBeenModifiedSinceMount?(c=!n.areValuesEqual(y,e,x),d="accept"===r&&!n.areValuesEqual(y,e,C.lastCommittedValue)):(c=!0,d="accept"===r),k(t=>f({},t,{clockShallowValue:c?void 0:t.clockShallowValue,lastCommittedValue:d?e:t.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let p=null;const h=()=>{if(!p){let t;t=l||(a?"view":"unknown"),p={validationError:null==i?E(e):i,source:t},a&&(p.shortcut=a)}return p};c&&S(e,h()),d&&u&&u(e,h()),s&&R(!1)});x!==C.lastExternalValue&&k(e=>f({},e,{lastExternalValue:x,clockShallowValue:void 0,hasBeenModifiedSinceMount:!0}));const M=Mg((e,t="partial")=>{"shallow"!==t?P(e,{changeImportance:"finish"===t&&d?"accept":"set",source:"view"}):k(t=>f({},t,{clockShallowValue:e,hasBeenModifiedSinceMount:!0}))});s.useEffect(()=>{if(b){if(void 0===p)throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");k(e=>f({},e,{open:p}))}},[b,p]);const T=s.useMemo(()=>n.cleanValue(y,void 0===C.clockShallowValue?x:C.clockShallowValue),[y,n,C.clockShallowValue,x]);return{timezone:w,state:C,setValue:P,setValueFromView:M,setOpen:R,value:x,viewValue:T}}({props:t,valueManager:n,validator:i}),{view:te,setView:ne,defaultView:re,focusedView:oe,setFocusedView:ie,setValueAndGoToNextView:ae,goToNextStep:le,hasNextStep:se,hasSeveralSteps:ce}=nK({view:g,views:m,openTo:v,onChange:Z,onViewChange:b,autoFocus:l,getStepNavigation:h}),ue=Mg(()=>Q(n.emptyValue,{source:"view"})),de=Mg(()=>Q(n.getTodayValue(z,q,r),{source:"view"})),pe=Mg(()=>Q(J,{source:"view"})),fe=Mg(()=>Q(Y.lastCommittedValue,{skipPublicationIfPristine:!0,source:"view"})),he=Mg(()=>{Q(J,{skipPublicationIfPristine:!0,source:"view"})}),{hasUIView:me,viewModeLookup:ge,timeViewsCount:ve}=s.useMemo(()=>m.reduce((e,t)=>{const n=null==y[t]?"field":"UI";return e.viewModeLookup[t]=n,"UI"===n&&(e.hasUIView=!0,(e=>RU.includes(e))(t)&&(e.timeViewsCount+=1)),e},{hasUIView:!1,viewModeLookup:{},timeViewsCount:0}),[y,m]),be=ge[te],ye=Mg(()=>be),[we,xe]=s.useState("UI"===be?te:null);we!==te&&"UI"===ge[te]&&xe(te),Wh(()=>{"field"===be&&Y.open&&(X(!1),setTimeout(()=>{U?.current?.setSelectedSections(te),U?.current?.focusField(te)}))},[te]),Wh(()=>{if(!Y.open)return;let e=te;"field"===be&&null!=we&&(e=we),e!==re&&"UI"===ge[e]&&"UI"===ge[re]&&(e=re),e!==te&&ne(e),ie(e,!0)},[Y.open]);const Se=s.useMemo(()=>({isPickerValueEmpty:n.areValuesEqual(z,J,n.emptyValue),isPickerOpen:Y.open,isPickerDisabled:t.disabled??!1,isPickerReadOnly:t.readOnly??!1,pickerOrientation:B,pickerVariant:o}),[z,n,J,Y.open,B,o,t.disabled,t.readOnly]),Ce=s.useMemo(()=>S||!me?"hidden":k||E?"disabled":"enabled",[S,me,k,E]),ke=Mg(le),Ee=s.useMemo(()=>C&&!ce?[]:["cancel","nextOrAccept"],[C,ce]),Re=s.useMemo(()=>({setValue:Q,setOpen:X,clearValue:ue,setValueToToday:de,acceptValueChanges:pe,cancelValueChanges:fe,setView:ne,goToNextStep:ke}),[Q,X,ue,de,pe,fe,ne,ke]),Pe=s.useMemo(()=>f({},Re,{value:J,timezone:q,open:Y.open,views:m,view:we,initialView:_,disabled:k??!1,readOnly:E??!1,autoFocus:D??!1,variant:o,orientation:B,popupRef:W,reduceAnimations:j,triggerRef:V,triggerStatus:Ce,hasNextStep:se,fieldFormat:I??"",name:F,label:O,rootSx:A,rootRef:K,rootClassName:L}),[Re,J,K,o,B,j,k,E,I,L,F,O,A,Ce,se,q,Y.open,we,m,_,D]),Me=s.useMemo(()=>({dismissViews:he,ownerState:Se,hasUIView:me,getCurrentViewMode:ye,rootRefObject:G,labelId:$,triggerElement:H,viewContainerRole:p,defaultActionBarActions:Ee,onPopperExited:a}),[he,Se,me,ye,$,H,p,Ee,a]),Te=s.useMemo(()=>({formatDensity:R,enableAccessibleFieldDOMStructure:P,selectedSections:M,onSelectedSectionsChange:T,fieldRef:U}),[R,P,M,T,U]);return{providerProps:{localeText:u,contextValue:Pe,privateContextValue:Me,actionsContextValue:Re,fieldPrivateContextValue:Te,isValidContextValue:e=>{const r=i({adapter:z,value:e,timezone:q,props:t});return!n.hasError(r)}},renderCurrentView:()=>{if(null==we)return null;const e=y[we];if(null==e)return null;const t=f({},N,{views:m,timezone:q,value:ee,onChange:ae,view:we,onViewChange:ne,showViewSwitcher:ve>1,timeViewsCount:ve},"tooltip"===p?{focusedView:null,onFocusedViewChange:()=>{}}:{focusedView:oe,onFocusedViewChange:ie});return c?Xp.jsx(c,{viewRenderers:y,popperView:we,rendererProps:t}):e(t)},ownerState:Se}};function sK(e){return Ph("MuiPickersLayout",e)}const cK=Mh("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),uK=["actions"],dK=pg(_x,{name:"MuiPickersLayout",slot:"ActionBar"})({});function pK(e){const{actions:t}=e,n=d(e,uK),r=vG(),{clearValue:o,setValueToToday:i,acceptValueChanges:a,cancelValueChanges:l,goToNextStep:s,hasNextStep:c}=rG();if(null==t||0===t.length)return null;const u=t?.map(e=>{switch(e){case"clear":return Xp.jsx(Xw,{onClick:o,children:r.clearButtonLabel},e);case"cancel":return Xp.jsx(Xw,{onClick:l,children:r.cancelButtonLabel},e);case"accept":return Xp.jsx(Xw,{onClick:a,children:r.okButtonLabel},e);case"today":return Xp.jsx(Xw,{onClick:i,children:r.todayButtonLabel},e);case"next":return Xp.jsx(Xw,{onClick:s,children:r.nextStepButtonLabel},e);case"nextOrAccept":return c?Xp.jsx(Xw,{onClick:s,children:r.nextStepButtonLabel},e):Xp.jsx(Xw,{onClick:a,children:r.okButtonLabel},e);default:return null}});return Xp.jsx(dK,f({},n,{children:u}))}const fK=s.memo(pK),hK=320,mK=["items","changeImportance"],gK=["getValue"],vK=pg(tC,{name:"MuiPickersLayout",slot:"Shortcuts"})({});function bK(e){const{items:t,changeImportance:n="accept"}=e,r=d(e,mK),{setValue:o}=(()=>{const e=s.useContext(oG);if(null==e)throw new Error(["MUI X: The `usePickerActionsContext` can only be called in fields that are used as a slot of a Picker component"].join("\n"));return e})(),i=s.useContext(JU);if(null==t||0===t.length)return null;const a=t.map(e=>{let{getValue:t}=e,r=d(e,gK);const a=t({isValid:i});return f({},r,{label:r.label,onClick:()=>{o(a,{changeImportance:n,shortcut:r,source:"view"})},disabled:!i(a)})});return Xp.jsx(vK,f({dense:!0,sx:[{maxHeight:336,maxWidth:200,overflow:"auto"},...Array.isArray(r.sx)?r.sx:[r.sx]]},r,{children:a.map(e=>Xp.jsx(cC,{children:Xp.jsx(zy,f({},e))},e.id??e.label))}))}const yK=["ownerState"];const wK=e=>{const{ownerState:t,defaultActionBarActions:n}=lG(),{view:r}=rG(),o=um(),{children:i,slots:a,slotProps:l,classes:c}=e,u=s.useMemo(()=>f({},t,{layoutDirection:o?"rtl":"ltr",hasShortcuts:!1}),[t,o]),p=((e,t)=>{const{pickerOrientation:n}=t;return wm({root:["root","landscape"===n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},sK,e)})(c,u),h=a?.actionBar??fK,m=d(yy({elementType:h,externalSlotProps:l?.actionBar,additionalProps:{actions:n},className:p.actionBar,ownerState:u}),yK),g=Xp.jsx(h,f({},m)),v=a?.toolbar,b=yy({elementType:v,externalSlotProps:l?.toolbar,className:p.toolbar,ownerState:u}),y=function(e){return null!==e.view}(b)&&v?Xp.jsx(v,f({},b)):null,w=i,x=a?.tabs,S=r&&x?Xp.jsx(x,f({className:p.tabs},l?.tabs)):null,C=a?.shortcuts??bK,k=yy({elementType:C,externalSlotProps:l?.shortcuts,className:p.shortcuts,ownerState:u}),E=Array.isArray(k?.items)&&k.items.length>0;return{toolbar:y,content:w,tabs:S,actionBar:g,shortcuts:r&&C?Xp.jsx(C,f({},k)):null,ownerState:f({},u,{hasShortcuts:E})}},xK=pg("div",{name:"MuiPickersLayout",slot:"Root"})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${cK.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{pickerOrientation:"landscape",hasShortcuts:!1},style:{[`& .${cK.toolbar}`]:{gridColumn:1,gridRow:"1 / 3"}}},{props:{pickerOrientation:"landscape",hasShortcuts:!0},style:{[`& .${cK.toolbar}`]:{gridColumn:"2 / 4",gridRow:1,maxWidth:"max-content"},[`& .${cK.shortcuts}`]:{gridColumn:1,gridRow:2}}},{props:{pickerOrientation:"portrait"},style:{[`& .${cK.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${cK.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{hasShortcuts:!0,layoutDirection:"rtl"},style:{[`& .${cK.shortcuts}`]:{gridColumn:4}}}]}),SK=pg("div",{name:"MuiPickersLayout",slot:"ContentWrapper"})({gridColumn:"2 / 4",gridRow:2,display:"flex",flexDirection:"column"}),CK=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersLayout"}),{toolbar:r,content:o,tabs:i,actionBar:a,shortcuts:l,ownerState:c}=wK(n),{orientation:u,variant:d}=rG(),{sx:p,className:f,classes:h}=n,m=((e,t)=>{const{pickerOrientation:n}=t;return wm({root:["root","landscape"===n&&"landscape"],contentWrapper:["contentWrapper"]},sK,e)})(h,c);return Xp.jsxs(xK,{ref:t,sx:p,className:QU(m.root,f),ownerState:c,children:["landscape"===u?l:r,"landscape"===u?r:l,Xp.jsx(SK,{className:m.contentWrapper,ownerState:c,children:"desktop"===d?Xp.jsxs(s.Fragment,{children:[o,i]}):Xp.jsxs(s.Fragment,{children:[i,o]})}),a]})});function kK(e){const{steps:t}=e;return function(e){const{steps:t,isViewMatchingStep:n,onStepChange:r}=e;return e=>{if(null==t)return tK;const o=t.findIndex(t=>n(e.view,t)),i=-1===o||o===t.length-1?null:t[o+1];return{hasNextStep:null!=i,hasSeveralSteps:t.length>1,goToNextStep:()=>{null!=i&&r(f({},e,{step:i}))},areViewsInSameStep:(e,r)=>t.find(t=>n(e,t))===t.find(e=>n(r,e))}}}({steps:t,isViewMatchingStep:(e,t)=>null==t.views||t.views.includes(e),onStepChange:({step:e,defaultView:t,setView:n,view:r,views:o})=>{const i=null==e.views?t:e.views.find(e=>o.includes(e));i!==r&&n(i)}})}const EK=["props","steps"],RK=["ownerState"],PK=e=>null!=e.saveQuery,MK=({stateResponse:{localizedDigits:e,sectionsValueBoundaries:t,state:n,timezone:r,setCharacterQuery:o,setTempAndroidValueStr:i,updateSectionValue:a}})=>{const l=gG(),s=({keyPressed:e,sectionIndex:t},r,i)=>{const a=e.toLowerCase(),l=n.sections[t];if(null!=n.characterQuery&&(!i||i(n.characterQuery.value))&&n.characterQuery.sectionIndex===t){const e=`${n.characterQuery.value}${a}`,i=r(e,l);if(!PK(i))return o({sectionIndex:t,value:e,sectionType:l.type}),i}const s=r(a,l);return PK(s)&&!s.saveQuery?(o(null),null):(o({sectionIndex:t,value:a,sectionType:l.type}),PK(s)?null:s)};return Mg(o=>{const c=n.sections[o.sectionIndex],u=$U(o.keyPressed,e)?(n=>{const r=({queryValue:n,skipIfBelowMinimum:r,section:o})=>{const i=AU(n,e),a=Number(i),s=t[o.type]({currentDate:null,format:o.format,contentType:o.contentType});if(a>s.maximum)return{saveQuery:!1};if(r&&a<s.minimum)return{saveQuery:!0};const c=10*a>s.maximum||i.length===s.maximum.toString().length;return{sectionValue:jU(l,a,s,e,o),shouldGoToNextSection:c}};return s(n,(e,t)=>{if("digit"===t.contentType||"digit-with-letter"===t.contentType)return r({queryValue:e,skipIfBelowMinimum:!1,section:t});if("month"===t.type){VU(l,"digit","month","MM");const n=r({queryValue:e,skipIfBelowMinimum:!0,section:{type:t.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2}});return PK(n)?n:f({},n,{sectionValue:_U(l,n.sectionValue,"MM",t.format)})}if("weekDay"===t.type){const n=r({queryValue:e,skipIfBelowMinimum:!0,section:t});return PK(n)?n:f({},n,{sectionValue:DU(l,t.format)[Number(n.sectionValue)-1]})}return{saveQuery:!1}},t=>$U(t,e))})(f({},o,{keyPressed:NU(o.keyPressed,e)})):(e=>{const t=(e,t,n)=>{const r=t.filter(e=>e.toLowerCase().startsWith(n));return 0===r.length?{saveQuery:!1}:{sectionValue:r[0],shouldGoToNextSection:1===r.length}},n=(e,n,o,i)=>{const a=e=>FU(l,r,n.type,e);if("letter"===n.contentType)return t(n.format,a(n.format),e);if(o&&null!=i&&"letter"===OU(l,o).contentType){const n=a(o),r=t(0,n,e);return PK(r)?{saveQuery:!1}:f({},r,{sectionValue:i(r.sectionValue,n)})}return{saveQuery:!1}};return s(e,(e,t)=>{switch(t.type){case"month":{const r=e=>_U(l,e,l.formats.month,t.format);return n(e,t,l.formats.month,r)}case"weekDay":{const r=(e,t)=>t.indexOf(e).toString();return n(e,t,l.formats.weekday,r)}case"meridiem":return n(e,t);default:return{saveQuery:!1}}})})(o);null!=u?a({section:c,newSectionValue:u.sectionValue,shouldGoToNextSection:u.shouldGoToNextSection}):i(null)})},TK=e=>{const t=gG(),n=vG(),r=um(),{manager:{validator:o,valueType:i,internal_valueManager:a,internal_fieldValueManager:l},internalPropsWithDefaults:c,internalPropsWithDefaults:{value:u,defaultValue:d,referenceDate:p,onChange:h,format:m,formatDensity:g="dense",selectedSections:v,onSelectedSectionsChange:b,shouldRespectLeadingZeros:y=!1,timezone:w,enableAccessibleFieldDOMStructure:x=!0},forwardedProps:{error:S}}=e,{value:C,handleValueChange:k,timezone:E}=iK({name:"a field component",timezone:w,value:u,defaultValue:d,referenceDate:p,onChange:h,valueManager:a}),R=s.useRef(C);s.useEffect(()=>{R.current=C},[C]);const{hasValidationError:P}=AG({props:c,validator:o,timezone:E,value:C,onError:c.onError}),M=s.useMemo(()=>(e=>{const t=e.date(void 0);return"0"===e.formatByString(e.setSeconds(t,0),"s")?LU:Array.from({length:10}).map((n,r)=>e.formatByString(e.setSeconds(t,r),"s"))})(t),[t]),T=s.useMemo(()=>((e,t,n)=>{const r=e.date(void 0,n),o=e.endOfYear(r),i=e.endOfDay(r),{maxDaysInMonth:a,longestMonth:l}=wU(e,r).reduce((t,n)=>{const r=e.getDaysInMonth(n);return r>t.maxDaysInMonth?{maxDaysInMonth:r,longestMonth:n}:t},{maxDaysInMonth:0,longestMonth:null});return{year:({format:t})=>({minimum:0,maximum:HU(e,t)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(o)+1}),day:({currentDate:t})=>({minimum:1,maximum:e.isValid(t)?e.getDaysInMonth(t):a,longestMonth:l}),weekDay:({format:t,contentType:n})=>{if("digit"===n){const n=DU(e,t).map(Number);return{minimum:Math.min(...n),maximum:Math.max(...n)}}return{minimum:1,maximum:7}},hours:({format:n})=>{const o=e.getHours(i);return AU(e.formatByString(e.endOfDay(r),n),t)!==o.toString()?{minimum:1,maximum:Number(AU(e.formatByString(e.startOfDay(r),n),t))}:{minimum:0,maximum:o}},minutes:()=>({minimum:0,maximum:e.getMinutes(i)}),seconds:()=>({minimum:0,maximum:e.getSeconds(i)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}})(t,M,E),[t,M,E]),I=s.useCallback(e=>l.getSectionsFromValue(e,e=>PG({adapter:t,localeText:n,localizedDigits:M,format:m,date:e,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:x,isRtl:r})),[l,m,n,M,r,y,t,g,x]),[O,D]=s.useState(()=>{const e=I(C),n={sections:e,lastExternalValue:C,lastSectionsDependencies:{format:m,isRtl:r,locale:t.locale},tempValueStrAndroid:null,characterQuery:null},o=(e=>Math.max(...e.map(e=>MU[e.type]??1)))(e);return f({},n,{referenceValue:a.getInitialReferenceValue({referenceDate:p,value:C,adapter:t,props:c,granularity:o,timezone:E})})}),[F,L]=Pg({controlled:v,default:null,name:"useField",state:"selectedSections"}),A=e=>{L(e),b?.(e)},N=s.useMemo(()=>GU(F,O.sections),[F,O.sections]),$="all"===N?0:N,z=s.useMemo(()=>((e,t)=>{const n={};if(!t)return e.forEach((t,r)=>{const o=0===r?null:r-1,i=r===e.length-1?null:r+1;n[r]={leftIndex:o,rightIndex:i}}),{neighbors:n,startIndex:0,endIndex:e.length-1};const r={},o={};let i=0,a=0,l=e.length-1;for(;l>=0;){a=e.findIndex((e,t)=>t>=i&&e.endSeparator?.includes(" ")&&" / "!==e.endSeparator),-1===a&&(a=e.length-1);for(let e=a;e>=i;e-=1)o[e]=l,r[l]=e,l-=1;i=a+1}return e.forEach((t,i)=>{const a=o[i],l=0===a?null:r[a-1],s=a===e.length-1?null:r[a+1];n[i]={leftIndex:l,rightIndex:s}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}})(O.sections,r&&!x),[O.sections,r,x]),j=s.useMemo(()=>O.sections.every(e=>""===e.value),[O.sections]),B=s.useMemo(()=>{if(null!=$)return!1;const e=O.sections.filter(e=>""!==e.value);return e.length>0&&O.sections.length-e.length>0},[O.sections,$]),_=s.useMemo(()=>void 0!==S?S:P||B,[P,B,S]),H=e=>{const n={validationError:o({adapter:t,value:e,timezone:E,props:c})};k(e,n)},V=(e,t)=>{const n=[...O.sections];return n[e]=f({},n[e],{value:t,modified:!0}),n},W=s.useRef(null),U=Ng(),G=e=>{null!=$&&(W.current={sectionIndex:$,value:e},U.start(0,()=>{W.current=null}))},K=()=>{if(null==$)return;const e=O.sections[$];""!==e.value&&(G(""),null===l.getDateFromSection(C,e)?D(e=>f({},e,{sections:V($,""),tempValueStrAndroid:null,characterQuery:null})):(D(e=>f({},e,{characterQuery:null})),H(l.updateDateInValue(C,e,null))))},q=Ng(),Y=Mg(e=>{D(t=>f({},t,{characterQuery:e}))});if(C!==O.lastExternalValue){const e=null!=W.current&&!t.isValid(l.getDateFromSection(C,O.sections[W.current.sectionIndex]));let n;n=e?V(W.current.sectionIndex,W.current.value):I(C),D(o=>f({},o,{lastExternalValue:C,sections:n,sectionsDependencies:{format:m,isRtl:r,locale:t.locale},referenceValue:e?o.referenceValue:l.updateReferenceValue(t,C,o.referenceValue),tempValueStrAndroid:null}))}if(r!==O.lastSectionsDependencies.isRtl||m!==O.lastSectionsDependencies.format||t.locale!==O.lastSectionsDependencies.locale){const e=I(C);D(n=>f({},n,{lastSectionsDependencies:{format:m,isRtl:r,locale:t.locale},sections:e,tempValueStrAndroid:null,characterQuery:null}))}null==O.characterQuery||_||null!=$||Y(null),null!=O.characterQuery&&O.sections[O.characterQuery.sectionIndex]?.type!==O.characterQuery.sectionType&&Y(null),s.useEffect(()=>{null!=W.current&&(W.current=null)});const X=Ng();return s.useEffect(()=>(null!=O.characterQuery&&X.start(5e3,()=>Y(null)),()=>{}),[O.characterQuery,Y,X]),s.useEffect(()=>{null!=O.tempValueStrAndroid&&null!=$&&K()},[O.sections]),{activeSectionIndex:$,areAllSectionsEmpty:j,error:_,localizedDigits:M,parsedSelectedSections:N,sectionOrder:z,sectionsValueBoundaries:T,state:O,timezone:E,value:C,clearValue:()=>{a.areValuesEqual(t,C,a.emptyValue)?D(e=>f({},e,{sections:e.sections.map(e=>f({},e,{value:""})),tempValueStrAndroid:null,characterQuery:null})):(D(e=>f({},e,{characterQuery:null})),H(a.emptyValue))},clearActiveSection:K,setCharacterQuery:Y,setSelectedSections:A,setTempAndroidValueStr:e=>D(t=>f({},t,{tempValueStrAndroid:e})),updateSectionValue:({section:e,newSectionValue:n,shouldGoToNextSection:r})=>{U.clear(),q.clear();const o=l.getDateFromSection(C,e);r&&$<O.sections.length-1&&A($+1);const i=V($,n),a=l.getDateSectionsFromValue(i,e),s=((e,t,n)=>{const r=t.some(e=>"day"===e.type),o=[],i=[];for(let e=0;e<t.length;e+=1){const a=t[e];r&&"weekDay"===a.type||(o.push(a.format),i.push(BU(a,"non-input",n)))}const a=o.join(" "),l=i.join(" ");return e.parse(l,a)})(t,a,M);if(t.isValid(s)){const n=UU(t,s,a,l.getDateFromSection(O.referenceValue,e),!0);return null==o&&q.start(0,()=>{R.current===C&&D(t=>f({},t,{sections:l.clearDateSections(O.sections,e),tempValueStrAndroid:null}))}),H(l.updateDateInValue(C,e,n))}return a.every(e=>""!==e.value)&&(null==o||t.isValid(o))?(G(n),H(l.updateDateInValue(C,e,s))):(null!=o&&(G(n),H(l.updateDateInValue(C,e,s))),D(e=>f({},e,{sections:i,tempValueStrAndroid:null})))},updateValueFromValueStr:e=>{const o=l.parseValueStr(e,O.referenceValue,(e,o)=>{const i=t.parse(e,m);if(!t.isValid(i))return null;const a=PG({adapter:t,localeText:n,localizedDigits:M,format:m,date:i,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:x,isRtl:r});return UU(t,i,a,o,!1)});H(o)},getSectionsFromValue:I}};function IK(e){const{manager:{internal_useApplyDefaultValuesToFieldInternalProps:t},internalProps:n,skipContextFieldRefAssignment:r}=e,o=MG(),i=tG(),a=Tg(n.unstableFieldRef,r?null:i?.fieldRef),l=o?.setValue,c=s.useCallback((e,t)=>l?.(e,{validationError:t.validationError,shouldClose:!1}),[l]);return t(s.useMemo(()=>null!=i&&null!=o?f({value:o.value,onChange:c,timezone:o.timezone,disabled:o.disabled,readOnly:o.readOnly,autoFocus:o.autoFocus&&!o.open,focused:!!o.open||void 0,format:o.fieldFormat,formatDensity:i.formatDensity,enableAccessibleFieldDOMStructure:i.enableAccessibleFieldDOMStructure,selectedSections:i.selectedSections,onSelectedSectionsChange:i.onSelectedSectionsChange,unstableFieldRef:a},n):n,[o,i,n,c,a]))}function OK(e){const{focused:t,domGetters:n,stateResponse:{parsedSelectedSections:r,state:o}}=e;if(!n.isReady())return;const i=kg(n.getRoot()).getSelection();if(!i)return;if(null==r)return i.rangeCount>0&&i.getRangeAt(0).startContainer instanceof Node&&n.getRoot().contains(i.getRangeAt(0).startContainer)&&i.removeAllRanges(),void(t&&n.getRoot().blur());if(!n.getRoot().contains(VG(n.getRoot())))return;const a=new window.Range;let l;if("all"===r)l=n.getRoot();else{l="empty"===o.sections[r].type?n.getSectionContainer(r):n.getSectionContent(r)}a.selectNodeContents(l),l.focus(),i.removeAllRanges(),i.addRange(a)}function DK(e){const t=gG(),{manager:{internal_fieldValueManager:n},internalPropsWithDefaults:{minutesStep:r,disabled:o,readOnly:i},stateResponse:{state:a,value:l,activeSectionIndex:s,parsedSelectedSections:c,sectionsValueBoundaries:u,localizedDigits:d,timezone:p,sectionOrder:f,clearValue:h,clearActiveSection:m,setSelectedSections:g,updateSectionValue:v}}=e;return Mg(e=>{if(!o)switch(!0){case(e.ctrlKey||e.metaKey)&&"A"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey:e.preventDefault(),g("all");break;case"ArrowRight"===e.key:if(e.preventDefault(),null==c)g(f.startIndex);else if("all"===c)g(f.endIndex);else{const e=f.neighbors[c].rightIndex;null!==e&&g(e)}break;case"ArrowLeft"===e.key:if(e.preventDefault(),null==c)g(f.endIndex);else if("all"===c)g(f.startIndex);else{const e=f.neighbors[c].leftIndex;null!==e&&g(e)}break;case"Delete"===e.key:if(e.preventDefault(),i)break;null==c||"all"===c?h():m();break;case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(e.key):{if(e.preventDefault(),i||null==s)break;"all"===c&&g(s);const o=a.sections[s],f=function(e,t,n,r,o,i,a,l){const s=function(e){switch(e){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}}(r),c="Home"===r,u="End"===r,d=""===n.value||c||u,p=()=>{const r=o[n.type]({currentDate:a,format:n.format,contentType:n.contentType}),p=t=>jU(e,t,r,i,n),f="minutes"===n.type&&l?.minutesStep?l.minutesStep:1;let h;if(d){if("year"===n.type&&!u&&!c)return e.formatByString(e.date(void 0,t),n.format);h=s>0||c?r.minimum:r.maximum}else{h=parseInt(AU(n.value,i),10)+s*f}return h%f!==0&&((s<0||c)&&(h+=f-(f+h)%f),(s>0||u)&&(h-=h%f)),h>r.maximum?p(r.minimum+(h-r.maximum-1)%(r.maximum-r.minimum+1)):h<r.minimum?p(r.maximum-(r.minimum-h-1)%(r.maximum-r.minimum+1)):p(h)},f=()=>{const r=FU(e,t,n.type,n.format);if(0===r.length)return n.value;if(d)return s>0||c?r[0]:r[r.length-1];const o=r.indexOf(n.value);return r[((o+s)%r.length+r.length)%r.length]};if("digit"===n.contentType||"digit-with-letter"===n.contentType)return p();return f()}(t,p,o,e.key,u,d,n.getDateFromSection(l,o),{minutesStep:r});v({section:o,newSectionValue:f,shouldGoToNextSection:!1});break}}})}function FK(e,t){if(e.value)switch(e.type){case"month":{if("digit"===e.contentType){const n=t.setMonth(t.date(),Number(e.value)-1);return t.isValid(n)?t.format(n,"month"):""}const n=t.parse(e.value,e.format);return n&&t.isValid(n)?t.format(n,"month"):void 0}case"day":if("digit"===e.contentType){const n=t.setDate(t.startOfYear(t.date()),Number(e.value));return t.isValid(n)?t.format(n,"dayOfMonthFull"):""}return e.value;default:return}}function LK(e,t){if(e.value)switch(e.type){case"weekDay":if("letter"===e.contentType)return;return Number(e.value);case"meridiem":{const n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);return n?t.getHours(n)>=12?1:0:void 0}case"day":return"digit-with-letter"===e.contentType?parseInt(e.value,10):Number(e.value);case"month":{if("digit"===e.contentType)return Number(e.value);const n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return"letter"!==e.contentType?Number(e.value):void 0}}const AK=e=>{const{props:t,manager:n,skipContextFieldRefAssignment:r,manager:{valueType:o,internal_useOpenPickerButtonAriaLabel:i}}=e,{internalProps:a,forwardedProps:l}=kG(t,o),c=IK({manager:n,internalProps:a,skipContextFieldRefAssignment:r}),{sectionListRef:u,onBlur:d,onClick:p,onFocus:h,onInput:m,onPaste:g,onKeyDown:v,onClear:b,clearable:y}=l,{disabled:w=!1,readOnly:x=!1,autoFocus:S=!1,focused:C,unstableFieldRef:k}=c,E=s.useRef(null),R=Tg(u,E),P=s.useMemo(()=>({isReady:()=>null!=E.current,getRoot:()=>E.current.getRoot(),getSectionContainer:e=>E.current.getSectionContainer(e),getSectionContent:e=>E.current.getSectionContent(e),getSectionIndexFromDOMElement:e=>E.current.getSectionIndexFromDOMElement(e)}),[E]),M=TK({manager:n,internalPropsWithDefaults:c,forwardedProps:l}),{areAllSectionsEmpty:T,error:I,parsedSelectedSections:O,sectionOrder:D,state:F,value:L,clearValue:A,setSelectedSections:N}=M,$=MK({stateResponse:M}),z=i(L),[j,B]=s.useState(!1);function _(e=0){if(w||!E.current||null!=NK(E))return;const t=GU(e,F.sections);B(!0),E.current.getSectionContent(t).focus()}const H=function(e){const{manager:t,focused:n,setFocused:r,domGetters:o,stateResponse:i,applyCharacterEditing:a,internalPropsWithDefaults:l,stateResponse:{parsedSelectedSections:s,sectionOrder:c,state:u,clearValue:d,setCharacterQuery:p,setSelectedSections:f,updateValueFromValueStr:h},internalPropsWithDefaults:{disabled:m=!1,readOnly:g=!1}}=e,v=DK({manager:t,internalPropsWithDefaults:l,stateResponse:i}),b=Ng(),y=Mg(e=>{!m&&o.isReady()&&(r(!0),"all"===s?b.start(0,()=>{const e=document.getSelection().getRangeAt(0).startOffset;if(0===e)return void f(c.startIndex);let t=0,n=0;for(;n<e&&t<u.sections.length;){const e=u.sections[t];t+=1,n+=`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`.length}f(t-1)}):n?o.getRoot().contains(e.target)||f(c.startIndex):(r(!0),f(c.startIndex)))}),w=Mg(e=>{if(!o.isReady()||"all"!==s)return;const t=e.target.textContent??"";o.getRoot().innerHTML=u.sections.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),OK({focused:n,domGetters:o,stateResponse:i}),0===t.length||10===t.charCodeAt(0)?(d(),f("all")):t.length>1?h(t):("all"===s&&f(0),a({keyPressed:t,sectionIndex:0}))}),x=Mg(e=>{if(g||"all"!==s)return void e.preventDefault();const t=e.clipboardData.getData("text");e.preventDefault(),p(null),h(t)}),S=Mg(()=>{if(n||m||!o.isReady())return;const e=VG(o.getRoot());r(!0),null!=o.getSectionIndexFromDOMElement(e)||f(c.startIndex)}),C=Mg(()=>{setTimeout(()=>{if(!o.isReady())return;const e=VG(o.getRoot());!o.getRoot().contains(e)&&(r(!1),f(null))})});return{onKeyDown:v,onBlur:C,onFocus:S,onClick:y,onPaste:x,onInput:w,contentEditable:"all"===s,tabIndex:l.disabled||0===s?-1:0}}({manager:n,internalPropsWithDefaults:c,stateResponse:M,applyCharacterEditing:$,focused:j,setFocused:B,domGetters:P}),V=function(e){const{manager:{internal_fieldValueManager:t},stateResponse:{areAllSectionsEmpty:n,state:r,updateValueFromValueStr:o}}=e,i=Mg(e=>{o(e.target.value)});return{value:s.useMemo(()=>n?"":t.getV7HiddenInputValueFromSections(r.sections),[n,r.sections,t]),onChange:i}}({manager:n,stateResponse:M}),W=function(e){const{stateResponse:{setSelectedSections:t},internalPropsWithDefaults:{disabled:n=!1}}=e,r=s.useCallback(e=>r=>{n||r.isDefaultPrevented()||t(e)},[n,t]);return s.useCallback(e=>({"data-sectionindex":e,onClick:r(e)}),[r])}({stateResponse:M,internalPropsWithDefaults:c}),U=function(e){const t=gG(),n=vG(),{focused:r,domGetters:o,stateResponse:i,applyCharacterEditing:a,manager:{internal_fieldValueManager:l},stateResponse:{parsedSelectedSections:c,sectionsValueBoundaries:u,state:d,value:p,clearActiveSection:f,setCharacterQuery:h,setSelectedSections:m,updateSectionValue:g,updateValueFromValueStr:v},internalPropsWithDefaults:{disabled:b=!1,readOnly:y=!1}}=e,w="all"===c,x=!w&&!b&&!y,S=Mg(e=>{if(!o.isReady())return;const t=d.sections[e];o.getSectionContent(e).innerHTML=t.value||t.placeholder,OK({focused:r,domGetters:o,stateResponse:i})}),C=Mg(e=>{if(!o.isReady())return;const t=e.target,n=t.textContent??"",r=o.getSectionIndexFromDOMElement(t),i=d.sections[r];if(y)S(r);else{if(0===n.length){if(""===i.value)return void S(r);const t=e.nativeEvent.inputType;return"insertParagraph"===t||"insertLineBreak"===t?void S(r):(S(r),void f())}a({keyPressed:n,sectionIndex:r}),S(r)}}),k=Mg(e=>{e.preventDefault()}),E=Mg(e=>{if(e.preventDefault(),y||b||"number"!=typeof c)return;const t=d.sections[c],n=e.clipboardData.getData("text"),r=/^[a-zA-Z]+$/.test(n),o=/^[0-9]+$/.test(n),i=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(n);"letter"===t.contentType&&r||"digit"===t.contentType&&o||"digit-with-letter"===t.contentType&&i?(h(null),g({section:t,newSectionValue:n,shouldGoToNextSection:!0})):r||o||(h(null),v(n))}),R=Mg(e=>{e.preventDefault(),e.dataTransfer.dropEffect="none"}),P=s.useCallback(e=>()=>{b||m(e)},[b,m]);return s.useCallback((e,r)=>{const o=u[e.type]({currentDate:l.getDateFromSection(p,e),contentType:e.contentType,format:e.format});return{onInput:C,onPaste:E,onMouseUp:k,onDragOver:R,onFocus:P(r),"aria-readonly":y,"aria-valuenow":LK(e,t),"aria-valuemin":o.minimum,"aria-valuemax":o.maximum,"aria-valuetext":e.value?FK(e,t):n.empty,"aria-label":n[e.type],"aria-disabled":b,tabIndex:!x||w||r>0?-1:0,contentEditable:!w&&!b&&!y,role:"spinbutton","data-range-position":e.dateName||void 0,spellCheck:!x&&void 0,autoCapitalize:x?"none":void 0,autoCorrect:x?"off":void 0,children:e.value||e.placeholder,inputMode:"letter"===e.contentType?"text":"numeric"}},[u,w,b,y,x,n,t,C,E,k,R,P,l,p])}({manager:n,stateResponse:M,applyCharacterEditing:$,internalPropsWithDefaults:c,domGetters:P,focused:j}),G=Mg(e=>{v?.(e),H.onKeyDown(e)}),K=Mg(e=>{d?.(e),H.onBlur(e)}),q=Mg(e=>{h?.(e),H.onFocus(e)}),Y=Mg(e=>{e.isDefaultPrevented()||(p?.(e),H.onClick(e))}),X=Mg(e=>{g?.(e),H.onPaste(e)}),Q=Mg(e=>{m?.(e),H.onInput(e)}),Z=Mg((e,...t)=>{e.preventDefault(),b?.(e,...t),A(),$K(E)?N(D.startIndex):_(0)}),J=s.useMemo(()=>F.sections.map((e,t)=>{const n=U(e,t);return{container:W(t),content:U(e,t),before:{children:e.startSeparator},after:{children:e.endSeparator,"data-range-position":e.isEndFormatSeparator?n["data-range-position"]:void 0}}}),[F.sections,W,U]);return s.useEffect(()=>{if(null==E.current)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.","","If you want to keep using an `<input />` HTML element for the editing, please add the `enableAccessibleFieldDOMStructure={false}` prop to your Picker or Field component:","","<DatePicker enableAccessibleFieldDOMStructure={false} slots={{ textField: MyCustomTextField }} />","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join("\n"));S&&!w&&E.current&&E.current.getSectionContent(D.startIndex).focus()},[]),Wh(()=>{if(j&&E.current)if("all"===O)E.current.getRoot().focus();else if("number"==typeof O){const e=E.current.getSectionContent(O);e&&e.focus()}},[O,j]),Wh(()=>{OK({focused:j,domGetters:P,stateResponse:M})}),s.useImperativeHandle(k,()=>({getSections:()=>F.sections,getActiveSectionIndex:()=>NK(E),setSelectedSections:e=>{if(w||!E.current)return;const t=GU(e,F.sections);B(null!==("all"===t?0:t)),N(e)},focusField:_,isFieldFocused:()=>$K(E)})),f({},l,H,{onBlur:K,onClick:Y,onFocus:q,onInput:Q,onPaste:X,onKeyDown:G,onClear:Z},V,{error:I,clearable:Boolean(y&&!T&&!x&&!w),focused:C??j,sectionListRef:R,enableAccessibleFieldDOMStructure:!0,elements:J,areAllSectionsEmpty:T,disabled:w,readOnly:x,autoFocus:S,openPickerAriaLabel:z})};function NK(e){const t=VG(e.current?.getRoot());return t&&e.current&&e.current.getRoot().contains(t)?e.current.getSectionIndexFromDOMElement(t):null}function $K(e){const t=VG(e.current?.getRoot());return!!e.current&&e.current.getRoot().contains(t)}const zK=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),jK=e=>{const t=um(),n=Ng(),r=Ng(),{props:o,manager:i,skipContextFieldRefAssignment:a,manager:{valueType:l,internal_valueManager:c,internal_fieldValueManager:u,internal_useOpenPickerButtonAriaLabel:d}}=e,{internalProps:p,forwardedProps:h}=kG(o,l),m=IK({manager:i,internalProps:p,skipContextFieldRefAssignment:a}),{onFocus:g,onClick:v,onPaste:b,onBlur:y,onKeyDown:w,onClear:x,clearable:S,inputRef:C,placeholder:k}=h,{readOnly:E=!1,disabled:R=!1,autoFocus:P=!1,focused:M,unstableFieldRef:T}=m,I=s.useRef(null),O=Tg(C,I),D=TK({manager:i,internalPropsWithDefaults:m,forwardedProps:h}),{activeSectionIndex:F,areAllSectionsEmpty:L,error:A,localizedDigits:N,parsedSelectedSections:$,sectionOrder:z,state:j,value:B,clearValue:_,clearActiveSection:H,setCharacterQuery:V,setSelectedSections:W,setTempAndroidValueStr:U,updateSectionValue:G,updateValueFromValueStr:K,getSectionsFromValue:q}=D,Y=MK({stateResponse:D}),X=d(B),Q=s.useMemo(()=>((e,t,n)=>{let r=0,o=n?1:0;const i=[];for(let a=0;a<e.length;a+=1){const l=e[a],s=BU(l,n?"input-rtl":"input-ltr",t),c=`${l.startSeparator}${s}${l.endSeparator}`,u=zK(c).length,d=c.length,p=zK(s),h=o+(""===p?0:s.indexOf(p[0]))+l.startSeparator.length,m=h+p.length;i.push(f({},l,{start:r,end:r+u,startInInput:h,endInInput:m})),r+=u,o+=d}return i})(j.sections,N,t),[j.sections,N,t]);function Z(){const e=I.current.selectionStart??0;let t;t=e<=Q[0].startInInput||e>=Q[Q.length-1].endInInput?1:Q.findIndex(t=>t.startInInput-t.startSeparator.length>e);const n=-1===t?Q.length-1:t-1;W(n)}function J(e=0){VG(I.current)!==I.current&&(I.current?.focus(),W(e))}const ee=Mg(e=>{g?.(e);const t=I.current;n.start(0,()=>{t&&t===I.current&&null==F&&(t.value.length&&Number(t.selectionEnd)-Number(t.selectionStart)===t.value.length?W("all"):Z())})}),te=Mg((e,...t)=>{e.isDefaultPrevented()||(v?.(e,...t),Z())}),ne=Mg(e=>{if(b?.(e),e.preventDefault(),E||R)return;const t=e.clipboardData.getData("text");if("number"==typeof $){const e=j.sections[$],n=/^[a-zA-Z]+$/.test(t),r=/^[0-9]+$/.test(t),o=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(t);if("letter"===e.contentType&&n||"digit"===e.contentType&&r||"digit-with-letter"===e.contentType&&o)return V(null),void G({section:e,newSectionValue:t,shouldGoToNextSection:!0});if(n||r)return}V(null),K(t)}),re=Mg(e=>{y?.(e),W(null)}),oe=Mg(e=>{if(E)return;const n=e.target.value;if(""===n)return void _();const r=e.nativeEvent.data,o=r&&r.length>1,i=o?r:n,a=zK(i);if("all"===$&&W(F),null==F||o)return void K(o?r:a);let l;if("all"===$&&1===a.length)l=a;else{const e=zK(u.getV6InputValueFromSections(Q,N,t));let n=-1,r=-1;for(let t=0;t<e.length;t+=1)-1===n&&e[t]!==a[t]&&(n=t),-1===r&&e[e.length-t-1]!==a[a.length-t-1]&&(r=t);const o=Q[F];if(n<o.start||e.length-r-1>o.end)return;const i=a.length-e.length+o.end-zK(o.endSeparator||"").length;l=a.slice(o.start+zK(o.startSeparator||"").length,i)}if(0===l.length)return navigator.userAgent.toLowerCase().includes("android")&&U(i),void H();Y({keyPressed:l,sectionIndex:F})}),ie=Mg((e,...t)=>{e.preventDefault(),x?.(e,...t),_(),BK(I)?W(z.startIndex):J(0)}),ae=DK({manager:i,internalPropsWithDefaults:m,stateResponse:D}),le=Mg(e=>{w?.(e),ae(e)}),se=s.useMemo(()=>void 0!==k?k:u.getV6InputValueFromSections(q(c.emptyValue),N,t),[k,u,q,c.emptyValue,N,t]),ce=s.useMemo(()=>j.tempValueStrAndroid??u.getV6InputValueFromSections(j.sections,N,t),[j.sections,u,j.tempValueStrAndroid,N,t]);s.useEffect(()=>{I.current&&I.current===VG(I.current)&&W("all")},[]),Wh(()=>{!function e(){if(!I.current)return;if(null==$)return void(I.current.scrollLeft&&(I.current.scrollLeft=0));if(I.current!==VG(I.current))return;const t=I.current.scrollTop;if("all"===$)I.current.select();else{const t=Q[$],n="empty"===t.type?t.startInInput-t.startSeparator.length:t.startInInput,o="empty"===t.type?t.endInInput+t.endSeparator.length:t.endInInput;n===I.current.selectionStart&&o===I.current.selectionEnd||I.current===VG(I.current)&&I.current.setSelectionRange(n,o),r.start(0,()=>{!I.current||I.current!==VG(I.current)||I.current.selectionStart!==I.current.selectionEnd||I.current.selectionStart===n&&I.current.selectionEnd===o||e()})}I.current.scrollTop=t}()});const ue=s.useMemo(()=>null==F||"letter"===j.sections[F].contentType?"text":"numeric",[F,j.sections]),de=!(I.current&&I.current===VG(I.current))&&L;return s.useImperativeHandle(T,()=>({getSections:()=>j.sections,getActiveSectionIndex:()=>{const e=I.current.selectionStart??0,t=I.current.selectionEnd??0;if(0===e&&0===t)return null;const n=e<=Q[0].startInInput?1:Q.findIndex(t=>t.startInInput-t.startSeparator.length>e);return-1===n?Q.length-1:n-1},setSelectedSections:e=>W(e),focusField:J,isFieldFocused:()=>BK(I)})),f({},h,{error:A,"aria-invalid":A,clearable:Boolean(S&&!L&&!E&&!R),onBlur:re,onClick:te,onFocus:ee,onPaste:ne,onKeyDown:le,onClear:ie,inputRef:O,enableAccessibleFieldDOMStructure:!1,placeholder:se,inputMode:ue,autoComplete:"off",value:de?"":ce,onChange:oe,focused:M,disabled:R,readOnly:E,autoFocus:P,openPickerAriaLabel:X})};function BK(e){return e.current===VG(e.current)}const _K=e=>(e=>{const t=tG();return(e.props.enableAccessibleFieldDOMStructure??t?.enableAccessibleFieldDOMStructure??1?AK:jK)(e)})({manager:function(e={}){const{enableAccessibleFieldDOMStructure:t=!0}=e;return s.useMemo(()=>({valueType:"date",validator:LG,internal_valueManager:qU,internal_fieldValueManager:YU,internal_enableAccessibleFieldDOMStructure:t,internal_useApplyDefaultValuesToFieldInternalProps:zG,internal_useOpenPickerButtonAriaLabel:$G}),[t])}(e),props:e});function HK(e){const{ownerState:t}=lG(),n=um();return s.useMemo(()=>f({},t,{isFieldDisabled:e.disabled??!1,isFieldReadOnly:e.readOnly??!1,isFieldRequired:e.required??!1,fieldDirection:n?"rtl":"ltr"}),[t,e.disabled,e.readOnly,e.required,n])}const VK=Sg(Xp.jsx("path",{d:"M7 10l5 5 5-5z"})),WK=Sg(Xp.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})),UK=Sg(Xp.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),GK=Sg(Xp.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}));Sg(Xp.jsxs(s.Fragment,{children:[Xp.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),Xp.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]})),Sg(Xp.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"})),Sg(Xp.jsxs(s.Fragment,{children:[Xp.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),Xp.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}));const KK=Sg(Xp.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function qK(e){return Ph("MuiPickersTextField",e)}function YK(e){return Ph("MuiPickersInputBase",e)}Mh("MuiPickersTextField",["root","focused","disabled","error","required"]);const XK=Mh("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input","inputSizeSmall","activeBar"]);function QK(e){return Ph("MuiPickersSectionList",e)}const ZK=Mh("MuiPickersSectionList",["root","section","sectionContent"]),JK=["slots","slotProps","elements","sectionListRef","classes"],eq=pg("div",{name:"MuiPickersSectionList",slot:"Root"})({direction:"ltr /*! @noflip */",outline:"none"}),tq=pg("span",{name:"MuiPickersSectionList",slot:"Section"})({}),nq=pg("span",{name:"MuiPickersSectionList",slot:"SectionSeparator"})({whiteSpace:"pre"}),rq=pg("span",{name:"MuiPickersSectionList",slot:"SectionContent"})({outline:"none"});function oq(e){const{slots:t,slotProps:n,element:r,classes:o}=e,{ownerState:i}=lG(),a=t?.section??tq,l=yy({elementType:a,externalSlotProps:n?.section,externalForwardedProps:r.container,className:o.section,ownerState:i}),c=t?.sectionContent??rq,u=yy({elementType:c,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:o.sectionContent,ownerState:i}),d=t?.sectionSeparator??nq,p=yy({elementType:d,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:f({},i,{separatorPosition:"before"})}),h=yy({elementType:d,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:f({},i,{separatorPosition:"after"})}),m=s.useRef(null),g=Tg(u.ref,m);return Xp.jsxs(a,f({},l,{children:[Xp.jsx(d,f({},p)),Xp.jsx(c,f({},u,{ref:g,onBlur:e=>{const t=e.relatedTarget,n=e.currentTarget.closest(`.${ZK.root}`);n&&t instanceof Node&&n.contains(t)&&e.stopPropagation()}})),Xp.jsx(d,f({},h))]}))}const iq=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersSectionList"}),{slots:r,slotProps:o,elements:i,sectionListRef:a,classes:l}=n,c=d(n,JK),u=(e=>wm({root:["root"],section:["section"],sectionContent:["sectionContent"]},QK,e))(l),{ownerState:p}=lG(),h=s.useRef(null),m=Tg(t,h),g=e=>{if(!h.current)throw new Error(`MUI X: Cannot call sectionListRef.${e} before the mount of the component.`);return h.current};s.useImperativeHandle(a,()=>({getRoot:()=>g("getRoot"),getSectionContainer:e=>g("getSectionContainer").querySelector(`.${ZK.section}[data-sectionindex="${e}"]`),getSectionContent:e=>g("getSectionContent").querySelector(`.${ZK.section}[data-sectionindex="${e}"] .${ZK.sectionContent}`),getSectionIndexFromDOMElement(e){const t=g("getSectionIndexFromDOMElement");if(null==e||!t.contains(e))return null;let n=null;return e.classList.contains(ZK.section)?n=e:e.classList.contains(ZK.sectionContent)&&(n=e.parentElement),null==n?null:Number(n.dataset.sectionindex)}}));const v=r?.root??eq,b=yy({elementType:v,externalSlotProps:o?.root,externalForwardedProps:c,additionalProps:{ref:m,suppressContentEditableWarning:!0},className:u.root,ownerState:p});return Xp.jsx(v,f({},b,{children:b.contentEditable?i.map(({content:e,before:t,after:n})=>`${t.children}${e.children}${n.children}`).join(""):Xp.jsx(s.Fragment,{children:i.map((e,t)=>Xp.jsx(oq,{slots:r,slotProps:o,element:e,classes:u},t))})}))}),aq=s.createContext(null),lq=()=>{const e=s.useContext(aq);if(null==e)throw new Error(["MUI X: The `usePickerTextFieldOwnerState` can only be called in components that are used inside a PickerTextField component"].join("\n"));return e},sq=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef","onFocus","onBlur","classes","ownerState"],cq=pg("div",{name:"MuiPickersInputBase",slot:"Root"})(({theme:e})=>{return f({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:(t=.15/16,Math.round(1e5*t)/1e5)+"em",variants:[{props:{isInputInFullWidth:!0},style:{width:"100%"}}]});var t}),uq=pg(eq,{name:"MuiPickersInputBase",slot:"SectionsContainer"})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{fieldDirection:"rtl"},style:{justifyContent:"end"}},{props:{inputSize:"small"},style:{paddingTop:1}},{props:{hasStartAdornment:!1,isFieldFocused:!1,isFieldValueEmpty:!0},style:{color:"currentColor",opacity:0}},{props:{hasStartAdornment:!1,isFieldFocused:!1,isFieldValueEmpty:!0,inputHasLabel:!1},style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:"light"===e.palette.mode?.42:.5}},{props:{hasStartAdornment:!1,isFieldFocused:!1,isFieldValueEmpty:!0,inputHasLabel:!0,isLabelShrunk:!0},style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:"light"===e.palette.mode?.42:.5}}]})),dq=pg(tq,{name:"MuiPickersInputBase",slot:"Section"})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),pq=pg(rq,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),fq=pg(nq,{name:"MuiPickersInputBase",slot:"Separator"})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),hq=pg("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(f({},{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"})),mq=pg("div",{name:"MuiPickersInputBase",slot:"ActiveBar"})(({theme:e,ownerState:t})=>({display:"none",position:"absolute",height:2,bottom:2,borderTopLeftRadius:2,borderTopRightRadius:2,transition:e.transitions.create(["width","left"],{duration:e.transitions.duration.shortest}),backgroundColor:(e.vars||e).palette.primary.main,'[data-active-range-position="start"] &, [data-active-range-position="end"] &':{display:"block"},'[data-active-range-position="start"] &':{left:t.sectionOffsets[0]},'[data-active-range-position="end"] &':{left:t.sectionOffsets[1]}}));function gq(e,t,n,r){if(e.content.id){const e=t.current?.querySelectorAll(`[data-sectionindex="${n}"] [data-range-position="${r}"]`);if(e)return Array.from(e).reduce((e,t)=>e+t.offsetWidth,0)}return 0}const vq=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersInputBase"}),{elements:r,areAllSectionsEmpty:o,value:i,onChange:a,id:l,endAdornment:c,startAdornment:u,renderSuffix:p,slots:h,slotProps:m,contentEditable:g,tabIndex:v,onInput:b,onPaste:y,onKeyDown:w,name:x,readOnly:S,inputProps:C,inputRef:k,sectionListRef:E,onFocus:R,onBlur:P,classes:M,ownerState:T}=n,I=d(n,sq),O=lq(),D=s.useRef(null),F=s.useRef(null),L=s.useRef([]),A=Tg(t,D),N=Tg(C?.ref,k),$=Uy();if(!$)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const z=T??O,j=e=>{$.onFocus?.(e),R?.(e)};s.useEffect(()=>{$&&$.setAdornedStart(Boolean(u))},[$,u]),s.useEffect(()=>{$&&(o?$.onEmpty():$.onFilled())},[$,o]);const B=((e,t)=>{const{isFieldFocused:n,isFieldDisabled:r,isFieldReadOnly:o,hasFieldError:i,inputSize:a,isInputInFullWidth:l,inputColor:s,hasStartAdornment:c,hasEndAdornment:u}=t;return wm({root:["root",n&&!r&&"focused",r&&"disabled",o&&"readOnly",i&&"error",l&&"fullWidth",`color${xf(s)}`,"small"===a&&"inputSizeSmall",c&&"adornedStart",u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"],activeBar:["activeBar"]},YK,e)})(M,z),_=h?.root||cq,H=yy({elementType:_,externalSlotProps:m?.root,externalForwardedProps:I,additionalProps:{"aria-invalid":$.error,ref:A},className:B.root,ownerState:z}),V=h?.input||uq,W=r.some(e=>void 0!==e.content["data-range-position"]);return s.useEffect(()=>{if(!W||!z.isPickerOpen)return;const{activeBarWidth:e,sectionOffsets:t}=function(e,t){let n=0;const r=t.current?.getAttribute("data-active-range-position");if("end"===r)for(let r=e.length-1;r>=e.length/2;r-=1)n+=gq(e[r],t,r,"end");else for(let r=0;r<e.length/2;r+=1)n+=gq(e[r],t,r,"start");return{activeBarWidth:n,sectionOffsets:[t.current?.querySelector('[data-sectionindex="0"]')?.offsetLeft||0,t.current?.querySelector(`[data-sectionindex="${e.length/2}"]`)?.offsetLeft||0]}}(r,D);L.current=[t[0],t[1]],F.current&&(F.current.style.width=`${e}px`)},[r,W,z.isPickerOpen]),Xp.jsxs(_,f({},H,{children:[u,Xp.jsx(iq,{sectionListRef:E,elements:r,contentEditable:g,tabIndex:v,className:B.sectionsContainer,onFocus:j,onBlur:e=>{$.onBlur?.(e),P?.(e)},onInput:b,onPaste:y,onKeyDown:e=>{if(w?.(e),"Enter"===e.key&&!e.defaultMuiPrevented){if(D.current?.dataset.multiInput)return;const t=D.current?.closest("form"),n=t?.querySelector('[type="submit"]');if(!t||!n)return;e.preventDefault(),t.requestSubmit(n)}},slots:{root:V,section:dq,sectionContent:pq,sectionSeparator:fq},slotProps:{root:f({},m?.input,{ownerState:z}),sectionContent:{className:XK.sectionContent},sectionSeparator:({separatorPosition:e})=>({className:"before"===e?XK.sectionBefore:XK.sectionAfter})}}),c,p?p(f({},$)):null,Xp.jsx(hq,f({name:x,className:B.input,value:i,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:S,required:$.required,disabled:$.disabled,onFocus:e=>{j(e)}},C,{ref:N})),W&&Xp.jsx(mq,{className:B.activeBar,ref:F,ownerState:{sectionOffsets:L.current}})]}))});function bq(e){return Ph("MuiPickersOutlinedInput",e)}const yq=f({},XK,Mh("MuiPickersOutlinedInput",["root","notchedOutline","input"])),wq=["children","className","label","notched","shrink"],xq=pg("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline"})(({theme:e})=>{const t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),Sq=pg("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),Cq=pg("legend",{shouldForwardProp:e=>Oh(e)&&"notched"!==e})(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{inputHasLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{inputHasLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{inputHasLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function kq(e){const{className:t,label:n,notched:r}=e,o=d(e,wq),i=lq();return Xp.jsx(xq,f({"aria-hidden":!0,className:t},o,{ownerState:i,children:Xp.jsx(Cq,{ownerState:i,notched:r,children:n?Xp.jsx(Sq,{children:n}):Xp.jsx(Sq,{className:"notranslate",children:"​"})})}))}const Eq=["label","autoFocus","ownerState","classes","notched"],Rq=pg(cq,{name:"MuiPickersOutlinedInput",slot:"Root"})(({theme:e})=>{const t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${yq.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${yq.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${yq.focused} .${yq.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${yq.disabled}`]:{[`& .${yq.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${yq.error} .${yq.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t]?.main??!1).map(t=>({props:{inputColor:t},style:{[`&.${yq.focused}:not(.${yq.error}) .${yq.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}}))}}),Pq=pg(uq,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer"})({padding:"16.5px 0",variants:[{props:{inputSize:"small"},style:{padding:"8.5px 0"}}]}),Mq=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersOutlinedInput"}),{label:r,classes:o,notched:i}=n,a=d(n,Eq),l=Uy(),c=(e=>f({},e,wm({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},bq,e)))(o);return Xp.jsx(vq,f({slots:{root:Rq,input:Pq},renderSuffix:e=>Xp.jsx(kq,{shrink:Boolean(i||e.adornedStart||e.focused||e.filled),notched:Boolean(i||e.adornedStart||e.focused||e.filled),className:c.notchedOutline,label:null!=r&&""!==r&&l?.required?Xp.jsxs(s.Fragment,{children:[r," ","*"]}):r})},a,{label:r,classes:c,ref:t}))});function Tq(e){return Ph("MuiPickersFilledInput",e)}Mq.muiName="Input";const Iq=f({},XK,Mh("MuiPickersFilledInput",["root","underline","input"])),Oq=["label","autoFocus","disableUnderline","hiddenLabel","classes"],Dq=pg(cq,{name:"MuiPickersFilledInput",slot:"Root",shouldForwardProp:e=>Oh(e)&&"disableUnderline"!==e})(({theme:e})=>{const t="light"===e.palette.mode,n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${Iq.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${Iq.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{inputColor:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t]?.main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Iq.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Iq.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Iq.disabled}, .${Iq.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Iq.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:{hasStartAdornment:!0},style:{paddingLeft:12}},{props:{hasEndAdornment:!0},style:{paddingRight:12}}]}}),Fq=pg(uq,{name:"MuiPickersFilledInput",slot:"sectionsContainer",shouldForwardProp:e=>Oh(e)&&"hiddenLabel"!==e})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{inputSize:"small"},style:{paddingTop:21,paddingBottom:4}},{props:{hasStartAdornment:!0},style:{paddingLeft:0}},{props:{hasEndAdornment:!0},style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,inputSize:"small"},style:{paddingTop:8,paddingBottom:9}}]}),Lq=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersFilledInput"}),{label:r,disableUnderline:o=!1,hiddenLabel:i=!1,classes:a}=n,l=d(n,Oq),s=f({},lq(),{inputHasUnderline:!o}),c=((e,t)=>{const{inputHasUnderline:n}=t;return f({},e,wm({root:["root",n&&"underline"],input:["input"]},Tq,e))})(a,s);return Xp.jsx(vq,f({slots:{root:Dq,input:Fq},slotProps:{root:{disableUnderline:o},input:{hiddenLabel:i}}},l,{label:r,classes:c,ref:t,ownerState:s}))});function Aq(e){return Ph("MuiPickersFilledInput",e)}Lq.muiName="Input";const Nq=f({},XK,Mh("MuiPickersInput",["root","underline","input"])),$q=["label","autoFocus","disableUnderline","ownerState","classes"],zq=pg(cq,{name:"MuiPickersInput",slot:"Root",shouldForwardProp:e=>Oh(e)&&"disableUnderline"!==e})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{inputColor:t,inputHasUnderline:!0},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].main}`}}})),{props:{inputHasUnderline:!0},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Nq.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Nq.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Nq.disabled}, .${Nq.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${Nq.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),jq=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersInput"}),{label:r,disableUnderline:o=!1,classes:i}=n,a=d(n,$q),l=f({},lq(),{inputHasUnderline:!o}),s=((e,t)=>{const{inputHasUnderline:n}=t;return f({},e,wm({root:["root",!n&&"underline"],input:["input"]},Aq,e))})(i,l);return Xp.jsx(vq,f({slots:{root:zq},slotProps:{root:{disableUnderline:o}}},a,{ownerState:l,label:r,classes:s,ref:t}))});jq.muiName="Input";const Bq=["onFocus","onBlur","className","classes","color","disabled","error","variant","required","hiddenLabel","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps","data-active-range-position"],_q={standard:jq,filled:Lq,outlined:Mq},Hq=pg(sS,{name:"MuiPickersTextField",slot:"Root"})({maxWidth:"100%"}),Vq=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersTextField"}),{onFocus:r,onBlur:o,className:i,classes:a,color:l="primary",disabled:c=!1,error:u=!1,variant:p="outlined",required:h=!1,hiddenLabel:m=!1,InputProps:g,inputProps:v,inputRef:b,sectionListRef:y,elements:w,areAllSectionsEmpty:x,onClick:S,onKeyDown:C,onKeyUp:k,onPaste:E,onInput:R,endAdornment:P,startAdornment:M,tabIndex:T,contentEditable:I,focused:O,value:D,onChange:F,fullWidth:L,id:A,name:N,helperText:$,FormHelperTextProps:z,label:j,InputLabelProps:B,"data-active-range-position":_}=n,H=d(n,Bq),V=Tg(t,s.useRef(null)),W=mm(A),U=$&&W?`${W}-helper-text`:void 0,G=j&&W?`${W}-label`:void 0,K=HK({disabled:n.disabled,required:n.required,readOnly:g?.readOnly}),q=s.useMemo(()=>f({},K,{isFieldValueEmpty:x,isFieldFocused:O??!1,hasFieldError:u??!1,inputSize:n.size??"medium",inputColor:l??"primary",isInputInFullWidth:L??!1,hasStartAdornment:Boolean(M??g?.startAdornment),hasEndAdornment:Boolean(P??g?.endAdornment),inputHasLabel:!!j,isLabelShrunk:Boolean(B?.shrink)}),[K,x,O,u,n.size,l,L,M,P,g?.startAdornment,g?.endAdornment,j,B?.shrink]),Y=((e,t)=>{const{isFieldFocused:n,isFieldDisabled:r,isFieldRequired:o}=t;return wm({root:["root",n&&!r&&"focused",r&&"disabled",o&&"required"]},qK,e)})(a,q),X=_q[p],Q={};return"outlined"===p?(B&&void 0!==B.shrink&&(Q.notched=B.shrink),Q.label=j):"filled"===p&&(Q.hiddenLabel=m),Xp.jsx(aq.Provider,{value:q,children:Xp.jsxs(Hq,f({className:QU(Y.root,i),ref:V,focused:O,disabled:c,variant:p,error:u,color:l,fullWidth:L,required:h,ownerState:q},H,{children:[null!=j&&""!==j&&Xp.jsx(zS,f({htmlFor:W,id:G},B,{children:j})),Xp.jsx(X,f({elements:w,areAllSectionsEmpty:x,onClick:S,onKeyDown:C,onKeyUp:k,onInput:R,onPaste:E,onFocus:r,onBlur:o,endAdornment:P,startAdornment:M,tabIndex:T,contentEditable:I,value:D,onChange:F,id:W,fullWidth:L,inputProps:v,inputRef:b,sectionListRef:y,label:j,name:N,role:"group","aria-labelledby":G,"aria-describedby":U,"aria-live":U?"polite":void 0,"data-active-range-position":_},Q,g)),$&&Xp.jsx(bS,f({id:U},z,{children:$}))]}))})}),Wq=["enableAccessibleFieldDOMStructure"],Uq=["InputProps","readOnly","onClear","clearable","clearButtonPosition","openPickerButtonPosition","openPickerAriaLabel"],Gq=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef","onClear","clearable","clearButtonPosition","openPickerButtonPosition","openPickerAriaLabel"],Kq=["ownerState"],qq=["ownerState"],Yq=["ownerState"],Xq=["ownerState"],Qq=["InputProps","inputProps"],Zq=()=>{},Jq=s.createContext({slots:{},slotProps:{},inputRef:void 0});function eY(e){const{fieldResponse:t,defaultOpenPickerIcon:n}=e,r=vG(),o=MG(),i=s.useContext(Jq),{textFieldProps:a,onClear:l,clearable:c,openPickerAriaLabel:u,clearButtonPosition:p="end",openPickerButtonPosition:h="end"}=(e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=d(e,Wq);if(t){const{InputProps:e,readOnly:t,onClear:r,clearable:o,clearButtonPosition:i,openPickerButtonPosition:a,openPickerAriaLabel:l}=n,s=d(n,Uq),c=rR>=6&&s?.slotProps?.input?tY(s?.slotProps?.input,e):Zq;return{clearable:o,onClear:r,clearButtonPosition:i,openPickerButtonPosition:a,openPickerAriaLabel:l,textFieldProps:f({},s,rR>=6&&s?.slotProps?.input?{slotProps:f({},s?.slotProps,{input:e=>f({},_g(c,e),{readOnly:t})})}:{InputProps:f({},e??{},{readOnly:t})})}}const{onPaste:r,onKeyDown:o,inputMode:i,readOnly:a,InputProps:l,inputProps:s,inputRef:c,onClear:u,clearable:p,clearButtonPosition:h,openPickerButtonPosition:m,openPickerAriaLabel:g}=n,v=d(n,Gq),b=rR>=6&&v?.slotProps?.input?tY(v?.slotProps?.input,l):Zq,y=rR>=6&&v?.slotProps?.htmlInput?tY(v?.slotProps?.htmlInput,s):Zq;return{clearable:p,onClear:u,clearButtonPosition:h,openPickerButtonPosition:m,openPickerAriaLabel:g,textFieldProps:f({},v,rR>=6&&(v?.slotProps?.input||v?.slotProps?.htmlInput)?{slotProps:f({},v?.slotProps,{input:e=>f({},_g(b,e),{readOnly:a}),htmlInput:e=>f({},_g(y,e),{inputMode:i,onPaste:r,onKeyDown:o,ref:c})})}:{InputProps:f({},l??{},{readOnly:a}),inputProps:f({},s??{},{inputMode:i,onPaste:r,onKeyDown:o,ref:c})})}})(t),m=HK(a),g=Mg(e=>{e.preventDefault(),o?.setOpen(e=>!e)}),v=o?o.triggerStatus:"hidden",b=c?p:null,y="hidden"!==v?h:null,w=i.slots.textField??(!1===t.enableAccessibleFieldDOMStructure?qE:Vq),x=i.slots.inputAdornment??AS,S=d(yy({elementType:x,externalSlotProps:i.slotProps.inputAdornment,additionalProps:{position:"start"},ownerState:f({},m,{position:"start"})}),Kq),C=d(yy({elementType:x,externalSlotProps:i.slotProps.inputAdornment,additionalProps:{position:"end"},ownerState:f({},m,{position:"end"})}),qq),k=i.slots.openPickerButton??Mv,E=d(yy({elementType:k,externalSlotProps:i.slotProps.openPickerButton,additionalProps:{disabled:"disabled"===v,onClick:g,"aria-label":u,edge:"standard"!==a.variant&&y},ownerState:m}),Yq),R=i.slots.openPickerIcon??n,P=yy({elementType:R,externalSlotProps:i.slotProps.openPickerIcon,ownerState:m}),M=i.slots.clearButton??Mv,T=d(yy({elementType:M,externalSlotProps:i.slotProps.clearButton,className:"clearButton",additionalProps:{title:r.fieldClearLabel,tabIndex:-1,onClick:l,disabled:t.disabled||t.readOnly,edge:"standard"!==a.variant&&b!==y&&b},ownerState:m}),Xq),I=i.slots.clearIcon??KK,O=yy({elementType:I,externalSlotProps:i.slotProps.clearIcon,additionalProps:{fontSize:"small"},ownerState:m});a.ref=Tg(a.ref,o?.rootRef);const D={},F=_g((rR>=6&&a?.slotProps?.input)??a.InputProps,m);o&&(D.ref=o.triggerRef),F?.startAdornment||"start"!==b&&"start"!==y||(D.startAdornment=Xp.jsxs(x,f({},S,{children:["start"===y&&Xp.jsx(k,f({},E,{children:Xp.jsx(R,f({},P))})),"start"===b&&Xp.jsx(M,f({},T,{children:Xp.jsx(I,f({},O))}))]}))),F?.endAdornment||"end"!==b&&"end"!==y||(D.endAdornment=Xp.jsxs(x,f({},C,{children:["end"===b&&Xp.jsx(M,f({},T,{children:Xp.jsx(I,f({},O))})),"end"===y&&Xp.jsx(k,f({},E,{children:Xp.jsx(R,f({},P))}))]}))),D?.endAdornment||D?.startAdornment||!i.slots.inputAdornment||(D.endAdornment=Xp.jsx(x,f({},C))),null!=b&&(a.sx=[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(a.sx)?a.sx:[a.sx]]);const L=rR>=6&&a?.slotProps?.input?_g(tY(F,D),m):f({},F,D);return a.inputProps=rR>=6&&a?.slotProps?.htmlInput?_g(a.slotProps.htmlInput,m):a.inputProps,delete a?.slotProps?.input,t.enableAccessibleFieldDOMStructure&&delete a?.slotProps,Xp.jsx(w,f({},a,{InputProps:L}))}function tY(e,t){return e?t?n=>f({},_g(t,n),_g(e,n)):e:t}function nY(e){const{slots:t={},slotProps:n={},inputRef:r,children:o}=e,i=s.useMemo(()=>({inputRef:r,slots:{openPickerButton:t.openPickerButton,openPickerIcon:t.openPickerIcon,textField:t.textField,inputAdornment:t.inputAdornment,clearIcon:t.clearIcon,clearButton:t.clearButton},slotProps:{openPickerButton:n.openPickerButton,openPickerIcon:n.openPickerIcon,textField:n.textField,inputAdornment:n.inputAdornment,clearIcon:n.clearIcon,clearButton:n.clearButton}}),[r,t.openPickerButton,t.openPickerIcon,t.textField,t.inputAdornment,t.clearIcon,t.clearButton,n.openPickerButton,n.openPickerIcon,n.textField,n.inputAdornment,n.clearIcon,n.clearButton]);return Xp.jsx(Jq.Provider,{value:i,children:o})}const rY=["slots","slotProps"],oY=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiDateField"}),{slots:r,slotProps:o}=n,i=d(n,rY),a=function(e){const{ref:t,externalForwardedProps:n,slotProps:r}=e,o=s.useContext(Jq),i=MG(),a=HK(n),{InputProps:l,inputProps:c}=n,u=d(n,Qq),p=yy({elementType:Vq,externalSlotProps:tY(o.slotProps.textField,r?.textField),externalForwardedProps:u,additionalProps:{ref:t,sx:i?.rootSx,label:i?.label,name:i?.name,className:i?.rootClassName,inputRef:o.inputRef},ownerState:a});return p.inputProps=f({},c,p.inputProps),p.InputProps=f({},l,p.InputProps),p}({slotProps:o,ref:t,externalForwardedProps:i}),l=_K(a);return Xp.jsx(nY,{slots:r,slotProps:o,inputRef:i.inputRef,children:Xp.jsx(eY,{fieldResponse:l,defaultOpenPickerIcon:GK})})}),iY=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:a,timezone:l})=>{const c=gG();return s.useCallback(s=>null!==LG({adapter:c,value:s,timezone:l,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:a}}),[c,e,t,n,r,o,i,a,l])},aY=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:o,maxDate:i,minDate:a,onMonthChange:l,onYearChange:c,reduceAnimations:u,shouldDisableDate:d,timezone:p,getCurrentMonthFromVisibleDate:h}=e,m=gG(),g=s.useRef(((e,t)=>(n,r)=>{switch(r.type){case"setVisibleDate":return f({},n,{slideDirection:r.direction,currentMonth:r.month,isMonthSwitchingAnimating:!t.isSameMonth(r.month,n.currentMonth)&&!e&&!r.skipAnimation,focusedDay:r.focusedDay});case"changeMonthTimezone":{const e=r.newTimezone;if(t.getTimezone(n.currentMonth)===e)return n;let o=t.setTimezone(n.currentMonth,e);return t.getMonth(o)!==t.getMonth(n.currentMonth)&&(o=t.setMonth(o,t.getMonth(n.currentMonth))),f({},n,{currentMonth:o})}case"finishMonthSwitchingAnimation":return f({},n,{isMonthSwitchingAnimating:!1});default:throw new Error("missing support")}})(Boolean(u),m)).current,v=s.useMemo(()=>qU.getInitialReferenceValue({value:t,adapter:m,timezone:p,props:e,referenceDate:n,granularity:MU.day}),[n,p]),[b,y]=s.useReducer(g,{isMonthSwitchingAnimating:!1,focusedDay:v,currentMonth:m.startOfMonth(v),slideDirection:"left"}),w=iY({shouldDisableDate:d,minDate:a,maxDate:i,disableFuture:r,disablePast:o,timezone:p});s.useEffect(()=>{y({type:"changeMonthTimezone",newTimezone:m.getTimezone(v)})},[v,m]);const x=Mg(({target:e,reason:t})=>{if("cell-interaction"===t&&null!=b.focusedDay&&m.isSameDay(e,b.focusedDay))return;const n="cell-interaction"===t;let s,u;if("cell-interaction"===t)s=h(e,b.currentMonth),u=e;else if(s=m.isSameMonth(e,b.currentMonth)?b.currentMonth:m.startOfMonth(e),u=e,w(u)){const t=m.startOfMonth(e),n=m.endOfMonth(e);u=bU({adapter:m,date:u,minDate:m.isBefore(a,t)?t:a,maxDate:m.isAfter(i,n)?n:i,disablePast:o,disableFuture:r,isDateDisabled:w,timezone:p})}const d=!m.isSameMonth(b.currentMonth,s),f=!m.isSameYear(b.currentMonth,s);d&&l?.(s),f&&c?.(m.startOfYear(s)),y({type:"setVisibleDate",month:s,direction:m.isAfterDay(s,b.currentMonth)?"left":"right",focusedDay:null!=b.focusedDay&&null!=u&&m.isSameDay(u,b.focusedDay)?b.focusedDay:u,skipAnimation:n})}),S=s.useCallback(()=>{y({type:"finishMonthSwitchingAnimation"})},[]);return{referenceDate:v,calendarState:b,setVisibleDate:x,isDateDisabled:w,onMonthSwitchingAnimationEnd:S}},lY=e=>Ph("MuiPickersFadeTransitionGroup",e);Mh("MuiPickersFadeTransitionGroup",["root"]);const sY=["children"],cY=pg(Zo,{name:"MuiPickersFadeTransitionGroup",slot:"Root"})({display:"block",position:"relative"});function uY(e){const t=cg({props:e,name:"MuiPickersFadeTransitionGroup"}),{className:n,reduceAnimations:r,transKey:o,classes:i}=t,{children:a}=t,l=d(t,sY),s=(e=>wm({root:["root"]},lY,e))(i),c=sg();return r?a:Xp.jsx(cY,{className:QU(s.root,n),ownerState:l,children:Xp.jsx(Pw,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:c.transitions.duration.enteringScreen,enter:c.transitions.duration.enteringScreen,exit:0},children:a},o)})}function dY(e){return Ph("MuiPickersDay",e)}const pY=Mh("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]);function fY(e){const{disabled:t,selected:n,today:r,outsideCurrentMonth:o,day:i,disableMargin:a,disableHighlightToday:l,showDaysOutsideCurrentMonth:c}=e,u=gG(),{ownerState:d}=lG();return s.useMemo(()=>f({},d,{day:i,isDaySelected:n??!1,isDayDisabled:t??!1,isDayCurrent:r??!1,isDayOutsideMonth:o??!1,isDayStartOfWeek:u.isSameDay(i,u.startOfWeek(i)),isDayEndOfWeek:u.isSameDay(i,u.endOfWeek(i)),disableMargin:a??!1,disableHighlightToday:l??!1,showDaysOutsideCurrentMonth:c??!1}),[u,d,i,n,t,r,o,a,l,c])}const hY=["autoFocus","className","classes","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","children","isFirstVisibleCell","isLastVisibleCell","day","selected","disabled","today","outsideCurrentMonth","disableMargin","disableHighlightToday","showDaysOutsideCurrentMonth"],mY=({theme:e})=>f({},e.typography.caption,{width:36,height:36,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:tm(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:tm(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${pY.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${pY.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${pY.disabled}:not(.${pY.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${pY.disabled}&.${pY.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:"0 2px"}},{props:{isDayOutsideMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,isDayCurrent:!0},style:{[`&:not(.${pY.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),gY=(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.isDayCurrent&&t.today,!n.isDayOutsideMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.isDayOutsideMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},vY=pg(sv,{name:"MuiPickersDay",slot:"Root",overridesResolver:gY})(mY),bY=pg("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:gY})(({theme:e})=>f({},mY({theme:e}),{opacity:0,pointerEvents:"none"})),yY=()=>{},wY=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiPickersDay"}),{autoFocus:r=!1,className:o,classes:i,isAnimating:a,onClick:l,onDaySelect:c,onFocus:u=yY,onBlur:p=yY,onKeyDown:h=yY,onMouseDown:m=yY,onMouseEnter:g=yY,children:v,day:b,selected:y,disabled:w,today:x,outsideCurrentMonth:S,disableMargin:C,disableHighlightToday:k,showDaysOutsideCurrentMonth:E}=n,R=d(n,hY),P=fY({day:b,selected:y,disabled:w,today:x,outsideCurrentMonth:S,disableMargin:C,disableHighlightToday:k,showDaysOutsideCurrentMonth:E}),M=((e,t)=>{const{isDaySelected:n,isDayDisabled:r,isDayCurrent:o,isDayOutsideMonth:i,disableMargin:a,disableHighlightToday:l,showDaysOutsideCurrentMonth:s}=t,c=i&&!s;return wm({root:["root",n&&!c&&"selected",r&&"disabled",!a&&"dayWithMargin",!l&&o&&"today",i&&s&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},dY,e)})(i,P),T=gG(),I=s.useRef(null),O=Tg(I,t);Wh(()=>{!r||w||a||S||I.current.focus()},[r,w,a,S]);return S&&!E?Xp.jsx(bY,{className:QU(M.root,M.hiddenDaySpacingFiller,o),ownerState:P,role:R.role}):Xp.jsx(vY,f({className:QU(M.root,o),ref:O,centerRipple:!0,disabled:w,tabIndex:y?0:-1,onKeyDown:e=>h(e,b),onFocus:e=>u(e,b),onBlur:e=>p(e,b),onMouseEnter:e=>g(e,b),onClick:e=>{e.defaultMuiPrevented=!0,w||c(b),S&&e.currentTarget.focus(),l&&l(e)},onMouseDown:e=>{m(e),S&&e.preventDefault()}},R,{ownerState:P,children:v??T.format(b,"dayOfMonth")}))}),xY=s.memo(wY),SY=e=>Ph("MuiPickersSlideTransition",e),CY=Mh("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),kY=["children","className","reduceAnimations","slideDirection","transKey","classes"],EY=pg(Zo,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${CY["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${CY["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${CY.slideEnterActive}`]:t.slideEnterActive},{[`.${CY.slideExit}`]:t.slideExit},{[`.${CY["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${CY["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{const t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${CY["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${CY["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${CY.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${CY.slideExit}`]:{transform:"translate(0%)"},[`& .${CY["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${CY["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});const RY=e=>Ph("MuiDayCalendar",e);Mh("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const PY=["parentProps","day","focusedDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],MY=["ownerState"],TY=pg("div",{name:"MuiDayCalendar",slot:"Root"})({}),IY=pg("div",{name:"MuiDayCalendar",slot:"Header"})({display:"flex",justifyContent:"center",alignItems:"center"}),OY=pg(Gv,{name:"MuiDayCalendar",slot:"WeekDayLabel"})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),DY=pg(Gv,{name:"MuiDayCalendar",slot:"WeekNumberLabel"})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.disabled})),FY=pg(Gv,{name:"MuiDayCalendar",slot:"WeekNumber"})(({theme:e})=>f({},e.typography.caption,{width:36,height:36,padding:0,margin:"0 2px",color:(e.vars||e).palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),LY=pg("div",{name:"MuiDayCalendar",slot:"LoadingContainer"})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:240}),AY=pg(function(e){const t=cg({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,slideDirection:i,transKey:a,classes:l}=t,c=d(t,kY),{ownerState:u}=lG(),p=f({},u,{slideDirection:i}),h=((e,t)=>{const{slideDirection:n}=t;return wm({root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]},SY,e)})(l,p),m=sg();if(o)return Xp.jsx("div",{className:QU(h.root,r),children:n});const g={exit:h.exit,enterActive:h.enterActive,enter:h.enter,exitActive:h.exitActive};return Xp.jsx(EY,{className:QU(h.root,r),childFactory:e=>s.cloneElement(e,{classNames:g}),role:"presentation",ownerState:p,children:Xp.jsx(Ko,f({mountOnEnter:!0,unmountOnExit:!0,timeout:m.transitions.duration.complex,classNames:g},c,{children:n}),a)})},{name:"MuiDayCalendar",slot:"SlideTransition"})({minHeight:240}),NY=pg("div",{name:"MuiDayCalendar",slot:"MonthContainer"})({overflow:"hidden"}),$Y=pg("div",{name:"MuiDayCalendar",slot:"WeekContainer"})({margin:"2px 0",display:"flex",justifyContent:"center"});function zY(e){let{parentProps:t,day:n,focusedDay:r,selectedDays:o,isDateDisabled:i,currentMonthNumber:a,isViewFocused:l}=e,c=d(e,PY);const{disabled:u,disableHighlightToday:p,isMonthSwitchingAnimating:h,showDaysOutsideCurrentMonth:m,slots:g,slotProps:v,timezone:b}=t,y=gG(),w=NG(b),x=null!=r&&y.isSameDay(n,r),S=l&&x,C=o.some(e=>y.isSameDay(e,n)),k=y.isSameDay(n,w),E=s.useMemo(()=>u||i(n),[u,i,n]),R=s.useMemo(()=>y.getMonth(n)!==a,[y,n,a]),P=fY({day:n,selected:C,disabled:E,today:k,outsideCurrentMonth:R,disableMargin:void 0,disableHighlightToday:p,showDaysOutsideCurrentMonth:m}),M=g?.day??xY,T=d(yy({elementType:M,externalSlotProps:v?.day,additionalProps:f({disableHighlightToday:p,showDaysOutsideCurrentMonth:m,role:"gridcell",isAnimating:h,"data-timestamp":y.toJsDate(n).valueOf()},c),ownerState:f({},P,{day:n,isDayDisabled:E,isDaySelected:C})}),MY),I=s.useMemo(()=>{const e=y.startOfMonth(y.setMonth(n,a));return m?y.isSameDay(n,y.startOfWeek(e)):y.isSameDay(n,e)},[a,n,m,y]),O=s.useMemo(()=>{const e=y.endOfMonth(y.setMonth(n,a));return m?y.isSameDay(n,y.endOfWeek(e)):y.isSameDay(n,e)},[a,n,m,y]);return Xp.jsx(M,f({},T,{day:n,disabled:E,autoFocus:!R&&S,today:k,outsideCurrentMonth:R,isFirstVisibleCell:I,isLastVisibleCell:O,selected:C,tabIndex:x?0:-1,"aria-selected":C,"aria-current":k?"date":void 0}))}function jY(e){const t=cg({props:e,name:"MuiDayCalendar"}),n=gG(),{onFocusedDayChange:r,className:o,classes:i,currentMonth:a,selectedDays:l,focusedDay:c,loading:u,onSelectedDaysChange:d,onMonthSwitchingAnimationEnd:p,readOnly:h,reduceAnimations:m,renderLoading:g=()=>Xp.jsx("span",{children:"..."}),slideDirection:v,TransitionProps:b,disablePast:y,disableFuture:w,minDate:x,maxDate:S,shouldDisableDate:C,shouldDisableMonth:k,shouldDisableYear:E,dayOfWeekFormatter:R=e=>n.format(e,"weekdayShort").charAt(0).toUpperCase(),hasFocus:P,onFocusedViewChange:M,gridLabelId:T,displayWeekNumber:I,fixedWeekNumber:O,timezone:D}=t,F=NG(D),L=(e=>wm({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},RY,e))(i),A=um(),N=iY({shouldDisableDate:C,shouldDisableMonth:k,shouldDisableYear:E,minDate:x,maxDate:S,disablePast:y,disableFuture:w,timezone:D}),$=vG(),z=Mg(e=>{h||d(e)}),j=e=>{N(e)||(r(e),M?.(!0))},B=Mg((e,t)=>{switch(e.key){case"ArrowUp":j(n.addDays(t,-7)),e.preventDefault();break;case"ArrowDown":j(n.addDays(t,7)),e.preventDefault();break;case"ArrowLeft":{const r=n.addDays(t,A?1:-1),o=n.addMonths(t,A?1:-1),i=bU({adapter:n,date:r,minDate:A?r:n.startOfMonth(o),maxDate:A?n.endOfMonth(o):r,isDateDisabled:N,timezone:D});j(i||r),e.preventDefault();break}case"ArrowRight":{const r=n.addDays(t,A?-1:1),o=n.addMonths(t,A?-1:1),i=bU({adapter:n,date:r,minDate:A?n.startOfMonth(o):r,maxDate:A?r:n.endOfMonth(o),isDateDisabled:N,timezone:D});j(i||r),e.preventDefault();break}case"Home":j(n.startOfWeek(t)),e.preventDefault();break;case"End":j(n.endOfWeek(t)),e.preventDefault();break;case"PageUp":j(n.addMonths(t,1)),e.preventDefault();break;case"PageDown":j(n.addMonths(t,-1)),e.preventDefault()}}),_=Mg((e,t)=>j(t)),H=Mg((e,t)=>{null!=c&&n.isSameDay(c,t)&&M?.(!1)}),V=n.getMonth(a),W=n.getYear(a),U=s.useMemo(()=>l.filter(e=>!!e).map(e=>n.startOfDay(e)),[n,l]),G=`${W}-${V}`,K=s.useMemo(()=>s.createRef(),[G]),q=s.useMemo(()=>{const e=n.getWeekArray(a);let t=n.addMonths(a,1);for(;O&&e.length<O;){const r=n.getWeekArray(t),o=n.isSameDay(e[e.length-1][0],r[0][0]);r.slice(o?1:0).forEach(t=>{e.length<O&&e.push(t)}),t=n.addMonths(t,1)}return e},[a,O,n]);return Xp.jsxs(TY,{role:"grid","aria-labelledby":T,className:L.root,children:[Xp.jsxs(IY,{role:"row",className:L.header,children:[I&&Xp.jsx(DY,{variant:"caption",role:"columnheader","aria-label":$.calendarWeekNumberHeaderLabel,className:L.weekNumberLabel,children:$.calendarWeekNumberHeaderText}),EU(n,F).map((e,t)=>Xp.jsx(OY,{variant:"caption",role:"columnheader","aria-label":n.format(e,"weekday"),className:L.weekDayLabel,children:R(e)},t.toString()))]}),u?Xp.jsx(LY,{className:L.loadingContainer,children:g()}):Xp.jsx(AY,f({transKey:G,onExited:p,reduceAnimations:m,slideDirection:v,className:QU(o,L.slideTransition)},b,{nodeRef:K,children:Xp.jsx(NY,{ref:K,role:"rowgroup",className:L.monthContainer,children:q.map((e,r)=>Xp.jsxs($Y,{role:"row",className:L.weekContainer,"aria-rowindex":r+1,children:[I&&Xp.jsx(FY,{className:L.weekNumber,role:"rowheader","aria-label":$.calendarWeekNumberAriaLabelText(n.getWeekNumber(e[0])),children:$.calendarWeekNumberText(n.getWeekNumber(e[0]))}),e.map((e,n)=>Xp.jsx(zY,{parentProps:t,day:e,selectedDays:U,isViewFocused:P,focusedDay:c,onKeyDown:B,onFocus:_,onBlur:H,onDaySelect:z,isDateDisabled:N,currentMonthNumber:V,"aria-colindex":n+1},e.toString()))]},`week-${e[0]}`))})}))]})}function BY(e){return Ph("MuiMonthCalendar",e)}const _Y=Mh("MuiMonthCalendar",["root","button","disabled","selected"]),HY=["autoFocus","classes","disabled","selected","value","onClick","onKeyDown","onFocus","onBlur","slots","slotProps"],VY=pg("button",{name:"MuiMonthCalendar",slot:"Button",overridesResolver:(e,t)=>[t.button,{[`&.${_Y.disabled}`]:t.disabled},{[`&.${_Y.selected}`]:t.selected}]})(({theme:e})=>f({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:tm(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:tm(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${_Y.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${_Y.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),WY=s.memo(function(e){const{autoFocus:t,classes:n,disabled:r,selected:o,value:i,onClick:a,onKeyDown:l,onFocus:c,onBlur:u,slots:p,slotProps:h}=e,m=d(e,HY),g=s.useRef(null),{ownerState:v}=lG(),b=f({},v,{isMonthDisabled:r,isMonthSelected:o}),y=((e,t)=>wm({button:["button",t.isMonthDisabled&&"disabled",t.isMonthSelected&&"selected"]},BY,e))(n,b);Wh(()=>{t&&g.current?.focus()},[t]);const w=p?.monthButton??VY,x=yy({elementType:w,externalSlotProps:h?.monthButton,externalForwardedProps:m,additionalProps:{disabled:r,ref:g,type:"button",role:"radio","aria-checked":o,onClick:e=>a(e,i),onKeyDown:e=>l(e,i),onFocus:e=>c(e,i),onBlur:e=>u(e,i)},ownerState:b,className:y.button});return Xp.jsx(w,f({},x))}),UY=["autoFocus","className","currentMonth","classes","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"];const GY=(e,t,n,r,o)=>Boolean(e===t&&r&&o.isSameYear(n,r)),KY=pg("div",{name:"MuiMonthCalendar",slot:"Root",shouldForwardProp:e=>Oh(e)&&"monthsPerRow"!==e})({display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",rowGap:16,padding:"8px 0",width:hK,boxSizing:"border-box",variants:[{props:{monthsPerRow:3},style:{columnGap:24}},{props:{monthsPerRow:4},style:{columnGap:0}}]}),qY=s.forwardRef(function(e,t){const n=function(e,t){const n=cg({props:e,name:t});return f({},n,jG(n),{monthsPerRow:n.monthsPerRow??3})}(e,"MuiMonthCalendar"),{autoFocus:r,className:o,currentMonth:i,classes:a,value:l,defaultValue:c,referenceDate:u,disabled:p,disableFuture:h,disablePast:m,maxDate:g,minDate:v,onChange:b,shouldDisableMonth:y,readOnly:w,onMonthFocus:x,hasFocus:S,onFocusedViewChange:C,monthsPerRow:k,timezone:E,gridLabelId:R,slots:P,slotProps:M}=n,T=d(n,UY),{value:I,handleValueChange:O,timezone:D}=iK({name:"MonthCalendar",timezone:E,value:l,defaultValue:c,referenceDate:u,onChange:b,valueManager:qU}),F=NG(D),L=um(),A=gG(),{ownerState:N}=lG(),$=s.useMemo(()=>qU.getInitialReferenceValue({value:I,adapter:A,props:n,timezone:D,referenceDate:u,granularity:MU.month}),[]),z=(e=>wm({root:["root"]},BY,e))(a),j=s.useMemo(()=>A.getMonth(F),[A,F]),B=s.useMemo(()=>null!=I?A.getMonth(I):null,[I,A]),[_,H]=s.useState(()=>B||A.getMonth($)),[V,W]=Pg({name:"MonthCalendar",state:"hasFocus",controlled:S,default:r??!1}),U=Mg(e=>{W(e),C&&C(e)}),G=s.useCallback(e=>{const t=A.startOfMonth(m&&A.isAfter(F,v)?F:v),n=A.startOfMonth(h&&A.isBefore(F,g)?F:g),r=A.startOfMonth(e);return!!A.isBefore(r,t)||(!!A.isAfter(r,n)||!!y&&y(r))},[h,m,g,v,F,y,A]),K=Mg((e,t)=>{if(w)return;const n=I&&i&&!A.isSameYear(I,i)?A.setYear(I,A.getYear(i)):I,r=A.setMonth(n??$,t);O(r)}),q=Mg(e=>{G(A.setMonth(I??i??$,e))||(H(e),U(!0),x&&x(e))});s.useEffect(()=>{H(e=>null!==B&&e!==B?B:e)},[B]);const Y=Mg((e,t)=>{const n=12;switch(e.key){case"ArrowUp":q((n+t-3)%n),e.preventDefault();break;case"ArrowDown":q((n+t+3)%n),e.preventDefault();break;case"ArrowLeft":q((n+t+(L?1:-1))%n),e.preventDefault();break;case"ArrowRight":q((n+t+(L?-1:1))%n),e.preventDefault()}}),X=Mg((e,t)=>{q(t)}),Q=Mg((e,t)=>{_===t&&U(!1)});return Xp.jsx(KY,f({ref:t,className:QU(z.root,o),ownerState:N,role:"radiogroup","aria-labelledby":R,monthsPerRow:k},T,{children:wU(A,i??I??$).map(e=>{const t=A.getMonth(e),n=A.format(e,"monthShort"),r=A.format(e,"month"),o=GY(t,B,e,I,A),i=p||G(e);return Xp.jsx(WY,{selected:o,value:t,onClick:K,onKeyDown:Y,autoFocus:V&&t===_,disabled:i,tabIndex:t!==_||i?-1:0,onFocus:X,onBlur:Q,"aria-current":GY(t,j,e,F,A)?"date":void 0,"aria-label":r,slots:P,slotProps:M,classes:a,children:n},n)})}))});function YY(e){return Ph("MuiYearCalendar",e)}const XY=Mh("MuiYearCalendar",["root","button","disabled","selected"]),QY=["autoFocus","classes","disabled","selected","value","onClick","onKeyDown","onFocus","onBlur","slots","slotProps"],ZY=pg("button",{name:"MuiYearCalendar",slot:"Button",overridesResolver:(e,t)=>[t.button,{[`&.${XY.disabled}`]:t.disabled},{[`&.${XY.selected}`]:t.selected}]})(({theme:e})=>f({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:tm(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:tm(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${XY.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${XY.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),JY=s.memo(function(e){const{autoFocus:t,classes:n,disabled:r,selected:o,value:i,onClick:a,onKeyDown:l,onFocus:c,onBlur:u,slots:p,slotProps:h}=e,m=d(e,QY),g=s.useRef(null),{ownerState:v}=lG(),b=f({},v,{isYearDisabled:r,isYearSelected:o}),y=((e,t)=>wm({button:["button",t.isYearDisabled&&"disabled",t.isYearSelected&&"selected"]},YY,e))(n,b);Wh(()=>{t&&g.current?.focus()},[t]);const w=p?.yearButton??ZY,x=yy({elementType:w,externalSlotProps:h?.yearButton,externalForwardedProps:m,additionalProps:{disabled:r,ref:g,type:"button",role:"radio","aria-checked":o,onClick:e=>a(e,i),onKeyDown:e=>l(e,i),onFocus:e=>c(e,i),onBlur:e=>u(e,i)},ownerState:b,className:y.button});return Xp.jsx(w,f({},x))}),eX=["autoFocus","className","classes","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"];const tX=pg("div",{name:"MuiYearCalendar",slot:"Root",shouldForwardProp:e=>Oh(e)&&"yearsPerRow"!==e})({display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",rowGap:12,padding:"6px 0",overflowY:"auto",height:"100%",width:hK,maxHeight:280,boxSizing:"border-box",position:"relative",variants:[{props:{yearsPerRow:3},style:{columnGap:24}},{props:{yearsPerRow:4},style:{columnGap:0,padding:"0 2px"}}]}),nX=pg("div",{name:"MuiYearCalendar",slot:"ButtonFiller"})({height:36,width:72}),rX=s.forwardRef(function(e,t){const n=function(e,t){const n=cg({props:e,name:t});return f({},n,jG(n),{yearsPerRow:n.yearsPerRow??3,yearsOrder:n.yearsOrder??"asc"})}(e,"MuiYearCalendar"),{autoFocus:r,className:o,classes:i,value:a,defaultValue:l,referenceDate:c,disabled:u,disableFuture:p,disablePast:h,maxDate:m,minDate:g,onChange:v,readOnly:b,shouldDisableYear:y,onYearFocus:w,hasFocus:x,onFocusedViewChange:S,yearsOrder:C,yearsPerRow:k,timezone:E,gridLabelId:R,slots:P,slotProps:M}=n,T=d(n,eX),{value:I,handleValueChange:O,timezone:D}=iK({name:"YearCalendar",timezone:E,value:a,defaultValue:l,referenceDate:c,onChange:v,valueManager:qU}),F=NG(D),L=um(),A=gG(),{ownerState:N}=lG(),$=s.useMemo(()=>qU.getInitialReferenceValue({value:I,adapter:A,props:n,timezone:D,referenceDate:c,granularity:MU.year}),[]),z=(e=>wm({root:["root"]},YY,e))(i),j=s.useMemo(()=>A.getYear(F),[A,F]),B=s.useMemo(()=>null!=I?A.getYear(I):null,[I,A]),[_,H]=s.useState(()=>B||A.getYear($)),[V,W]=Pg({name:"YearCalendar",state:"hasFocus",controlled:x,default:r??!1}),U=Mg(e=>{W(e),S&&S(e)}),G=s.useCallback(e=>{if(h&&A.isBeforeYear(e,F))return!0;if(p&&A.isAfterYear(e,F))return!0;if(g&&A.isBeforeYear(e,g))return!0;if(m&&A.isAfterYear(e,m))return!0;if(!y)return!1;const t=A.startOfYear(e);return y(t)},[p,h,m,g,F,y,A]),K=Mg((e,t)=>{if(b)return;const n=A.setYear(I??$,t);O(n)}),q=Mg(e=>{G(A.setYear(I??$,e))||(H(e),U(!0),w?.(e))});s.useEffect(()=>{H(e=>null!==B&&e!==B?B:e)},[B]);const Y="desc"!==C?1*k:-1*k,X=L&&"asc"===C||!L&&"desc"===C?-1:1,Q=Mg((e,t)=>{switch(e.key){case"ArrowUp":q(t-Y),e.preventDefault();break;case"ArrowDown":q(t+Y),e.preventDefault();break;case"ArrowLeft":q(t-X),e.preventDefault();break;case"ArrowRight":q(t+X),e.preventDefault()}}),Z=Mg((e,t)=>{q(t)}),J=Mg((e,t)=>{_===t&&U(!1)}),ee=s.useRef(null),te=Tg(t,ee);s.useEffect(()=>{if(r||null===ee.current)return;const e=ee.current.querySelector('[tabindex="0"]');if(!e)return;const t=e.offsetHeight,n=e.offsetTop,o=ee.current.clientHeight,i=ee.current.scrollTop,a=n+t;t>o||n<i||(ee.current.scrollTop=a-o/2-t/2)},[r]);const ne=A.getYearRange([g,m]);"desc"===C&&ne.reverse();let re=k-ne.length%k;return re===k&&(re=0),Xp.jsxs(tX,f({ref:te,className:QU(z.root,o),ownerState:N,role:"radiogroup","aria-labelledby":R,yearsPerRow:k},T,{children:[ne.map(e=>{const t=A.getYear(e),n=t===B,r=u||G(e);return Xp.jsx(JY,{selected:n,value:t,onClick:K,onKeyDown:Q,autoFocus:V&&t===_,disabled:r,tabIndex:t!==_||r?-1:0,onFocus:Z,onBlur:J,"aria-current":j===t?"date":void 0,slots:P,slotProps:M,classes:i,children:A.format(e,"year")},A.format(e,"year"))}),Array.from({length:re},(e,t)=>Xp.jsx(nX,{},t))]}))}),oX=e=>Ph("MuiPickersCalendarHeader",e),iX=Mh("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function aX(e){return Ph("MuiPickersArrowSwitcher",e)}Mh("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const lX=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId","classes"],sX=["ownerState"],cX=["ownerState"],uX=pg("div",{name:"MuiPickersArrowSwitcher",slot:"Root"})({display:"flex"}),dX=pg("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer"})(({theme:e})=>({width:e.spacing(3)})),pX=pg(Mv,{name:"MuiPickersArrowSwitcher",slot:"Button"})({variants:[{props:{isButtonHidden:!0},style:{visibility:"hidden"}}]}),fX=s.forwardRef(function(e,t){const n=um(),r=cg({props:e,name:"MuiPickersArrowSwitcher"}),{children:o,className:i,slots:a,slotProps:l,isNextDisabled:s,isNextHidden:c,onGoToNext:u,nextLabel:p,isPreviousDisabled:h,isPreviousHidden:m,onGoToPrevious:g,previousLabel:v,labelId:b,classes:y}=r,w=d(r,lX),{ownerState:x}=lG(),S=(e=>wm({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},aX,e))(y),C={isDisabled:s,isHidden:c,goTo:u,label:p},k={isDisabled:h,isHidden:m,goTo:g,label:v},E=a?.previousIconButton??pX,R=yy({elementType:E,externalSlotProps:l?.previousIconButton,additionalProps:{size:"medium",title:k.label,"aria-label":k.label,disabled:k.isDisabled,edge:"end",onClick:k.goTo},ownerState:f({},x,{isButtonHidden:k.isHidden??!1}),className:QU(S.button,S.previousIconButton)}),P=a?.nextIconButton??pX,M=yy({elementType:P,externalSlotProps:l?.nextIconButton,additionalProps:{size:"medium",title:C.label,"aria-label":C.label,disabled:C.isDisabled,edge:"start",onClick:C.goTo},ownerState:f({},x,{isButtonHidden:C.isHidden??!1}),className:QU(S.button,S.nextIconButton)}),T=a?.leftArrowIcon??WK,I=d(yy({elementType:T,externalSlotProps:l?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:x,className:S.leftArrowIcon}),sX),O=a?.rightArrowIcon??UK,D=d(yy({elementType:O,externalSlotProps:l?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:x,className:S.rightArrowIcon}),cX);return Xp.jsxs(uX,f({ref:t,className:QU(S.root,i),ownerState:x},w,{children:[Xp.jsx(E,f({},R,{children:n?Xp.jsx(O,f({},D)):Xp.jsx(T,f({},I))})),o?Xp.jsx(Gv,{variant:"subtitle1",component:"span",id:b,children:o}):Xp.jsx(dX,{className:S.spacer,ownerState:x}),Xp.jsx(P,f({},M,{children:n?Xp.jsx(T,f({},I)):Xp.jsx(O,f({},D))}))]}))});const hX=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","classes","timezone","format"],mX=["ownerState"],gX=pg("div",{name:"MuiPickersCalendarHeader",slot:"Root"})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),vX=pg("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer"})(({theme:e})=>f({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),bX=pg("div",{name:"MuiPickersCalendarHeader",slot:"Label"})({marginRight:6}),yX=pg(Mv,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton"})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${iX.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),wX=pg(VK,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon"})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),xX=s.forwardRef(function(e,t){const n=vG(),r=gG(),o=cg({props:e,name:"MuiPickersCalendarHeader"}),{slots:i,slotProps:a,currentMonth:l,disabled:c,disableFuture:u,disablePast:p,maxDate:h,minDate:m,onMonthChange:g,onViewChange:v,view:b,reduceAnimations:y,views:w,labelId:x,className:S,classes:C,timezone:k,format:E=`${r.formats.month} ${r.formats.year}`}=o,R=d(o,hX),{ownerState:P}=lG(),M=(e=>wm({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},oX,e))(C),T=i?.switchViewButton??yX,I=yy({elementType:T,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(b)},ownerState:f({},P,{view:b}),className:M.switchViewButton}),O=i?.switchViewIcon??wX,D=d(yy({elementType:O,externalSlotProps:a?.switchViewIcon,ownerState:P,className:M.switchViewIcon}),mX),F=function(e,{disableFuture:t,maxDate:n,timezone:r}){const o=gG();return s.useMemo(()=>{const i=o.date(void 0,r),a=o.startOfMonth(t&&o.isBefore(i,n)?i:n);return!o.isAfter(a,e)},[t,n,e,o,r])}(l,{disableFuture:u,maxDate:h,timezone:k}),L=function(e,{disablePast:t,minDate:n,timezone:r}){const o=gG();return s.useMemo(()=>{const i=o.date(void 0,r),a=o.startOfMonth(t&&o.isAfter(i,n)?i:n);return!o.isBefore(a,e)},[t,n,e,o,r])}(l,{disablePast:p,minDate:m,timezone:k});if(1===w.length&&"year"===w[0])return null;const A=r.formatByString(l,E);return Xp.jsxs(gX,f({},R,{ownerState:P,className:QU(M.root,S),ref:t,children:[Xp.jsxs(vX,{role:"presentation",onClick:()=>{if(1!==w.length&&v&&!c)if(2===w.length)v(w.find(e=>e!==b)||w[0]);else{const e=0!==w.indexOf(b)?0:1;v(w[e])}},ownerState:P,"aria-live":"polite",className:M.labelContainer,children:[Xp.jsx(uY,{reduceAnimations:y,transKey:A,children:Xp.jsx(bX,{id:x,ownerState:P,className:M.label,children:A})}),w.length>1&&!c&&Xp.jsx(T,f({},I,{children:Xp.jsx(O,f({},D))}))]}),Xp.jsx(Pw,{in:"day"===b,appear:!y,enter:!y,children:Xp.jsx(fX,{slots:i,slotProps:a,onGoToPrevious:()=>g(r.addMonths(l,-1)),isPreviousDisabled:L,previousLabel:n.previousMonth,onGoToNext:()=>g(r.addMonths(l,1)),isNextDisabled:F,nextLabel:n.nextMonth})})]}))}),SX=pg("div")({overflow:"hidden",width:hK,maxHeight:336,display:"flex",flexDirection:"column",margin:"0 auto"}),CX=e=>Ph("MuiDateCalendar",e);Mh("MuiDateCalendar",["root","viewTransitionContainer"]);const kX=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","classes","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"];const EX=pg(SX,{name:"MuiDateCalendar",slot:"Root"})({display:"flex",flexDirection:"column",height:336}),RX=pg(uY,{name:"MuiDateCalendar",slot:"ViewTransitionContainer"})({}),PX=s.forwardRef(function(e,t){const n=gG(),{ownerState:r}=lG(),o=mm(),i=function(e,t){const n=cg({props:e,name:t}),r=eK(n.reduceAnimations);return f({},n,jG(n),{loading:n.loading??!1,openTo:n.openTo??"day",views:n.views??["year","day"],reduceAnimations:r,renderLoading:n.renderLoading??(()=>Xp.jsx("span",{children:"..."}))})}(e,"MuiDateCalendar"),{autoFocus:a,onViewChange:l,value:c,defaultValue:u,referenceDate:p,disableFuture:h,disablePast:m,onChange:g,onMonthChange:v,reduceAnimations:b,shouldDisableDate:y,shouldDisableMonth:w,shouldDisableYear:x,view:S,views:C,openTo:k,className:E,classes:R,disabled:P,readOnly:M,minDate:T,maxDate:I,disableHighlightToday:O,focusedView:D,onFocusedViewChange:F,showDaysOutsideCurrentMonth:L,fixedWeekNumber:A,dayOfWeekFormatter:N,slots:$,slotProps:z,loading:j,renderLoading:B,displayWeekNumber:_,yearsOrder:H,yearsPerRow:V,monthsPerRow:W,timezone:U}=i,G=d(i,kX),{value:K,handleValueChange:q,timezone:Y}=iK({name:"DateCalendar",timezone:U,value:c,defaultValue:u,referenceDate:p,onChange:g,valueManager:qU}),{view:X,setView:Q,focusedView:Z,setFocusedView:J,goToNextView:ee,setValueAndGoToNextView:te}=nK({view:S,views:C,openTo:k,onChange:q,onViewChange:l,autoFocus:a,focusedView:D,onFocusedViewChange:F}),{referenceDate:ne,calendarState:re,setVisibleDate:oe,isDateDisabled:ie,onMonthSwitchingAnimationEnd:ae}=aY({value:K,referenceDate:p,reduceAnimations:b,onMonthChange:v,minDate:T,maxDate:I,shouldDisableDate:y,disablePast:m,disableFuture:h,timezone:Y,getCurrentMonthFromVisibleDate:(e,t)=>n.isSameMonth(e,t)?t:n.startOfMonth(e)}),le=P&&K||T,se=P&&K||I,ce=`${o}-grid-label`,ue=null!==Z,de=$?.calendarHeader??xX,pe=yy({elementType:de,externalSlotProps:z?.calendarHeader,additionalProps:{views:C,view:X,currentMonth:re.currentMonth,onViewChange:Q,onMonthChange:e=>oe({target:e,reason:"header-navigation"}),minDate:le,maxDate:se,disabled:P,disablePast:m,disableFuture:h,reduceAnimations:b,timezone:Y,labelId:ce},ownerState:r}),fe=Mg(e=>{const t=n.startOfMonth(e),r=n.endOfMonth(e),o=ie(e)?bU({adapter:n,date:e,minDate:n.isBefore(T,t)?t:T,maxDate:n.isAfter(I,r)?r:I,disablePast:m,disableFuture:h,isDateDisabled:ie,timezone:Y}):e;o?(te(o,"finish"),oe({target:o,reason:"cell-interaction"})):(ee(),oe({target:t,reason:"cell-interaction"}))}),he=Mg(e=>{const t=n.startOfYear(e),r=n.endOfYear(e),o=ie(e)?bU({adapter:n,date:e,minDate:n.isBefore(T,t)?t:T,maxDate:n.isAfter(I,r)?r:I,disablePast:m,disableFuture:h,isDateDisabled:ie,timezone:Y}):e;o?(te(o,"finish"),oe({target:o,reason:"cell-interaction"})):(ee(),oe({target:t,reason:"cell-interaction"}))}),me=Mg(e=>q(e?vU(n,e,K??ne):e,"finish",X));s.useEffect(()=>{n.isValid(K)&&oe({target:K,reason:"controlled-value-change"})},[K]);const ge=(e=>wm({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},CX,e))(R),ve={disablePast:m,disableFuture:h,maxDate:I,minDate:T},be={disableHighlightToday:O,readOnly:M,disabled:P,timezone:Y,gridLabelId:ce,slots:$,slotProps:z},ye=s.useRef(X);s.useEffect(()=>{ye.current!==X&&(Z===ye.current&&J(X,!0),ye.current=X)},[Z,J,X]);const we=s.useMemo(()=>[K],[K]);return Xp.jsxs(EX,f({ref:t,className:QU(ge.root,E),ownerState:r},G,{children:[Xp.jsx(de,f({},pe,{slots:$,slotProps:z})),Xp.jsx(RX,{reduceAnimations:b,className:ge.viewTransitionContainer,transKey:X,ownerState:r,children:Xp.jsxs("div",{children:["year"===X&&Xp.jsx(rX,f({},ve,be,{value:K,onChange:he,shouldDisableYear:x,hasFocus:ue,onFocusedViewChange:e=>J("year",e),yearsOrder:H,yearsPerRow:V,referenceDate:ne})),"month"===X&&Xp.jsx(qY,f({},ve,be,{currentMonth:re.currentMonth,hasFocus:ue,className:E,value:K,onChange:fe,shouldDisableMonth:w,onFocusedViewChange:e=>J("month",e),monthsPerRow:W,referenceDate:ne})),"day"===X&&Xp.jsx(jY,f({},re,ve,be,{onMonthSwitchingAnimationEnd:ae,hasFocus:ue,onFocusedDayChange:e=>oe({target:e,reason:"cell-interaction"}),reduceAnimations:b,selectedDays:we,onSelectedDaysChange:me,shouldDisableDate:y,shouldDisableMonth:w,shouldDisableYear:x,onFocusedViewChange:e=>J("day",e),showDaysOutsideCurrentMonth:L,fixedWeekNumber:A,dayOfWeekFormatter:N,displayWeekNumber:_,loading:j,renderLoading:B}))]})})]}))}),MX=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:o,value:i,defaultValue:a,referenceDate:l,onChange:s,className:c,classes:u,disableFuture:d,disablePast:p,minDate:f,maxDate:h,shouldDisableDate:m,shouldDisableMonth:g,shouldDisableYear:v,reduceAnimations:b,onMonthChange:y,monthsPerRow:w,onYearChange:x,yearsOrder:S,yearsPerRow:C,slots:k,slotProps:E,loading:R,renderLoading:P,disableHighlightToday:M,readOnly:T,disabled:I,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:D,sx:F,autoFocus:L,fixedWeekNumber:A,displayWeekNumber:N,timezone:$})=>Xp.jsx(PX,{view:e,onViewChange:t,views:n.filter(CU),focusedView:r&&CU(r)?r:null,onFocusedViewChange:o,value:i,defaultValue:a,referenceDate:l,onChange:s,className:c,classes:u,disableFuture:d,disablePast:p,minDate:f,maxDate:h,shouldDisableDate:m,shouldDisableMonth:g,shouldDisableYear:v,reduceAnimations:b,onMonthChange:y,monthsPerRow:w,onYearChange:x,yearsOrder:S,yearsPerRow:C,slots:k,slotProps:E,loading:R,renderLoading:P,disableHighlightToday:M,readOnly:T,disabled:I,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:D,sx:F,autoFocus:L,fixedWeekNumber:A,displayWeekNumber:N,timezone:$}),TX=s.forwardRef(function(e,t){const n=gG(),r=BG(e,"MuiDesktopDatePicker"),o=f({day:MX,month:MX,year:MX},r.viewRenderers),i=f({},r,{closeOnSelect:r.closeOnSelect??!0,viewRenderers:o,format:kU(n,r,!1),yearsPerRow:r.yearsPerRow??4,slots:f({field:oY},r.slots),slotProps:f({},r.slotProps,{field:e=>f({},_g(r.slotProps?.field,e),SG(r)),toolbar:f({hidden:!0},r.slotProps?.toolbar)})}),{renderPicker:a}=(e=>{let{props:t,steps:n}=e,r=d(e,EK);const{slots:o,slotProps:i,label:a,inputRef:l,localeText:s}=t,c=kK({steps:n}),{providerProps:u,renderCurrentView:p,ownerState:h}=lK(f({},r,{props:t,localeText:s,autoFocusView:!0,viewContainerRole:"dialog",variant:"desktop",getStepNavigation:c})),m=u.privateContextValue.labelId,g=i?.toolbar?.hidden??!1,v=o.field,b=d(yy({elementType:v,externalSlotProps:i?.field,additionalProps:f({},g&&{id:m}),ownerState:h}),RK),y=o.layout??CK;let w=m;g&&(w=a?`${m}-label`:void 0);const x=f({},i,{toolbar:f({},i?.toolbar,{titleId:m}),popper:f({"aria-labelledby":w},i?.popper)});return{renderPicker:()=>Xp.jsxs(aG,f({},u,{children:[Xp.jsx(v,f({},b,{slots:f({},o,b.slots),slotProps:f({},x,b.slotProps),inputRef:l})),Xp.jsx(YG,{slots:o,slotProps:x,children:Xp.jsx(y,f({},x?.layout,{slots:o,slotProps:x,children:p()}))})]}))}})({ref:t,props:i,valueManager:qU,valueType:"date",validator:LG,steps:null});return a()});TX.propTypes={autoFocus:C.bool,className:C.string,closeOnSelect:C.bool,dayOfWeekFormatter:C.func,defaultValue:C.object,disabled:C.bool,disableFuture:C.bool,disableHighlightToday:C.bool,disableOpenPicker:C.bool,disablePast:C.bool,displayWeekNumber:C.bool,enableAccessibleFieldDOMStructure:C.any,fixedWeekNumber:C.number,format:C.string,formatDensity:C.oneOf(["dense","spacious"]),inputRef:Yg,label:C.node,loading:C.bool,localeText:C.object,maxDate:C.object,minDate:C.object,monthsPerRow:C.oneOf([3,4]),name:C.string,onAccept:C.func,onChange:C.func,onClose:C.func,onError:C.func,onMonthChange:C.func,onOpen:C.func,onSelectedSectionsChange:C.func,onViewChange:C.func,onYearChange:C.func,open:C.bool,openTo:C.oneOf(["day","month","year"]),orientation:C.oneOf(["landscape","portrait"]),readOnly:C.bool,reduceAnimations:C.bool,referenceDate:C.object,renderLoading:C.func,selectedSections:C.oneOfType([C.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),C.number]),shouldDisableDate:C.func,shouldDisableMonth:C.func,shouldDisableYear:C.func,showDaysOutsideCurrentMonth:C.bool,slotProps:C.object,slots:C.object,sx:C.oneOfType([C.arrayOf(C.oneOfType([C.func,C.object,C.bool])),C.func,C.object]),timezone:C.string,value:C.object,view:C.oneOf(["day","month","year"]),viewRenderers:C.shape({day:C.func,month:C.func,year:C.func}),views:C.arrayOf(C.oneOf(["day","month","year"]).isRequired),yearsOrder:C.oneOf(["asc","desc"]),yearsPerRow:C.oneOf([3,4])};const IX=pg(zx)({[`& .${Dx.container}`]:{outline:0},[`& .${Dx.paper}`]:{outline:0,minWidth:hK}}),OX=pg(Gx)({"&:first-of-type":{padding:0}});function DX(e){const{children:t,slots:n,slotProps:r}=e,{open:o}=rG(),{dismissViews:i,onPopperExited:a}=lG(),l=n?.dialog??IX,s=n?.mobileTransition??Pw;return Xp.jsx(l,f({open:o,onClose:()=>{i(),a?.()}},r?.dialog,{TransitionComponent:s,TransitionProps:r?.mobileTransition,PaperComponent:n?.mobilePaper,PaperProps:r?.mobilePaper,children:Xp.jsx(OX,{children:t})}))}const FX=["props","steps"],LX=["ownerState"],AX=s.forwardRef(function(e,t){const n=gG(),r=BG(e,"MuiMobileDatePicker"),o=f({day:MX,month:MX,year:MX},r.viewRenderers),i=f({},r,{viewRenderers:o,format:kU(n,r,!1),slots:f({field:oY},r.slots),slotProps:f({},r.slotProps,{field:e=>f({},_g(r.slotProps?.field,e),SG(r)),toolbar:f({hidden:!1},r.slotProps?.toolbar)})}),{renderPicker:a}=(e=>{let{props:t,steps:n}=e,r=d(e,FX);const{slots:o,slotProps:i,label:a,inputRef:l,localeText:s}=t,c=kK({steps:n}),{providerProps:u,renderCurrentView:p,ownerState:h}=lK(f({},r,{props:t,localeText:s,autoFocusView:!0,viewContainerRole:"dialog",variant:"mobile",getStepNavigation:c})),m=u.privateContextValue.labelId,g=i?.toolbar?.hidden??!1,v=o.field,b=d(yy({elementType:v,externalSlotProps:i?.field,additionalProps:f({},g&&{id:m}),ownerState:h}),LX),y=o.layout??CK;let w=m;g&&(w=a?`${m}-label`:void 0);const x=f({},i,{toolbar:f({},i?.toolbar,{titleId:m}),mobilePaper:f({"aria-labelledby":w},i?.mobilePaper)});return{renderPicker:()=>Xp.jsxs(aG,f({},u,{children:[Xp.jsx(v,f({},b,{slots:f({},o,b.slots),slotProps:f({},x,b.slotProps),inputRef:l})),Xp.jsx(DX,{slots:o,slotProps:x,children:Xp.jsx(y,f({},x?.layout,{slots:o,slotProps:x,children:p()}))})]}))}})({ref:t,props:i,valueManager:qU,valueType:"date",validator:LG,steps:null});return a()});AX.propTypes={autoFocus:C.bool,className:C.string,closeOnSelect:C.bool,dayOfWeekFormatter:C.func,defaultValue:C.object,disabled:C.bool,disableFuture:C.bool,disableHighlightToday:C.bool,disableOpenPicker:C.bool,disablePast:C.bool,displayWeekNumber:C.bool,enableAccessibleFieldDOMStructure:C.any,fixedWeekNumber:C.number,format:C.string,formatDensity:C.oneOf(["dense","spacious"]),inputRef:Yg,label:C.node,loading:C.bool,localeText:C.object,maxDate:C.object,minDate:C.object,monthsPerRow:C.oneOf([3,4]),name:C.string,onAccept:C.func,onChange:C.func,onClose:C.func,onError:C.func,onMonthChange:C.func,onOpen:C.func,onSelectedSectionsChange:C.func,onViewChange:C.func,onYearChange:C.func,open:C.bool,openTo:C.oneOf(["day","month","year"]),orientation:C.oneOf(["landscape","portrait"]),readOnly:C.bool,reduceAnimations:C.bool,referenceDate:C.object,renderLoading:C.func,selectedSections:C.oneOfType([C.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),C.number]),shouldDisableDate:C.func,shouldDisableMonth:C.func,shouldDisableYear:C.func,showDaysOutsideCurrentMonth:C.bool,slotProps:C.object,slots:C.object,sx:C.oneOfType([C.arrayOf(C.oneOfType([C.func,C.object,C.bool])),C.func,C.object]),timezone:C.string,value:C.object,view:C.oneOf(["day","month","year"]),viewRenderers:C.shape({day:C.func,month:C.func,year:C.func}),views:C.arrayOf(C.oneOf(["day","month","year"]).isRequired),yearsOrder:C.oneOf(["asc","desc"]),yearsPerRow:C.oneOf([3,4])};const NX=["desktopModeMediaQuery"],$X=s.forwardRef(function(e,t){const n=cg({props:e,name:"MuiDatePicker"}),{desktopModeMediaQuery:r=WG}=n,o=d(n,NX);return nR(r,{defaultMatches:!0})?Xp.jsx(TX,f({ref:t},o)):Xp.jsx(AX,f({ref:t},o))});var zX,jX={exports:{}};var BX,_X=(zX||(zX=1,function(e){e.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",i="minute",a="hour",l="day",s="week",c="month",u="quarter",d="year",p="date",f="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={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(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},v=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},b={s:v,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+v(r,2,"0")+":"+v(o,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),o=t.clone().add(r,c),i=n-o<0,a=t.clone().add(r+(i?-1:1),c);return+(-(r+(n-o)/(i?o-a:a-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:s,d:l,D:p,h:a,m:i,s:o,ms:r,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",w={};w[y]=g;var x="$isDayjsObject",S=function(e){return e instanceof R||!(!e||!e[x])},C=function e(t,n,r){var o;if(!t)return y;if("string"==typeof t){var i=t.toLowerCase();w[i]&&(o=i),n&&(w[i]=n,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var l=t.name;w[l]=t,o=l}return!r&&o&&(y=o),o||!r&&y},k=function(e,t){if(S(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new R(n)},E=b;E.l=C,E.i=S,E.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var R=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var v=g.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(h);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return E},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},v.isAfter=function(e,t){return k(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<k(e)},v.$g=function(e,t,n){return E.u(e)?this[t]:this.set(n,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var n=this,r=!!E.u(t)||t,u=E.p(e),f=function(e,t){var o=E.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?o:o.endOf(l)},h=function(e,t){return E.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},m=this.$W,g=this.$M,v=this.$D,b="set"+(this.$u?"UTC":"");switch(u){case d:return r?f(1,0):f(31,11);case c:return r?f(1,g):f(0,g+1);case s:var y=this.$locale().weekStart||0,w=(m<y?m+7:m)-y;return f(r?v-w:v+(6-w),g);case l:case p:return h(b+"Hours",0);case a:return h(b+"Minutes",1);case i:return h(b+"Seconds",2);case o:return h(b+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var n,s=E.p(e),u="set"+(this.$u?"UTC":""),f=(n={},n[l]=u+"Date",n[p]=u+"Date",n[c]=u+"Month",n[d]=u+"FullYear",n[a]=u+"Hours",n[i]=u+"Minutes",n[o]=u+"Seconds",n[r]=u+"Milliseconds",n)[s],h=s===l?this.$D+(t-this.$W):t;if(s===c||s===d){var m=this.clone().set(p,1);m.$d[f](h),m.init(),this.$d=m.set(p,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](h);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[E.p(e)]()},v.add=function(r,u){var p,f=this;r=Number(r);var h=E.p(u),m=function(e){var t=k(f);return E.w(t.date(t.date()+Math.round(e*r)),f)};if(h===c)return this.set(c,this.$M+r);if(h===d)return this.set(d,this.$y+r);if(h===l)return m(1);if(h===s)return m(7);var g=(p={},p[i]=t,p[a]=n,p[o]=e,p)[h]||1,v=this.$d.getTime()+r*g;return E.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=E.z(this),i=this.$H,a=this.$m,l=this.$M,s=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,o,i){return e&&(e[n]||e(t,r))||o[n].slice(0,i)},p=function(e){return E.s(i%12||12,e,"0")},h=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(m,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return E.s(t.$y,4,"0");case"M":return l+1;case"MM":return E.s(l+1,2,"0");case"MMM":return d(n.monthsShort,l,c,3);case"MMMM":return d(c,l);case"D":return t.$D;case"DD":return E.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,s,2);case"ddd":return d(n.weekdaysShort,t.$W,s,3);case"dddd":return s[t.$W];case"H":return String(i);case"HH":return E.s(i,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return h(i,a,!0);case"A":return h(i,a,!1);case"m":return String(a);case"mm":return E.s(a,2,"0");case"s":return String(t.$s);case"ss":return E.s(t.$s,2,"0");case"SSS":return E.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(r,p,f){var h,m=this,g=E.p(p),v=k(r),b=(v.utcOffset()-this.utcOffset())*t,y=this-v,w=function(){return E.m(m,v)};switch(g){case d:h=w()/12;break;case c:h=w();break;case u:h=w()/3;break;case s:h=(y-b)/6048e5;break;case l:h=(y-b)/864e5;break;case a:h=y/n;break;case i:h=y/t;break;case o:h=y/e;break;default:h=y}return f?h:E.a(h)},v.daysInMonth=function(){return this.endOf(c).$D},v.$locale=function(){return w[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},v.clone=function(){return E.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},g}(),P=R.prototype;return k.prototype=P,[["$ms",r],["$s",o],["$m",i],["$H",a],["$W",l],["$M",c],["$y",d],["$D",p]].forEach(function(e){P[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),k.extend=function(e,t){return e.$i||(e(t,R,k),e.$i=!0),k},k.locale=C,k.isDayjs=S,k.unix=function(e){return k(1e3*e)},k.en=w[y],k.Ls=w,k.p={},k}()}(jX)),jX.exports),HX=t(_X),VX={exports:{}};var WX,UX=(BX||(BX=1,function(e){var t,n;e.exports=(t="week",n="year",function(e,r,o){var i=r.prototype;i.week=function(e){if(void 0===e&&(e=null),null!==e)return this.add(7*(e-this.week()),"day");var r=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var i=o(this).startOf(n).add(1,n).date(r),a=o(this).endOf(t);if(i.isBefore(a))return 1}var l=o(this).startOf(n).date(r).startOf(t).subtract(1,"millisecond"),s=this.diff(l,t,!0);return s<0?o(this).startOf("week").week():Math.ceil(s)},i.weeks=function(e){return void 0===e&&(e=null),this.week(e)}})}(VX)),VX.exports),GX=t(UX),KX={exports:{}};var qX,YX=(WX||(WX=1,function(e){e.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,o=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},l=function(e){return(e=+e)+(e>68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],u=function(e){var t=a[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=a.meridiem;if(r){for(var o=1;o<=24;o+=1)if(e.indexOf(r(o,0,t))>-1){n=o>12;break}}else n=e===(t?"pm":"PM");return n},p={A:[i,function(e){this.afternoon=d(e,!1)}],a:[i,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[o,s("seconds")],ss:[o,s("seconds")],m:[o,s("minutes")],mm:[o,s("minutes")],H:[o,s("hours")],h:[o,s("hours")],HH:[o,s("hours")],hh:[o,s("hours")],D:[o,s("day")],DD:[r,s("day")],Do:[i,function(e){var t=a.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],w:[o,s("week")],ww:[r,s("week")],M:[o,s("month")],MM:[r,s("month")],MMM:[i,function(e){var t=u("months"),n=(u("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=u("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[r,function(e){this.year=l(e)}],YYYY:[/\d{4}/,s("year")],Z:c,ZZ:c};function f(n){var r,o;r=n,o=a&&a.formats;for(var i=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,n,r){var i=r&&r.toUpperCase();return n||o[r]||e[r]||o[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,n){return t||n.slice(1)})})).match(t),l=i.length,s=0;s<l;s+=1){var c=i[s],u=p[c],d=u&&u[0],f=u&&u[1];i[s]=f?{regex:d,parser:f}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},n=0,r=0;n<l;n+=1){var o=i[n];if("string"==typeof o)r+=o.length;else{var a=o.regex,s=o.parser,c=e.slice(r),u=a.exec(c)[0];s.call(t,u),e=e.replace(u,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(l=e.parseTwoDigitYear);var r=t.prototype,o=r.parse;r.parse=function(e){var t=e.date,r=e.utc,i=e.args;this.$u=r;var l=i[1];if("string"==typeof l){var s=!0===i[2],c=!0===i[3],u=s||c,d=i[2];c&&(d=i[2]),a=this.$locale(),!s&&d&&(a=n.Ls[d]),this.$d=function(e,t,n,r){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var o=f(t)(e),i=o.year,a=o.month,l=o.day,s=o.hours,c=o.minutes,u=o.seconds,d=o.milliseconds,p=o.zone,h=o.week,m=new Date,g=l||(i||a?1:m.getDate()),v=i||m.getFullYear(),b=0;i&&!a||(b=a>0?a-1:m.getMonth());var y,w=s||0,x=c||0,S=u||0,C=d||0;return p?new Date(Date.UTC(v,b,g,w,x,S,C+60*p.offset*1e3)):n?new Date(Date.UTC(v,b,g,w,x,S,C)):(y=new Date(v,b,g,w,x,S,C),h&&(y=r(y).week(h).toDate()),y)}catch(e){return new Date("")}}(t,l,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(l)&&(this.$d=new Date("")),a={}}else if(l instanceof Array)for(var p=l.length,h=1;h<=p;h+=1){i[1]=l[h-1];var m=n.apply(this,i);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}h===p&&(this.$d=new Date(""))}else o.call(this,e)}}}()}(KX)),KX.exports),XX=t(YX),QX={exports:{}};var ZX,JX=(qX||(qX=1,function(e){var t;e.exports=(t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},function(e,n,r){var o=n.prototype,i=o.format;r.en.formats=t,o.format=function(e){void 0===e&&(e="YYYY-MM-DDTHH:mm:ssZ");var n=this.$locale().formats,r=function(e,n){return e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(e,r,o){var i=o&&o.toUpperCase();return r||n[o]||t[o]||n[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,n){return t||n.slice(1)})})}(e,void 0===n?{}:n);return i.call(this,r)}})}(QX)),QX.exports),eQ=t(JX),tQ={exports:{}};var nQ,rQ=(ZX||(ZX=1,function(e){e.exports=function(e,t,n){t.prototype.isBetween=function(e,t,r,o){var i=n(e),a=n(t),l="("===(o=o||"()")[0],s=")"===o[1];return(l?this.isAfter(i,r):!this.isBefore(i,r))&&(s?this.isBefore(a,r):!this.isAfter(a,r))||(l?this.isBefore(i,r):!this.isAfter(i,r))&&(s?this.isAfter(a,r):!this.isBefore(a,r))}}}(tQ)),tQ.exports),oQ=t(rQ),iQ={exports:{}};var aQ=(nQ||(nQ=1,function(e){e.exports=function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var o=this.$utils(),i=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return n.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return n.ordinal(t.week(),"W");case"w":case"ww":return o.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return o.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return o.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}});return r.bind(this)(i)}}}(iQ)),iQ.exports),lQ=t(aQ);HX.extend(eQ),HX.extend(GX),HX.extend(oQ),HX.extend(lQ);const sQ={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},cQ={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",dayOfMonthFull:"Do",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},uQ=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join("\n"),dQ=["Missing timezone plugin","To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join("\n");class pQ{isMUIAdapter=!0;isTimezoneCompatible=!0;lib="dayjs";escapedCharacters={start:"[",end:"]"};formatTokenMap=(()=>sQ)();constructor({locale:e,formats:t}={}){this.locale=e,this.formats=f({},cQ,t),HX.extend(XX)}setLocaleToValue=e=>{const t=this.getCurrentLocaleCode();return t===e.locale()?e:e.locale(t)};hasUTCPlugin=()=>void 0!==HX.utc;hasTimezonePlugin=()=>void 0!==HX.tz;isSame=(e,t,n)=>{const r=this.setTimezone(t,this.getTimezone(e));return e.format(n)===r.format(n)};cleanTimezone=e=>{switch(e){case"default":return;case"system":return HX.tz.guess();default:return e}};createSystemDate=e=>{let t;if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const n=HX.tz.guess();t="UTC"===n?HX(e):HX.tz(e,n)}else t=HX(e);return this.setLocaleToValue(t)};createUTCDate=e=>{if(!this.hasUTCPlugin())throw new Error(uQ);return this.setLocaleToValue(HX.utc(e))};createTZDate=(e,t)=>{if(!this.hasUTCPlugin())throw new Error(uQ);if(!this.hasTimezonePlugin())throw new Error(dQ);const n=void 0!==e&&!e.endsWith("Z");return this.setLocaleToValue(HX(e).tz(this.cleanTimezone(t),n))};getLocaleFormats=()=>{const e=HX.Ls;let t=e[this.locale||"en"];return void 0===t&&(t=e.en),t.formats};adjustOffset=e=>{if(!this.hasTimezonePlugin())return e;const t=this.getTimezone(e);if("UTC"!==t){const n=e.tz(this.cleanTimezone(t),!0);if(n.$offset===(e.$offset??0))return e;e.$offset=n.$offset}return e};date=(e,t="default")=>null===e?null:"UTC"===t?this.createUTCDate(e):"system"===t||"default"===t&&!this.hasTimezonePlugin()?this.createSystemDate(e):this.createTZDate(e,t);getInvalidDate=()=>HX(new Date("Invalid date"));getTimezone=e=>{if(this.hasTimezonePlugin()){const t=e.$x?.$timezone;if(t)return t}return this.hasUTCPlugin()&&e.isUTC()?"UTC":"system"};setTimezone=(e,t)=>{if(this.getTimezone(e)===t)return e;if("UTC"===t){if(!this.hasUTCPlugin())throw new Error(uQ);return e.utc()}if("system"===t)return e.local();if(!this.hasTimezonePlugin()){if("default"===t)return e;throw new Error(dQ)}return this.setLocaleToValue(HX.tz(e,this.cleanTimezone(t)))};toJsDate=e=>e.toDate();parse=(e,t)=>""===e?null:HX(e,t,this.locale,!0);getCurrentLocaleCode=()=>this.locale||"en";is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||"");expandFormat=e=>{const t=this.getLocaleFormats();return e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(e,n,r)=>{const o=r&&r.toUpperCase();return n||t[r]||t[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(e,t,n)=>t||n.slice(1))})};isValid=e=>null!=e&&e.isValid();format=(e,t)=>this.formatByString(e,this.formats[t]);formatByString=(e,t)=>this.setLocaleToValue(e).format(t);formatNumber=e=>e;isEqual=(e,t)=>null===e&&null===t||null!==e&&null!==t&&e.toDate().getTime()===t.toDate().getTime();isSameYear=(e,t)=>this.isSame(e,t,"YYYY");isSameMonth=(e,t)=>this.isSame(e,t,"YYYY-MM");isSameDay=(e,t)=>this.isSame(e,t,"YYYY-MM-DD");isSameHour=(e,t)=>e.isSame(t,"hour");isAfter=(e,t)=>e>t;isAfterYear=(e,t)=>this.hasUTCPlugin()?!this.isSameYear(e,t)&&e.utc()>t.utc():e.isAfter(t,"year");isAfterDay=(e,t)=>this.hasUTCPlugin()?!this.isSameDay(e,t)&&e.utc()>t.utc():e.isAfter(t,"day");isBefore=(e,t)=>e<t;isBeforeYear=(e,t)=>this.hasUTCPlugin()?!this.isSameYear(e,t)&&e.utc()<t.utc():e.isBefore(t,"year");isBeforeDay=(e,t)=>this.hasUTCPlugin()?!this.isSameDay(e,t)&&e.utc()<t.utc():e.isBefore(t,"day");isWithinRange=(e,[t,n])=>e>=t&&e<=n;startOfYear=e=>this.adjustOffset(e.startOf("year"));startOfMonth=e=>this.adjustOffset(e.startOf("month"));startOfWeek=e=>this.adjustOffset(this.setLocaleToValue(e).startOf("week"));startOfDay=e=>this.adjustOffset(e.startOf("day"));endOfYear=e=>this.adjustOffset(e.endOf("year"));endOfMonth=e=>this.adjustOffset(e.endOf("month"));endOfWeek=e=>this.adjustOffset(this.setLocaleToValue(e).endOf("week"));endOfDay=e=>this.adjustOffset(e.endOf("day"));addYears=(e,t)=>this.adjustOffset(e.add(t,"year"));addMonths=(e,t)=>this.adjustOffset(e.add(t,"month"));addWeeks=(e,t)=>this.adjustOffset(e.add(t,"week"));addDays=(e,t)=>this.adjustOffset(e.add(t,"day"));addHours=(e,t)=>this.adjustOffset(e.add(t,"hour"));addMinutes=(e,t)=>this.adjustOffset(e.add(t,"minute"));addSeconds=(e,t)=>this.adjustOffset(e.add(t,"second"));getYear=e=>e.year();getMonth=e=>e.month();getDate=e=>e.date();getHours=e=>e.hour();getMinutes=e=>e.minute();getSeconds=e=>e.second();getMilliseconds=e=>e.millisecond();setYear=(e,t)=>this.adjustOffset(e.set("year",t));setMonth=(e,t)=>this.adjustOffset(e.set("month",t));setDate=(e,t)=>this.adjustOffset(e.set("date",t));setHours=(e,t)=>this.adjustOffset(e.set("hour",t));setMinutes=(e,t)=>this.adjustOffset(e.set("minute",t));setSeconds=(e,t)=>this.adjustOffset(e.set("second",t));setMilliseconds=(e,t)=>this.adjustOffset(e.set("millisecond",t));getDaysInMonth=e=>e.daysInMonth();getWeekArray=e=>{const t=this.startOfWeek(this.startOfMonth(e)),n=this.endOfWeek(this.endOfMonth(e));let r=0,o=t;const i=[];for(;o<n;){const e=Math.floor(r/7);i[e]=i[e]||[],i[e].push(o),o=this.addDays(o,1),r+=1}return i};getWeekNumber=e=>e.week();getDayOfWeek(e){return e.day()+1}getYearRange=([e,t])=>{const n=this.startOfYear(e),r=this.endOfYear(t),o=[];let i=n;for(;this.isBefore(i,r);)o.push(i),i=this.addYears(i,1);return o}}const fQ=({providersData:e,rootProvider:t,savedFilters:n={},onSaveFilter:r,onRemoveFilter:o,existingDimensions:i=[],existingMetrics:a=[],titleOverrides:l={},onUpdateTitle:u,onResetTitle:d})=>{const p=SR(),[f,h]=s.useState(!1),[m,g]=s.useState([]),[v,b]=s.useState(""),[y,w]=s.useState([]),[x,S]=s.useState([]),[C,k]=s.useState(!1),[E,R]=s.useState(null),[P,M]=s.useState(null),[T,I]=s.useState(null),[O,D]=s.useState(null),[F,L]=s.useState("");s.useEffect(()=>{b(""),w([]),S([]),M(null),I(null)},[m]);const A=e=>e&&("date"===e.type||"timestamp"===e.type),N=()=>{const n=t?0===m.length?t:m[m.length-1].targetKey:null;if(!n||!e||!e[n])return[];const r=e[n];if(!r.dimensions)return[];const o=[];return Object.keys(r.dimensions).forEach(e=>{const t=r.dimensions[e];Object.keys(t).forEach(r=>{const i=t[r];(e=>!!e.column&&/^[a-zA-Z0-9_.]+$/.test(e.column))(i)&&o.push({key:`${n}_${e}.${r}`,value:i.title||r,dimensionKey:r,alias:e,dimension:i})})}),o},$=()=>{h(!1),g([]),b(""),w([]),S([]),M(null),I(null),R(null)},z=()=>{R(null),w([]),S([]),M(null),I(null)},j=e=>{const t=F.trim();""!==t?(u(e,t),D(null),L("")):B()},B=()=>{D(null),L("")},_=async e=>{k(!0);try{const n={provider:t,doc:{query:{dimensions:[e],metrics:[],order_by:[{name:e}]}},parameters:p?.parameters||{base_currency:"EUR"}};console.log("Fetching filter values with payload:",n);const r=await jc.runAdHocReport({report:n});console.log("Filter values results:",r);const o=(Array.isArray(r)?r:r.data||[]).map(t=>{let n=t[e];if(void 0===n){n=t[e.replace(/\./g,"_")]}if(void 0===n){const e=Object.keys(t);e.length>0&&(n=t[e[0]])}return{key:String(n),value:String(n)}});console.log("Transformed distinct values:",o),w(o)}catch(e){console.error("Error fetching filter values:",e),w([])}finally{k(!1)}},H=e=>{const n=[t];return e.relationNames&&e.relationNames.length>0&&n.push(...e.relationNames),n.join(" → ")},V=Object.entries(n);return c.createElement("div",null,c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:2,marginBottom:2}},f?c.createElement(c.Fragment,null,c.createElement(Xw,{variant:"outlined",onClick:$},"Cancel"),c.createElement(Xw,{variant:"contained",onClick:()=>{const n=N().find(e=>e.key===v);if(!n)return;const o=A(n.dimension);if(o){if(!P&&!T)return}else if(0===x.length)return;if(!v)return;const i=[],a=[t],l=[];let s=t;m.forEach(t=>{const n=e[s];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&(i.push(e),l.push(e.name))}a.push(t.targetKey),s=t.targetKey});const c=[e[t].default_alias];i.forEach(e=>{c.push(e.alias)});const u=`${c.join("_")}.${n.dimensionKey}`;let d;o?(d={},P&&(d.gte=P.format("YYYY-MM-DD")),T&&(d.lte=T.format("YYYY-MM-DD"))):d=x;const p={dimension:n.dimension,relations:i,providerPath:a,relationNames:l,dimensionKey:n.dimensionKey,dimensionTitle:n.value,fullPath:u,values:d};r(u,p),$()},disabled:(()=>{if(!v)return!0;const e=N().find(e=>e.key===v);if(!e)return!0;return A(e.dimension)?!P&&!T:0===x.length})()},"Save Filter")):c.createElement(Xw,{variant:"contained",onClick:()=>{h(!0),g([]),b(""),w([]),S([]),M(null),I(null),R(null)}},"Add Filter")),f&&c.createElement(qg,{sx:{padding:3,marginBottom:3}},c.createElement(Gv,{variant:"h6",sx:{marginBottom:2}},"Select Provider Path"),c.createElement(kH,{providersData:e,rootProvider:t,onSelectionChange:g,existingDimensions:i,existingMetrics:a,existingFilters:n}),c.createElement(Gv,{variant:"h6",sx:{marginTop:3,marginBottom:2}},"Select Dimension for Filter"),c.createElement(uR,{items:N(),value:v,label:"Choose Dimension",onChange:n=>{const r=n.target.value;if(b(r),S([]),M(null),I(null),r){const n=N().find(e=>e.key===r);if(n){if(!A(n.dimension)){const r=[];let o=t;m.forEach(t=>{const n=e[o];if(n&&n.relations){const e=n.relations.find(e=>e.name===t.relationName);e&&r.push(e)}o=t.targetKey});const i=[e[t].default_alias];r.forEach(e=>{i.push(e.alias)});const a=`${i.join("_")}.${n.dimensionKey}`;_(a)}}}else w([])},sx:{width:"400px"}}),v&&(()=>{const e=N().find(e=>e.key===v),t=e&&A(e.dimension);return c.createElement(c.Fragment,null,c.createElement(Gv,{variant:"h6",sx:{marginTop:3,marginBottom:2}},t?"Select Date Range":"Select Filter Values"),t?c.createElement(mU,{dateAdapter:pQ},c.createElement(jw,{sx:{display:"flex",gap:2,width:"400px"}},c.createElement($X,{label:"From Date",value:P,onChange:e=>M(e),slotProps:{textField:{size:"small",fullWidth:!0},field:{clearable:!0}}}),c.createElement($X,{label:"To Date",value:T,onChange:e=>I(e),slotProps:{textField:{size:"small",fullWidth:!0},field:{clearable:!0}}}))):c.createElement(jw,{sx:{width:"400px"}},c.createElement(sR,{items:y,selectedKeys:x,onChange:e=>S(e),label:"Choose Values",placeholder:"Select one or more values...",loading:C,helperText:x.length>0?`${x.length} value(s) selected`:"Select at least one value"})))})()),V.length>0&&c.createElement(jw,{sx:{marginTop:3}},c.createElement(Gv,{variant:"h6",sx:{marginBottom:2}},"Saved Filters"),c.createElement(jw,{sx:{display:"flex",flexDirection:"column",gap:2}},V.map(([e,t])=>{const i=A(t.dimension),a=E===e,s=O===e;let u,p,f;i&&t.values&&"object"==typeof t.values&&!Array.isArray(t.values)?(p=t.values.gte&&t.values.lte?`${t.values.gte} to ${t.values.lte}`:t.values.gte?`From ${t.values.gte}`:t.values.lte?`Until ${t.values.lte}`:"No dates",f="📅"):(u=t.values?.length||0,p=t.values?.join(", ")||"No values",f=u);const m=l[e]||t.dimensionTitle,g=!!l[e];return c.createElement(jw,{key:e},c.createElement(jw,{sx:{display:"flex",alignItems:"center",gap:1,marginBottom:a?2:0}},s?c.createElement(c.Fragment,null,c.createElement(qE,{value:F,onChange:e=>L(e.target.value),onKeyDown:t=>((e,t)=>{"Enter"===e.key?j(t):"Escape"===e.key&&B()})(t,e),size:"small",autoFocus:!0,placeholder:"Enter custom title",sx:{width:"300px"}}),c.createElement(Hk,{title:"Save",arrow:!0},c.createElement(Mv,{size:"small",onClick:()=>j(e),color:"primary"},c.createElement(oU,{fontSize:"small"}))),c.createElement(Hk,{title:"Cancel",arrow:!0},c.createElement(Mv,{size:"small",onClick:B,color:"default"},c.createElement(iU,{fontSize:"small"}))),g&&c.createElement(Hk,{title:"Reset to default",arrow:!0},c.createElement(Mv,{size:"small",onClick:()=>(e=>{d(e),D(null),L("")})(e),color:"warning"},c.createElement(aU,{fontSize:"small"})))):c.createElement(c.Fragment,null,c.createElement(Hk,{title:c.createElement("div",null,c.createElement("div",null,c.createElement("strong",null,"Path:")," ",H(t)," → ",t.dimensionTitle),c.createElement("div",null,c.createElement("strong",null,"Full Path:")," ",e),c.createElement("div",null,c.createElement("strong",null,i?"Date Range":`Values (${u})`,":")," ",p)),arrow:!0,placement:"top"},c.createElement(Nw,{badgeContent:f,color:"secondary"},c.createElement(zy,{label:m,onDelete:()=>o(e),color:"secondary",variant:"outlined",sx:{fontWeight:g?"bold":"normal",fontStyle:g?"italic":"normal"}}))),c.createElement(Hk,{title:"Rename filter",arrow:!0},c.createElement(Mv,{size:"small",onClick:()=>((e,t)=>{D(e),L(l[e]||t||"")})(e,t.dimensionTitle),color:"primary",disabled:a},c.createElement(mH,{fontSize:"small"}))),c.createElement(Hk,{title:"Edit filter values",arrow:!0},c.createElement(Mv,{size:"small",onClick:()=>(async(e,t)=>{h(!1),R(e),A(t.dimension)?t.values&&"object"==typeof t.values&&!Array.isArray(t.values)&&(M(t.values.gte?HX(t.values.gte):null),I(t.values.lte?HX(t.values.lte):null)):(S(t.values||[]),await _(e))})(e,t),color:"primary",disabled:a},c.createElement(pU,{fontSize:"small"}))))),a&&c.createElement(qg,{sx:{padding:2,marginLeft:2}},c.createElement(Gv,{variant:"subtitle2",sx:{marginBottom:1}},"Edit Filter ",i?"Date Range":"Values"," for: ",t.dimensionTitle),i?c.createElement(mU,{dateAdapter:pQ},c.createElement(jw,{sx:{display:"flex",gap:2,width:"400px",marginBottom:2}},c.createElement($X,{label:"From Date",value:P,onChange:e=>M(e),slotProps:{textField:{size:"small",fullWidth:!0},field:{clearable:!0}}}),c.createElement($X,{label:"To Date",value:T,onChange:e=>I(e),slotProps:{textField:{size:"small",fullWidth:!0},field:{clearable:!0}}}))):c.createElement(jw,{sx:{width:"400px",marginBottom:2}},c.createElement(sR,{items:y,selectedKeys:x,onChange:e=>S(e),label:"Choose Values",placeholder:"Select one or more values...",loading:C,helperText:x.length>0?`${x.length} value(s) selected`:"Select at least one value"})),c.createElement(jw,{sx:{display:"flex",gap:1}},c.createElement(Xw,{variant:"outlined",size:"small",onClick:z},"Cancel"),c.createElement(Xw,{variant:"contained",size:"small",onClick:()=>(e=>{const t=n[e];if(A(t.dimension)){if(!P&&!T)return;const n={};P&&(n.gte=P.format("YYYY-MM-DD")),T&&(n.lte=T.format("YYYY-MM-DD"));const o={...t,values:n};r(e,o)}else{if(0===x.length)return;const n={...t,values:x};r(e,n)}R(null),w([]),S([]),M(null),I(null)})(e),disabled:i?!P&&!T:0===x.length},"Save Changes"))))}))))},hQ=({reportData:e,dimensions:t,metrics:n,loading:r,onPageChange:o,totalRows:i=0,titleOverrides:a={dimensions:{},metrics:{}}})=>{const[l,u]=s.useState({page:0,pageSize:50}),d=c.useMemo(()=>{const e=[];return t.forEach(t=>{let n,r;if(t.relations&&t.relations.length>0){const e=t.fullPath.split("."),r=e[0],o=e[1],i=r.split("_");i.shift();const a=i.join("_");n=a?`${a}_${o}`:o}else n=t.fullPath.replace(".","_");r=a.dimensions[t.fullPath]||t.dimensionTitle||n,e.push({field:n,headerName:r,flex:1,minWidth:150})}),n.forEach(t=>{const n=t.metric;let r,o;if(t.relations&&t.relations.length>0){const e=t.fullPath.split("."),n=e[0],o=e[1],i=n.split("_");i.shift();const a=i.join("_");r=a?`${a}_${o}`:o}else r=t.metricName;o=a.metrics[t.fullPath]||t.metricTitle||r,e.push({field:r,headerName:o,flex:1,minWidth:150,type:"integer"===n?.type||"currency"===n?.type?"number":"string",valueFormatter:e=>{if(null==e)return"";if(n?.format){const t=pl(e).format(n.format);return n?.prefix?`${n.prefix} ${t}`:t}return e}})}),e},[t,n,a]),p=c.useMemo(()=>e&&Array.isArray(e)?e.map((e,t)=>({id:t,...e})):[],[e]);return r?c.createElement(jw,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400},c.createElement(Cv,null)):e&&0!==e.length?c.createElement(jw,{sx:{height:600,width:"100%"}},c.createElement(fH,{rows:p,columns:d,paginationModel:l,onPaginationModelChange:e=>{u(e),o&&e.page!==l.page&&o(e.page,e.pageSize)},pageSizeOptions:[10,25,50,100],paginationMode:"server",rowCount:i||p.length,loading:r,disableRowSelectionOnClick:!0,sx:{"& .MuiDataGrid-cell":{padding:"8px"},"& .MuiDataGrid-columnHeader":{backgroundColor:"#f5f5f5",fontWeight:"bold"}}})):c.createElement(jw,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400},c.createElement(Gv,{variant:"body1",color:"textSecondary"},"No data available. Run a report to see results."))};function mQ({children:e,value:t,index:n}){return c.createElement("div",{role:"tabpanel",hidden:t!==n,id:`report-tabpanel-${n}`,"aria-labelledby":`report-tab-${n}`},t===n&&c.createElement(jw,{sx:{py:3}},e))}const gQ=({reportDefinitionId:e,cloneData:t,autoRun:n,onBackToList:r})=>{const o=ER(),i=SR(),[a,l]=s.useState(null),[u,d]=s.useState(""),[p,f]=s.useState(""),[h,m]=s.useState({dimensions:[],metrics:[],filters:{}}),[g,v]=s.useState({dimensions:{},metrics:{},filters:{}}),[b,y]=s.useState(null),[w,x]=s.useState(!1),[S,C]=s.useState(0),[k,E]=s.useState(0),[R,P]=s.useState(50),[M,T]=s.useState(0),[I,O]=s.useState(!1),[D,F]=s.useState(!1);s.useEffect(()=>{(async()=>{const e=await jc.getProviders();console.log({providers:e}),l(e)})()},[]),s.useEffect(()=>{e&&a&&N(e)},[e,a]),s.useEffect(()=>{t&&a&&$(t)},[t,a]),s.useEffect(()=>{n&&D&&u&&h.dimensions.length>0&&B()},[n,D]);const L=(e,t,n)=>{try{const[r,o]=e.split("."),i=r.split("_");let a=n;const l=[],s=[n],c=[];for(let e=1;e<i.length;e++){const n=i[e],r=t[a];if(!r||!r.relations)return console.warn(`Provider ${a} not found or has no relations`),null;const o=r.relations.find(e=>e.alias===n);if(!o)return console.warn(`Relation with alias ${n} not found in provider ${a}`),null;l.push(o),c.push(o.name),a=o.target,s.push(a)}const u=t[a];if(!u)return console.warn(`Final provider ${a} not found`),null;const d=u.default_alias;if(!u.dimensions||!u.dimensions[d])return console.warn(`Dimensions not found for alias ${d} in provider ${a}`),null;const p=u.dimensions[d][o];return p?{dimension:p,relations:l,providerPath:s,relationNames:c,dimensionKey:o,dimensionTitle:p.title||o,fullPath:e}:(console.warn(`Dimension ${o} not found in provider ${a}, alias ${d}`),null)}catch(t){return console.warn(`Error reconstructing dimension from path ${e}:`,t),null}},A=(e,t,n)=>{try{const[r,o]=e.split("."),i=r.split("_");let a=n;const l=[],s=[n],c=[];for(let e=1;e<i.length;e++){const n=i[e],r=t[a];if(!r||!r.relations)return console.warn(`Provider ${a} not found or has no relations`),null;const o=r.relations.find(e=>e.alias===n);if(!o)return console.warn(`Relation with alias ${n} not found in provider ${a}`),null;l.push(o),c.push(o.name),a=o.target,s.push(a)}const u=t[a];if(!u)return console.warn(`Final provider ${a} not found`),null;if(!u.metrics)return console.warn(`Metrics not found in provider ${a}`),null;const d=u.metrics.find(e=>e.name===o);return d?{metric:d,relations:l,providerPath:s,relationNames:c,metricName:o,metricTitle:d.title||o,fullPath:e}:(console.warn(`Metric ${o} not found in provider ${a}`),null)}catch(t){return console.warn(`Error reconstructing metric from path ${e}:`,t),null}},N=async e=>{try{console.log("Loading report definition:",e);const t=await jc.getReportDefinition({id:e});console.log("Loaded report definition:",t),d(t.provider),f(t.title||"");const n=[],r={};if(t.definition?.doc?.query?.order_by)for(const e of t.definition.doc.query.order_by)!0===e.desc?r[e.name]="desc":r[e.name]="asc";if(t.definition?.doc?.query?.dimensions)for(const e of t.definition.doc.query.dimensions){const o=L(e,a,t.provider);o&&(o.sortOrder=r[e]||null,n.push(o))}const o=[];if(t.definition?.doc?.query?.metrics)for(const e of t.definition.doc.query.metrics){const n=A(e,a,t.provider);n&&o.push(n)}const i={dimensions:{},metrics:{},filters:{}};t.definition?.doc?.query?.titles&&(t.definition.doc.query.titles.dimensions&&(i.dimensions=t.definition.doc.query.titles.dimensions),t.definition.doc.query.titles.metrics&&(i.metrics=t.definition.doc.query.titles.metrics),t.definition.doc.query.titles.filters&&(i.filters=t.definition.doc.query.titles.filters));const l={};if(t.definition?.doc?.query?.filter){const e=t.definition.doc.query.filter;(e.and||e.or||[]).forEach(e=>{const[n,r]=Object.entries(e)[0],o=L(n,a,t.provider);o&&(l[n]={...o,values:r})})}m({dimensions:n,metrics:o,filters:l}),v(i),F(!0),console.log("Reconstructed report:",{dimensions:n,metrics:o,filters:l,titleOverrides:i})}catch(e){console.error("Error loading report definition:",e),o.error("Error loading report definition: "+(e.message||"Unknown error"))}},$=e=>{try{console.log("Loading cloned report:",e),d(e.provider),f(e.title||"");const t=[],n={};if(e.definition?.doc?.query?.order_by)for(const t of e.definition.doc.query.order_by)!0===t.desc?n[t.name]="desc":n[t.name]="asc";if(e.definition?.doc?.query?.dimensions)for(const r of e.definition.doc.query.dimensions){const o=L(r,a,e.provider);o&&(o.sortOrder=n[r]||null,t.push(o))}const r=[];if(e.definition?.doc?.query?.metrics)for(const t of e.definition.doc.query.metrics){const n=A(t,a,e.provider);n&&r.push(n)}const o={dimensions:{},metrics:{},filters:{}};e.definition?.doc?.query?.titles&&(e.definition.doc.query.titles.dimensions&&(o.dimensions=e.definition.doc.query.titles.dimensions),e.definition.doc.query.titles.metrics&&(o.metrics=e.definition.doc.query.titles.metrics),e.definition.doc.query.titles.filters&&(o.filters=e.definition.doc.query.titles.filters));const i={};if(e.definition?.doc?.query?.filter){const t=e.definition.doc.query.filter;(t.and||t.or||[]).forEach(t=>{const[n,r]=Object.entries(t)[0],o=L(n,a,e.provider);o&&(i[n]={...o,values:r})})}m({dimensions:t,metrics:r,filters:i}),v(o),console.log("Loaded cloned report:",{dimensions:t,metrics:r,filters:i,titleOverrides:o})}catch(e){console.error("Error loading cloned report:",e),o.error("Error loading cloned report: "+(e.message||"Unknown error"))}},z=(e=0,t=50)=>{const n=h.dimensions.map(e=>{const t={name:e.fullPath};return"desc"===e.sortOrder&&(t.desc=!0),t}),r=[];h.filters&&Object.keys(h.filters).length>0&&Object.entries(h.filters).forEach(([e,t])=>{t.values&&(Array.isArray(t.values)?t.values.length>0&&r.push({[e]:t.values}):"object"==typeof t.values&&r.push({[e]:t.values}))});const o=r.length>0?{and:r}:null,a={};Object.keys(g.dimensions).length>0&&(a.dimensions=g.dimensions),Object.keys(g.metrics).length>0&&(a.metrics=g.metrics),Object.keys(g.filters).length>0&&(a.filters=g.filters);const l={dimensions:h.dimensions.map(e=>e.fullPath),metrics:h.metrics.map(e=>e.fullPath),order_by:n,limit:t,offset:e*t};Object.keys(a).length>0&&(l.titles=a),o&&(l.filter=o);return{provider:u,doc:{query:l},parameters:i?.parameters||{base_currency:"EUR"}}},j=async(e,t)=>{try{x(!0);const n=z(e,t);console.log("Running report with:",n);const r=await jc.runAdHocReport({report:n});console.log("Report result:",r),y(r),r&&r.length<t?C(e*t+r.length):C((e+2)*t)}catch(e){console.error("Error running report:",e),o.error("Error running report: "+(e.message||"Unknown error")),y(null)}finally{x(!1)}},B=async()=>{E(0),await j(0,R),T(3)},_=u,H=u&&p.trim()&&(h.dimensions.length>0||h.metrics.length>0);return c.createElement(jw,{sx:{p:3}},c.createElement(jw,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2}},c.createElement("h1",null,e?"Edit Report":"Create New Report"),r&&c.createElement(Xw,{variant:"outlined",startIcon:c.createElement(xH,null),onClick:r},"Back to List")),c.createElement(jw,{sx:{mt:2,display:"flex",gap:2,alignItems:"flex-start",flexWrap:"wrap"}},c.createElement(qE,{label:"Report Title",value:p,onChange:e=>f(e.target.value),placeholder:"Enter report title",sx:{width:"300px"},size:"small"}),c.createElement(uR,{items:a?Object.keys(a).filter(e=>!0===a[e].base).map(e=>({key:e,value:a[e].name||e})):[],value:u,label:"Select Root Provider",onChange:e=>{d(e.target.value),m({dimensions:[],metrics:[],filters:{}}),v({dimensions:{},metrics:{},filters:{}}),console.log("Selected root provider:",e.target.value)},sx:{width:"300px"},disabled:!!e}),c.createElement(Xw,{variant:"contained",onClick:B,disabled:!_,sx:{height:"40px"}},"Run Report"),c.createElement(Xw,{variant:"contained",color:"secondary",startIcon:c.createElement(CH,null),onClick:async()=>{try{x(!0);const e=z();console.log("Downloading report with:",e);const t=(new Date).toISOString().split("T")[0],n=`${(p||"report").replace(/[^a-z0-9]/gi,"_").toLowerCase()}_${t}.csv`;await jc.downloadAdHocReport({report:e,filename:n}),o.success("Report downloaded successfully!")}catch(e){console.error("Error downloading report:",e),o.error("Error downloading report: "+(e.message||"Unknown error"))}finally{x(!1)}},disabled:!_||w,sx:{height:"40px"}},"Download CSV"),c.createElement(Xw,{variant:"contained",color:"success",startIcon:c.createElement(SH,null),onClick:async()=>{if(u)if(p.trim())if(0!==h.dimensions.length||0!==h.metrics.length)try{O(!0);const t=h.dimensions.map(e=>{const t={name:e.fullPath};return"desc"===e.sortOrder&&(t.desc=!0),t}),n={};Object.keys(g.dimensions).length>0&&(n.dimensions=g.dimensions),Object.keys(g.metrics).length>0&&(n.metrics=g.metrics),Object.keys(g.filters).length>0&&(n.filters=g.filters);const i={dimensions:h.dimensions.map(e=>e.fullPath),metrics:h.metrics.map(e=>e.fullPath),order_by:t};if(Object.keys(n).length>0&&(i.titles=n),Object.keys(h.filters).length>0){const e=[];Object.entries(h.filters).forEach(([t,n])=>{n.values&&(Array.isArray(n.values)?n.values.length>0&&e.push({[t]:n.values}):"object"==typeof n.values&&e.push({[t]:n.values}))}),e.length>0&&(i.filter={and:e})}const a={query:i},l={provider:u,title:p.trim(),definition:{provider:u,doc:a,parameters:{base_currency:"EUR"}}};console.log("Saving report definition:",l),e?(await jc.updateReportDefinition({id:e,reportDefinition:l}),o.success("Report definition updated successfully!")):(await jc.createReportDefinition({reportDefinition:l}),o.success("Report definition created successfully!")),r&&r()}catch(e){console.error("Error saving report definition:",e),o.error("Error saving report definition: "+(e.message||"Unknown error"))}finally{O(!1)}else o.warning("Please add at least one dimension or metric");else o.warning("Please enter a report title");else o.warning("Please select a provider first")},disabled:!H||I,sx:{height:"40px"}},I?"Saving...":e?"Update Report":"Save Report")),u&&c.createElement(jw,{sx:{mt:4}},c.createElement(jw,{sx:{borderBottom:1,borderColor:"divider"}},c.createElement(WE,{value:M,onChange:(e,t)=>{T(t)},"aria-label":"report builder tabs"},c.createElement(Jk,{label:c.createElement(Nw,{badgeContent:h.dimensions.length,color:"primary"},c.createElement("span",{style:{marginRight:h.dimensions.length>0?"12px":"0"}},"Dimensions")),id:"report-tab-0","aria-controls":"report-tabpanel-0"}),c.createElement(Jk,{label:c.createElement(Nw,{badgeContent:h.metrics.length,color:"primary"},c.createElement("span",{style:{marginRight:h.metrics.length>0?"12px":"0"}},"Metrics")),id:"report-tab-1","aria-controls":"report-tabpanel-1"}),c.createElement(Jk,{label:c.createElement(Nw,{badgeContent:Object.keys(h.filters).length,color:"secondary"},c.createElement("span",{style:{marginRight:Object.keys(h.filters).length>0?"12px":"0"}},"Filters")),id:"report-tab-2","aria-controls":"report-tabpanel-2"}),c.createElement(Jk,{label:b?"Results":"Results (Run report first)",id:"report-tab-3","aria-controls":"report-tabpanel-3",disabled:!b}))),c.createElement(mQ,{value:M,index:0},c.createElement(cU,{providersData:a,rootProvider:u,savedDimensions:h.dimensions,onSaveDimension:e=>{m(t=>{const n={...t,dimensions:[...t.dimensions,e]};return console.log("Dimension saved:",e),console.log("Complete report:",n),n})},onRemoveDimension:e=>{m(t=>({...t,dimensions:t.dimensions.filter((t,n)=>n!==e)}))},onReorderDimensions:e=>{m(t=>({...t,dimensions:e}))},titleOverrides:g.dimensions,onUpdateTitle:(e,t)=>{v(n=>({...n,dimensions:{...n.dimensions,[e]:t}}))},onResetTitle:e=>{v(t=>{const n={...t.dimensions};return delete n[e],{...t,dimensions:n}})},existingMetrics:h.metrics,existingFilters:h.filters})),c.createElement(mQ,{value:M,index:1},c.createElement(dU,{providersData:a,rootProvider:u,savedMetrics:h.metrics,onSaveMetric:e=>{m(t=>{const n={...t,metrics:[...t.metrics,e]};return console.log("Metric saved:",e),console.log("Complete report:",n),n})},onRemoveMetric:e=>{m(t=>({...t,metrics:t.metrics.filter((t,n)=>n!==e)}))},onReorderMetrics:e=>{m(t=>({...t,metrics:e}))},titleOverrides:g.metrics,onUpdateTitle:(e,t)=>{v(n=>({...n,metrics:{...n.metrics,[e]:t}}))},onResetTitle:e=>{v(t=>{const n={...t.metrics};return delete n[e],{...t,metrics:n}})},existingDimensions:h.dimensions,existingFilters:h.filters})),c.createElement(mQ,{value:M,index:2},c.createElement(fQ,{providersData:a,rootProvider:u,savedFilters:h.filters,existingDimensions:h.dimensions,existingMetrics:h.metrics,onSaveFilter:(e,t)=>{m(n=>{const r={...n,filters:{...n.filters,[e]:t}};return console.log("Filter saved:",{fullPath:e,filterData:t}),console.log("Complete report:",r),r})},onRemoveFilter:e=>{m(t=>{const n={...t.filters};return delete n[e],{...t,filters:n}})},titleOverrides:g.filters,onUpdateTitle:(e,t)=>{v(n=>({...n,filters:{...n.filters,[e]:t}}))},onResetTitle:e=>{v(t=>{const n={...t.filters};return delete n[e],{...t,filters:n}})}})),c.createElement(mQ,{value:M,index:3},b&&c.createElement(hQ,{reportData:b,dimensions:h.dimensions,metrics:h.metrics,loading:w,onPageChange:async(e,t)=>{E(e),t!==R&&P(t),await j(e,t)},totalRows:S,titleOverrides:g}))))},vQ=()=>{const[e,t]=s.useState("list"),[n,r]=s.useState(null),[o,i]=s.useState(null),[a,l]=s.useState(!1),[u,d]=s.useState(0),p=e=>{r(e),i(null),l(!1),t("builder")},f=()=>{r(null),i(null),l(!1),t("builder")},h=e=>{r(e),i(null),l(!0),t("builder")},m=e=>{r(null),i(e),l(!1),t("builder")};return"list"===e?c.createElement(wH,{onSelectReport:p,onAddNew:f,onCloneReport:m,onRunReport:h,refreshTrigger:u}):c.createElement(gQ,{reportDefinitionId:n,cloneData:o,autoRun:a,onBackToList:()=>{r(null),i(null),l(!1),t("list"),d(e=>e+1)}})};var bQ={Chart:yR,Dashboard:function({id:e="sample_dashboard",api:t,params:n}){const r=SR(),o=t||r?.api||{},i=n||r?.parameters||{},[a,l]=c.useState(),[u]=c.useState(),[d,p]=c.useState([]),f=c.useRef({}),h=vR();bR(h),console.log({rows:d},{dashboard:a},{schema:u},{params:i}),s.useEffect(()=>{jc.setBaseUrl(o.base_url),jc.setToken(o.token)},[o]);const m=async e=>{const t=e?.doc?.rows||[],n=[];for(let e=0;e<t.length;e++){const r=t[e];r.columns?.forEach(e=>{if(e.override?.filter?.length){const t={};e.override.filter.forEach(e=>{e.hasOwnProperty("value")&&(t[e.field]=[e.value])}),e.filter=t}}),n.push(r)}p(n)};return c.useEffect(()=>{e&&(async()=>{jc.setBaseUrl(o.base_url),jc.setToken(o.token),await jc.loadDashboardMeta({dashboardId:e});const t=await jc.getDashboard({id:e});f.current[t?.id]=t,l(t),await m(t)})().catch(e=>console.error(e.message))},[e]),c.createElement(mi,{maxWidth:!1,disableGutters:!0},c.createElement(qi,{container:!0,spacing:3},d?.map((e,t)=>{const n=(e=>0===e?12:12/e)(e.columns.length);return c.createElement(c.Fragment,{key:t},1===t?c.createElement(qi,{item:!0,xs:12},c.createElement(qi,{container:!0,spacing:3},e.columns.map((e,t)=>c.createElement(qi,{key:t,item:!0,xs:12,md:n},c.createElement(yR,{api:o,cache:f.current,id:e.id,dashboard:a,schema:u,title:e.title,filter:e.filter,params:i}))))):e.columns.map((e,t)=>c.createElement(qi,{key:t,item:!0,xs:12,md:n},c.createElement(yR,{api:o,cache:f.current,id:e.id,dashboard:a,schema:u,title:e.title,filter:e.filter,params:i}))))})))},ReportApp:({params:e,api:t})=>(jc._initialized||(jc.setBaseUrl(t.base_url),jc.setToken(t.token),jc._initialized=!0),s.useEffect(()=>{jc.setBaseUrl(t.base_url),jc.setToken(t.token)},[t]),c.createElement(kR,null,c.createElement(xR,{defaultParameters:e,defaultApi:t},c.createElement(vQ,null))))};return bQ}();