jmapcloud-ng 2.0.5-qa.5 → 2.0.5-qa.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/package.json +1 -3
  2. package/public/{ng/build/index.html → index.html} +12 -7
  3. package/public/index.js +190 -0
  4. package/public/ng-core/{build/index.html → index.html} +11 -9
  5. package/public/ng-core/index.js +159 -0
  6. package/.env.example +0 -14
  7. package/public/ng/data-grid.CZXBnpSI.js +0 -1
  8. package/public/ng/html2canvas.esm.BcSe2Xmo.js +0 -1
  9. package/public/ng/index.Dog3_S0j.js +0 -2
  10. package/public/ng/index.es.DITumWjq.js +0 -1
  11. package/public/ng/jspdf.es.min.DHuu4hbj.js +0 -2
  12. package/public/ng/purify.es.IvdpZz4l.js +0 -1
  13. package/public/ng/shared-helpers.D1OtmvKm.js +0 -1
  14. package/public/ng/start.core.CjYO82wC.js +0 -1
  15. package/public/ng/start.core.DQPF01Tt.js +0 -1
  16. package/public/ng/start.ewrrhV85.css +0 -1
  17. package/public/ng/ui-full.BGSOFjZi.js +0 -190
  18. package/public/ng/ui-full.CP0fGfFR.css +0 -1
  19. package/public/ng/vite-preload-helper.CmrNfjeq.js +0 -1
  20. package/public/ng/xlsx.Bf_Vk0xj.js +0 -1
  21. package/public/ng-core/html2canvas.esm.BcSe2Xmo.js +0 -1
  22. package/public/ng-core/index.DAGAIr0b.css +0 -1
  23. package/public/ng-core/index.d3c3ba1a-922f-42b4-810c-a42a72421f2b.js +0 -158
  24. package/public/ng-core/shared-helpers.DZ3ws_zM.js +0 -1
  25. package/public/ng-core/start.core.Bc6LsoEP.js +0 -1
  26. package/public/ng-core/vite-preload-helper.CqTjqO7g.js +0 -1
  27. /package/public/{ng/ARROW.9V9mH5sV.png → ARROW.9V9mH5sV.png} +0 -0
  28. /package/public/{ng/MaterialIcons-Regular.BjVsc-s9.woff2 → MaterialIcons-Regular.BjVsc-s9.woff2} +0 -0
  29. /package/public/{ng/MaterialIcons-Regular.Bnsxcfr1.woff → MaterialIcons-Regular.Bnsxcfr1.woff} +0 -0
  30. /package/public/{ng/MaterialIcons-Regular.N21pKt8_.ttf → MaterialIcons-Regular.N21pKt8_.ttf} +0 -0
  31. /package/public/{ng/MaterialIcons-Regular.rDPjWPoz.eot → MaterialIcons-Regular.rDPjWPoz.eot} +0 -0
  32. /package/public/{ng/barlow-v5-latin-ext_latin-300.BOtJevCE.woff → barlow-v5-latin-ext_latin-300.BOtJevCE.woff} +0 -0
  33. /package/public/{ng/barlow-v5-latin-ext_latin-300.CU1HK-bZ.ttf → barlow-v5-latin-ext_latin-300.CU1HK-bZ.ttf} +0 -0
  34. /package/public/{ng/barlow-v5-latin-ext_latin-300.DLZg2Aqw.woff2 → barlow-v5-latin-ext_latin-300.DLZg2Aqw.woff2} +0 -0
  35. /package/public/{ng/barlow-v5-latin-ext_latin-300.f3X_qAHv.eot → barlow-v5-latin-ext_latin-300.f3X_qAHv.eot} +0 -0
  36. /package/public/{ng/barlow-v5-latin-ext_latin-300italic.Cq3R63xm.eot → barlow-v5-latin-ext_latin-300italic.Cq3R63xm.eot} +0 -0
  37. /package/public/{ng/barlow-v5-latin-ext_latin-300italic.D7H-NYlV.woff → barlow-v5-latin-ext_latin-300italic.D7H-NYlV.woff} +0 -0
  38. /package/public/{ng/barlow-v5-latin-ext_latin-300italic.IFGWg-1n.ttf → barlow-v5-latin-ext_latin-300italic.IFGWg-1n.ttf} +0 -0
  39. /package/public/{ng/barlow-v5-latin-ext_latin-300italic.egA3zdlg.woff2 → barlow-v5-latin-ext_latin-300italic.egA3zdlg.woff2} +0 -0
  40. /package/public/{ng/barlow-v5-latin-ext_latin-500.C4YXkooW.ttf → barlow-v5-latin-ext_latin-500.C4YXkooW.ttf} +0 -0
  41. /package/public/{ng/barlow-v5-latin-ext_latin-500.CD6t94O0.woff2 → barlow-v5-latin-ext_latin-500.CD6t94O0.woff2} +0 -0
  42. /package/public/{ng/barlow-v5-latin-ext_latin-500.CxOfqZC2.eot → barlow-v5-latin-ext_latin-500.CxOfqZC2.eot} +0 -0
  43. /package/public/{ng/barlow-v5-latin-ext_latin-500.CzPrU5vz.woff → barlow-v5-latin-ext_latin-500.CzPrU5vz.woff} +0 -0
  44. /package/public/{ng/barlow-v5-latin-ext_latin-500italic.57LLgqjl.woff → barlow-v5-latin-ext_latin-500italic.57LLgqjl.woff} +0 -0
  45. /package/public/{ng/barlow-v5-latin-ext_latin-500italic.B6ytA4Ll.ttf → barlow-v5-latin-ext_latin-500italic.B6ytA4Ll.ttf} +0 -0
  46. /package/public/{ng/barlow-v5-latin-ext_latin-500italic.BlgFPUrR.woff2 → barlow-v5-latin-ext_latin-500italic.BlgFPUrR.woff2} +0 -0
  47. /package/public/{ng/barlow-v5-latin-ext_latin-500italic.Ckyh_717.eot → barlow-v5-latin-ext_latin-500italic.Ckyh_717.eot} +0 -0
  48. /package/public/{ng/barlow-v5-latin-ext_latin-700.BRgY-mcC.eot → barlow-v5-latin-ext_latin-700.BRgY-mcC.eot} +0 -0
  49. /package/public/{ng/barlow-v5-latin-ext_latin-700.Bit82amp.ttf → barlow-v5-latin-ext_latin-700.Bit82amp.ttf} +0 -0
  50. /package/public/{ng/barlow-v5-latin-ext_latin-700.BpBhuUVz.woff → barlow-v5-latin-ext_latin-700.BpBhuUVz.woff} +0 -0
  51. /package/public/{ng/barlow-v5-latin-ext_latin-700.DC603mJ6.woff2 → barlow-v5-latin-ext_latin-700.DC603mJ6.woff2} +0 -0
  52. /package/public/{ng/barlow-v5-latin-ext_latin-700italic.Ca79JvF0.woff → barlow-v5-latin-ext_latin-700italic.Ca79JvF0.woff} +0 -0
  53. /package/public/{ng/barlow-v5-latin-ext_latin-700italic.ClCyBg9U.woff2 → barlow-v5-latin-ext_latin-700italic.ClCyBg9U.woff2} +0 -0
  54. /package/public/{ng/barlow-v5-latin-ext_latin-700italic.D8ZJZUNK.eot → barlow-v5-latin-ext_latin-700italic.D8ZJZUNK.eot} +0 -0
  55. /package/public/{ng/barlow-v5-latin-ext_latin-700italic.DqT2IX-q.ttf → barlow-v5-latin-ext_latin-700italic.DqT2IX-q.ttf} +0 -0
  56. /package/public/{ng/barlow-v5-latin-ext_latin-italic.1jYUkYRv.woff2 → barlow-v5-latin-ext_latin-italic.1jYUkYRv.woff2} +0 -0
  57. /package/public/{ng/barlow-v5-latin-ext_latin-italic.BEAJKPKF.ttf → barlow-v5-latin-ext_latin-italic.BEAJKPKF.ttf} +0 -0
  58. /package/public/{ng/barlow-v5-latin-ext_latin-italic.BWD2mhUL.woff → barlow-v5-latin-ext_latin-italic.BWD2mhUL.woff} +0 -0
  59. /package/public/{ng/barlow-v5-latin-ext_latin-italic.DjOUzQd-.eot → barlow-v5-latin-ext_latin-italic.DjOUzQd-.eot} +0 -0
  60. /package/public/{ng/barlow-v5-latin-ext_latin-regular.B3onXd7t.ttf → barlow-v5-latin-ext_latin-regular.B3onXd7t.ttf} +0 -0
  61. /package/public/{ng/barlow-v5-latin-ext_latin-regular.Ca4dJCbb.woff2 → barlow-v5-latin-ext_latin-regular.Ca4dJCbb.woff2} +0 -0
  62. /package/public/{ng/barlow-v5-latin-ext_latin-regular.D-IiuhnY.eot → barlow-v5-latin-ext_latin-regular.D-IiuhnY.eot} +0 -0
  63. /package/public/{ng/barlow-v5-latin-ext_latin-regular.DLT4q60S.woff → barlow-v5-latin-ext_latin-regular.DLT4q60S.woff} +0 -0
  64. /package/public/{ng/default.Ce_Z_JPs.jpeg → default.Ce_Z_JPs.jpeg} +0 -0
  65. /package/public/{ng/favicon_dark.BF6q4K7_.ico → favicon_dark.BF6q4K7_.ico} +0 -0
  66. /package/public/{ng/favicon_light.P7XKPcl8.ico → favicon_light.P7XKPcl8.ico} +0 -0
  67. /package/public/{ng/loading.BSbPtkHb.gif → loading.BSbPtkHb.gif} +0 -0
  68. /package/public/{ng/logo.hwi8NCH2.png → logo.hwi8NCH2.png} +0 -0
@@ -1 +0,0 @@
1
- import{r as e,u as t,c as r,f as n,g as o,e as l,j as i,h as a,i as s,s as u,I as c,k as d,l as p,A as g,m as h,C as m,G as C,P as b,n as w,o as v,M as x,p as R,q as y,t as S,v as I,w as M,x as P,d as k,y as D,z as E,B as F,S as G,D as H,E as T,F as O,H as L,J as A,K as j,L as $,N as z,O as V,Q as N,R as B,T as _,U as W,V as U,W as q,X as K,Y as X,Z as Y,_ as Q,$ as J,a0 as Z,a1 as ee,a2 as te,a3 as re,a4 as ne,a5 as oe,a6 as le,a7 as ie,a8 as ae,a9 as se,aa as ue,ab as ce,ac as de,ad as pe,ae as ge,af as fe,ag as he,ah as me,ai as Ce,aj as be,ak as we,al as ve,am as xe,an as Re,ao as ye,ap as Se,aq as Ie,ar as Me,as as Pe,at as ke,au as De,av as Ee,aw as Fe,ax as Ge,ay as He,az as Te,aA as Oe,aB as Le,aC as Ae,aD as je,aE as $e,aF as ze,aG as Ve,aH as Ne,aI as Be,aJ as _e,aK as We,aL as Ue,aM as qe,aN as Ke,aO as Xe,aP as Ye,aQ as Qe,aR as Je}from"./ui-full.BGSOFjZi.js";import{R as Ze}from"./start.core.DQPF01Tt.js";import{_ as et,b as tt,s as rt,g as nt,t as ot}from"./shared-helpers.D1OtmvKm.js";var lt,it={};function requireFaPlusLarge(){return lt||(lt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});var t="plus-large",r=[],n="e59e",o="M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 192-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0 0 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-192 192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-192 0 0-192z";e.definition={prefix:"fas",iconName:t,icon:[512,512,r,n,o]},e.faPlusLarge=e.definition,e.prefix="fas",e.iconName=t,e.width=512,e.height=512,e.ligatures=r,e.unicode=n,e.svgPathData=o,e.aliases=r}(it)),it}var at=requireFaPlusLarge(),st=Symbol("NOT_FOUND");var ensureIsArray=e=>Array.isArray(e)?e:[e];function getDependencies(e){const t=Array.isArray(e[0])?e[0]:e;return function assertIsArrayOfFunctions(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){const r=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw new TypeError(`${t}[${r}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}var referenceEqualityCheck=(e,t)=>e===t;function lruMemoize(e,t){const r="object"==typeof t?t:{equalityCheck:t},{equalityCheck:n=referenceEqualityCheck,maxSize:o=1,resultEqualityCheck:l}=r,i=function createCacheKeyComparator(e){return function areArgumentsShallowlyEqual(t,r){if(null===t||null===r||t.length!==r.length)return!1;const{length:n}=t;for(let o=0;o<n;o++)if(!e(t[o],r[o]))return!1;return!0}}(n);let a=0;const s=o<=1?function createSingletonCache(e){let t;return{get:r=>t&&e(t.key,r)?t.value:st,put(e,r){t={key:e,value:r}},getEntries:()=>t?[t]:[],clear(){t=void 0}}}(i):function createLruCache(e,t){let r=[];function get(e){const n=r.findIndex(r=>t(e,r.key));if(n>-1){const e=r[n];return n>0&&(r.splice(n,1),r.unshift(e)),e.value}return st}return{get,put:function put(t,n){get(t)===st&&(r.unshift({key:t,value:n}),r.length>e&&r.pop())},getEntries:function getEntries(){return r},clear:function clear(){r=[]}}}(o,i);function memoized(){let t=s.get(arguments);if(t===st){if(t=e.apply(null,arguments),a++,l){const e=s.getEntries().find(e=>l(e.value,t));e&&(t=e.value,0!==a&&a--)}s.put(arguments,t)}return t}return memoized.clearCache=()=>{s.clear(),memoized.resetResultsCount()},memoized.resultsCount=()=>a,memoized.resetResultsCount=()=>{a=0},memoized}var ut="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function createCacheNode(){return{s:0,v:void 0,o:null,p:null}}function weakMapMemoize(e,t={}){let r={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:n}=t;let o,l=0;function memoized(){let t=r;const{length:i}=arguments;for(let e=0,r=i;e<r;e++){const r=arguments[e];if("function"==typeof r||"object"==typeof r&&null!==r){let e=t.o;null===e&&(t.o=e=new WeakMap);const n=e.get(r);void 0===n?(t=createCacheNode(),e.set(r,t)):t=n}else{let e=t.p;null===e&&(t.p=e=new Map);const n=e.get(r);void 0===n?(t=createCacheNode(),e.set(r,t)):t=n}}const a=t;let s;if(1===t.s)s=t.v;else if(s=e.apply(null,arguments),l++,n){const e=o?.deref?.()??o;null!=e&&n(e,s)&&(s=e,0!==l&&l--);o="object"==typeof s&&null!==s||"function"==typeof s?new ut(s):s}return a.s=1,a.v=s,s}return memoized.clearCache=()=>{r={s:0,v:void 0,o:null,p:null},memoized.resetResultsCount()},memoized.resultsCount=()=>l,memoized.resetResultsCount=()=>{l=0},memoized}function createSelectorCreator(e,...t){const r="function"==typeof e?{memoize:e,memoizeOptions:t}:e,createSelector2=(...e)=>{let t,n=0,o=0,l={},i=e.pop();"object"==typeof i&&(l=i,i=e.pop()),function assertIsFunction(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(i,`createSelector expects an output function after the inputs, but received: [${typeof i}]`);const a={...r,...l},{memoize:s,memoizeOptions:u=[],argsMemoize:c=weakMapMemoize,argsMemoizeOptions:d=[]}=a,p=ensureIsArray(u),g=ensureIsArray(d),h=getDependencies(e),m=s(function recomputationWrapper(){return n++,i.apply(null,arguments)},...p),C=c(function dependenciesChecker(){o++;const e=function collectInputSelectorResults(e,t){const r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}(h,arguments);return t=m.apply(null,e),t},...g);return Object.assign(C,{resultFunc:i,memoizedResultFunc:m,dependencies:h,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>n,resetRecomputations:()=>{n=0},memoize:s,argsMemoize:c})};return Object.assign(createSelector2,{withTypes:()=>createSelector2}),createSelector2}var ct,dt,pt=createSelectorCreator(weakMapMemoize),gt=Object.assign((e,t=pt)=>{!function assertIsObject(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 r=Object.keys(e);return t(r.map(t=>e[t]),(...e)=>e.reduce((e,t,n)=>(e[r[n]]=t,e),{}))},{withTypes:()=>gt}),ft={exports:{}},ht={};var mt=function requireShim(){return dt||(dt=1,ft.exports=function requireUseSyncExternalStoreShim_production(){if(ct)return ht;ct=1;var t=e(),r="function"==typeof Object.is?Object.is:function is(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=t.useState,o=t.useEffect,l=t.useLayoutEffect,i=t.useDebugValue;function checkIfSnapshotChanged(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(o){return!0}}var a="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function useSyncExternalStore$1(e,t){return t()}:function useSyncExternalStore$2(e,t){var r=t(),a=n({inst:{value:r,getSnapshot:t}}),s=a[0].inst,u=a[1];return l(function(){s.value=r,s.getSnapshot=t,checkIfSnapshotChanged(s)&&u({inst:s})},[e,r,t]),o(function(){return checkIfSnapshotChanged(s)&&u({inst:s}),e(function(){checkIfSnapshotChanged(s)&&u({inst:s})})},[e]),i(r),r};return ht.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:a,ht}()),ft.exports}();function isOutputSelector(e){return e.acceptsApiRef}function applySelector(e,t){return isOutputSelector(t)?t(e):t(e.current.state)}function applySelectorV8(e,t,r,n){return isOutputSelector(t)?t(e,r):t(e.current.state,n)}const Ct=Object.is,bt=n,arrayShallowCompare=(e,t)=>e===t||e.length===t.length&&e.every((e,r)=>e===t[r]),createRefs=()=>({state:null,equals:null,selector:null,args:void 0}),wt=[],emptyGetSnapshot=()=>null,useGridSelector=(e,n,o=Ct)=>{const l=t(createRefs),i=null!==l.current.selector,[a,s]=r.useState(i?null:applySelector(e,n));l.current.state=a,l.current.equals=o,l.current.selector=n;const u=r.useCallback(()=>(l.current.subscription||(l.current.subscription=e.current.store.subscribe(()=>{const t=applySelector(e,l.current.selector);l.current.equals(l.current.state,t)||(l.current.state=t,s(t))})),null),wt),c=r.useCallback(()=>()=>{l.current.subscription&&(l.current.subscription(),l.current.subscription=void 0)},wt);return mt.useSyncExternalStore(c,u,emptyGetSnapshot),a},useGridSelectorV8=(e,n,o=void 0,l=Ct)=>{const i=t(createRefs),a=null!==i.current.selector,[s,u]=r.useState(a?null:applySelectorV8(e,n,o,e.current.instanceId));i.current.state=s,i.current.equals=l,i.current.selector=n;const c=i.current.args;if(i.current.args=o,a&&!((e,t)=>{let r=Object.is;return t instanceof Array?r=arrayShallowCompare:t instanceof Object&&(r=bt),r(e,t)})(c,o)){const t=applySelectorV8(e,i.current.selector,i.current.args,e.current.instanceId);i.current.equals(i.current.state,t)||(i.current.state=t,u(t))}const d=r.useCallback(()=>(i.current.subscription||(i.current.subscription=e.current.store.subscribe(()=>{const t=applySelectorV8(e,i.current.selector,i.current.args,e.current.instanceId);i.current.equals(i.current.state,t)||(i.current.state=t,u(t))})),null),wt),p=r.useCallback(()=>()=>{i.current.subscription&&(i.current.subscription(),i.current.subscription=void 0)},wt);return mt.useSyncExternalStore(p,d,emptyGetSnapshot),s},vt=createSelectorCreator({memoize:lruMemoize,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),xt=new WeakMap;function checkIsAPIRef(e){return"current"in e&&"instanceId"in e.current}const Rt={id:"default"},createSelector=(e,t,r,n,o,l,...i)=>{if(i.length>0)throw new Error("Unsupported number of selectors");let a;if(e&&t&&r&&n&&o&&l)a=(i,a)=>{const s=checkIsAPIRef(i),u=a??(s?i.current.instanceId:Rt),c=s?i.current.state:i,d=e(c,u),p=t(c,u),g=r(c,u),h=n(c,u),m=o(c,u);return l(d,p,g,h,m)};else if(e&&t&&r&&n&&o)a=(l,i)=>{const a=checkIsAPIRef(l),s=i??(a?l.current.instanceId:Rt),u=a?l.current.state:l,c=e(u,s),d=t(u,s),p=r(u,s),g=n(u,s);return o(c,d,p,g)};else if(e&&t&&r&&n)a=(o,l)=>{const i=checkIsAPIRef(o),a=l??(i?o.current.instanceId:Rt),s=i?o.current.state:o,u=e(s,a),c=t(s,a),d=r(s,a);return n(u,c,d)};else if(e&&t&&r)a=(n,o)=>{const l=checkIsAPIRef(n),i=o??(l?n.current.instanceId:Rt),a=l?n.current.state:n,s=e(a,i),u=t(a,i);return r(s,u)};else{if(!e||!t)throw new Error("Missing arguments");a=(r,n)=>{const o=checkIsAPIRef(r),l=n??(o?r.current.instanceId:Rt),i=o?r.current.state:r,a=e(i,l);return t(a)}}return a.acceptsApiRef=!0,a},createSelectorV8=(e,t,r,n,o,l,...i)=>{if(i.length>0)throw new Error("Unsupported number of selectors");let a;if(!e||!t)throw new Error("Missing arguments");return a=(r,n,o)=>{const l=checkIsAPIRef(r),i=o??(l?r.current.instanceId:Rt),a=l?r.current.state:r,s=e(a,n,i);return t(s,n)},a.acceptsApiRef=!0,a},createSelectorMemoized=(...e)=>{const selector=(t,r)=>{const n=checkIsAPIRef(t),o=n?t.current.instanceId:r??Rt,l=n?t.current.state:t,i=xt.get(o),a=i??new Map,s=a?.get(e);if(a&&s)return s(l,o);const u=vt(...e);return i||xt.set(o,a),a.set(e,u),u(l,o)};return selector.acceptsApiRef=!0,selector},gridDimensionsSelector=e=>e.dimensions,yt=createSelector(gridDimensionsSelector,e=>e.columnsTotalWidth),gridRowHeightSelector=e=>e.dimensions.rowHeight,gridContentHeightSelector=e=>e.dimensions.contentSize.height,gridHasScrollXSelector=e=>e.dimensions.hasScrollX,gridHasScrollYSelector=e=>e.dimensions.hasScrollY,gridHasFillerSelector=e=>e.dimensions.columnsTotalWidth<e.dimensions.viewportOuterSize.width,gridHeaderHeightSelector=e=>e.dimensions.headerHeight,gridGroupHeaderHeightSelector=e=>e.dimensions.groupHeaderHeight,gridHeaderFilterHeightSelector=e=>e.dimensions.headerFilterHeight,gridVerticalScrollbarWidthSelector=e=>e.dimensions.hasScrollY?e.dimensions.scrollbarSize:0,gridHasBottomFillerSelector=e=>{const t=e.dimensions.hasScrollX?e.dimensions.scrollbarSize:0,r=e.dimensions.viewportOuterSize.height-e.dimensions.minimumSize.height>0;return!(0===t&&!r)},St=parseInt(r.version,10),forwardRef=e=>{if(St>=19){const Component=t=>e(t,t.ref??null);return Component.displayName=e.displayName??e.name,Component}return r.forwardRef(e)},It=r.createContext(void 0),useGridRootProps$1=()=>{const e=r.useContext(It);if(!e)throw new Error("MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e};function getDataGridUtilityClass(e){return o("MuiDataGrid",e)}const Mt=l("MuiDataGrid",["actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","aggregationColumnHeaderLabel","autoHeight","autosizing","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","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--lastUnpinned","columnHeader--siblingFocused","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeaders","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsManagement","columnsManagementRow","columnsManagementHeader","columnsManagementSearchInput","columnsManagementFooter","container--top","container--bottom","detailPanel","detailPanels","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--hasSkeletonLoadingOverlay","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--dynamicHeight","row--detailPanelExpanded","row--borderBottom","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","rowSkeleton","scrollArea--left","scrollArea--right","scrollArea--up","scrollArea--down","scrollArea","scrollbar","scrollbar--vertical","scrollbar--horizontal","scrollbarFiller","scrollbarFiller--header","scrollbarFiller--borderTop","scrollbarFiller--borderBottom","scrollbarFiller--pinnedRight","selectedRowCount","sortButton","sortIcon","toolbarContainer","toolbarFilterList","virtualScroller","virtualScroller--hasScrollX","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","pinnedColumns","withVerticalBorder","withBorderColor","cell--withRightBorder","cell--withLeftBorder","columnHeader--withRightBorder","columnHeader--withLeftBorder","treeDataGroupingCell","treeDataGroupingCellToggle","treeDataGroupingCellLoadingContainer","groupingCriteriaCell","groupingCriteriaCellToggle","groupingCriteriaCellLoadingContainer","pinnedRows","pinnedRows--top","pinnedRows--bottom","pinnedRowsRenderZone"]),Pt=r.createContext(void 0);function useGridApiContext$1(){const e=r.useContext(Pt);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}class TimerBasedCleanupTracking{constructor(e=1e3){this.timeouts=new Map,this.cleanupTimeout=1e3,this.cleanupTimeout=e}register(e,t,r){this.timeouts||(this.timeouts=new Map);const n=setTimeout(()=>{"function"==typeof t&&t(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,n)}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 FinalizationRegistryBasedCleanupTracking{constructor(){this.registry=new FinalizationRegistry(e=>{"function"==typeof e&&e()})}register(e,t,r){this.registry.register(e,t,r)}unregister(e){this.registry.unregister(e)}reset(){}}var kt=function(e){return e.DataGrid="DataGrid",e.DataGridPro="DataGridPro",e.DataGridPremium="DataGridPremium",e}(kt||{});class ObjectToBeRetainedByReact{}const Dt=function createUseGridApiEventHandler(e){let t=0;return function useGridApiEventHandler2(n,o,l,i){null===e.registry&&(e.registry="undefined"!=typeof FinalizationRegistry?new FinalizationRegistryBasedCleanupTracking:new TimerBasedCleanupTracking);const[a]=r.useState(new ObjectToBeRetainedByReact),s=r.useRef(null),u=r.useRef(null);u.current=l;const c=r.useRef(null);if(!s.current&&u.current){const enhancedHandler=(e,t,r)=>{t&&!t.defaultMuiPrevented&&u.current?.(e,t,r)};s.current=n.current.subscribeEvent(o,enhancedHandler,i),t+=1,c.current={cleanupToken:t},e.registry.register(a,()=>{s.current?.(),s.current=null,c.current=null},c.current)}else!u.current&&s.current&&(s.current(),s.current=null,c.current&&(e.registry.unregister(c.current),c.current=null));r.useEffect(()=>{if(!s.current&&u.current){const enhancedHandler=(e,t,r)=>{t&&!t.defaultMuiPrevented&&u.current?.(e,t,r)};s.current=n.current.subscribeEvent(o,enhancedHandler,i)}return c.current&&e.registry&&(e.registry.unregister(c.current),c.current=null),()=>{s.current?.(),s.current=null}},[n,o,i])}}({registry:null}),Et={isFirst:!0};function useGridApiOptionHandler(e,t,r){Dt(e,t,r,Et)}const Ft={compact:.7,comfortable:1.3,standard:1},gridDensitySelector=e=>e.density,Gt=createSelector(gridDensitySelector,e=>Ft[e]),Ht=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange"],Tt=u(c,{name:"MuiDataGrid",slot:"EditInputCell",overridesResolver:(e,t)=>t.editInputCell})(({theme:e})=>et({},e.typography.body2,{padding:"1px 0","& input":{padding:"0 16px",height:"100%"}})),Ot=forwardRef((e,t)=>{const n=useGridRootProps$1(),{id:o,value:l,field:u,colDef:c,hasFocus:d,debounceMs:p=200,isProcessingProps:g,onValueChange:h}=e,m=tt(e,Ht),C=useGridApiContext$1(),b=r.useRef(null),[w,v]=r.useState(l),x=(e=>{const{classes:t}=e;return s({root:["editInputCell"]},getDataGridUtilityClass,t)})(n),R=r.useCallback(async e=>{const t=e.target.value;h&&await h(e,t);const r=C.current.getColumn(u);let n=t;r.valueParser&&(n=r.valueParser(t,C.current.getRow(o),r,C)),v(n),C.current.setEditCellValue({id:o,field:u,value:n,debounceMs:p,unstable_skipValueParser:!0},e)},[C,p,u,o,h]),y=C.current.unstable_getEditCellMeta(o,u);return r.useEffect(()=>{"debouncedSetEditCellValue"!==y?.changeReason&&v(l)},[y,l]),a(()=>{d&&b.current.focus()},[d]),i.jsx(Tt,et({inputRef:b,className:x.root,ownerState:n,fullWidth:!0,type:"number"===c.type?c.type:"text",value:w??"",onChange:R,endAdornment:g?i.jsx(n.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},m,{ref:t}))}),gridRowsStateSelector=e=>e.rows,Lt=createSelector(gridRowsStateSelector,e=>e.totalRowCount),At=createSelector(gridRowsStateSelector,e=>e.loading),jt=createSelector(gridRowsStateSelector,e=>e.totalTopLevelRowCount),$t=createSelector(gridRowsStateSelector,e=>e.dataRowIdToModelLookup),zt=createSelector(gridRowsStateSelector,e=>e.dataRowIdToIdLookup),Vt=createSelector(gridRowsStateSelector,e=>e.tree),Nt=createSelector(gridRowsStateSelector,e=>e.groupsToFetch),Bt=createSelector(gridRowsStateSelector,e=>e.groupingName),_t=createSelector(gridRowsStateSelector,e=>e.treeDepths),Wt=createSelectorMemoized(gridRowsStateSelector,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}),Ut=createSelector(gridRowsStateSelector,e=>e.dataRowIds),qt=createSelectorMemoized(createSelector(gridRowsStateSelector,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??{}}))??[]}}),Kt=createSelector(qt,e=>(e?.top?.length||0)+(e?.bottom?.length||0)),sanitizeSortModel=(e,t)=>t&&e.length>1?[e[0]]:e,mergeStateWithSortModel=(e,t)=>r=>et({},r,{sorting:et({},r.sorting,{sortModel:sanitizeSortModel(e,t)})}),buildAggregatedSortingApplier=(e,t)=>{const r=e.map(e=>((e,t)=>{const r=t.current.getColumn(e.field);if(!r||null===e.sort)return null;let n;return n=r.getSortComparator?r.getSortComparator(e.sort):"desc"===e.sort?(...e)=>-1*r.sortComparator(...e):r.sortComparator,n?{getSortCellParams:e=>({id:e,field:r.field,rowNode:Vt(t)[e],value:t.current.getCellValue(e,r.field),api:t.current}),comparator:n}:null})(e,t)).filter(e=>!!e);return 0===r.length?null:e=>e.map(e=>({node:e,params:r.map(t=>t.getSortCellParams(e.id))})).sort((e,t)=>{return n=e,o=t,r.reduce((e,t,r)=>{if(0!==e)return e;const l=n.params[r],i=o.params[r];return t.comparator(l.value,i.value,l,i)},0);var n,o}).map(e=>e.node.id)},getNextGridSortDirection=(e,t)=>{const r=e.indexOf(t);return t&&-1!==r&&r+1!==e.length?e[r+1]:e[0]},gridNillComparator=(e,t)=>null==e&&null!=t?-1:null==t&&null!=e?1:null==e&&null==t?0:null,Xt=new Intl.Collator,gridNumberComparator=(e,t)=>{const r=gridNillComparator(e,t);return null!==r?r:Number(e)-Number(t)},gridDateComparator=(e,t)=>{const r=gridNillComparator(e,t);return null!==r?r:e>t?1:e<t?-1:0},Yt=["item","applyValue","type","apiRef","focusElementRef","tabIndex","disabled","isFilterActive","clearButton","InputProps","variant"];function GridFilterInputValue(e){const{item:t,applyValue:n,type:o,apiRef:l,focusElementRef:a,tabIndex:s,disabled:u,clearButton:c,InputProps:g,variant:h="standard"}=e,m=tt(e,Yt),C=d(),[b,w]=r.useState(sanitizeFilterItemValue$1(t.value)),[v,x]=r.useState(!1),R=p(),y=useGridRootProps$1(),S=r.useCallback(e=>{const r=sanitizeFilterItemValue$1(e.target.value);w(r),x(!0),C.start(y.filterDebounceMs,()=>{const e=et({},t,{value:"number"!==o||Number.isNaN(Number(r))?r:Number(r),fromInput:R});n(e),x(!1)})},[C,y.filterDebounceMs,t,o,R,n]);return r.useEffect(()=>{t.fromInput===R&&null!=t.value||w(sanitizeFilterItemValue$1(t.value))},[R,t]),i.jsx(y.slots.baseTextField,et({id:R,label:l.current.getLocaleText("filterPanelInputLabel"),placeholder:l.current.getLocaleText("filterPanelInputPlaceholder"),value:b??"",onChange:S,variant:h,type:o||"text",InputProps:et({},v||c?{endAdornment:v?i.jsx(y.slots.loadIcon,{fontSize:"small",color:"action"}):c}:{},{disabled:u},g,{inputProps:et({tabIndex:s},g?.inputProps)}),InputLabelProps:{shrink:!0},inputRef:a},m,y.slotProps?.baseTextField))}function sanitizeFilterItemValue$1(e){if(null!=e&&""!==e)return String(e)}function isObject(e){return"object"==typeof e&&null!==e}function escapeRegExp(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const clamp=(e,t,r)=>Math.max(t,Math.min(r,e));function range(e,t){return Array.from({length:t-e}).map((t,r)=>e+r)}function isDeepEqual(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 r=e.length;if(r!==t.length)return!1;for(let n=0;n<r;n+=1)if(!isDeepEqual(e[n],t[n]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;const r=Array.from(e.entries());for(let e=0;e<r.length;e+=1)if(!t.has(r[e][0]))return!1;for(let e=0;e<r.length;e+=1){const n=r[e];if(!isDeepEqual(n[1],t.get(n[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;const r=Array.from(e.entries());for(let e=0;e<r.length;e+=1)if(!t.has(r[e][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){const r=e.length;if(r!==t.length)return!1;for(let n=0;n<r;n+=1)if(e[n]!==t[n])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 r=Object.keys(e),n=r.length;if(n!==Object.keys(t).length)return!1;for(let e=0;e<n;e+=1)if(!Object.prototype.hasOwnProperty.call(t,r[e]))return!1;for(let o=0;o<n;o+=1){const n=r[o];if(!isDeepEqual(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function deepClone(e){return"function"==typeof structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e))}const runIf=(e,t)=>r=>{e&&t(r)},Qt=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],Jt=["key"];function GridFilterInputMultipleValue(e){const{item:t,applyValue:n,type:o,apiRef:l,focusElementRef:a,color:s,error:u,helperText:c,size:d,variant:h="standard"}=e,m=tt(e,Qt),C={color:s,error:u,helperText:c,size:d,variant:h},[b,w]=r.useState(t.value||[]),v=p(),x=useGridRootProps$1();r.useEffect(()=>{const e=t.value??[];w(e.map(String))},[t.value]);const R=r.useCallback((e,r)=>{w(r.map(String)),n(et({},t,{value:[...r.map(e=>"number"===o?Number(e):e)]}))},[n,t,o]);return i.jsx(g,et({multiple:!0,freeSolo:!0,options:[],filterOptions:(e,t)=>{const{inputValue:r}=t;return null==r||""===r?[]:[r]},id:v,value:b,onChange:R,renderTags:(e,t)=>e.map((e,r)=>{const n=t({index:r}),{key:o}=n,l=tt(n,Jt);return i.jsx(x.slots.baseChip,et({variant:"outlined",size:"small",label:e},l),o)}),renderInput:e=>i.jsx(x.slots.baseTextField,et({},e,{label:l.current.getLocaleText("filterPanelInputLabel"),placeholder:l.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:et({},e.InputLabelProps,{shrink:!0}),inputRef:a,type:o||"text"},C,x.slotProps?.baseTextField))},m))}var Zt=function(e){return e.Cell="cell",e.Row="row",e}(Zt||{}),er=function(e){return e.Edit="edit",e.View="view",e}(er||{}),tr=function(e){return e.Edit="edit",e.View="view",e}(tr||{}),rr=function(e){return e.And="and",e.Or="or",e}(rr||{}),nr=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e.pasteKeyDown="pasteKeyDown",e}(nr||{}),or=function(e){return e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(or||{}),lr=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e}(lr||{}),ir=function(e){return e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(ir||{});function isLeaf(e){return void 0!==e.field}const ar={filteredRowsLookup:{},filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}},getDefaultGridFilterModel=()=>({items:[],logicOperator:rr.And,quickFilterValues:[],quickFilterLogicOperator:rr.And});function getPublicApiRef(e){return{current:e.current.getPublicApi()}}let sr=function(e){return e.LEFT="left",e.RIGHT="right",e}({});const ur={left:[],right:[]},gridIsRtlSelector=e=>e.isRtl,gridColumnsStateSelector=e=>e.columns,cr=createSelector(gridColumnsStateSelector,e=>e.orderedFields),dr=createSelector(gridColumnsStateSelector,e=>e.lookup),pr=createSelectorMemoized(cr,dr,(e,t)=>e.map(e=>t[e])),gr=createSelector(gridColumnsStateSelector,e=>e.columnVisibilityModel),fr=createSelectorMemoized(pr,gr,(e,t)=>e.filter(e=>!1!==t[e.field])),hr=createSelectorMemoized(fr,e=>e.map(e=>e.field)),gridPinnedColumnsSelector=e=>e.pinnedColumns,mr=createSelectorMemoized(gridPinnedColumnsSelector,cr,gridIsRtlSelector,(e,t,r)=>filterMissingColumns(e,t,r)),Cr=createSelectorMemoized(gridColumnsStateSelector,gridPinnedColumnsSelector,hr,gridIsRtlSelector,(e,t,r,n)=>{const o=filterMissingColumns(t,r,n);return{left:o.left.map(t=>e.lookup[t]),right:o.right.map(t=>e.lookup[t])}});function filterMissingColumns(e,t,r){if(!Array.isArray(e.left)&&!Array.isArray(e.right))return ur;if(0===e.left?.length&&0===e.right?.length)return ur;const filter2=(e,t)=>Array.isArray(e)?e.filter(e=>t.includes(e)):[],n=filter2(e.left,t),o=t.filter(e=>!n.includes(e)),l=filter2(e.right,o);return r?{left:l,right:n}:{left:n,right:l}}const br=createSelectorMemoized(fr,e=>{const t=[];let r=0;for(let n=0;n<e.length;n+=1)t.push(r),r+=e[n].computedWidth;return t}),wr=createSelectorMemoized(pr,e=>e.filter(e=>e.filterable)),vr=createSelectorMemoized(pr,e=>e.reduce((e,t)=>(t.filterable&&(e[t.field]=t),e),{})),xr=createSelectorMemoized(pr,e=>e.some(e=>void 0!==e.colSpan));let Rr;const cleanFilterItem=(e,t)=>{const r=et({},e);if(null==r.id&&(r.id=Math.round(1e5*Math.random())),null==r.operator){const e=dr(t)[r.field];r.operator=e&&e.filterOperators[0].value}return r},sanitizeFilterModel=(e,t,r)=>{const n=e.items.length>1;let o;o=n&&t?[e.items[0]]:e.items;const l=n&&o.some(e=>null==e.id);return o.some(e=>null==e.operator)||l?et({},e,{items:o.map(e=>cleanFilterItem(e,r))}):e.items!==o?et({},e,{items:o}):e},mergeStateWithFilterModel=(e,t,r)=>n=>et({},n,{filterModel:sanitizeFilterModel(e,t,r)}),removeDiacritics=e=>"string"==typeof e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,getFilterCallbackFromItem=(e,t)=>{if(!e.field||!e.operator)return null;const r=t.current.getColumn(e.field);if(!r)return null;let n;if(r.valueParser){const o=r.valueParser;n=Array.isArray(e.value)?e.value?.map(e=>o(e,void 0,r,t)):o(e.value,void 0,r,t)}else n=e.value;const{ignoreDiacritics:o}=t.current.rootProps;o&&(n=removeDiacritics(n));const l=et({},e,{value:n}),i=r.filterOperators;if(!i?.length)throw new Error(`MUI X: No filter operators found for column '${r.field}'.`);const a=i.find(e=>e.value===l.operator);if(!a)throw new Error(`MUI X: No filter operator found for column '${r.field}' and operator value '${l.operator}'.`);const s=getPublicApiRef(t),u=a.getApplyFilterFn(l,r);return"function"!=typeof u?null:{item:l,fn:e=>{let n=t.current.getRowValue(e,r);return o&&(n=removeDiacritics(n)),u(n,e,r,s)}}};let yr=1;const buildAggregatedFilterItemsApplier=(e,t,r)=>{const{items:n}=e,o=n.map(e=>getFilterCallbackFromItem(e,t)).filter(e=>!!e);if(0===o.length)return null;if(r||!function getHasEval(){if(void 0!==Rr)return Rr;try{Rr=new Function("return true")()}catch(e){Rr=!1}return Rr}())return(e,t)=>{const r={};for(let n=0;n<o.length;n+=1){const l=o[n];t&&!t(l.item.field)||(r[l.item.id]=l.fn(e))}return r};const l=new Function("appliers","row","shouldApplyFilter",`"use strict";\n${o.map((e,t)=>`const shouldApply${t} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(e.item.field)});`).join("\n")}\n\nconst result$$ = {\n${o.map((e,t)=>` ${JSON.stringify(String(e.item.id))}: !shouldApply${t} ? false : appliers[${t}].fn(row),`).join("\n")}\n};\n\nreturn result$$;`.replaceAll("$$",String(yr)));yr+=1;return(e,t)=>l(o,e,t)},shouldQuickFilterExcludeHiddenColumns=e=>e.quickFilterExcludeHiddenColumns??!0,buildAggregatedFilterApplier=(e,t,r)=>{const n=buildAggregatedFilterItemsApplier(e,t,r),o=((e,t)=>{const r=e.quickFilterValues?.filter(Boolean)??[];if(0===r.length)return null;const n=shouldQuickFilterExcludeHiddenColumns(e)?hr(t):cr(t),o=[],{ignoreDiacritics:l}=t.current.rootProps,i=getPublicApiRef(t);return n.forEach(e=>{const n=t.current.getColumn(e),a=n?.getApplyQuickFilterFn;a&&o.push({column:n,appliers:r.map(e=>{const t=l?removeDiacritics(e):e;return{fn:a(t,n,i)}})})}),function isRowMatchingQuickFilter(e,n){const a={};e:for(let s=0;s<r.length;s+=1){const u=r[s];for(let r=0;r<o.length;r+=1){const{column:c,appliers:d}=o[r],{field:p}=c;if(n&&!n(p))continue;const g=d[s];let h=t.current.getRowValue(e,c);if(null!==g.fn&&(l&&(h=removeDiacritics(h)),g.fn(h,e,c,i))){a[u]=!0;continue e}}a[u]=!1}return a}})(e,t);return function isRowMatchingFilters(e,t,r){r.passingFilterItems=n?.(e,t)??null,r.passingQuickFilterValues=o?.(e,t)??null}},isNotNull=e=>null!=e,passFilterLogic=(e,t,r,n,o)=>{const l=((e,t,r)=>(e.cleanedFilterItems||(e.cleanedFilterItems=r.filter(e=>null!==getFilterCallbackFromItem(e,t))),e.cleanedFilterItems))(o,n,r.items),i=e.filter(isNotNull),a=t.filter(isNotNull);if(i.length>0){const filterItemPredicate=e=>i.some(t=>t[e.id]);if((r.logicOperator??getDefaultGridFilterModel().logicOperator)===rr.And){if(!l.every(filterItemPredicate))return!1}else{if(!l.some(filterItemPredicate))return!1}}if(a.length>0&&null!=r.quickFilterValues){const quickFilterValuePredicate=e=>a.some(t=>t[e]);if((r.quickFilterLogicOperator??getDefaultGridFilterModel().quickFilterLogicOperator)===rr.And){if(!r.quickFilterValues.every(quickFilterValuePredicate))return!1}else{if(!r.quickFilterValues.some(quickFilterValuePredicate))return!1}}return!0},createContainsFilterFn=(e,t)=>r=>{if(!r.value)return null;const n=e?r.value:r.value.trim(),o=new RegExp(escapeRegExp(n),"i");return e=>{if(null==e)return t;const r=o.test(String(e));return t?!r:r}},createEqualityFilterFn=(e,t)=>r=>{if(!r.value)return null;const n=e?r.value:r.value.trim(),o=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return e=>{if(null==e)return t;const r=0===o.compare(n,e.toString());return t?!r:r}},createEmptyFilterFn=e=>()=>t=>{const r=""===t||null==t;return e?!r:r},getGridStringOperators=(e=!1)=>[{value:"contains",getApplyFilterFn:createContainsFilterFn(e,!1),InputComponent:GridFilterInputValue},{value:"doesNotContain",getApplyFilterFn:createContainsFilterFn(e,!0),InputComponent:GridFilterInputValue},{value:"equals",getApplyFilterFn:createEqualityFilterFn(e,!1),InputComponent:GridFilterInputValue},{value:"doesNotEqual",getApplyFilterFn:createEqualityFilterFn(e,!0),InputComponent:GridFilterInputValue},{value:"startsWith",getApplyFilterFn:t=>{if(!t.value)return null;const r=e?t.value:t.value.trim(),n=new RegExp(`^${escapeRegExp(r)}.*$`,"i");return e=>null!=e&&n.test(e.toString())},InputComponent:GridFilterInputValue},{value:"endsWith",getApplyFilterFn:t=>{if(!t.value)return null;const r=e?t.value:t.value.trim(),n=new RegExp(`.*${escapeRegExp(r)}$`,"i");return e=>null!=e&&n.test(e.toString())},InputComponent:GridFilterInputValue},{value:"isEmpty",getApplyFilterFn:createEmptyFilterFn(!1),requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:createEmptyFilterFn(!0),requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:t=>{if(!Array.isArray(t.value)||0===t.value.length)return null;const r=e?t.value:t.value.map(e=>e.trim()),n=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return e=>null!=e&&r.some(t=>0===n.compare(t,e.toString()||""))},InputComponent:GridFilterInputMultipleValue}],Sr={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,editable:!1,sortComparator:(e,t)=>{const r=gridNillComparator(e,t);return null!==r?r:"string"==typeof e?Xt.compare(e.toString(),t.toString()):e-t},type:"string",align:"left",filterOperators:getGridStringOperators(),renderEditCell:e=>i.jsx(Ot,et({},e)),getApplyQuickFilterFn:e=>{if(!e)return null;const t=new RegExp(escapeRegExp(e),"i");return(e,r,n,o)=>{let l=o.current.getRowFormattedValue(r,n);return o.current.ignoreDiacritics&&(l=removeDiacritics(l)),null!=l&&t.test(l.toString())}}},Ir=["open","target","onClose","children","position","className","onExited"],Mr=u(w,{name:"MuiDataGrid",slot:"Menu",overridesResolver:(e,t)=>t.menu})(({theme:e})=>({zIndex:e.zIndex.modal,[`& .${Mt.menuList}`]:{outline:0}})),Pr={"bottom-start":"top left","bottom-end":"top right"};function GridMenu(e){const{open:t,target:n,onClose:o,children:l,position:u,className:c,onExited:d}=e,p=tt(e,Ir),g=useGridApiContext$1(),w=useGridRootProps$1(),v=(e=>{const{classes:t}=e;return s({root:["menu"]},getDataGridUtilityClass,t)})(w),x=r.useRef(null);a(()=>{t?x.current=document.activeElement instanceof HTMLElement?document.activeElement:null:(x.current?.focus?.(),x.current=null)},[t]),r.useEffect(()=>{const e=t?"menuOpen":"menuClose";g.current.publishEvent(e,{target:n})},[g,t,n]);const handleClickAway=e=>{e.target&&(n===e.target||n?.contains(e.target))||o(e)};return i.jsx(Mr,et({as:w.slots.basePopper,className:h(v.root,c),ownerState:w,open:t,anchorEl:n,transition:!0,placement:u},p,w.slotProps?.basePopper,{children:({TransitionProps:e,placement:t})=>{return i.jsx(m,{onClickAway:handleClickAway,mouseEvent:"onMouseDown",children:i.jsx(C,et({},e,{style:{transformOrigin:Pr[t]},onExited:(r=e?.onExited,e=>{r&&r(),d&&d(e)}),children:i.jsx(b,{children:l})}))});var r}}))}const kr=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","focusElementRef"];function GridActionsCell(e){const{colDef:t,id:n,hasFocus:o,tabIndex:l,position:a="bottom-end",focusElementRef:s}=e,u=tt(e,kr),[c,d]=r.useState(-1),[g,h]=r.useState(!1),m=useGridApiContext$1(),C=r.useRef(null),b=r.useRef(null),w=r.useRef(!1),R=r.useRef({}),y=v(),S=p(),I=p(),M=useGridRootProps$1();if(!(e=>"function"==typeof e.getActions)(t))throw new Error("MUI X: Missing the `getActions` property in the `GridColDef`.");const P=t.getActions(m.current.getRowParams(n)),k=P.filter(e=>!e.props.showInMenu),D=P.filter(e=>e.props.showInMenu),E=k.length+(D.length?1:0);r.useLayoutEffect(()=>{o||Object.entries(R.current).forEach(([e,t])=>{t?.stop({},()=>{delete R.current[e]})})},[o]),r.useEffect(()=>{if(c<0||!C.current)return;if(c>=C.current.children.length)return;C.current.children[c].focus({preventScroll:!0})},[c]),r.useEffect(()=>{o||(d(-1),w.current=!1)},[o]),r.useImperativeHandle(s,()=>({focus(){if(!w.current){const e=P.findIndex(e=>!e.props.disabled);d(e)}}}),[P]),r.useEffect(()=>{c>=E&&d(E-1)},[c,E]);const hideMenu=()=>{h(!1)},handleTouchRippleRef=e=>t=>{R.current[e]=t},handleButtonClick=(e,t)=>r=>{d(e),w.current=!0,t&&t(r)};return i.jsxs("div",et({role:"menu",ref:C,tabIndex:-1,className:Mt.actionsCell,onKeyDown:e=>{if(E<=1)return;const getNewIndex=(e,t)=>{if(e<0||e>P.length)return e;const r=("left"===t?-1:1)*(y?-1:1);return P[e+r]?.props.disabled?getNewIndex(e+r,t):e+r};let t=c;"ArrowRight"===e.key?t=getNewIndex(c,"right"):"ArrowLeft"===e.key&&(t=getNewIndex(c,"left")),t<0||t>=E||t!==c&&(e.preventDefault(),e.stopPropagation(),d(t))}},u,{children:[k.map((e,t)=>r.cloneElement(e,{key:t,touchRippleRef:handleTouchRippleRef(t),onClick:handleButtonClick(t,e.props.onClick),tabIndex:c===t?l:-1})),D.length>0&&I&&i.jsx(M.slots.baseIconButton,et({ref:b,id:I,"aria-label":m.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":g,"aria-controls":g?S:void 0,role:"menuitem",size:"small",onClick:e=>{e.stopPropagation(),e.preventDefault(),g?hideMenu():(h(!0),d(E-1),w.current=!0)},touchRippleRef:handleTouchRippleRef(I),tabIndex:c===k.length?l:-1},M.slotProps?.baseIconButton,{children:i.jsx(M.slots.moreActionsIcon,{fontSize:"small"})})),D.length>0&&i.jsx(GridMenu,{open:g,target:b.current,position:a,onClose:hideMenu,children:i.jsx(x,{id:S,className:Mt.menuList,onKeyDown:e=>{"Tab"===e.key&&e.preventDefault(),["Tab","Escape"].includes(e.key)&&hideMenu()},"aria-labelledby":I,variant:"menu",autoFocusItem:!0,children:D.map((e,t)=>r.cloneElement(e,{key:t,closeMenu:hideMenu}))})})]}))}const Dr="actions",Er=et({},Sr,{sortable:!1,filterable:!1,aggregable:!1,width:100,display:"flex",align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:e=>i.jsx(GridActionsCell,et({},e)),getApplyQuickFilterFn:void 0}),Fr="auto-generated-group-node-root",Gr=Symbol("mui.id_autogenerated"),buildRootGroup=()=>({type:"group",id:Fr,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null});const getRowIdFromRowModel=(e,t,r)=>{const n=t?t(e):e.id;return function checkGridRowIdIsValid(e,t,r="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.",r,JSON.stringify(t)].join("\n"))}(n,e,r),n},createRowsInternalCache=({rows:e,getRowId:t,loading:r,rowCount:n})=>{const o={type:"full",rows:[]},l={},i={};for(let a=0;a<e.length;a+=1){const r=e[a],n=getRowIdFromRowModel(r,t);l[n]=r,i[n]=n,o.rows.push(n)}return{rowsBeforePartialUpdates:e,loadingPropBeforePartialUpdates:r,rowCountPropBeforePartialUpdates:n,updates:o,dataRowIdToIdLookup:i,dataRowIdToModelLookup:l}},getTopLevelRowCount=({tree:e,rowCountProp:t=0})=>{const r=e[Fr];return Math.max(t,r.children.length+(null==r.footerId?0:1))},getRowsStateFromCache=({apiRef:e,rowCountProp:t=0,loadingProp:r,previousTree:n,previousTreeDepths:o,previousGroupsToFetch:l})=>{const i=e.current.caches.rows,{tree:a,treeDepths:s,dataRowIds:u,groupingName:c,groupsToFetch:d=[]}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:n,previousTreeDepths:o,updates:i.updates,dataRowIdToIdLookup:i.dataRowIdToIdLookup,dataRowIdToModelLookup:i.dataRowIdToModelLookup,previousGroupsToFetch:l}),p=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:a,treeDepths:s,dataRowIdToIdLookup:i.dataRowIdToIdLookup,dataRowIds:u,dataRowIdToModelLookup:i.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},et({},p,{totalRowCount:Math.max(t,p.dataRowIds.length),totalTopLevelRowCount:getTopLevelRowCount({tree:p.tree,rowCountProp:t}),groupingName:c,loading:r,groupsToFetch:d})},isAutogeneratedRowNode=e=>"skeletonRow"===e.type||"footer"===e.type||"group"===e.type&&e.isAutoGenerated||"pinnedRow"===e.type&&e.isAutoGenerated,getTreeNodeDescendants=(e,t,r)=>{const n=e[t];if("group"!==n.type)return[];const o=[];for(let l=0;l<n.children.length;l+=1){const t=n.children[l];r&&isAutogeneratedRowNode(e[t])||o.push(t);const i=getTreeNodeDescendants(e,t,r);for(let e=0;e<i.length;e+=1)o.push(i[e])}return r||null==n.footerId||o.push(n.footerId),o},updateCacheWithNewRows=({previousCache:e,getRowId:t,updates:r,groupKeys:n})=>{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;r.forEach(e=>{const r=getRowIdFromRowModel(e,t,"A row was provided without id when calling updateRows():");o.has(r)?o.set(r,et({},o.get(r),e)):o.set(r,e)});const l={type:"partial",actions:{insert:[...e.updates.actions.insert??[]],modify:[...e.updates.actions.modify??[]],remove:[...e.updates.actions.remove??[]]},idToActionLookup:et({},e.updates.idToActionLookup),groupKeys:n},i=et({},e.dataRowIdToModelLookup),a=et({},e.dataRowIdToIdLookup),s={insert:{},modify:{},remove:{}};o.forEach((e,t)=>{const r=l.idToActionLookup[t];if("delete"===e._action){if("remove"===r||!i[t])return;return null!=r&&(s[r][t]=!0),l.actions.remove.push(t),delete i[t],void delete a[t]}const n=i[t];if(n)return"remove"===r?(s.remove[t]=!0,l.actions.modify.push(t)):null==r&&l.actions.modify.push(t),void(i[t]=et({},n,e));"remove"===r?(s.remove[t]=!0,l.actions.insert.push(t)):null==r&&l.actions.insert.push(t),i[t]=e,a[t]=t});const u=Object.keys(s);for(let c=0;c<u.length;c+=1){const e=u[c],t=s[e];Object.keys(t).length>0&&(l.actions[e]=l.actions[e].filter(e=>!t[e]))}return{dataRowIdToModelLookup:i,dataRowIdToIdLookup:a,updates:l,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}},Hr="var(--DataGrid-overlayHeight, calc(var(--height) * 2))";function computeRowsUpdates(e,t,r){const n=[];return t.forEach(t=>{const o=getRowIdFromRowModel(t,r,"A row was provided without id when calling updateRows():"),l=e.current.getRowNode(o);if("pinnedRow"===l?.type){const r=e.current.caches.pinnedRows,n=r.idLookup[o];n&&(r.idLookup[o]=et({},n,t))}else n.push(t)}),n}const getValidRowHeight=(e,t,r)=>"number"==typeof e&&e>0?e:t,Tr="__tree_data_group__",Or="__row_group_by_columns_group__",Lr="__detail_panel_toggle__";let Ar=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 jr=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","hideDescendantCount"];function GridBooleanCellRaw(e){const{value:t,rowNode:n}=e,o=tt(e,jr),l=useGridApiContext$1(),a=useGridRootProps$1(),u=(e=>{const{classes:t}=e;return s({root:["booleanCell"]},getDataGridUtilityClass,t)})({classes:a.classes}),c=useGridSelector(l,Wt)>0&&"group"===n.type&&!1===a.treeData,d=r.useMemo(()=>t?a.slots.booleanCellTrueIcon:a.slots.booleanCellFalseIcon,[a.slots.booleanCellFalseIcon,a.slots.booleanCellTrueIcon,t]);return c&&void 0===t?null:i.jsx(d,et({fontSize:"small",className:u.root,titleAccess:l.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":Boolean(t)},o))}const $r=r.memo(GridBooleanCellRaw),zr=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"];function GridEditBooleanCell(e){const{id:t,value:n,field:o,className:l,hasFocus:u,onValueChange:c}=e,d=tt(e,zr),g=useGridApiContext$1(),m=r.useRef(null),C=p(),[b,w]=r.useState(n),v=useGridRootProps$1(),x=(e=>{const{classes:t}=e;return s({root:["editBooleanCell"]},getDataGridUtilityClass,t)})({classes:v.classes}),R=r.useCallback(async e=>{const r=e.target.checked;c&&await c(e,r),w(r),await g.current.setEditCellValue({id:t,field:o,value:r},e)},[g,o,t,c]);return r.useEffect(()=>{w(n)},[n]),a(()=>{u&&m.current.focus()},[u]),i.jsx("label",et({htmlFor:C,className:h(x.root,l)},d,{children:i.jsx(v.slots.baseCheckbox,et({id:C,inputRef:m,checked:Boolean(b),onChange:R,size:"small"},v.slotProps?.baseCheckbox))}))}const Vr=["item","applyValue","apiRef","focusElementRef","isFilterActive","clearButton","tabIndex","label","variant","InputLabelProps"],sanitizeFilterItemValue=e=>"true"===String(e).toLowerCase()||"false"!==String(e).toLowerCase()&&void 0,Nr=u("div")({display:"flex",alignItems:"center",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function GridFilterInputBoolean(e){const{item:t,applyValue:n,apiRef:o,focusElementRef:l,clearButton:a,tabIndex:s,label:u,variant:c="standard"}=e,d=tt(e,Vr),[g,h]=r.useState(sanitizeFilterItemValue(t.value)),m=useGridRootProps$1(),C=p(),b=p(),w=m.slotProps?.baseSelect||{},v=w.native??!1,x=m.slotProps?.baseSelectOption||{},R=r.useCallback(e=>{const r=sanitizeFilterItemValue(e.target.value);h(r),n(et({},t,{value:r}))},[n,t]);r.useEffect(()=>{h(sanitizeFilterItemValue(t.value))},[t.value]);const y=u??o.current.getLocaleText("filterPanelInputLabel");return i.jsxs(Nr,{children:[i.jsxs(m.slots.baseFormControl,{fullWidth:!0,children:[i.jsx(m.slots.baseInputLabel,et({},m.slotProps?.baseInputLabel,{id:C,shrink:!0,variant:c,children:y})),i.jsxs(m.slots.baseSelect,et({labelId:C,id:b,label:y,value:void 0===g?"":String(g),onChange:R,variant:c,notched:"outlined"===c||void 0,native:v,displayEmpty:!0,inputProps:{ref:l,tabIndex:s}},d,w,{children:[i.jsx(m.slots.baseSelectOption,et({},x,{native:v,value:"",children:o.current.getLocaleText("filterValueAny")})),i.jsx(m.slots.baseSelectOption,et({},x,{native:v,value:"true",children:o.current.getLocaleText("filterValueTrue")})),i.jsx(m.slots.baseSelectOption,et({},x,{native:v,value:"false",children:o.current.getLocaleText("filterValueFalse")}))]}))]}),a]})}const Br=et({},Sr,{type:"boolean",display:"flex",align:"center",headerAlign:"center",renderCell:e=>e.field!==Or&&isAutogeneratedRowNode(e.rowNode)?"":i.jsx($r,et({},e)),renderEditCell:e=>i.jsx(GridEditBooleanCell,et({},e)),sortComparator:gridNumberComparator,valueFormatter:(e,t,r,n)=>e?n.current.getLocaleText("booleanCellTrueLabel"):n.current.getLocaleText("booleanCellFalseLabel"),filterOperators:[{value:"is",getApplyFilterFn:e=>{const t=sanitizeFilterItemValue(e.value);return void 0===t?null:e=>Boolean(e)===t},InputComponent:GridFilterInputBoolean}],getApplyQuickFilterFn:void 0,aggregable:!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)}),gridSortingStateSelector=e=>e.sorting,_r=createSelector(gridSortingStateSelector,e=>e.sortedRows),Wr=createSelectorMemoized(_r,$t,Vt,(e,t,r)=>e.reduce((e,n)=>{const o=t[n];if(o)e.push({id:n,model:o});else{const t=r[n];t&&isAutogeneratedRowNode(t)&&e.push({id:n,model:{[Gr]:n}})}return e},[])),Ur=createSelector(gridSortingStateSelector,e=>e.sortModel),qr=createSelectorMemoized(Ur,e=>e.reduce((t,r,n)=>(t[r.field]={sortDirection:r.sort,sortIndex:e.length>1?n+1:void 0},t),{})),Kr=createSelectorMemoized(_r,e=>e.reduce((e,t,r)=>(e[t]=r,e),Object.create(null))),gridFilterStateSelector=e=>e.filter,Xr=createSelector(gridFilterStateSelector,e=>e.filterModel),Yr=createSelector(Xr,e=>e.quickFilterValues),Qr=createSelector(gridFilterStateSelector,e=>e.filteredRowsLookup),Jr=createSelector(gridFilterStateSelector,e=>e.filteredChildrenCountLookup),Zr=createSelector(gridFilterStateSelector,e=>e.filteredDescendantCountLookup),en=createSelectorMemoized(e=>e.visibleRowsLookup,Wr,Wt,Xr,Yr,(e,t,r,n,o)=>r<2&&!n.items.length&&!o?.length?t:t.filter(t=>!1!==e[t.id])),tn=createSelectorMemoized(en,e=>e.map(e=>e.id)),rn=createSelectorMemoized(Qr,Wr,(e,t)=>t.filter(t=>!1!==e[t.id])),nn=createSelectorMemoized(rn,e=>e.map(e=>e.id)),on=createSelectorMemoized(tn,Vt,(e,t)=>{const r={};let n=0;return e.reduce((e,o)=>{const l=t[o];return r[l.depth]||(r[l.depth]=0),l.depth>n&&(r[l.depth]=0),n=l.depth,r[l.depth]+=1,e[o]=r[l.depth],e},{})}),ln=createSelectorMemoized(en,Vt,Wt,(e,t,r)=>r<2?e:e.filter(e=>0===t[e.id]?.depth)),an=createSelector(en,e=>e.length),sn=createSelector(ln,e=>e.length),un=createSelector(rn,e=>e.length);createSelector(un,sn,(e,t)=>e-t);const cn=createSelectorMemoized(Xr,dr,(e,t)=>e.items?.filter(e=>{if(!e.field)return!1;const r=t[e.field];if(!r?.filterOperators||0===r?.filterOperators?.length)return!1;const n=r.filterOperators.find(t=>t.value===e.operator);return!!n&&(!n.InputComponent||null!=e.value&&""!==e.value?.toString())})),dn=createSelectorMemoized(cn,e=>e.reduce((e,t)=>(e[t.field]?e[t.field].push(t):e[t.field]=[t],e),{})),gridRowSelectionStateSelector=e=>e.rowSelection,pn=createSelector(gridRowSelectionStateSelector,e=>e.length),gn=createSelectorMemoized(gridRowSelectionStateSelector,$t,(e,t)=>new Map(e.map(e=>[e,t[e]]))),fn=createSelectorMemoized(gridRowSelectionStateSelector,e=>e.reduce((e,t)=>(e[t]=t,e),{}));function getGridRowGroupSelectableDescendants(e,t){const r=Vt(e),n=_r(e),o=Qr(e),l=r[t];if(!l||"group"!==l.type)return[];const i=[];for(let a=n.findIndex(e=>e===t)+1;a<n.length&&r[n[a]]?.depth>l.depth;a+=1){const t=n[a];!1!==o[t]&&e.current.isRowSelectable(t)&&i.push(t)}return i}function isMultipleRowSelectionEnabled(e){return e.signature===kt.DataGrid?e.checkboxSelection&&!0!==e.disableMultipleRowSelection:!e.disableMultipleRowSelection}const findRowsToSelect=(e,t,r,n,o,l,i=new Set(gridRowSelectionStateSelector(e.current.state)))=>{const a=Qr(e),s=new Set([]);if((n||o)&&!1!==a[r]){if(n){const n=t[r];if("group"===n?.type){getGridRowGroupSelectableDescendants(e,r).forEach(e=>{l(e),s.add(e)})}}if(o){const checkAllDescendantsSelected=e=>{if(!i.has(e)&&!s.has(e))return!1;const r=t[e];return!!r&&("group"!==r.type||r.children.every(checkAllDescendantsSelected))},traverseParents=r=>{const n=((e,t,r)=>{const n=e[r];if(!n)return[];const o=n.parent;return null==o?[]:e[o].children.filter(e=>e!==r&&!1!==t[e])})(t,a,r);if(0===n.length||n.every(checkAllDescendantsSelected)){const n=t[r],o=n?.parent;null!=o&&o!==Fr&&e.current.isRowSelectable(o)&&(l(o),s.add(o),traverseParents(o))}};traverseParents(r)}}},findRowsToDeselect=(e,t,r,n,o,l)=>{const i=fn(e);if(o||n){if(o){const e=((e,t)=>{const r=[];let n=t;for(;null!=n&&n!==Fr;){const t=e[n];if(!t)return r;r.push(n),n=t.parent}return r})(t,r);e.forEach(e=>{i[e]===e&&l(e)})}if(n){const n=t[r];if("group"===n?.type){getGridRowGroupSelectableDescendants(e,r).forEach(e=>{l(e)})}}}},hn=["field","id","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],mn=forwardRef(function GridCellCheckboxRenderer2(e,t){const{field:n,id:o,rowNode:l,hasFocus:a,tabIndex:u}=e,c=tt(e,hn),d=useGridApiContext$1(),p=useGridRootProps$1(),g=(e=>{const{classes:t}=e;return s({root:["checkboxInput"]},getDataGridUtilityClass,t)})({classes:p.classes}),h=r.useRef(null),m=r.useRef(null),C=R(h,t);r.useLayoutEffect(()=>{if(0===u){const e=d.current.getCellElement(o,n);e&&(e.tabIndex=-1)}},[d,u,o,n]),r.useEffect(()=>{if(a){const e=h.current?.querySelector("input");e?.focus({preventScroll:!0})}else m.current&&m.current.stop({})},[a]);const b=r.useCallback(e=>{" "===e.key&&e.stopPropagation()},[]),w=d.current.isRowSelectable(o),v=function getCheckboxPropsSelector(e,t){return createSelector(Vt,_r,Qr,fn,(r,n,o,l)=>{const i=r[e];if(!i||"group"!==i.type)return{isIndeterminate:!1,isChecked:l[e]===e};if(l[e]===e)return{isIndeterminate:!1,isChecked:!0};let a=0,s=0;for(let t=n.findIndex(t=>t===e)+1;t<n.length&&r[n[t]]?.depth>i.depth;t+=1){const e=n[t];!1!==o[e]&&(a+=1,void 0!==l[e]&&(s+=1))}return{isIndeterminate:s>0&&(s<a||void 0===l[e]),isChecked:t?s>0:l[e]===e}})}(o,p.rowSelectionPropagation?.parents??!1),{isIndeterminate:x,isChecked:y}=useGridSelector(d,v,bt);if("footer"===l.type||"pinnedRow"===l.type)return null;const S="select"===p.indeterminateCheckboxAction?y&&!x:y,I=d.current.getLocaleText(S?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return i.jsx(p.slots.baseCheckbox,et({tabIndex:u,checked:S,onChange:e=>{const t={value:e.target.checked,id:o};d.current.publishEvent("rowSelectionCheckboxChange",t,e)},className:g.root,inputProps:{"aria-label":I,name:"select_row"},onKeyDown:b,indeterminate:x,disabled:!w,touchRippleRef:m},p.slotProps?.baseCheckbox,c,{ref:C}))}),gridFocusStateSelector=e=>e.focus,Cn=createSelector(gridFocusStateSelector,e=>e.cell),bn=createSelector(gridFocusStateSelector,e=>e.columnHeader),wn=createSelector(gridFocusStateSelector,e=>e.columnHeaderFilter),vn=createSelector(gridFocusStateSelector,e=>e.columnGroupHeader),gridTabIndexStateSelector=e=>e.tabIndex,xn=createSelector(gridTabIndexStateSelector,e=>e.cell),Rn=createSelector(gridTabIndexStateSelector,e=>e.columnHeader),yn=createSelector(gridTabIndexStateSelector,e=>e.columnHeaderFilter),Sn=createSelector(gridTabIndexStateSelector,e=>e.columnGroupHeader);function useGridApiMethod(e,t,n){const o=r.useRef(!0);a(()=>{o.current=!1,e.current.register(n,t)},[e,n,t]),o.current&&e.current.register(n,t)}function useGridLogger(e,t){const n=r.useRef(null);if(n.current)return n.current;const o=e.current.getLogger(t);return n.current=o,o}const useGridNativeEventListener=(e,t,r,n,o)=>{const l=useGridLogger(e,"useNativeEventListener");useGridApiOptionHandler(e,"rootMount",()=>{const e="function"==typeof t?t():t.current;if(e&&r&&n)return l.debug(`Binding native ${r} event`),e.addEventListener(r,n,o),()=>{l.debug(`Clearing native ${r} event`),e.removeEventListener(r,n,o)}})},useFirstRender=e=>{const t=r.useRef(!0);t.current&&(t.current=!1,e())},noop$2=()=>{},getPageCount=(e,t,r)=>t>0&&e>0?Math.ceil(e/t):-1===e?r+2:0,getDefaultGridPaginationModel=e=>({page:0,pageSize:e?0:100}),throwIfPageSizeExceedsTheLimit=(e,t)=>{if(t===kt.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"))},gridPaginationSelector=e=>e.pagination,In=createSelector(gridPaginationSelector,e=>e.enabled&&"client"===e.paginationMode),Mn=createSelector(gridPaginationSelector,e=>e.paginationModel),Pn=createSelector(gridPaginationSelector,e=>e.rowCount),kn=createSelector(gridPaginationSelector,e=>e.meta),Dn=createSelector(Mn,e=>e.page),En=createSelector(Mn,e=>e.pageSize),Fn=createSelector(Mn,Pn,(e,t)=>getPageCount(t,e.pageSize,e.page)),Gn=createSelectorMemoized(In,Mn,Vt,Wt,en,ln,(e,t,r,n,o,l)=>{if(!e)return null;const i=l.length,a=Math.min(t.pageSize*t.page,i-1),s=-1===t.pageSize?i-1:Math.min(a+t.pageSize-1,i-1);if(-1===a||-1===s)return null;if(n<2)return{firstRowIndex:a,lastRowIndex:s};const u=l[a],c=s-a+1,d=o.findIndex(e=>e.id===u.id);let p=d,g=0;for(;p<o.length&&g<=c;){const e=o[p],t=r[e.id]?.depth;void 0===t?p+=1:((g<c||t>0)&&(p+=1),0===t&&(g+=1))}return{firstRowIndex:d,lastRowIndex:p-1}}),Hn=createSelectorMemoized(en,Gn,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),Tn=createSelectorMemoized(tn,Gn,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),On=createSelectorMemoized(In,Gn,Hn,en,(e,t,r,n)=>e?{rows:r,range:t,rowToIndexMap:r.reduce((e,t,r)=>(e.set(t.model,r),e),new Map)}:{rows:n,range:0===n.length?null:{firstRowIndex:0,lastRowIndex:n.length-1},rowToIndexMap:n.reduce((e,t,r)=>(e.set(t.model,r),e),new Map)}),Ln=["field","colDef"],An=forwardRef(function GridHeaderCheckbox2(e,t){const n=tt(e,Ln),[,o]=r.useState(!1),l=useGridApiContext$1(),a=useGridRootProps$1(),u=(e=>{const{classes:t}=e;return s({root:["checkboxInput"]},getDataGridUtilityClass,t)})({classes:a.classes}),c=useGridSelector(l,Rn),d=useGridSelector(l,gridRowSelectionStateSelector),p=useGridSelector(l,tn),g=useGridSelector(l,Tn),h=r.useMemo(()=>"function"!=typeof a.isRowSelectable?d:d.filter(e=>!!a.keepNonExistentRowsSelected||!!l.current.getRow(e)&&a.isRowSelectable(l.current.getRowParams(e))),[l,a.isRowSelectable,d,a.keepNonExistentRowsSelected]),m=r.useMemo(()=>(a.pagination&&a.checkboxSelectionVisibleOnly&&"server"!==a.paginationMode?g:p).reduce((e,t)=>(e[t]=!0,e),{}),[a.pagination,a.paginationMode,a.checkboxSelectionVisibleOnly,g,p]),C=r.useMemo(()=>h.filter(e=>m[e]).length,[h,m]),b=C>0&&C<Object.keys(m).length,w=C>0,v=null!==c&&c.field===e.field?0:-1;r.useLayoutEffect(()=>{const t=l.current.getColumnHeaderElement(e.field);0===v&&t&&(t.tabIndex=-1)},[v,l,e.field]);const x=r.useCallback(e=>{" "===e.key&&l.current.publishEvent("headerSelectionCheckboxChange",{value:!w})},[l,w]),R=r.useCallback(()=>{o(e=>!e)},[]);r.useEffect(()=>l.current.subscribeEvent("rowSelectionChange",R),[l,R]);const y="select"===a.indeterminateCheckboxAction?w&&!b:w,S=l.current.getLocaleText(y?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return i.jsx(a.slots.baseCheckbox,et({indeterminate:b,checked:y,onChange:e=>{const t={value:e.target.checked};l.current.publishEvent("headerSelectionCheckboxChange",t)},className:u.root,inputProps:{"aria-label":S,name:"select_all_rows"},tabIndex:v,onKeyDown:x,disabled:!isMultipleRowSelectionEnabled(a)},a.slotProps?.baseCheckbox,n,{ref:t}))}),gridRowIdSelector=(e,t)=>Gr in t?t[Gr]:e.props.getRowId?e.props.getRowId(t):t.id,jn="__check__",$n=et({},Br,{type:"custom",field:jn,width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,display:"flex",valueGetter:(e,t,r,n)=>void 0!==fn(n)[gridRowIdSelector(n.current.state,t)],renderHeader:e=>i.jsx(An,et({},e)),renderCell:e=>i.jsx(mn,et({},e))}),zn=["item","applyValue","type","apiRef","focusElementRef","InputProps","isFilterActive","clearButton","tabIndex","disabled"];function convertFilterItemValueToInputValue(e,t){if(null==e)return"";const r=new Date(e);return Number.isNaN(r.getTime())?"":"date"===t?r.toISOString().substring(0,10):"datetime-local"===t?(r.setMinutes(r.getMinutes()-r.getTimezoneOffset()),r.toISOString().substring(0,19)):r.toISOString().substring(0,10)}function GridFilterInputDate(e){const{item:t,applyValue:n,type:o,apiRef:l,focusElementRef:a,InputProps:s,clearButton:u,tabIndex:c,disabled:g}=e,h=tt(e,zn),m=d(),[C,b]=r.useState(()=>convertFilterItemValueToInputValue(t.value,o)),[w,v]=r.useState(!1),x=p(),R=useGridRootProps$1(),y=r.useCallback(e=>{m.clear();const r=e.target.value;b(r),v(!0),m.start(R.filterDebounceMs,()=>{const e=new Date(r);n(et({},t,{value:Number.isNaN(e.getTime())?void 0:e})),v(!1)})},[n,t,R.filterDebounceMs,m]);return r.useEffect(()=>{const e=convertFilterItemValueToInputValue(t.value,o);b(e)},[t.value,o]),i.jsx(R.slots.baseTextField,et({fullWidth:!0,id:x,label:l.current.getLocaleText("filterPanelInputLabel"),placeholder:l.current.getLocaleText("filterPanelInputPlaceholder"),value:C,onChange:y,variant:"standard",type:o||"text",InputLabelProps:{shrink:!0},inputRef:a,InputProps:et({},w||u?{endAdornment:w?i.jsx(R.slots.loadIcon,{fontSize:"small",color:"action"}):u}:{},{disabled:g},s,{inputProps:et({max:"datetime-local"===o?"9999-12-31T23:59":"9999-12-31",tabIndex:c},s?.inputProps)})},h,R.slotProps?.baseTextField))}function buildApplyFilterFn(e,t,r,n){if(!e.value)return null;const o=new Date(e.value);r?o.setSeconds(0,0):(o.setMinutes(o.getMinutes()+o.getTimezoneOffset()),o.setHours(0,0,0,0));const l=o.getTime();return e=>{if(!e)return!1;if(n)return t(e.getTime(),l);const o=new Date(e);return r?o.setSeconds(0,0):o.setHours(0,0,0,0),t(o.getTime(),l)}}const getGridDateOperators=e=>[{value:"is",getApplyFilterFn:t=>buildApplyFilterFn(t,(e,t)=>e===t,e),InputComponent:GridFilterInputDate,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFn:t=>buildApplyFilterFn(t,(e,t)=>e!==t,e),InputComponent:GridFilterInputDate,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFn:t=>buildApplyFilterFn(t,(e,t)=>e>t,e),InputComponent:GridFilterInputDate,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:t=>buildApplyFilterFn(t,(e,t)=>e>=t,e),InputComponent:GridFilterInputDate,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFn:t=>buildApplyFilterFn(t,(e,t)=>e<t,e,!e),InputComponent:GridFilterInputDate,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrBefore",getApplyFilterFn:t=>buildApplyFilterFn(t,(e,t)=>e<=t,e),InputComponent:GridFilterInputDate,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>e=>null==e,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>null!=e,requiresFilterValue:!1}],Vn=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange"],Nn=u(c)({fontSize:"inherit"});function GridEditDateCell(e){const{id:t,value:n,field:o,colDef:l,hasFocus:u,inputProps:c,onValueChange:d}=e,p=tt(e,Vn),g="dateTime"===l.type,h=useGridApiContext$1(),m=r.useRef(null),C=r.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,g?16:10)}return{parsed:e,formatted:t}},[n,g]),[b,w]=r.useState(C),v=(e=>{const{classes:t}=e;return s({root:["editInputCell"]},getDataGridUtilityClass,t)})({classes:useGridRootProps$1().classes}),x=r.useCallback(e=>{if(""===e)return null;const[t,r]=e.split("T"),[n,o,l]=t.split("-"),i=new Date;if(i.setFullYear(Number(n),Number(o)-1,Number(l)),i.setHours(0,0,0,0),r){const[e,t]=r.split(":");i.setHours(Number(e),Number(t),0,0)}return i},[]),R=r.useCallback(async e=>{const r=e.target.value,n=x(r);d&&await d(e,n),w({parsed:n,formatted:r}),h.current.setEditCellValue({id:t,field:o,value:n},e)},[h,o,t,d,x]);return r.useEffect(()=>{w(e=>C.parsed!==e.parsed&&C.parsed?.getTime()!==e.parsed?.getTime()?C:e)},[C]),a(()=>{u&&m.current.focus()},[u]),i.jsx(Nn,et({inputRef:m,fullWidth:!0,className:v.root,type:g?"datetime-local":"date",inputProps:et({max:g?"9999-12-31T23:59":"9999-12-31"},c),value:b.formatted,onChange:R},p))}const renderEditDateCell=e=>i.jsx(GridEditDateCell,et({},e));function throwIfNotDateObject({value:e,columnType:t,rowId:r,field:n}){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: ${r}, field: "${n}".`].join("\n"))}const Bn=et({},Sr,{type:"date",sortComparator:gridDateComparator,valueFormatter:(e,t,r,n)=>{if(!e)return"";return throwIfNotDateObject({value:e,columnType:"date",rowId:gridRowIdSelector(n.current.state,t),field:r.field}),e.toLocaleDateString()},filterOperators:getGridDateOperators(),renderEditCell:renderEditDateCell,pastedValueParser:e=>new Date(e)}),_n=et({},Sr,{type:"dateTime",sortComparator:gridDateComparator,valueFormatter:(e,t,r,n)=>{if(!e)return"";return throwIfNotDateObject({value:e,columnType:"dateTime",rowId:gridRowIdSelector(n.current.state,t),field:r.field}),e.toLocaleString()},filterOperators:getGridDateOperators(!0),renderEditCell:renderEditDateCell,pastedValueParser:e=>new Date(e)}),parseNumericValue=e=>null==e?null:Number(e),getGridNumericOperators=()=>[{value:"=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>parseNumericValue(t)===e.value,InputComponent:GridFilterInputValue,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>parseNumericValue(t)!==e.value,InputComponent:GridFilterInputValue,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&parseNumericValue(t)>e.value,InputComponent:GridFilterInputValue,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&parseNumericValue(t)>=e.value,InputComponent:GridFilterInputValue,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&parseNumericValue(t)<e.value,InputComponent:GridFilterInputValue,InputComponentProps:{type:"number"}},{value:"<=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&parseNumericValue(t)<=e.value,InputComponent:GridFilterInputValue,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:GridFilterInputMultipleValue,InputComponentProps:{type:"number"}}],Wn=et({},Sr,{type:"number",align:"right",headerAlign:"right",sortComparator:gridNumberComparator,valueParser:e=>""===e?null:Number(e),valueFormatter:e=>function isNumber(e){return"number"==typeof e&&!Number.isNaN(e)}(e)?e.toLocaleString():e||"",filterOperators:getGridNumericOperators(),getApplyQuickFilterFn:e=>null==e||Number.isNaN(e)||""===e?null:t=>parseNumericValue(t)===parseNumericValue(e)});function isSingleSelectColDef(e){return"singleSelect"===e?.type}function getValueOptions(e,t){if(e)return"function"==typeof e.valueOptions?e.valueOptions(et({field:e.field},t)):e.valueOptions}function getValueFromValueOptions(e,t,r){if(void 0===t)return;const n=t.find(t=>{const n=r(t);return String(n)===String(e)});return r(n)}const Un=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen"],qn=["MenuProps"];function GridEditSingleSelectCell(e){const t=useGridRootProps$1(),{id:n,value:o,field:l,row:s,colDef:u,hasFocus:c,error:d,onValueChange:p,initialOpen:g=t.editMode===Zt.Cell}=e,h=tt(e,Un),m=useGridApiContext$1(),C=r.useRef(null),b=r.useRef(null),[w,v]=r.useState(g),x=(t.slotProps?.baseSelect||{}).native??!1,R=t.slotProps?.baseSelect||{},{MenuProps:y}=R,S=tt(R,qn);if(a(()=>{c&&b.current?.focus()},[c]),!isSingleSelectColDef(u))return null;const I=getValueOptions(u,{id:n,row:s});if(!I)return null;const M=u.getOptionValue,P=u.getOptionLabel;return I&&u?i.jsx(t.slots.baseSelect,et({ref:C,inputRef:b,value:o,onChange:async e=>{if(!isSingleSelectColDef(u)||!I)return;v(!1);const t=getValueFromValueOptions(e.target.value,I,M);p&&await p(e,t),await m.current.setEditCellValue({id:n,field:l,value:t},e)},open:w,onOpen:e=>{(function isKeyboardEvent$1(e){return!!e.key})(e)&&"Enter"===e.key||v(!0)},MenuProps:et({onClose:(e,r)=>{if(t.editMode!==Zt.Row){if("backdropClick"===r||"Escape"===e.key){const t=m.current.getCellParams(n,l);m.current.publishEvent("cellEditStop",et({},t,{reason:"Escape"===e.key?or.escapeKeyDown:or.cellFocusOut}))}}else v(!1)}},y),error:d,native:x,fullWidth:!0},h,S,{children:I.map(e=>{const n=M(e);return r.createElement(t.slots.baseSelectOption,et({},t.slotProps?.baseSelectOption||{},{native:x,key:n,value:n}),P(e))})})):null}const Kn=["item","applyValue","type","apiRef","focusElementRef","placeholder","tabIndex","label","variant","isFilterActive","clearButton","InputLabelProps"],renderSingleSelectOptions=({column:e,OptionComponent:t,getOptionLabel:n,getOptionValue:o,isSelectNative:l,baseSelectOptionProps:i})=>["",...getValueOptions(e)||[]].map(e=>{const a=o(e);let s=n(e);return""===s&&(s=" "),r.createElement(t,et({},i,{native:l,key:a,value:a}),s)}),Xn=u("div")({display:"flex",alignItems:"flex-end",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function GridFilterInputSingleSelect(e){const{item:t,applyValue:n,type:o,apiRef:l,focusElementRef:a,placeholder:s,tabIndex:u,label:c,variant:d="standard",clearButton:g}=e,h=tt(e,Kn),m=t.value??"",C=p(),b=p(),w=useGridRootProps$1(),v=w.slotProps?.baseSelect?.native??!1;let x=null;if(t.field){const e=l.current.getColumn(t.field);isSingleSelectColDef(e)&&(x=e)}const R=x?.getOptionValue,y=x?.getOptionLabel,S=r.useMemo(()=>getValueOptions(x),[x]),I=r.useCallback(e=>{let r=e.target.value;r=getValueFromValueOptions(r,S,R),n(et({},t,{value:r}))},[S,R,n,t]);if(!isSingleSelectColDef(x))return null;const M=c??l.current.getLocaleText("filterPanelInputLabel");return i.jsxs(Xn,{children:[i.jsxs(w.slots.baseFormControl,{fullWidth:!0,children:[i.jsx(w.slots.baseInputLabel,et({},w.slotProps?.baseInputLabel,{id:b,htmlFor:C,shrink:!0,variant:d,children:M})),i.jsx(w.slots.baseSelect,et({id:C,label:M,labelId:b,value:m,onChange:I,variant:d,type:o||"text",inputProps:{tabIndex:u,ref:a,placeholder:s??l.current.getLocaleText("filterPanelInputPlaceholder")},native:v,notched:"outlined"===d||void 0},h,w.slotProps?.baseSelect,{children:renderSingleSelectOptions({column:x,OptionComponent:w.slots.baseSelectOption,getOptionLabel:y,getOptionValue:R,isSelectNative:v,baseSelectOptionProps:w.slotProps?.baseSelectOption})}))]}),g]})}const Yn=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],Qn=["key"],Jn=y();function GridFilterInputMultipleSingleSelect(e){const{item:t,applyValue:n,apiRef:o,focusElementRef:l,color:a,error:s,helperText:u,size:c,variant:d="standard"}=e,h=tt(e,Yn),m={color:a,error:s,helperText:u,size:c,variant:d},C=p(),b=useGridRootProps$1();let w=null;if(t.field){const e=o.current.getColumn(t.field);isSingleSelectColDef(e)&&(w=e)}const v=w?.getOptionValue,x=w?.getOptionLabel,R=r.useCallback((e,t)=>v(e)===v(t),[v]),y=r.useMemo(()=>getValueOptions(w)||[],[w]),S=r.useMemo(()=>Array.isArray(t.value)?t.value.reduce((e,t)=>{const r=y.find(e=>v(e)===t);return null!=r&&e.push(r),e},[]):[],[v,t.value,y]),I=r.useCallback((e,r)=>{n(et({},t,{value:r.map(v)}))},[n,t,v]);return i.jsx(g,et({multiple:!0,options:y,isOptionEqualToValue:R,filterOptions:Jn,id:C,value:S,onChange:I,getOptionLabel:x,renderTags:(e,t)=>e.map((e,r)=>{const n=t({index:r}),{key:o}=n,l=tt(n,Qn);return i.jsx(b.slots.baseChip,et({variant:"outlined",size:"small",label:x(e)},l),o)}),renderInput:e=>i.jsx(b.slots.baseTextField,et({},e,{label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:et({},e.InputLabelProps,{shrink:!0}),inputRef:l,type:"singleSelect"},m,b.slotProps?.baseTextField))},h))}const parseObjectValue=e=>null!=e&&isObject(e)?e.value:e,Zn=et({},Sr,{type:"singleSelect",getOptionLabel:e=>isObject(e)?e.label:String(e),getOptionValue:e=>isObject(e)?e.value:e,valueFormatter(e,t,r,n){const o=gridRowIdSelector(n.current.state,t);if(!isSingleSelectColDef(r))return"";const l=getValueOptions(r,{id:o,row:t});if(null==e)return"";if(!l)return e;if("object"!=typeof l[0])return r.getOptionLabel(e);const i=l.find(t=>r.getOptionValue(t)===e);return i?r.getOptionLabel(i):""},renderEditCell:e=>i.jsx(GridEditSingleSelectCell,et({},e)),filterOperators:[{value:"is",getApplyFilterFn:e=>null==e.value||""===e.value?null:t=>parseObjectValue(t)===parseObjectValue(e.value),InputComponent:GridFilterInputSingleSelect},{value:"not",getApplyFilterFn:e=>null==e.value||""===e.value?null:t=>parseObjectValue(t)!==parseObjectValue(e.value),InputComponent:GridFilterInputSingleSelect},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||0===e.value.length)return null;const t=e.value.map(parseObjectValue);return e=>t.includes(parseObjectValue(e))},InputComponent:GridFilterInputMultipleSingleSelect}],pastedValueParser:(e,t,r)=>{const n=r,o=getValueOptions(n)||[],l=n.getOptionValue;if(o.find(t=>l(t)===e))return e}}),gridHeaderFilteringStateSelector=e=>e.headerFiltering,eo=createSelector(gridHeaderFilteringStateSelector,e=>e?.enabled??!1),to=createSelector(gridHeaderFilteringStateSelector,e=>e.editing),ro=createSelector(gridHeaderFilteringStateSelector,e=>e.menuOpen),gridColumnGroupingSelector=e=>e.columnGrouping,no=createSelectorMemoized(gridColumnGroupingSelector,e=>e?.unwrappedGroupingModel??{}),oo=createSelectorMemoized(gridColumnGroupingSelector,e=>e?.lookup??{}),lo=createSelectorMemoized(gridColumnGroupingSelector,e=>e?.headerStructure??[]),io=createSelector(gridColumnGroupingSelector,e=>e?.maxDepth??0),ao=["maxWidth","minWidth","width","flex"],so={string:Sr,number:Wn,date:Bn,dateTime:_n,boolean:Br,singleSelect:Zn,[Dr]:Er,custom:Sr};const hydrateColumnsWidth=(e,t)=>{const r={};let n=0,o=0;const l=[];e.orderedFields.forEach(t=>{let i=e.lookup[t],a=0,s=!1;!1!==e.columnVisibilityModel[t]&&(i.flex&&i.flex>0?(n+=i.flex,s=!0):a=clamp(i.width||Sr.width,i.minWidth||Sr.minWidth,i.maxWidth||Sr.maxWidth),o+=a),i.computedWidth!==a&&(i=et({},i,{computedWidth:a})),s&&l.push(i),r[t]=i});const i=void 0===t?0:t.viewportOuterSize.width-(t.hasScrollY?t.scrollbarSize:0),a=Math.max(i-o,0);if(n>0&&i>0){const e=function computeFlexColumnsWidth({initialFreeSpace:e,totalFlexUnits:t,flexColumns:r}){const n=new Set(r.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 loopOverFlexItems(){if(o.frozenFields.length===n.size)return;const l={min:{},max:{}};let i=e,a=t,s=0;o.frozenFields.forEach(e=>{i-=o.all[e].computedWidth,a-=o.all[e].flex});for(let e=0;e<r.length;e+=1){const t=r[e];if(o.all[t.field]&&!0===o.all[t.field].frozen)continue;let n=i/a*t.flex;n<t.minWidth?(s+=t.minWidth-n,n=t.minWidth,l.min[t.field]=!0):n>t.maxWidth&&(s+=t.maxWidth-n,n=t.maxWidth,l.max[t.field]=!0),o.all[t.field]={frozen:!1,computedWidth:n,flex:t.flex}}s<0?Object.keys(l.max).forEach(e=>{o.freeze(e)}):s>0?Object.keys(l.min).forEach(e=>{o.freeze(e)}):r.forEach(({field:e})=>{o.freeze(e)}),loopOverFlexItems()}(),o.all}({initialFreeSpace:a,totalFlexUnits:n,flexColumns:l});Object.keys(e).forEach(t=>{r[t].computedWidth=e[t].computedWidth})}return et({},e,{lookup:r})};function getDefaultColTypeDef(e){let t=so.string;return e&&so[e]&&(t=so[e]),t}const createColumnsState=({apiRef:e,columnsToUpsert:t,initialState:r,columnVisibilityModel:n=gr(e),keepOnlyColumnsToUpsert:o=!1})=>{const l=!e.current.state.columns;let i;if(l)i={orderedFields:[],lookup:{},columnVisibilityModel:n};else{const t=gridColumnsStateSelector(e.current.state);i={orderedFields:o?[]:[...t.orderedFields],lookup:et({},t.lookup),columnVisibilityModel:n}}let a={};o&&!l&&(a=Object.keys(i.lookup).reduce((e,t)=>et({},e,{[t]:!1}),{})),t.forEach(e=>{const{field:t}=e;a[t]=!0;let r=i.lookup[t];null==r?(r=et({},getDefaultColTypeDef(e.type),{field:t,hasBeenResized:!1}),i.orderedFields.push(t)):o&&i.orderedFields.push(t),r&&r.type!==e.type&&(r=et({},getDefaultColTypeDef(e.type),{field:t}));let n=r.hasBeenResized;ao.forEach(t=>{void 0!==e[t]&&(n=!0,-1===e[t]&&(e[t]=1/0))}),i.lookup[t]=S(r,et({},e,{hasBeenResized:n}))}),o&&!l&&Object.keys(i.lookup).forEach(e=>{a[e]||delete i.lookup[e]});const s=((e,t)=>{if(!t)return e;const{orderedFields:r=[],dimensions:n={}}=t,o=Object.keys(n);if(0===o.length&&0===r.length)return e;const l={},i=[];for(let u=0;u<r.length;u+=1){const t=r[u];e.lookup[t]&&(l[t]=!0,i.push(t))}const a=0===i.length?e.orderedFields:[...i,...e.orderedFields.filter(e=>!l[e])],s=et({},e.lookup);for(let u=0;u<o.length;u+=1){const e=o[u],t=et({},s[e],{hasBeenResized:!0});Object.entries(n[e]).forEach(([e,r])=>{t[e]=-1===r?1/0:r}),s[e]=t}return et({},e,{orderedFields:a,lookup:s})})(e.current.unstable_applyPipeProcessors("hydrateColumns",i),r);return hydrateColumnsWidth(s,e.current.getRootDimensions?.()??void 0)};function getTotalHeaderHeight(e,t){if(t.unstable_listView)return 0;const r=Gt(e),n=io(e),o=eo(e);return Math.floor(t.columnHeaderHeight*r)+Math.floor((t.columnGroupHeaderHeight??t.columnHeaderHeight)*r)*n+(o?Math.floor((t.headerFilterHeight??t.columnHeaderHeight)*r):0)}const gridRowsMetaSelector=e=>e.rowsMeta,uo=P("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${Mt["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${Mt["scrollArea--right"]}`]:t["scrollArea--right"]},{[`&.${Mt["scrollArea--up"]}`]:t["scrollArea--up"]},{[`&.${Mt["scrollArea--down"]}`]:t["scrollArea--down"]},t.scrollArea]})(()=>({position:"absolute",zIndex:101,[`&.${Mt["scrollArea--left"]}`]:{top:0,left:0,width:20,bottom:0},[`&.${Mt["scrollArea--right"]}`]:{top:0,right:0,width:20,bottom:0},[`&.${Mt["scrollArea--up"]}`]:{top:0,left:0,right:0,height:20},[`&.${Mt["scrollArea--down"]}`]:{bottom:0,left:0,right:0,height:20}})),co=createSelectorV8(gridDimensionsSelector,(e,t)=>"left"===t?e.leftPinnedWidth:"right"===t?e.rightPinnedWidth+(e.hasScrollX?e.scrollbarSize:0):0);function GridHorizontalScrollAreaContent(e){const{scrollDirection:t,scrollPosition:n}=e,o=r.useRef(null),l=useGridApiContext$1(),a=d(),s=useGridSelector(l,Gt),u=useGridSelector(l,yt),c=useGridSelectorV8(l,co,t),p=useGridRootProps$1(),g=getTotalHeaderHeight(l,p),h=Math.floor(p.columnHeaderHeight*s),m=et({height:h,top:g-h},"left"===t?{left:c}:{},"right"===t?{right:c}:{}),C=M(e=>{let r;if(e.preventDefault(),"left"===t)r=e.clientX-o.current.getBoundingClientRect().right;else{if("right"!==t)throw new Error("MUI X: Wrong drag direction");r=Math.max(1,e.clientX-o.current.getBoundingClientRect().left)}r=1.5*(r-1)+1,a.start(0,()=>{l.current.scroll({left:n.current.left+r,top:n.current.top})})});return i.jsx(po,et({},e,{ref:o,getCanScrollMore:()=>{const e=gridDimensionsSelector(l.current.state);if("left"===t)return n.current.left>0;if("right"===t){const t=u-e.viewportInnerSize.width;return n.current.left<t}return!1},style:m,handleDragOver:C}))}function GridVerticalScrollAreaContent(e){const{scrollDirection:t,scrollPosition:n}=e,o=r.useRef(null),l=useGridApiContext$1(),a=d(),s=useGridSelector(l,gridRowsMetaSelector),u=useGridRootProps$1(),c=getTotalHeaderHeight(l,u),p={top:"up"===t?c:void 0,bottom:"down"===t?0:void 0},g=M(e=>{let r;if(e.preventDefault(),"up"===t)r=e.clientY-o.current.getBoundingClientRect().bottom;else{if("down"!==t)throw new Error("MUI X: Wrong drag direction");r=Math.max(1,e.clientY-o.current.getBoundingClientRect().top)}r=1.5*(r-1)+1,a.start(0,()=>{l.current.scroll({left:n.current.left,top:n.current.top+r})})});return i.jsx(po,et({},e,{ref:o,getCanScrollMore:()=>{const e=gridDimensionsSelector(l.current.state);if("up"===t)return n.current.top>0;if("down"===t){const t=(s.currentPageTotalHeight||0)-e.viewportInnerSize.height-e.scrollbarSize;return n.current.top<t}return!1},style:p,handleDragOver:g}))}const po=forwardRef(function GridScrollAreaContent2(e,t){const{scrollDirection:n,getCanScrollMore:o,style:l,handleDragOver:a}=e,u=useGridApiContext$1(),[c,d]=r.useState(o),p=useGridRootProps$1(),g=et({},p,{scrollDirection:n}),h=(e=>{const{scrollDirection:t,classes:r}=e;return s({root:["scrollArea",`scrollArea--${t}`]},getDataGridUtilityClass,r)})(g);return Dt(u,"scrollPositionChange",()=>{d(o)}),c?i.jsx(uo,{ref:t,className:h.root,ownerState:g,onDragOver:a,style:l}):null}),go=I(function GridScrollAreaWrapper(e){const t=useGridApiContext$1(),[n,o]=r.useState("none");return Dt(t,"columnHeaderDragStart",()=>o("horizontal")),Dt(t,"columnHeaderDragEnd",()=>o("none")),Dt(t,"rowDragStart",()=>o("vertical")),Dt(t,"rowDragEnd",()=>o("none")),"none"===n?null:"horizontal"===n?i.jsx(GridHorizontalScrollAreaContent,et({},e)):i.jsx(GridVerticalScrollAreaContent,et({},e))});var fo,ho={};function requireReactMajor(){if(fo)return ho;fo=1;var t=rt().default;Object.defineProperty(ho,"__esModule",{value:!0}),ho.default=void 0;var r=t(e());return ho.default=parseInt(r.version,10),ho}const mo=nt(requireReactMajor()),Co=r.createContext(void 0);function useGridPrivateApiContext$1(){const e=r.useContext(Co);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 getVisibleRows=(e,t)=>On(e),useGridVisibleRows=(e,t)=>useGridSelector(e,On),bo=("undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"empty").includes("firefox"),gridVirtualizationSelector=e=>e.virtualization;createSelector(gridVirtualizationSelector,e=>e.enabled);const wo=createSelector(gridVirtualizationSelector,e=>e.enabledForColumns),vo=createSelector(gridVirtualizationSelector,e=>e.enabledForRows),xo=createSelector(gridVirtualizationSelector,e=>e.renderContext),Ro=createSelectorMemoized(e=>e.virtualization.renderContext.firstColumnIndex,e=>e.virtualization.renderContext.lastColumnIndex,(e,t)=>({firstColumnIndex:e,lastColumnIndex:t})),yo={firstRowIndex:0,lastRowIndex:0,firstColumnIndex:0,lastColumnIndex:0},virtualizationStateInitializer=(e,t)=>{const{disableVirtualization:r,autoHeight:n}=t;return et({},e,{virtualization:{enabled:!r,enabledForColumns:!r,enabledForRows:!r&&!n,renderContext:yo}})};const gridRowSpanningStateSelector=e=>e.rowSpanning,So=createSelector(gridRowSpanningStateSelector,e=>e.hiddenCells),Io=createSelector(gridRowSpanningStateSelector,e=>e.spannedCells),Mo=createSelector(gridRowSpanningStateSelector,e=>e.hiddenCellOriginMap),gridListColumnSelector=e=>e.listViewColumn,Po=createSelectorMemoized(pt(Cn,xo,On,fr,$t,(e,t,r,n,o)=>{if(!e)return!1;const l=o[e.id];if(!l)return!1;const i=r.rowToIndexMap.get(l),a=n.slice(t.firstColumnIndex,t.lastColumnIndex).findIndex(t=>t.field===e.field);return!(void 0!==i&&-1!==a&&i>=t.firstRowIndex&&i<=t.lastRowIndex)}),fr,On,$t,Cn,(e,t,r,n,o)=>{if(!e)return null;const l=n[o.id];if(!l)return null;const i=r.rowToIndexMap.get(l);if(void 0===i)return null;const a=t.findIndex(e=>e.field===o.field);return-1===a?null:et({},o,{rowIndex:i,columnIndex:a})});function roundToDecimalPlaces(e,t){return Math.round(e*10**t)/10**t}const ko="undefined"!=typeof window&&/jsdom|HappyDOM/.test(window.navigator.userAgent);var Do=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}(Do||{});const Eo={top:0,left:0},Fo=Object.freeze(new Map),useGridVirtualScroller=()=>{const e=useGridPrivateApiContext$1(),n=useGridRootProps$1(),{unstable_listView:o}=n,l=useGridSelector(e,()=>o?[gridListColumnSelector(e.current.state)]:fr(e)),s=useGridSelector(e,vo)&&!ko,u=useGridSelector(e,wo)&&!ko,c=useGridSelector(e,qt),p=Cr(e),g=o?ur:p,h=c.bottom.length>0,[m,C]=r.useState(Fo),b=v(),w=useGridSelector(e,fn),x=useGridVisibleRows(e),R=e.current.mainElementRef,y=e.current.virtualScrollerRef,S=e.current.virtualScrollbarVerticalRef,I=e.current.virtualScrollbarHorizontalRef,P=useGridSelector(e,xr),D=r.useRef(!1),E=useGridSelector(e,gridRowHeightSelector),F=useGridSelector(e,gridContentHeightSelector),G=useGridSelector(e,yt),H=useGridSelector(e,needsHorizontalScrollbarSelector),T=useGridSelector(e,gridVerticalScrollbarWidthSelector),O=useGridSelector(e,gridHasFillerSelector),L=r.useRef(null),A=r.useCallback(t=>{if(R.current=t,!t)return;const r=t.getBoundingClientRect();let n={width:roundToDecimalPlaces(r.width,1),height:roundToDecimalPlaces(r.height,1)};if((!L.current||n.width!==L.current.width&&n.height!==L.current.height)&&(L.current=n,e.current.publishEvent("resize",n)),"undefined"==typeof ResizeObserver)return;const o=new ResizeObserver(t=>{const r=t[0];if(!r)return;const o={width:roundToDecimalPlaces(r.contentRect.width,1),height:roundToDecimalPlaces(r.contentRect.height,1)};o.width===n.width&&o.height===n.height||(e.current.publishEvent("resize",o),n=o)});return o.observe(t),mo>=19?()=>{R.current=null,o.disconnect()}:void 0},[e,R]),j=r.useRef(n.initialState?.scroll??Eo),$=r.useRef(!1),z=r.useRef(Eo),V=r.useRef(yo),N=useGridSelector(e,xo),B=useGridSelector(e,Po),_=d(),W=r.useRef(void 0),U=t(()=>((e,t,r,n,o)=>({direction:Do.NONE,buffer:bufferForDirection(e,Do.NONE,t,r,n,o)}))(b,n.rowBufferPx,n.columnBufferPx,15*E,300)).current,q=r.useCallback(t=>{if(areRenderContextsEqual(t,e.current.state.virtualization.renderContext))return;const r=t.firstRowIndex!==V.current.firstRowIndex||t.lastRowIndex!==V.current.lastRowIndex;e.current.setState(e=>et({},e,{virtualization:et({},e.virtualization,{renderContext:t})}));gridDimensionsSelector(e.current.state).isReady&&r&&(V.current=t,e.current.publishEvent("renderedRowsIntervalChange",t)),z.current=j.current},[e]),K=M(()=>{const t=y.current;if(!t)return;const r=gridDimensionsSelector(e.current.state),o=Math.ceil(r.minimumSize.height-r.viewportOuterSize.height),l=Math.ceil(r.minimumSize.width-r.viewportInnerSize.width),i={top:clamp(t.scrollTop,0,o),left:b?clamp(t.scrollLeft,-l,0):clamp(t.scrollLeft,0,l)},a=i.left-j.current.left,c=i.top-j.current.top,d=0!==a||0!==c;j.current=i;const p=d?function directionForDelta(e,t){if(0===e&&0===t)return Do.NONE;return Math.abs(t)>=Math.abs(e)?t>0?Do.DOWN:Do.UP:e>0?Do.RIGHT:Do.LEFT}(a,c):Do.NONE,g=Math.abs(j.current.top-z.current.top),h=Math.abs(j.current.left-z.current.left),m=g>=E||h>=50,C=U.direction!==p;if(!(m||C))return N;if(C)switch(p){case Do.NONE:case Do.LEFT:case Do.RIGHT:W.current=void 0;break;default:W.current=N}U.direction=p,U.buffer=bufferForDirection(b,p,n.rowBufferPx,n.columnBufferPx,15*E,300);const w=computeRenderContext(inputsSelector(e,n,s,u),j.current,U);return areRenderContextsEqual(w,N)||(k.flushSync(()=>{q(w)}),_.start(1e3,K)),w}),forceUpdateRenderContext=()=>{if(!gridDimensionsSelector(e.current.state).isReady&&(s||u))return;const t=computeRenderContext(inputsSelector(e,n,s,u),j.current,U);W.current=void 0,q(t)},X=M(()=>{if($.current)return void($.current=!1);const t=K();e.current.publishEvent("scrollPositionChange",{top:j.current.top,left:j.current.left,renderContext:t})}),Y=M(t=>{e.current.publishEvent("virtualScrollerWheel",{},t)}),Q=M(t=>{e.current.publishEvent("virtualScrollerTouchMove",{},t)}),J=r.useMemo(()=>({overflowX:!H||o?"hidden":void 0,overflowY:n.autoHeight?"hidden":void 0}),[H,n.autoHeight,o]),Z=r.useMemo(()=>{const e={width:H?G:"auto",flexBasis:F,flexShrink:0};return 0===e.flexBasis&&(e.flexBasis=Hr),e},[G,F,H]),ee=r.useCallback(t=>{t&&e.current.publishEvent("virtualScrollerContentSizeChange",{columnsTotalWidth:G,contentHeight:F})},[e,G,F]);return a(()=>{D.current&&e.current.updateRenderContext?.()},[e,u,s]),a(()=>{o&&(y.current.scrollLeft=0)},[o,y]),((e,t)=>{const n=r.useRef(!1);a(()=>n.current||!e?noop$2:(n.current=!0,t()),[n.current||e])})(N!==yo,()=>{if(e.current.publishEvent("scrollPositionChange",{top:j.current.top,left:j.current.left,renderContext:N}),D.current=!0,n.initialState?.scroll&&y.current){const t=y.current,{top:r,left:o}=n.initialState.scroll,l={top:!(r>0),left:!(o>0)};if(!l.left&&G&&(t.scrollLeft=o,$.current=!0,l.left=!0),!l.top&&F&&(t.scrollTop=r,$.current=!0,l.top=!0),!l.top||!l.left){const n=e.current.subscribeEvent("virtualScrollerContentSizeChange",e=>{!l.left&&e.columnsTotalWidth&&(t.scrollLeft=o,$.current=!0,l.left=!0),!l.top&&e.contentHeight&&(t.scrollTop=r,$.current=!0,l.top=!0),l.left&&l.top&&n()});return n}}}),e.current.register("private",{updateRenderContext:forceUpdateRenderContext}),useGridApiOptionHandler(e,"sortedRowsSet",forceUpdateRenderContext),useGridApiOptionHandler(e,"paginationModelChange",forceUpdateRenderContext),useGridApiOptionHandler(e,"columnsChange",forceUpdateRenderContext),{renderContext:N,setPanels:C,getRows:(t={})=>{if(!t.rows&&!x.range)return[];const r=Vt(e);let o=N;t.renderContext&&(o=t.renderContext,o.firstColumnIndex=N.firstColumnIndex,o.lastColumnIndex=N.lastColumnIndex);const a=!h&&void 0===t.position||h&&"bottom"===t.position,s=void 0!==t.position;let u;switch(t.position){case"top":u=0;break;case"bottom":u=c.top.length+x.rows.length;break;case void 0:u=c.top.length}const d=t.rows??x.rows,p=o.firstRowIndex,C=Math.min(o.lastRowIndex,d.length),b=t.rows?range(0,t.rows.length):range(p,C);let v=-1;!s&&B&&(B.rowIndex<p&&(b.unshift(B.rowIndex),v=B.rowIndex),B.rowIndex>C&&(b.push(B.rowIndex),v=B.rowIndex));const R=[],y=n.slotProps?.row,S=br(e);return b.forEach(c=>{const{id:p,model:h}=d[c];if(!r[p])return;const C=(x?.range?.firstRowIndex||0)+u+c;if(P){const t=g.left.length,r=l.length-g.right.length;e.current.calculateColSpan({rowId:p,minFirstColumn:t,maxLastColumn:r,columns:l}),g.left.length>0&&e.current.calculateColSpan({rowId:p,minFirstColumn:0,maxLastColumn:g.left.length,columns:l}),g.right.length>0&&e.current.calculateColSpan({rowId:p,minFirstColumn:l.length-g.right.length,maxLastColumn:l.length,columns:l})}const b=e.current.rowHasAutoHeight(p)?"auto":e.current.unstable_getRowHeight(p);let I;I=null!=w[p]&&e.current.isRowSelectable(p);let M=!1;void 0===t.position&&(M=0===c);let k=!1;const D=c===d.length-1;if(a)if(s)k=D;else{c===x.rows.length-1&&(k=!0)}let E=o;W.current&&c>=W.current.firstRowIndex&&c<W.current.lastRowIndex&&(E=W.current);const F=c===v,H=B?.rowIndex===C,L=computeOffsetLeft(S,E,g.left.length),A=D&&"top"===t.position,j=E.firstColumnIndex,$=E.lastColumnIndex;if(R.push(i.jsx(n.slots.row,et({row:h,rowId:p,index:C,selected:I,offsetLeft:L,columnsTotalWidth:G,rowHeight:b,pinnedColumns:g,visibleColumns:l,firstColumnIndex:j,lastColumnIndex:$,focusedColumnIndex:H?B.columnIndex:void 0,isFirstVisible:M,isLastVisible:k,isNotVisible:F,showBottomBorder:A,scrollbarWidth:T,gridHasFiller:O},y),p)),F)return;const z=m.get(p);z&&R.push(z),void 0===t.position&&D&&R.push(e.current.getInfiniteLoadingTriggerElement?.({lastRowId:p}))}),R},getContainerProps:()=>({ref:A}),getScrollerProps:()=>({ref:y,onScroll:X,onWheel:Y,onTouchMove:Q,style:J,role:"presentation",tabIndex:bo?-1:void 0}),getContentProps:()=>({style:Z,role:"presentation",ref:ee}),getRenderZoneProps:()=>({role:"rowgroup"}),getScrollbarVerticalProps:()=>({ref:S,scrollPosition:j}),getScrollbarHorizontalProps:()=>({ref:I,scrollPosition:j}),getScrollAreaProps:()=>({scrollPosition:j})}};function needsHorizontalScrollbarSelector(e){return e.dimensions.viewportOuterSize.width>0&&e.dimensions.columnsTotalWidth>e.dimensions.viewportOuterSize.width}function inputsSelector(e,t,r,n){const o=gridDimensionsSelector(e.current.state),l=getVisibleRows(e),i=t.unstable_listView?[gridListColumnSelector(e.current.state)]:fr(e),a=Mo(e),s=e.current.state.rows.dataRowIds.at(-1),u=i.at(-1);return{enabledForRows:r,enabledForColumns:n,apiRef:e,autoHeight:t.autoHeight,rowBufferPx:t.rowBufferPx,columnBufferPx:t.columnBufferPx,leftPinnedWidth:o.leftPinnedWidth,columnsTotalWidth:o.columnsTotalWidth,viewportInnerWidth:o.viewportInnerSize.width,viewportInnerHeight:o.viewportInnerSize.height,lastRowHeight:void 0!==s?e.current.unstable_getRowHeight(s):0,lastColumnWidth:u?.computedWidth??0,rowsMeta:gridRowsMetaSelector(e.current.state),columnPositions:br(e),rows:l.rows,range:l.range,pinnedColumns:Cr(e),visibleColumns:i,hiddenCellsOriginMap:a,listView:t.unstable_listView??!1,virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight}}function computeRenderContext(e,t,r){const n={firstRowIndex:0,lastRowIndex:e.rows.length,firstColumnIndex:0,lastColumnIndex:e.visibleColumns.length},{top:o,left:l}=t,i=Math.abs(l)+e.leftPinnedWidth;if(e.enabledForRows){let t=Math.min(getNearestIndexToRender(e,o,{atStart:!0,lastPosition:e.rowsMeta.positions[e.rowsMeta.positions.length-1]+e.lastRowHeight}),e.rowsMeta.positions.length-1);const r=e.hiddenCellsOriginMap[t];if(r){const e=Math.min(...Object.values(r));t=Math.min(t,e)}const l=e.autoHeight?t+e.rows.length:getNearestIndexToRender(e,o+e.viewportInnerHeight);n.firstRowIndex=t,n.lastRowIndex=l}if(e.listView)return et({},n,{lastColumnIndex:1});if(e.enabledForColumns){let t=0,o=e.columnPositions.length,l=!1;const[a,s]=getIndexesToRender({firstIndex:n.firstRowIndex,lastIndex:n.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:r.buffer.rowBefore,bufferAfter:r.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight});if(!e.virtualizeColumnsWithAutoRowHeight)for(let r=a;r<s&&!l;r+=1){const t=e.rows[r];l=e.apiRef.current.rowHasAutoHeight(t.id)}l&&!e.virtualizeColumnsWithAutoRowHeight||(t=binarySearch(i,e.columnPositions,{atStart:!0,lastPosition:e.columnsTotalWidth}),o=binarySearch(i+e.viewportInnerWidth,e.columnPositions)),n.firstColumnIndex=t,n.lastColumnIndex=o}const a=function deriveRenderContext(e,t,r){const[n,o]=getIndexesToRender({firstIndex:t.firstRowIndex,lastIndex:t.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:r.buffer.rowBefore,bufferAfter:r.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight}),[l,i]=getIndexesToRender({firstIndex:t.firstColumnIndex,lastIndex:t.lastColumnIndex,minFirstIndex:e.pinnedColumns.left.length,maxLastIndex:e.visibleColumns.length-e.pinnedColumns.right.length,bufferBefore:r.buffer.columnBefore,bufferAfter:r.buffer.columnAfter,positions:e.columnPositions,lastSize:e.lastColumnWidth}),a=function getFirstNonSpannedColumnToRender({firstColumnToRender:e,apiRef:t,firstRowToRender:r,lastRowToRender:n,visibleRows:o}){let l=e,i=!1;for(;!i;){i=!0;for(let e=r;e<n;e+=1)if(o[e]){const r=o[e].id,n=t.current.unstable_getCellColSpanInfo(r,l);if(n&&n.spannedByColSpan&&n.leftVisibleCellIndex<l){l=n.leftVisibleCellIndex,i=!1;break}}}return l}({firstColumnToRender:l,apiRef:e.apiRef,firstRowToRender:n,lastRowToRender:o,visibleRows:e.rows});return{firstRowIndex:n,lastRowIndex:o,firstColumnIndex:a,lastColumnIndex:i}}(e,n,r);return a}function getNearestIndexToRender(e,t,r){const n=e.apiRef.current.getLastMeasuredRowIndex();let o=n===1/0;e.range?.lastRowIndex&&!o&&(o=n>=e.range.lastRowIndex);const l=clamp(n-(e.range?.firstRowIndex||0),0,e.rowsMeta.positions.length);return o||e.rowsMeta.positions[l]>=t?binarySearch(t,e.rowsMeta.positions,r):function exponentialSearch(e,t,r,n){let o=1;for(;r<t.length&&Math.abs(t[r])<e;)r+=o,o*=2;return binarySearch(e,t,n,Math.floor(r/2),Math.min(r,t.length))}(t,e.rowsMeta.positions,l,r)}function binarySearch(e,t,r=void 0,n=0,o=t.length){if(t.length<=0)return-1;if(n>=o)return n;const l=n+Math.floor((o-n)/2),i=t[l];let a;if(r?.atStart){a=e-((l===t.length-1?r.lastPosition:t[l+1])-i)<i}else a=e<=i;return a?binarySearch(e,t,r,n,l):binarySearch(e,t,r,l+1,o)}function getIndexesToRender({firstIndex:e,lastIndex:t,bufferBefore:r,bufferAfter:n,minFirstIndex:o,maxLastIndex:l,positions:i,lastSize:a}){const s=i[e]-r,u=i[t]+n,c=binarySearch(s,i,{atStart:!0,lastPosition:i[i.length-1]+a}),d=binarySearch(u,i);return[clamp(c,o,l),clamp(d,o,l)]}function areRenderContextsEqual(e,t){return e===t||e.firstRowIndex===t.firstRowIndex&&e.lastRowIndex===t.lastRowIndex&&e.firstColumnIndex===t.firstColumnIndex&&e.lastColumnIndex===t.lastColumnIndex}function computeOffsetLeft(e,t,r){const n=(e[t.firstColumnIndex]??0)-(e[r]??0);return Math.abs(n)}function bufferForDirection(e,t,r,n,o,l){if(e)switch(t){case Do.LEFT:t=Do.RIGHT;break;case Do.RIGHT:t=Do.LEFT}switch(t){case Do.NONE:return{rowAfter:r,rowBefore:r,columnAfter:n,columnBefore:n};case Do.LEFT:return{rowAfter:0,rowBefore:0,columnAfter:0,columnBefore:l};case Do.RIGHT:return{rowAfter:0,rowBefore:0,columnAfter:l,columnBefore:0};case Do.UP:return{rowAfter:0,rowBefore:o,columnAfter:0,columnBefore:0};case Do.DOWN:return{rowAfter:o,rowBefore:0,columnAfter:0,columnBefore:0};default:throw new Error("unreachable")}}const Go=P("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>"overlayType"!==e&&"loadingOverlayVariant"!==e,overridesResolver:(e,t)=>t.overlayWrapper})(({overlayType:e,loadingOverlayVariant:t})=>"skeleton"!==t?{position:"sticky",top:"var(--DataGrid-headersTotalHeight)",left:0,width:0,height:0,zIndex:"loadingOverlay"===e?5:4}:{}),Ho=P("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>"overlayType"!==e&&"loadingOverlayVariant"!==e,overridesResolver:(e,t)=>t.overlayWrapperInner})({});function GridOverlayWrapper(e){const t=useGridApiContext$1(),r=useGridRootProps$1(),n=useGridSelector(t,gridDimensionsSelector);let o=Math.max(n.viewportOuterSize.height-n.topContainerHeight-n.bottomContainerHeight-(n.hasScrollX?n.scrollbarSize:0),0);0===o&&(o=Hr);const l=(e=>{const{classes:t}=e;return s({root:["overlayWrapper"],inner:["overlayWrapperInner"]},getDataGridUtilityClass,t)})(et({},e,{classes:r.classes}));return i.jsx(Go,et({className:h(l.root)},e,{children:i.jsx(Ho,et({className:h(l.inner),style:{height:o,width:n.viewportOuterSize.width}},e))}))}function GridOverlays(e){const{overlayType:t}=e,r=useGridRootProps$1();if(!t)return null;const n=r.slots?.[t],o=r.slotProps?.[t];return i.jsx(GridOverlayWrapper,et({},e,{children:i.jsx(n,et({},o))}))}const gridColumnMenuSelector=e=>e.columnMenu;const To=I(function GridHeaders(){const e=useGridPrivateApiContext$1(),t=useGridRootProps$1(),r=useGridSelector(e,fr),n=useGridSelector(e,dn),o=useGridSelector(e,qr),l=useGridSelector(e,Rn),a=useGridSelector(e,()=>null===xn(e)),s=useGridSelector(e,Sn),u=useGridSelector(e,bn),c=useGridSelector(e,vn),d=useGridSelector(e,io),p=useGridSelector(e,gridColumnMenuSelector),g=useGridSelector(e,gr),h=useGridSelector(e,lo),m=!(null===s&&null===l&&a),C=e.current.columnHeadersContainerRef;return i.jsx(t.slots.columnHeaders,et({ref:C,visibleColumns:r,filterColumnLookup:n,sortColumnLookup:o,columnHeaderTabIndexState:l,columnGroupHeaderTabIndexState:s,columnHeaderFocus:u,columnGroupHeaderFocus:c,headerGroupingMaxDepth:d,columnMenuState:p,columnVisibility:g,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:m},t.slotProps?.columnHeaders))}),Oo=r.createContext(void 0),useGridConfiguration=()=>{const e=r.useContext(Oo);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},Lo=P("div")({position:"absolute",top:"var(--DataGrid-headersTotalHeight)",left:0,width:"calc(100% - (var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))"}),Ao=P("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.main,r.hasPinnedRight&&t["main--hasPinnedRight"],"skeleton"===r.loadingOverlayVariant&&t["main--hasSkeletonLoadingOverlay"]]}})({flexGrow:1,position:"relative",overflow:"hidden",display:"flex",flexDirection:"column"}),jo=forwardRef((e,t)=>{const{ownerState:r}=e,n=useGridRootProps$1(),o=useGridConfiguration().hooks.useGridAriaAttributes();return i.jsxs(Ao,et({ownerState:r,className:e.className,tabIndex:-1},o,n.slotProps?.main,{ref:t,children:[i.jsx(Lo,{role:"presentation","data-id":"gridPanelAnchor"}),e.children]}))}),$o=P("div")({position:"sticky",zIndex:40,top:0});function GridTopContainer(e){const t=s({root:["topContainer"]},getDataGridUtilityClass,{});return i.jsx($o,et({},e,{className:h(t.root,Mt["container--top"]),role:"presentation"}))}const zo=P("div")({position:"sticky",zIndex:40,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});function GridBottomContainer(e){const t=s({root:["bottomContainer"]},getDataGridUtilityClass,{});return i.jsx(zo,et({},e,{className:h(t.root,Mt["container--bottom"]),role:"presentation"}))}const Vo=P("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.virtualScrollerContent,r.overflowedContent&&t["virtualScrollerContent--overflowed"]]}})({}),No=forwardRef(function GridVirtualScrollerContent2(e,t){const r=useGridRootProps$1(),n=!r.autoHeight&&"auto"===e.style?.minHeight,o=((e,t)=>{const{classes:r}=e;return s({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},getDataGridUtilityClass,r)})(r,n),l={classes:r.classes,overflowedContent:n};return i.jsx(Vo,et({},e,{ownerState:l,className:h(o.root,e.className),ref:t}))}),Bo=P("div")({display:"flex",flexDirection:"row",width:"var(--DataGrid-rowWidth)",boxSizing:"border-box"}),_o=P("div")({position:"sticky",height:"100%",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",backgroundColor:"var(--DataGrid-pinnedBackground)"}),Wo=P(_o)({left:0,borderRight:"1px solid var(--rowBorderColor)"}),Uo=P(_o)({right:0,borderLeft:"1px solid var(--rowBorderColor)"}),qo=P("div")({flexGrow:1,borderTop:"1px solid var(--rowBorderColor)"});const Ko=I(function GridVirtualScrollerFiller({rowsLength:e}){const t=useGridApiContext$1(),{viewportOuterSize:r,minimumSize:n,hasScrollX:o,hasScrollY:l,scrollbarSize:a,leftPinnedWidth:s,rightPinnedWidth:u}=useGridSelector(t,gridDimensionsSelector),c=o?a:0,d=r.height-n.height>0;return 0!==c||d?i.jsxs(Bo,{className:Mt.filler,role:"presentation",style:{height:c,"--rowBorderColor":0===e?"transparent":"var(--DataGrid-rowBorderColor)"},children:[s>0&&i.jsx(Wo,{className:Mt["filler--pinnedLeft"],style:{width:s}}),i.jsx(qo,{}),u>0&&i.jsx(Uo,{className:Mt["filler--pinnedRight"],style:{width:u+(l?a:0)}})]}):null}),Xo=["className"],Yo=P("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone",overridesResolver:(e,t)=>t.virtualScrollerRenderZone})({position:"absolute",display:"flex",flexDirection:"column"}),Qo=forwardRef(function GridVirtualScrollerRenderZone2(e,t){const{className:r}=e,n=tt(e,Xo),o=useGridApiContext$1(),l=useGridRootProps$1(),a=(e=>{const{classes:t}=e;return s({root:["virtualScrollerRenderZone"]},getDataGridUtilityClass,t)})(l),u=useGridSelector(o,()=>{const e=xo(o);return gridRowsMetaSelector(o.current.state).positions[e.firstRowIndex]??0});return i.jsx(Yo,et({className:h(a.root,r),ownerState:l,style:{transform:`translate3d(0, ${u}px, 0)`}},n,{ref:t}))}),Jo={includeHeaders:!0,includeOutliers:!1,outliersFactor:1.5,expand:!1,disableColumnVirtualization:!0},gridEditRowsStateSelector=e=>e.editRows,Zo=createSelectorV8(gridEditRowsStateSelector,(e,{rowId:t,editMode:r})=>r===Zt.Row&&Boolean(e[t])),el=createSelectorV8(gridEditRowsStateSelector,(e,{rowId:t,field:r})=>e[t]?.[r]??null),gridPreferencePanelStateSelector=e=>e.preferencePanel,tl=createSelectorV8(gridPreferencePanelStateSelector,(e,t)=>!(!e.open||e.labelId!==t));var rl=function(e){return e.filters="filters",e.columns="columns",e}(rl||{});const nl=P("div")({position:"absolute",display:"inline-block",zIndex:60,"&:hover":{zIndex:70},"--size":"calc(max(var(--DataGrid-scrollbarSize), 14px))"}),ol=P(nl)({width:"var(--size)",height:"calc(var(--DataGrid-hasScrollY) * (100% - var(--DataGrid-topContainerHeight) - var(--DataGrid-bottomContainerHeight) - var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize)))",overflowY:"auto",overflowX:"hidden",outline:0,"& > div":{width:"var(--size)"},top:"var(--DataGrid-topContainerHeight)",right:"0px"}),ll=P(nl)({width:"100%",height:"var(--size)",overflowY:"hidden",overflowX:"auto",outline:0,"& > div":{height:"var(--size)"},bottom:"0px"}),il=forwardRef(function GridVirtualScrollbar2(e,t){const n=useGridPrivateApiContext$1(),o=useGridRootProps$1(),l=r.useRef(!1),a=r.useRef(0),u=r.useRef(null),c=r.useRef(null),d=((e,t)=>{const{classes:r}=e;return s({root:["scrollbar",`scrollbar--${t}`],content:["scrollbarContent"]},getDataGridUtilityClass,r)})(o,e.position),p=useGridSelector(n,gridDimensionsSelector),g="vertical"===e.position?"height":"width",h="vertical"===e.position?"scrollTop":"scrollLeft",m="vertical"===e.position?"top":"left",C="vertical"===e.position?p.hasScrollX:p.hasScrollY,b=p.minimumSize[g]+(C?p.scrollbarSize:0),w=("vertical"===e.position?p.viewportInnerSize.height:p.viewportOuterSize.width)*(b/p.viewportOuterSize[g]),v=M(()=>{const t=u.current,r=e.scrollPosition.current;if(!t)return;if(r[m]===a.current)return;if(a.current=r[m],l.current)return void(l.current=!1);l.current=!0;const n=r[m]/b;t[h]=n*w}),x=M(()=>{const e=n.current.virtualScrollerRef.current,t=u.current;if(!t)return;if(l.current)return void(l.current=!1);l.current=!0;const r=t[h]/w;e[h]=r*b});D(()=>{const e=n.current.virtualScrollerRef.current,t=u.current,r={passive:!0};return e.addEventListener("scroll",v,r),t.addEventListener("scroll",x,r),()=>{e.removeEventListener("scroll",v,r),t.removeEventListener("scroll",x,r)}}),r.useEffect(()=>{c.current.style.setProperty(g,`${w}px`)},[w,g]);const y="vertical"===e.position?ol:ll;return i.jsx(y,{ref:R(t,u),className:d.root,style:"vertical"===e.position&&o.unstable_listView?{height:"100%",top:0}:void 0,tabIndex:-1,"aria-hidden":"true",onFocus:e=>{e.target.blur()},children:i.jsx("div",{ref:c,className:d.content})})}),al=P("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.virtualScroller,r.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}),hasPinnedRightSelector=e=>e.dimensions.rightPinnedWidth>0;function GridVirtualScroller(e){const t=useGridApiContext$1(),r=useGridRootProps$1(),n=useGridSelector(t,gridHasScrollYSelector),o=useGridSelector(t,gridHasScrollXSelector),l=useGridSelector(t,hasPinnedRightSelector),a=useGridSelector(t,gridHasBottomFillerSelector),u=(()=>{const e=useGridApiContext$1(),t=useGridRootProps$1(),r=useGridSelector(e,Lt),n=useGridSelector(e,an),o=useGridSelector(e,Kt),l=0===r&&0===o,i=useGridSelector(e,At);let a=null,s=null;return!i&&l&&(a="noRowsOverlay"),!i&&r>0&&0===n&&(a="noResultsOverlay"),i&&(a="loadingOverlay",s=t.slotProps?.loadingOverlay?.[l?"noRowsVariant":"variant"]||null),{overlayType:a,loadingOverlayVariant:s}})(),c={classes:r.classes,hasScrollX:o,hasPinnedRight:l,loadingOverlayVariant:u.loadingOverlayVariant},d=(e=>{const{classes:t,hasScrollX:r,hasPinnedRight:n,loadingOverlayVariant:o}=e;return s({root:["main",n&&"main--hasPinnedRight","skeleton"===o&&"main--hasSkeletonLoadingOverlay"],scroller:["virtualScroller",r&&"virtualScroller--hasScrollX"]},getDataGridUtilityClass,t)})(c),p=useGridVirtualScroller(),{getContainerProps:g,getScrollerProps:h,getContentProps:m,getRenderZoneProps:C,getScrollbarVerticalProps:b,getScrollbarHorizontalProps:w,getRows:v,getScrollAreaProps:x}=p,R=v();return i.jsxs(jo,et({className:d.root},g(),{ownerState:c,children:[i.jsx(go,et({scrollDirection:"left"},x())),i.jsx(go,et({scrollDirection:"right"},x())),i.jsx(go,et({scrollDirection:"up"},x())),i.jsx(go,et({scrollDirection:"down"},x())),i.jsxs(al,et({className:d.scroller},h(),{ownerState:c,children:[i.jsxs(GridTopContainer,{children:[!r.unstable_listView&&i.jsx(To,{}),i.jsx(r.slots.pinnedRows,{position:"top",virtualScroller:p})]}),i.jsx(GridOverlays,et({},u)),i.jsx(No,et({},m(),{children:i.jsxs(Qo,et({},C(),{children:[R,i.jsx(r.slots.detailPanels,{virtualScroller:p})]}))})),a&&i.jsx(Ko,{rowsLength:R.length}),i.jsx(GridBottomContainer,{children:i.jsx(r.slots.pinnedRows,{position:"bottom",virtualScroller:p})})]})),o&&!r.unstable_listView&&i.jsx(il,et({position:"horizontal"},w())),n&&i.jsx(il,et({position:"vertical"},b())),e.children]}))}function GridFooterPlaceholder(){const e=useGridRootProps$1();return e.hideFooter?null:i.jsx(e.slots.footer,et({},e.slotProps?.footer))}let sl;function doesSupportPreventScroll(){return void 0===sl&&document.createElement("div").focus({get preventScroll(){return sl=!0,!1}}),sl}function useProps(e){return r.useMemo(()=>function groupForwardedProps(e){if(e.slotProps?.root)return e;const t=Object.keys(e);if(!t.some(e=>e.startsWith("aria-")||e.startsWith("data-")))return e;const r={},n=e.forwardedProps??{};for(let o=0;o<t.length;o+=1){const l=t[o];l.startsWith("aria-")||l.startsWith("data-")?n[l]=e[l]:r[l]=e[l]}return r.forwardedProps=n,r}(e),[e])}const rtlFlipSide=(e,t)=>{if(e)if(t){if(e===Ar.LEFT)return"right";if(e===Ar.RIGHT)return"left"}else{if(e===Ar.LEFT)return"left";if(e===Ar.RIGHT)return"right"}};function attachPinnedStyle(e,t,r,n){const o=rtlFlipSide(r,t);return o&&void 0!==n?(e[o]=n,e):e}const ul=["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"],cl=["changeReason","unstable_updateValueOnRender"];Ar.LEFT,sr.LEFT,Ar.RIGHT,sr.RIGHT,Ar.NONE,Ar.VIRTUAL;const dl=I(forwardRef(function GridCell2(e,t){const{column:n,row:o,rowId:l,rowNode:a,align:u,colIndex:c,width:d,className:p,style:g,colSpan:m,disableDragEvents:C,isNotVisible:b,pinnedOffset:w,pinnedPosition:x,showRightBorder:y,showLeftBorder:S,onClick:I,onDoubleClick:M,onMouseDown:P,onMouseUp:k,onMouseOver:D,onKeyDown:G,onKeyUp:H,onDragEnter:T,onDragOver:O}=e,L=tt(e,ul),A=useGridPrivateApiContext$1(),j=useGridRootProps$1(),$=v(),z=n.field,V=useGridSelectorV8(A,el,{rowId:l,field:z}),N=useGridConfiguration().hooks.useCellAggregationResult(l,z),B=V?er.Edit:er.View,_=A.current.getCellParamsForRow(l,z,o,{colDef:n,cellMode:B,rowNode:a,tabIndex:useGridSelector(A,()=>{const e=xn(A);return e&&e.field===z&&e.id===l?0:-1}),hasFocus:useGridSelector(A,()=>{const e=Cn(A);return e?.id===l&&e.field===z})});_.api=A.current,N&&(_.value=N.value,_.formattedValue=n.valueFormatter?n.valueFormatter(_.value,o,n,A):_.value);const W=useGridSelector(A,()=>A.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:l,field:z})),U=useGridSelector(A,So),q=useGridSelector(A,Io),{hasFocus:K,isEditable:X=!1,value:Y}=_,Q="actions"===n.type&&n.getActions?.(A.current.getRowParams(l)).some(e=>!e.props.disabled),J="view"!==B&&X||Q?-1:_.tabIndex,{classes:Z,getCellClassName:ee}=j,te=[useGridSelector(A,()=>A.current.unstable_applyPipeProcessors("cellClassName",[],{id:l,field:z}).filter(Boolean).join(" "))];n.cellClassName&&te.push("function"==typeof n.cellClassName?n.cellClassName(_):n.cellClassName),"flex"===n.display&&te.push(Mt["cell--flex"]),ee&&te.push(ee(_));const re=_.formattedValue??Y,ne=r.useRef(null),oe=R(t,ne),le=r.useRef(null),ie=j.cellSelection??!1,ae=(e=>{const{align:t,showLeftBorder:r,showRightBorder:n,pinnedPosition:o,isEditable:l,isSelected:i,isSelectionMode:a,classes:u}=e,c={root:["cell",`cell--text${F(t)}`,i&&"selected",l&&"cell--editable",r&&"cell--withLeftBorder",n&&"cell--withRightBorder",o===Ar.LEFT&&"cell--pinnedLeft",o===Ar.RIGHT&&"cell--pinnedRight",a&&!l&&"cell--selectionMode"]};return s(c,getDataGridUtilityClass,u)})({align:u,showLeftBorder:S,showRightBorder:y,isEditable:X,classes:j.classes,pinnedPosition:x,isSelected:W,isSelectionMode:ie}),se=r.useCallback(e=>t=>{const r=A.current.getCellParams(l,z||"");A.current.publishEvent(e,r,t),k&&k(t)},[A,z,k,l]),ue=r.useCallback(e=>t=>{const r=A.current.getCellParams(l,z||"");A.current.publishEvent(e,r,t),P&&P(t)},[A,z,P,l]),ce=r.useCallback((e,t)=>r=>{if(!A.current.getRow(l))return;const n=A.current.getCellParams(l,z||"");A.current.publishEvent(e,n,r),t&&t(r)},[A,z,l]),de=U[l]?.[z]??!1,pe=q[l]?.[z]??1,ge=r.useMemo(()=>{if(b)return{padding:0,opacity:0,width:0,height:0,border:0};const e=attachPinnedStyle(et({"--width":`${d}px`},g),$,x,w),t=x===Ar.LEFT,r=x===Ar.RIGHT;return pe>1&&(e.height=`calc(var(--height) * ${pe})`,e.zIndex=10,(t||r)&&(e.zIndex=40)),e},[d,b,g,w,x,$,pe]);if(r.useEffect(()=>{if(!K||B===er.Edit)return;const e=E(A.current.rootElementRef.current);if(ne.current&&!ne.current.contains(e.activeElement)){const e=ne.current.querySelector('[tabindex="0"]'),t=le.current||e||ne.current;if(doesSupportPreventScroll())t.focus({preventScroll:!0});else{const e=A.current.getScrollPosition();t.focus(),A.current.scroll(e)}}},[K,B,A]),de)return i.jsx("div",{"data-colindex":c,role:"presentation",style:et({width:"var(--width)"},ge)});let fe,he,me=L.onFocus;if(null===V&&n.renderCell&&(fe=n.renderCell(_)),null!==V&&n.renderEditCell){const e=A.current.getRowWithUpdatedValues(l,n.field),t=tt(V,cl),r=n.valueFormatter?n.valueFormatter(V.value,e,n,A):_.formattedValue,o=et({},_,{row:e,formattedValue:r},t);fe=n.renderEditCell(o),te.push(Mt["cell--editing"]),te.push(Z?.["cell--editing"])}if(void 0===fe){const e=re?.toString();fe=e,he=e}r.isValidElement(fe)&&Q&&(fe=r.cloneElement(fe,{focusElementRef:le}));const Ce=C?null:{onDragEnter:ce("cellDragEnter",T),onDragOver:ce("cellDragOver",O)};return i.jsx("div",et({className:h(ae.root,te,p),role:"gridcell","data-field":z,"data-colindex":c,"aria-colindex":c+1,"aria-colspan":m,"aria-rowspan":pe,style:ge,title:he,tabIndex:J,onClick:ce("cellClick",I),onDoubleClick:ce("cellDoubleClick",M),onMouseOver:ce("cellMouseOver",D),onMouseDown:ue("cellMouseDown"),onMouseUp:se("cellMouseUp"),onKeyDown:ce("cellKeyDown",G),onKeyUp:ce("cellKeyUp",H)},Ce,L,{onFocus:me,ref:oe,children:fe}))})),pl=["field","type","align","width","height","empty","style","className"],gl="1.3em",fl=[40,80],hl={number:[40,60],string:[40,80],date:[40,60],dateTime:[60,80],singleSelect:[40,80]},ml=function createRandomNumberGenerator(e){const t=function mulberry32(e){return()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296}}(e);return(e,r)=>e+(r-e)*t()}(12345);const Cl=I(function GridSkeletonCell(e){const{field:t,type:n,align:o,width:l,height:a,empty:u=!1,style:c,className:d}=e,p=tt(e,pl),g=(e=>{const{align:t,classes:r,empty:n}=e,o={root:["cell","cellSkeleton",`cell--text${t?F(t):"Left"}`,n&&"cellEmpty"]};return s(o,getDataGridUtilityClass,r)})({classes:useGridRootProps$1().classes,align:o,empty:u}),m=r.useMemo(()=>{if("boolean"===n||"actions"===n)return{variant:"circular",width:gl,height:gl};const[e,t]=n?hl[n]??fl:fl;return{variant:"text",width:`${Math.round(ml(e,t))}%`,height:"1.2em"}},[n]);return i.jsx("div",et({"data-field":t,className:h(g.root,d),style:et({height:a,maxWidth:l,minWidth:l},c)},p,{children:!u&&i.jsx(G,et({},m))}))});const bl={width:3,rx:1.5,x:10.5},shouldShowBorderTopRightRadiusSelector=e=>e.dimensions.hasScrollX&&(!e.dimensions.hasScrollY||0===e.dimensions.scrollbarSize),wl=u("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${Mt.autoHeight}`]:t.autoHeight},{[`&.${Mt.autosizing}`]:t.autosizing},{[`&.${Mt["root--densityStandard"]}`]:t["root--densityStandard"]},{[`&.${Mt["root--densityComfortable"]}`]:t["root--densityComfortable"]},{[`&.${Mt["root--densityCompact"]}`]:t["root--densityCompact"]},{[`&.${Mt["root--disableUserSelection"]}`]:t["root--disableUserSelection"]},{[`&.${Mt["root--noToolbar"]}`]:t["root--noToolbar"]},{[`&.${Mt.withVerticalBorder}`]:t.withVerticalBorder},{[`& .${Mt.actionsCell}`]:t.actionsCell},{[`& .${Mt.booleanCell}`]:t.booleanCell},{[`& .${Mt.cell}`]:t.cell},{[`& .${Mt["cell--editable"]}`]:t["cell--editable"]},{[`& .${Mt["cell--editing"]}`]:t["cell--editing"]},{[`& .${Mt["cell--flex"]}`]:t["cell--flex"]},{[`& .${Mt["cell--pinnedLeft"]}`]:t["cell--pinnedLeft"]},{[`& .${Mt["cell--pinnedRight"]}`]:t["cell--pinnedRight"]},{[`& .${Mt["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${Mt["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${Mt["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${Mt["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${Mt["cell--selectionMode"]}`]:t["cell--selectionMode"]},{[`& .${Mt["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${Mt["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${Mt["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${Mt["cell--withLeftBorder"]}`]:t["cell--withLeftBorder"]},{[`& .${Mt["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${Mt.cellCheckbox}`]:t.cellCheckbox},{[`& .${Mt.cellEmpty}`]:t.cellEmpty},{[`& .${Mt.cellOffsetLeft}`]:t.cellOffsetLeft},{[`& .${Mt.cellSkeleton}`]:t.cellSkeleton},{[`& .${Mt.checkboxInput}`]:t.checkboxInput},{[`& .${Mt.columnHeader}`]:t.columnHeader},{[`& .${Mt["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${Mt["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${Mt["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${Mt["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${Mt["columnHeader--emptyGroup"]}`]:t["columnHeader--emptyGroup"]},{[`& .${Mt["columnHeader--filledGroup"]}`]:t["columnHeader--filledGroup"]},{[`& .${Mt["columnHeader--filtered"]}`]:t["columnHeader--filtered"]},{[`& .${Mt["columnHeader--last"]}`]:t["columnHeader--last"]},{[`& .${Mt["columnHeader--lastUnpinned"]}`]:t["columnHeader--lastUnpinned"]},{[`& .${Mt["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${Mt["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${Mt["columnHeader--pinnedLeft"]}`]:t["columnHeader--pinnedLeft"]},{[`& .${Mt["columnHeader--pinnedRight"]}`]:t["columnHeader--pinnedRight"]},{[`& .${Mt["columnHeader--siblingFocused"]}`]:t["columnHeader--siblingFocused"]},{[`& .${Mt["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${Mt["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${Mt["columnHeader--withLeftBorder"]}`]:t["columnHeader--withLeftBorder"]},{[`& .${Mt["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${Mt.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${Mt.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${Mt.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${Mt.columnHeaderTitleContainerContent}`]:t.columnHeaderTitleContainerContent},{[`& .${Mt.columnSeparator}`]:t.columnSeparator},{[`& .${Mt["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${Mt["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${Mt["columnSeparator--sideLeft"]}`]:t["columnSeparator--sideLeft"]},{[`& .${Mt["columnSeparator--sideRight"]}`]:t["columnSeparator--sideRight"]},{[`& .${Mt["container--bottom"]}`]:t["container--bottom"]},{[`& .${Mt["container--top"]}`]:t["container--top"]},{[`& .${Mt.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${Mt["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},{[`& .${Mt.editBooleanCell}`]:t.editBooleanCell},{[`& .${Mt.filterIcon}`]:t.filterIcon},{[`& .${Mt["filler--borderBottom"]}`]:t["filler--borderBottom"]},{[`& .${Mt["filler--pinnedLeft"]}`]:t["filler--pinnedLeft"]},{[`& .${Mt["filler--pinnedRight"]}`]:t["filler--pinnedRight"]},{[`& .${Mt.groupingCriteriaCell}`]:t.groupingCriteriaCell},{[`& .${Mt.groupingCriteriaCellLoadingContainer}`]:t.groupingCriteriaCellLoadingContainer},{[`& .${Mt.groupingCriteriaCellToggle}`]:t.groupingCriteriaCellToggle},{[`& .${Mt.headerFilterRow}`]:t.headerFilterRow},{[`& .${Mt.iconSeparator}`]:t.iconSeparator},{[`& .${Mt.menuIcon}`]:t.menuIcon},{[`& .${Mt.menuIconButton}`]:t.menuIconButton},{[`& .${Mt.menuList}`]:t.menuList},{[`& .${Mt.menuOpen}`]:t.menuOpen},{[`& .${Mt.overlayWrapperInner}`]:t.overlayWrapperInner},{[`& .${Mt.pinnedRows}`]:t.pinnedRows},{[`& .${Mt["pinnedRows--bottom"]}`]:t["pinnedRows--bottom"]},{[`& .${Mt["pinnedRows--top"]}`]:t["pinnedRows--top"]},{[`& .${Mt.row}`]:t.row},{[`& .${Mt["row--borderBottom"]}`]:t["row--borderBottom"]},{[`& .${Mt["row--detailPanelExpanded"]}`]:t["row--detailPanelExpanded"]},{[`& .${Mt["row--dragging"]}`]:t["row--dragging"]},{[`& .${Mt["row--dynamicHeight"]}`]:t["row--dynamicHeight"]},{[`& .${Mt["row--editable"]}`]:t["row--editable"]},{[`& .${Mt["row--editing"]}`]:t["row--editing"]},{[`& .${Mt["row--firstVisible"]}`]:t["row--firstVisible"]},{[`& .${Mt["row--lastVisible"]}`]:t["row--lastVisible"]},{[`& .${Mt.rowReorderCell}`]:t.rowReorderCell},{[`& .${Mt["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${Mt.rowReorderCellContainer}`]:t.rowReorderCellContainer},{[`& .${Mt.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${Mt.rowSkeleton}`]:t.rowSkeleton},{[`& .${Mt.scrollbar}`]:t.scrollbar},{[`& .${Mt["scrollbar--horizontal"]}`]:t["scrollbar--horizontal"]},{[`& .${Mt["scrollbar--vertical"]}`]:t["scrollbar--vertical"]},{[`& .${Mt.scrollbarFiller}`]:t.scrollbarFiller},{[`& .${Mt["scrollbarFiller--borderBottom"]}`]:t["scrollbarFiller--borderBottom"]},{[`& .${Mt["scrollbarFiller--borderTop"]}`]:t["scrollbarFiller--borderTop"]},{[`& .${Mt["scrollbarFiller--header"]}`]:t["scrollbarFiller--header"]},{[`& .${Mt["scrollbarFiller--pinnedRight"]}`]:t["scrollbarFiller--pinnedRight"]},{[`& .${Mt.sortIcon}`]:t.sortIcon},{[`& .${Mt.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${Mt.treeDataGroupingCellLoadingContainer}`]:t.treeDataGroupingCellLoadingContainer},{[`& .${Mt.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${Mt.withBorderColor}`]:t.withBorderColor}]})(({theme:e})=>{const t=useGridPrivateApiContext$1(),r=useGridSelector(t,shouldShowBorderTopRightRadiusSelector),n=function getBorderColor(e){return e.vars?e.vars.palette.TableCell.border:"light"===e.palette.mode?T(H(e.palette.divider,1),.88):O(H(e.palette.divider,1),.68)}(e),o=e.shape.borderRadius,l=e.vars?e.vars.palette.background.default:e.mixins.MuiDataGrid?.containerBackground??e.palette.background.default,i=e.mixins.MuiDataGrid?.pinnedBackground??l,a=e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:H(e.palette.background.default,e.palette.action.disabledOpacity),s=(e.vars||e).palette.action.hoverOpacity,u=(e.vars||e).palette.action.hover,c=(e.vars||e).palette.action.selectedOpacity,d=e.vars?`calc(${s} + ${c})`:s+c,p=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${c})`:H(e.palette.primary.main,c),g=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${d})`:H(e.palette.primary.main,d),h=e.vars?blendCssVars:blend,getPinnedBackgroundStyles=e=>({[`& .${Mt["cell--pinnedLeft"]}, & .${Mt["cell--pinnedRight"]}`]:{backgroundColor:e,"&.Mui-selected":{backgroundColor:h(e,p,c),"&:hover":{backgroundColor:h(e,p,d)}}}}),m=getPinnedBackgroundStyles(h(i,u,s)),C=h(i,p,c),b=getPinnedBackgroundStyles(C),w=getPinnedBackgroundStyles(h(i,g,d)),v={backgroundColor:p,"&:hover":{backgroundColor:g,"@media (hover: none)":{backgroundColor:p}}};return et({"--unstable_DataGrid-radius":"number"==typeof o?`${o}px`:o,"--unstable_DataGrid-headWeight":e.typography.fontWeightMedium,"--unstable_DataGrid-overlayBackground":a,"--DataGrid-containerBackground":l,"--DataGrid-pinnedBackground":i,"--DataGrid-rowBorderColor":n,"--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:n,borderRadius:"var(--unstable_DataGrid-radius)",color:(e.vars||e).palette.text.primary},e.typography.body2,{outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflow:"hidden",overflowAnchor:"none",transform:"translate(0, 0)",[`.${Mt.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)"},[`&.${Mt.autoHeight}`]:{height:"auto"},[`&.${Mt.autosizing}`]:{[`& .${Mt.columnHeaderTitleContainerContent} > *`]:{overflow:"visible !important"},"@media (hover: hover)":{[`& .${Mt.menuIcon}`]:{width:"0 !important",visibility:"hidden !important"}},[`& .${Mt.cell}`]:{overflow:"visible !important",whiteSpace:"nowrap",minWidth:"max-content !important",maxWidth:"max-content !important"},[`& .${Mt.groupingCriteriaCell}`]:{width:"unset"},[`& .${Mt.treeDataGroupingCell}`]:{width:"unset"}},[`& .${Mt.columnHeader}, & .${Mt.cell}`]:{WebkitTapHighlightColor:"transparent",padding:"0 10px",boxSizing:"border-box"},[`& .${Mt.columnHeader}:focus-within, & .${Mt.cell}:focus-within`]:{outline:`solid ${e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.5)`:H(e.palette.primary.main,.5)} 1px`,outlineOffset:-1},[`& .${Mt.columnHeader}:focus, & .${Mt.cell}:focus`]:{outline:`solid ${e.palette.primary.main} 1px`,outlineOffset:-1},[`& .${Mt.columnHeader}:focus,\n & .${Mt["columnHeader--withLeftBorder"]},\n & .${Mt["columnHeader--withRightBorder"]},\n & .${Mt["columnHeader--siblingFocused"]},\n & .${Mt["virtualScroller--hasScrollX"]} .${Mt["columnHeader--lastUnpinned"]},\n & .${Mt["virtualScroller--hasScrollX"]} .${Mt["columnHeader--last"]}\n `]:{[`& .${Mt.columnSeparator}`]:{opacity:0},"@media (hover: none)":{[`& .${Mt["columnSeparator--resizable"]}`]:{opacity:1}},[`& .${Mt["columnSeparator--resizable"]}:hover`]:{opacity:1}},[`&.${Mt["root--noToolbar"]} [aria-rowindex="1"] [aria-colindex="1"]`]:{borderTopLeftRadius:"calc(var(--unstable_DataGrid-radius) - 1px)"},[`&.${Mt["root--noToolbar"]} [aria-rowindex="1"] .${Mt["columnHeader--last"]}`]:{borderTopRightRadius:r?"calc(var(--unstable_DataGrid-radius) - 1px)":void 0},[`& .${Mt.columnHeaderCheckbox}, & .${Mt.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${Mt.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center"},[`& .${Mt["virtualScroller--hasScrollX"]} .${Mt["columnHeader--last"]}`]:{overflow:"hidden"},[`& .${Mt["columnHeader--sorted"]} .${Mt.iconButtonContainer}, & .${Mt["columnHeader--filtered"]} .${Mt.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${Mt.columnHeader}:not(.${Mt["columnHeader--sorted"]}) .${Mt.sortButton}`]:{opacity:0,transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter})},[`& .${Mt.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",gap:e.spacing(.25),minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden"},[`& .${Mt.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${Mt["columnHeader--filledGroup"]} .${Mt.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${Mt.sortIcon}, & .${Mt.filterIcon}`]:{fontSize:"inherit"},[`& .${Mt["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${Mt["columnHeader--alignCenter"]} .${Mt.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${Mt["columnHeader--alignRight"]} .${Mt.columnHeaderDraggableContainer}, & .${Mt["columnHeader--alignRight"]} .${Mt.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${Mt["columnHeader--alignCenter"]} .${Mt.menuIcon}`]:{marginLeft:"auto"},[`& .${Mt["columnHeader--alignRight"]} .${Mt.menuIcon}`]:{marginRight:"auto",marginLeft:-5},[`& .${Mt["columnHeader--moving"]}`]:{backgroundColor:(e.vars||e).palette.action.hover},[`& .${Mt["columnHeader--pinnedLeft"]}, & .${Mt["columnHeader--pinnedRight"]}`]:{position:"sticky",zIndex:40,background:"var(--DataGrid-pinnedBackground)"},[`& .${Mt.columnSeparator}`]:{position:"absolute",overflow:"hidden",zIndex:30,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",maxWidth:10,color:n},[`& .${Mt.columnHeaders}`]:{width:"var(--DataGrid-rowWidth)"},"@media (hover: hover)":{[`& .${Mt.columnHeader}:hover`]:{[`& .${Mt.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${Mt.iconButtonContainer}`]:{visibility:"visible",width:"auto"}},[`& .${Mt.columnHeader}:not(.${Mt["columnHeader--sorted"]}):hover .${Mt.sortButton}`]:{opacity:.5}},"@media (hover: none)":{[`& .${Mt.columnHeader} .${Mt.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${Mt.columnHeader}:focus,\n & .${Mt["columnHeader--siblingFocused"]}`]:{[`.${Mt["columnSeparator--resizable"]}`]:{color:(e.vars||e).palette.primary.main}}},[`& .${Mt["columnSeparator--sideLeft"]}`]:{left:-5},[`& .${Mt["columnSeparator--sideRight"]}`]:{right:-5},[`& .${Mt["columnHeader--withRightBorder"]} .${Mt["columnSeparator--sideLeft"]}`]:{left:-5.5},[`& .${Mt["columnHeader--withRightBorder"]} .${Mt["columnSeparator--sideRight"]}`]:{right:-5.5},[`& .${Mt["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none",[`&.${Mt["columnSeparator--resizing"]}`]:{color:(e.vars||e).palette.primary.main},"@media (hover: none)":{[`& .${Mt.iconSeparator} rect`]:bl},"@media (hover: hover)":{"&:hover":{color:(e.vars||e).palette.primary.main,[`& .${Mt.iconSeparator} rect`]:bl}},"& svg":{pointerEvents:"none"}},[`& .${Mt.iconSeparator}`]:{color:"inherit",transition:e.transitions.create(["color","width"],{duration:e.transitions.duration.shortest})},[`& .${Mt.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-5,display:"flex",alignItems:"center"},[`.${Mt.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${Mt.headerFilterRow}`]:{[`& .${Mt.columnHeader}`]:{boxSizing:"border-box",borderBottom:"1px solid var(--DataGrid-rowBorderColor)"}},[`& .${Mt["row--borderBottom"]} .${Mt.columnHeader},\n & .${Mt["row--borderBottom"]} .${Mt.filler},\n & .${Mt["row--borderBottom"]} .${Mt.scrollbarFiller}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${Mt["row--borderBottom"]} .${Mt.cell}`]:{borderBottom:"1px solid var(--rowBorderColor)"},[`.${Mt.row}`]:{display:"flex",width:"var(--DataGrid-rowWidth)",breakInside:"avoid","--rowBorderColor":"var(--DataGrid-rowBorderColor)",[`&.${Mt["row--firstVisible"]}`]:{"--rowBorderColor":"transparent"},"&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Mt.rowSkeleton}:hover`]:{backgroundColor:"transparent"},"&.Mui-selected":v},[`& .${Mt["container--top"]}, & .${Mt["container--bottom"]}`]:{"[role=row]":{background:"var(--DataGrid-containerBackground)"}},[`& .${Mt.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":v},[`& .${Mt["virtualScrollerContent--overflowed"]} .${Mt["row--lastVisible"]} .${Mt.cell}`]:{borderTopColor:"transparent"},[`& .${Mt["pinnedRows--top"]} :first-of-type`]:{[`& .${Mt.cell}, .${Mt.scrollbarFiller}`]:{borderTop:"none"}},[`&.${Mt["root--disableUserSelection"]}`]:{userSelect:"none"},[`& .${Mt["row--dynamicHeight"]} > .${Mt.cell}`]:{whiteSpace:"initial",lineHeight:"inherit"},[`& .${Mt.cellEmpty}`]:{flex:1,padding:0,height:"unset"},[`& .${Mt.cell}.${Mt["cell--selectionMode"]}`]:{cursor:"default"},[`& .${Mt.cell}.${Mt["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:e.shadows[2],backgroundColor:(e.vars||e).palette.background.paper,"&:focus-within":{outline:`1px solid ${(e.vars||e).palette.primary.main}`,outlineOffset:-1}},[`& .${Mt["row--editing"]}`]:{boxShadow:e.shadows[2]},[`& .${Mt["row--editing"]} .${Mt.cell}`]:{boxShadow:e.shadows[0],backgroundColor:(e.vars||e).palette.background.paper},[`& .${Mt.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${Mt.booleanCell}[data-value="true"]`]:{color:(e.vars||e).palette.text.secondary},[`& .${Mt.booleanCell}[data-value="false"]`]:{color:(e.vars||e).palette.text.disabled},[`& .${Mt.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:e.spacing(1)},[`& .${Mt.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${Mt["rowReorderCell--draggable"]}`]:{cursor:"move",opacity:1},[`& .${Mt.rowReorderCellContainer}`]:{padding:0,display:"flex",alignItems:"stretch"},[`.${Mt.withBorderColor}`]:{borderColor:n},[`& .${Mt["cell--withLeftBorder"]}, & .${Mt["columnHeader--withLeftBorder"]}`]:{borderLeftColor:"var(--DataGrid-rowBorderColor)",borderLeftWidth:"1px",borderLeftStyle:"solid"},[`& .${Mt["cell--withRightBorder"]}, & .${Mt["columnHeader--withRightBorder"]}`]:{borderRightColor:"var(--DataGrid-rowBorderColor)",borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${Mt["cell--flex"]}`]:{display:"flex",alignItems:"center",lineHeight:"inherit"},[`& .${Mt["cell--textLeft"]}`]:{textAlign:"left",justifyContent:"flex-start"},[`& .${Mt["cell--textRight"]}`]:{textAlign:"right",justifyContent:"flex-end"},[`& .${Mt["cell--textCenter"]}`]:{textAlign:"center",justifyContent:"center"},[`& .${Mt["cell--pinnedLeft"]}, & .${Mt["cell--pinnedRight"]}`]:{position:"sticky",zIndex:30,background:"var(--DataGrid-pinnedBackground)","&.Mui-selected":{backgroundColor:C}},[`& .${Mt.virtualScrollerContent} .${Mt.row}`]:{"&:hover":m,"&.Mui-selected":b,"&.Mui-selected:hover":w},[`& .${Mt.cellOffsetLeft}`]:{flex:"0 0 auto",display:"inline-block"},[`& .${Mt.cellSkeleton}`]:{flex:"0 0 auto",height:"100%",display:"inline-flex",alignItems:"center"},[`& .${Mt.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${Mt.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${Mt["columnHeader--dragging"]}, & .${Mt["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${Mt["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity,[`& .${Mt.rowReorderCellPlaceholder}`]:{display:"flex"}},[`& .${Mt.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${Mt.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`& .${Mt.treeDataGroupingCellLoadingContainer}, .${Mt.groupingCriteriaCellLoadingContainer}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},[`& .${Mt.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${Mt.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`.${Mt.scrollbarFiller}`]:{minWidth:"calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",alignSelf:"stretch",[`&.${Mt["scrollbarFiller--borderTop"]}`]:{borderTop:"1px solid var(--DataGrid-rowBorderColor)"},[`&.${Mt["scrollbarFiller--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`&.${Mt["scrollbarFiller--pinnedRight"]}`]:{backgroundColor:"var(--DataGrid-pinnedBackground)",position:"sticky",right:0}},[`& .${Mt.filler}`]:{flex:"1 0 auto"},[`& .${Mt["filler--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${Mt["main--hasSkeletonLoadingOverlay"]}`]:{[`& .${Mt.virtualScrollerContent}`]:{position:"fixed",visibility:"hidden"},[`& .${Mt["scrollbar--vertical"]}, & .${Mt.pinnedRows}, & .${Mt.virtualScroller} > .${Mt.filler}`]:{display:"none"}}})});function blend(e,t,r,n=1){const f=(e,t)=>Math.round((e**(1/n)*(1-r)+t**(1/n)*r)**n),o=L(e),l=L(t),i=[f(o.values[0],l.values[0]),f(o.values[1],l.values[1]),f(o.values[2],l.values[2])];return A({type:"rgb",values:i})}const removeOpacity=e=>`rgb(from ${e} r g b / 1)`;function blendCssVars(e,t,r){return`color-mix(in srgb,${e}, ${removeOpacity(t)} calc(${r} * 100%))`}const emptySubscribe=()=>()=>{},clientSnapshot=()=>!1,serverSnapshot=()=>!0;function GridPreferencesPanel(){const e=useGridApiContext$1(),t=useGridSelector(e,pr),r=useGridRootProps$1(),n=useGridSelector(e,gridPreferencePanelStateSelector),o=e.current.unstable_applyPipeProcessors("preferencePanel",null,n.openedPanelValue??rl.filters);return i.jsx(r.slots.panel,et({as:r.slots.basePopper,open:t.length>0&&n.open,id:n.panelId,"aria-labelledby":n.labelId},r.slotProps?.panel,r.slotProps?.basePopper,{children:o}))}function GridHeader(){const e=useGridRootProps$1();return i.jsxs(r.Fragment,{children:[i.jsx(GridPreferencesPanel,{}),e.slots.toolbar&&i.jsx(e.slots.toolbar,et({},e.slotProps?.toolbar))]})}const vl=["className","children"],xl=I(forwardRef(function GridRoot2(e,t){const n=useGridRootProps$1(),{className:o,children:l}=e,a=tt(e,vl),u=useGridPrivateApiContext$1(),c=useGridSelector(u,gridDensitySelector),d=u.current.rootElementRef,p=r.useCallback(e=>{null!==e&&u.current.publishEvent("rootMount",e)},[u]),g=R(d,t,p),m=n,C=((e,t)=>{const{autoHeight:r,classes:n,showCellVerticalBorder:o}=e,l={root:["root",r&&"autoHeight",`root--density${F(t)}`,null===e.slots.toolbar&&"root--noToolbar","withBorderColor",o&&"withVerticalBorder"]};return s(l,getDataGridUtilityClass,n)})(m,c);return mt.useSyncExternalStore(emptySubscribe,clientSnapshot,serverSnapshot)?null:i.jsxs(wl,et({className:h(C.root,o),ownerState:m},a,{ref:g,children:[i.jsx(GridHeader,{}),i.jsx(GridVirtualScroller,{children:l}),i.jsx(GridFooterPlaceholder,{})]}))})),Rl=["className"],yl=P("div",{name:"MuiDataGrid",slot:"FooterContainer",overridesResolver:(e,t)=>t.footerContainer})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),Sl=forwardRef(function GridFooterContainer2(e,t){const{className:r}=e,n=tt(e,Rl),o=useGridRootProps$1(),l=(e=>{const{classes:t}=e;return s({root:["footerContainer","withBorderColor"]},getDataGridUtilityClass,t)})(o);return i.jsx(yl,et({className:h(l.root,r),ownerState:o},n,{ref:t}))}),Il=["className"],Ml=P("div",{name:"MuiDataGrid",slot:"Overlay",overridesResolver:(e,t)=>t.overlay})({width:"100%",height:"100%",display:"flex",alignSelf:"center",alignItems:"center",justifyContent:"center",backgroundColor:"var(--unstable_DataGrid-overlayBackground)"}),Pl=forwardRef(function GridOverlay2(e,t){const{className:r}=e,n=tt(e,Il),o=useGridRootProps$1(),l=(e=>{const{classes:t}=e;return s({root:["overlay"]},getDataGridUtilityClass,t)})(o);return i.jsx(Ml,et({className:h(l.root,r),ownerState:o},n,{ref:t}))}),kl=r.memo(e=>{const{colDef:t,open:n,columnMenuId:o,columnMenuButtonId:l,iconButtonRef:a}=e,u=useGridApiContext$1(),c=useGridRootProps$1(),d=(e=>{const{classes:t,open:r}=e;return s({root:["menuIcon",r&&"menuOpen"],button:["menuIconButton"]},getDataGridUtilityClass,t)})(et({},e,{classes:c.classes})),p=r.useCallback(e=>{e.preventDefault(),e.stopPropagation(),u.current.toggleColumnMenu(t.field)},[u,t.field]),g=t.headerName??t.field;return i.jsx("div",{className:d.root,children:i.jsx(c.slots.baseTooltip,et({title:u.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},c.slotProps?.baseTooltip,{children:i.jsx(c.slots.baseIconButton,et({ref:a,tabIndex:-1,className:d.button,"aria-label":u.current.getLocaleText("columnMenuAriaLabel")(g),size:"small",onClick:p,"aria-haspopup":"menu","aria-expanded":n,"aria-controls":n?o:void 0,id:l},c.slotProps?.baseIconButton,{children:i.jsx(c.slots.columnMenuIcon,{fontSize:"inherit"})}))}))})});function GridColumnHeaderMenu({columnMenuId:e,columnMenuButtonId:t,ContentComponent:r,contentComponentProps:n,field:o,open:l,target:a,onExited:s}){const u=useGridApiContext$1(),c=u.current.getColumn(o),d=M(e=>{e&&(e.stopPropagation(),a?.contains(e.target))||u.current.hideColumnMenu()});return a&&c?i.jsx(GridMenu,{placement:"bottom-"+("right"===c.align?"start":"end"),open:l,target:a,onClose:d,onExited:s,children:i.jsx(r,et({colDef:c,hideMenu:d,open:l,id:e,labelledby:t},n))}):null}function findParentElementFromClassName(e,t){return e.closest(`.${t}`)}function escapeOperandAttributeSelector(e){return e.replace(/["\\]/g,"\\$&")}function getGridRowElementSelector(e){return`.${Mt.row}[data-id="${escapeOperandAttributeSelector(String(e))}"]`}function isEventTargetInPortal(e){return 1===e.target.nodeType&&!e.currentTarget.contains(e.target)}function findGridElement(e,t){return e.rootElementRef.current.querySelector(`.${Mt[t]}`)}const findPinnedCells=({api:e,colIndex:t,position:r,filterFn:n})=>{if(null===t)return[];const o=[];return queryRows(e).forEach(e=>{e.getAttribute("data-id")&&e.querySelectorAll(`.${Mt["left"===r?"cell--pinnedLeft":"cell--pinnedRight"]}`).forEach(e=>{const t=parseCellColIndex(e);null!==t&&n(t)&&o.push(e)})}),o};const findPinnedHeaders=({api:e,colIndex:t,position:r,filterFn:n})=>{if(!e.columnHeadersContainerRef?.current)return[];if(null===t)return[];const o=[];return e.columnHeadersContainerRef.current.querySelectorAll(`.${Mt["left"===r?"columnHeader--pinnedLeft":"columnHeader--pinnedRight"]}`).forEach(e=>{const t=parseCellColIndex(e);null!==t&&n(t,e)&&o.push(e)}),o};function queryRows(e){return e.virtualScrollerRef.current.querySelectorAll(`:scope > div > div > .${Mt.row}`)}function parseCellColIndex(e){const t=e.getAttribute("aria-colindex");return t?Number(t)-1:null}const Dl=["className","aria-label"],El=P("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle",overridesResolver:(e,t)=>t.columnHeaderTitle})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)",lineHeight:"normal"}),Fl=forwardRef(function ColumnHeaderInnerTitle2(e,t){const{className:r}=e,n=tt(e,Dl),o=useGridRootProps$1(),l=(e=>{const{classes:t}=e;return s({root:["columnHeaderTitle"]},getDataGridUtilityClass,t)})(o);return i.jsx(El,et({className:h(l.root,r),ownerState:o},n,{ref:t}))});function GridColumnHeaderTitle(e){const{label:t,description:n}=e,o=useGridRootProps$1(),l=r.useRef(null),[a,s]=r.useState(""),u=r.useCallback(()=>{if(!n&&l?.current){const e=function isOverflown(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}(l.current);s(e?t:"")}},[n,t]);return i.jsx(o.slots.baseTooltip,et({title:n||a},o.slotProps?.baseTooltip,{children:i.jsx(Fl,{onMouseOver:u,ref:l,children:t})}))}const Gl=["resizable","resizing","height","side"];var Hl=function(e){return e.Left="left",e.Right="right",e}(Hl||{});function GridColumnHeaderSeparatorRaw(e){const{height:t,side:n=Hl.Right}=e,o=tt(e,Gl),l=useGridRootProps$1(),a=(e=>{const{resizable:t,resizing:r,classes:n,side:o}=e,l={root:["columnSeparator",t&&"columnSeparator--resizable",r&&"columnSeparator--resizing",o&&`columnSeparator--side${F(o)}`],icon:["iconSeparator"]};return s(l,getDataGridUtilityClass,n)})(et({},e,{side:n,classes:l.classes})),u=r.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]);return i.jsx("div",et({className:a.root,style:{minHeight:t}},o,{onClick:u,children:i.jsx(l.slots.columnResizeIcon,{className:a.icon})}))}const Tl=r.memo(GridColumnHeaderSeparatorRaw),Ol=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps","style"],Ll=forwardRef(function GridGenericColumnHeaderItem2(e,t){const{classes:n,colIndex:o,height:l,isResizing:a,sortDirection:s,tabIndex:u,separatorSide:c,isDraggable:d,headerComponent:p,description:g,width:m,columnMenuIconButton:C=null,columnMenu:b=null,columnTitleIconButtons:w=null,headerClassName:v,label:x,resizable:y,draggableContainerProps:S,columnHeaderSeparatorProps:I,style:M}=e,P=tt(e,Ol),k=useGridRootProps$1(),D=r.useRef(null),E=R(D,t);let F="none";return null!=s&&(F="asc"===s?"ascending":"descending"),i.jsxs("div",et({className:h(n.root,v),style:et({},M,{height:l,width:m}),role:"columnheader",tabIndex:u,"aria-colindex":o+1,"aria-sort":F},P,{ref:E,children:[i.jsxs("div",et({className:n.draggableContainer,draggable:d,role:"presentation"},S,{children:[i.jsxs("div",{className:n.titleContainer,role:"presentation",children:[i.jsx("div",{className:n.titleContainerContent,children:void 0!==p?p:i.jsx(GridColumnHeaderTitle,{label:x,description:g,columnWidth:m})}),w]}),C]})),i.jsx(Tl,et({resizable:!k.disableColumnResize&&!!y,resizing:a,height:l,side:c},I)),b]}))});const Al=I(function GridColumnHeaderItem(e){const{colDef:t,columnMenuOpen:n,colIndex:o,headerHeight:l,isResizing:a,isLast:u,sortDirection:c,sortIndex:d,filterItemsCounter:g,hasFocus:m,tabIndex:C,disableReorder:b,separatorSide:w,showLeftBorder:x,showRightBorder:R,pinnedPosition:y,pinnedOffset:S}=e,I=useGridPrivateApiContext$1(),M=useGridRootProps$1(),P=v(),k=r.useRef(null),D=p(),E=p(),F=r.useRef(null),[G,H]=r.useState(n),T=r.useMemo(()=>!M.disableColumnReorder&&!b&&!t.disableReorder,[M.disableColumnReorder,b,t.disableReorder]);let O;t.renderHeader&&(O=t.renderHeader(I.current.getColumnHeaderParams(t.field)));const L=(e=>{const{colDef:t,classes:r,isDragging:n,sortDirection:o,showRightBorder:l,showLeftBorder:i,filterItemsCounter:a,pinnedPosition:u,isLastUnpinned:c,isSiblingFocused:d}=e,p=null!=o,g=null!=a&&a>0,h="number"===t.type,m={root:["columnHeader","left"===t.headerAlign&&"columnHeader--alignLeft","center"===t.headerAlign&&"columnHeader--alignCenter","right"===t.headerAlign&&"columnHeader--alignRight",t.sortable&&"columnHeader--sortable",n&&"columnHeader--moving",p&&"columnHeader--sorted",g&&"columnHeader--filtered",h&&"columnHeader--numeric","withBorderColor",l&&"columnHeader--withRightBorder",i&&"columnHeader--withLeftBorder",u===Ar.LEFT&&"columnHeader--pinnedLeft",u===Ar.RIGHT&&"columnHeader--pinnedRight",c&&"columnHeader--lastUnpinned",d&&"columnHeader--siblingFocused"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return s(m,getDataGridUtilityClass,r)})(et({},e,{classes:M.classes,showRightBorder:R,showLeftBorder:x})),A=r.useCallback(e=>r=>{isEventTargetInPortal(r)||I.current.publishEvent(e,I.current.getColumnHeaderParams(t.field),r)},[I,t.field]),j=r.useMemo(()=>({onClick:A("columnHeaderClick"),onContextMenu:A("columnHeaderContextMenu"),onDoubleClick:A("columnHeaderDoubleClick"),onMouseOver:A("columnHeaderOver"),onMouseOut:A("columnHeaderOut"),onMouseEnter:A("columnHeaderEnter"),onMouseLeave:A("columnHeaderLeave"),onKeyDown:A("columnHeaderKeyDown"),onFocus:A("columnHeaderFocus"),onBlur:A("columnHeaderBlur")}),[A]),$=r.useMemo(()=>T?{onDragStart:A("columnHeaderDragStart"),onDragEnter:A("columnHeaderDragEnter"),onDragOver:A("columnHeaderDragOver"),onDragEnd:A("columnHeaderDragEnd")}:{},[T,A]),z=r.useMemo(()=>({onMouseDown:A("columnSeparatorMouseDown"),onDoubleClick:A("columnSeparatorDoubleClick")}),[A]);r.useEffect(()=>{G||H(n)},[G,n]);const V=r.useCallback(()=>{H(!1)},[]),N=!M.disableColumnMenu&&!t.disableColumnMenu&&i.jsx(kl,{colDef:t,columnMenuId:D,columnMenuButtonId:E,open:G,iconButtonRef:F}),B=i.jsx(GridColumnHeaderMenu,{columnMenuId:D,columnMenuButtonId:E,field:t.field,open:n,target:F.current,ContentComponent:M.slots.columnMenu,contentComponentProps:M.slotProps?.columnMenu,onExited:V}),_=t.sortingOrder??M.sortingOrder,W=(t.sortable||null!=c)&&!t.hideSortIcons&&!M.disableColumnSorting,U=i.jsxs(r.Fragment,{children:[!M.disableColumnFilter&&i.jsx(M.slots.columnHeaderFilterIconButton,et({field:t.field,counter:g},M.slotProps?.columnHeaderFilterIconButton)),W&&i.jsx(M.slots.columnHeaderSortIcon,et({field:t.field,direction:c,index:d,sortingOrder:_,disabled:!t.sortable},M.slotProps?.columnHeaderSortIcon))]});r.useLayoutEffect(()=>{const e=I.current.state.columnMenu;if(m&&!e.open){const e=k.current.querySelector('[tabindex="0"]')||k.current;if(!e)return;if(doesSupportPreventScroll())e.focus({preventScroll:!0});else{const t=I.current.getScrollPosition();e.focus(),I.current.scroll(t)}}},[I,m]);const q="function"==typeof t.headerClassName?t.headerClassName({field:t.field,colDef:t}):t.headerClassName,K=t.headerName??t.field,X=r.useMemo(()=>attachPinnedStyle(et({},e.style),P,y,S),[y,S,e.style,P]);return i.jsx(Ll,et({ref:k,classes:L,columnMenuOpen:n,colIndex:o,height:l,isResizing:a,sortDirection:c,hasFocus:m,tabIndex:C,separatorSide:w,isDraggable:T,headerComponent:O,description:t.description,elementId:t.field,width:t.computedWidth,columnMenuIconButton:N,columnTitleIconButtons:U,headerClassName:h(q,u&&Mt["columnHeader--last"]),label:K,resizable:!M.disableColumnResize&&!!t.resizable,"data-field":t.field,columnMenu:B,draggableContainerProps:$,columnHeaderSeparatorProps:z,style:X},j))}),jl=["className"],$l=P("div",{name:"MuiDataGrid",slot:"IconButtonContainer",overridesResolver:(e,t)=>t.iconButtonContainer})(()=>({display:"flex",visibility:"hidden",width:0})),zl=forwardRef(function GridIconButtonContainer2(e,t){const{className:r}=e,n=tt(e,jl),o=useGridRootProps$1(),l=(e=>{const{classes:t}=e;return s({root:["iconButtonContainer"]},getDataGridUtilityClass,t)})(o);return i.jsx($l,et({className:h(l.root,r),ownerState:o},n,{ref:t}))}),Vl=["direction","index","sortingOrder","disabled","className"];function GridColumnHeaderSortIconRaw(e){const{direction:t,index:r,sortingOrder:n,disabled:o,className:l}=e,a=tt(e,Vl),u=useGridApiContext$1(),c=useGridRootProps$1(),d=(e=>{const{classes:t}=e;return s({root:["sortButton"],icon:["sortIcon"]},getDataGridUtilityClass,t)})(et({},e,{classes:c.classes})),p=function getIcon(e,t,r,n){let o;const l={};return"asc"===t?o=e.columnSortedAscendingIcon:"desc"===t?o=e.columnSortedDescendingIcon:(o=e.columnUnsortedIcon,l.sortingOrder=n),o?i.jsx(o,et({fontSize:"small",className:r},l)):null}(c.slots,t,d.icon,n);if(!p)return null;const g=i.jsx(c.slots.baseIconButton,et({tabIndex:-1,"aria-label":u.current.getLocaleText("columnHeaderSortIconLabel"),title:u.current.getLocaleText("columnHeaderSortIconLabel"),size:"small",disabled:o,className:h(d.root,l)},c.slotProps?.baseIconButton,a,{children:p}));return i.jsxs(zl,{children:[null!=r&&i.jsx(c.slots.baseBadge,{badgeContent:r,color:"default",overlap:"circular",children:g}),null==r&&g]})}const Nl=r.memo(GridColumnHeaderSortIconRaw);function GridColumnHeaderFilterIconButton(e){const{counter:t,field:n,onClick:o}=e,l=useGridApiContext$1(),a=useGridRootProps$1(),u=(e=>{const{classes:t}=e;return s({icon:["filterIcon"]},getDataGridUtilityClass,t)})(et({},e,{classes:a.classes})),c=p(),d=useGridSelectorV8(l,tl,c),g=p(),h=r.useCallback(e=>{e.preventDefault(),e.stopPropagation();const{open:t,openedPanelValue:r}=gridPreferencePanelStateSelector(l.current.state);t&&r===rl.filters?l.current.hideFilterPanel():l.current.showFilterPanel(void 0,g,c),o&&o(l.current.getColumnHeaderParams(n),e)},[l,n,o,g,c]);if(!t)return null;const m=i.jsx(a.slots.baseIconButton,et({id:c,onClick:h,color:"default","aria-label":l.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":d,"aria-controls":d?g:void 0},a.slotProps?.baseIconButton,{children:i.jsx(a.slots.columnFilteredIcon,{className:u.icon,fontSize:"small"})}));return i.jsx(a.slots.baseTooltip,et({title:l.current.getLocaleText("columnHeaderFiltersTooltipActive")(t),enterDelay:1e3},a.slotProps?.baseTooltip,{children:i.jsxs(zl,{children:[t>1&&i.jsx(a.slots.baseBadge,{badgeContent:t,color:"default",children:m}),1===t&&m]})}))}const Bl=j(i.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward"),_l=j(i.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward"),Wl=j(i.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight"),Ul=j(i.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),ql=j(i.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),Kl=j(i.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"}),"FilterAlt"),Xl=j(i.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"}),"Search");j(i.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu"),j(i.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"}),"CheckCircle");const Yl=j(i.jsx("path",{d:"M6 5H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm14 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm-7 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1z"}),"ColumnIcon"),Ql=j(i.jsx("rect",{width:"1",height:"24",x:"11.5",rx:"0.5"}),"Separator"),Jl=j(i.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"}),"ViewHeadline"),Zl=j(i.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"}),"TableRows"),ei=j(i.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"}),"ViewStream"),ti=j(i.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"}),"TripleDotsVertical"),ri=j(i.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"}),"Close"),ni=j(i.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),oi=j(i.jsx("path",{d:"M19 13H5v-2h14v2z"}),"Remove"),li=j(i.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"}),"Load"),ii=j(i.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"}),"Drag"),ai=j(i.jsx("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}),"SaveAlt"),si=j(i.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),ui=j(i.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"}),"MoreVert"),ci=j(i.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"}),"VisibilityOff"),di=j(i.jsx("g",{children:i.jsx("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})}),"ViewColumn"),pi=j(i.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"}),"Clear");j(i.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"}),"Delete");const gi=j(i.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"}),"Delete");function isPrintableKey(e){return 1===e.key.length&&!e.ctrlKey&&!e.metaKey}const isNavigationKey=e=>0===e.indexOf("Arrow")||0===e.indexOf("Page")||" "===e||"Home"===e||"End"===e,isHideMenuKey=e=>"Tab"===e||"Escape"===e;function isPasteShortcut(e){return(e.ctrlKey||e.metaKey)&&"V"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey}const fi=["hideMenu","colDef","id","labelledby","className","children","open"],hi=u(x)(()=>({minWidth:248})),mi=forwardRef(function GridColumnMenuContainer2(e,t){const{hideMenu:n,id:o,labelledby:l,className:a,children:s,open:u}=e,c=tt(e,fi),d=r.useCallback(e=>{"Tab"===e.key&&e.preventDefault(),isHideMenuKey(e.key)&&n(e)},[n]);return i.jsx(hi,et({id:o,className:h(Mt.menuList,a),"aria-labelledby":l,onKeyDown:d,autoFocus:u},c,{ref:t,children:s}))}),Ci=["displayOrder"];function GridColumnMenuHideItem(e){const{colDef:t,onClick:n}=e,o=useGridApiContext$1(),l=useGridRootProps$1(),a=1===fr(o).filter(e=>!0!==e.disableColumnMenu).length,s=r.useCallback(e=>{a||(o.current.setColumnVisibility(t.field,!1),n(e))},[o,t.field,n,a]);return l.disableColumnSelector||!1===t.hideable?null:i.jsxs($,{onClick:s,disabled:a,children:[i.jsx(z,{children:i.jsx(l.slots.columnMenuHideIcon,{fontSize:"small"})}),i.jsx(V,{children:o.current.getLocaleText("columnMenuHideColumn")})]})}function GridColumnMenuManageItem(e){const{onClick:t}=e,n=useGridApiContext$1(),o=useGridRootProps$1(),l=r.useCallback(e=>{t(e),n.current.showPreferences(rl.columns)},[n,t]);return o.disableColumnSelector?null:i.jsxs($,{onClick:l,children:[i.jsx(z,{children:i.jsx(o.slots.columnMenuManageColumnsIcon,{fontSize:"small"})}),i.jsx(V,{children:n.current.getLocaleText("columnMenuManageColumns")})]})}const bi=["defaultSlots","defaultSlotProps","slots","slotProps"],wi={columnMenuSortItem:function GridColumnMenuSortItem(e){const{colDef:t,onClick:n}=e,o=useGridApiContext$1(),l=useGridSelector(o,Ur),a=useGridRootProps$1(),s=r.useMemo(()=>{if(!t)return null;const e=l.find(e=>e.field===t.field);return e?.sort},[t,l]),u=t.sortingOrder??a.sortingOrder,c=r.useCallback(e=>{n(e);const r=e.currentTarget.getAttribute("data-value")||null;o.current.sortColumn(t.field,r===s?null:r)},[o,t,n,s]);if(a.disableColumnSorting||!t||!t.sortable||!u.some(e=>!!e))return null;const getLabel=e=>{const r=o.current.getLocaleText(e);return"function"==typeof r?r(t):r};return i.jsxs(r.Fragment,{children:[u.includes("asc")&&"asc"!==s?i.jsxs($,{onClick:c,"data-value":"asc",children:[i.jsx(z,{children:i.jsx(a.slots.columnMenuSortAscendingIcon,{fontSize:"small"})}),i.jsx(V,{children:getLabel("columnMenuSortAsc")})]}):null,u.includes("desc")&&"desc"!==s?i.jsxs($,{onClick:c,"data-value":"desc",children:[i.jsx(z,{children:i.jsx(a.slots.columnMenuSortDescendingIcon,{fontSize:"small"})}),i.jsx(V,{children:getLabel("columnMenuSortDesc")})]}):null,u.includes(null)&&null!=s?i.jsxs($,{onClick:c,children:[i.jsx(z,{}),i.jsx(V,{children:o.current.getLocaleText("columnMenuUnsort")})]}):null]})},columnMenuFilterItem:function GridColumnMenuFilterItem(e){const{colDef:t,onClick:n}=e,o=useGridApiContext$1(),l=useGridRootProps$1(),a=r.useCallback(e=>{n(e),o.current.showFilterPanel(t.field)},[o,t.field,n]);return l.disableColumnFilter||!t.filterable?null:i.jsxs($,{onClick:a,children:[i.jsx(z,{children:i.jsx(l.slots.columnMenuFilterIcon,{fontSize:"small"})}),i.jsx(V,{children:o.current.getLocaleText("columnMenuFilter")})]})},columnMenuColumnsItem:function GridColumnMenuColumnsItem(e){return i.jsxs(r.Fragment,{children:[i.jsx(GridColumnMenuHideItem,et({},e)),i.jsx(GridColumnMenuManageItem,et({},e))]})}},vi={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},xi=forwardRef(function GridGenericColumnMenu2(e,t){const{defaultSlots:n,defaultSlotProps:o,slots:l,slotProps:a}=e,s=tt(e,bi),u=(e=>{const t=useGridPrivateApiContext$1(),n=useGridRootProps$1(),{defaultSlots:o,defaultSlotProps:l,slots:i={},slotProps:a={},hideMenu:s,colDef:u,addDividers:c=!0}=e,d=r.useMemo(()=>et({},o,i),[o,i]),p=r.useMemo(()=>{if(!a||0===Object.keys(a).length)return l;const e=et({},a);return Object.entries(l).forEach(([t,r])=>{e[t]=et({},r,a[t]||{})}),e},[l,a]),g=t.current.unstable_applyPipeProcessors("columnMenu",[],e.colDef),h=r.useMemo(()=>{const e=Object.keys(o);return Object.keys(i).filter(t=>!e.includes(t))},[i,o]);return r.useMemo(()=>{const e=Array.from(new Set([...g,...h])).filter(e=>null!=d[e]).sort((e,t)=>{const r=p[e],n=p[t];return(Number.isFinite(r?.displayOrder)?r.displayOrder:100)-(Number.isFinite(n?.displayOrder)?n.displayOrder:100)});return e.reduce((t,r,o)=>{let l={colDef:u,onClick:s};const i=p[r];if(i){const e=tt(i,Ci);l=et({},l,e)}return c&&o!==e.length-1?[...t,[d[r],l],[n.slots.baseDivider,{}]]:[...t,[d[r],l]]},[])},[c,u,g,s,d,p,h,n.slots.baseDivider])})(et({},s,{defaultSlots:n,defaultSlotProps:o,slots:l,slotProps:a}));return i.jsx(mi,et({},s,{ref:t,children:u.map(([e,t],r)=>i.jsx(e,et({},t),r))}))}),Ri=forwardRef(function GridColumnMenu2(e,t){return i.jsx(xi,et({},e,{ref:t,defaultSlots:wi,defaultSlotProps:vi}))}),yi=["className","slotProps"],Si=u("div",{name:"MuiDataGrid",slot:"PanelWrapper",overridesResolver:(e,t)=>t.panelWrapper})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),isEnabled=()=>!0,Ii=forwardRef(function GridPanelWrapper2(e,t){const{className:r,slotProps:n={}}=e,o=tt(e,yi),l=useGridRootProps$1(),a=(e=>{const{classes:t}=e;return s({root:["panelWrapper"]},getDataGridUtilityClass,t)})(l);return i.jsx(N,et({open:!0,disableEnforceFocus:!0,isEnabled},n.TrapFocus,{children:i.jsx(Si,et({tabIndex:-1,className:h(a.root,r),ownerState:l},o,{ref:t}))}))});const Mi=["children","className","classes"],Pi=l("MuiDataGrid",["panel","paper"]),ki=u(w,{name:"MuiDataGrid",slot:"Panel",overridesResolver:(e,t)=>t.panel})(({theme:e})=>({zIndex:e.zIndex.modal})),Di=u(b,{name:"MuiDataGrid",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,minWidth:300,maxHeight:450,display:"flex",maxWidth:`calc(100vw - ${e.spacing(.5)})`,overflow:"auto"})),Ei=forwardRef((e,t)=>{const{children:n,className:o}=e,l=tt(e,Mi),a=useGridApiContext$1(),s=useGridRootProps$1(),u=Pi,[c,d]=r.useState(!1),p=r.useCallback(()=>{a.current.hidePreferences()},[a]),g=r.useCallback(e=>{"Escape"===e.key&&a.current.hidePreferences()},[a]),C=r.useMemo(()=>[{name:"flip",enabled:!0,options:{rootBoundary:"document"}},{name:"isPlaced",enabled:!0,phase:"main",fn:()=>{d(!0)},effect:()=>()=>{d(!1)}}],[]),[b,w]=r.useState(null);return r.useEffect(()=>{const e=a.current.rootElementRef?.current?.querySelector('[data-id="gridPanelAnchor"]');e&&w(e)},[a]),b?i.jsx(ki,et({placement:"bottom-start",className:h(u.panel,o),ownerState:s,anchorEl:b,modifiers:C},l,{ref:t,children:i.jsx(m,{mouseEvent:"onPointerUp",touchEvent:!1,onClickAway:p,children:i.jsx(Di,{className:u.paper,ownerState:s,elevation:8,onKeyDown:g,children:c&&n})})})):null}),Fi=["className"],Gi=P("div",{name:"MuiDataGrid",slot:"PanelContent",overridesResolver:(e,t)=>t.panelContent})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400});function GridPanelContent(e){const{className:t}=e,r=tt(e,Fi),n=useGridRootProps$1(),o=(e=>{const{classes:t}=e;return s({root:["panelContent"]},getDataGridUtilityClass,t)})(n);return i.jsx(Gi,et({className:h(o.root,t),ownerState:n},r))}const Hi=["className"],Ti=P("div",{name:"MuiDataGrid",slot:"PanelFooter",overridesResolver:(e,t)=>t.panelFooter})(({theme:e})=>({padding:e.spacing(.5),display:"flex",justifyContent:"space-between"}));function GridPanelFooter(e){const{className:t}=e,r=tt(e,Hi),n=useGridRootProps$1(),o=(e=>{const{classes:t}=e;return s({root:["panelFooter"]},getDataGridUtilityClass,t)})(n);return i.jsx(Ti,et({className:h(o.root,t),ownerState:n},r))}const Oi=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","readOnly","children"],Li=["InputComponentProps"],Ai=u("div",{name:"MuiDataGrid",slot:"FilterForm",overridesResolver:(e,t)=>t.filterForm})(({theme:e})=>({display:"flex",padding:e.spacing(1)})),ji=u("div",{name:"MuiDataGrid",slot:"FilterFormDeleteIcon",overridesResolver:(e,t)=>t.filterFormDeleteIcon})(({theme:e})=>({flexShrink:0,justifyContent:"flex-end",marginRight:e.spacing(.5),marginBottom:e.spacing(.2)})),$i=u("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput",overridesResolver:(e,t)=>t.filterFormLogicOperatorInput})({minWidth:55,marginRight:5,justifyContent:"end"}),zi=u("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput",overridesResolver:(e,t)=>t.filterFormColumnInput})({width:150}),Vi=u("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput",overridesResolver:(e,t)=>t.filterFormOperatorInput})({width:150}),Ni=u("div",{name:"MuiDataGrid",slot:"FilterFormValueInput",overridesResolver:(e,t)=>t.filterFormValueInput})({width:190}),getColumnLabel=e=>e.headerName||e.field,Bi=new Intl.Collator,_i=forwardRef(function GridFilterForm2(e,t){const{item:n,hasMultipleFilters:o,deleteFilter:l,applyFilterChanges:a,showMultiFilterOperators:u,disableMultiFilterOperator:c,applyMultiFilterOperatorChanges:d,focusElementRef:g,logicOperators:m=[rr.And,rr.Or],columnsSort:C,filterColumns:b,deleteIconProps:w={},logicOperatorInputProps:v={},operatorInputProps:x={},columnInputProps:R={},valueInputProps:y={},readOnly:S}=e,I=tt(e,Oi),M=useGridApiContext$1(),P=useGridSelector(M,dr),k=useGridSelector(M,wr),D=useGridSelector(M,Xr),E=p(),G=p(),H=p(),T=p(),O=useGridRootProps$1(),L=(e=>{const{classes:t}=e;return s({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},getDataGridUtilityClass,t)})(O),A=r.useRef(null),j=r.useRef(null),$=D.logicOperator??rr.And,z=o&&m.length>0,V=O.slotProps?.baseFormControl||{},N=(O.slotProps?.baseSelect||{}).native??!1,B=O.slotProps?.baseInputLabel||{},_=O.slotProps?.baseSelectOption||{},{InputComponentProps:W}=y,U=tt(y,Li),{filteredColumns:q,selectedField:K}=r.useMemo(()=>{let e=n.field;const t=!1===P[n.field].filterable?P[n.field]:null;if(t)return{filteredColumns:[t],selectedField:e};if(void 0===b||"function"!=typeof b)return{filteredColumns:k,selectedField:e};const r=b({field:n.field,columns:k,currentFilters:D?.items||[]});return{filteredColumns:k.filter(t=>{const o=r.includes(t.field);return t.field!==n.field||o||(e=void 0),o}),selectedField:e}},[b,D?.items,k,n.field,P]),X=r.useMemo(()=>{switch(C){case"asc":return q.sort((e,t)=>Bi.compare(getColumnLabel(e),getColumnLabel(t)));case"desc":return q.sort((e,t)=>-Bi.compare(getColumnLabel(e),getColumnLabel(t)));default:return q}},[q,C]),Y=n.field?M.current.getColumn(n.field):null,Q=r.useMemo(()=>n.operator&&Y?Y.filterOperators?.find(e=>e.value===n.operator):null,[n,Y]),J=r.useCallback(e=>{const t=e.target.value,r=M.current.getColumn(t);if(r.field===Y.field)return;const o=r.filterOperators.find(e=>e.value===n.operator)||r.filterOperators[0];let l=!o.InputComponent||o.InputComponent!==Q?.InputComponent||r.type!==Y.type?void 0:n.value;if("singleSelect"===r.type&&void 0!==l){const e=r,t=getValueOptions(e);Array.isArray(l)?l=l.filter(r=>void 0!==getValueFromValueOptions(r,t,e?.getOptionValue)):void 0===getValueFromValueOptions(n.value,t,e?.getOptionValue)&&(l=void 0)}a(et({},n,{field:t,operator:o.value,value:l}))},[M,a,n,Y,Q]),Z=r.useCallback(e=>{const t=e.target.value,r=Y?.filterOperators.find(e=>e.value===t);a(et({},n,{operator:t,value:!r?.InputComponent||r?.InputComponent!==Q?.InputComponent?void 0:n.value}))},[a,n,Y,Q]),ee=r.useCallback(e=>{const t=e.target.value===rr.And.toString()?rr.And:rr.Or;d(t)},[d]);return r.useImperativeHandle(g,()=>({focus:()=>{Q?.InputComponent?A?.current?.focus():j.current.focus()}}),[Q]),i.jsxs(Ai,et({className:L.root,"data-id":n.id,ownerState:O},I,{ref:t,children:[i.jsx(ji,et({variant:"standard",as:O.slots.baseFormControl},V,w,{className:h(L.deleteIcon,V.className,w.className),ownerState:O,children:i.jsx(O.slots.baseIconButton,et({"aria-label":M.current.getLocaleText("filterPanelDeleteIconLabel"),title:M.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:()=>{l(n)},size:"small",disabled:S},O.slotProps?.baseIconButton,{children:i.jsx(O.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),i.jsx($i,et({variant:"standard",as:O.slots.baseFormControl},V,v,{sx:[z?{display:"flex"}:{display:"none"},u?{visibility:"visible"}:{visibility:"hidden"},V.sx,v.sx],className:h(L.logicOperatorInput,V.className,v.className),ownerState:O,children:i.jsx(O.slots.baseSelect,et({inputProps:{"aria-label":M.current.getLocaleText("filterPanelLogicOperator")},value:$??"",onChange:ee,disabled:!!c||1===m.length,native:N},O.slotProps?.baseSelect,{children:m.map(e=>r.createElement(O.slots.baseSelectOption,et({},_,{native:N,key:e.toString(),value:e.toString()}),M.current.getLocaleText((e=>{switch(e){case rr.And:return"filterPanelOperatorAnd";case rr.Or:return"filterPanelOperatorOr";default:throw new Error("MUI X: Invalid `logicOperator` property in the `GridFilterPanel`.")}})(e))))}))})),i.jsxs(zi,et({variant:"standard",as:O.slots.baseFormControl},V,R,{className:h(L.columnInput,V.className,R.className),ownerState:O,children:[i.jsx(O.slots.baseInputLabel,et({},B,{htmlFor:E,id:G,children:M.current.getLocaleText("filterPanelColumns")})),i.jsx(O.slots.baseSelect,et({labelId:G,id:E,label:M.current.getLocaleText("filterPanelColumns"),value:K??"",onChange:J,native:N,disabled:S},O.slotProps?.baseSelect,{children:X.map(e=>r.createElement(O.slots.baseSelectOption,et({},_,{native:N,key:e.field,value:e.field}),getColumnLabel(e)))}))]})),i.jsxs(Vi,et({variant:"standard",as:O.slots.baseFormControl},V,x,{className:h(L.operatorInput,V.className,x.className),ownerState:O,children:[i.jsx(O.slots.baseInputLabel,et({},B,{htmlFor:H,id:T,children:M.current.getLocaleText("filterPanelOperator")})),i.jsx(O.slots.baseSelect,et({labelId:T,label:M.current.getLocaleText("filterPanelOperator"),id:H,value:n.operator,onChange:Z,native:N,inputRef:j,disabled:S},O.slotProps?.baseSelect,{children:Y?.filterOperators?.map(e=>r.createElement(O.slots.baseSelectOption,et({},_,{native:N,key:e.value,value:e.value}),e.label||M.current.getLocaleText(`filterOperator${F(e.value)}`)))}))]})),i.jsx(Ni,et({variant:"standard",as:O.slots.baseFormControl},V,U,{className:h(L.valueInput,V.className,U.className),ownerState:O,children:Q?.InputComponent?i.jsx(Q.InputComponent,et({apiRef:M,item:n,applyValue:a,focusElementRef:A,disabled:S},Q.InputComponentProps,W),n.field):null}))]}))}),Wi=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],getGridFilter=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(1e5*Math.random())}),Ui=forwardRef(function GridFilterPanel2(e,t){const n=useGridApiContext$1(),o=useGridRootProps$1(),l=useGridSelector(n,Xr),a=useGridSelector(n,wr),s=useGridSelector(n,vr),u=r.useRef(null),c=r.useRef(null),{logicOperators:d=[rr.And,rr.Or],columnsSort:p,filterFormProps:g,getColumnForNewFilter:h,disableAddFilterButton:m=!1,disableRemoveAllButton:C=!1}=e,b=tt(e,Wi),w=n.current.upsertFilterItem,v=r.useCallback(e=>{n.current.setFilterLogicOperator(e)},[n]),x=r.useCallback(()=>{let e;if(h&&"function"==typeof h){const t=h({currentFilters:l?.items||[],columns:a});if(null===t)return null;e=a.find(({field:e})=>e===t)}else e=a.find(e=>e.filterOperators?.length);return e?getGridFilter(e):null},[l?.items,a,h]),R=r.useCallback(()=>{if(void 0===h||"function"!=typeof h)return x();const e=l.items.length?l.items:[x()].filter(Boolean),t=h({currentFilters:e,columns:a});if(null===t)return null;const r=a.find(({field:e})=>e===t);return r?getGridFilter(r):null},[l.items,a,h,x]),y=r.useMemo(()=>l.items.length?l.items:(c.current||(c.current=x()),c.current?[c.current]:[]),[l.items,x]),S=y.length>1,{readOnlyFilters:I,validFilters:M}=r.useMemo(()=>y.reduce((e,t)=>(s[t.field]?e.validFilters.push(t):e.readOnlyFilters.push(t),e),{readOnlyFilters:[],validFilters:[]}),[y,s]),P=r.useCallback(()=>{const e=R();e&&n.current.upsertFilterItems([...y,e])},[n,R,y]),k=r.useCallback(e=>{const t=1===M.length;n.current.deleteFilterItem(e),t&&n.current.hideFilterPanel()},[n,M.length]),D=r.useCallback(()=>1===M.length&&void 0===M[0].value?(n.current.deleteFilterItem(M[0]),n.current.hideFilterPanel()):n.current.setFilterModel(et({},l,{items:I}),"removeAllFilterItems"),[n,I,l,M]);return r.useEffect(()=>{d.length>0&&l.logicOperator&&!d.includes(l.logicOperator)&&v(d[0])},[d,v,l.logicOperator]),r.useEffect(()=>{M.length>0&&u.current.focus()},[M.length]),i.jsxs(Ii,et({},b,{ref:t,children:[i.jsxs(GridPanelContent,{children:[I.map((e,t)=>i.jsx(_i,et({item:e,applyFilterChanges:w,deleteFilter:k,hasMultipleFilters:S,showMultiFilterOperators:t>0,disableMultiFilterOperator:1!==t,applyMultiFilterOperatorChanges:v,focusElementRef:null,readOnly:!0,logicOperators:d,columnsSort:p},g),null==e.id?t:e.id)),M.map((e,t)=>i.jsx(_i,et({item:e,applyFilterChanges:w,deleteFilter:k,hasMultipleFilters:S,showMultiFilterOperators:I.length+t>0,disableMultiFilterOperator:I.length+t!==1,applyMultiFilterOperatorChanges:v,focusElementRef:t===M.length-1?u:null,logicOperators:d,columnsSort:p},g),null==e.id?t+I.length:e.id))]}),o.disableMultipleColumnsFiltering||m&&C?null:i.jsxs(GridPanelFooter,{children:[m?i.jsx("span",{}):i.jsx(o.slots.baseButton,et({onClick:P,startIcon:i.jsx(o.slots.filterPanelAddIcon,{})},o.slotProps?.baseButton,{children:n.current.getLocaleText("filterPanelAddFilter")})),!C&&M.length>0?i.jsx(o.slots.baseButton,et({onClick:D,startIcon:i.jsx(o.slots.filterPanelRemoveAllIcon,{})},o.slotProps?.baseButton,{children:n.current.getLocaleText("filterPanelRemoveAll")})):null]})]}))}),defaultSearchPredicate=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1,qi=new Intl.Collator;const Ki=u("div",{name:"MuiDataGrid",slot:"ColumnsManagement",overridesResolver:(e,t)=>t.columnsManagement})(({theme:e})=>({padding:e.spacing(0,3,1.5),display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400,alignItems:"flex-start"})),Xi=u("div",{name:"MuiDataGrid",slot:"ColumnsManagementHeader",overridesResolver:(e,t)=>t.columnsManagementHeader})(({theme:e})=>({padding:e.spacing(1.5,3)})),Yi=u(_,{name:"MuiDataGrid",slot:"ColumnsManagementSearchInput",overridesResolver:(e,t)=>t.columnsManagementSearchInput})(({theme:e})=>({[`& .${W.root}`]:{padding:e.spacing(0,1.5,0,1.5)},[`& .${W.input}::-webkit-search-decoration,\n & .${W.input}::-webkit-search-cancel-button,\n & .${W.input}::-webkit-search-results-button,\n & .${W.input}::-webkit-search-results-decoration`]:{display:"none"}})),Qi=u("div",{name:"MuiDataGrid",slot:"ColumnsManagementFooter",overridesResolver:(e,t)=>t.columnsManagementFooter})(({theme:e})=>({padding:e.spacing(.5,1,.5,3),display:"flex",justifyContent:"space-between",borderTop:`1px solid ${e.palette.divider}`})),Ji=u("div")(({theme:e})=>({padding:e.spacing(.5,0),color:e.palette.grey[500]})),Zi=forwardRef(function GridToolbarExportContainer2(e,t){const{children:n,slotProps:o={}}=e,l=o.button||{},a=o.tooltip||{},s=useGridApiContext$1(),u=useGridRootProps$1(),c=p(),d=p(),[g,h]=r.useState(!1),m=r.useRef(null),C=R(t,m),handleMenuClose=()=>h(!1);return null==n?null:i.jsxs(r.Fragment,{children:[i.jsx(u.slots.baseTooltip,et({title:s.current.getLocaleText("toolbarExportLabel"),enterDelay:1e3},u.slotProps?.baseTooltip,a,{children:i.jsx(u.slots.baseButton,et({size:"small",startIcon:i.jsx(u.slots.exportIcon,{}),"aria-expanded":g,"aria-label":s.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-controls":g?d:void 0,id:c},u.slotProps?.baseButton,l,{onClick:e=>{h(e=>!e),l.onClick?.(e)},ref:C,children:s.current.getLocaleText("toolbarExport")}))})),i.jsx(GridMenu,{open:g,target:m.current,onClose:handleMenuClose,position:"bottom-start",children:i.jsx(x,{id:d,className:Mt.menuList,"aria-labelledby":c,onKeyDown:e=>{"Tab"===e.key&&e.preventDefault(),isHideMenuKey(e.key)&&handleMenuClose()},autoFocusItem:g,children:r.Children.map(n,e=>r.isValidElement(e)?r.cloneElement(e,{hideMenu:handleMenuClose}):e)})})]})}),ea=["hideMenu","options"],ta=["hideMenu","options"],ra=["csvOptions","printOptions","excelOptions"];function GridCsvExportMenuItem(e){const t=useGridApiContext$1(),{hideMenu:r,options:n}=e,o=tt(e,ea);return i.jsx($,et({onClick:()=>{t.current.exportDataAsCsv(n),r?.()}},o,{children:t.current.getLocaleText("toolbarExportCSV")}))}function GridPrintExportMenuItem(e){const t=useGridApiContext$1(),{hideMenu:r,options:n}=e,o=tt(e,ta);return i.jsx($,et({onClick:()=>{t.current.exportDataAsPrint(n),r?.()}},o,{children:t.current.getLocaleText("toolbarExportPrint")}))}forwardRef(function GridToolbarExport2(e,t){const n=e,{csvOptions:o={},printOptions:l={},excelOptions:a}=n,s=tt(n,ra),u=useGridApiContext$1().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:a,csvOptions:o,printOptions:l}).sort((e,t)=>e.componentName>t.componentName?1:-1);return 0===u.length?null:i.jsx(Zi,et({},s,{ref:t,children:u.map((e,t)=>r.cloneElement(e.component,{key:t}))}))});const na=["className","selectedRowCount"],oa=P("div",{name:"MuiDataGrid",slot:"SelectedRowCount",overridesResolver:(e,t)=>t.selectedRowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2),visibility:"hidden",width:0,height:0,[e.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}})),la=forwardRef(function GridSelectedRowCount2(e,t){const{className:r,selectedRowCount:n}=e,o=tt(e,na),l=useGridApiContext$1(),a=useGridRootProps$1(),u=(e=>{const{classes:t}=e;return s({root:["selectedRowCount"]},getDataGridUtilityClass,t)})(a),c=l.current.getLocaleText("footerRowSelected")(n);return i.jsx(oa,et({className:h(u.root,r),ownerState:a},o,{ref:t,children:c}))}),ia=forwardRef(function GridFooter2(e,t){const r=useGridApiContext$1(),n=useGridRootProps$1(),o=useGridSelector(r,jt),l=useGridSelector(r,pn),a=useGridSelector(r,sn),s=!n.hideFooterSelectedRowCount&&l>0?i.jsx(la,{selectedRowCount:l}):i.jsx("div",{}),u=n.hideFooterRowCount||n.pagination?null:i.jsx(n.slots.footerRowCount,et({},n.slotProps?.footerRowCount,{rowCount:o,visibleRowCount:a})),c=n.pagination&&!n.hideFooterPagination&&n.slots.pagination&&i.jsx(n.slots.pagination,et({},n.slotProps?.pagination));return i.jsxs(Sl,et({},e,{ref:t,children:[s,u,c]}))}),getPinnedCellOffset=(e,t,r,n,o,l)=>{let i;switch(e){case Ar.LEFT:i=n[r];break;case Ar.RIGHT:i=o-n[r]-t+l;break;default:i=void 0}return i},shouldCellShowRightBorder=(e,t,r,n,o)=>{const l=t===r-1;return!(e!==Ar.LEFT||!l)||!!n&&(e===Ar.LEFT||(e===Ar.RIGHT?!l:!l||o))},shouldCellShowLeftBorder=(e,t)=>e===Ar.RIGHT&&0===t,aa={root:Mt.scrollbarFiller,header:Mt["scrollbarFiller--header"],borderTop:Mt["scrollbarFiller--borderTop"],borderBottom:Mt["scrollbarFiller--borderBottom"],pinnedRight:Mt["scrollbarFiller--pinnedRight"]};function GridScrollbarFillerCell({header:e,borderTop:t=!0,borderBottom:r,pinnedRight:n}){return i.jsx("div",{role:"presentation",className:h(aa.root,e&&aa.header,t&&aa.borderTop,r&&aa.borderBottom,n&&aa.pinnedRight)})}const sa=P("div",{name:"MuiDataGrid",slot:"SkeletonLoadingOverlay",overridesResolver:(e,t)=>t.skeletonLoadingOverlay})({minWidth:"100%",width:"max-content",height:"100%",overflow:"clip"}),getColIndex=e=>parseInt(e.getAttribute("data-colindex"),10),ua=forwardRef(function GridSkeletonLoadingOverlay2(e,t){const n=useGridRootProps$1(),{slots:o}=n,l=v(),a=(e=>{const{classes:t}=e;return s({root:["skeletonLoadingOverlay"]},getDataGridUtilityClass,t)})({classes:n.classes}),u=r.useRef(null),c=R(u,t),d=useGridApiContext$1(),p=useGridSelector(d,gridDimensionsSelector),g=p?.viewportInnerSize.height??0,m=Math.ceil(g/p.rowHeight),C=useGridSelector(d,yt),b=useGridSelector(d,br),w=r.useMemo(()=>b.filter(e=>e<=C).length,[C,b]),x=useGridSelector(d,fr),y=r.useMemo(()=>x.slice(0,w),[x,w]),S=useGridSelector(d,Cr),I=r.useCallback(e=>-1!==S.left.findIndex(t=>t.field===e)?Ar.LEFT:-1!==S.right.findIndex(t=>t.field===e)?Ar.RIGHT:void 0,[S.left,S.right]),M=r.useMemo(()=>{const e=[];for(let t=0;t<m;t+=1){const r=[];for(let e=0;e<y.length;e+=1){const a=y[e],s=I(a.field),u=s===Ar.LEFT,c=s===Ar.RIGHT,d=rtlFlipSide(s,l),g=d?S[d].length:y.length-S.left.length-S.right.length,m=d?S[d].findIndex(e=>e.field===a.field):e-S.left.length,C=p.hasScrollY?p.scrollbarSize:0,w=attachPinnedStyle({},l,s,getPinnedCellOffset(s,a.computedWidth,e,b,p.columnsTotalWidth,C)),v=p.columnsTotalWidth<p.viewportOuterSize.width,x=shouldCellShowRightBorder(s,m,g,n.showCellVerticalBorder,v),R=shouldCellShowLeftBorder(s,m),M=e===y.length-1,P=c&&0===m,k=P&&v,D=M&&!P&&v,E=p.viewportOuterSize.width-p.columnsTotalWidth,F=Math.max(0,E),G=i.jsx(o.skeletonCell,{width:F,empty:!0},`skeleton-filler-column-${t}`),H=M&&0!==C;k&&r.push(G),r.push(i.jsx(o.skeletonCell,{field:a.field,type:a.type,align:a.align,width:"var(--width)",height:p.rowHeight,"data-colindex":e,className:h(u&&Mt["cell--pinnedLeft"],c&&Mt["cell--pinnedRight"],x&&Mt["cell--withRightBorder"],R&&Mt["cell--withLeftBorder"]),style:et({"--width":`${a.computedWidth}px`},w)},`skeleton-column-${t}-${a.field}`)),D&&r.push(G),H&&r.push(i.jsx(GridScrollbarFillerCell,{pinnedRight:S.right.length>0},`skeleton-scrollbar-filler-${t}`))}e.push(i.jsx("div",{className:h(Mt.row,Mt.rowSkeleton,0===t&&Mt["row--firstVisible"]),children:r},`skeleton-row-${t}`))}return e},[o,y,S,m,n.showCellVerticalBorder,p,b,I,l]);return Dt(d,"columnResize",e=>{const{colDef:t,width:r}=e,n=u.current?.querySelectorAll(`[data-field="${escapeOperandAttributeSelector(t.field)}"]`);if(!n)throw new Error("MUI X: Expected skeleton cells to be defined with `data-field` attribute.");const o=y.findIndex(e=>e.field===t.field),l=I(t.field),i=l===Ar.LEFT,a=l===Ar.RIGHT,s=getComputedStyle(n[0]).getPropertyValue("--width"),c=parseInt(s,10)-r;if(n&&n.forEach(e=>{e.style.setProperty("--width",`${r}px`)}),i){const e=u.current?.querySelectorAll(`.${Mt["cell--pinnedLeft"]}`);e?.forEach(e=>{getColIndex(e)>o&&(e.style.left=parseInt(getComputedStyle(e).left,10)-c+"px")})}if(a){const e=u.current?.querySelectorAll(`.${Mt["cell--pinnedRight"]}`);e?.forEach(e=>{getColIndex(e)<o&&(e.style.right=`${parseInt(getComputedStyle(e).right,10)+c}px`)})}}),i.jsx(sa,et({className:a.root},e,{ref:c,children:M}))}),ca=["variant","noRowsVariant","style"],da={"circular-progress":{component:q,style:{}},"linear-progress":{component:U,style:{display:"block"}},skeleton:{component:ua,style:{display:"block"}}},pa=forwardRef(function GridLoadingOverlay2(e,t){const{variant:r="circular-progress",noRowsVariant:n="circular-progress",style:o}=e,l=tt(e,ca),a=useGridApiContext$1(),s=useGridSelector(a,Lt),u=da[0===s?n:r];return i.jsx(Pl,et({style:et({},u.style,o)},l,{ref:t,children:i.jsx(u.component,{})}))}),ga=forwardRef(function GridNoRowsOverlay2(e,t){const r=useGridApiContext$1().current.getLocaleText("noRowsLabel");return i.jsx(Pl,et({},e,{ref:t,children:r}))}),fa=u(K)(({theme:e})=>({maxHeight:"calc(100% + 1px)",flexGrow:1,[`& .${X.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${X.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),defaultLabelDisplayedRows=({from:e,to:t,count:r,estimated:n})=>n?`${e}–${t} of ${-1!==r?r:`more than ${n>t?n:t}`}`:`${e}–${t} of ${-1!==r?r:`more than ${t}`}`,ha=forwardRef(function GridPagination2(e,t){const n=useGridApiContext$1(),o=useGridRootProps$1(),l=useGridSelector(n,Mn),a=useGridSelector(n,Pn),s=useGridSelector(n,Fn),{paginationMode:u,loading:c,estimatedRowCount:d}=o,p=r.useMemo(()=>-1===a&&"server"===u&&c?{backIconButtonProps:{disabled:!0},nextIconButtonProps:{disabled:!0}}:{},[c,u,a]),g=r.useMemo(()=>Math.max(0,s-1),[s]),h=r.useMemo(()=>-1===a||l.page<=g?l.page:g,[g,l.page,a]),m=r.useCallback(e=>{const t=Number(e.target.value);n.current.setPageSize(t)},[n]),C=r.useCallback((e,t)=>{n.current.setPage(t)},[n]),b=(e=>{for(let t=0;t<o.pageSizeOptions.length;t+=1){const r=o.pageSizeOptions[t];if("number"==typeof r){if(r===e)return!0}else if(r.value===e)return!0}return!1})(l.pageSize)?o.pageSizeOptions:[],w=n.current.getLocaleText("MuiTablePagination"),v=(x=w.labelDisplayedRows||defaultLabelDisplayedRows,R=d,({from:e,to:t,count:r,page:n})=>x({from:e,to:t,count:r,page:n,estimated:R}));var x,R;return i.jsx(fa,et({component:"div",count:a,page:h,rowsPerPageOptions:b,rowsPerPage:l.pageSize,onPageChange:C,onRowsPerPageChange:m},p,w,{labelDisplayedRows:v},e,{ref:t}))}),ma=["className","rowCount","visibleRowCount"],Ca=P("div",{name:"MuiDataGrid",slot:"RowCount",overridesResolver:(e,t)=>t.rowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2)})),ba=forwardRef(function GridRowCount2(e,t){const{className:r,rowCount:n,visibleRowCount:o}=e,l=tt(e,ma),a=useGridApiContext$1(),u=useGridRootProps$1(),c=(e=>{const{classes:t}=e;return s({root:["rowCount"]},getDataGridUtilityClass,t)})(u);if(0===n)return null;const d=o<n?a.current.getLocaleText("footerTotalVisibleRows")(o,n):n.toLocaleString();return i.jsxs(Ca,et({className:h(c.root,r),ownerState:u},l,{ref:t,children:[a.current.getLocaleText("footerTotalRows")," ",d]}))});const wa=["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"],va=createSelectorV8(gridEditRowsStateSelector,(e,t)=>{if(!t)return!1;return!!function isObjectEmpty(e){for(const t in e)return!1;return!0}(e)}),xa=I(forwardRef(function GridRow2(e,t){const{selected:n,rowId:o,row:l,index:a,style:u,rowHeight:c,className:d,visibleColumns:p,pinnedColumns:g,offsetLeft:m,columnsTotalWidth:C,firstColumnIndex:b,lastColumnIndex:w,focusedColumnIndex:v,isFirstVisible:x,isLastVisible:y,isNotVisible:S,showBottomBorder:I,scrollbarWidth:M,gridHasFiller:P,onClick:k,onDoubleClick:D,onMouseEnter:E,onMouseLeave:F,onMouseOut:G,onMouseOver:H}=e,T=tt(e,wa),O=useGridPrivateApiContext$1(),L=useGridConfiguration(),A=r.useRef(null),j=useGridRootProps$1(),$=useGridVisibleRows(O),z=useGridSelector(O,Ur),V=useGridSelector(O,Wt),N=useGridSelector(O,br),B=j.rowReordering,_=useGridSelectorV8(O,va,B),W=R(A,t),U=O.current.getRowNode(o),q=useGridSelectorV8(O,Zo,{rowId:o,editMode:j.editMode}),K=j.editMode===Zt.Row,X=void 0!==v,Y=X&&v>=g.left.length&&v<b,Q=X&&v<p.length-g.right.length&&v>=w,J=function composeGridClasses(e,t){return s(t,getDataGridUtilityClass,e)}(j.classes,{root:["row",n&&"selected",K&&"row--editable",q&&"row--editing",x&&"row--firstVisible",y&&"row--lastVisible",I&&"row--borderBottom","auto"===c&&"row--dynamicHeight"]}),Z=L.hooks.useGridRowAriaAttributes();r.useLayoutEffect(()=>{if($.range){const e=O.current.getRowIndexRelativeToVisibleRows(o);void 0!==e&&O.current.unstable_setLastMeasuredRowIndex(e)}if(A.current&&"auto"===c)return O.current.observeRowHeight(A.current,o)},[O,$.range,c,o]);const ee=r.useCallback((e,t)=>r=>{isEventTargetInPortal(r)||O.current.getRow(o)&&(O.current.publishEvent(e,O.current.getRowParams(o),r),t&&t(r))},[O,o]),te=r.useCallback(e=>{const t=findParentElementFromClassName(e.target,Mt.cell),r=t?.getAttribute("data-field");if(r){if(r===$n.field)return;if(r===Lr)return;if("__reorder__"===r)return;if(O.current.getCellMode(o,r)===er.Edit)return;const e=O.current.getColumn(r);if(e?.type===Dr)return}ee("rowClick",k)(e)},[O,k,ee,o]),{slots:re,slotProps:ne,disableColumnReorder:oe}=j,le=useGridSelector(O,()=>et({},O.current.getRowHeightEntry(o)),bt),ie=r.useMemo(()=>{if(S)return{opacity:0,width:0,height:0};const e=et({},u,{maxHeight:"auto"===c?"none":c,minHeight:c,"--height":"number"==typeof c?`${c}px`:c});if(le.spacingTop){e["border"===j.rowSpacingType?"borderTopWidth":"marginTop"]=le.spacingTop}if(le.spacingBottom){const t="border"===j.rowSpacingType?"borderBottomWidth":"marginBottom";let r=e[t];"number"!=typeof r&&(r=parseInt(r||"0",10)),r+=le.spacingBottom,e[t]=r}return e},[S,c,u,le,j.rowSpacingType]),ae=O.current.unstable_applyPipeProcessors("rowClassName",[],o),se=Z(U,a);if("function"==typeof j.getRowClassName){const e=a-($.range?.firstRowIndex||0),t=et({},O.current.getRowParams(o),{isFirstVisible:0===e,isLastVisible:e===$.rows.length-1,indexRelativeToCurrentPage:e});ae.push(j.getRowClassName(t))}const getCell=(e,t,r,n,a=Ar.NONE)=>{const s=O.current.unstable_getCellColSpanInfo(o,r);if(s?.spannedByColSpan)return null;const u=s?.cellProps.width??e.computedWidth,d=s?.cellProps.colSpan??1,p=getPinnedCellOffset(a,e.computedWidth,r,N,C,M);if("skeletonRow"===U.type)return i.jsx(re.skeletonCell,{type:e.type,width:u,height:c,field:e.field,align:e.align},e.field);const g="__reorder__"===e.field,h=!(oe||e.disableReorder),m=_&&!z.length&&V<=1,b=!(h||g&&m),w=a===Ar.VIRTUAL,v=shouldCellShowLeftBorder(a,t),x=shouldCellShowRightBorder(a,t,n,j.showCellVerticalBorder,P);return i.jsx(re.cell,et({column:e,width:u,rowId:o,align:e.align||"left",colIndex:r,colSpan:d,disableDragEvents:b,isNotVisible:w,pinnedOffset:p,pinnedPosition:a,showLeftBorder:v,showRightBorder:x,row:l,rowNode:U},ne?.cell),e.field)},ue=g.left.map((e,t)=>getCell(e,t,t,g.left.length,Ar.LEFT)),ce=g.right.map((e,t)=>{const r=p.length-g.right.length+t;return getCell(e,t,r,g.right.length,Ar.RIGHT)}),de=p.length-g.left.length-g.right.length,pe=[];Y&&pe.push(getCell(p[v],v-g.left.length,v,de,Ar.VIRTUAL));for(let r=b;r<w;r+=1){const e=p[r],t=r-g.left.length;e&&pe.push(getCell(e,t,r,de))}Q&&pe.push(getCell(p[v],v-g.left.length,v,de,Ar.VIRTUAL));const ge=l?{onClick:te,onDoubleClick:ee("rowDoubleClick",D),onMouseEnter:ee("rowMouseEnter",E),onMouseLeave:ee("rowMouseLeave",F),onMouseOut:ee("rowMouseOut",G),onMouseOver:ee("rowMouseOver",H)}:null;return i.jsxs("div",et({"data-id":o,"data-rowindex":a,role:"row",className:h(...ae,J.root,d),style:ie},se,ge,T,{ref:W,children:[ue,i.jsx("div",{role:"presentation",className:Mt.cellOffsetLeft,style:{width:m}}),pe,i.jsx("div",{role:"presentation",className:h(Mt.cell,Mt.cellEmpty)}),ce,0!==M&&i.jsx(GridScrollbarFillerCell,{pinnedRight:g.right.length>0,borderTop:!x})]}))}));function GridContextProvider({privateApiRef:e,configuration:t,props:n,children:o}){const l=r.useRef(e.current.getPublicApi());return i.jsx(Oo.Provider,{value:t,children:i.jsx(It.Provider,{value:n,children:i.jsx(Co.Provider,{value:e,children:i.jsx(Pt.Provider,{value:l,children:o})})})})}const Ra=function localStorageAvailable(){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"),noop$1=()=>{},ya={debug:noop$1,info:noop$1,warn:noop$1,error:noop$1},Sa=["debug","info","warn","error"];function getAppender(e,t,r=console){const n=Sa.indexOf(t);if(-1===n)throw new Error(`MUI X: Log level ${t} not recognized.`);return Sa.reduce((t,o,l)=>(t[o]=l>=n?(...t)=>{const[n,...l]=t;r[o](`MUI X: ${e} - ${n}`,...l)}:noop$1,t),{})}class EventManager{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(e,t,r={}){let n=this.events[e];n||(n={highPriority:new Map,regular:new Map},this.events[e]=n),r.isFirst?n.highPriority.set(t,!0):n.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 r=this.events[e];if(!r)return;const n=Array.from(r.highPriority.keys()),o=Array.from(r.regular.keys());for(let l=n.length-1;l>=0;l-=1){const e=n[l];r.highPriority.has(e)&&e.apply(this,t)}for(let l=0;l<o.length;l+=1){const e=o[l];r.regular.has(e)&&e.apply(this,t)}}once(e,t){const r=this;this.on(e,function oneTimeListener(...n){r.removeListener(e,oneTimeListener),t.apply(r,n)})}}class Store{static create(e){return new Store(e)}constructor(e){this.value=void 0,this.listeners=void 0,this.subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}),this.getSnapshot=()=>this.value,this.update=e=>{this.value=e,this.listeners.forEach(t=>t(e))},this.value=e,this.listeners=new Set}}const Ia=Symbol("mui.api_private");let Ma=0;function useGridApiInitialization(e,t){const n=r.useRef(null),o=r.useRef(null);o.current||(o.current=function createPrivateAPI(e){const t=e.current?.[Ia];if(t)return t;const r={},n={state:r,store:Store.create(r),instanceId:{id:Ma}};return Ma+=1,n.getPublicApi=()=>e.current,n.register=(t,r)=>{Object.keys(r).forEach(o=>{const l=r[o],i=n[o];if(!0===i?.spying?i.target=l:n[o]=l,"public"===t){const t=e.current,r=t[o];!0===r?.spying?r.target=l:t[o]=l}})},n.register("private",{caches:{},eventManager:new EventManager}),n}(n)),n.current||(n.current=function createPublicAPI(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[Ia]:e.current}}(o));const l=r.useCallback((...e)=>{const[r,n,l={}]=e;if(l.defaultMuiPrevented=!1,(e=>void 0!==e.isPropagationStopped)(l)&&l.isPropagationStopped())return;const i=t.signature===kt.DataGridPro||t.signature===kt.DataGridPremium?{api:o.current.getPublicApi()}:{};o.current.eventManager.emit(r,n,l,i)},[o,t.signature]),i=r.useCallback((e,t,r)=>{o.current.eventManager.on(e,t,r);const n=o.current;return()=>{n.eventManager.removeListener(e,t)}},[o]);return useGridApiMethod(o,{subscribeEvent:i,publishEvent:l},"public"),e&&!e.current?.state&&(e.current=n.current),r.useImperativeHandle(e,()=>n.current,[n]),r.useEffect(()=>{const e=o.current;return()=>{e.publishEvent("unmount")}},[o]),o}const useGridRegisterPipeProcessor=(e,t,n,o=!0)=>{const l=r.useRef(null),i=r.useRef(`mui-${Math.round(1e9*Math.random())}`),a=r.useCallback(()=>{l.current=e.current.registerPipeProcessor(t,i.current,n)},[e,n,t]);useFirstRender(()=>{o&&a()});const s=r.useRef(!0);r.useEffect(()=>(s.current?s.current=!1:o&&a(),()=>{l.current&&(l.current(),l.current=null)}),[a,o])},useGridRegisterPipeApplier=(e,t,n)=>{const o=r.useRef(null),l=r.useRef(`mui-${Math.round(1e9*Math.random())}`),i=r.useCallback(()=>{o.current=e.current.registerPipeApplier(t,l.current,n)},[e,n,t]);useFirstRender(()=>{i()});const a=r.useRef(!0);r.useEffect(()=>(a.current?a.current=!1:i(),()=>{o.current&&(o.current(),o.current=null)}),[i])},useGridRegisterStrategyProcessor=(e,t,n,o)=>{const l=r.useCallback(()=>{e.current.registerStrategyProcessor(t,n,o)},[e,o,n,t]);useFirstRender(()=>{l()});const i=r.useRef(!0);r.useEffect(()=>{i.current?i.current=!1:l()},[l])},Pa="none",ka={rowTreeCreation:"rowTree",filtering:"rowTree",sorting:"rowTree",visibleRowsLookupCreation:"rowTree"},propsStateInitializer=(e,t)=>et({},e,{props:{getRowId:t.getRowId}}),useGridInitialization=(e,t)=>{const n=useGridApiInitialization(e,t);return(e=>{const t=r.useRef(null),n=r.useRef(null),o=r.useRef(null),l=r.useRef(null),i=r.useRef(null),a=r.useRef(null);e.current.register("public",{rootElementRef:t}),e.current.register("private",{mainElementRef:n,virtualScrollerRef:o,virtualScrollbarVerticalRef:l,virtualScrollbarHorizontalRef:i,columnHeadersContainerRef:a})})(n),((e,t)=>{r.useEffect(()=>{e.current.setState(e=>et({},e,{props:{getRowId:t.getRowId}}))},[e,t.getRowId])})(n,t),(e=>{const t=v();void 0===e.current.state.isRtl&&(e.current.state.isRtl=t);const n=r.useRef(!0);r.useEffect(()=>{n.current?n.current=!1:e.current.setState(e=>et({},e,{isRtl:t}))},[e,t])})(n),((e,t)=>{useGridApiMethod(e,{getLogger:r.useCallback(e=>Ra?getAppender(e,"debug",t.logger):t.logLevel?getAppender(e,t.logLevel.toString(),t.logger):ya,[t.logLevel,t.logger])},"private")})(n,t),(e=>{const t=r.useRef({}),n=r.useCallback(e=>{t.current[e.stateId]=e},[]),o=r.useCallback((r,n)=>{let o;if(o=function isFunction(e){return"function"==typeof e}(r)?r(e.current.state):r,e.current.state===o)return!1;let l=!1;const i=[];if(Object.keys(t.current).forEach(r=>{const n=t.current[r],a=n.stateSelector(e.current.state,e.current.instanceId),s=n.stateSelector(o,e.current.instanceId);s!==a&&(i.push({stateId:n.stateId,hasPropChanged:s!==n.propModel}),void 0!==n.propModel&&s!==n.propModel&&(l=!0))}),i.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${i[0].stateId}, therefore, you're not allowed to update ${i.map(e=>e.stateId).join(", ")} in the same transaction.`);if(l||(e.current.state=o,e.current.publishEvent("stateChange",o),e.current.store.update(o)),1===i.length){const{stateId:r,hasPropChanged:a}=i[0],s=t.current[r],u=s.stateSelector(o,e.current.instanceId);s.propOnChange&&a&&s.propOnChange(u,{reason:n,api:e.current}),l||e.current.publishEvent(s.changeEvent,u,{reason:n})}return!l},[e]),l=r.useCallback((t,r,n)=>e.current.setState(e=>et({},e,{[t]:r(e[t])}),n),[e]),i=r.useCallback(()=>{},[]),a={updateControlState:l,registerControlState:n};useGridApiMethod(e,{setState:o,forceUpdate:i},"public"),useGridApiMethod(e,a,"private")})(n),(e=>{const t=r.useRef({}),n=r.useRef(!1),o=r.useCallback(e=>{!n.current&&e&&(n.current=!0,Object.values(e.appliers).forEach(e=>{e()}),n.current=!1)},[]),l=r.useCallback((e,r,n)=>{t.current[e]||(t.current[e]={processors:new Map,processorsAsArray:[],appliers:{}});const l=t.current[e];return l.processors.get(r)!==n&&(l.processors.set(r,n),l.processorsAsArray=Array.from(t.current[e].processors.values()).filter(e=>null!==e),o(l)),()=>{t.current[e].processors.set(r,null),t.current[e].processorsAsArray=Array.from(t.current[e].processors.values()).filter(e=>null!==e)}},[o]),i=r.useCallback((e,r,n)=>(t.current[e]||(t.current[e]={processors:new Map,processorsAsArray:[],appliers:{}}),t.current[e].appliers[r]=n,()=>{const n=t.current[e].appliers,o=tt(n,[r].map(ot));t.current[e].appliers=o}),[]),a=r.useCallback(e=>{o(t.current[e])},[o]),s={unstable_applyPipeProcessors:r.useCallback((...e)=>{const[r,n,o]=e;if(!t.current[r])return n;const l=t.current[r].processorsAsArray;let i=n;for(let t=0;t<l.length;t+=1)i=l[t](i,o);return i},[])};useGridApiMethod(e,{registerPipeProcessor:l,registerPipeApplier:i,requestPipeProcessorsApplication:a},"private"),useGridApiMethod(e,s,"public")})(n),(e=>{const t=r.useRef(new Map),n=r.useRef({}),o=r.useCallback((t,r,o)=>{const cleanup=()=>{const e=n.current[r],o=tt(e,[t].map(ot));n.current[r]=o};n.current[r]||(n.current[r]={});const l=n.current[r],i=l[t];return l[t]=o,i&&i!==o?(t===e.current.getActiveStrategy(ka[r])&&e.current.publishEvent("activeStrategyProcessorChange",r),cleanup):cleanup},[e]),l=r.useCallback((t,r)=>{const o=e.current.getActiveStrategy(ka[t]);if(null==o)throw new Error("Can't apply a strategy processor before defining an active strategy");const l=n.current[t];if(!l||!l[o])throw new Error(`No processor found for processor "${t}" on strategy "${o}"`);return(0,l[o])(r)},[e]),i=r.useCallback(e=>{const r=Array.from(t.current.entries()).find(([,t])=>t.group===e&&t.isAvailable());return r?.[0]??Pa},[]),a=r.useCallback((r,n,o)=>{t.current.set(n,{group:r,isAvailable:o}),e.current.publishEvent("strategyAvailabilityChange")},[e]);useGridApiMethod(e,{registerStrategyProcessor:o,applyStrategyProcessor:l,getActiveStrategy:i,setStrategyAvailability:a},"private")})(n),((e,t)=>{const n=r.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})})(n,t),n.current.register("private",{rootProps:t}),n},useGridInitializeState=(e,t,n)=>{const o=r.useRef(!1);o.current||(t.current.state=e(t.current.state,n,t),o.current=!0)};function sanitizeCellValue(e,t){if(null==e)return"";const r="string"==typeof e?e:`${e}`;if(t.shouldAppendQuotes||t.escapeFormulas){const e=r.replace(/"/g,'""');return t.escapeFormulas&&["=","+","-","@","\t","\r"].includes(e[0])?`"'${e}"`:[t.delimiter,"\n","\r",'"'].some(e=>r.includes(e))?`"${e}"`:e}return r}const serializeCellValue=(e,t)=>{const{csvOptions:r,ignoreValueFormatter:n}=t;let o;if(n){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 sanitizeCellValue(o,r)};class CSVRow{constructor(e){this.options=void 0,this.rowString="",this.isEmpty=!0,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 buildCSV(e){const{columns:t,rowIds:r,csvOptions:n,ignoreValueFormatter:o,apiRef:l}=e,i=r.reduce((e,r)=>`${e}${(({id:e,columns:t,getCellParams:r,csvOptions:n,ignoreValueFormatter:o})=>{const l=new CSVRow({csvOptions:n});return t.forEach(t=>{const i=r(e,t.field);l.addValue(serializeCellValue(i,{ignoreValueFormatter:o,csvOptions:n}))}),l.getRowString()})({id:r,columns:t,getCellParams:l.current.getCellParams,ignoreValueFormatter:o,csvOptions:n})}\r\n`,"").trim();if(!n.includeHeaders)return i;const a=t.filter(e=>e.field!==$n.field),s=[];if(n.includeColumnGroupsHeaders){const e=l.current.getAllGroupDetails();let t=0;const r=a.reduce((e,r)=>{const n=l.current.getColumnGroupPath(r.field);return e[r.field]=n,t=Math.max(t,n.length),e},{});for(let o=0;o<t;o+=1){const t=new CSVRow({csvOptions:n,sanitizeCellValue});s.push(t),a.forEach(n=>{const l=(r[n.field]||[])[o],i=e[l];t.addValue(i?i.headerName||i.groupId:"")})}}const u=new CSVRow({csvOptions:n,sanitizeCellValue});a.forEach(e=>{u.addValue(e.headerName||e.field)}),s.push(u);return`${`${s.map(e=>e.getRowString()).join("\r\n")}\r\n`}${i}`.trim()}function writeToClipboardPolyfill(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 r=document.createRange();r.selectNode(t);const n=window.getSelection();n.removeAllRanges(),n.addRange(r);try{document.execCommand("copy")}finally{document.body.removeChild(t)}}const useGridClipboard=(e,t)=>{const n=t.ignoreValueFormatterDuringExport,o=("object"==typeof n?n?.clipboardExport:n)||!1,l=t.clipboardCopyCellDelimiter,i=r.useCallback(t=>{if(!function isCopyShortcut(e){return(e.ctrlKey||e.metaKey)&&"C"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey}(t))return;if(function hasNativeSelection(e){return!!window.getSelection()?.toString()||!!(e&&(e.selectionEnd||0)-(e.selectionStart||0)>0)}(t.target))return;let r="";if(e.current.getSelectedRows().size>0)r=e.current.getDataAsCsv({includeHeaders:!1,delimiter:l,shouldAppendQuotes:!1,escapeFormulas:!1});else{const t=Cn(e);if(t){const n=e.current.getCellParams(t.id,t.field);r=serializeCellValue(n,{csvOptions:{delimiter:l,shouldAppendQuotes:!1,escapeFormulas:!1},ignoreValueFormatter:o})}}r=e.current.unstable_applyPipeProcessors("clipboardCopy",r),r&&(!function copyToClipboard(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>{writeToClipboardPolyfill(e)}):writeToClipboardPolyfill(e)}(r),e.current.publishEvent("clipboardCopy",r))},[e,o,l]);useGridNativeEventListener(e,()=>e.current.rootElementRef.current,"keydown",i),useGridApiOptionHandler(e,"clipboardCopy",t.onClipboardCopy)},columnMenuStateInitializer=e=>et({},e,{columnMenu:{open:!1}}),columnsStateInitializer=(e,t,r)=>{const n=createColumnsState({apiRef:r,columnsToUpsert:t.columns,initialState:t.initialState?.columns,columnVisibilityModel:t.columnVisibilityModel??t.initialState?.columns?.columnVisibilityModel??{},keepOnlyColumnsToUpsert:!0});return et({},e,{columns:n,pinnedColumns:e.pinnedColumns??ur})};function mergeColumnsState(e){return t=>et({},t,{columns:e})}const densityStateInitializer=(e,t)=>et({},e,{density:t.initialState?.density??t.density??"standard"});const getColumnsToExport=({apiRef:e,options:t})=>{const r=pr(e);if(t.fields)return t.fields.reduce((e,t)=>{const n=r.find(e=>e.field===t);return n&&e.push(n),e},[]);return(t.allColumns?r:fr(e)).filter(e=>!e.disableExport)},defaultGetRowsToExport=({apiRef:e})=>{const t=nn(e),r=Vt(e),n=e.current.getSelectedRows(),o=t.filter(e=>"footer"!==r[e].type),l=qt(e),i=l?.top?.map(e=>e.id)||[],a=l?.bottom?.map(e=>e.id)||[];return o.unshift(...i),o.push(...a),n.size>0?o.filter(e=>n.has(e)):o},useGridCsvExport=(e,t)=>{const n=useGridLogger(e,"useGridCsvExport"),o=t.ignoreValueFormatterDuringExport,l=("object"==typeof o?o?.csvExport:o)||!1,a=r.useCallback((t={})=>{n.debug("Get data as CSV");return buildCSV({columns:getColumnsToExport({apiRef:e,options:t}),rowIds:(t.getRowsToExport??defaultGetRowsToExport)({apiRef:e}),csvOptions:{delimiter:t.delimiter||",",shouldAppendQuotes:t.shouldAppendQuotes??!0,includeHeaders:t.includeHeaders??!0,includeColumnGroupsHeaders:t.includeColumnGroupsHeaders??!0,escapeFormulas:t.escapeFormulas??!0},ignoreValueFormatter:l,apiRef:e})},[n,e,l]),s=r.useCallback(e=>{n.debug("Export data as CSV");const t=a(e);!function exportAs(e,t="csv",r=document.title||"untitled"){const n=`${r}.${t}`;if("download"in HTMLAnchorElement.prototype){const t=URL.createObjectURL(e),r=document.createElement("a");return r.href=t,r.download=n,r.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,a]);useGridApiMethod(e,{getDataAsCsv:a,exportDataAsCsv:s},"public");const u=r.useCallback((e,t)=>t.csvOptions?.disableToolbarButton?e:[...e,{component:i.jsx(GridCsvExportMenuItem,{options:t.csvOptions}),componentName:"csvExport"}],[]);useGridRegisterPipeProcessor(e,"exportMenu",u)},getDerivedPaginationModel=(e,t,r)=>{let n=e.paginationModel;const o=e.rowCount,l=r?.pageSize??n.pageSize,i=r?.page??n.page,a=getPageCount(o,l,i);!r||r?.page===n.page&&r?.pageSize===n.pageSize||(n=r);const s=-1===l?0:((e,t=0)=>0===t?e:Math.max(Math.min(e,t-1),0))(n.page,a);return s!==n.page&&(n=et({},n,{page:s})),throwIfPageSizeExceedsTheLimit(n.pageSize,t),n};const useGridPrintExport=(e,t)=>{const n=null!==e.current.rootElementRef.current,o=useGridLogger(e,"useGridPrintExport"),l=r.useRef(null),a=r.useRef(null),s=r.useRef({}),u=r.useRef([]),c=r.useRef(null);r.useEffect(()=>{l.current=E(e.current.rootElementRef.current)},[e,n]);const d=r.useCallback((t,r,n)=>new Promise(o=>{const l=getColumnsToExport({apiRef:e,options:{fields:t,allColumns:r}}).map(e=>e.field),i=pr(e),a={};i.forEach(e=>{a[e.field]=l.includes(e.field)}),n&&(a[$n.field]=!0),e.current.setColumnVisibilityModel(a),o()}),[e]),p=r.useCallback(t=>{const r=t({apiRef:e}).reduce((t,r)=>{const n=e.current.getRow(r);return n[Gr]||t.push(n),t},[]);e.current.setRows(r)},[e]),g=r.useCallback((r,n)=>{const o=et({copyStyles:!0,hideToolbar:!1,hideFooter:!1,includeCheckboxes:!1},n),i=r.contentDocument;if(!i)return;const a=gridRowsMetaSelector(e.current.state),s=e.current.rootElementRef.current,u=s.cloneNode(!0);u.querySelector(`.${Mt.main}`).style.overflow="visible",u.style.contain="size";let c=s.querySelector(`.${Mt.toolbarContainer}`)?.offsetHeight||0,d=s.querySelector(`.${Mt.footerContainer}`)?.offsetHeight||0;const p=u.querySelector(`.${Mt.footerContainer}`);o.hideToolbar&&(u.querySelector(`.${Mt.toolbarContainer}`)?.remove(),c=0),o.hideFooter&&p&&(p.remove(),d=0);const g=a.currentPageTotalHeight+getTotalHeaderHeight(e,t)+c+d;u.style.height=`${g}px`,u.style.boxSizing="content-box",!o.hideFooter&&p&&(p.style.position="absolute",p.style.width="100%",p.style.top=g-d+"px");const h=document.createElement("div");h.appendChild(u),i.body.style.marginTop="0px",i.body.innerHTML=h.innerHTML;const m="function"==typeof o.pageStyle?o.pageStyle():o.pageStyle;if("string"==typeof m){const e=i.createElement("style");e.appendChild(i.createTextNode(m)),i.head.appendChild(e)}o.bodyClassName&&i.body.classList.add(...o.bodyClassName.split(" "));const C=[];if(o.copyStyles){const e=s.getRootNode(),t=("ShadowRoot"===e.constructor.name?e:l.current).querySelectorAll("style, link[rel='stylesheet']");for(let r=0;r<t.length;r+=1){const e=t[r];if("STYLE"===e.tagName){const t=i.createElement(e.tagName),r=e.sheet;if(r){let e="";for(let t=0;t<r.cssRules.length;t+=1)"string"==typeof r.cssRules[t].cssText&&(e+=`${r.cssRules[t].cssText}\r\n`);t.appendChild(i.createTextNode(e)),i.head.appendChild(t)}}else if(e.getAttribute("href")){const t=i.createElement(e.tagName);for(let r=0;r<e.attributes.length;r+=1){const n=e.attributes[r];n&&t.setAttribute(n.nodeName,n.nodeValue||"")}C.push(new Promise(e=>{t.addEventListener("load",()=>e())})),i.head.appendChild(t)}}}Promise.all(C).then(()=>{r.contentWindow.print()})},[e,l,t]),h=r.useCallback(t=>{l.current.body.removeChild(t),e.current.restoreState(a.current||{}),a.current?.columns?.columnVisibilityModel||e.current.setColumnVisibilityModel(s.current),e.current.setState(e=>et({},e,{virtualization:c.current})),e.current.setRows(u.current),a.current=null,s.current={},u.current=[]},[e]),m=r.useCallback(async r=>{if(o.debug("Export data as Print"),!e.current.rootElementRef.current)throw new Error("MUI X: No grid root element available.");if(a.current=e.current.exportState(),s.current=gr(e),u.current=e.current.getSortedRows().filter(e=>!e[Gr]),t.pagination){const t={page:0,pageSize:an(e)};e.current.setState(e=>et({},e,{pagination:et({},e.pagination,{paginationModel:getDerivedPaginationModel(e.pagination,"DataGridPro",t)})}))}c.current=e.current.state.virtualization,e.current.unstable_setVirtualization(!1),await d(r?.fields,r?.allColumns,r?.includeCheckboxes),p(r?.getRowsToExport??defaultGetRowsToExport),await function raf(){return new Promise(e=>{requestAnimationFrame(()=>{e()})})}();const n=function buildPrintWindow(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}(r?.fileName);n.onload=()=>{g(n,r);n.contentWindow.matchMedia("print").addEventListener("change",e=>{!1===e.matches&&h(n)})},l.current.body.appendChild(n)},[t,o,e,g,h,d,p]);useGridApiMethod(e,{exportDataAsPrint:m},"public");const C=r.useCallback((e,t)=>t.printOptions?.disableToolbarButton?e:[...e,{component:i.jsx(GridPrintExportMenuItem,{options:t.printOptions}),componentName:"printExport"}],[]);useGridRegisterPipeProcessor(e,"exportMenu",C)},filterStateInitializer=(e,t,r)=>{const n=t.filterModel??t.initialState?.filter?.filterModel??getDefaultGridFilterModel();return et({},e,{filter:et({filterModel:sanitizeFilterModel(n,t.disableMultipleColumnsFiltering,r)},ar),visibleRowsLookup:{}})},getVisibleRowsLookup$1=e=>e.filteredRowsLookup;function getVisibleRowsLookupState(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}function createMemoizedValues(){return lruMemoize(Object.values)}const focusStateInitializer=e=>et({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),getLeftColumnIndex=({currentColIndex:e,firstColIndex:t,lastColIndex:r,isRtl:n})=>{if(n){if(e<r)return e+1}else if(!n&&e>t)return e-1;return null},getRightColumnIndex=({currentColIndex:e,firstColIndex:t,lastColIndex:r,isRtl:n})=>{if(n){if(e>t)return e-1}else if(!n&&e<r)return e+1;return null};const Da=createSelectorMemoized(On,qt,(e,t)=>(t.top||[]).concat(e.rows,t.bottom||[])),useGridKeyboardNavigation=(e,t)=>{const n=useGridLogger(e,"useGridKeyboardNavigation"),o=v(),l=t.unstable_listView,i=r.useCallback(()=>Da(e),[e]),a="DataGrid"!==t.signature&&t.headerFilters,s=r.useCallback((t,r,o="left",i="up")=>{const a=en(e),s=e.current.unstable_getCellColSpanInfo(r,t);s&&s.spannedByColSpan&&("left"===o?t=s.leftVisibleCellIndex:"right"===o&&(t=s.rightVisibleCellIndex));const u=l?gridListColumnSelector(e.current.state).field:hr(e)[t],c=function findNonRowSpannedCell(e,t,r,n){const o=So(e);if(!o[t]?.[r])return t;const l=nn(e);let i=l.indexOf(t)+("down"===n?1:-1);for(;i>=0&&i<l.length;){const e=l[i];if(!o[e]?.[r])return e;i+="down"===n?1:-1}return t}(e,r,u,i),d=a.findIndex(e=>e.id===c);n.debug(`Navigating to cell row ${d}, col ${t}`),e.current.scrollToIndexes({colIndex:t,rowIndex:d}),e.current.setCellFocus(c,u)},[e,n,l]),u=r.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=r.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]),d=r.useCallback((t,r,o)=>{n.debug(`Navigating to header col ${t}`),e.current.scrollToIndexes({colIndex:t});const{field:l}=e.current.getVisibleColumns()[t];e.current.setColumnGroupHeaderFocus(l,r,o)},[e,n]),p=r.useCallback(e=>i()[e]?.id,[i]),g=r.useCallback((t,r)=>{const n=r.currentTarget.querySelector(`.${Mt.columnHeaderTitleContainerContent}`);if(!!n&&n.contains(r.target)&&t.field!==$n.field)return;const l=i(),g=e.current.getViewportPageSize(),h=t.field?e.current.getColumnIndex(t.field):0,m=l.length>0?0:null,C=l.length-1,b=fr(e).length-1,w=io(e);let v=!0;switch(r.key){case"ArrowDown":a?c(h,r):null!==m&&s(h,p(m));break;case"ArrowRight":{const e=getRightColumnIndex({currentColIndex:h,firstColIndex:0,lastColIndex:b,isRtl:o});null!==e&&u(e,r);break}case"ArrowLeft":{const e=getLeftColumnIndex({currentColIndex:h,firstColIndex:0,lastColIndex:b,isRtl:o});null!==e&&u(e,r);break}case"ArrowUp":w>0&&d(h,w-1,r);break;case"PageDown":null!==m&&null!==C&&s(h,p(Math.min(m+g,C)));break;case"Home":u(0,r);break;case"End":u(b,r);break;case"Enter":(r.ctrlKey||r.metaKey)&&e.current.toggleColumnMenu(t.field);break;case" ":break;default:v=!1}v&&r.preventDefault()},[e,i,a,c,s,p,o,u,d]),h=r.useCallback((t,r)=>{const n=to(e)===t.field,l=ro(e)===t.field;if(n||l||!isNavigationKey(r.key))return;const a=i(),d=e.current.getViewportPageSize(),g=t.field?e.current.getColumnIndex(t.field):0,h=a.length-1,m=fr(e).length-1;let C=!0;switch(r.key){case"ArrowDown":{const e=p(0);null!=e&&s(g,e);break}case"ArrowRight":{const e=getRightColumnIndex({currentColIndex:g,firstColIndex:0,lastColIndex:m,isRtl:o});null!==e&&c(e,r);break}case"ArrowLeft":{const n=getLeftColumnIndex({currentColIndex:g,firstColIndex:0,lastColIndex:m,isRtl:o});null!==n?c(n,r):e.current.setColumnHeaderFilterFocus(t.field,r);break}case"ArrowUp":u(g,r);break;case"PageDown":null!==h&&s(g,p(Math.min(0+d,h)));break;case"Home":c(0,r);break;case"End":c(m,r);break;case" ":break;default:C=!1}C&&r.preventDefault()},[e,i,c,o,u,s,p]),m=r.useCallback((t,r)=>{const n=vn(e);if(null===n)return;const{field:o,depth:l}=n,{fields:a,depth:c,maxDepth:g}=t,h=i(),m=e.current.getViewportPageSize(),C=e.current.getColumnIndex(o),b=o?e.current.getColumnIndex(o):0,w=h.length-1,v=fr(e).length-1;let x=!0;switch(r.key){case"ArrowDown":c===g-1?u(C,r):d(C,l+1,r);break;case"ArrowUp":c>0&&d(C,l-1,r);break;case"ArrowRight":{const e=a.length-a.indexOf(o)-1;C+e+1<=v&&d(C+e+1,l,r);break}case"ArrowLeft":{const e=a.indexOf(o);C-e-1>=0&&d(C-e-1,l,r);break}case"PageDown":null!==w&&s(b,p(Math.min(0+m,w)));break;case"Home":d(0,l,r);break;case"End":d(v,l,r);break;case" ":break;default:x=!1}x&&r.preventDefault()},[e,i,u,d,s,p]),C=r.useCallback((t,r)=>{if(isEventTargetInPortal(r))return;const n=e.current.getCellParams(t.id,t.field);if(n.cellMode===er.Edit||!isNavigationKey(r.key))return;if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:r,cell:n}))return;const d=i();if(0===d.length)return;const g=e.current.getViewportPageSize(),h=l?()=>0:e.current.getColumnIndex,m=t.field?h(t.field):0,C=d.findIndex(e=>e.id===t.id),b=d.length-1,w=(l?[gridListColumnSelector(e.current.state)]:fr(e)).length-1;let v=!0;switch(r.key){case"ArrowDown":C<b&&s(m,p(C+1),o?"right":"left","down");break;case"ArrowUp":C>0?s(m,p(C-1)):a?c(m,r):u(m,r);break;case"ArrowRight":{const e=getRightColumnIndex({currentColIndex:m,firstColIndex:0,lastColIndex:w,isRtl:o});null!==e&&s(e,p(C),o?"left":"right");break}case"ArrowLeft":{const e=getLeftColumnIndex({currentColIndex:m,firstColIndex:0,lastColIndex:w,isRtl:o});null!==e&&s(e,p(C),o?"right":"left");break}case"Tab":r.shiftKey&&m>0?s(m-1,p(C),"left"):!r.shiftKey&&m<w&&s(m+1,p(C),"right");break;case" ":{if(t.field===Lr)break;const e=t.colDef;if(e&&(e.field===Tr||(e=>e===Or||null!==(e=>{const t=e.match(/^__row_group_by_columns_group_(.*)__$/);return t?t[1]:null})(e))(e.field)))break;!r.shiftKey&&C<b&&s(m,p(Math.min(C+g,b)));break}case"PageDown":C<b&&s(m,p(Math.min(C+g,b)));break;case"PageUp":{const e=Math.max(C-g,0);e!==C&&e>=0?s(m,p(e)):u(m,r);break}case"Home":r.ctrlKey||r.metaKey||r.shiftKey?s(0,p(0)):s(0,p(C));break;case"End":r.ctrlKey||r.metaKey||r.shiftKey?s(w,p(b)):s(w,p(C));break;default:v=!1}v&&r.preventDefault()},[e,i,o,s,p,a,c,u,l]),b=r.useCallback((e,{event:t})=>" "!==t.key&&e,[]);useGridRegisterPipeProcessor(e,"canStartEditing",b),Dt(e,"columnHeaderKeyDown",g),Dt(e,"headerFilterKeyDown",h),Dt(e,"columnGroupHeaderKeyDown",m),Dt(e,"cellKeyDown",C)},paginationStateInitializer=(e,t)=>{const r=et({},getDefaultGridPaginationModel(t.autoPageSize),t.paginationModel??t.initialState?.pagination?.paginationModel);throwIfPageSizeExceedsTheLimit(r.pageSize,t.signature);const n=t.rowCount??t.initialState?.pagination?.rowCount??("client"===t.paginationMode?e.rows?.totalRowCount:void 0),o=t.paginationMeta??t.initialState?.pagination?.meta??{};return et({},e,{pagination:et({},e.pagination,{paginationModel:r,rowCount:n,meta:o,enabled:!0===t.pagination,paginationMode:t.paginationMode})})},useGridPagination=(e,n)=>{((e,t)=>{const n=useGridLogger(e,"useGridPaginationMeta"),o=useGridSelector(e,kn);e.current.registerControlState({stateId:"paginationMeta",propModel:t.paginationMeta,propOnChange:t.onPaginationMetaChange,stateSelector:kn,changeEvent:"paginationMetaChange"});const l=r.useCallback(t=>{o!==t&&(n.debug("Setting 'paginationMeta' to",t),e.current.setState(e=>et({},e,{pagination:et({},e.pagination,{meta:t})})))},[e,n,o]);useGridApiMethod(e,{setPaginationMeta:l},"public");const i=r.useCallback((r,n)=>{const o=kn(e);return n.exportOnlyDirtyModels&&null==t.paginationMeta&&null==t.initialState?.pagination?.meta?r:et({},r,{pagination:et({},r.pagination,{meta:o})})},[e,t.paginationMeta,t.initialState?.pagination?.meta]),a=r.useCallback((t,r)=>{const n=r.stateToRestore.pagination?.meta?r.stateToRestore.pagination.meta:kn(e);return e.current.setState(e=>et({},e,{pagination:et({},e.pagination,{meta:n})})),t},[e]);useGridRegisterPipeProcessor(e,"exportState",i),useGridRegisterPipeProcessor(e,"restoreState",a),r.useEffect(()=>{t.paginationMeta&&e.current.setPaginationMeta(t.paginationMeta)},[e,t.paginationMeta])})(e,n),((e,t)=>{const n=useGridLogger(e,"useGridPaginationModel"),o=useGridSelector(e,Gt),l=r.useRef(Xr(e)),i=Math.floor(t.rowHeight*o);e.current.registerControlState({stateId:"paginationModel",propModel:t.paginationModel,propOnChange:t.onPaginationModelChange,stateSelector:Mn,changeEvent:"paginationModelChange"});const a=r.useCallback(t=>{const r=Mn(e);t!==r.page&&(n.debug(`Setting page to ${t}`),e.current.setPaginationModel({page:t,pageSize:r.pageSize}))},[e,n]),s=r.useCallback(t=>{const r=Mn(e);t!==r.pageSize&&(n.debug(`Setting page size to ${t}`),e.current.setPaginationModel({pageSize:t,page:r.page}))},[e,n]),u=r.useCallback(r=>{const o=Mn(e);r!==o&&(n.debug("Setting 'paginationModel' to",r),e.current.setState(e=>et({},e,{pagination:et({},e.pagination,{paginationModel:getDerivedPaginationModel(e.pagination,t.signature,r)})}),"setPaginationModel"))},[e,n,t.signature]);useGridApiMethod(e,{setPage:a,setPageSize:s,setPaginationModel:u},"public");const c=r.useCallback((r,n)=>{const o=Mn(e);return!n.exportOnlyDirtyModels||null!=t.paginationModel||null!=t.initialState?.pagination?.paginationModel||0!==o.page&&o.pageSize!==(t.autoPageSize?0:100)?et({},r,{pagination:et({},r.pagination,{paginationModel:o})}):r},[e,t.paginationModel,t.initialState?.pagination?.paginationModel,t.autoPageSize]),d=r.useCallback((r,n)=>{const o=n.stateToRestore.pagination?.paginationModel?et({},getDefaultGridPaginationModel(t.autoPageSize),n.stateToRestore.pagination?.paginationModel):Mn(e);return e.current.setState(e=>et({},e,{pagination:et({},e.pagination,{paginationModel:getDerivedPaginationModel(e.pagination,t.signature,o)})}),"stateRestorePreProcessing"),r},[e,t.autoPageSize,t.signature]);useGridRegisterPipeProcessor(e,"exportState",c),useGridRegisterPipeProcessor(e,"restoreState",d);const p=r.useCallback(()=>{if(!t.autoPageSize)return;const r=e.current.getRootDimensions(),n=Math.max(1,Math.floor(r.viewportInnerSize.height/i));e.current.setPageSize(n)},[e,t.autoPageSize,i]),g=r.useCallback(t=>{if(null==t)return;const r=Mn(e);if(0===r.page)return;const n=Fn(e);r.page>n-1&&e.current.setPage(Math.max(0,n-1))},[e]),h=r.useCallback(()=>{0!==Mn(e).page&&e.current.setPage(0),0!==e.current.getScrollPosition().top&&e.current.scroll({top:0})},[e]),m=r.useCallback(t=>{const r=et({},t,{items:cn(e)});isDeepEqual(r,l.current)||(l.current=r,h())},[e,h]);Dt(e,"viewportInnerSizeChange",p),Dt(e,"paginationModelChange",()=>{const t=Mn(e);e.current.virtualScrollerRef?.current&&e.current.scrollToIndexes({rowIndex:t.page*t.pageSize})}),Dt(e,"rowCountChange",g),Dt(e,"sortModelChange",runIf(t.resetPageOnSortFilter,h)),Dt(e,"filterModelChange",runIf(t.resetPageOnSortFilter,m));const C=r.useRef(!0);r.useEffect(()=>{C.current?C.current=!1:t.pagination&&e.current.setState(e=>et({},e,{pagination:et({},e.pagination,{paginationModel:getDerivedPaginationModel(e.pagination,t.signature,t.paginationModel)})}))},[e,t.paginationModel,t.signature,t.pagination]),r.useEffect(()=>{e.current.setState(e=>{const r=!0===t.pagination;return e.pagination.paginationMode===t.paginationMode||e.pagination.enabled===r?e:et({},e,{pagination:et({},e.pagination,{paginationMode:t.paginationMode,enabled:!0===t.pagination})})})},[e,t.paginationMode,t.pagination]),r.useEffect(p,[p])})(e,n),((e,n)=>{const o=useGridLogger(e,"useGridRowCount"),l=useGridSelector(e,sn),i=useGridSelector(e,Pn),a=useGridSelector(e,kn),s=useGridSelector(e,Mn),u=t(()=>Mn(e).pageSize);e.current.registerControlState({stateId:"paginationRowCount",propModel:n.rowCount,propOnChange:n.onRowCountChange,stateSelector:Pn,changeEvent:"rowCountChange"});const c=r.useCallback(t=>{i!==t&&(o.debug("Setting 'rowCount' to",t),e.current.setState(e=>et({},e,{pagination:et({},e.pagination,{rowCount:t})})))},[e,o,i]);useGridApiMethod(e,{setRowCount:c},"public");const d=r.useCallback((t,r)=>{const o=Pn(e);return r.exportOnlyDirtyModels&&null==n.rowCount&&null==n.initialState?.pagination?.rowCount?t:et({},t,{pagination:et({},t.pagination,{rowCount:o})})},[e,n.rowCount,n.initialState?.pagination?.rowCount]),p=r.useCallback((t,r)=>{const n=r.stateToRestore.pagination?.rowCount?r.stateToRestore.pagination.rowCount:Pn(e);return e.current.setState(e=>et({},e,{pagination:et({},e.pagination,{rowCount:n})})),t},[e]);useGridRegisterPipeProcessor(e,"exportState",d),useGridRegisterPipeProcessor(e,"restoreState",p);const g=r.useCallback(t=>{"client"!==n.paginationMode&&u.current&&t.pageSize!==u.current&&(u.current=t.pageSize,-1===i&&e.current.setPage(0))},[n.paginationMode,u,i,e]);Dt(e,"paginationModelChange",g),r.useEffect(()=>{"client"===n.paginationMode?e.current.setRowCount(l):null!=n.rowCount&&e.current.setRowCount(n.rowCount)},[e,n.paginationMode,l,n.rowCount]);const h=!1===a.hasNextPage;r.useEffect(()=>{h&&-1===i&&e.current.setRowCount(s.pageSize*s.page+l)},[e,l,h,i,s])})(e,n)},preferencePanelStateInitializer=(e,t)=>et({},e,{preferencePanel:t.initialState?.preferencePanel??{open:!1}}),getDefaultCellValue=e=>{switch(e.type){case"boolean":return!1;case"date":case"dateTime":case"number":return;case"singleSelect":return null;default:return""}},Ea=["id","field"],Fa=["id","field"],Ga=["id"],Ha=["id"],editingStateInitializer=e=>et({},e,{editRows:{}}),useGridEditing=(e,t)=>{((e,t)=>{const[n,o]=r.useState({}),l=r.useRef(n),i=r.useRef({}),{processRowUpdate:s,onProcessRowUpdateError:u,cellModesModel:c,onCellModesModelChange:d}=t,runIfEditModeIsCell=e=>(...r)=>{t.editMode===Zt.Cell&&e(...r)},p=r.useCallback((t,r)=>{const n=e.current.getCellParams(t,r);if(!e.current.isCellEditable(n))throw new Error(`MUI X: The cell with id=${t} and field=${r} is not editable.`)},[e]),g=r.useCallback((t,r,n)=>{if(e.current.getCellMode(t,r)!==n)throw new Error(`MUI X: The cell with id=${t} and field=${r} is not in ${n} mode.`)},[e]),h=r.useCallback((t,r)=>{if(!t.isEditable)return;if(t.cellMode===er.Edit)return;const n=et({},t,{reason:nr.cellDoubleClick});e.current.publishEvent("cellEditStart",n,r)},[e]),m=r.useCallback((t,r)=>{if(t.cellMode===er.View)return;if(e.current.getCellMode(t.id,t.field)===er.View)return;const n=et({},t,{reason:or.cellFocusOut});e.current.publishEvent("cellEditStop",n,r)},[e]),C=r.useCallback((t,r)=>{if(t.cellMode===er.Edit){if(229===r.which)return;let n;if("Escape"===r.key?n=or.escapeKeyDown:"Enter"===r.key?n=or.enterKeyDown:"Tab"===r.key&&(n=r.shiftKey?or.shiftTabKeyDown:or.tabKeyDown,r.preventDefault()),n){const o=et({},t,{reason:n});e.current.publishEvent("cellEditStop",o,r)}}else if(t.isEditable){let n;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:r,cellParams:t,editMode:"cell"}))return;if(isPrintableKey(r)?n=nr.printableKeyDown:isPasteShortcut(r)?n=nr.pasteKeyDown:"Enter"===r.key?n=nr.enterKeyDown:"Backspace"!==r.key&&"Delete"!==r.key||(n=nr.deleteKeyDown),n){const o=et({},t,{reason:n,key:r.key});e.current.publishEvent("cellEditStart",o,r)}}},[e]),b=r.useCallback(t=>{const{id:r,field:n,reason:o}=t,l={id:r,field:n};o!==nr.printableKeyDown&&o!==nr.deleteKeyDown&&o!==nr.pasteKeyDown||(l.deleteValue=!0),e.current.startCellEditMode(l)},[e]),w=r.useCallback(t=>{const{id:r,field:n,reason:o}=t;let l;e.current.runPendingEditCellValueMutation(r,n),o===or.enterKeyDown?l="below":o===or.tabKeyDown?l="right":o===or.shiftTabKeyDown&&(l="left");const i="escapeKeyDown"===o;e.current.stopCellEditMode({id:r,field:n,ignoreModifications:i,cellToFocusAfter:l})},[e]);var v;Dt(e,"cellDoubleClick",runIfEditModeIsCell(h)),Dt(e,"cellFocusOut",runIfEditModeIsCell(m)),Dt(e,"cellKeyDown",runIfEditModeIsCell(C)),Dt(e,"cellEditStart",runIfEditModeIsCell(b)),Dt(e,"cellEditStop",runIfEditModeIsCell(w)),useGridApiOptionHandler(e,"cellEditStart",t.onCellEditStart),useGridApiOptionHandler(e,"cellEditStop",(v=t.onCellEditStop,async(...t)=>{if(v){const{id:r,field:n}=t[0],o=e.current.state.editRows,l=o[r][n]?.error;l||v(...t)}}));const x=r.useCallback((t,r)=>{const n=gridEditRowsStateSelector(e.current.state);return n[t]&&n[t][r]?er.Edit:er.View},[e]),R=M(r=>{const n=r!==t.cellModesModel;d&&n&&d(r,{api:e.current}),t.cellModesModel&&n||(o(r),l.current=r,e.current.publishEvent("cellModesModelChange",r))}),y=r.useCallback((e,t,r)=>{const n=et({},l.current);if(null!==r)n[e]=et({},n[e],{[t]:et({},r)});else{const r=n[e],o=tt(r,[t].map(ot));n[e]=o,0===Object.keys(n[e]).length&&delete n[e]}R(n)},[R]),S=r.useCallback((t,r,n)=>{e.current.setState(e=>{const o=et({},e.editRows);return null!==n?o[t]=et({},o[t],{[r]:et({},n)}):(delete o[t][r],0===Object.keys(o[t]).length&&delete o[t]),et({},e,{editRows:o})}),e.current.forceUpdate()},[e]),I=r.useCallback(e=>{const{id:t,field:r}=e,n=tt(e,Ea);p(t,r),g(t,r,er.View),y(t,r,et({mode:er.Edit},n))},[p,g,y]),P=M(async t=>{const{id:r,field:n,deleteValue:o,initialValue:l}=t,i=e.current.getCellValue(r,n);let a=i;o?a=getDefaultCellValue(e.current.getColumn(n)):l&&(a=l);const s=e.current.getColumn(n),u=!!s.preProcessEditCellProps&&o;let c={value:a,error:!1,isProcessingProps:u};if(S(r,n,c),e.current.setCellFocus(r,n),u&&(c=await Promise.resolve(s.preProcessEditCellProps({id:r,row:e.current.getRow(r),props:c,hasChanged:a!==i})),e.current.getCellMode(r,n)===er.Edit)){const t=gridEditRowsStateSelector(e.current.state);S(r,n,et({},c,{value:t[r][n].value,isProcessingProps:!1}))}}),k=r.useCallback(e=>{const{id:t,field:r}=e,n=tt(e,Fa);g(t,r,er.Edit),y(t,r,et({mode:er.View},n))},[g,y]),D=M(async t=>{const{id:r,field:n,ignoreModifications:o,cellToFocusAfter:l="none"}=t;g(r,n,er.Edit),e.current.runPendingEditCellValueMutation(r,n);const finishCellEditMode=()=>{S(r,n,null),y(r,n,null),"none"!==l&&e.current.moveFocusToRelativeCell(r,n,l)};if(o)return void finishCellEditMode();const a=gridEditRowsStateSelector(e.current.state),{error:c,isProcessingProps:d}=a[r][n];if(c||d)return i.current[r][n].mode=er.Edit,void y(r,n,{mode:er.Edit});const p=e.current.getRowWithUpdatedValuesFromCellEditing(r,n);if(s){const handleError=e=>{i.current[r][n].mode=er.Edit,y(r,n,{mode:er.Edit}),u&&u(e)};try{const t=e.current.getRow(r);Promise.resolve(s(p,t,{rowId:r})).then(t=>{e.current.updateRows([t]),finishCellEditMode()}).catch(handleError)}catch(h){handleError(h)}}else e.current.updateRows([p]),finishCellEditMode()}),E={setCellEditingEditCellValue:r.useCallback(async t=>{const{id:r,field:n,value:o,debounceMs:l,unstable_skipValueParser:i}=t;p(r,n),g(r,n,er.Edit);const a=e.current.getColumn(n),s=e.current.getRow(r);let u=o;a.valueParser&&!i&&(u=a.valueParser(o,s,a,e));let c=gridEditRowsStateSelector(e.current.state),d=et({},c[r][n],{value:u,changeReason:l?"debouncedSetEditCellValue":"setEditCellValue"});if(a.preProcessEditCellProps){const e=o!==c[r][n].value;d=et({},d,{isProcessingProps:!0}),S(r,n,d),d=await Promise.resolve(a.preProcessEditCellProps({id:r,row:s,props:d,hasChanged:e}))}return e.current.getCellMode(r,n)!==er.View&&(c=gridEditRowsStateSelector(e.current.state),d=et({},d,{isProcessingProps:!1}),d.value=a.preProcessEditCellProps?c[r][n].value:u,S(r,n,d),c=gridEditRowsStateSelector(e.current.state),!c[r]?.[n]?.error)},[e,p,g,S]),getRowWithUpdatedValuesFromCellEditing:r.useCallback((t,r)=>{const n=e.current.getColumn(r),o=gridEditRowsStateSelector(e.current.state),l=e.current.getRow(t);if(!o[t]||!o[t][r])return e.current.getRow(t);const{value:i}=o[t][r];return n.valueSetter?n.valueSetter(i,l,n,e):et({},l,{[r]:i})},[e])};useGridApiMethod(e,{getCellMode:x,startCellEditMode:I,stopCellEditMode:k},"public"),useGridApiMethod(e,E,"private"),r.useEffect(()=>{c&&R(c)},[c,R]),a(()=>{const t=$t(e),r=i.current;i.current=deepClone(n),Object.entries(n).forEach(([n,o])=>{Object.entries(o).forEach(([o,l])=>{const i=r[n]?.[o]?.mode||er.View,a=t[n]?e.current.getRowId(t[n]):n;l.mode===er.Edit&&i===er.View?P(et({id:a,field:o},l)):l.mode===er.View&&i===er.Edit&&D(et({id:a,field:o},l))})})},[e,n,P,D])})(e,t),((e,t)=>{const[n,o]=r.useState({}),l=r.useRef(n),i=r.useRef({}),s=r.useRef({}),u=r.useRef(void 0),c=r.useRef(null),{processRowUpdate:d,onProcessRowUpdateError:p,rowModesModel:g,onRowModesModelChange:h}=t,runIfEditModeIsRow=e=>(...r)=>{t.editMode===Zt.Row&&e(...r)},m=r.useCallback((t,r)=>{const n=e.current.getCellParams(t,r);if(!e.current.isCellEditable(n))throw new Error(`MUI X: The cell with id=${t} and field=${r} is not editable.`)},[e]),C=r.useCallback((t,r)=>{if(e.current.getRowMode(t)!==r)throw new Error(`MUI X: The row with id=${t} is not in ${r} mode.`)},[e]),b=r.useCallback(t=>{const r=gridEditRowsStateSelector(e.current.state);return Object.values(r[t]).some(e=>e.error)},[e]),w=r.useCallback((t,r)=>{if(!t.isEditable)return;if(e.current.getRowMode(t.id)===tr.Edit)return;const n=e.current.getRowParams(t.id),o=et({},n,{field:t.field,reason:lr.cellDoubleClick});e.current.publishEvent("rowEditStart",o,r)},[e]),v=r.useCallback(e=>{c.current=e},[]),x=r.useCallback((t,r)=>{t.isEditable&&e.current.getRowMode(t.id)!==tr.View&&(c.current=null,u.current=setTimeout(()=>{if(c.current?.id!==t.id){if(!e.current.getRow(t.id))return;if(e.current.getRowMode(t.id)===tr.View)return;if(b(t.id))return;const n=e.current.getRowParams(t.id),o=et({},n,{field:t.field,reason:ir.rowFocusOut});e.current.publishEvent("rowEditStop",o,r)}}))},[e,b]);r.useEffect(()=>()=>{clearTimeout(u.current)},[]);const R=r.useCallback((t,r)=>{if(t.cellMode===tr.Edit){if(229===r.which)return;let n;if("Escape"===r.key)n=ir.escapeKeyDown;else if("Enter"===r.key)n=ir.enterKeyDown;else if("Tab"===r.key){const o=hr(e).filter(r=>e.current.getColumn(r).type===Dr||e.current.isCellEditable(e.current.getCellParams(t.id,r)));if(r.shiftKey?t.field===o[0]&&(n=ir.shiftTabKeyDown):t.field===o[o.length-1]&&(n=ir.tabKeyDown),r.preventDefault(),!n){const n=o.findIndex(e=>e===t.field),l=o[r.shiftKey?n-1:n+1];e.current.setCellFocus(t.id,l)}}if(n){if(n!==ir.escapeKeyDown&&b(t.id))return;const o=et({},e.current.getRowParams(t.id),{reason:n,field:t.field});e.current.publishEvent("rowEditStop",o,r)}}else if(t.isEditable){let n;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:r,cellParams:t,editMode:"row"}))return;if(isPrintableKey(r)||isPasteShortcut(r)?n=lr.printableKeyDown:"Enter"===r.key?n=lr.enterKeyDown:"Backspace"!==r.key&&"Delete"!==r.key||(n=lr.deleteKeyDown),n){const o=e.current.getRowParams(t.id),l=et({},o,{field:t.field,reason:n});e.current.publishEvent("rowEditStart",l,r)}}},[e,b]),y=r.useCallback(t=>{const{id:r,field:n,reason:o}=t,l={id:r,fieldToFocus:n};o!==lr.printableKeyDown&&o!==lr.deleteKeyDown||(l.deleteValue=!!n),e.current.startRowEditMode(l)},[e]),S=r.useCallback(t=>{const{id:r,reason:n,field:o}=t;let l;e.current.runPendingEditCellValueMutation(r),n===ir.enterKeyDown?l="below":n===ir.tabKeyDown?l="right":n===ir.shiftTabKeyDown&&(l="left");const i="escapeKeyDown"===n;e.current.stopRowEditMode({id:r,ignoreModifications:i,field:o,cellToFocusAfter:l})},[e]);Dt(e,"cellDoubleClick",runIfEditModeIsRow(w)),Dt(e,"cellFocusIn",runIfEditModeIsRow(v)),Dt(e,"cellFocusOut",runIfEditModeIsRow(x)),Dt(e,"cellKeyDown",runIfEditModeIsRow(R)),Dt(e,"rowEditStart",runIfEditModeIsRow(y)),Dt(e,"rowEditStop",runIfEditModeIsRow(S)),useGridApiOptionHandler(e,"rowEditStart",t.onRowEditStart),useGridApiOptionHandler(e,"rowEditStop",t.onRowEditStop);const I=r.useCallback(r=>Zo(e,{rowId:r,editMode:t.editMode})?tr.Edit:tr.View,[e,t.editMode]),P=M(r=>{const n=r!==t.rowModesModel;h&&n&&h(r,{api:e.current}),t.rowModesModel&&n||(o(r),l.current=r,e.current.publishEvent("rowModesModelChange",r))}),k=r.useCallback((e,t)=>{const r=et({},l.current);null!==t?r[e]=et({},t):delete r[e],P(r)},[P]),D=r.useCallback((t,r)=>{e.current.setState(e=>{const n=et({},e.editRows);return null!==r?n[t]=r:delete n[t],et({},e,{editRows:n})}),e.current.forceUpdate()},[e]),E=r.useCallback((t,r,n)=>{e.current.setState(e=>{const o=et({},e.editRows);return null!==n?o[t]=et({},o[t],{[r]:et({},n)}):(delete o[t][r],0===Object.keys(o[t]).length&&delete o[t]),et({},e,{editRows:o})}),e.current.forceUpdate()},[e]),F=r.useCallback(e=>{const{id:t}=e,r=tt(e,Ga);C(t,tr.View),k(t,et({mode:tr.Edit},r))},[C,k]),G=M(t=>{const{id:r,fieldToFocus:n,deleteValue:o,initialValue:l}=t,i=e.current.getRow(r),a=pr(e),u=a.reduce((t,i)=>{const a=i.field;if(!e.current.getCellParams(r,a).isEditable)return t;const s=e.current.getColumn(a);let u=e.current.getCellValue(r,a);return n===a&&(o||l)&&(o?u=getDefaultCellValue(s):l&&(u=l)),t[a]={value:u,error:!1,isProcessingProps:s.editable&&!!s.preProcessEditCellProps&&o},t},{});s.current[r]=i,D(r,u),n&&e.current.setCellFocus(r,n),a.filter(t=>e.current.getCellParams(r,t.field).isEditable&&t.editable&&!!t.preProcessEditCellProps&&o).forEach(t=>{const n=t.field,a=e.current.getCellValue(r,n),s=o?getDefaultCellValue(t):l??a;Promise.resolve(t.preProcessEditCellProps({id:r,row:i,props:u[n],hasChanged:s!==a})).then(t=>{if(e.current.getRowMode(r)===tr.Edit){const o=gridEditRowsStateSelector(e.current.state);E(r,n,et({},t,{value:o[r][n].value,isProcessingProps:!1}))}})})}),H=r.useCallback(e=>{const{id:t}=e,r=tt(e,Ha);C(t,tr.Edit),k(t,et({mode:tr.View},r))},[C,k]),T=M(t=>{const{id:r,ignoreModifications:n,field:o,cellToFocusAfter:l="none"}=t;e.current.runPendingEditCellValueMutation(r);const finishRowEditMode=()=>{"none"!==l&&o&&e.current.moveFocusToRelativeCell(r,o,l),D(r,null),k(r,null),delete s.current[r]};if(n)return void finishRowEditMode();const a=gridEditRowsStateSelector(e.current.state),u=s.current[r];if(Object.values(a[r]).some(e=>e.isProcessingProps))return void(i.current[r].mode=tr.Edit);if(b(r))return i.current[r].mode=tr.Edit,void k(r,{mode:tr.Edit});const c=e.current.getRowWithUpdatedValuesFromRowEditing(r);if(d){const handleError=e=>{i.current[r]&&(i.current[r].mode=tr.Edit,k(r,{mode:tr.Edit})),p&&p(e)};try{Promise.resolve(d(c,u,{rowId:r})).then(t=>{e.current.updateRows([t]),finishRowEditMode()}).catch(handleError)}catch(g){handleError(g)}}else e.current.updateRows([c]),finishRowEditMode()}),O={setRowEditingEditCellValue:r.useCallback(t=>{const{id:r,field:n,value:o,debounceMs:l,unstable_skipValueParser:i}=t;m(r,n);const a=e.current.getColumn(n),s=e.current.getRow(r);let u=o;a.valueParser&&!i&&(u=a.valueParser(o,s,a,e));let c=gridEditRowsStateSelector(e.current.state),d=et({},c[r][n],{value:u,changeReason:l?"debouncedSetEditCellValue":"setEditCellValue"});return a.preProcessEditCellProps||E(r,n,d),new Promise(t=>{const o=[];if(a.preProcessEditCellProps){const l=d.value!==c[r][n].value;d=et({},d,{isProcessingProps:!0}),E(r,n,d);const i=c[r],p=tt(i,[n].map(ot)),g=Promise.resolve(a.preProcessEditCellProps({id:r,row:s,props:d,hasChanged:l,otherFieldsProps:p})).then(o=>{e.current.getRowMode(r)!==tr.View?(c=gridEditRowsStateSelector(e.current.state),(o=et({},o,{isProcessingProps:!1})).value=a.preProcessEditCellProps?c[r][n].value:u,E(r,n,o)):t(!1)});o.push(g)}Object.entries(c[r]).forEach(([l,i])=>{if(l===n)return;const a=e.current.getColumn(l);if(!a.preProcessEditCellProps)return;i=et({},i,{isProcessingProps:!0}),E(r,l,i),c=gridEditRowsStateSelector(e.current.state);const u=c[r],d=tt(u,[l].map(ot)),p=Promise.resolve(a.preProcessEditCellProps({id:r,row:s,props:i,hasChanged:!1,otherFieldsProps:d})).then(n=>{e.current.getRowMode(r)!==tr.View?(n=et({},n,{isProcessingProps:!1}),E(r,l,n)):t(!1)});o.push(p)}),Promise.all(o).then(()=>{e.current.getRowMode(r)===tr.Edit?(c=gridEditRowsStateSelector(e.current.state),t(!c[r][n].error)):t(!1)})})},[e,m,E]),getRowWithUpdatedValuesFromRowEditing:r.useCallback(t=>{const r=gridEditRowsStateSelector(e.current.state),n=e.current.getRow(t);if(!r[t])return e.current.getRow(t);let o=et({},s.current[t],n);return Object.entries(r[t]).forEach(([t,r])=>{const n=e.current.getColumn(t);n?.valueSetter?o=n.valueSetter(r.value,o,n,e):o[t]=r.value}),o},[e])};useGridApiMethod(e,{getRowMode:I,startRowEditMode:F,stopRowEditMode:H},"public"),useGridApiMethod(e,O,"private"),r.useEffect(()=>{g&&P(g)},[g,P]),a(()=>{const t=$t(e),r=i.current;i.current=deepClone(n);const o=new Set([...Object.keys(n),...Object.keys(r)]);Array.from(o).forEach(o=>{const l=n[o]??{mode:tr.View},i=r[o]?.mode||tr.View,a=t[o]?e.current.getRowId(t[o]):o;l.mode===tr.Edit&&i===tr.View?G(et({id:a},l)):l.mode===tr.View&&i===tr.Edit&&T(et({id:a},l))})},[e,n,G,T])})(e,t);const n=r.useRef({}),{isCellEditable:o}=t,l=r.useCallback(e=>!isAutogeneratedRowNode(e.rowNode)&&(!!e.colDef.editable&&(!!e.colDef.renderEditCell&&(!o||o(e)))),[o]);r.useEffect(()=>{const e=n.current;return()=>{Object.entries(e).forEach(([t,r])=>{Object.keys(r).forEach(r=>{const[n]=e[t][r];clearTimeout(n),delete e[t][r]})})}},[]);const i=r.useCallback((e,t)=>{if(n.current[e])if(t){if(n.current[e][t]){const[,r]=n.current[e][t];r()}}else Object.keys(n.current[e]).forEach(t=>{const[,r]=n.current[e][t];r()})},[]),s=r.useCallback(r=>{const{id:o,field:l,debounceMs:i}=r;return new Promise(a=>{((e,t,r,o)=>{if(!r)return void o();if(n.current[e]||(n.current[e]={}),n.current[e][t]){const[r]=n.current[e][t];clearTimeout(r)}const l=setTimeout(()=>{o(),delete n.current[e][t]},r);n.current[e][t]=[l,()=>{const[r]=n.current[e][t];clearTimeout(r),o(),delete n.current[e][t]}]})(o,l,i,async()=>{const n=t.editMode===Zt.Row?e.current.setRowEditingEditCellValue:e.current.setCellEditingEditCellValue;if(e.current.getCellMode(o,l)===er.Edit){const e=await n(r);a(e)}})})},[e,t.editMode]),u=r.useCallback((r,n)=>t.editMode===Zt.Cell?e.current.getRowWithUpdatedValuesFromCellEditing(r,n):e.current.getRowWithUpdatedValuesFromRowEditing(r),[e,t.editMode]),c=r.useCallback((t,r)=>{const n=gridEditRowsStateSelector(e.current.state);return n[t]?.[r]??null},[e]),d={runPendingEditCellValueMutation:i};useGridApiMethod(e,{isCellEditable:l,setEditCellValue:s,getRowWithUpdatedValues:u,unstable_getEditCellMeta:c},"public"),useGridApiMethod(e,d,"private")},rowsStateInitializer=(e,t,r)=>{const n=!!t.unstable_dataSource;return r.current.caches.rows=createRowsInternalCache({rows:n?[]:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),et({},e,{rows:getRowsStateFromCache({apiRef:r,rowCountProp:t.rowCount,loadingProp:!!n||t.loading,previousTree:null,previousTreeDepths:null})})},flatRowTreeCreationMethod=e=>"full"===e.updates.type?(e=>{const t={[Fr]:et({},buildRootGroup(),{children:e})};for(let r=0;r<e.length;r+=1){const n=e[r];t[n]={id:n,depth:0,parent:Fr,type:"leaf",groupingKey:null}}return{groupingName:Pa,tree:t,treeDepths:{0:e.length},dataRowIds:e}})(e.updates.rows):(({previousTree:e,actions:t})=>{const r=et({},e),n={};for(let i=0;i<t.remove.length;i+=1){const e=t.remove[i];n[e]=!0,delete r[e]}for(let i=0;i<t.insert.length;i+=1){const e=t.insert[i];r[e]={id:e,depth:0,parent:Fr,type:"leaf",groupingKey:null}}const o=r[Fr];let l=[...o.children,...t.insert];return Object.values(n).length&&(l=l.filter(e=>!n[e])),r[Fr]=et({},o,{children:l}),{groupingName:Pa,tree:r,treeDepths:{0:l.length},dataRowIds:l}})({previousTree:e.previousTree,actions:e.updates.actions});class MissingRowIdError extends Error{}function useGridParamsApi(e,t){const n=r.useCallback(t=>({field:t,colDef:e.current.getColumn(t)}),[e]),o=r.useCallback(t=>{const r=e.current.getRow(t);if(!r)throw new MissingRowIdError(`No row with id #${t} found`);return{id:t,columns:e.current.getAllColumns(),row:r}},[e]),l=r.useCallback((t,r,n,{cellMode:o,colDef:l,hasFocus:i,rowNode:a,tabIndex:s})=>{const u=n[r],c=l?.valueGetter?l.valueGetter(u,n,l,e):u,d={id:t,field:r,row:n,rowNode:a,colDef:l,cellMode:o,hasFocus:i,tabIndex:s,value:c,formattedValue:c,isEditable:!1,api:e.current};return l&&l.valueFormatter&&(d.formattedValue=l.valueFormatter(c,n,l,e)),d.isEditable=l&&e.current.isCellEditable(d),d},[e]),i=r.useCallback((r,n)=>{const o=e.current.getRow(r),l=e.current.getRowNode(r);if(!o||!l)throw new MissingRowIdError(`No row with id #${r} found`);const i=Cn(e),a=xn(e),s=e.current.getCellMode(r,n);return e.current.getCellParamsForRow(r,n,o,{colDef:t.unstable_listView&&t.unstable_listColumn?.field===n?gridListColumnSelector(e.current.state):e.current.getColumn(n),rowNode:l,hasFocus:null!==i&&i.field===n&&i.id===r,tabIndex:a&&a.field===n&&a.id===r?0:-1,cellMode:s})},[e,t.unstable_listView,t.unstable_listColumn?.field]),a=r.useCallback((t,r)=>{const n=e.current.getColumn(r),o=e.current.getRow(t);if(!o)throw new MissingRowIdError(`No row with id #${t} found`);return n&&n.valueGetter?n.valueGetter(o[n.field],o,n,e):o[r]},[e]),s=r.useCallback((t,r)=>{const n=r.field;if(!r||!r.valueGetter)return t[n];const o=t[r.field];return r.valueGetter(o,t,r,e)},[e]),u=r.useCallback((t,r)=>{const n=s(t,r);return r&&r.valueFormatter?r.valueFormatter(n,t,r,e):n},[e,s]),c=r.useCallback(t=>e.current.rootElementRef.current?function getGridColumnHeaderElement(e,t){return e.querySelector(`[role="columnheader"][data-field="${escapeOperandAttributeSelector(t)}"]`)}(e.current.rootElementRef.current,t):null,[e]),d=r.useCallback(t=>e.current.rootElementRef.current?function getGridRowElement(e,t){return e.querySelector(getGridRowElementSelector(t))}(e.current.rootElementRef.current,t):null,[e]),p=r.useCallback((t,r)=>e.current.rootElementRef.current?function getGridCellElement(e,{id:t,field:r}){const n=`${getGridRowElementSelector(t)} .${Mt.cell}[data-field="${escapeOperandAttributeSelector(r)}"]`;return e.querySelector(n)}(e.current.rootElementRef.current,{id:t,field:r}):null,[e]),g={getCellParamsForRow:l};useGridApiMethod(e,{getCellValue:a,getCellParams:i,getCellElement:p,getRowValue:s,getRowFormattedValue:u,getRowParams:o,getRowElement:d,getColumnHeaderParams:n,getColumnHeaderElement:c},"public"),useGridApiMethod(e,g,"private")}const getSelectionModelPropValue=(e,t)=>null==e||Array.isArray(e)?e:t&&t[0]===e?t:[e],rowSelectionStateInitializer=(e,t)=>et({},e,{rowSelection:t.rowSelection?getSelectionModelPropValue(t.rowSelectionModel)??[]:[]}),useGridRowSelection=(e,t)=>{const n=useGridLogger(e,"useGridSelection"),o=r.useCallback(e=>(...r)=>{t.rowSelection&&e(...r)},[t.rowSelection]),l=t.signature!==kt.DataGrid&&(t.rowSelectionPropagation?.parents||t.rowSelectionPropagation?.descendants),i=r.useMemo(()=>getSelectionModelPropValue(t.rowSelectionModel,gridRowSelectionStateSelector(e.current.state)),[e,t.rowSelectionModel]),a=r.useRef(null);e.current.registerControlState({stateId:"rowSelection",propModel:i,propOnChange:t.onRowSelectionModelChange,stateSelector:gridRowSelectionStateSelector,changeEvent:"rowSelectionChange"});const{checkboxSelection:s,disableRowSelectionOnClick:u,isRowSelectable:c}=t,d=isMultipleRowSelectionEnabled(t),p=useGridSelector(e,Vt),g=useGridSelector(e,Wt)>1,h=r.useCallback(t=>{let r=t;const n=a.current??t,o=e.current.isRowSelected(t);if(o){const t=tn(e),o=t.findIndex(e=>e===n),l=t.findIndex(e=>e===r);if(o===l)return;r=o>l?t[l+1]:t[l-1]}a.current=t,e.current.selectRowRange({startId:n,endId:r},!o)},[e]),m=r.useCallback(r=>{if(t.signature===kt.DataGrid&&!d&&Array.isArray(r)&&r.length>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"));gridRowSelectionStateSelector(e.current.state)!==r&&(n.debug("Setting selection model"),e.current.setState(e=>et({},e,{rowSelection:t.rowSelection?r:[]})),e.current.forceUpdate())},[e,n,t.rowSelection,t.signature,d]),C=r.useCallback(t=>gridRowSelectionStateSelector(e.current.state).includes(t),[e]),b=r.useCallback(r=>{if(!1===t.rowSelection)return!1;if(c&&!c(e.current.getRowParams(r)))return!1;const n=Vt(e)[r];return"footer"!==n?.type&&"pinnedRow"!==n?.type},[e,t.rowSelection,c]),w=r.useCallback(()=>gn(e),[e]),v=r.useCallback((r,o=!0,i=!1)=>{if(e.current.isRowSelectable(r))if(a.current=r,i){n.debug(`Setting selection for row ${r}`);const i=[],addRow=e=>{i.push(e)};o&&(addRow(r),l&&findRowsToSelect(e,p,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,addRow)),e.current.setRowSelectionModel(i)}else{n.debug(`Toggling selection for row ${r}`);const i=gridRowSelectionStateSelector(e.current.state),a=new Set(i);a.delete(r);const addRow=e=>{a.add(e)},removeRow=e=>{a.delete(e)};o?(addRow(r),l&&findRowsToSelect(e,p,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,addRow)):l&&findRowsToDeselect(e,p,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,removeRow);(a.size<2||d)&&e.current.setRowSelectionModel(Array.from(a))}},[e,n,l,p,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents,d]),x=r.useCallback((r,o=!0,i=!1)=>{n.debug("Setting selection for several rows");const a=r.filter(t=>e.current.isRowSelectable(t));let s;if(i){if(o){if(s=new Set(a),l){const addRow=e=>{s.add(e)};a.forEach(r=>{findRowsToSelect(e,p,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,addRow)})}}else s=new Set;const r=fn(e);if(s.size===Object.keys(r).length&&Array.from(s).every(e=>r[e]===e))return}else{s=new Set(Object.values(fn(e)));const addRow=e=>{s.add(e)},removeRow=e=>{s.delete(e)};a.forEach(r=>{o?(s.add(r),l&&findRowsToSelect(e,p,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,addRow)):(removeRow(r),l&&findRowsToDeselect(e,p,r,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,removeRow))})}(s.size<2||d)&&e.current.setRowSelectionModel(Array.from(s))},[n,l,d,e,p,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents]),R=r.useCallback(r=>{if(!g||!l||0===r.length)return r;const n=new Set(r),addRow=e=>{n.add(e)};for(const o of r)findRowsToSelect(e,p,o,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,addRow,n);return Array.from(n)},[e,p,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents,g,l]),y=r.useCallback(({startId:t,endId:r},o=!0,l=!1)=>{if(!e.current.getRow(t)||!e.current.getRow(r))return;n.debug(`Expanding selection from row ${t} to row ${r}`);const i=tn(e),a=i.indexOf(t),s=i.indexOf(r),[u,c]=a>s?[s,a]:[a,s],d=i.slice(u,c+1);e.current.selectRows(d,o,l)},[e,n]),S={selectRows:x,selectRowRange:y,getPropagatedRowSelectionModel:R};useGridApiMethod(e,{selectRow:v,setRowSelectionModel:m,getSelectedRows:w,isRowSelected:C,isRowSelectable:b},"public"),useGridApiMethod(e,S,t.signature===kt.DataGrid?"private":"public");const I=r.useRef(!0),P=r.useCallback((r=!1)=>{if(I.current)return;const n=gridRowSelectionStateSelector(e.current.state),o=$t(e),l=Qr(e),i=et({},fn(e));let a=!1;n.forEach(e=>{if((e=>"server"===t.filterMode?!o[e]:!o[e]||!1===l[e])(e)){if(t.keepNonExistentRowsSelected)return;return delete i[e],void(a=!0)}if(!t.rowSelectionPropagation?.parents)return;const r=p[e];if("group"===r.type){if(r.isAutoGenerated)return delete i[e],void(a=!0);r.children.every(e=>!1===l[e])||(delete i[e],a=!0)}});const s=g&&t.rowSelectionPropagation?.parents&&Object.keys(i).length>0;if(a||s&&!r){const t=Object.values(i);s?e.current.selectRows(t,!0,!0):e.current.setRowSelectionModel(t)}},[e,g,t.rowSelectionPropagation?.parents,t.keepNonExistentRowsSelected,t.filterMode,p]),k=r.useCallback((t,r)=>{const n=r.metaKey||r.ctrlKey,o=!s&&!n&&!(e=>!!e.key)(r),l=!d||o,i=e.current.isRowSelected(t);l?e.current.selectRow(t,!!o||!i,!0):e.current.selectRow(t,!i,!1)},[e,d,s]),D=r.useCallback((t,r)=>{if(u)return;const n=r.target.closest(`.${Mt.cell}`)?.getAttribute("data-field");if(n===$n.field)return;if(n===Lr)return;if(n){const t=e.current.getColumn(n);if(t?.type===Dr)return}"pinnedRow"!==Vt(e)[t.id].type&&(r.shiftKey&&d?h(t.id):k(t.id,r))},[u,d,e,h,k]),E=r.useCallback((e,t)=>{d&&t.shiftKey&&window.getSelection()?.removeAllRanges()},[d]),F=r.useCallback((t,r)=>{d&&r.nativeEvent.shiftKey?h(t.id):e.current.selectRow(t.id,t.value,!d)},[e,h,d]),G=r.useCallback(r=>{const n=t.pagination&&t.checkboxSelectionVisibleOnly&&"client"===t.paginationMode?Tn(e):tn(e);e.current.selectRows(n,r.value)},[e,t.checkboxSelectionVisibleOnly,t.pagination,t.paginationMode]),H=r.useCallback((t,r)=>{if(e.current.getCellMode(t.id,t.field)!==er.Edit&&!isEventTargetInPortal(r)){if(isNavigationKey(r.key)&&r.shiftKey){const n=Cn(e);if(n&&n.id!==t.id){r.preventDefault();const o=e.current.isRowSelected(n.id);if(!d)return void e.current.selectRow(n.id,!o,!0);const l=e.current.getRowIndexRelativeToVisibleRows(n.id),i=e.current.getRowIndexRelativeToVisibleRows(t.id);let a,s;l>i?o?(a=i,s=l-1):(a=i,s=l):o?(a=l+1,s=i):(a=l,s=i);const u=getVisibleRows(e).rows.slice(a,s+1).map(e=>e.id);return void e.current.selectRows(u,!o)}}if(" "===r.key&&r.shiftKey)return r.preventDefault(),void k(t.id,r);"A"===String.fromCharCode(r.keyCode)&&(r.ctrlKey||r.metaKey)&&(r.preventDefault(),x(e.current.getAllRowIds(),!0))}},[e,k,x,d]),T=M(()=>{if(!t.rowSelection)return void e.current.setRowSelectionModel([]);if(void 0===i)return;if(!l||!g||0===i.length)return void e.current.setRowSelectionModel(i);const r=e.current.getPropagatedRowSelectionModel(i);r.length===i.length&&r.every(e=>i.includes(e))?e.current.setRowSelectionModel(i):e.current.setRowSelectionModel(r)});Dt(e,"sortedRowsSet",o(()=>P(!0))),Dt(e,"filteredRowsSet",o(()=>P())),Dt(e,"rowClick",o(D)),Dt(e,"rowSelectionCheckboxChange",o(F)),Dt(e,"headerSelectionCheckboxChange",G),Dt(e,"cellMouseDown",o(E)),Dt(e,"cellKeyDown",o(H)),r.useEffect(()=>{T()},[e,i,t.rowSelection,T]);const O=null!=i;r.useEffect(()=>{if(O||!t.rowSelection)return;const r=gridRowSelectionStateSelector(e.current.state);if(b){const t=r.filter(e=>b(e));t.length<r.length&&e.current.setRowSelectionModel(t)}},[e,b,O,t.rowSelection]),r.useEffect(()=>{if(!t.rowSelection||O)return;const r=gridRowSelectionStateSelector(e.current.state);!d&&r.length>1&&e.current.setRowSelectionModel([])},[e,d,s,O,t.rowSelection]),r.useEffect(()=>{o(P)},[P,o]),r.useEffect(()=>{I.current&&(I.current=!1)},[])},useGridRowSelectionPreProcessors=(e,t)=>{const n=(e=>{const{classes:t}=e;return r.useMemo(()=>s({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},getDataGridUtilityClass,t),[t])})({classes:t.classes}),o=r.useCallback(r=>{const o=et({},$n,{cellClassName:n.cellCheckbox,headerClassName:n.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),l=t.checkboxSelection,i=null!=r.lookup[jn];return l&&!i?(r.lookup[jn]=o,r.orderedFields=[jn,...r.orderedFields]):!l&&i?(delete r.lookup[jn],r.orderedFields=r.orderedFields.filter(e=>e!==jn)):l&&i&&(r.lookup[jn]=et({},o,r.lookup[jn]),t.columns.some(e=>e.field===jn)||(r.orderedFields=[jn,...r.orderedFields.filter(e=>e!==jn)])),r},[e,n,t.columns,t.checkboxSelection]);useGridRegisterPipeProcessor(e,"hydrateColumns",o)},sortingStateInitializer=(e,t)=>{const r=t.sortModel??t.initialState?.sorting?.sortModel??[];return et({},e,{sorting:{sortModel:sanitizeSortModel(r,t.disableMultipleColumnsSorting),sortedRows:[]}})};function scrollIntoView(e){const{containerSize:t,scrollPosition:r,elementSize:n,elementOffset:o}=e,l=o+n;return n>t?o:l-t>r?l-t:o<r?o:void 0}const Ta={autoHeight:!1,autoPageSize:!1,autosizeOnMount:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,clipboardCopyCellDelimiter:"\t",columnBufferPx: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,disableVirtualization:!1,editMode:Zt.Cell,filterDebounceMs:150,filterMode:"client",hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,ignoreValueFormatterDuringExport:!1,indeterminateCheckboxAction:"deselect",keepColumnPositionIfDraggedOutside:!1,keepNonExistentRowsSelected:!1,loading:!1,logger:console,logLevel:"error",pageSizeOptions:[25,50,100],pagination:!1,paginationMode:"client",resetPageOnSortFilter:!1,resizeThrottleMs:60,rowBufferPx:150,rowHeight:52,rowPositionsDebounceMs:166,rows:[],rowSelection:!0,rowSpacingType:"margin",showCellVerticalBorder:!1,showColumnVerticalBorder:!1,sortingMode:"client",sortingOrder:["asc","desc",null],throttleRowsMs:0,unstable_rowSpanning:!1,virtualizeColumnsWithAutoRowHeight:!1},Oa={width:0,height:0},La={isReady:!1,root:Oa,viewportOuterSize:Oa,viewportInnerSize:Oa,contentSize:Oa,minimumSize:Oa,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},dimensionsStateInitializer=(e,t,r)=>{const n=La,o=Gt(r);return et({},e,{dimensions:et({},n,getStaticDimensions(t,r,o,Cr(r)))})},Aa=createSelector(fr,br,(e,t)=>{const r=e.length;return 0===r?0:roundToDecimalPlaces(t[r-1]+e[r-1].computedWidth,1)});function useGridDimensions(e,t){const n=useGridLogger(e,"useResizeContainer"),o=r.useRef(!1),l=r.useRef(Oa),i=useGridSelector(e,Cr),s=useGridSelector(e,Gt),u=useGridSelector(e,Aa),c=r.useRef(!0),{rowHeight:d,headerHeight:p,groupHeaderHeight:g,headerFilterHeight:h,headersTotalHeight:m,leftPinnedWidth:C,rightPinnedWidth:b}=getStaticDimensions(t,e,s,i),w=r.useRef(void 0),v=r.useCallback(()=>gridDimensionsSelector(e.current.state),[e]),x=r.useCallback(t=>{e.current.setState(e=>et({},e,{dimensions:t})),e.current.rootElementRef.current&&setCSSVariables(e.current.rootElementRef.current,gridDimensionsSelector(e.current.state))},[e]),R=r.useCallback(()=>{const t=e.current.mainElementRef.current;if(!t)return;const r=Y(t).getComputedStyle(t),n={width:parseFloat(r.width)||0,height:parseFloat(r.height)||0};w.current&&areElementSizesEqual(w.current,n)||(e.current.publishEvent("resize",n),w.current=n)},[e]),y=r.useCallback(()=>{const r=gridDimensionsSelector(e.current.state);if(!r.isReady)return 0;const n=getVisibleRows(e);if(t.getRowHeight){const t=xo(e),r=t.lastRowIndex-t.firstRowIndex;return Math.min(r-1,n.rows.length)}const o=Math.floor(r.viewportInnerSize.height/d);return Math.min(o,n.rows.length)},[e,t.getRowHeight,d]),S=r.useCallback(()=>{if(c.current)return;const r=function measureScrollbarSize(e,t){if(void 0!==t)return t;if(null===e)return 0;const r=ja.get(e);if(void 0!==r)return r;const n=E(e).createElement("div");n.style.width="99px",n.style.height="99px",n.style.position="absolute",n.style.overflow="scroll",n.className="scrollDiv",e.appendChild(n);const o=n.offsetWidth-n.clientWidth;return e.removeChild(n),ja.set(e,o),o}(e.current.mainElementRef.current,t.scrollbarSize),n=gridRowsMetaSelector(e.current.state),o=m+n.pinnedTopRowsTotalHeight,i=n.pinnedBottomRowsTotalHeight,a={width:u-C-b,height:roundToDecimalPlaces(n.currentPageTotalHeight,1)};let s,w,v=!1,R=!1;if(t.autoHeight)R=!1,v=Math.round(u)>Math.round(l.current.width),s={width:l.current.width,height:o+i+a.height},w={width:Math.max(0,s.width-(R?r:0)),height:Math.max(0,s.height-(v?r:0))};else{s={width:l.current.width,height:l.current.height},w={width:Math.max(0,s.width-C-b),height:Math.max(0,s.height-o-i)};const e=a,t=w,n=e.width>t.width,u=e.height>t.height;(n||u)&&(R=u,v=e.width+(R?r:0)>t.width,v&&(R=e.height+r>t.height)),R&&(w.width-=r),v&&(w.height-=r)}const y=Math.max(s.width,u+(R?r:0)),S={width:u,height:o+a.height+i},I={isReady:!0,root:l.current,viewportOuterSize:s,viewportInnerSize:w,contentSize:a,minimumSize:S,hasScrollX:v,hasScrollY:R,scrollbarSize:r,headerHeight:p,groupHeaderHeight:g,headerFilterHeight:h,rowWidth:y,rowHeight:d,columnsTotalWidth:u,leftPinnedWidth:C,rightPinnedWidth:b,headersTotalHeight:m,topContainerHeight:o,bottomContainerHeight:i},M=e.current.state.dimensions;isDeepEqual(M,I)||(x(I),areElementSizesEqual(I.viewportInnerSize,M.viewportInnerSize)||e.current.publishEvent("viewportInnerSizeChange",I.viewportInnerSize),e.current.updateRenderContext?.())},[e,x,t.scrollbarSize,t.autoHeight,d,p,g,h,u,m,C,b]),I=M(S),P=r.useMemo(()=>t.resizeThrottleMs>0?function throttle(e,t=166){let r,n;const later=()=>{r=void 0,e(...n)};function throttled(...e){n=e,void 0===r&&(r=setTimeout(later,t))}return throttled.clear=()=>{clearTimeout(r),r=void 0},throttled}(()=>{I(),e.current.publishEvent("debouncedResize",l.current)},t.resizeThrottleMs):void 0,[e,t.resizeThrottleMs,I]);r.useEffect(()=>P?.clear,[P]);const k={resize:R,getRootDimensions:v},D={updateDimensions:S,getViewportPageSize:y};a(S,[S]),useGridApiMethod(e,k,"public"),useGridApiMethod(e,D,"private");const F=r.useCallback(t=>{setCSSVariables(t,gridDimensionsSelector(e.current.state))},[e]),G=r.useCallback(e=>{if(l.current=e,0!==e.height||o.current||t.autoHeight||ko||(n.error(["The parent DOM element of the Data Grid has an empty height.","Please make sure that this element has an intrinsic height.","The grid displays with a height of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join("\n")),o.current=!0),0!==e.width||o.current||ko||(n.error(["The parent DOM element of the Data Grid has an empty width.","Please make sure that this element has an intrinsic width.","The grid displays with a width of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join("\n")),o.current=!0),c.current||!P)return c.current=!1,void S();P()},[S,t.autoHeight,P,n]);useGridApiOptionHandler(e,"rootMount",F),useGridApiOptionHandler(e,"resize",G),useGridApiOptionHandler(e,"debouncedResize",t.onResize)}function setCSSVariables(e,t){const set=(t,r)=>e.style.setProperty(t,r);set("--DataGrid-hasScrollX",`${Number(t.hasScrollX)}`),set("--DataGrid-hasScrollY",`${Number(t.hasScrollY)}`),set("--DataGrid-scrollbarSize",`${t.scrollbarSize}px`),set("--DataGrid-rowWidth",`${t.rowWidth}px`),set("--DataGrid-columnsTotalWidth",`${t.columnsTotalWidth}px`),set("--DataGrid-leftPinnedWidth",`${t.leftPinnedWidth}px`),set("--DataGrid-rightPinnedWidth",`${t.rightPinnedWidth}px`),set("--DataGrid-headerHeight",`${t.headerHeight}px`),set("--DataGrid-headersTotalHeight",`${t.headersTotalHeight}px`),set("--DataGrid-topContainerHeight",`${t.topContainerHeight}px`),set("--DataGrid-bottomContainerHeight",`${t.bottomContainerHeight}px`),set("--height",`${t.rowHeight}px`)}function getStaticDimensions(e,t,r,n){const o=getValidRowHeight(e.rowHeight,Ta.rowHeight);return{rowHeight:Math.floor(o*r),headerHeight:Math.floor(e.columnHeaderHeight*r),groupHeaderHeight:Math.floor((e.columnGroupHeaderHeight??e.columnHeaderHeight)*r),headerFilterHeight:Math.floor((e.headerFilterHeight??e.columnHeaderHeight)*r),columnsTotalWidth:Aa(t),headersTotalHeight:getTotalHeaderHeight(t,e),leftPinnedWidth:n.left.reduce((e,t)=>e+t.computedWidth,0),rightPinnedWidth:n.right.reduce((e,t)=>e+t.computedWidth,0)}}const ja=new WeakMap;function areElementSizesEqual(e,t){return e.width===t.width&&e.height===t.height}const $a=void 0!==globalThis.ResizeObserver?globalThis.ResizeObserver:class ResizeObserver2{observe(){}unobserve(){}disconnect(){}},rowsMetaStateInitializer=(e,t,r)=>{r.current.caches.rowsMeta={heights:new Map};const n=gridRowHeightSelector(r.current.state),o=Lt(r),l=gridPaginationSelector(r.current.state),i=Math.min(l.enabled?l.paginationModel.pageSize:o,o);return et({},e,{rowsMeta:{currentPageTotalHeight:i*n,positions:Array.from({length:i},(e,t)=>t*n),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0}})};function calculateCellColSpan(e){const{apiRef:t,lookup:r,columnIndex:n,rowId:o,minFirstColumnIndex:l,maxLastColumnIndex:i,columns:a}=e,s=a.length,u=a[n],c=t.current.getRow(o),d=t.current.getRowValue(c,u),p="function"==typeof u.colSpan?u.colSpan(d,c,u,t):u.colSpan;if(!p||1===p)return setCellColSpanInfo(r,o,n,{spannedByColSpan:!1,cellProps:{colSpan:1,width:u.computedWidth}}),{colSpan:1};let g=u.computedWidth;for(let h=1;h<p;h+=1){const e=n+h;if(e>=l&&e<i){g+=a[e].computedWidth,setCellColSpanInfo(r,o,n+h,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(n+p,s-1),leftVisibleCellIndex:n})}setCellColSpanInfo(r,o,n,{spannedByColSpan:!1,cellProps:{colSpan:p,width:g}})}return{colSpan:p}}function setCellColSpanInfo(e,t,r,n){e[t]||(e[t]={}),e[t][r]=n}const recurrentUnwrapGroupingColumnModel=(e,t,r)=>{if(isLeaf(e)){if(void 0!==r[e.field])throw new Error(["MUI X: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${r[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join("\n"));return void(r[e.field]=t)}const{groupId:n,children:o}=e;o.forEach(e=>{recurrentUnwrapGroupingColumnModel(e,[...t,n],r)})},unwrapGroupingColumnModel=e=>{if(!e)return{};const t={};return e.forEach(e=>{recurrentUnwrapGroupingColumnModel(e,[],t)}),t},getColumnGroupsHeaderStructure=(e,t,r)=>{const getParents=e=>t[e]??[],n=[],o=Math.max(...e.map(e=>getParents(e).length)),haveSameParents=(e,t,r)=>isDeepEqual(getParents(e).slice(0,r+1),getParents(t).slice(0,r+1));for(let l=0;l<o;l+=1){const t=e.reduce((e,t)=>{const n=getParents(t)[l]??null;if(0===e.length)return[{columnFields:[t],groupId:n}];const o=e[e.length-1],i=o.columnFields[o.columnFields.length-1];return o.groupId!==n||!haveSameParents(i,t,l)||(a=i,s=t,r?.left&&r.left.includes(a)&&!r.left.includes(s)||r?.right&&!r.right.includes(a)&&r.right.includes(s))?[...e,{columnFields:[t],groupId:n}]:[...e.slice(0,e.length-1),{columnFields:[...o.columnFields,t],groupId:n}];var a,s},[]);n.push(t)}return n},za=["groupId","children"],createGroupLookup=e=>{let t={};return e.forEach(e=>{if(isLeaf(e))return;const{groupId:r,children:n}=e,o=tt(e,za);if(!r)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");const l=et({},o,{groupId:r}),i=createGroupLookup(n);if(void 0!==i[r]||void 0!==t[r])throw new Error(`MUI X: The groupId ${r} is used multiple times in the columnGroupingModel.`);t=et({},t,i,{[r]:l})}),et({},t)},columnGroupsStateInitializer=(e,t,r)=>{if(!t.columnGroupingModel)return e;const n=cr(r),o=hr(r),l=createGroupLookup(t.columnGroupingModel??[]),i=unwrapGroupingColumnModel(t.columnGroupingModel??[]),a=getColumnGroupsHeaderStructure(n,i,r.current.state.pinnedColumns??{}),s=0===o.length?0:Math.max(...o.map(e=>i[e]?.length??0));return et({},e,{columnGrouping:{lookup:l,unwrappedGroupingModel:i,headerStructure:a,maxDepth:s}})};function trackFinger(e,t){if(void 0!==t&&e.changedTouches){for(let r=0;r<e.changedTouches.length;r+=1){const n=e.changedTouches[r];if(n.identifier===t)return{x:n.clientX,y:n.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function computeNewWidth(e,t,r,n){let o=e;return o+="Right"===n?t-r.left:r.right-t,o}function preventClick(e){e.preventDefault(),e.stopImmediatePropagation()}function useColumnVirtualizationDisabled(e){const t=r.useRef(void 0),selector=()=>wo(e),n=useGridSelector(e,selector);r.useEffect(()=>{t.current&&!1===n&&(t.current.resolve(),t.current=void 0)});return()=>{if(!t.current){if(!1===selector())return Promise.resolve();t.current=function createControllablePromise(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});return r.resolve=e,r.reject=t,r}()}return t.current}}function extractColumnWidths(e,t,r){const n={},o=e.current.rootElementRef.current;return o.classList.add(Mt.autosizing),r.forEach(r=>{const o=function findGridCells(e,t){const r=e.virtualScrollerRef.current;return Array.from(r.querySelectorAll(`:scope > div > div > div > [data-field="${escapeOperandAttributeSelector(t)}"][role="gridcell"]`))}(e.current,r.field).map(e=>e.getBoundingClientRect().width??0),l=t.includeOutliers?o:function excludeOutliers(e,t){if(e.length<4)return e;const r=e.slice();r.sort((e,t)=>e-t);const n=r[Math.floor(.25*r.length)],o=r[Math.floor(.75*r.length)-1],l=o-n,i=l<5?5:l*t;return r.filter(e=>e>n-i&&e<o+i)}(o,t.outliersFactor);if(t.includeHeaders){const t=function findGridHeader(e,t){return e.columnHeadersContainerRef.current.querySelector(`:scope > div > [data-field="${escapeOperandAttributeSelector(t)}"][role="columnheader"]`)}(e.current,r.field);if(t){const e=t.querySelector(`.${Mt.columnHeaderTitle}`),r=t.querySelector(`.${Mt.columnHeaderTitleContainerContent}`),n=t.querySelector(`.${Mt.iconButtonContainer}`),o=t.querySelector(`.${Mt.menuIcon}`),i=e??r,a=window.getComputedStyle(t,null),s=parseInt(a.paddingLeft,10)+parseInt(a.paddingRight,10),u=i.scrollWidth+1+s+(n?.clientWidth??0)+(o?.clientWidth??0);l.push(u)}}const i=r.minWidth!==-1/0&&void 0!==r.minWidth,a=r.maxWidth!==1/0&&void 0!==r.maxWidth,s=i?r.minWidth:0,u=a?r.maxWidth:1/0,c=0===l.length?0:Math.max(...l);n[r.field]=clamp(c,s,u)}),o.classList.remove(Mt.autosizing),n}const columnResizeStateInitializer=e=>et({},e,{columnResize:{resizingColumnField:""}});function createResizeRefs(){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 useGridColumnResize=(e,n)=>{const o=v(),l=useGridLogger(e,"useGridColumnResize"),i=t(createResizeRefs).current,a=r.useRef(null),s=r.useRef(null),u=d(),c=r.useRef(void 0),updateWidth=t=>{l.debug(`Updating width to ${t} for col ${i.colDef.field}`);const r=i.columnHeaderElement.offsetWidth,n=t-r,o=t-i.initialColWidth;if(o>0){const t=i.initialTotalWidth+o;e.current.rootElementRef?.current?.style.setProperty("--DataGrid-rowWidth",`${t}px`)}i.colDef.computedWidth=t,i.colDef.width=t,i.colDef.flex=0,i.columnHeaderElement.style.width=`${t}px`;const a=i.headerFilterElement;a&&(a.style.width=`${t}px`),i.groupHeaderElements.forEach(e=>{const r=e;let o;o="1"===r.getAttribute("aria-colspan")?`${t}px`:`${r.offsetWidth+n}px`,r.style.width=o}),i.cellElements.forEach(e=>{const r=e;let o;o="1"===r.getAttribute("aria-colspan")?`${t}px`:`${r.offsetWidth+n}px`,r.style.setProperty("--width",o)});const s=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,i.colDef.field);s===sr.LEFT&&(updateProperty(i.fillerLeft,"width",n),i.leftPinnedCellsAfter.forEach(e=>{updateProperty(e,"left",n)}),i.leftPinnedHeadersAfter.forEach(e=>{updateProperty(e,"left",n)})),s===sr.RIGHT&&(updateProperty(i.fillerRight,"width",n),i.rightPinnedCellsBefore.forEach(e=>{updateProperty(e,"right",n)}),i.rightPinnedHeadersBefore.forEach(e=>{updateProperty(e,"right",n)}))},finishResize=t=>{if(b(),i.previousMouseClickEvent){const r=i.previousMouseClickEvent,n=r.timeStamp,o=r.clientX,l=r.clientY;if(t.timeStamp-n<300&&t.clientX===o&&t.clientY===l)return i.previousMouseClickEvent=void 0,void e.current.publishEvent("columnResizeStop",null,t)}if(i.colDef){e.current.setColumnWidth(i.colDef.field,i.colDef.width),l.debug(`Updating col ${i.colDef.field} with new width: ${i.colDef.width}`);const t=gridColumnsStateSelector(e.current.state);i.groupHeaderElements.forEach(e=>{const r=e,n=`${function getFieldsFromGroupHeaderElem(e){return e.getAttribute("data-fields").slice(2,-2).split("-|-")}(e).reduce((e,r)=>!1!==t.columnVisibilityModel[r]?e+t.lookup[r].computedWidth:e,0)}px`;r.style.width=n})}u.start(0,()=>{e.current.publishEvent("columnResizeStop",null,t)})},storeReferences=(t,r,n)=>{const l=e.current.rootElementRef.current;i.initialColWidth=t.computedWidth,i.initialTotalWidth=e.current.getRootDimensions().rowWidth,i.colDef=t,i.columnHeaderElement=function findHeaderElementFromField(e,t){return e.querySelector(`[data-field="${escapeOperandAttributeSelector(t)}"]`)}(e.current.columnHeadersContainerRef.current,t.field);const u=l.querySelector(`.${Mt.headerFilterRow} [data-field="${escapeOperandAttributeSelector(t.field)}"]`);u&&(i.headerFilterElement=u),i.groupHeaderElements=function findGroupHeaderElementsFromField(e,t){return Array.from(e.querySelectorAll(`[data-fields*="|-${escapeOperandAttributeSelector(t)}-|"]`)??[])}(e.current.columnHeadersContainerRef?.current,t.field),i.cellElements=function findGridCellElementsFromCol(e,t){if(!findParentElementFromClassName(e,Mt.root))throw new Error("MUI X: The root element is not found.");const r=e.getAttribute("aria-colindex");if(!r)return[];const n=Number(r)-1,o=[];return t.virtualScrollerRef?.current?(queryRows(t).forEach(e=>{const r=e.getAttribute("data-id");if(!r)return;let l=n;const i=t.unstable_getCellColSpanInfo(r,n);i&&i.spannedByColSpan&&(l=i.leftVisibleCellIndex);const a=e.querySelector(`[data-colindex="${l}"]`);a&&o.push(a)}),o):[]}(i.columnHeaderElement,e.current),i.fillerLeft=findGridElement(e.current,o?"filler--pinnedRight":"filler--pinnedLeft"),i.fillerRight=findGridElement(e.current,o?"filler--pinnedLeft":"filler--pinnedRight");const c=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,i.colDef.field);i.leftPinnedCellsAfter=c!==sr.LEFT?[]:function findLeftPinnedCellsAfterCol(e,t,r){const n=parseCellColIndex(t);return findPinnedCells({api:e,colIndex:n,position:r?"right":"left",filterFn:e=>r?e<n:e>n})}(e.current,i.columnHeaderElement,o),i.rightPinnedCellsBefore=c!==sr.RIGHT?[]:function findRightPinnedCellsBeforeCol(e,t,r){const n=parseCellColIndex(t);return findPinnedCells({api:e,colIndex:n,position:r?"left":"right",filterFn:e=>r?e>n:e<n})}(e.current,i.columnHeaderElement,o),i.leftPinnedHeadersAfter=c!==sr.LEFT?[]:function findLeftPinnedHeadersAfterCol(e,t,r){const n=parseCellColIndex(t);return findPinnedHeaders({api:e,position:r?"right":"left",colIndex:n,filterFn:e=>r?e<n:e>n})}(e.current,i.columnHeaderElement,o),i.rightPinnedHeadersBefore=c!==sr.RIGHT?[]:function findRightPinnedHeadersBeforeCol(e,t,r){const n=parseCellColIndex(t);return findPinnedHeaders({api:e,position:r?"left":"right",colIndex:n,filterFn:(e,t)=>!t.classList.contains(Mt["columnHeader--last"])&&(r?e>n:e<n)})}(e.current,i.columnHeaderElement,o),s.current=function getResizeDirection(e,t){const r=e.classList.contains(Mt["columnSeparator--sideRight"])?"Right":"Left";return t?function flipResizeDirection(e){return"Right"===e?"Left":"Right"}(r):r}(r,o),a.current=function computeOffsetToSeparator(e,t,r){return"Left"===r?e-t.left:t.right-e}(n,i.columnHeaderElement.getBoundingClientRect(),s.current)},p=M(finishResize),g=M(t=>{if(0===t.buttons)return void p(t);let r=computeNewWidth(a.current,t.clientX,i.columnHeaderElement.getBoundingClientRect(),s.current);r=clamp(r,i.colDef.minWidth,i.colDef.maxWidth),updateWidth(r);const n={element:i.columnHeaderElement,colDef:i.colDef,width:r};e.current.publishEvent("columnResize",n,t)}),h=M(e=>{trackFinger(e,c.current)&&finishResize(e)}),m=M(t=>{const r=trackFinger(t,c.current);if(!r)return;if("mousemove"===t.type&&0===t.buttons)return void h(t);let n=computeNewWidth(a.current,r.x,i.columnHeaderElement.getBoundingClientRect(),s.current);n=clamp(n,i.colDef.minWidth,i.colDef.maxWidth),updateWidth(n);const o={element:i.columnHeaderElement,colDef:i.colDef,width:n};e.current.publishEvent("columnResize",o,t)}),C=M(t=>{const r=findParentElementFromClassName(t.target,Mt["columnSeparator--resizable"]);if(!r)return;const n=t.changedTouches[0];null!=n&&(c.current=n.identifier);const o=function getFieldFromHeaderElem(e){return e.getAttribute("data-field")}(findParentElementFromClassName(t.target,Mt.columnHeader)),i=e.current.getColumn(o);l.debug(`Start Resize on col ${i.field}`),e.current.publishEvent("columnResizeStart",{field:o},t),storeReferences(i,r,n.clientX);const a=E(t.currentTarget);a.addEventListener("touchmove",m),a.addEventListener("touchend",h)}),b=r.useCallback(()=>{const t=E(e.current.rootElementRef.current);t.body.style.removeProperty("cursor"),t.removeEventListener("mousemove",g),t.removeEventListener("mouseup",p),t.removeEventListener("touchmove",m),t.removeEventListener("touchend",h),setTimeout(()=>{t.removeEventListener("click",preventClick,!0)},100),i.columnHeaderElement&&(i.columnHeaderElement.style.pointerEvents="unset")},[e,i,g,p,m,h]),w=r.useCallback(({field:t})=>{e.current.setState(e=>et({},e,{columnResize:et({},e.columnResize,{resizingColumnField:t})})),e.current.forceUpdate()},[e]),x=r.useCallback(()=>{e.current.setState(e=>et({},e,{columnResize:et({},e.columnResize,{resizingColumnField:""})})),e.current.forceUpdate()},[e]),R=M(({colDef:t},r)=>{if(0!==r.button)return;if(!r.currentTarget.classList.contains(Mt["columnSeparator--resizable"]))return;r.preventDefault(),l.debug(`Start Resize on col ${t.field}`),e.current.publishEvent("columnResizeStart",{field:t.field},r),storeReferences(t,r.currentTarget,r.clientX);const n=E(e.current.rootElementRef.current);n.body.style.cursor="col-resize",i.previousMouseClickEvent=r.nativeEvent,n.addEventListener("mousemove",g),n.addEventListener("mouseup",p),n.addEventListener("click",preventClick,!0)}),y=M((t,r)=>{if(n.disableAutosize)return;if(0!==r.button)return;const o=e.current.state.columns.lookup[t.field];!1!==o.resizable&&e.current.autosizeColumns(et({},n.autosizeOptions,{disableColumnVirtualization:!1,columns:[o.field]}))}),S=useColumnVirtualizationDisabled(e),I=r.useRef(!1),P=r.useCallback(async t=>{const r=e.current.rootElementRef?.current;if(!r)return;if(I.current)return;I.current=!0;const o=gridColumnsStateSelector(e.current.state),l=et({},Jo,t,{columns:t?.columns??o.orderedFields});l.columns=l.columns.filter(e=>!1!==o.columnVisibilityModel[e]);const i=l.columns.map(t=>e.current.state.columns.lookup[t]);try{!n.disableVirtualization&&l.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await S());const t=extractColumnWidths(e,l,i),r=i.map(e=>et({},e,{width:t[e.field],computedWidth:t[e.field],flex:0}));if(l.expand){const n=o.orderedFields.map(e=>o.lookup[e]).filter(e=>!1!==o.columnVisibilityModel[e.field]).reduce((e,r)=>e+(t[r.field]??r.computedWidth??r.width),0),l=e.current.getRootDimensions(),i=l.viewportInnerSize.width-n;if(i>0){const e=i/(r.length||1);r.forEach(t=>{t.width+=e,t.computedWidth+=e})}}e.current.updateColumns(r),r.forEach((t,r)=>{if(t.width!==i[r].width){const r=t.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(t.field),colDef:t,width:r})}})}finally{n.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),I.current=!1}},[e,S,n.disableVirtualization]);r.useEffect(()=>b,[b]),D(()=>{n.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(n.autosizeOptions)})}),useGridNativeEventListener(e,()=>e.current.columnHeadersContainerRef?.current,"touchstart",C,{passive:!0}),useGridApiMethod(e,{autosizeColumns:P},"public"),Dt(e,"columnResizeStop",x),Dt(e,"columnResizeStart",w),Dt(e,"columnSeparatorMouseDown",R),Dt(e,"columnSeparatorDoubleClick",y),useGridApiOptionHandler(e,"columnResize",n.onColumnResize),useGridApiOptionHandler(e,"columnWidthChange",n.onColumnWidthChange)};function updateProperty(e,t,r){e&&(e.style[t]=`${parseInt(e.style[t],10)+r}px`)}function isRowContextInitialized(e){return 0!==e.firstRowIndex||0!==e.lastRowIndex}const getCellValue=(e,t,r)=>{if(!e)return null;let n=e[t.field];const o=t.rowSpanValueGetter??t.valueGetter;return o&&(n=o(n,e,t,r)),n},Va={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},Na={firstRowIndex:0,lastRowIndex:0},Ba=new Set([jn,"__reorder__",Lr]),computeRowSpanningState=(e,t,r,n,o,l,i)=>{const a=l?{}:et({},e.current.state.rowSpanning.spannedCells),s=l?{}:et({},e.current.state.rowSpanning.hiddenCells),u=l?{}:et({},e.current.state.rowSpanning.hiddenCellOriginMap);return l&&(i=Na),t.forEach(t=>{if(!Ba.has(t.field)){for(let l=o.firstRowIndex;l<o.lastRowIndex;l+=1){const i=r[l];if(s[i.id]?.[t.field])continue;const c=getCellValue(i.model,t,e);if(null==c)continue;let d=i.id,p=l,g=0;const h=[];if(l===o.firstRowIndex){let o=l-1,i=r[o];for(;o>=n.firstRowIndex&&i&&getCellValue(i.model,t,e)===c;){const e=r[o+1];s[e.id]?s[e.id][t.field]=!0:s[e.id]={[t.field]:!0},h.push(l),g+=1,d=i.id,p=o,o-=1,i=r[o]}}h.forEach(e=>{u[e]?u[e][t.field]=p:u[e]={[t.field]:p}});let m=l+1;for(;m<=n.lastRowIndex&&r[m]&&getCellValue(r[m].model,t,e)===c;){const e=r[m];s[e.id]?s[e.id][t.field]=!0:s[e.id]={[t.field]:!0},u[m]?u[m][t.field]=p:u[m]={[t.field]:p},m+=1,g+=1}g>0&&(a[d]?a[d][t.field]=g+1:a[d]={[t.field]:g+1})}i={firstRowIndex:Math.min(i.firstRowIndex,o.firstRowIndex),lastRowIndex:Math.max(i.lastRowIndex,o.lastRowIndex)}}}),{spannedCells:a,hiddenCells:s,hiddenCellOriginMap:u,processedRange:i}},getInitialRangeToProcess=(e,t)=>{const r=Ut(t).length;if(e.pagination){const e=En(t);let n=20;return e>0&&(n=e-1),{firstRowIndex:0,lastRowIndex:Math.min(n,r)}}return{firstRowIndex:0,lastRowIndex:Math.min(20,r)}},rowSpanningStateInitializer=(e,t,r)=>{if(!t.unstable_rowSpanning)return et({},e,{rowSpanning:Va});const n=e.rows.dataRowIds||[],o=e.columns.orderedFields||[],l=e.rows.dataRowIdToModelLookup,i=e.columns.lookup,a=Boolean(e.filter.filterModel.items.length)||Boolean(e.filter.filterModel.quickFilterValues?.length);if(!n.length||!o.length||!l||!i||a)return et({},e,{rowSpanning:Va});const s=getInitialRangeToProcess(t,r),u=n.map(e=>({id:e,model:l[e]})),c=o.map(e=>i[e]),{spannedCells:d,hiddenCells:p,hiddenCellOriginMap:g}=computeRowSpanningState(r,c,u,s,s,!0,Na);return et({},e,{rowSpanning:{spannedCells:d,hiddenCells:p,hiddenCellOriginMap:g}})},listViewStateInitializer=(e,t,r)=>et({},e,{listViewColumn:t.unstable_listColumn?et({},t.unstable_listColumn,{computedWidth:getListColumnWidth(r)}):void 0});function getListColumnWidth(e){return gridDimensionsSelector(e.current.state).viewportInnerSize.width}function GridColumnGroupHeader(e){const{groupId:t,width:n,depth:o,maxDepth:l,fields:a,height:u,colIndex:c,hasFocus:d,tabIndex:g,isLastColumn:h,pinnedPosition:m,pinnedOffset:C}=e,b=useGridRootProps$1(),w=v(),x=r.useRef(null),R=useGridApiContext$1(),y=useGridSelector(R,oo),S=t?y[t]:{},{headerName:I=t??"",description:M="",headerAlign:P}=S;let k;const D=t&&y[t]?.renderHeaderGroup,E=r.useMemo(()=>({groupId:t,headerName:I,description:M,depth:o,maxDepth:l,fields:a,colIndex:c,isLastColumn:h}),[t,I,M,o,l,a,c,h]);t&&D&&(k=D(E));const F=et({},e,{classes:b.classes,headerAlign:P,depth:o,isDragging:!1}),G=I??t,H=p(),T=null===t?`empty-group-cell-${H}`:t,O=(e=>{const{classes:t,headerAlign:r,isDragging:n,isLastColumn:o,showLeftBorder:l,showRightBorder:i,groupId:a,pinnedPosition:u}=e,c={root:["columnHeader","left"===r&&"columnHeader--alignLeft","center"===r&&"columnHeader--alignCenter","right"===r&&"columnHeader--alignRight",n&&"columnHeader--moving",i&&"columnHeader--withRightBorder",l&&"columnHeader--withLeftBorder","withBorderColor",null===a?"columnHeader--emptyGroup":"columnHeader--filledGroup",u===Ar.LEFT&&"columnHeader--pinnedLeft",u===Ar.RIGHT&&"columnHeader--pinnedRight",o&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return s(c,getDataGridUtilityClass,t)})(F);r.useLayoutEffect(()=>{if(d){const e=x.current.querySelector('[tabindex="0"]')||x.current;if(!e)return;if(doesSupportPreventScroll())e.focus({preventScroll:!0});else{const t=R.current.getScrollPosition();e.focus(),R.current.scroll(t)}}},[R,d]);const L=r.useCallback(e=>t=>{isEventTargetInPortal(t)||R.current.publishEvent(e,E,t)},[R,E]),A=r.useMemo(()=>({onKeyDown:L("columnGroupHeaderKeyDown"),onFocus:L("columnGroupHeaderFocus"),onBlur:L("columnGroupHeaderBlur")}),[L]),j="function"==typeof S.headerClassName?S.headerClassName(E):S.headerClassName,$=r.useMemo(()=>attachPinnedStyle(et({},e.style),w,m,C),[m,C,e.style,w]);return i.jsx(Ll,et({ref:x,classes:O,columnMenuOpen:!1,colIndex:c,height:u,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:g,isDraggable:!1,headerComponent:k,headerClassName:j,description:M,elementId:T,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:G,"aria-colspan":a.length,"data-fields":`|-${a.join("-|-")}-|`,style:$},A))}const _a=u("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})({display:"flex"}),useGridColumnHeaders$1=e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:o,columnHeaderTabIndexState:l,columnGroupHeaderTabIndexState:a,columnHeaderFocus:s,columnGroupHeaderFocus:u,headerGroupingMaxDepth:c,columnMenuState:d,columnVisibility:p,columnGroupsHeaderStructure:g,hasOtherElementInTabSequence:m}=e,[C,b]=r.useState(""),[w,v]=r.useState(""),x=useGridPrivateApiContext$1(),R=useGridRootProps$1(),y=useGridSelector(x,no),S=useGridSelector(x,br),I=useGridSelector(x,Ro),M=useGridSelector(x,Cr),P=useGridSelector(x,dr),k=computeOffsetLeft(S,I,M.left.length),D=useGridSelector(x,yt),E=useGridSelector(x,gridHasFillerSelector),F=useGridSelector(x,gridHeaderHeightSelector),G=useGridSelector(x,gridGroupHeaderHeightSelector),H=useGridSelector(x,gridVerticalScrollbarWidthSelector),T=r.useCallback(e=>v(e.field),[]),O=r.useCallback(()=>v(""),[]),L=r.useCallback(e=>b(e.field),[]),A=r.useCallback(()=>b(""),[]),j=r.useMemo(()=>M.left.length?{firstColumnIndex:0,lastColumnIndex:M.left.length}:null,[M.left.length]),$=r.useMemo(()=>M.right.length?{firstColumnIndex:t.length-M.right.length,lastColumnIndex:t.length}:null,[M.right.length,t.length]);Dt(x,"columnResizeStart",T),Dt(x,"columnResizeStop",O),Dt(x,"columnHeaderDragStart",L),Dt(x,"columnHeaderDragEnd",A);const getColumnsToRender=e=>{const{renderContext:r=I}=e||{},n=r.firstColumnIndex,o=r.lastColumnIndex;return{renderedColumns:t.slice(n,o),firstColumnToRender:n,lastColumnToRender:o}},getFillers=(e,t,n,o=!1)=>{const l=e?.position===Ar.RIGHT,a=void 0===e?.position,s=M.right.length>0&&l||0===M.right.length&&a,u=k-n;return i.jsxs(r.Fragment,{children:[a&&i.jsx("div",{role:"presentation",style:{width:u}}),t,a&&i.jsx("div",{role:"presentation",className:h(Mt.filler,o&&Mt["filler--borderBottom"])}),s&&i.jsx(GridScrollbarFillerCell,{header:!0,pinnedRight:l,borderBottom:o,borderTop:!1})]})},getColumnHeaders=(e,t={})=>{const{renderedColumns:r,firstColumnToRender:a}=getColumnsToRender(e),u=[];for(let c=0;c<r.length;c+=1){const p=r[c],g=a+c,h=0===g,b=null!==l&&l.field===p.field||h&&!m?0:-1,v=null!==s&&s.field===p.field,x=d.open&&d.field===p.field,y=e?.position,I=getPinnedCellOffset(y,p.computedWidth,g,S,D,H),P=y===Ar.RIGHT?r[c-1]:r[c+1],k=!!P&&(null!==s&&s.field===P.field),G=g+1===S.length-M.right.length,T=c,O=r.length,L=shouldCellShowLeftBorder(y,T),A=shouldCellShowRightBorder(y,T,O,R.showColumnVerticalBorder,E);u.push(i.jsx(Al,et({},n[p.field],{columnMenuOpen:x,filterItemsCounter:o[p.field]&&o[p.field].length,headerHeight:F,isDragging:p.field===C,colDef:p,colIndex:g,isResizing:w===p.field,isLast:g===S.length-1,hasFocus:v,tabIndex:b,pinnedPosition:y,pinnedOffset:I,isLastUnpinned:G,isSiblingFocused:k,showLeftBorder:L,showRightBorder:A},t),p.field))}return getFillers(e,u,0)},getColumnGroupHeaders=({depth:e,params:r})=>{const n=getColumnsToRender(r);if(0===n.renderedColumns.length)return null;const{firstColumnToRender:o,lastColumnToRender:l}=n,s=g[e],d=t[o].field,h=y[d]?.[e]??null,m=s.findIndex(({groupId:e,columnFields:t})=>e===h&&t.includes(d)),C=t[l-1].field,b=y[C]?.[e]??null,w=s.findIndex(({groupId:e,columnFields:t})=>e===b&&t.includes(C)),v=s.slice(m,w+1).map(e=>et({},e,{columnFields:e.columnFields.filter(e=>!1!==p[e])})).filter(e=>e.columnFields.length>0),x=v[0].columnFields.indexOf(d),I=v[0].columnFields.slice(0,x).reduce((e,t)=>e+(P[t].computedWidth??0),0);let M=o;const k=v.map(({groupId:t,columnFields:n},o)=>{const l=null!==u&&u.depth===e&&n.includes(u.field),s=null!==a&&a.depth===e&&n.includes(a.field)?0:-1,d={width:n.reduce((e,t)=>e+P[t].computedWidth,0),fields:n,colIndex:M},p=r.position,g=getPinnedCellOffset(p,d.width,M,S,D,H);M+=n.length;let h=o;return p===Ar.LEFT&&(h=M-1),i.jsx(GridColumnGroupHeader,{groupId:t,width:d.width,fields:d.fields,colIndex:d.colIndex,depth:e,isLastColumn:o===v.length-1,maxDepth:c,height:G,hasFocus:l,tabIndex:s,pinnedPosition:p,pinnedOffset:g,showLeftBorder:shouldCellShowLeftBorder(p,h),showRightBorder:shouldCellShowRightBorder(p,h,v.length,R.showColumnVerticalBorder,E)},o)});return getFillers(r,k,I)};return{renderContext:I,leftRenderContext:j,rightRenderContext:$,pinnedColumns:M,visibleColumns:t,columnPositions:S,getFillers,getColumnHeadersRow:()=>i.jsxs(_a,{role:"row","aria-rowindex":c+1,ownerState:R,className:Mt["row--borderBottom"],children:[j&&getColumnHeaders({position:Ar.LEFT,renderContext:j},{disableReorder:!0}),getColumnHeaders({renderContext:I}),$&&getColumnHeaders({position:Ar.RIGHT,renderContext:$},{disableReorder:!0,separatorSide:Hl.Left})]}),getColumnsToRender,getColumnGroupHeadersRows:()=>{if(0===c)return null;const e=[];for(let t=0;t<c;t+=1)e.push(i.jsxs(_a,{role:"row","aria-rowindex":t+1,ownerState:R,children:[j&&getColumnGroupHeaders({depth:t,params:{position:Ar.LEFT,renderContext:j,maxLastColumn:j.lastColumnIndex}}),getColumnGroupHeaders({depth:t,params:{renderContext:I}}),$&&getColumnGroupHeaders({depth:t,params:{position:Ar.RIGHT,renderContext:$,maxLastColumn:$.lastColumnIndex}})]},t));return e},getPinnedCellOffset,isDragging:!!C,getInnerProps:()=>({role:"rowgroup"})}},Wa=["className"],Ua=P("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),qa=forwardRef(function GridColumnHeaders(e,t){const{className:r}=e,n=tt(e,Wa),o=useGridRootProps$1(),l=(e=>{const{classes:t}=e;return s({root:["columnHeaders"]},getDataGridUtilityClass,t)})(o);return i.jsx(Ua,et({className:h(l.root,r),ownerState:o},n,{role:"presentation",ref:t}))}),Ka=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],Xa=I(forwardRef(function GridColumnHeaders2(e,t){const{visibleColumns:r,sortColumnLookup:n,filterColumnLookup:o,columnHeaderTabIndexState:l,columnGroupHeaderTabIndexState:a,columnHeaderFocus:s,columnGroupHeaderFocus:u,headerGroupingMaxDepth:c,columnMenuState:d,columnVisibility:p,columnGroupsHeaderStructure:g,hasOtherElementInTabSequence:h}=e,m=tt(e,Ka),{getInnerProps:C,getColumnHeadersRow:b,getColumnGroupHeadersRows:w}=useGridColumnHeaders$1({visibleColumns:r,sortColumnLookup:n,filterColumnLookup:o,columnHeaderTabIndexState:l,columnGroupHeaderTabIndexState:a,columnHeaderFocus:s,columnGroupHeaderFocus:u,headerGroupingMaxDepth:c,columnMenuState:d,columnVisibility:p,columnGroupsHeaderStructure:g,hasOtherElementInTabSequence:h});return i.jsxs(qa,et({},m,C(),{ref:t,children:[w(),b()]}))}));const Ya=forwardRef(function GridNoResultsOverlay2(e,t){const r=useGridApiContext$1().current.getLocaleText("noResultsOverlayLabel");return i.jsx(Pl,et({},e,{ref:t,children:r}))}),Qa=["sortingOrder"],Ja=r.memo(function GridColumnHeaderSortIcon2(e){const{sortingOrder:t}=e,r=tt(e,Qa),n=useGridRootProps$1(),[o]=t,l="asc"===o?n.slots.columnSortedAscendingIcon:n.slots.columnSortedDescendingIcon;return l?i.jsx(l,et({},r)):null}),Za=["native"];const es=et({},{booleanCellTrueIcon:si,booleanCellFalseIcon:ri,columnMenuIcon:ti,openFilterButtonIcon:ql,filterPanelDeleteIcon:ri,columnFilteredIcon:Kl,columnSelectorIcon:Yl,columnUnsortedIcon:Ja,columnSortedAscendingIcon:Bl,columnSortedDescendingIcon:_l,columnResizeIcon:Ql,densityCompactIcon:Jl,densityStandardIcon:Zl,densityComfortableIcon:ei,exportIcon:ai,moreActionsIcon:ui,treeDataCollapseIcon:Ul,treeDataExpandIcon:Wl,groupingCriteriaCollapseIcon:Ul,groupingCriteriaExpandIcon:Wl,detailPanelExpandIcon:ni,detailPanelCollapseIcon:oi,rowReorderIcon:ii,quickFilterIcon:Xl,quickFilterClearIcon:ri,columnMenuHideIcon:ci,columnMenuSortAscendingIcon:Bl,columnMenuSortDescendingIcon:_l,columnMenuFilterIcon:Kl,columnMenuManageColumnsIcon:di,columnMenuClearIcon:pi,loadIcon:li,filterPanelAddIcon:ni,filterPanelRemoveAllIcon:gi,columnReorderIcon:ii},{baseBadge:ae,baseCheckbox:ie,baseDivider:le,baseTextField:_,baseFormControl:oe,baseSelect:ne,baseButton:re,baseIconButton:te,baseInputAdornment:ee,baseTooltip:Z,basePopper:w,baseInputLabel:J,baseSelectOption:function MUISelectOption(e){let{native:t}=e,r=tt(e,Za);return t?i.jsx("option",et({},r)):i.jsx($,et({},r))},baseChip:Q}),ts=et({},es,{cell:dl,skeletonCell:Cl,columnHeaderFilterIconButton:function GridColumnHeaderFilterIconButtonWrapped(e){return e.counter?i.jsx(GridColumnHeaderFilterIconButton,et({},e)):null},columnHeaderSortIcon:Nl,columnMenu:Ri,columnHeaders:Xa,detailPanels:function GridDetailPanels$1(e){return null},footer:ia,footerRowCount:ba,toolbar:null,pinnedRows:function GridPinnedRows$1(e){return null},loadingOverlay:pa,noResultsOverlay:Ya,noRowsOverlay:ga,pagination:ha,filterPanel:Ui,columnsPanel:function GridColumnsPanel(e){const t=useGridRootProps$1();return i.jsx(Ii,et({},e,{children:i.jsx(t.slots.columnsManagement,et({},t.slotProps?.columnsManagement))}))},columnsManagement:function GridColumnsManagement(e){const n=useGridApiContext$1(),o=r.useRef(null),l=useGridSelector(n,pr),a=t(()=>gr(n)).current,u=useGridSelector(n,gr),c=useGridRootProps$1(),[d,p]=r.useState(""),g=(e=>{const{classes:t}=e;return s({root:["columnsManagement"],header:["columnsManagementHeader"],searchInput:["columnsManagementSearchInput"],footer:["columnsManagementFooter"],row:["columnsManagementRow"]},getDataGridUtilityClass,t)})(c),{sort:h,searchPredicate:m=defaultSearchPredicate,autoFocusSearchField:C=!0,disableShowHideToggle:b=!1,disableResetButton:w=!1,toggleAllMode:v="all",getTogglableColumns:x,searchInputProps:R}=e,y=r.useMemo(()=>((e,t)=>{const r=new Set(Object.keys(e).filter(t=>!1===e[t])),n=new Set(Object.keys(t).filter(e=>!1===t[e]));if(r.size!==n.size)return!1;let o=!0;return r.forEach(e=>{n.has(e)||(o=!1)}),o})(u,a),[u,a]),S=r.useMemo(()=>{switch(h){case"asc":return[...l].sort((e,t)=>qi.compare(e.headerName||e.field,t.headerName||t.field));case"desc":return[...l].sort((e,t)=>-qi.compare(e.headerName||e.field,t.headerName||t.field));default:return l}},[l,h]),toggleColumn=e=>{const{name:t}=e.target;n.current.setColumnVisibility(t,!1===u[t])},I=r.useMemo(()=>{const e=x?x(S):null,t=e?S.filter(({field:t})=>e.includes(t)):S;return d?t.filter(e=>m(e,d.toLowerCase())):t},[S,d,m,x]),M=r.useCallback(e=>{const t=gr(n),r=et({},t),o=x?x(l):null;return("filteredOnly"===v?I:l).forEach(t=>{t.hideable&&(null==o||o.includes(t.field))&&(e?delete r[t.field]:r[t.field]=!1)}),n.current.setColumnVisibilityModel(r)},[n,l,x,v,I]),P=r.useCallback(e=>{p(e.target.value)},[]),k=r.useMemo(()=>I.filter(e=>e.hideable),[I]),D=r.useMemo(()=>k.every(e=>null==u[e.field]||!1!==u[e.field]),[u,k]),E=r.useMemo(()=>k.every(e=>!1===u[e.field]),[u,k]),F=r.useRef(null);r.useEffect(()=>{C?o.current.focus():F.current&&"function"==typeof F.current.focus&&F.current.focus()},[C]);let G=!1;const isFirstHideableColumn=e=>!1===G&&!1!==e.hideable&&(G=!0,!0),H=r.useCallback(()=>{p(""),o.current.focus()},[]);return i.jsxs(r.Fragment,{children:[i.jsx(Xi,{className:g.header,ownerState:c,children:i.jsx(Yi,et({as:c.slots.baseTextField,ownerState:c,placeholder:n.current.getLocaleText("columnsManagementSearchTitle"),inputRef:o,className:g.searchInput,value:d,onChange:P,variant:"outlined",size:"small",type:"search",InputProps:{startAdornment:i.jsx(c.slots.baseInputAdornment,{position:"start",children:i.jsx(c.slots.quickFilterIcon,{})}),endAdornment:i.jsx(c.slots.baseIconButton,et({"aria-label":n.current.getLocaleText("columnsManagementDeleteIconLabel"),size:"small",sx:[d?{visibility:"visible"}:{visibility:"hidden"}],tabIndex:-1,onClick:H},c.slotProps?.baseIconButton,{children:i.jsx(c.slots.quickFilterClearIcon,{fontSize:"small"})}))},inputProps:{"aria-label":n.current.getLocaleText("columnsManagementSearchTitle")},autoComplete:"off",fullWidth:!0},c.slotProps?.baseTextField,R))}),i.jsxs(Ki,{className:g.root,ownerState:c,children:[I.map(e=>i.jsx(B,{className:g.row,control:i.jsx(c.slots.baseCheckbox,et({disabled:!1===e.hideable,checked:!1!==u[e.field],onClick:toggleColumn,name:e.field,sx:{p:.5},inputRef:isFirstHideableColumn(e)?F:void 0},c.slotProps?.baseCheckbox)),label:e.headerName||e.field},e.field)),0===I.length&&i.jsx(Ji,{ownerState:c,children:n.current.getLocaleText("columnsManagementNoColumns")})]}),b&&w||!(I.length>0)?null:i.jsxs(Qi,{ownerState:c,className:g.footer,children:[b?i.jsx("span",{}):i.jsx(B,{control:i.jsx(c.slots.baseCheckbox,et({disabled:0===k.length,checked:D,indeterminate:!D&&!E,onClick:()=>M(!D),name:n.current.getLocaleText("columnsManagementShowHideAllText"),sx:{p:.5}},c.slotProps?.baseCheckbox)),label:n.current.getLocaleText("columnsManagementShowHideAllText")}),w?null:i.jsx(c.slots.baseButton,et({onClick:()=>n.current.setColumnVisibilityModel(a),disabled:y},c.slotProps?.baseButton,{children:n.current.getLocaleText("columnsManagementReset")}))]})]})},panel:Ei,row:xa}),headerFilteringStateInitializer=(e,t)=>et({},e,{headerFiltering:{enabled:t.headerFilters??!1,editing:null,menuOpen:null}}),rs=P("div")({position:"sticky",left:0,width:0,height:0}),useGridInfiniteLoader=(e,t)=>{const n=useGridSelector(e,gridDimensionsSelector).isReady,o=useGridSelector(e,fr),l=useGridVisibleRows(e),a=r.useRef(null),s=d(),u=r.useRef(null),c="client"===t.rowsLoadingMode&&!!t.onRowsScrollEnd,p=M(([t])=>{const r=t.intersectionRatio;if(t.isIntersecting&&1===r){const t=e.current.getViewportPageSize(),r={visibleColumns:o,viewportPageSize:t,visibleRowsCount:l.rows.length};e.current.publishEvent("rowsScrollEnd",r),a.current?.disconnect(),u.current=null}});r.useEffect(()=>{const r=e.current.virtualScrollerRef.current;if(!c||!n||!r)return;a.current?.disconnect();const o=(l=e.current.state).dimensions.hasScrollX?l.dimensions.scrollbarSize:0;var l;const i=t.scrollEndThreshold-o;a.current=new IntersectionObserver(p,{threshold:1,root:r,rootMargin:`0px 0px ${i}px 0px`}),u.current&&a.current.observe(u.current)},[e,n,p,c,t.scrollEndThreshold]);const g=r.useCallback(e=>{c&&s.start(0,()=>(e=>{u.current!==e&&(a.current?.disconnect(),u.current=e,u.current&&a.current?.observe(u.current))})(e))},[c,s]),h=r.useCallback(({lastRowId:e})=>c?i.jsx(rs,{ref:g,role:"presentation"},`trigger-${e}`):null,[c,g]);useGridApiMethod(e,{getInfiniteLoadingTriggerElement:h},"private"),useGridApiOptionHandler(e,"rowsScrollEnd",t.onRowsScrollEnd)},ns=createSelector(e=>e.columnReorder,e=>e.dragCol),os="left",ls="right",columnReorderStateInitializer=e=>et({},e,{columnReorder:{dragCol:""}}),useGridColumnReorder=(e,t)=>{const n=useGridLogger(e,"useGridColumnReorder"),o=r.useRef(null),l=r.useRef({x:0,y:0}),i=r.useRef(null),a=r.useRef({}),u=r.useRef(void 0),c=(e=>{const{classes:t}=e;return s({columnHeaderDragging:["columnHeader--dragging"]},getDataGridUtilityClass,t)})({classes:t.classes}),d=v();r.useEffect(()=>()=>{clearTimeout(u.current)},[]);const p=r.useCallback((r,l)=>{if(t.disableColumnReorder||r.colDef.disableReorder)return;n.debug(`Start dragging col ${r.field}`),l.stopPropagation(),o.current=l.currentTarget,o.current.classList.add(c.columnHeaderDragging),l.dataTransfer&&(l.dataTransfer.effectAllowed="move"),e.current.setState(e=>et({},e,{columnReorder:et({},e.columnReorder,{dragCol:r.field})})),e.current.forceUpdate(),u.current=setTimeout(()=>{o.current.classList.remove(c.columnHeaderDragging)}),i.current=e.current.getColumnIndex(r.field,!1);const s=e.current.getColumnGroupPath(r.field),d=i.current,p=e.current.getAllColumns(),g=e.current.getAllGroupDetails(),getGroupPathFromColumnIndex=t=>{const r=p[t].field;return e.current.getColumnGroupPath(r)};let h=null;s.forEach(e=>{g[e]?.freeReordering||(d>0&&getGroupPathFromColumnIndex(d-1).includes(e)||d+1<p.length&&getGroupPathFromColumnIndex(d+1).includes(e))&&(h=e)}),a.current={};for(let e=0;e<p.length;e+=1){const t=e<=d?e-1:e,r=e<d?e:e+1;if(null!==h){let n=!1;(t>=0&&getGroupPathFromColumnIndex(t).includes(h)||r<p.length&&getGroupPathFromColumnIndex(r).includes(h))&&(n=!0),n||(a.current[e]=!0)}t>=0&&r<p.length&&getGroupPathFromColumnIndex(r).forEach(r=>{getGroupPathFromColumnIndex(t).includes(r)&&(s.includes(r)||g[r]?.freeReordering||(a.current[e]=!0))})}},[t.disableColumnReorder,c.columnHeaderDragging,n,e]),g=r.useCallback((e,t)=>{t.preventDefault(),t.stopPropagation()},[]),h=r.useCallback((t,r)=>{const o=ns(e);if(!o)return;n.debug(`Dragging over col ${t.field}`),r.preventDefault(),r.stopPropagation();const i={x:r.clientX,y:r.clientY};if(t.field!==o&&(s=l.current,u=i,s.x!==u.x||s.y!==u.y)){const r=e.current.getColumnIndex(t.field,!1),n=e.current.getColumnIndex(t.field,!0),s=e.current.getColumn(t.field),u=e.current.getColumnIndex(o,!1),c=e.current.getVisibleColumns(),p=e.current.getAllColumns(),g=((e,t)=>e.x<=t.x?ls:os)(l.current,i),h=g===os&&(d?u<r:r<u);if(h||g===ls&&(d?r<u:u<r)){let t,l=0;if(t=!s.disableReorder||(h?n>0&&!c[n-1].disableReorder:n<c.length-1&&!c[n+1].disableReorder),a.current[r]){let e,o=r+l;if(h)for(e=n>0?c[n-1].field:null;o>0&&p[o].field!==e&&a.current[o];)l-=1,o=r+l;else for(e=n+1<c.length?c[n+1].field:null;o<p.length-1&&p[o].field!==e&&a.current[o];)l+=1,o=r+l;(a.current[o]||p[o].field===e)&&(t=!1)}e.current.unstable_applyPipeProcessors("canBeReordered",t,{targetIndex:n})&&e.current.setColumnIndex(o,r+l)}l.current=i}var s,u},[e,n,d]),m=r.useCallback((r,l)=>{const a=ns(e);if(!t.disableColumnReorder&&a){if(n.debug("End dragging col"),l.preventDefault(),l.stopPropagation(),clearTimeout(u.current),o.current.classList.contains(c.columnHeaderDragging)&&o.current.classList.remove(c.columnHeaderDragging),o.current=null,"none"!==l.dataTransfer.dropEffect||t.keepColumnPositionIfDraggedOutside){const t={column:e.current.getColumn(a),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(a),oldIndex:i.current};e.current.publishEvent("columnOrderChange",t)}else e.current.setColumnIndex(a,i.current),i.current=null;e.current.setState(e=>et({},e,{columnReorder:et({},e.columnReorder,{dragCol:""})})),e.current.forceUpdate()}},[e,t.disableColumnReorder,t.keepColumnPositionIfDraggedOutside,n,c.columnHeaderDragging]);Dt(e,"columnHeaderDragStart",p),Dt(e,"columnHeaderDragEnter",g),Dt(e,"columnHeaderDragOver",h),Dt(e,"columnHeaderDragEnd",m),Dt(e,"cellDragEnter",g),Dt(e,"cellDragOver",h),useGridApiOptionHandler(e,"columnOrderChange",t.onColumnOrderChange)},as=et({},Sr,{type:"custom",sortable:!1,filterable:!1,disableColumnMenu:!0,disableReorder:!0,align:"left",width:200,valueGetter:(e,t,r,n)=>{const o=gridRowIdSelector(n.current.state,t),l=Vt(n)[o];return"group"===l?.type||"leaf"===l?.type?l.groupingKey:void 0}}),ss={field:Tr,editable:!1,groupable:!1};let us=function(e){return e.Default="tree-data",e.DataSource="tree-data-source",e}({});const cs=useGridRootProps$1,ds=useGridApiContext$1;function GridTreeDataGroupingCell(e){const{id:t,field:r,formattedValue:n,rowNode:o,hideDescendantCount:l,offsetMultiplier:a=2}=e,u=cs(),c=ds(),d=(e=>{const{classes:t}=e;return s({root:["treeDataGroupingCell"],toggle:["treeDataGroupingCellToggle"]},getDataGridUtilityClass,t)})(u),p=useGridSelector(c,Zr)[o.id]??0,g=o.childrenExpanded?u.slots.treeDataCollapseIcon:u.slots.treeDataExpandIcon;return i.jsxs(se,{className:d.root,sx:{ml:o.depth*a},children:[i.jsx("div",{className:d.toggle,children:p>0&&i.jsx(u.slots.baseIconButton,et({size:"small",onClick:e=>{c.current.setRowChildrenExpansion(t,!o.childrenExpanded),c.current.setCellFocus(t,r),e.stopPropagation()},tabIndex:-1,"aria-label":o.childrenExpanded?c.current.getLocaleText("treeDataCollapse"):c.current.getLocaleText("treeDataExpand")},u?.slotProps?.baseIconButton,{children:i.jsx(g,{fontSize:"inherit"})}))}),i.jsxs("span",{children:[void 0===n?o.groupingKey:n,!l&&p>0?` (${p})`:""]})]})}const gridDetailPanelExpandedRowIdsSelector=e=>e.detailPanel.expandedRowIds,gridDetailPanelExpandedRowsContentCacheSelector=e=>e.detailPanel.contentCache,gridDetailPanelRawHeightCacheSelector=e=>e.detailPanel.heightCache,ps=createSelectorMemoized(gridDetailPanelRawHeightCacheSelector,e=>Object.entries(e).reduce((e,[t,{height:r}])=>(e[t]=r||0,e),{})),gs=createSelectorV8(gridDetailPanelExpandedRowIdsSelector,(e,t)=>e.includes(t));function GridDetailPanelToggleCell(e){const{id:t,row:n,api:o}=e,l=o.getRowId(n),a=useGridSelectorV8({current:o},gs,l),u=cs(),c=ds(),d=(e=>{const{classes:t,isExpanded:r}=e;return s({root:["detailPanelToggleCell",r&&"detailPanelToggleCell--expanded"]},getDataGridUtilityClass,t)})({classes:u.classes,isExpanded:a}),p=useGridSelector(c,gridDetailPanelExpandedRowsContentCacheSelector),g=r.isValidElement(p[t]),h=a?u.slots.detailPanelCollapseIcon:u.slots.detailPanelExpandIcon;return i.jsx(u.slots.baseIconButton,et({size:"small",tabIndex:-1,disabled:!g,className:d.root,"aria-expanded":a,"aria-label":a?c.current.getLocaleText("collapseDetailPanel"):c.current.getLocaleText("expandDetailPanel")},u.slotProps?.baseIconButton,{children:i.jsx(h,{fontSize:"inherit"})}))}function GridRowReorderCell(e){const t=useGridApiContext$1(),n=cs(),o=useGridSelector(t,Ur),l=useGridSelector(t,Wt),a=useGridSelector(t,gridEditRowsStateSelector),u=e.row.__reorder__||e.id,c=r.useMemo(()=>!!n.rowReordering&&!o.length&&1===l&&0===Object.keys(a).length,[n.rowReordering,o,l,a]),d=(e=>{const{isDraggable:t,classes:r}=e;return s({root:["rowReorderCell",t&&"rowReorderCell--draggable"],placeholder:["rowReorderCellPlaceholder"]},getDataGridUtilityClass,r)})({isDraggable:c,classes:n.classes}),p=r.useCallback((r,n)=>o=>{isEventTargetInPortal(o)||t.current.getRow(e.id)&&(t.current.publishEvent(r,t.current.getRowParams(e.id),o),n&&n(o))},[t,e.id]),g=r.useCallback(()=>{t.current.rootElementRef?.current?.classList.add(Mt["root--disableUserSelection"])},[t]),h=r.useCallback(()=>{t.current.rootElementRef?.current?.classList.remove(Mt["root--disableUserSelection"])},[t]),m=r.useCallback(e=>{h(),p("rowDragEnd")(e)},[p,h]),C=c?{onDragStart:p("rowDragStart"),onDragOver:p("rowDragOver"),onDragEnd:m,onMouseDown:g,onMouseUp:h}:null;return"footer"===e.rowNode.type?null:i.jsxs("div",et({className:d.root,draggable:c},C,{children:[i.jsx(n.slots.rowReorderIcon,{}),i.jsx("div",{className:d.placeholder,children:u})]}))}const fs=j(i.jsx("g",{transform:"rotate(-30 15 10)",children:i.jsx("path",{d:"M16,9V4l1,0c0.55,0,1-0.45,1-1v0c0-0.55-0.45-1-1-1H7C6.45,2,6,2.45,6,3v0 c0,0.55,0.45,1,1,1l1,0v5c0,1.66-1.34,3-3,3h0v2h5.97v7l1,1l1-1v-7H19v-2h0C17.34,12,16,10.66,16,9z",fillRule:"evenodd"})}),"PushPinRight"),hs=j(i.jsx("g",{transform:"rotate(30 8 12)",children:i.jsx("path",{d:"M16,9V4l1,0c0.55,0,1-0.45,1-1v0c0-0.55-0.45-1-1-1H7C6.45,2,6,2.45,6,3v0 c0,0.55,0.45,1,1,1l1,0v5c0,1.66-1.34,3-3,3h0v2h5.97v7l1,1l1-1v-7H19v-2h0C17.34,12,16,10.66,16,9z",fillRule:"evenodd"})}),"PushPinLeft"),ms=["operators","item","field","buttonRef","headerFilterMenuRef","disabled"],Cs={width:22,height:22,margin:"auto 0 10px 5px"};function GridHeaderFilterMenuContainer(e){const{operators:t,item:n,field:o,buttonRef:l,headerFilterMenuRef:a,disabled:s=!1}=e,u=tt(e,ms),c=p(),d=p(),g=cs(),h=useGridApiContext$1(),m=useGridSelector(h,ro),C=Boolean(m===o&&a.current);if(!g.slots.headerFilterMenu)return null;const b=h.current.getLocaleText("filterPanelOperator"),w=b?String(b):void 0;return i.jsxs(r.Fragment,{children:[i.jsx(g.slots.baseIconButton,et({id:c,ref:l,"aria-label":w,title:w,"aria-controls":d,"aria-expanded":C?"true":void 0,"aria-haspopup":"true",tabIndex:-1,size:"small",onClick:e=>{a.current=e.currentTarget,h.current.showHeaderFilterMenu(o)},sx:Cs,disabled:s},g.slotProps?.baseIconButton,{children:i.jsx(g.slots.openFilterButtonIcon,{fontSize:"small"})})),i.jsx(g.slots.headerFilterMenu,et({field:o,open:C,item:n,target:a.current,operators:t,labelledBy:c,id:d},u))]})}const bs={padding:"2px"};function GridHeaderFilterClearButton(e){const t=cs();return i.jsx(t.slots.baseIconButton,et({tabIndex:-1,"aria-label":"Clear filter",size:"small",sx:bs},e,t.slotProps?.baseIconButton,{children:i.jsx(t.slots.columnMenuClearIcon,{fontSize:"inherit"})}))}const ws=["colIndex","height","hasFocus","width","headerClassName","colDef","item","headerFilterMenuRef","InputComponentProps","showClearIcon","pinnedPosition","pinnedOffset","style","showLeftBorder","showRightBorder"],vs={'& input[value=""]:not(:focus)':{color:"transparent"}},xs={string:GridFilterInputValue,number:GridFilterInputValue,date:GridFilterInputDate,dateTime:GridFilterInputDate,boolean:GridFilterInputBoolean,singleSelect:GridFilterInputSingleSelect,actions:null,custom:null},Rs=I(forwardRef((e,t)=>{const{colIndex:n,height:o,hasFocus:l,width:a,headerClassName:u,colDef:c,item:d,headerFilterMenuRef:p,InputComponentProps:g,showClearIcon:m=!0,pinnedPosition:C,pinnedOffset:b,style:w,showLeftBorder:x,showRightBorder:y}=e,S=tt(e,ws),I=useGridPrivateApiContext$1(),M=v(),P=useGridSelector(I,hr),k=cs(),D=r.useRef(null),E=R(t,D),G=r.useRef(null),H=r.useRef(null),T=useGridSelector(I,to)===c.field,O=useGridSelector(I,ro)===c.field,L=r.useMemo(()=>c.filterOperators?c.filterOperators.filter(e=>"isAnyOf"!==e.value):[],[c.filterOperators]),A=useGridSelector(I,Xr),j=useGridSelector(I,vr),$=r.useMemo(()=>{if(!A?.items.length)return!1;const e=A.items.find(e=>e.field===c.field);return!!e&&!j[e.field]},[c.field,A,j]),z=r.useMemo(()=>L.find(e=>e.value===d.operator)??L[0],[d.operator,L]),V=c.filterable||$?z.InputComponent??xs[c.type]:null,N=r.useCallback(()=>{I.current.deleteFilterItem(d)},[I,d]);let B;c.renderHeaderFilter&&(B=c.renderHeaderFilter(et({},e,{inputRef:G}))),r.useLayoutEffect(()=>{if(l&&!O){let e=D.current.querySelector('[tabindex="0"]');T&&V&&(e=G.current);const t=e||D.current,r=I.current.getScrollPosition();t?.focus(),I.current.scroll(r)}},[V,I,l,T,O]);const _=r.useCallback(e=>{if(!(O||isNavigationKey(e.key)||$))switch(e.key){case"Escape":T&&I.current.stopHeaderFilterEditMode();break;case"Enter":if(T&&!e.defaultPrevented){I.current.stopHeaderFilterEditMode();break}if(e.metaKey||e.ctrlKey){p.current=H.current,I.current.showHeaderFilterMenu(c.field);break}I.current.startHeaderFilterEditMode(c.field);break;case"Tab":if(T){const t=P[n+(e.shiftKey?-1:1)]??null;t&&(I.current.startHeaderFilterEditMode(t),I.current.setColumnHeaderFilterFocus(t,e))}break;default:if(T||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)break;I.current.startHeaderFilterEditMode(c.field)}},[I,c.field,n,P,p,T,$,O]),W=r.useCallback((e,t)=>r=>{I.current.publishEvent(e,I.current.getColumnHeaderParams(c.field),r),t&&t(r)},[I,c.field]),U=r.useCallback(e=>{l||(G.current?.contains?.(e.target)&&G.current.focus(),I.current.setColumnHeaderFilterFocus(c.field,e))},[I,c.field,l]),q=r.useMemo(()=>({onKeyDown:W("headerFilterKeyDown",_),onClick:W("headerFilterClick"),onMouseDown:W("headerFilterMouseDown",U),onBlur:W("headerFilterBlur")}),[U,_,W]),K=(e=>{const{colDef:t,classes:r,showRightBorder:n,showLeftBorder:o,pinnedPosition:l}=e,i={root:["columnHeader","left"===t.headerAlign&&"columnHeader--alignLeft","center"===t.headerAlign&&"columnHeader--alignCenter","right"===t.headerAlign&&"columnHeader--alignRight","withBorderColor",n&&"columnHeader--withRightBorder",o&&"columnHeader--withLeftBorder",l===Ar.LEFT&&"columnHeader--pinnedLeft",l===Ar.RIGHT&&"columnHeader--pinnedRight"]};return s(i,getDataGridUtilityClass,r)})(et({},k,{pinnedPosition:C,colDef:c,showLeftBorder:x,showRightBorder:y})),X=!1===z.requiresFilterValue,Y=void 0!==d?.value||X,Q=z.headerLabel??I.current.getLocaleText(`headerFilterOperator${F(d.operator)}`),J=Y||l;return i.jsxs("div",et({className:h(K.root,u),style:attachPinnedStyle(et({height:o,width:a},w),M,C,b),role:"columnheader","aria-colindex":n+1,"aria-label":null==B?c.headerName??c.field:void 0},S,q,{ref:E,children:[B,V&&void 0===B?i.jsxs(r.Fragment,{children:[i.jsx(V,et({apiRef:I,item:d,inputRef:G,applyValue:I.current.upsertFilterItem,onFocus:()=>I.current.startHeaderFilterEditMode(c.field),onBlur:e=>{I.current.stopHeaderFilterEditMode(),e.relatedTarget?.className.includes("columnHeader")||I.current.setState(e=>et({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))},label:F(Q),placeholder:"",isFilterActive:J,clearButton:m&&Y?i.jsx(GridHeaderFilterClearButton,{onClick:N,disabled:$}):null,disabled:$||X,tabIndex:-1,InputLabelProps:null,sx:"date"===c.type||"dateTime"===c.type||"number"===c.type?vs:void 0},X?{value:""}:{},z?.InputComponentProps,g)),i.jsx(GridHeaderFilterMenuContainer,{operators:L,item:d,field:c.field,disabled:$,applyFilterChanges:I.current.upsertFilterItem,headerFilterMenuRef:p,buttonRef:H})]}):null]}))}));const getGroupRowIdFromPath=e=>`auto-generated-row-${e.map(e=>`${e.field}/${e.key}`).join("-")}`,getNodePathInTree=({id:e,tree:t})=>{const r=[];let n=t[e];for(;n.id!==Fr;)r.push({field:"leaf"===n.type?null:n.groupingField,key:n.groupingKey}),n=t[n.parent];return r.reverse(),r},checkGroupChildrenExpansion=(e,t,r)=>{let n;return n=e.id===Fr||(r?r(e):-1===t||t>e.depth),n},updateGroupDefaultExpansion=(e,t,r)=>{const n=checkGroupChildrenExpansion(e,t,r);return e.childrenExpanded=n,e},insertNodeInTree=(e,t,r,n)=>{t[e.id]=e,r[e.depth]=(r[e.depth]??0)+1;const o=t[e.parent];if("group"===e.type||"leaf"===e.type){const r=e.groupingField??"__no_field__",l=e.groupingKey??"__no_key__",i=o.childrenFromPath?.[r];null!==n&&n[o.id]===t[o.id]?o.children=[...o.children,e.id]:o.children.push(e.id),null==i?o.childrenFromPath[r]={[l.toString()]:e.id}:i[l.toString()]=e.id}else"footer"===e.type&&(o.footerId=e.id)},removeNodeFromTree=({node:e,tree:t,treeDepths:r})=>{delete t[e.id];const n=e.depth,o=r[n];1===o?delete r[n]:r[n]=o-1;const l=t[e.parent];if("footer"===e.type)t[l.id]=et({},l,{footerId:null});else{const r=e.groupingField??"__no_field__",n=e.groupingKey??"__no_key__",o=l.children.filter(t=>t!==e.id),i=l.childrenFromPath;delete i[r][n.toString()],t[l.id]=et({},l,{children:o,childrenFromPath:i})}},updateGroupNodeIdAndAutoGenerated=({node:e,updatedNode:t,previousTree:r,tree:n,treeDepths:o})=>{e.children.forEach(e=>{n[e]=et({},n[e],{parent:t.id})}),removeNodeFromTree({node:e,tree:n,treeDepths:o});const l=et({},e,t);insertNodeInTree(l,n,o,r)},createUpdatedGroupsManager=()=>({value:{},addAction(e,t){this.value[e]||(this.value[e]={}),this.value[e][t]=!0}}),getVisibleRowsLookup=({tree:e,filteredRowsLookup:t})=>{if(!t)return{};const r={},handleTreeNode=(n,o)=>{const l=!1!==t[n.id];"group"===n.type&&n.children.forEach(t=>{const r=e[t];handleTreeNode(r,o&&!!n.childrenExpanded)}),r[n.id]=l&&o,"group"===n.type&&null!=n.footerId&&(r[n.footerId]=l&&o&&!!n.childrenExpanded)},n=Object.values(e);for(let o=0;o<n.length;o+=1){const e=n[o];0===e.depth&&handleTreeNode(e,!0)}return r},insertDataRowInTree=({id:e,path:t,updatedGroupsManager:r,previousTree:n,tree:o,treeDepths:l,onDuplicatePath:i,isGroupExpandedByDefault:a,defaultGroupingExpansionDepth:s,serverChildrenCount:u,groupsToFetch:c})=>{let d=Fr;for(let p=0;p<t.length;p+=1){const{key:g,field:h}=t[p],m=h??"__no_field__",C=g??"__no_key__",b=o[d].childrenFromPath?.[m]?.[C.toString()];if(p===t.length-1)if(null==b){let i;if(void 0!==u&&0!==u){i={type:"group",id:e,parent:d,path:t.map(e=>e.key),depth:p,isAutoGenerated:!1,groupingKey:g,groupingField:h,children:[],childrenFromPath:{},childrenExpanded:!1,serverChildrenCount:u};checkGroupChildrenExpansion(i,s,a)&&c?.add(e)}else i={type:"leaf",id:e,depth:p,parent:d,groupingKey:g};r?.addAction(d,"insertChildren"),insertNodeInTree(i,o,l,n)}else{const a=o[b];"group"===a.type&&a.isAutoGenerated?(r?.addAction(d,"removeChildren"),r?.addAction(d,"insertChildren"),updateGroupNodeIdAndAutoGenerated({tree:o,previousTree:n,treeDepths:l,node:a,updatedNode:{id:e,isAutoGenerated:!1}})):i?.(b,e,t)}else if(null==b){const e=getGroupRowIdFromPath(t.slice(0,p+1)),i={type:"group",id:e,parent:d,depth:p,isAutoGenerated:!0,groupingKey:g,groupingField:h,children:[],childrenFromPath:{},childrenExpanded:!1};r?.addAction(d,"insertChildren"),insertNodeInTree(updateGroupDefaultExpansion(i,s,a),o,l,n),d=e}else{const e=o[b];if("group"!==e.type){const t={type:"group",id:e.id,parent:e.parent,depth:e.depth,isAutoGenerated:!1,groupingKey:g,groupingField:h,children:[],childrenFromPath:{},childrenExpanded:!1};o[b]=updateGroupDefaultExpansion(t,s,a)}d=e.id}}},createRowTree=e=>{const t=[],r={[Fr]:buildRootGroup()},n={},o=new Set;for(let l=0;l<e.nodes.length;l+=1){const i=e.nodes[l];t.push(i.id),insertDataRowInTree({tree:r,previousTree:e.previousTree,id:i.id,path:i.path,serverChildrenCount:i.serverChildrenCount,onDuplicatePath:e.onDuplicatePath,treeDepths:n,isGroupExpandedByDefault:e.isGroupExpandedByDefault,defaultGroupingExpansionDepth:e.defaultGroupingExpansionDepth,groupsToFetch:o})}return{tree:r,treeDepths:n,groupingName:e.groupingName,dataRowIds:t,groupsToFetch:Array.from(o)}};class Node{constructor(e,t){this.next=void 0,this.data=void 0,this.next=t,this.data=e}insertAfter(e){if(!e.first||!e.last)return;const t=this.next;this.next=e.first,e.last.next=t}}class List{constructor(e,t){this.first=void 0,this.last=void 0,this.first=e,this.last=t}data(){const e=[];return this.forEach(t=>{e.push(t.data)}),e}forEach(e){let t=this.first;for(;null!==t;)e(t),t=t.next}static from(e){if(0===e.length)return new List(null,null);let t=0;const r=new Node(e[t],null);let n=r;for(;t+1<e.length;){t+=1;const r=new Node(e[t],null);n.next=r,n=r}return new List(r,n)}}const removeNodeAndCleanParent=({node:e,tree:t,treeDepths:r,updatedGroupsManager:n})=>{removeNodeFromTree({node:e,tree:t,treeDepths:r}),"group"===e.type&&null!=e.footerId&&removeNodeFromTree({node:t[e.footerId],tree:t,treeDepths:r});const o=t[e.parent];n?.addAction(o.id,"removeChildren");o.id!==Fr&&0===o.children.length&&(o.isAutoGenerated?removeNodeAndCleanParent({node:o,tree:t,treeDepths:r}):t[o.id]={type:"leaf",id:o.id,depth:o.depth,parent:o.parent,groupingKey:o.groupingKey})},removeDataRowFromTree=({id:e,tree:t,treeDepths:r,updatedGroupsManager:n})=>{const o=t[e];"group"===o.type&&o.children.length>0?(({node:e,tree:t,treeDepths:r,updatedGroupsManager:n})=>{n?.addAction(e.parent,"removeChildren"),n?.addAction(e.parent,"insertChildren"),updateGroupNodeIdAndAutoGenerated({previousTree:null,tree:t,treeDepths:r,node:e,updatedNode:{id:getGroupRowIdFromPath(getNodePathInTree({id:e.id,tree:t})),isAutoGenerated:!0}})})({node:o,tree:t,treeDepths:r,updatedGroupsManager:n}):removeNodeAndCleanParent({node:o,tree:t,treeDepths:r,updatedGroupsManager:n})},updateRowTree=e=>{const t=et({},e.previousTree),r=et({},e.previousTreeDepth),n=createUpdatedGroupsManager(),o=e.previousGroupsToFetch?new Set([...e.previousGroupsToFetch]):new Set([]);for(let i=0;i<e.nodes.inserted.length;i+=1){const{id:l,path:a,serverChildrenCount:s}=e.nodes.inserted[i];insertDataRowInTree({previousTree:e.previousTree,tree:t,treeDepths:r,updatedGroupsManager:n,id:l,path:a,serverChildrenCount:s,onDuplicatePath:e.onDuplicatePath,isGroupExpandedByDefault:e.isGroupExpandedByDefault,defaultGroupingExpansionDepth:e.defaultGroupingExpansionDepth,groupsToFetch:o})}for(let i=0;i<e.nodes.removed.length;i+=1){const o=e.nodes.removed[i];removeDataRowFromTree({tree:t,treeDepths:r,updatedGroupsManager:n,id:o})}for(let i=0;i<e.nodes.modified.length;i+=1){const{id:l,path:a,serverChildrenCount:s}=e.nodes.modified[i];isDeepEqual(getNodePathInTree({tree:t,id:l}),a)?n?.addAction(t[l].parent,"modifyChildren"):(removeDataRowFromTree({tree:t,treeDepths:r,updatedGroupsManager:n,id:l}),insertDataRowInTree({previousTree:e.previousTree,tree:t,treeDepths:r,updatedGroupsManager:n,id:l,path:a,serverChildrenCount:s,onDuplicatePath:e.onDuplicatePath,isGroupExpandedByDefault:e.isGroupExpandedByDefault,defaultGroupingExpansionDepth:e.defaultGroupingExpansionDepth,groupsToFetch:o}))}const l=getTreeNodeDescendants(t,Fr,!0);return{tree:t,treeDepths:r,groupingName:e.groupingName,dataRowIds:l,updatedGroupsManager:n,groupsToFetch:Array.from(o)}},ys=["hideDescendantCount"],useGridTreeDataPreProcessors=(e,t)=>{const n=r.useCallback(()=>{e.current.setStrategyAvailability("rowTree",us.Default,t.treeData&&!t.unstable_dataSource?()=>!0:()=>!1)},[e,t.treeData,t.unstable_dataSource]),o=r.useCallback(()=>{const r=t.groupingColDef;let n;if("function"==typeof r){n=r({groupingName:us.Default,fields:[]})}else n=r;const o=n??{},{hideDescendantCount:l}=o,a=tt(o,ys),s=et({},as,{renderCell:e=>i.jsx(GridTreeDataGroupingCell,et({},e,{hideDescendantCount:l})),headerName:e.current.getLocaleText("treeDataGroupingHeaderName")});return et({},s,a,ss)},[e,t.groupingColDef]),l=r.useCallback(e=>{if(t.unstable_dataSource)return e;const r=ss.field,n=t.treeData,l=e.lookup[r];if(n){const t=o();l&&(t.width=l.width,t.flex=l.flex),e.lookup[r]=t,null==l&&(e.orderedFields=[r,...e.orderedFields])}else!n&&l&&(delete e.lookup[r],e.orderedFields=e.orderedFields.filter(e=>e!==r));return e},[t.treeData,t.unstable_dataSource,o]),a=r.useCallback(e=>{if(!t.getTreeDataPath)throw new Error("MUI X: No getTreeDataPath given.");const getRowTreeBuilderNode=r=>({id:r,path:t.getTreeDataPath(e.dataRowIdToModelLookup[r]).map(e=>({key:e,field:null}))}),onDuplicatePath=(e,t,r)=>{throw new Error(["MUI X: The path returned by `getTreeDataPath` should be unique.",`The rows with id #${e} and #${t} have the same.`,`Path: ${JSON.stringify(r.map(e=>e.key))}.`].join("\n"))};return"full"===e.updates.type?createRowTree({previousTree:e.previousTree,nodes:e.updates.rows.map(getRowTreeBuilderNode),defaultGroupingExpansionDepth:t.defaultGroupingExpansionDepth,isGroupExpandedByDefault:t.isGroupExpandedByDefault,groupingName:us.Default,onDuplicatePath}):updateRowTree({nodes:{inserted:e.updates.actions.insert.map(getRowTreeBuilderNode),modified:e.updates.actions.modify.map(getRowTreeBuilderNode),removed:e.updates.actions.remove},previousTree:e.previousTree,previousTreeDepth:e.previousTreeDepths,defaultGroupingExpansionDepth:t.defaultGroupingExpansionDepth,isGroupExpandedByDefault:t.isGroupExpandedByDefault,groupingName:us.Default})},[t.getTreeDataPath,t.defaultGroupingExpansionDepth,t.isGroupExpandedByDefault]),s=r.useCallback(r=>(e=>{const{apiRef:t,rowTree:r,disableChildrenFiltering:n,isRowMatchingFilters:o}=e,l={},i={},a={},s={},u={passingFilterItems:null,passingQuickFilterValues:null},filterTreeNode=(c,d,p)=>{let g;if(n&&c.depth>0)g=null;else if(o&&"footer"!==c.type){const r=t.current.getRow(c.id);o(r,void 0,u),g=passFilterLogic([u.passingFilterItems],[u.passingQuickFilterValues],e.filterModel,e.apiRef,s)}else g=!0;let h,m=0,C=0;switch("group"===c.type&&c.children.forEach(e=>{const t=r[e],n=filterTreeNode(t,g??d,p&&!!c.childrenExpanded);C+=n,n>0&&(m+=1)}),g){case!0:h=!0;break;case!1:h=C>0;break;default:h=d}return l[c.id]=h,h?(i[c.id]=m,a[c.id]=C,"footer"===c.type?C:C+1):0},c=Object.values(r);for(let d=0;d<c.length;d+=1){const e=c[d];0===e.depth&&filterTreeNode(e,!0,!0)}return{filteredRowsLookup:l,filteredChildrenCountLookup:i,filteredDescendantCountLookup:a}})({rowTree:Vt(e),isRowMatchingFilters:r.isRowMatchingFilters,disableChildrenFiltering:t.disableChildrenFiltering,filterModel:r.filterModel,apiRef:e}),[e,t.disableChildrenFiltering]),u=r.useCallback(r=>(e=>{const{rowTree:t,disableChildrenSorting:r,sortRowList:n}=e,o=new Map,sortGroup=e=>{let l;if(!n||r&&-1!==e.depth){for(let r=0;r<e.children.length;r+=1){const n=t[e.children[r]];"group"===n.type&&sortGroup(n)}l=[...e.children]}else{for(let r=0;r<e.children.length;r+=1){const n=t[e.children[r]];"group"===n.type&&sortGroup(n)}l=n(e.children.map(e=>t[e]))}null!=e.footerId&&l.push(e.footerId),o.set(e.id,l)};sortGroup(t[Fr]);const l=List.from(o.get(Fr));return l.forEach(e=>{const t=o.get(e.data);t?.length&&e.insertAfter(List.from(t))}),l.data()})({rowTree:Vt(e),sortRowList:r.sortRowList,disableChildrenSorting:t.disableChildrenSorting}),[e,t.disableChildrenSorting]);useGridRegisterPipeProcessor(e,"hydrateColumns",l),useGridRegisterStrategyProcessor(e,us.Default,"rowTreeCreation",a),useGridRegisterStrategyProcessor(e,us.Default,"filtering",s),useGridRegisterStrategyProcessor(e,us.Default,"sorting",u),useGridRegisterStrategyProcessor(e,us.Default,"visibleRowsLookupCreation",getVisibleRowsLookup),useFirstRender(()=>{n()});const c=r.useRef(!0);r.useEffect(()=>{c.current?c.current=!1:n()},[n])};const Ss=useGridPrivateApiContext$1,Is=createSelector(Xr,Ur,Mn,(e,t,r)=>et({groupKeys:[],paginationModel:r,sortModel:t,filterModel:e},(e=>{const t=e.page*e.pageSize;return{start:t,end:t+e.pageSize-1}})(r))),gridDataSourceStateSelector=e=>e.dataSource;createSelector(gridDataSourceStateSelector,e=>e.loading);const Ms=createSelectorV8(gridDataSourceStateSelector,(e,t)=>e.loading[t]??!1),Ps=createSelector(gridDataSourceStateSelector,e=>e.errors),ks=createSelectorV8(gridDataSourceStateSelector,(e,t)=>e.errors[t]),useUtilityClasses$5=e=>{const{classes:t}=e;return s({root:["treeDataGroupingCell"],toggle:["treeDataGroupingCellToggle"],loadingContainer:["treeDataGroupingCellLoadingContainer"]},getDataGridUtilityClass,t)};function GridTreeDataGroupingCellIcon(e){const t=Ss(),r=cs(),n=useUtilityClasses$5(r),{rowNode:o,id:l,field:a,descendantCount:s}=e,u=useGridSelectorV8(t,Ms,l),c=useGridSelectorV8(t,ks,l),d=o.childrenExpanded?r.slots.treeDataCollapseIcon:r.slots.treeDataExpandIcon;return u?i.jsx("div",{className:n.loadingContainer,children:i.jsx(q,{size:"1rem",color:"inherit"})}):-1===s||s>0?i.jsx(r.slots.baseIconButton,et({size:"small",onClick:e=>{o.childrenExpanded?t.current.setRowChildrenExpansion(l,!o.childrenExpanded):t.current.unstable_dataSource.fetchRows(l),t.current.setCellFocus(l,a),e.stopPropagation()},tabIndex:-1,"aria-label":o.childrenExpanded?t.current.getLocaleText("treeDataCollapse"):t.current.getLocaleText("treeDataExpand")},r?.slotProps?.baseIconButton,{children:i.jsx(r.slots.baseTooltip,{title:c?.message??null,children:i.jsx(r.slots.baseBadge,{variant:"dot",color:"error",invisible:!c,children:i.jsx(d,{fontSize:"inherit"})})})})):null}function GridDataSourceTreeDataGroupingCell(e){const{id:t,field:r,formattedValue:n,rowNode:o,hideDescendantCount:l,offsetMultiplier:a=2}=e,s=cs(),u=Ss(),c=useGridSelector(u,e=>e.rows.dataRowIdToModelLookup[t]),d=useUtilityClasses$5(s);let p=0;return c&&(p=s.unstable_dataSource?.getChildrenCount?.(c)??0),i.jsxs(se,{className:d.root,sx:{ml:o.depth*a},children:[i.jsx("div",{className:d.toggle,children:i.jsx(GridTreeDataGroupingCellIcon,{id:t,field:r,rowNode:o,row:c,descendantCount:p})}),i.jsxs("span",{children:[void 0===n?o.groupingKey:n,!l&&p>0?` (${p})`:""]})]})}const Ds=["hideDescendantCount"],useGridDataSourceTreeDataPreProcessors=(e,t)=>{const n=r.useCallback(()=>{e.current.setStrategyAvailability("rowTree",us.DataSource,t.treeData&&t.unstable_dataSource?()=>!0:()=>!1)},[e,t.treeData,t.unstable_dataSource]),o=r.useCallback(()=>{const r=t.groupingColDef;let n;if("function"==typeof r){n=r({groupingName:us.DataSource,fields:[]})}else n=r;const o=n??{},{hideDescendantCount:l}=o,a=tt(o,Ds),s=et({},as,{renderCell:e=>i.jsx(GridDataSourceTreeDataGroupingCell,et({},e,{hideDescendantCount:l})),headerName:e.current.getLocaleText("treeDataGroupingHeaderName")});return et({},s,a,ss)},[e,t.groupingColDef]),l=r.useCallback(e=>{if(!t.unstable_dataSource)return e;const r=ss.field,n=t.treeData,l=e.lookup[r];if(n){const t=o();l&&(t.width=l.width,t.flex=l.flex),e.lookup[r]=t,null==l&&(e.orderedFields=[r,...e.orderedFields])}else!n&&l&&(delete e.lookup[r],e.orderedFields=e.orderedFields.filter(e=>e!==r));return e},[t.treeData,t.unstable_dataSource,o]),a=r.useCallback(e=>{const r=t.unstable_dataSource?.getGroupKey;if(!r)throw new Error("MUI X: No `getGroupKey` method provided with the dataSource.");const n=t.unstable_dataSource?.getChildrenCount;if(!n)throw new Error("MUI X: No `getChildrenCount` method provided with the dataSource.");const o=e.updates.groupKeys??[],getRowTreeBuilderNode=t=>{const l=n(e.dataRowIdToModelLookup[t]);return{id:t,path:[...o,r(e.dataRowIdToModelLookup[t])].map(e=>({key:e,field:null})),serverChildrenCount:l}},onDuplicatePath=(e,t,r)=>{throw new Error(["MUI X: The values returned by `getGroupKey` for all the sibling rows should be unique.",`The rows with id #${e} and #${t} have the same.`,`Path: ${JSON.stringify(r.map(e=>e.key))}.`].join("\n"))};return"full"===e.updates.type?createRowTree({previousTree:e.previousTree,nodes:e.updates.rows.map(getRowTreeBuilderNode),defaultGroupingExpansionDepth:t.defaultGroupingExpansionDepth,isGroupExpandedByDefault:t.isGroupExpandedByDefault,groupingName:us.DataSource,onDuplicatePath}):updateRowTree({nodes:{inserted:e.updates.actions.insert.map(getRowTreeBuilderNode),modified:e.updates.actions.modify.map(getRowTreeBuilderNode),removed:e.updates.actions.remove},previousTree:e.previousTree,previousGroupsToFetch:e.previousGroupsToFetch,previousTreeDepth:e.previousTreeDepths,defaultGroupingExpansionDepth:t.defaultGroupingExpansionDepth,isGroupExpandedByDefault:t.isGroupExpandedByDefault,groupingName:us.DataSource})},[t.unstable_dataSource,t.defaultGroupingExpansionDepth,t.isGroupExpandedByDefault]),s=r.useCallback(()=>function skipFiltering(e){const t={},r={},n=Object.values(e);for(let o=0;o<n.length;o+=1){const e=n[o];t[e.id]=!0,r[e.id]=e.serverChildrenCount??0}return{filteredRowsLookup:t,filteredChildrenCountLookup:r,filteredDescendantCountLookup:ar.filteredDescendantCountLookup}}(Vt(e)),[e]),u=r.useCallback(()=>function skipSorting(e){return getTreeNodeDescendants(e,Fr,!1)}(Vt(e)),[e]);useGridRegisterPipeProcessor(e,"hydrateColumns",l),useGridRegisterStrategyProcessor(e,us.DataSource,"rowTreeCreation",a),useGridRegisterStrategyProcessor(e,us.DataSource,"filtering",s),useGridRegisterStrategyProcessor(e,us.DataSource,"sorting",u),useGridRegisterStrategyProcessor(e,us.DataSource,"visibleRowsLookupCreation",getVisibleRowsLookup),useFirstRender(()=>{n()});const c=r.useRef(!0);r.useEffect(()=>{c.current?c.current=!1:n()},[n])},columnPinningStateInitializer=(e,t,r)=>{let n;return r.current.caches.columnPinning={orderedFieldsBeforePinningColumns:null},n=t.pinnedColumns?t.pinnedColumns:t.initialState?.pinnedColumns?t.initialState.pinnedColumns:{},et({},e,{pinnedColumns:n})};function setState(e,t){e.current.setState(e=>et({},e,{pinnedColumns:t}))}const Es=et({},Sr,{type:"custom",field:Lr,editable:!1,sortable:!1,filterable:!1,resizable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,align:"left",width:40,valueGetter:(e,t,r,n)=>{const o=gridRowIdSelector(n.current.state,t);return gridDetailPanelExpandedRowIdsSelector(n.current.state).includes(o)},renderCell:e=>i.jsx(GridDetailPanelToggleCell,et({},e)),renderHeader:({colDef:e})=>i.jsx("div",{"aria-label":e.headerName})}),detailPanelStateInitializer=(e,t)=>et({},e,{detailPanel:{heightCache:{},expandedRowIds:t.detailPanelExpandedRowIds??t.initialState?.detailPanel?.expandedRowIds??[]}});function cacheContentAndHeight(e,t,r,n){if("function"!=typeof t)return{};const o=Ut(e),l=o.reduce((r,n)=>{const o=e.current.getRowParams(n);return r[n]=t(o),r},{}),i=o.reduce((t,o)=>{if(null==l[o])return t;const i=e.current.getRowParams(o),a=r(i),s="auto"===a;return t[o]={autoHeight:s,height:s?n[o]?.height:a},t},{});return{contentCache:l,heightCache:i}}const Fs=et({},Sr,{type:"custom",field:"__reorder__",sortable:!1,filterable:!1,width:50,align:"center",headerAlign:"center",disableColumnMenu:!0,disableExport:!0,disableReorder:!0,resizable:!1,aggregable:!1,renderHeader:()=>" ",renderCell:e=>"footer"===e.rowNode.type||"pinnedRow"===e.rowNode.type?null:i.jsx(GridRowReorderCell,et({},e))});var Gs=function(e){return e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e}(Gs||{});let Hs=null,Ts={previousTargetId:null,dragDirection:null};const useGridRowReorder=(e,t)=>{const n=useGridLogger(e,"useGridRowReorder"),o=useGridSelector(e,Ur),l=useGridSelector(e,Wt),i=r.useRef(null),a=r.useRef(null),u=r.useRef(void 0),c=(e=>{const{classes:t}=e;return s({rowDragging:["row--dragging"]},getDataGridUtilityClass,t)})({classes:t.classes}),[d,p]=r.useState(""),g=useGridSelector(e,Kr);r.useEffect(()=>()=>{clearTimeout(u.current)},[]);const h=r.useMemo(()=>!t.rowReordering||!!o.length||1!==l,[t.rowReordering,o,l]),m=r.useCallback((t,r)=>{const o=gridEditRowsStateSelector(e.current.state);h||0!==Object.keys(o).length||(n.debug(`Start dragging row ${t.id}`),r.stopPropagation(),i.current=r.currentTarget,i.current.classList.add(c.rowDragging),p(t.id),u.current=setTimeout(()=>{i.current.classList.remove(c.rowDragging)}),a.current=g[t.id],e.current.setCellFocus(t.id,Fs.field))},[e,h,n,c.rowDragging,g]),C=r.useCallback((t,r)=>{if(""===d)return;const o=e.current.getRowNode(t.id);if(!o||"footer"===o.type||"pinnedRow"===o.type)return;n.debug(`Dragging over row ${t.id}`),r.preventDefault(),r.stopPropagation();const l=Hs?Hs.y-r.clientY:r.clientY;if(t.id!==d){const r=g[t.id],n={dragDirection:l>0?Gs.DOWN:Gs.UP,previousTargetId:t.id},o=n.dragDirection!==Ts.dragDirection||n.previousTargetId!==Ts.previousTargetId;(null===Ts.dragDirection||Math.abs(l)>=1&&o)&&(e.current.setRowIndex(d,r),Ts=n)}Hs={x:r.clientX,y:r.clientY}},[d,e,n,g]),b=r.useCallback((t,r)=>{const o=gridEditRowsStateSelector(e.current.state);if(""!==d&&!h&&0===Object.keys(o).length){if(n.debug("End dragging row"),r.preventDefault(),r.stopPropagation(),clearTimeout(u.current),i.current=null,Ts.dragDirection=null,"none"===r.dataTransfer.dropEffect)e.current.setRowIndex(d,a.current),a.current=null;else{const r={row:e.current.getRow(d),targetIndex:g[t.id],oldIndex:a.current};e.current.publishEvent("rowOrderChange",r)}p("")}},[e,d,h,n,g]);Dt(e,"rowDragStart",m),Dt(e,"rowDragOver",C),Dt(e,"rowDragEnd",b),Dt(e,"cellDragOver",C),useGridApiOptionHandler(e,"rowOrderChange",t.onRowOrderChange)},useGridRowReorderPreProcessors=(e,t)=>{const n=(e=>{const{classes:t}=e;return r.useMemo(()=>s({rowReorderCellContainer:["rowReorderCellContainer"],columnHeaderReorder:["columnHeaderReorder"]},getDataGridUtilityClass,t),[t])})({classes:t.classes}),o=r.useCallback(r=>{const o=et({},Fs,{cellClassName:n.rowReorderCellContainer,headerClassName:n.columnHeaderReorder,headerName:e.current.getLocaleText("rowReorderingHeaderName")}),l=t.rowReordering,i=null!=r.lookup[o.field];return l&&!i?(r.lookup[o.field]=o,r.orderedFields=[o.field,...r.orderedFields]):!l&&i?(delete r.lookup[o.field],r.orderedFields=r.orderedFields.filter(e=>e!==o.field)):l&&i&&(r.lookup[o.field]=et({},o,r.lookup[o.field]),t.columns.some(e=>e.field===Fs.field)||(r.orderedFields=[o.field,...r.orderedFields.filter(e=>e!==o.field)])),r},[e,n,t.columns,t.rowReordering]);useGridRegisterPipeProcessor(e,"hydrateColumns",o)};const getSkeletonRowId=e=>`auto-generated-skeleton-row-root-${e}`;function createPinnedRowsInternalCache(e,t){const r={topIds:[],bottomIds:[],idLookup:{}};return e?.top?.forEach(e=>{const n=getRowIdFromRowModel(e,t);r.topIds.push(n),r.idLookup[n]=e}),e?.bottom?.forEach(e=>{const n=getRowIdFromRowModel(e,t);r.bottomIds.push(n),r.idLookup[n]=e}),r}const rowPinningStateInitializer=(e,t,r)=>(r.current.caches.pinnedRows=createPinnedRowsInternalCache(t.pinnedRows,t.getRowId),et({},e,{rows:et({},e.rows,{additionalRowGroups:et({},e.rows?.additionalRowGroups,{pinnedRows:{top:[],bottom:[]}})})}));function addPinnedRow({groupingParams:e,rowModel:t,rowId:r,position:n,apiRef:o,isAutoGenerated:l}){const i=et({},e.dataRowIdToModelLookup),a=et({},e.dataRowIdToIdLookup),s=et({},e.tree),u=et({},e.treeDepths);insertNodeInTree({type:"pinnedRow",id:r,depth:0,parent:Fr,isAutoGenerated:l},s,u,null),i[r]=t,a[r]=r,o.current.caches.rows.dataRowIdToModelLookup[r]=et({},t),o.current.caches.rows.dataRowIdToIdLookup[r]=r;const c=e.additionalRowGroups?.pinnedRows||{},d={id:r,model:t};return e.additionalRowGroups?.pinnedRows?.[n]?.includes(d)?et({},e,{dataRowIdToModelLookup:i,dataRowIdToIdLookup:a,tree:s,treeDepths:u}):et({},e,{dataRowIdToModelLookup:i,dataRowIdToIdLookup:a,tree:s,treeDepths:u,additionalRowGroups:et({},e.additionalRowGroups,{pinnedRows:et({},c,{[n]:[...c[n]||[],d]})})})}const runIfServerMode=(e,t)=>()=>{"server"===e&&t()};let Os=function(e){return e[e.QUEUED=0]="QUEUED",e[e.PENDING=1]="PENDING",e[e.SETTLED=2]="SETTLED",e[e.UNKNOWN=3]="UNKNOWN",e}({});class NestedDataManager{constructor(e,t=Infinity){this.pendingRequests=new Set,this.queuedRequests=new Set,this.settledRequests=new Set,this.api=void 0,this.maxConcurrentRequests=void 0,this.processQueue=async()=>{if(0===this.queuedRequests.size||this.pendingRequests.size>=this.maxConcurrentRequests)return;const e=Math.min(this.maxConcurrentRequests-this.pendingRequests.size,this.queuedRequests.size);if(0===e)return;const t=Array.from(this.queuedRequests);for(let r=0;r<e;r+=1){const e=t[r];this.queuedRequests.delete(e),this.pendingRequests.add(e),this.api.fetchRowChildren(e)}},this.queue=async e=>{const t={};e.forEach(e=>{this.queuedRequests.add(e),t[e]=!0}),this.api.setState(e=>et({},e,{dataSource:et({},e.dataSource,{loading:et({},e.dataSource.loading,t)})})),this.processQueue()},this.setRequestSettled=e=>{this.pendingRequests.delete(e),this.settledRequests.add(e),this.processQueue()},this.clear=()=>{this.queuedRequests.clear(),Array.from(this.pendingRequests).forEach(e=>this.clearPendingRequest(e))},this.clearPendingRequest=e=>{this.api.unstable_dataSource.setChildrenLoading(e,!1),this.pendingRequests.delete(e),this.processQueue()},this.getRequestStatus=e=>this.pendingRequests.has(e)?Os.PENDING:this.queuedRequests.has(e)?Os.QUEUED:this.settledRequests.has(e)?Os.SETTLED:Os.UNKNOWN,this.getActiveRequestsCount=()=>this.pendingRequests.size+this.queuedRequests.size,this.api=e.current,this.maxConcurrentRequests=t}}function getKey(e){return JSON.stringify([e.paginationModel,e.filterModel,e.sortModel,e.groupKeys,e.groupFields])}class GridDataSourceCacheDefault{constructor({ttl:e=3e5}){this.cache=void 0,this.ttl=void 0,this.cache={},this.ttl=e}set(e,t){const r=getKey(e),n=Date.now()+this.ttl;this.cache[r]={value:t,expiry:n}}get(e){const t=getKey(e),r=this.cache[t];if(r){if(!(Date.now()>r.expiry))return r.value;delete this.cache[t]}}clear(){this.cache={}}}const Ls={loading:{},errors:{}},As={clear:()=>{},get:()=>{},set:()=>{}};function getCache(e){return null===e?As:e??new GridDataSourceCacheDefault({})}const dataSourceStateInitializer=e=>et({},e,{dataSource:Ls}),useDataGridProComponent=(e,n)=>{const o=useGridInitialization(e,n);return((e,t)=>{const n=r.useCallback(r=>{const n=et({},Es,{headerName:e.current.getLocaleText("detailPanelToggle")}),o=!!t.getDetailPanelContent,l=null!=r.lookup[Lr];return o&&!l?(r.lookup[Lr]=n,r.orderedFields=[Lr,...r.orderedFields]):!o&&l?(delete r.lookup[Lr],r.orderedFields=r.orderedFields.filter(e=>e!==Lr)):o&&l&&(r.lookup[Lr]=et({},n,r.lookup[Lr]),t.columns.some(e=>e.field===Lr)||(r.orderedFields=[Lr,...r.orderedFields.filter(e=>e!==Lr)])),r},[e,t.columns,t.getDetailPanelContent]),o=r.useCallback((r,n)=>null==t.getDetailPanelContent?r:gridDetailPanelExpandedRowIdsSelector(e.current.state).includes(n)?[...r,Mt["row--detailPanelExpanded"]]:r,[e,t.getDetailPanelContent]);useGridRegisterPipeProcessor(e,"hydrateColumns",n),useGridRegisterPipeProcessor(e,"rowClassName",o)})(o,n),useGridTreeDataPreProcessors(o,n),useGridDataSourceTreeDataPreProcessors(o,n),useGridRowSelectionPreProcessors(o,n),((e,t)=>{const n=r.useCallback(e=>{const r=e.tree[Fr];if("server"!==t.rowsLoadingMode||!t.rowCount||r.children.length>=t.rowCount)return e;const n=et({},e.tree),o=[...r.children];for(let l=0;l<t.rowCount-r.children.length;l+=1){const e=getSkeletonRowId(l);o.push(e);const t={type:"skeletonRow",id:e,parent:Fr,depth:0};n[e]=t}return n[Fr]=et({},r,{children:o}),et({},e,{tree:n})},[t.rowCount,t.rowsLoadingMode]);useGridRegisterPipeProcessor(e,"hydrateRows",n)})(o,n),(e=>{const t=r.useRef(null),n=r.useCallback(r=>{const n=e.current.caches.pinnedRows||{},o=t.current;t.current=n;let l=et({},r,{additionalRowGroups:et({},r.additionalRowGroups,{pinnedRows:{}})});if(o){const pinnedRowCleanup=t=>{const r=l.tree[t];"pinnedRow"===r?.type&&(delete l.tree[t],delete l.dataRowIdToModelLookup[t],delete l.dataRowIdToIdLookup[t],delete e.current.caches.rows.dataRowIdToIdLookup[t],delete e.current.caches.rows.dataRowIdToModelLookup[t])};o.topIds?.forEach(pinnedRowCleanup),o.bottomIds?.forEach(pinnedRowCleanup)}if(n.topIds?.forEach(t=>{l=addPinnedRow({groupingParams:l,rowModel:n.idLookup[t],rowId:t,position:"top",apiRef:e,isAutoGenerated:!1})}),n.bottomIds?.forEach(t=>{l=addPinnedRow({groupingParams:l,rowModel:n.idLookup[t],rowId:t,position:"bottom",apiRef:e,isAutoGenerated:!1})}),n.bottomIds?.length||n.topIds?.length){const shouldKeepRow=e=>!l.tree[e]||"pinnedRow"!==l.tree[e].type,e=l.tree[Fr];l.tree[Fr]=et({},e,{children:e.children.filter(shouldKeepRow)}),l.dataRowIds=l.dataRowIds.filter(shouldKeepRow)}return l},[e]);useGridRegisterPipeProcessor(e,"hydrateRows",n)})(o),useGridRowReorderPreProcessors(o,n),((e,t)=>{const{disableColumnPinning:n}=t,o=r.useRef([]),l=r.useCallback(t=>{if(0===t.orderedFields.length||n)return t;const r=e.current.state;e.current.state=et({},r,{columns:t});const l=mr(e);e.current.state=r;const i=l.left,a=l.right;let s;const u=[...i,...a],{orderedFieldsBeforePinningColumns:c}=e.current.caches.columnPinning;if(c){s=new Array(t.orderedFields.length).fill(null);const r=[...s],n=[...t.orderedFields];o.current.forEach(e=>{if(!u.includes(e)&&t.lookup[e]){const t=c.indexOf(e);s[t]=e,r[t]=e,n.splice(n.indexOf(e),1)}}),u.forEach(e=>{let o=c.indexOf(e);if((-1===o||o>=r.length)&&(o=t.orderedFields.indexOf(e)),null!==r[o])for(o=0;null!==r[o];)o+=1;s[o]=e,r[o]=e,n.splice(n.indexOf(e),1)});let l=0;n.forEach(e=>{for(;null!==r[l];)l+=1;r[l]=e,s[l]=e}),e.current.caches.columnPinning.orderedFieldsBeforePinningColumns=r}else s=[...t.orderedFields],e.current.caches.columnPinning.orderedFieldsBeforePinningColumns=[...t.orderedFields];o.current=u;const d=s.filter(e=>!i.includes(e)&&!a.includes(e));return et({},t,{orderedFields:[...i,...d,...a]})},[e,n]);useGridRegisterPipeProcessor(e,"hydrateColumns",l);const i=r.useCallback((t,r)=>e.current.isColumnPinned(r),[e]);useGridRegisterPipeProcessor(e,"isColumnPinned",i)})(o,n),(e=>{useGridRegisterStrategyProcessor(e,Pa,"rowTreeCreation",flatRowTreeCreationMethod)})(o),useGridInitializeState(propsStateInitializer,o,n),useGridInitializeState(headerFilteringStateInitializer,o,n),useGridInitializeState(rowSelectionStateInitializer,o,n),useGridInitializeState(detailPanelStateInitializer,o,n),useGridInitializeState(columnPinningStateInitializer,o,n),useGridInitializeState(columnsStateInitializer,o,n),useGridInitializeState(rowPinningStateInitializer,o,n),useGridInitializeState(rowsStateInitializer,o,n),useGridInitializeState(paginationStateInitializer,o,n),useGridInitializeState(editingStateInitializer,o,n),useGridInitializeState(focusStateInitializer,o,n),useGridInitializeState(sortingStateInitializer,o,n),useGridInitializeState(preferencePanelStateInitializer,o,n),useGridInitializeState(filterStateInitializer,o,n),useGridInitializeState(rowSpanningStateInitializer,o,n),useGridInitializeState(densityStateInitializer,o,n),useGridInitializeState(columnReorderStateInitializer,o,n),useGridInitializeState(columnResizeStateInitializer,o,n),useGridInitializeState(columnMenuStateInitializer,o,n),useGridInitializeState(columnGroupsStateInitializer,o,n),useGridInitializeState(virtualizationStateInitializer,o,n),useGridInitializeState(dataSourceStateInitializer,o,n),useGridInitializeState(dimensionsStateInitializer,o,n),useGridInitializeState(rowsMetaStateInitializer,o,n),useGridInitializeState(listViewStateInitializer,o,n),((e,t)=>{const n=useGridLogger(e,"useGridHeaderFiltering"),o=r.useCallback(r=>{e.current.setState(e=>"DataGrid"===t.signature?e:et({},e,{headerFiltering:{enabled:t.headerFilters??!1,editing:r.editing??null,menuOpen:r.menuOpen??null}})),e.current.forceUpdate()},[e,t.signature,t.headerFilters]),l=r.useCallback(t=>{n.debug(`Starting edit mode on header filter for field: ${t}`),e.current.setHeaderFilterState({editing:t})},[e,n]),i=r.useCallback(()=>{n.debug("Stopping edit mode on header filter"),e.current.setHeaderFilterState({editing:null})},[e,n]),a=r.useCallback(t=>{n.debug(`Opening header filter menu for field: ${t}`),e.current.setHeaderFilterState({menuOpen:t})},[e,n]),s=r.useCallback(()=>{n.debug("Hiding header filter menu for active field");let t=e.current.state.headerFiltering.menuOpen;if(t){const r=dr(e),n=gr(e),o=cr(e);if(r[t]||(t=o[0]),!1===n[t]){const e=o.filter(e=>e===t||!1!==n[e]),r=e.indexOf(t);t=e[r+1]||e[r-1]}e.current.setHeaderFilterState({menuOpen:null}),e.current.setColumnHeaderFilterFocus(t)}},[e,n]),u={setHeaderFilterState:o};useGridApiMethod(e,{startHeaderFilterEditMode:l,stopHeaderFilterEditMode:i,showHeaderFilterMenu:a,hideHeaderFilterMenu:s},"public"),useGridApiMethod(e,u,"private");const c=r.useRef(!0);r.useEffect(()=>{c.current?c.current=!1:e.current.setHeaderFilterState({enabled:t.headerFilters??!1})},[e,t.headerFilters])})(o,n),((e,t)=>{const n=r.useCallback((r,n)=>{if(e.current.getCellParams(r.id,r.field).colDef.field===Tr&&(" "===n.key||"Enter"===n.key)&&!n.shiftKey){if("group"!==r.rowNode.type)return;if(t.unstable_dataSource&&!r.rowNode.childrenExpanded)return void e.current.unstable_dataSource.fetchRows(r.id);e.current.setRowChildrenExpansion(r.id,!r.rowNode.childrenExpanded)}},[e,t.unstable_dataSource]);Dt(e,"cellKeyDown",n)})(o,n),useGridKeyboardNavigation(o,n),useGridRowSelection(o,n),((e,t)=>{const n=useGridSelector(e,gridPinnedColumnsSelector),o=r.useCallback((t,r)=>{const n=Cr(e);if(!r.colIndex||0===n.left.length&&0===n.right.length)return t;const o=fr(e),l=yt(e),i=br(e),a=e.current.virtualScrollerRef.current.clientWidth,s=Math.abs(e.current.virtualScrollerRef.current.scrollLeft),u=o[r.colIndex].computedWidth,c=i[r.colIndex],d=i[n.left.length],p=l-i[i.length-n.right.length],g=c+u;return g-(a-p)>s?et({},t,{left:g-(a-p)}):c<s+d?et({},t,{left:c-d}):t},[e]),l=r.useCallback((e,r)=>t.disableColumnPinning||!1===r.pinnable?e:[...e,"columnMenuPinningItem"],[t.disableColumnPinning]),i=r.useCallback((t,{targetIndex:r})=>{const n=Cr(e);return 0===n.left.length&&0===n.right.length?t:!(n.left.length>0&&r<n.left.length)&&(n.right.length>0?!(r>=fr(e).length-n.right.length)&&t:t)},[e]),a=r.useCallback((r,n)=>{const o=gridPinnedColumnsSelector(e.current.state);return!n.exportOnlyDirtyModels||null!=t.pinnedColumns||null!=t.initialState?.pinnedColumns||(o.left??[]).length>0||(o.right??[]).length>0?et({},r,{pinnedColumns:o}):r},[e,t.pinnedColumns,t.initialState?.pinnedColumns]),s=r.useCallback((t,r)=>{const n=r.stateToRestore.pinnedColumns;return null!=n&&setState(e,n),t},[e]);useGridRegisterPipeProcessor(e,"scrollToIndexes",o),useGridRegisterPipeProcessor(e,"columnMenu",l),useGridRegisterPipeProcessor(e,"canBeReordered",i),useGridRegisterPipeProcessor(e,"exportState",a),useGridRegisterPipeProcessor(e,"restoreState",s),e.current.registerControlState({stateId:"pinnedColumns",propModel:t.pinnedColumns,propOnChange:t.onPinnedColumnsChange,stateSelector:gridPinnedColumnsSelector,changeEvent:"pinnedColumnsChange"});const u=r.useCallback((t,r)=>{if(e.current.isColumnPinned(t)===r)return;const o=r===sr.RIGHT?sr.LEFT:sr.RIGHT,l={[r]:[...n[r]||[],t],[o]:(n[o]||[]).filter(e=>e!==t)};e.current.setPinnedColumns(l)},[e,n]),c=r.useCallback(t=>{e.current.setPinnedColumns({left:(n.left||[]).filter(e=>e!==t),right:(n.right||[]).filter(e=>e!==t)})},[e,n.left,n.right]),d=r.useCallback(()=>gridPinnedColumnsSelector(e.current.state),[e]),p=r.useCallback(t=>{setState(e,t),e.current.requestPipeProcessorsApplication("hydrateColumns")},[e]),g=r.useCallback(e=>(n.left||[]).includes(e)?sr.LEFT:!!(n.right||[]).includes(e)&&sr.RIGHT,[n.left,n.right]);useGridApiMethod(e,{pinColumn:u,unpinColumn:c,getPinnedColumns:d,setPinnedColumns:p,isColumnPinned:g},"public"),Dt(e,"columnOrderChange",t=>{if(!e.current.caches.columnPinning.orderedFieldsBeforePinningColumns)return;const{column:r,targetIndex:n,oldIndex:o}=t,l=n>o?1:-1,i=cr(e)[n-l],a=[...e.current.caches.columnPinning.orderedFieldsBeforePinningColumns];let s=a.findIndex(e=>e===r.field),u=s+l;const c=a.findIndex(e=>e===i);for(;l>0?s<c:s>c;){for(;e.current.isColumnPinned(a[u]);)u+=l;const t=a[s];a[s]=a[u],a[u]=t,s=u,u=s+l}e.current.caches.columnPinning.orderedFieldsBeforePinningColumns=a}),r.useEffect(()=>{t.pinnedColumns&&e.current.setPinnedColumns(t.pinnedColumns)},[e,t.pinnedColumns])})(o,n),((e,t)=>{const n=r.useCallback(r=>{e.current.caches.pinnedRows=createPinnedRowsInternalCache(r,t.getRowId),e.current.requestPipeProcessorsApplication("hydrateRows")},[e,t.getRowId]);useGridApiMethod(e,{unstable_setPinnedRows:n},"public");const o=r.useRef(!0);r.useEffect(()=>{o.current?o.current=!1:e.current.unstable_setPinnedRows(t.pinnedRows)},[e,t.pinnedRows])})(o,n),function useGridColumns(e,t){const n=useGridLogger(e,"useGridColumns"),o=r.useRef(t.columns);e.current.registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:gr,changeEvent:"columnVisibilityModelChange"});const l=r.useCallback(t=>{n.debug("Updating columns state."),e.current.setState(mergeColumnsState(t)),e.current.publishEvent("columnsChange",t.orderedFields)},[n,e]),a=r.useCallback(t=>dr(e)[t],[e]),s=r.useCallback(()=>pr(e),[e]),u=r.useCallback(()=>fr(e),[e]),c=r.useCallback((t,r=!0)=>(r?fr(e):pr(e)).findIndex(e=>e.field===t),[e]),d=r.useCallback(t=>{const r=c(t);return br(e)[r]},[e,c]),p=r.useCallback(t=>{gr(e)!==t&&(e.current.setState(r=>et({},r,{columns:createColumnsState({apiRef:e,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:t,keepOnlyColumnsToUpsert:!1})})),e.current.updateRenderContext?.(),e.current.forceUpdate())},[e]),g=r.useCallback(t=>{const r=createColumnsState({apiRef:e,columnsToUpsert:t,initialState:void 0,keepOnlyColumnsToUpsert:!1});l(r)},[e,l]),h=r.useCallback((t,r)=>{const n=gr(e);if(r!==(n[t]??!0)){const o=et({},n,{[t]:r});e.current.setColumnVisibilityModel(o)}},[e]),m=r.useCallback(t=>cr(e).findIndex(e=>e===t),[e]),C=r.useCallback((t,r)=>{const o=cr(e),i=m(t);if(i===r)return;n.debug(`Moving column ${t} to index ${r}`);const a=[...o],s=a.splice(i,1)[0];a.splice(r,0,s),l(et({},gridColumnsStateSelector(e.current.state),{orderedFields:a}));const u={column:e.current.getColumn(t),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(t),oldIndex:i};e.current.publishEvent("columnIndexChange",u)},[e,n,l,m]),b=r.useCallback((t,r)=>{n.debug(`Updating column ${t} width to ${r}`);const o=gridColumnsStateSelector(e.current.state),i=o.lookup[t],a=et({},i,{width:r,hasBeenResized:!0});l(hydrateColumnsWidth(et({},o,{lookup:et({},o.lookup,{[t]:a})}),e.current.getRootDimensions())),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(t),colDef:a,width:r})},[e,n,l]),w={setColumnIndex:C};useGridApiMethod(e,{getColumn:a,getAllColumns:s,getColumnIndex:c,getColumnPosition:d,getVisibleColumns:u,getColumnIndexRelativeToVisibleColumns:m,updateColumns:g,setColumnVisibilityModel:p,setColumnVisibility:h,setColumnWidth:b},"public"),useGridApiMethod(e,w,t.signature===kt.DataGrid?"private":"public");const v=r.useCallback((r,n)=>{const o={},l=gr(e);(!n.exportOnlyDirtyModels||null!=t.columnVisibilityModel||Object.keys(t.initialState?.columns?.columnVisibilityModel??{}).length>0||Object.keys(l).length>0)&&(o.columnVisibilityModel=l),o.orderedFields=cr(e);const i=pr(e),a={};return i.forEach(e=>{if(e.hasBeenResized){const t={};ao.forEach(r=>{let n=e[r];n===1/0&&(n=-1),t[r]=n}),a[e.field]=t}}),Object.keys(a).length>0&&(o.dimensions=a),et({},r,{columns:o})},[e,t.columnVisibilityModel,t.initialState?.columns]),x=r.useCallback((t,r)=>{const n=r.stateToRestore.columns?.columnVisibilityModel,o=r.stateToRestore.columns;if(null==n&&null==o)return t;const l=createColumnsState({apiRef:e,columnsToUpsert:[],initialState:o,columnVisibilityModel:n,keepOnlyColumnsToUpsert:!1});return e.current.setState(mergeColumnsState(l)),null!=o&&e.current.publishEvent("columnsChange",l.orderedFields),t},[e]),R=r.useCallback((e,r)=>{if(r===rl.columns){const e=t.slots.columnsPanel;return i.jsx(e,et({},t.slotProps?.columnsPanel))}return e},[t.slots.columnsPanel,t.slotProps?.columnsPanel]),y=r.useCallback(e=>t.disableColumnSelector?e:[...e,"columnMenuColumnsItem"],[t.disableColumnSelector]);useGridRegisterPipeProcessor(e,"columnMenu",y),useGridRegisterPipeProcessor(e,"exportState",v),useGridRegisterPipeProcessor(e,"restoreState",x),useGridRegisterPipeProcessor(e,"preferencePanel",R);const S=r.useRef(null);Dt(e,"viewportInnerSizeChange",t=>{if(S.current!==t.width){if(S.current=t.width,!fr(e).some(e=>e.flex&&e.flex>0))return;l(hydrateColumnsWidth(gridColumnsStateSelector(e.current.state),e.current.getRootDimensions()))}});const I=r.useCallback(()=>{n.info("Columns pipe processing have changed, regenerating the columns");const t=createColumnsState({apiRef:e,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1});l(t)},[e,n,l]);useGridRegisterPipeApplier(e,"hydrateColumns",I);const M=r.useRef(!0);r.useEffect(()=>{if(M.current)return void(M.current=!1);if(n.info(`GridColumns have changed, new length ${t.columns.length}`),o.current===t.columns)return;const r=createColumnsState({apiRef:e,initialState:void 0,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0});o.current=t.columns,l(r)},[n,e,l,t.columns]),r.useEffect(()=>{void 0!==t.columnVisibilityModel&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,n,t.columnVisibilityModel])}(o,n),((e,n)=>{const o=useGridLogger(e,"useGridRows"),l=r.useRef(Date.now()),i=r.useRef(n.rowCount),a=d(),s=r.useCallback(t=>{const r=$t(e)[t];if(r)return r;const n=e.current.getRowNode(t);return n&&isAutogeneratedRowNode(n)?{[Gr]:t}:null},[e]),u=r.useCallback(t=>gridRowIdSelector(e.current.state,t),[e]),c=r.useCallback(({cache:t,throttle:r})=>{const run=()=>{l.current=Date.now(),e.current.setState(t=>et({},t,{rows:getRowsStateFromCache({apiRef:e,rowCountProp:n.rowCount,loadingProp:n.loading,previousTree:Vt(e),previousTreeDepths:_t(e),previousGroupsToFetch:Nt(e)})})),e.current.publishEvent("rowsSet"),e.current.forceUpdate()};if(a.clear(),e.current.caches.rows=t,!r)return void run();const o=n.throttleRowsMs-(Date.now()-l.current);o>0?a.start(o,run):run()},[n.throttleRowsMs,n.rowCount,n.loading,e,a]),p=r.useCallback(t=>{o.debug(`Updating all rows, new length ${t.length}`);const r=createRowsInternalCache({rows:t,getRowId:n.getRowId,loading:n.loading,rowCount:n.rowCount}),l=e.current.caches.rows;r.rowsBeforePartialUpdates=l.rowsBeforePartialUpdates,c({cache:r,throttle:!0})},[o,n.getRowId,n.loading,n.rowCount,c,e]),g=r.useCallback(t=>{if(n.signature===kt.DataGrid&&t.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"));const r=computeRowsUpdates(e,t,n.getRowId),o=updateCacheWithNewRows({updates:r,getRowId:n.getRowId,previousCache:e.current.caches.rows});c({cache:o,throttle:!0})},[n.signature,n.getRowId,c,e]),h=r.useCallback((t,r)=>{const o=computeRowsUpdates(e,t,n.getRowId),l=updateCacheWithNewRows({updates:o,getRowId:n.getRowId,previousCache:e.current.caches.rows,groupKeys:r??[]});c({cache:l,throttle:!1})},[n.getRowId,c,e]),m=r.useCallback(t=>{t!==n.loading&&(o.debug(`Setting loading to ${t}`),e.current.setState(e=>et({},e,{rows:et({},e.rows,{loading:t})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t)},[n.loading,e,o]),C=r.useCallback(()=>{const t=Ut(e),r=$t(e);return new Map(t.map(e=>[e,r[e]??{}]))},[e]),b=r.useCallback(()=>Lt(e),[e]),w=r.useCallback(()=>Ut(e),[e]),v=r.useCallback(t=>{const r=e.current.getRow(t),{rowToIndexMap:n}=getVisibleRows(e);return n.get(r)},[e]),x=r.useCallback((t,r)=>{const n=e.current.getRowNode(t);if(!n)throw new Error(`MUI X: No row with id #${t} found.`);if("group"!==n.type)throw new Error("MUI X: Only group nodes can be expanded or collapsed.");const o=et({},n,{childrenExpanded:r});e.current.setState(e=>et({},e,{rows:et({},e.rows,{tree:et({},e.rows.tree,{[t]:o})})})),e.current.forceUpdate(),e.current.publishEvent("rowExpansionChange",o)},[e]),R=r.useCallback(t=>Vt(e)[t]??null,[e]),y=r.useCallback(({skipAutoGeneratedRows:t=!0,groupId:r,applySorting:n,applyFiltering:o})=>{const l=Vt(e);let i;if(n){const n=l[r];if(!n)return[];const o=_r(e);i=[];for(let e=o.findIndex(e=>e===r)+1;e<o.length&&l[o[e]].depth>n.depth;e+=1){const r=o[e];t&&isAutogeneratedRowNode(l[r])||i.push(r)}}else i=getTreeNodeDescendants(l,r,t);if(o){const t=Qr(e);i=i.filter(e=>!1!==t[e])}return i},[e]),S=r.useCallback((t,r)=>{const n=e.current.getRowNode(t);if(!n)throw new Error(`MUI X: No row with id #${t} found.`);if(n.parent!==Fr)throw new Error("MUI X: The row reordering do not support reordering of grouped rows yet.");if("leaf"!==n.type)throw new Error("MUI X: The row reordering do not support reordering of footer or grouping rows.");e.current.setState(n=>{const l=Vt(n,e.current.instanceId)[Fr],i=l.children,a=i.findIndex(e=>e===t);if(-1===a||a===r)return n;o.debug(`Moving row ${t} to index ${r}`);const s=[...i];return s.splice(r,0,s.splice(a,1)[0]),et({},n,{rows:et({},n.rows,{tree:et({},n.rows.tree,{[Fr]:et({},l,{children:s})})})})}),e.current.publishEvent("rowsSet")},[e,o]),I={getRow:s,setLoading:m,getRowId:u,getRowModels:C,getRowsCount:b,getAllRowIds:w,setRows:p,updateRows:g,getRowNode:R,getRowIndexRelativeToVisibleRows:v,unstable_replaceRows:r.useCallback((t,r)=>{if(n.signature===kt.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(Wt(e)>1)throw new Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");const o=et({},Vt(e)),l=et({},$t(e)),i=et({},zt(e)),a=o[Fr],s=[...a.children],u=new Set;for(let e=0;e<r.length;e+=1){const a=r[e],c=getRowIdFromRowModel(a,n.getRowId,"A row was provided without id when calling replaceRows()."),[d]=s.splice(t+e,1,c);u.has(d)||(delete l[d],delete i[d],delete o[d]);const p={id:c,depth:0,parent:Fr,type:"leaf",groupingKey:null};l[c]=a,i[c]=c,o[c]=p,u.add(c)}o[Fr]=et({},a,{children:s});const c=s.filter(e=>"leaf"===o[e]?.type);e.current.caches.rows.dataRowIdToModelLookup=l,e.current.caches.rows.dataRowIdToIdLookup=i,e.current.setState(e=>et({},e,{rows:et({},e.rows,{dataRowIdToModelLookup:l,dataRowIdToIdLookup:i,dataRowIds:c,tree:o})})),e.current.publishEvent("rowsSet")},[e,n.signature,n.getRowId])},M={setRowIndex:S,setRowChildrenExpansion:x,getRowGroupChildren:y},P={updateServerRows:h},k=r.useCallback(()=>{let t;o.info("Row grouping pre-processing have changed, regenerating the row tree"),t=e.current.caches.rows.rowsBeforePartialUpdates===n.rows?et({},e.current.caches.rows,{updates:{type:"full",rows:Ut(e)}}):createRowsInternalCache({rows:n.rows,getRowId:n.getRowId,loading:n.loading,rowCount:n.rowCount}),c({cache:t,throttle:!1})},[o,e,n.rows,n.getRowId,n.loading,n.rowCount,c]),D=t(()=>n.unstable_dataSource),E=r.useCallback(e=>{n.unstable_dataSource&&n.unstable_dataSource!==D.current?D.current=n.unstable_dataSource:"rowTreeCreation"===e&&k()},[k,D,n.unstable_dataSource]),F=r.useCallback(()=>{e.current.getActiveStrategy("rowTree")!==Bt(e)&&k()},[e,k]);Dt(e,"activeStrategyProcessorChange",E),Dt(e,"strategyAvailabilityChange",F);const G=r.useCallback(()=>{e.current.setState(t=>{const r=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:Vt(t,e.current.instanceId),treeDepths:_t(t,e.current.instanceId),dataRowIds:Ut(t,e.current.instanceId),dataRowIdToModelLookup:$t(t,e.current.instanceId),dataRowIdToIdLookup:zt(t,e.current.instanceId)});return et({},t,{rows:et({},t.rows,r,{totalTopLevelRowCount:getTopLevelRowCount({tree:r.tree,rowCountProp:n.rowCount})})})}),e.current.publishEvent("rowsSet"),e.current.forceUpdate()},[e,n.rowCount]);useGridRegisterPipeApplier(e,"hydrateRows",G),useGridApiMethod(e,I,"public"),useGridApiMethod(e,M,n.signature===kt.DataGrid?"private":"public"),useGridApiMethod(e,P,"private");const H=r.useRef(!0);r.useEffect(()=>{if(H.current)return void(H.current=!1);let t=!1;n.rowCount!==i.current&&(t=!0,i.current=n.rowCount);const r=e.current.caches.rows.rowsBeforePartialUpdates===n.rows,l=e.current.caches.rows.loadingPropBeforePartialUpdates===n.loading,a=e.current.caches.rows.rowCountPropBeforePartialUpdates===n.rowCount;r&&(l||(e.current.setState(e=>et({},e,{rows:et({},e.rows,{loading:n.loading})})),e.current.caches.rows.loadingPropBeforePartialUpdates=n.loading,e.current.forceUpdate()),a||(e.current.setState(e=>et({},e,{rows:et({},e.rows,{totalRowCount:Math.max(n.rowCount||0,e.rows.totalRowCount),totalTopLevelRowCount:Math.max(n.rowCount||0,e.rows.totalTopLevelRowCount)})})),e.current.caches.rows.rowCountPropBeforePartialUpdates=n.rowCount,e.current.forceUpdate()),!t)||(o.debug(`Updating all rows, new length ${n.rows?.length}`),c({cache:createRowsInternalCache({rows:n.rows,getRowId:n.getRowId,loading:n.loading,rowCount:n.rowCount}),throttle:!1}))},[n.rows,n.rowCount,n.getRowId,n.loading,o,c,e])})(o,n),((e,n)=>{const o=t(()=>e.current.state.rowSpanning!==Va?getInitialRangeToProcess(n,e):Na),l=r.useCallback((t,r=!1)=>{const{range:l,rows:i}=getVisibleRows(e,(n.pagination,n.paginationMode));if(null===l||!isRowContextInitialized(t))return;r&&(o.current=Na);const a=function getUnprocessedRange(e,t){return e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?null:e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex>t.lastRowIndex?{firstRowIndex:t.lastRowIndex,lastRowIndex:e.lastRowIndex}:e.firstRowIndex<t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?{firstRowIndex:e.firstRowIndex,lastRowIndex:t.firstRowIndex-1}:e}({firstRowIndex:t.firstRowIndex,lastRowIndex:Math.min(t.lastRowIndex,l.lastRowIndex+1)},o.current);if(null===a)return;const s=fr(e),{spannedCells:u,hiddenCells:c,hiddenCellOriginMap:d,processedRange:p}=computeRowSpanningState(e,s,i,l,a,r,o.current);o.current=p;const g=Object.keys(u).length,h=Object.keys(c).length,m=Object.keys(e.current.state.rowSpanning.spannedCells).length,C=Object.keys(e.current.state.rowSpanning.hiddenCells).length;(r||g!==m||h!==C)&&(0!==g||0!==m)&&e.current.setState(e=>et({},e,{rowSpanning:{spannedCells:u,hiddenCells:c,hiddenCellOriginMap:d}}))},[e,o,n.pagination,n.paginationMode]),i=r.useCallback(()=>{const t=xo(e);isRowContextInitialized(t)&&l(t,!0)},[e,l]);Dt(e,"renderedRowsIntervalChange",runIf(n.unstable_rowSpanning,l)),Dt(e,"sortedRowsSet",runIf(n.unstable_rowSpanning,i)),Dt(e,"paginationModelChange",runIf(n.unstable_rowSpanning,i)),Dt(e,"filteredRowsSet",runIf(n.unstable_rowSpanning,i)),Dt(e,"columnsChange",runIf(n.unstable_rowSpanning,i)),r.useEffect(()=>{n.unstable_rowSpanning?e.current.state.rowSpanning===Va&&i():e.current.state.rowSpanning!==Va&&e.current.setState(e=>et({},e,{rowSpanning:Va}))},[e,i,n.unstable_rowSpanning])})(o,n),useGridParamsApi(o,n),((e,t)=>{const n=useGridSelector(e,gridDetailPanelExpandedRowsContentCacheSelector),o=r.useCallback((o,l)=>{if(o.field!==Lr||null==t.getDetailPanelContent)return;const i=n[o.id];r.isValidElement(i)&&l.target!==l.currentTarget&&e.current.toggleDetailPanel(o.id)},[e,n,t.getDetailPanelContent]),l=r.useCallback((r,n)=>{null!=t.getDetailPanelContent&&r.field===Lr&&" "===n.key&&e.current.toggleDetailPanel(r.id)},[e,t.getDetailPanelContent]);Dt(e,"cellClick",o),Dt(e,"cellKeyDown",l),e.current.registerControlState({stateId:"detailPanels",propModel:t.detailPanelExpandedRowIds,propOnChange:t.onDetailPanelExpandedRowIdsChange,stateSelector:gridDetailPanelExpandedRowIdsSelector,changeEvent:"detailPanelsExpandedRowIdsChange"});const i=r.useCallback(o=>{if(null==t.getDetailPanelContent)return;const l=n[o];if(!r.isValidElement(l))return;const i=e.current.getExpandedDetailPanels();e.current.setExpandedDetailPanels(i.includes(o)?i.filter(e=>e!==o):[...i,o])},[e,n,t.getDetailPanelContent]),a=r.useCallback(()=>gridDetailPanelExpandedRowIdsSelector(e.current.state),[e]),s=r.useCallback(t=>{e.current.setState(e=>et({},e,{detailPanel:et({},e.detailPanel,{expandedRowIds:t})})),e.current.requestPipeProcessorsApplication("rowHeight")},[e]),u={storeDetailPanelHeight:r.useCallback((t,r)=>{const n=gridDetailPanelRawHeightCacheSelector(e.current.state);n[t]&&n[t].height!==r&&(e.current.setState(e=>et({},e,{detailPanel:et({},e.detailPanel,{heightCache:et({},n,{[t]:et({},n[t],{height:r})})})})),e.current.requestPipeProcessorsApplication("rowHeight"))},[e]),detailPanelHasAutoHeight:r.useCallback(t=>{const r=gridDetailPanelRawHeightCacheSelector(e.current.state);return!!r[t]&&r[t].autoHeight},[e])};useGridApiMethod(e,{toggleDetailPanel:i,getExpandedDetailPanels:a,setExpandedDetailPanels:s},"public"),useGridApiMethod(e,u,"private"),r.useEffect(()=>{t.detailPanelExpandedRowIds&&gridDetailPanelExpandedRowIdsSelector(e.current.state)!==t.detailPanelExpandedRowIds&&e.current.setExpandedDetailPanels(t.detailPanelExpandedRowIds)},[e,t.detailPanelExpandedRowIds]);const c=r.useCallback(()=>{t.getDetailPanelContent&&(e.current.setState(r=>et({},r,{detailPanel:et({},r.detailPanel,cacheContentAndHeight(e,t.getDetailPanelContent,t.getDetailPanelHeight,r.detailPanel.heightCache))})),e.current.forceUpdate())},[e,t.getDetailPanelContent,t.getDetailPanelHeight]);Dt(e,"sortedRowsSet",c);const d=r.useRef(void 0),p=r.useRef(void 0),g=r.useCallback(()=>{t.getDetailPanelContent===d.current&&t.getDetailPanelHeight===p.current||(e.current.setState(r=>et({},r,{detailPanel:et({},r.detailPanel,cacheContentAndHeight(e,t.getDetailPanelContent,t.getDetailPanelHeight,r.detailPanel.heightCache))})),d.current=t.getDetailPanelContent,p.current=t.getDetailPanelHeight)},[e,t.getDetailPanelContent,t.getDetailPanelHeight]),h=r.useCallback((t,r)=>{const n=gridDetailPanelExpandedRowIdsSelector(e.current.state);if(!n||0===n.length||!n.includes(r.id))return t.detail=0,t;g();const o=ps(e);return t.detail=o[r.id]??0,t},[e,g]),m=void 0!==t.getDetailPanelContent;useGridRegisterPipeProcessor(e,"rowHeight",h,m);const C=r.useRef(!0);C.current&&g(),r.useEffect(()=>{C.current||g(),C.current=!1},[e,g])})(o,n),(e=>{const t=r.useRef({}),resetColSpan=()=>{t.current={}},n={resetColSpan,calculateColSpan:r.useCallback(({rowId:r,minFirstColumn:n,maxLastColumn:o,columns:l})=>{for(let i=n;i<o;i+=1){const a=calculateCellColSpan({apiRef:e,lookup:t.current,columnIndex:i,rowId:r,minFirstColumnIndex:n,maxLastColumnIndex:o,columns:l});a.colSpan>1&&(i+=a.colSpan-1)}},[e])};useGridApiMethod(e,{unstable_getCellColSpanInfo:(e,r)=>t.current[e]?.[r]},"public"),useGridApiMethod(e,n,"private"),Dt(e,"columnOrderChange",resetColSpan)})(o),((e,t)=>{const n=r.useCallback(t=>no(e)[t]??[],[e]),o=r.useCallback(()=>oo(e),[e]);useGridApiMethod(e,{getColumnGroupPath:n,getAllGroupDetails:o},"public");const l=r.useCallback(()=>{const r=unwrapGroupingColumnModel(t.columnGroupingModel??[]);e.current.setState(e=>{const t=e.columns?.orderedFields??[],n=e.pinnedColumns??{},o=getColumnGroupsHeaderStructure(t,r,n);return et({},e,{columnGrouping:et({},e.columnGrouping,{headerStructure:o})})})},[e,t.columnGroupingModel]),i=r.useCallback(t=>{const r=e.current.getPinnedColumns?.()??{},n=cr(e),o=hr(e),l=createGroupLookup(t??[]),i=unwrapGroupingColumnModel(t??[]),a=getColumnGroupsHeaderStructure(n,i,r),s=0===o.length?0:Math.max(...o.map(e=>i[e]?.length??0));e.current.setState(e=>et({},e,{columnGrouping:{lookup:l,unwrappedGroupingModel:i,headerStructure:a,maxDepth:s}}))},[e]);Dt(e,"columnIndexChange",l),Dt(e,"columnsChange",()=>{i(t.columnGroupingModel)}),Dt(e,"columnVisibilityModelChange",()=>{i(t.columnGroupingModel)}),r.useEffect(()=>{i(t.columnGroupingModel)},[i,t.columnGroupingModel])})(o,n),useGridEditing(o,n),((e,t)=>{const n=useGridLogger(e,"useGridFocus"),o=r.useRef(null),l=null!==e.current.rootElementRef.current,i=r.useCallback((t,r)=>{t&&e.current.getRow(t.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(t.id,t.field),r)},[e]),a=r.useCallback((t,r)=>{const o=Cn(e);o?.id===t&&o?.field===r||(e.current.setState(e=>(n.debug(`Focusing on cell with id=${t} and field=${r}`),et({},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.forceUpdate(),e.current.getRow(t)&&(o&&i(o,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(t,r))))},[e,n,i]),s=r.useCallback((t,r={})=>{const o=Cn(e);i(o,r),e.current.setState(e=>(n.debug(`Focusing on column header with colIndex=${t}`),et({},e,{tabIndex:{columnHeader:{field:t},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:t},columnHeaderFilter:null,cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,i]),u=r.useCallback((t,r={})=>{const o=Cn(e);i(o,r),e.current.setState(e=>(n.debug(`Focusing on column header filter with colIndex=${t}`),et({},e,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:t},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:t},cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,i]),c=r.useCallback((t,r,n={})=>{const o=Cn(e);o&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(o.id,o.field),n),e.current.setState(e=>et({},e,{tabIndex:{columnGroupHeader:{field:t,depth:r},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:t,depth:r},columnHeader:null,columnHeaderFilter:null,cell:null}})),e.current.forceUpdate()},[e]),d=r.useCallback(()=>vn(e),[e]),p=r.useCallback((r,n,o)=>{let l=e.current.getColumnIndex(n);const i=fr(e),a=getVisibleRows(e,(t.pagination,t.paginationMode)),s=qt(e),u=[].concat(s.top||[],a.rows,s.bottom||[]);let c=u.findIndex(e=>e.id===r);"right"===o?l+=1:"left"===o?l-=1:c+=1,l>=i.length?(c+=1,c<u.length&&(l=0)):l<0&&(c-=1,c>=0&&(l=i.length-1)),c=clamp(c,0,u.length-1);const d=u[c];if(!d)return;const p=e.current.unstable_getCellColSpanInfo(d.id,l);p&&p.spannedByColSpan&&("left"===o||"below"===o?l=p.leftVisibleCellIndex:"right"===o&&(l=p.rightVisibleCellIndex)),l=clamp(l,0,i.length-1);const g=i[l];e.current.setCellFocus(d.id,g.field)},[e,t.pagination,t.paginationMode]),g=r.useCallback(({id:t,field:r})=>{e.current.setCellFocus(t,r)},[e]),h=r.useCallback((t,r)=>{"Enter"===r.key||"Tab"===r.key||"Shift"===r.key||isNavigationKey(r.key)||e.current.setCellFocus(t.id,t.field)},[e]),m=r.useCallback(({field:t},r)=>{r.target===r.currentTarget&&e.current.setColumnHeaderFocus(t,r)},[e]),C=r.useCallback(({fields:t,depth:r},n)=>{if(n.target!==n.currentTarget)return;const o=vn(e);null!==o&&o.depth===r&&t.includes(o.field)||e.current.setColumnGroupHeaderFocus(t[0],r,n)},[e]),b=r.useCallback((t,r)=>{r.relatedTarget?.getAttribute("class")?.includes(Mt.columnHeader)||(n.debug("Clearing focus"),e.current.setState(e=>et({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[n,e]),w=r.useCallback(e=>{o.current=e},[]),v=r.useCallback(t=>{const r=o.current;o.current=null;const n=Cn(e);if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:t,cell:r}))return;if(!n)return void(r&&e.current.setCellFocus(r.id,r.field));if(r?.id===n.id&&r?.field===n.field)return;const l=e.current.getCellElement(n.id,n.field);l?.contains(t.target)||(r?e.current.setCellFocus(r.id,r.field):(e.current.setState(e=>et({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),e.current.forceUpdate(),i(n,t)))},[e,i]),x=r.useCallback(t=>{if("view"===t.cellMode)return;const r=Cn(e);r?.id===t.id&&r?.field===t.field||e.current.setCellFocus(t.id,t.field)},[e]),R=r.useCallback(()=>{const r=Cn(e);if(r&&!e.current.getRow(r.id)){const n=r.id;let o=null;if(void 0!==n){const r=e.current.getRowElement(n),l=r?.dataset.rowindex?Number(r?.dataset.rowindex):0,i=getVisibleRows(e,(t.pagination,t.paginationMode)),a=i.rows[clamp(l,0,i.rows.length-1)];o=a?.id??null}e.current.setState(e=>et({},e,{focus:{cell:null===o?null:{id:o,field:r.field},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))}},[e,t.pagination,t.paginationMode]),y=M(()=>{const r=Cn(e);if(!r)return;const n=getVisibleRows(e,(t.pagination,t.paginationMode));if(n.rows.find(e=>e.id===r.id))return;const o=fr(e);e.current.setState(e=>et({},e,{tabIndex:{cell:{id:n.rows[0].id,field:o[0].field},columnGroupHeader:null,columnHeader:null,columnHeaderFilter:null}}))}),S={moveFocusToRelativeCell:p,setColumnGroupHeaderFocus:c,getColumnGroupHeaderFocus:d};useGridApiMethod(e,{setCellFocus:a,setColumnHeaderFocus:s,setColumnHeaderFilterFocus:u},"public"),useGridApiMethod(e,S,"private"),r.useEffect(()=>{const t=E(e.current.rootElementRef.current);return t.addEventListener("mouseup",v),()=>{t.removeEventListener("mouseup",v)}},[e,l,v]),Dt(e,"columnHeaderBlur",b),Dt(e,"cellDoubleClick",g),Dt(e,"cellMouseDown",w),Dt(e,"cellKeyDown",h),Dt(e,"cellModeChange",x),Dt(e,"columnHeaderFocus",m),Dt(e,"columnGroupHeaderFocus",C),Dt(e,"rowsSet",R),Dt(e,"paginationModelChange",y)})(o,n),((e,t)=>{const n=useGridLogger(e,"useGridPreferencesPanel"),o=r.useCallback(()=>{e.current.setState(t=>{if(!t.preferencePanel.open)return t;n.debug("Hiding Preferences Panel");const r=gridPreferencePanelStateSelector(t);return e.current.publishEvent("preferencePanelClose",{openedPanelValue:r.openedPanelValue}),et({},t,{preferencePanel:{open:!1}})})},[e,n]),l=r.useCallback((t,r,o)=>{n.debug("Opening Preferences Panel"),e.current.setState(e=>et({},e,{preferencePanel:et({},e.preferencePanel,{open:!0,openedPanelValue:t,panelId:r,labelId:o})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:t})},[n,e]);useGridApiMethod(e,{showPreferences:l,hidePreferences:o},"public");const i=r.useCallback((r,n)=>{const o=gridPreferencePanelStateSelector(e.current.state);return!n.exportOnlyDirtyModels||null!=t.initialState?.preferencePanel||o.open?et({},r,{preferencePanel:o}):r},[e,t.initialState?.preferencePanel]),a=r.useCallback((t,r)=>{const n=r.stateToRestore.preferencePanel;return null!=n&&e.current.setState(e=>et({},e,{preferencePanel:n})),t},[e]);useGridRegisterPipeProcessor(e,"exportState",i),useGridRegisterPipeProcessor(e,"restoreState",a)})(o,n),((e,n)=>{const o=useGridLogger(e,"useGridFilter");e.current.registerControlState({stateId:"filter",propModel:n.filterModel,propOnChange:n.onFilterModelChange,stateSelector:Xr,changeEvent:"filterModelChange"});const l=r.useCallback(()=>{e.current.setState(t=>{const r=Xr(t,e.current.instanceId),n=e.current.getFilterState(r),o=et({},t,{filter:et({},t.filter,n)}),l=getVisibleRowsLookupState(e,o);return et({},o,{visibleRowsLookup:l})}),e.current.publishEvent("filteredRowsSet")},[e]),s=r.useCallback((e,t)=>null==t||!1===t.filterable||n.disableColumnFilter?e:[...e,"columnMenuFilterItem"],[n.disableColumnFilter]),u=r.useCallback(()=>{l(),e.current.forceUpdate()},[e,l]),c=r.useCallback(t=>{const r=Xr(e),n=[...r.items],o=n.findIndex(e=>e.id===t.id);-1===o?n.push(t):n[o]=t,e.current.setFilterModel(et({},r,{items:n}),"upsertFilterItem")},[e]),d=r.useCallback(t=>{const r=Xr(e),n=[...r.items];t.forEach(e=>{const t=n.findIndex(t=>t.id===e.id);-1===t?n.push(e):n[t]=e}),e.current.setFilterModel(et({},r,{items:n}),"upsertFilterItems")},[e]),p=r.useCallback(t=>{const r=Xr(e),n=r.items.filter(e=>e.id!==t.id);n.length!==r.items.length&&e.current.setFilterModel(et({},r,{items:n}),"deleteFilterItem")},[e]),g=r.useCallback((t,r,l)=>{if(o.debug("Displaying filter panel"),t){const r=Xr(e),o=r.items.filter(t=>{if(void 0!==t.value)return!Array.isArray(t.value)||0!==t.value.length;const r=e.current.getColumn(t.field),n=r.filterOperators?.find(e=>e.value===t.operator);return!(void 0===n?.requiresFilterValue||n?.requiresFilterValue)});let l;const i=o.find(e=>e.field===t),a=e.current.getColumn(t);l=i?o:n.disableMultipleColumnsFiltering?[cleanFilterItem({field:t,operator:a.filterOperators[0].value},e)]:[...o,cleanFilterItem({field:t,operator:a.filterOperators[0].value},e)],e.current.setFilterModel(et({},r,{items:l}))}e.current.showPreferences(rl.filters,r,l)},[e,o,n.disableMultipleColumnsFiltering]),h=r.useCallback(()=>{o.debug("Hiding filter panel"),e.current.hidePreferences()},[e,o]),m=r.useCallback(t=>{const r=Xr(e);r.logicOperator!==t&&e.current.setFilterModel(et({},r,{logicOperator:t}),"changeLogicOperator")},[e]),C=r.useCallback(t=>{const r=Xr(e);isDeepEqual(r.quickFilterValues,t)||e.current.setFilterModel(et({},r,{quickFilterValues:[...t]}))},[e]),b=r.useCallback((t,r)=>{Xr(e)!==t&&(o.debug("Setting filter model"),e.current.updateControlState("filter",mergeStateWithFilterModel(t,n.disableMultipleColumnsFiltering,e),r),e.current.unstable_applyFilters())},[e,o,n.disableMultipleColumnsFiltering]),w=r.useCallback(t=>{const r=sanitizeFilterModel(t,n.disableMultipleColumnsFiltering,e),o="client"===n.filterMode?buildAggregatedFilterApplier(r,e,n.disableEval):null,l=e.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:o,filterModel:r??getDefaultGridFilterModel()});return et({},l,{filterModel:r})},[n.disableMultipleColumnsFiltering,n.filterMode,n.disableEval,e]),v={setFilterLogicOperator:m,unstable_applyFilters:u,deleteFilterItem:p,upsertFilterItem:c,upsertFilterItems:d,setFilterModel:b,showFilterPanel:g,hideFilterPanel:h,setQuickFilterValues:C,ignoreDiacritics:n.ignoreDiacritics,getFilterState:w};useGridApiMethod(e,v,"public");const x=r.useCallback((t,r)=>{const o=Xr(e);return o.items.forEach(e=>{delete e.fromInput}),r.exportOnlyDirtyModels&&null==n.filterModel&&null==n.initialState?.filter?.filterModel&&isDeepEqual(o,getDefaultGridFilterModel())?t:et({},t,{filter:{filterModel:o}})},[e,n.filterModel,n.initialState?.filter?.filterModel]),R=r.useCallback((t,r)=>{const o=r.stateToRestore.filter?.filterModel;return null==o?t:(e.current.updateControlState("filter",mergeStateWithFilterModel(o,n.disableMultipleColumnsFiltering,e),"restoreState"),et({},t,{callbacks:[...t.callbacks,e.current.unstable_applyFilters]}))},[e,n.disableMultipleColumnsFiltering]),y=r.useCallback((e,t)=>{if(t===rl.filters){const e=n.slots.filterPanel;return i.jsx(e,et({},n.slotProps?.filterPanel))}return e},[n.slots.filterPanel,n.slotProps?.filterPanel]),{getRowId:S}=n,I=t(createMemoizedValues),M=r.useCallback(t=>{if("client"!==n.filterMode||!t.isRowMatchingFilters||!t.filterModel.items.length&&!t.filterModel.quickFilterValues?.length)return ar;const r=$t(e),o={},{isRowMatchingFilters:l}=t,i={},a={passingFilterItems:null,passingQuickFilterValues:null},s=I.current(e.current.state.rows.dataRowIdToModelLookup);for(let n=0;n<s.length;n+=1){const r=s[n],u=S?S(r):r.id;l(r,void 0,a);const c=passFilterLogic([a.passingFilterItems],[a.passingQuickFilterValues],t.filterModel,e,i);o[u]=c}const u="auto-generated-group-footer-root";return r[u]&&(o[u]=!0),{filteredRowsLookup:o,filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}}},[e,n.filterMode,S,I]);useGridRegisterPipeProcessor(e,"columnMenu",s),useGridRegisterPipeProcessor(e,"exportState",x),useGridRegisterPipeProcessor(e,"restoreState",R),useGridRegisterPipeProcessor(e,"preferencePanel",y),useGridRegisterStrategyProcessor(e,Pa,"filtering",M),useGridRegisterStrategyProcessor(e,Pa,"visibleRowsLookupCreation",getVisibleRowsLookup$1);const P=r.useCallback(()=>{o.debug("onColUpdated - GridColumns changed, applying filters");const t=Xr(e),r=dr(e),n=t.items.filter(e=>e.field&&r[e.field]);n.length<t.items.length&&e.current.setFilterModel(et({},t,{items:n}))},[e,o]),k=r.useCallback(t=>{"filtering"===t&&e.current.unstable_applyFilters()},[e]),D=r.useCallback(()=>{e.current.setState(t=>et({},t,{visibleRowsLookup:getVisibleRowsLookupState(e,t)})),e.current.forceUpdate()},[e]);Dt(e,"rowsSet",l),Dt(e,"columnsChange",P),Dt(e,"activeStrategyProcessorChange",k),Dt(e,"rowExpansionChange",D),Dt(e,"columnVisibilityModelChange",()=>{const t=Xr(e);t.quickFilterValues&&shouldQuickFilterExcludeHiddenColumns(t)&&e.current.unstable_applyFilters()}),useFirstRender(()=>{e.current.unstable_applyFilters()}),a(()=>{void 0!==n.filterModel&&e.current.setFilterModel(n.filterModel)},[e,o,n.filterModel])})(o,n),((e,t)=>{const n=useGridLogger(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:Ur,changeEvent:"sortModelChange"});const o=r.useCallback((t,r)=>{const n=Ur(e),o=n.findIndex(e=>e.field===t);let l=[...n];return o>-1?null==r?.sort?l.splice(o,1):l.splice(o,1,r):l=[...n,r],l},[e]),l=r.useCallback((r,n)=>{const o=Ur(e).find(e=>e.field===r.field);if(o){const e=void 0===n?getNextGridSortDirection(r.sortingOrder??t.sortingOrder,o.sort):n;return void 0===e?void 0:et({},o,{sort:e})}return{field:r.field,sort:void 0===n?getNextGridSortDirection(r.sortingOrder??t.sortingOrder):n}},[e,t.sortingOrder]),i=r.useCallback((e,r)=>null==r||!1===r.sortable||t.disableColumnSorting?e:(r.sortingOrder||t.sortingOrder).some(e=>!!e)?[...e,"columnMenuSortItem"]:e,[t.sortingOrder,t.disableColumnSorting]),s=r.useCallback(()=>{e.current.setState(r=>{if("server"===t.sortingMode)return n.debug("Skipping sorting rows as sortingMode = server"),et({},r,{sorting:et({},r.sorting,{sortedRows:getTreeNodeDescendants(Vt(e),Fr,!1)})});const o=Ur(r,e.current.instanceId),l=buildAggregatedSortingApplier(o,e),i=e.current.applyStrategyProcessor("sorting",{sortRowList:l});return et({},r,{sorting:et({},r.sorting,{sortedRows:i})})}),e.current.publishEvent("sortedRowsSet"),e.current.forceUpdate()},[e,n,t.sortingMode]),u=r.useCallback(r=>{Ur(e)!==r&&(n.debug("Setting sort model"),e.current.setState(mergeStateWithSortModel(r,t.disableMultipleColumnsSorting)),e.current.forceUpdate(),e.current.applySorting())},[e,n,t.disableMultipleColumnsSorting]),c=r.useCallback((r,n,i)=>{const a=e.current.getColumn(r),s=l(a,n);let u;u=!i||t.disableMultipleColumnsSorting?null==s?.sort?[]:[s]:o(a.field,s),e.current.setSortModel(u)},[e,o,l,t.disableMultipleColumnsSorting]),d=r.useCallback(()=>Ur(e),[e]),p=r.useCallback(()=>Wr(e).map(e=>e.model),[e]),g=r.useCallback(()=>_r(e),[e]),h=r.useCallback(t=>e.current.getSortedRowIds()[t],[e]);useGridApiMethod(e,{getSortModel:d,getSortedRows:p,getSortedRowIds:g,getRowIdFromRowIndex:h,setSortModel:u,sortColumn:c,applySorting:s},"public");const m=r.useCallback((r,n)=>{const o=Ur(e);return!n.exportOnlyDirtyModels||null!=t.sortModel||null!=t.initialState?.sorting?.sortModel||o.length>0?et({},r,{sorting:{sortModel:o}}):r},[e,t.sortModel,t.initialState?.sorting?.sortModel]),C=r.useCallback((r,n)=>{const o=n.stateToRestore.sorting?.sortModel;return null==o?r:(e.current.setState(mergeStateWithSortModel(o,t.disableMultipleColumnsSorting)),et({},r,{callbacks:[...r.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),b=r.useCallback(t=>{const r=Vt(e),n=r[Fr],o=t.sortRowList?t.sortRowList(n.children.map(e=>r[e])):[...n.children];return null!=n.footerId&&o.push(n.footerId),o},[e]);useGridRegisterPipeProcessor(e,"exportState",m),useGridRegisterPipeProcessor(e,"restoreState",C),useGridRegisterStrategyProcessor(e,Pa,"sorting",b);const w=r.useCallback(({field:e,colDef:r},n)=>{if(!r.sortable||t.disableColumnSorting)return;const o=n.shiftKey||n.metaKey||n.ctrlKey;c(e,void 0,o)},[c,t.disableColumnSorting]),v=r.useCallback(({field:e,colDef:r},n)=>{r.sortable&&!t.disableColumnSorting&&("Enter"!==n.key||n.ctrlKey||n.metaKey||c(e,void 0,n.shiftKey))},[c,t.disableColumnSorting]),x=r.useCallback(()=>{const t=Ur(e),r=dr(e);if(t.length>0){const n=t.filter(e=>r[e.field]);n.length<t.length&&e.current.setSortModel(n)}},[e]),R=r.useCallback(t=>{"sorting"===t&&e.current.applySorting()},[e]);useGridRegisterPipeProcessor(e,"columnMenu",i),Dt(e,"columnHeaderClick",w),Dt(e,"columnHeaderKeyDown",v),Dt(e,"rowsSet",e.current.applySorting),Dt(e,"columnsChange",x),Dt(e,"activeStrategyProcessorChange",R),useFirstRender(()=>{e.current.applySorting()}),a(()=>{void 0!==t.sortModel&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])})(o,n),((e,t)=>{const n=useGridLogger(e,"useDensity");e.current.registerControlState({stateId:"density",propModel:t.density,propOnChange:t.onDensityChange,stateSelector:gridDensitySelector,changeEvent:"densityChange"});const o=M(t=>{gridDensitySelector(e.current.state)!==t&&(n.debug(`Set grid density to ${t}`),e.current.setState(e=>et({},e,{density:t})))});useGridApiMethod(e,{setDensity:o},"public");const l=r.useCallback((r,n)=>{const o=gridDensitySelector(e.current.state);return n.exportOnlyDirtyModels&&null==t.density&&null==t.initialState?.density?r:et({},r,{density:o})},[e,t.density,t.initialState?.density]),i=r.useCallback((t,r)=>{const n=r.stateToRestore?.density?r.stateToRestore.density:gridDensitySelector(e.current.state);return e.current.setState(e=>et({},e,{density:n})),t},[e]);useGridRegisterPipeProcessor(e,"exportState",l),useGridRegisterPipeProcessor(e,"restoreState",i),r.useEffect(()=>{t.density&&e.current.setDensity(t.density)},[e,t.density])})(o,n),useGridColumnReorder(o,n),useGridColumnResize(o,n),useGridPagination(o,n),((e,n)=>{const{getRowHeight:o,getRowSpacing:l,getEstimatedRowHeight:i}=n,s=e.current.caches.rowsMeta.heights,u=r.useRef(-1),c=r.useRef(!1),d=r.useRef(!1),p=useGridSelector(e,Gt),g=useGridVisibleRows(e),h=useGridSelector(e,qt),m=useGridSelector(e,gridRowHeightSelector),C=r.useCallback(t=>{const r=gridDimensionsSelector(e.current.state).rowHeight,n=e.current.getRowHeightEntry(t.id);if(o){const e=o(et({},t,{densityFactor:p}));if("auto"===e){if(n.needsFirstMeasurement){const e=i?i(et({},t,{densityFactor:p})):r;n.content=e??r}c.current=!0,n.autoHeight=!0}else n.content=getValidRowHeight(e,r),n.needsFirstMeasurement=!1,n.autoHeight=!1}else n.content=r,n.needsFirstMeasurement=!1;if(l){const r=e.current.getRowIndexRelativeToVisibleRows(t.id),o=l(et({},t,{isFirstVisible:0===r,isLastVisible:r===g.rows.length-1,indexRelativeToCurrentPage:r}));n.spacingTop=o.top??0,n.spacingBottom=o.bottom??0}else n.spacingTop=0,n.spacingBottom=0;return e.current.unstable_applyPipeProcessors("rowHeight",n,t),n},[e,g.rows,o,i,m,l,p]),b=r.useCallback(()=>{c.current=!1;const t=h.top.reduce((e,t)=>{const r=C(t);return e+r.content+r.spacingTop+r.spacingBottom+r.detail},0),r=h.bottom.reduce((e,t)=>{const r=C(t);return e+r.content+r.spacingTop+r.spacingBottom+r.detail},0),n=[],o=g.rows.reduce((e,t)=>{n.push(e);const r=C(t);return e+(r.content+r.spacingTop+r.spacingBottom+r.detail)},0);c.current||(u.current=1/0);const l=t!==e.current.state.rowsMeta.pinnedTopRowsTotalHeight||r!==e.current.state.rowsMeta.pinnedBottomRowsTotalHeight||o!==e.current.state.rowsMeta.currentPageTotalHeight,i={currentPageTotalHeight:o,positions:n,pinnedTopRowsTotalHeight:t,pinnedBottomRowsTotalHeight:r};e.current.setState(e=>et({},e,{rowsMeta:i})),l&&e.current.updateDimensions(),d.current=!0},[e,h,g.rows,C]),w=t(()=>new $a(t=>{for(let r=0;r<t.length;r+=1){const n=t[r],o=n.borderBoxSize&&n.borderBoxSize.length>0?n.borderBoxSize[0].blockSize:n.contentRect.height,l=n.target.__mui_id,i=Po(e)?.id;if(i===l&&0===o)return;e.current.unstable_storeRowHeightMeasurement(l,o)}d.current||requestAnimationFrame(()=>{e.current.requestPipeProcessorsApplication("rowHeight")})})).current;useGridRegisterPipeApplier(e,"rowHeight",b),a(()=>{b()},[b]);const v={unstable_getRowHeight:e=>s.get(e)?.content??m,unstable_setLastMeasuredRowIndex:e=>{c.current&&e>u.current&&(u.current=e)},unstable_storeRowHeightMeasurement:(t,r)=>{const n=e.current.getRowHeightEntry(t),o=n.content!==r;n.needsFirstMeasurement=!1,n.content=r,d.current&&(d.current=!o)},resetRowHeights:()=>{s.clear(),b()}},x={hydrateRowsMeta:b,observeRowHeight:(e,t)=>(e.__mui_id=t,w.observe(e),()=>w.unobserve(e)),rowHasAutoHeight:e=>s.get(e)?.autoHeight??!1,getRowHeightEntry:e=>{let t=s.get(e);return void 0===t&&(t={content:m,spacingTop:0,spacingBottom:0,detail:0,autoHeight:!1,needsFirstMeasurement:!0},s.set(e,t)),t},getLastMeasuredRowIndex:()=>u.current};useGridApiMethod(e,v,"public"),useGridApiMethod(e,x,"private")})(o,n),useGridRowReorder(o,n),((e,t)=>{const n=v(),o=useGridLogger(e,"useGridScroll"),l=e.current.columnHeadersContainerRef,i=e.current.virtualScrollerRef,a=useGridSelector(e,en),s=r.useCallback(r=>{const n=gridDimensionsSelector(e.current.state),l=Lt(e),s=t.unstable_listView?[gridListColumnSelector(e.current.state)]:fr(e);if(null!=r.rowIndex&&0===l||0===s.length)return!1;o.debug(`Scrolling to cell at row ${r.rowIndex}, col: ${r.colIndex} `);let u={};if(void 0!==r.colIndex){const t=br(e);let o;if(void 0!==r.rowIndex){const t=a[r.rowIndex]?.id,n=e.current.unstable_getCellColSpanInfo(t,r.colIndex);n&&!n.spannedByColSpan&&(o=n.cellProps.width)}void 0===o&&(o=s[r.colIndex].computedWidth),u.left=scrollIntoView({containerSize:n.viewportOuterSize.width,scrollPosition:Math.abs(i.current.scrollLeft),elementSize:o,elementOffset:t[r.colIndex]})}if(void 0!==r.rowIndex){const o=gridRowsMetaSelector(e.current.state),l=Dn(e),a=En(e),s=t.pagination?r.rowIndex-l*a:r.rowIndex,c=o.positions[s+1]?o.positions[s+1]-o.positions[s]:o.currentPageTotalHeight-o.positions[s];u.top=scrollIntoView({containerSize:n.viewportInnerSize.height,scrollPosition:i.current.scrollTop,elementSize:c,elementOffset:o.positions[s]})}return u=e.current.unstable_applyPipeProcessors("scrollToIndexes",u,r),(void 0!==typeof u.left||void 0!==typeof u.top)&&(e.current.scroll(u),!0)},[o,e,i,t.pagination,a,t.unstable_listView]),u=r.useCallback(e=>{if(i.current&&void 0!==e.left&&l.current){const t=n?-1:1;l.current.scrollLeft=e.left,i.current.scrollLeft=t*e.left,o.debug(`Scrolling left: ${e.left}`)}i.current&&void 0!==e.top&&(i.current.scrollTop=e.top,o.debug(`Scrolling top: ${e.top}`)),o.debug("Scrolling, updating container, and viewport")},[i,n,l,o]),c=r.useCallback(()=>i?.current?{top:i.current.scrollTop,left:i.current.scrollLeft}:{top:0,left:0},[i]);useGridApiMethod(e,{scroll:u,scrollToIndexes:s,getScrollPosition:c},"public")})(o,n),useGridInfiniteLoader(o,n),((e,t)=>{const n=useGridSelector(e,Ur),o=useGridSelector(e,Xr),l=r.useRef({firstRowToRender:0,lastRowToRender:0}),i="server"!==t.rowsLoadingMode,a=r.useCallback(r=>{if(i)return;const a={firstRowToRender:r.firstRowIndex,lastRowToRender:r.lastRowIndex,sortModel:n,filterModel:o};if(l.current.firstRowToRender!==r.firstRowIndex||l.current.lastRowToRender!==r.lastRowIndex){if(l.current={firstRowToRender:r.firstRowIndex,lastRowToRender:r.lastRowIndex},0===n.length&&0===o.items.length){const n=getVisibleRows(e,(t.pagination,t.paginationMode)),o=function findSkeletonRowsSection({apiRef:e,visibleRows:t,range:r}){let{firstRowIndex:n,lastRowIndex:o}=r;const l=t.slice(r.firstRowIndex,r.lastRowIndex);let i=0,a=l.length-1,s=!1;for(;!s&&n<o;){const t="skeletonRow"===e.current.getRowNode(l[i].id)?.type,r="skeletonRow"===e.current.getRowNode(l[a].id)?.type;t&&r&&(s=!0),t||(i+=1,n+=1),r||(a-=1,o-=1)}return s?{firstRowIndex:n,lastRowIndex:o}:void 0}({apiRef:e,visibleRows:n.rows,range:{firstRowIndex:r.firstRowIndex,lastRowIndex:r.lastRowIndex}});if(!o)return;a.firstRowToRender=o.firstRowIndex,a.lastRowToRender=o.lastRowIndex}e.current.publishEvent("fetchRows",a)}},[e,i,t.pagination,t.paginationMode,n,o]),s=r.useCallback(t=>{if(i)return;e.current.requestPipeProcessorsApplication("hydrateRows");const r=xo(e),n={firstRowToRender:r.firstRowIndex,lastRowToRender:r.lastRowIndex,sortModel:t,filterModel:o};e.current.publishEvent("fetchRows",n)},[e,i,o]),u=r.useCallback(t=>{if(i)return;e.current.requestPipeProcessorsApplication("hydrateRows");const r=xo(e),o={firstRowToRender:r.firstRowIndex,lastRowToRender:r.lastRowIndex,sortModel:n,filterModel:t};e.current.publishEvent("fetchRows",o)},[e,i,n]);Dt(e,"renderedRowsIntervalChange",a),Dt(e,"sortModelChange",s),Dt(e,"filterModelChange",u),useGridApiOptionHandler(e,"fetchRows",t.onFetchRows)})(o,n),(e=>{const t=useGridLogger(e,"useGridColumnMenu"),n=r.useCallback(r=>{const n=gridColumnMenuSelector(e.current.state),o=r;(!0!==n.open||o!==n.field)&&(e.current.setState(e=>e.columnMenu.open&&e.columnMenu.field===r?e:(t.debug("Opening Column Menu"),et({},e,{columnMenu:{open:!0,field:r}}))),e.current.hidePreferences())},[e,t]),o=r.useCallback(()=>{const r=gridColumnMenuSelector(e.current.state);if(r.field){const t=dr(e),n=gr(e),o=cr(e);let l=r.field;if(t[l]||(l=o[0]),!1===n[l]){const e=o.filter(e=>e===l||!1!==n[e]),t=e.indexOf(l);l=e[t+1]||e[t-1]}e.current.setColumnHeaderFocus(l)}const n={open:!1,field:void 0};(n.open!==r.open||n.field!==r.field)&&e.current.setState(e=>(t.debug("Hiding Column Menu"),et({},e,{columnMenu:n})))},[e,t]),l=r.useCallback(r=>{t.debug("Toggle Column Menu");const l=gridColumnMenuSelector(e.current.state);l.open&&l.field===r?o():n(r)},[e,t,n,o]);useGridApiMethod(e,{showColumnMenu:n,hideColumnMenu:o,toggleColumnMenu:l},"public"),Dt(e,"columnResizeStart",o),Dt(e,"virtualScrollerWheel",e.current.hideColumnMenu),Dt(e,"virtualScrollerTouchMove",e.current.hideColumnMenu)})(o),useGridCsvExport(o,n),useGridPrintExport(o,n),useGridClipboard(o,n),useGridDimensions(o,n),function useGridEvents(e,t){useGridApiOptionHandler(e,"columnHeaderClick",t.onColumnHeaderClick),useGridApiOptionHandler(e,"columnHeaderContextMenu",t.onColumnHeaderContextMenu),useGridApiOptionHandler(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),useGridApiOptionHandler(e,"columnHeaderOver",t.onColumnHeaderOver),useGridApiOptionHandler(e,"columnHeaderOut",t.onColumnHeaderOut),useGridApiOptionHandler(e,"columnHeaderEnter",t.onColumnHeaderEnter),useGridApiOptionHandler(e,"columnHeaderLeave",t.onColumnHeaderLeave),useGridApiOptionHandler(e,"cellClick",t.onCellClick),useGridApiOptionHandler(e,"cellDoubleClick",t.onCellDoubleClick),useGridApiOptionHandler(e,"cellKeyDown",t.onCellKeyDown),useGridApiOptionHandler(e,"preferencePanelClose",t.onPreferencePanelClose),useGridApiOptionHandler(e,"preferencePanelOpen",t.onPreferencePanelOpen),useGridApiOptionHandler(e,"menuOpen",t.onMenuOpen),useGridApiOptionHandler(e,"menuClose",t.onMenuClose),useGridApiOptionHandler(e,"rowDoubleClick",t.onRowDoubleClick),useGridApiOptionHandler(e,"rowClick",t.onRowClick),useGridApiOptionHandler(e,"stateChange",t.onStateChange)}(o,n),(e=>{const t=r.useCallback((t={})=>e.current.unstable_applyPipeProcessors("exportState",{},t),[e]),n=r.useCallback(t=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:t}).callbacks.forEach(e=>{e()}),e.current.forceUpdate()},[e]);useGridApiMethod(e,{exportState:t,restoreState:n},"public")})(o),function useGridVirtualization(e,t){const setVirtualization=r=>{e.current.setState(e=>et({},e,{virtualization:et({},e.virtualization,{enabled:r,enabledForColumns:r,enabledForRows:r&&!t.autoHeight})}))},n={unstable_setVirtualization:setVirtualization,unstable_setColumnVirtualization:t=>{e.current.setState(e=>et({},e,{virtualization:et({},e.virtualization,{enabledForColumns:t})}))}};useGridApiMethod(e,n,"public"),r.useEffect(()=>{setVirtualization(!t.disableVirtualization)},[t.disableVirtualization,t.autoHeight])}(o,n),((e,n)=>{const o=t(()=>new NestedDataManager(e)).current,l=useGridSelector(e,Nt),i=r.useRef(0),a=n.unstable_onDataSourceError,[s,u]=r.useState(()=>getCache(n.unstable_dataSourceCache)),c=r.useCallback(async t=>{const r=n.unstable_dataSource?.getRows;if(!r)return;if(t)return void o.queue([t]);o.clear(),i.current=0,e.current.state.dataSource!==Ls&&e.current.resetDataSourceState();const l=et({},Is(e),e.current.unstable_applyPipeProcessors("getRowsParams",{})),s=e.current.unstable_dataSource.cache.get(l);if(void 0!==s){const t=s.rows;return e.current.setRows(t),void(void 0!==s.rowCount&&e.current.setRowCount(s.rowCount))}At(e)||e.current.setLoading(!0);try{const t=await r(l);e.current.unstable_dataSource.cache.set(l,t),void 0!==t.rowCount&&e.current.setRowCount(t.rowCount),e.current.setRows(t.rows),e.current.setLoading(!1)}catch(u){e.current.setRows([]),e.current.setLoading(!1),a?.(u,l)}},[o,e,n.unstable_dataSource?.getRows,a]),d=r.useCallback(async t=>{const r=e.current.unstable_applyPipeProcessors("getRowsParams",{});if(!n.treeData&&0===(r.groupFields?.length??0))return void o.clearPendingRequest(t);const l=n.unstable_dataSource?.getRows;if(!l)return void o.clearPendingRequest(t);const i=e.current.getRowNode(t);if(!i)return void o.clearPendingRequest(t);const s=et({},Is(e),r,{groupKeys:i.path}),u=e.current.unstable_dataSource.cache.get(s);if(void 0!==u){const r=u.rows;return o.setRequestSettled(t),e.current.updateServerRows(r,i.path),u.rowCount&&e.current.setRowCount(u.rowCount),e.current.setRowChildrenExpansion(t,!0),void e.current.unstable_dataSource.setChildrenLoading(t,!1)}Ps(e)[t]&&e.current.unstable_dataSource.setChildrenFetchError(t,null);try{const r=await l(s);if(!e.current.getRowNode(t))return void o.clearPendingRequest(t);if(o.getRequestStatus(t)===Os.UNKNOWN)return void e.current.unstable_dataSource.setChildrenLoading(t,!1);o.setRequestSettled(t),e.current.unstable_dataSource.cache.set(s,r),r.rowCount&&e.current.setRowCount(r.rowCount),e.current.updateServerRows(r.rows,i.path),e.current.setRowChildrenExpansion(t,!0)}catch(c){const r=c;e.current.unstable_dataSource.setChildrenFetchError(t,r),a?.(r,s)}finally{e.current.unstable_dataSource.setChildrenLoading(t,!1),o.setRequestSettled(t)}},[o,a,e,n.treeData,n.unstable_dataSource?.getRows]),p=r.useCallback((t,r)=>{e.current.setState(e=>{if(!e.dataSource.loading[t]&&!1===r)return e;const n=et({},e.dataSource.loading);return!1===r?delete n[t]:n[t]=r,et({},e,{dataSource:et({},e.dataSource,{loading:n})})})},[e]),g=r.useCallback((t,r)=>{e.current.setState(e=>{const n=et({},e.dataSource.errors);return null===r&&void 0!==n[t]?delete n[t]:n[t]=r,et({},e,{dataSource:et({},e.dataSource,{errors:n})})})},[e]),h=r.useCallback(()=>{e.current.setState(e=>et({},e,{dataSource:Ls}))},[e]),m=r.useMemo(()=>ue(c,0),[c]),C={fetchRowChildren:d,resetDataSourceState:h};useGridApiMethod(e,{unstable_dataSource:{setChildrenLoading:p,setChildrenFetchError:g,fetchRows:c,cache:s}},"public"),useGridApiMethod(e,C,"private"),Dt(e,"sortModelChange",runIfServerMode(n.sortingMode,m)),Dt(e,"filterModelChange",runIfServerMode(n.filterMode,m)),Dt(e,"paginationModelChange",runIfServerMode(n.paginationMode,m));const b=r.useRef(!0);r.useEffect(()=>{if(b.current)return void(b.current=!1);const e=getCache(n.unstable_dataSourceCache);u(t=>t!==e?e:t)},[n.unstable_dataSourceCache]),r.useEffect(()=>{n.unstable_dataSource&&(e.current.unstable_dataSource.cache.clear(),e.current.unstable_dataSource.fetchRows())},[e,n.unstable_dataSource]),r.useEffect(()=>{if(l&&l.length&&i.current<l.length){const e=l.slice(i.current);o.queue(e),i.current=l.length}},[e,o,l])})(o,n),function useGridListView(e,t){const updateListColumnWidth=()=>{e.current.setState(t=>t.listViewColumn?et({},t,{listViewColumn:et({},t.listViewColumn,{computedWidth:getListColumnWidth(e)})}):t)},n=r.useRef(null);Dt(e,"viewportInnerSizeChange",e=>{n.current!==e.width&&(n.current=e.width,updateListColumnWidth())}),Dt(e,"columnVisibilityModelChange",updateListColumnWidth),a(()=>{const r=t.unstable_listColumn;r&&e.current.setState(t=>et({},t,{listViewColumn:et({},r,{computedWidth:getListColumnWidth(e)})}))},[e,t.unstable_listColumn]),r.useEffect(()=>{t.unstable_listView&&t.unstable_listColumn},[t.unstable_listView,t.unstable_listColumn])}(o,n),o},js=et({},wi,{columnMenuPinningItem:function GridColumnMenuPinningItem(e){const{colDef:t,onClick:n}=e,o=ds(),l=cs(),a=v(),s=r.useCallback(e=>r=>{o.current.pinColumn(t.field,e),n(r)},[o,t.field,n]),unpinColumn=e=>{o.current.unpinColumn(t.field),n(e)},u=i.jsxs($,{onClick:s(sr.LEFT),children:[i.jsx(z,{children:i.jsx(l.slots.columnMenuPinLeftIcon,{fontSize:"small"})}),i.jsx(V,{children:o.current.getLocaleText("pinToLeft")})]}),c=i.jsxs($,{onClick:s(sr.RIGHT),children:[i.jsx(z,{children:i.jsx(l.slots.columnMenuPinRightIcon,{fontSize:"small"})}),i.jsx(V,{children:o.current.getLocaleText("pinToRight")})]});if(!t)return null;const d=o.current.isColumnPinned(t.field);if(d){const e=d===sr.RIGHT?sr.LEFT:sr.RIGHT,t=e===sr.RIGHT?"pinToRight":"pinToLeft",n=d===sr.RIGHT?l.slots.columnMenuPinLeftIcon:l.slots.columnMenuPinRightIcon;return i.jsxs(r.Fragment,{children:[i.jsxs($,{onClick:s(e),children:[i.jsx(z,{children:i.jsx(n,{fontSize:"small"})}),i.jsx(V,{children:o.current.getLocaleText(t)})]}),i.jsxs($,{onClick:unpinColumn,children:[i.jsx(z,{}),i.jsx(V,{children:o.current.getLocaleText("unpin")})]})]})}return a?i.jsxs(r.Fragment,{children:[c,u]}):i.jsxs(r.Fragment,{children:[u,c]})}}),$s=et({},vi,{columnMenuPinningItem:{displayOrder:15}}),zs=forwardRef(function GridProColumnMenu2(e,t){return i.jsx(xi,et({},e,{defaultSlots:js,defaultSlotProps:$s,ref:t}))}),Vs=["getColumnsToRender","getPinnedCellOffset","renderContext","leftRenderContext","rightRenderContext","pinnedColumns","visibleColumns","columnPositions"],Ns=Object.create(null),useGridColumnHeaders=e=>{const t=useGridPrivateApiContext$1(),{headerGroupingMaxDepth:n,hasOtherElementInTabSequence:o}=e,l=useGridSelector(t,yn),a=useGridColumnHeaders$1(et({},e,{hasOtherElementInTabSequence:o||null!==l})),{getColumnsToRender:u,getPinnedCellOffset:c,renderContext:d,leftRenderContext:p,rightRenderContext:g,pinnedColumns:h,visibleColumns:m,columnPositions:C}=a,b=tt(a,Vs),w=r.useRef(null);t.current.register("private",{headerFiltersElementRef:w});const v=r.useRef(null),x=cs(),R=(e=>{const{classes:t}=e;return r.useMemo(()=>s({headerFilterRow:["headerFilterRow"]},getDataGridUtilityClass,t),[t])})(x),y=!x.headerFilters,S=useGridSelector(t,Xr),I=useGridSelector(t,yt),M=useGridSelector(t,gridHasFillerSelector),P=useGridSelector(t,gridHeaderFilterHeightSelector),k=useGridSelector(t,gridVerticalScrollbarWidthSelector),D=useGridSelector(t,wn),E=r.useCallback(e=>{const t=S?.items.find(t=>t.field===e.field&&"isAnyOf"!==t.operator);if(null!=t)return t;const r=Ns[e.field];if(null!=r)return r;const n=getGridFilter(e);return Ns[e.field]=n,n},[S]),getColumnFilters=t=>{const{renderedColumns:r,firstColumnToRender:n}=u(t),o=[];for(let a=0;a<r.length;a+=1){const s=r[a],u=n+a,d=D?.field===s.field,p=0===u,g=l?.field,h=g===s.field||p&&!e.hasOtherElementInTabSequence?0:-1,m="function"==typeof s.headerClassName?s.headerClassName({field:s.field,colDef:s}):s.headerClassName,b=E(s),w=t?.position,R=c(w,s.computedWidth,u,C,I,k),y=a,S=r.length,F=shouldCellShowLeftBorder(w,y),G=shouldCellShowRightBorder(w,y,S,x.showColumnVerticalBorder,M);o.push(i.jsx(x.slots.headerFilterCell,et({colIndex:u,height:P,width:s.computedWidth,colDef:s,hasFocus:d,tabIndex:h,headerFilterMenuRef:v,headerClassName:m,"data-field":s.field,item:b,pinnedPosition:w,pinnedOffset:R,showLeftBorder:F,showRightBorder:G},x.slotProps?.headerFilterCell),`${s.field}-filter`))}return b.getFillers(t,o,0,!0)};return et({},b,{getColumnFiltersRow:()=>y?null:i.jsxs(_a,{ref:w,className:R.headerFilterRow,role:"row","aria-rowindex":n+2,ownerState:x,children:[p&&getColumnFilters({position:Ar.LEFT,renderContext:p,maxLastColumn:p.lastColumnIndex}),getColumnFilters({renderContext:d,maxLastColumn:m.length-h.right.length}),g&&getColumnFilters({position:Ar.RIGHT,renderContext:g,maxLastColumn:g.lastColumnIndex})]})})},Bs=["style","className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],_s=u("div")({flex:1,backgroundColor:"var(--DataGrid-containerBackground)"}),Ws=forwardRef(function GridColumnHeaders22(e,t){const{className:r,visibleColumns:n,sortColumnLookup:o,filterColumnLookup:l,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:s,columnHeaderFocus:u,columnGroupHeaderFocus:c,headerGroupingMaxDepth:d,columnMenuState:p,columnVisibility:g,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:m}=e,C=tt(e,Bs),{getInnerProps:b,getColumnHeadersRow:w,getColumnFiltersRow:v,getColumnGroupHeadersRows:x}=useGridColumnHeaders({visibleColumns:n,sortColumnLookup:o,filterColumnLookup:l,columnHeaderTabIndexState:a,hasOtherElementInTabSequence:m,columnGroupHeaderTabIndexState:s,columnHeaderFocus:u,columnGroupHeaderFocus:c,headerGroupingMaxDepth:d,columnMenuState:p,columnVisibility:g,columnGroupsHeaderStructure:h});return i.jsxs(qa,et({className:r},C,b(),{ref:t,children:[x(),w(),v(),i.jsx(_s,{})]}))}),noop=()=>{};const Us=u("div",{name:"MuiDataGrid",slot:"DetailPanel",overridesResolver:(e,t)=>t.detailPanel})(({theme:e})=>({width:"calc(var(--DataGrid-rowWidth) - var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",backgroundColor:(e.vars||e).palette.background.default,overflow:"auto"}));function GridDetailPanel(e){const{rowId:t,height:n,className:o,children:l}=e,s=Ss(),u=r.useRef(null),c=cs(),d="auto"===n;return r.useLayoutEffect(()=>{d&&"undefined"==typeof ResizeObserver&&s.current.storeDetailPanelHeight(t,u.current.clientHeight)},[s,d,t]),function useResizeObserver(e,t,n){const o=r.useRef(null);o.current=t,a(()=>{if(!1===n||"undefined"==typeof ResizeObserver)return noop;const t=e.current,r=new ResizeObserver(e=>{o.current(e)});return t&&r.observe(t),()=>{r.disconnect()}},[e,n])}(u,e=>{const[r]=e,n=r.borderBoxSize&&r.borderBoxSize.length>0?r.borderBoxSize[0].blockSize:r.contentRect.height;s.current.storeDetailPanelHeight(t,n)},d),i.jsx(Us,{ref:u,ownerState:c,role:"presentation",style:{height:n},className:o,children:l})}function GridDetailPanelsImpl({virtualScroller:e}){const t=Ss(),n=s({detailPanel:["detailPanel"]},getDataGridUtilityClass,{}),{setPanels:o}=e,l=useGridSelector(t,gridDetailPanelExpandedRowIdsSelector),a=useGridSelector(t,gridDetailPanelExpandedRowsContentCacheSelector),u=useGridSelector(t,ps),c=r.useCallback(e=>{const o=a[e],l=void 0!==t.current.getRowIndexRelativeToVisibleRows(e);if(!r.isValidElement(o)||!l)return null;const s=t.current.detailPanelHasAutoHeight(e)?"auto":u[e];return i.jsx(GridDetailPanel,{rowId:e,height:s,className:n.detailPanel,children:o},`panel-${e}`)},[t,n.detailPanel,u,a]);return r.useEffect(()=>{0===l.length?o(Fo):o(new Map(l.map(e=>[e,c(e)])))},[l,o,c]),null}const qs=et({},{columnMenuPinRightIcon:fs,columnMenuPinLeftIcon:hs}),Ks=et({},ts,qs,{columnMenu:zs,columnHeaders:Ws,detailPanels:function GridDetailPanels(e){return cs().getDetailPanelContent?r.createElement(GridDetailPanelsImpl,e):null},headerFilterCell:Rs,headerFilterMenu:function GridHeaderFilterMenu({open:e,field:t,target:n,applyFilterChanges:o,operators:l,item:a,id:s,labelledBy:u}){const c=useGridApiContext$1(),d=r.useCallback(()=>{c.current.hideHeaderFilterMenu()},[c]),p=r.useCallback(e=>{"Tab"===e.key&&e.preventDefault(),"Escape"!==e.key&&"Tab"!==e.key||d()},[d]);return n?i.jsx(GridMenu,{placement:"bottom-end",open:e,target:n,onClose:d,children:i.jsx(x,{"aria-labelledby":u,id:s,onKeyDown:p,children:l.map((r,n)=>{const l=r?.headerLabel??c.current.getLocaleText(`headerFilterOperator${F(r.value)}`);return i.jsx($,{onClick:()=>{o(et({},a,{operator:r.value})),d()},autoFocus:0===n&&e,selected:r.value===a.operator,children:l},`${t}-${r.value}`)})})}):null},pinnedRows:function GridPinnedRows({position:e,virtualScroller:t}){const n=s({root:["pinnedRows"]},getDataGridUtilityClass,{}),o=useGridPrivateApiContext$1(),l=useGridSelector(o,qt)[e],a=r.useMemo(()=>({firstRowIndex:0,lastRowIndex:l.length,firstColumnIndex:-1,lastColumnIndex:-1}),[l]);if(0===l.length)return null;const u=t.getRows({position:e,rows:l,renderContext:a});return i.jsx("div",{className:h(n.root,Mt[`pinnedRows--${e}`]),role:"presentation",children:u})}}),Xs=et({},Ta,{autosizeOnMount:!1,defaultGroupingExpansionDepth:0,disableAutosize:!1,disableChildrenFiltering:!1,disableChildrenSorting:!1,disableColumnPinning:!1,getDetailPanelHeight:()=>500,headerFilters:!1,keepColumnPositionIfDraggedOutside:!1,rowSelectionPropagation:{parents:!1,descendants:!1},rowReordering:!1,rowsLoadingMode:"client",scrollEndThreshold:80,treeData:!1,unstable_listView:!1}),Ys=Ks,useDataGridProProps=e=>{const t=ce(),n=useProps(r.useMemo(()=>de({props:e,theme:t,name:"MuiDataGrid"}),[t,e])),o=r.useMemo(()=>et({},pe,n.localeText),[n.localeText]),l=r.useMemo(()=>function computeSlots({defaultSlots:e,slots:t}){const r=t;if(!r||0===Object.keys(r).length)return e;const n=et({},e);return Object.keys(r).forEach(e=>{const t=e;void 0!==r[t]&&(n[t]=r[t])}),n}({defaultSlots:Ys,slots:n.slots}),[n.slots]);return r.useMemo(()=>et({},Xs,n,{localeText:o,slots:l},(e=>et({signature:"DataGridPro"},e.unstable_dataSource?{filterMode:"server",sortingMode:"server",paginationMode:"server"}:{}))(n)),[n,o,l])},Qs={hooks:{useGridAriaAttributes:()=>{const e=(()=>{const e=useGridPrivateApiContext$1(),t=useGridRootProps$1(),r=useGridSelector(e,fr),n=useGridSelector(e,an),o=useGridSelector(e,io),l=useGridSelector(e,Kt);return{role:"grid","aria-colcount":r.length,"aria-rowcount":o+1+l+n,"aria-multiselectable":isMultipleRowSelectionEnabled(t)}})(),t=cs().treeData?{role:"treegrid"}:{};return et({},e,t)},useGridRowAriaAttributes:e=>{const t=Ss(),n=cs(),o=(()=>{const e=useGridPrivateApiContext$1(),t=useGridSelector(e,fn),n=useGridSelector(e,io);return r.useCallback((r,o)=>{const l={},i=o+n+2;return l["aria-rowindex"]=i,e.current.isRowSelectable(r.id)&&(l["aria-selected"]=void 0!==t[r.id]),l},[e,t,n])})(),l=useGridSelector(t,sn),i=useGridSelector(t,Jr),a=useGridSelector(t,on);return r.useCallback((t,r)=>{const s=o(t,r);if(null===t||!n.treeData&&!e)return s;if("footer"===t.type||"pinnedRow"===t.type)return s;s["aria-level"]=t.depth+1;const u=i[t.id]??0;return"group"===t.type&&u>0&&(s["aria-expanded"]=Boolean(t.childrenExpanded)),null!==t.parent&&(s["aria-setsize"]=t.parent===Fr?l:i[t.parent],s["aria-posinset"]=a[t.id]),s},[n.treeData,e,l,i,a,o])},useCellAggregationResult:()=>null}},Js="MTc2NDExMTYwMDAwMA==",Zs=i.jsx(he,{packageName:"x-data-grid-pro",releaseInfo:Js}),eu=forwardRef(function DataGridPro2(e,t){const r=useDataGridProProps(e),n=useDataGridProComponent(r.apiRef,r);return ge("x-data-grid-pro",Js),i.jsx(GridContextProvider,{privateApiRef:n,configuration:Qs,props:r,children:i.jsx(xl,et({className:r.className,style:r.style,sx:r.sx},r.forwardedProps,r.slotProps?.root,{ref:t,children:Zs}))})}),tu=r.memo(eu);eu.propTypes={apiRef:fe.shape({current:fe.object.isRequired}),"aria-label":fe.string,"aria-labelledby":fe.string,autoHeight:fe.bool,autoPageSize:fe.bool,autosizeOnMount:fe.bool,autosizeOptions:fe.shape({columns:fe.arrayOf(fe.string),disableColumnVirtualization:fe.bool,expand:fe.bool,includeHeaders:fe.bool,includeOutliers:fe.bool,outliersFactor:fe.number}),cellModesModel:fe.object,checkboxSelection:fe.bool,checkboxSelectionVisibleOnly:fe.bool,classes:fe.object,clipboardCopyCellDelimiter:fe.string,columnBufferPx:fe.number,columnGroupHeaderHeight:fe.number,columnGroupingModel:fe.arrayOf(fe.object),columnHeaderHeight:fe.number,columns:fe.arrayOf(fe.object).isRequired,columnVisibilityModel:fe.object,defaultGroupingExpansionDepth:fe.number,density:fe.oneOf(["comfortable","compact","standard"]),detailPanelExpandedRowIds:fe.arrayOf(fe.oneOfType([fe.number,fe.string]).isRequired),disableAutosize:fe.bool,disableChildrenFiltering:fe.bool,disableChildrenSorting:fe.bool,disableColumnFilter:fe.bool,disableColumnMenu:fe.bool,disableColumnPinning:fe.bool,disableColumnReorder:fe.bool,disableColumnResize:fe.bool,disableColumnSelector:fe.bool,disableColumnSorting:fe.bool,disableDensitySelector:fe.bool,disableEval:fe.bool,disableMultipleColumnsFiltering:fe.bool,disableMultipleColumnsSorting:fe.bool,disableMultipleRowSelection:fe.bool,disableRowSelectionOnClick:fe.bool,disableVirtualization:fe.bool,editMode:fe.oneOf(["cell","row"]),estimatedRowCount:fe.number,experimentalFeatures:fe.shape({warnIfFocusStateIsNotSynced:fe.bool}),filterDebounceMs:fe.number,filterMode:fe.oneOf(["client","server"]),filterModel:fe.shape({items:fe.arrayOf(fe.shape({field:fe.string.isRequired,id:fe.oneOfType([fe.number,fe.string]),operator:fe.string.isRequired,value:fe.any})).isRequired,logicOperator:fe.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:fe.bool,quickFilterLogicOperator:fe.oneOf(["and","or"]),quickFilterValues:fe.array}),forwardedProps:fe.object,getCellClassName:fe.func,getDetailPanelContent:fe.func,getDetailPanelHeight:fe.func,getEstimatedRowHeight:fe.func,getRowClassName:fe.func,getRowHeight:fe.func,getRowId:fe.func,getRowSpacing:fe.func,getTreeDataPath:fe.func,groupingColDef:fe.oneOfType([fe.func,fe.object]),headerFilterHeight:fe.number,headerFilters:fe.bool,hideFooter:fe.bool,hideFooterPagination:fe.bool,hideFooterRowCount:fe.bool,hideFooterSelectedRowCount:fe.bool,ignoreDiacritics:fe.bool,ignoreValueFormatterDuringExport:fe.oneOfType([fe.shape({clipboardExport:fe.bool,csvExport:fe.bool}),fe.bool]),indeterminateCheckboxAction:fe.oneOf(["deselect","select"]),initialState:fe.object,isCellEditable:fe.func,isGroupExpandedByDefault:fe.func,isRowSelectable:fe.func,keepColumnPositionIfDraggedOutside:fe.bool,keepNonExistentRowsSelected:fe.bool,loading:fe.bool,localeText:fe.object,logger:fe.shape({debug:fe.func.isRequired,error:fe.func.isRequired,info:fe.func.isRequired,warn:fe.func.isRequired}),logLevel:fe.oneOf(["debug","error","info","warn",!1]),nonce:fe.string,onCellClick:fe.func,onCellDoubleClick:fe.func,onCellEditStart:fe.func,onCellEditStop:fe.func,onCellKeyDown:fe.func,onCellModesModelChange:fe.func,onClipboardCopy:fe.func,onColumnHeaderClick:fe.func,onColumnHeaderContextMenu:fe.func,onColumnHeaderDoubleClick:fe.func,onColumnHeaderEnter:fe.func,onColumnHeaderLeave:fe.func,onColumnHeaderOut:fe.func,onColumnHeaderOver:fe.func,onColumnOrderChange:fe.func,onColumnResize:fe.func,onColumnVisibilityModelChange:fe.func,onColumnWidthChange:fe.func,onDensityChange:fe.func,onDetailPanelExpandedRowIdsChange:fe.func,onFetchRows:fe.func,onFilterModelChange:fe.func,onMenuClose:fe.func,onMenuOpen:fe.func,onPaginationMetaChange:fe.func,onPaginationModelChange:fe.func,onPinnedColumnsChange:fe.func,onPreferencePanelClose:fe.func,onPreferencePanelOpen:fe.func,onProcessRowUpdateError:fe.func,onResize:fe.func,onRowClick:fe.func,onRowCountChange:fe.func,onRowDoubleClick:fe.func,onRowEditStart:fe.func,onRowEditStop:fe.func,onRowModesModelChange:fe.func,onRowOrderChange:fe.func,onRowSelectionModelChange:fe.func,onRowsScrollEnd:fe.func,onSortModelChange:fe.func,onStateChange:fe.func,pageSizeOptions:fe.arrayOf(fe.oneOfType([fe.number,fe.shape({label:fe.string.isRequired,value:fe.number.isRequired})]).isRequired),pagination:fe.bool,paginationMeta:fe.shape({hasNextPage:fe.bool}),paginationMode:fe.oneOf(["client","server"]),paginationModel:fe.shape({page:fe.number.isRequired,pageSize:fe.number.isRequired}),pinnedColumns:fe.object,pinnedRows:fe.shape({bottom:fe.arrayOf(fe.object),top:fe.arrayOf(fe.object)}),processRowUpdate:fe.func,resetPageOnSortFilter:fe.bool,resizeThrottleMs:fe.number,rowBufferPx:fe.number,rowCount:fe.number,rowHeight:fe.number,rowModesModel:fe.object,rowPositionsDebounceMs:fe.number,rowReordering:fe.bool,rows:fe.arrayOf(fe.object),rowSelection:fe.bool,rowSelectionModel:fe.oneOfType([fe.arrayOf(fe.oneOfType([fe.number,fe.string]).isRequired),fe.number,fe.string]),rowSelectionPropagation:fe.shape({descendants:fe.bool,parents:fe.bool}),rowsLoadingMode:fe.oneOf(["client","server"]),rowSpacingType:fe.oneOf(["border","margin"]),scrollbarSize:fe.number,scrollEndThreshold:fe.number,showCellVerticalBorder:fe.bool,showColumnVerticalBorder:fe.bool,slotProps:fe.object,slots:fe.object,sortingMode:fe.oneOf(["client","server"]),sortingOrder:fe.arrayOf(fe.oneOf(["asc","desc"])),sortModel:fe.arrayOf(fe.shape({field:fe.string.isRequired,sort:fe.oneOf(["asc","desc"])})),sx:fe.oneOfType([fe.arrayOf(fe.oneOfType([fe.func,fe.object,fe.bool])),fe.func,fe.object]),throttleRowsMs:fe.number,treeData:fe.bool,unstable_dataSource:fe.shape({getChildrenCount:fe.func,getGroupKey:fe.func,getRows:fe.func.isRequired,updateRow:fe.func}),unstable_dataSourceCache:fe.shape({clear:fe.func.isRequired,get:fe.func.isRequired,set:fe.func.isRequired}),unstable_listColumn:fe.shape({align:fe.oneOf(["center","left","right"]),cellClassName:fe.oneOfType([fe.func,fe.string]),display:fe.oneOf(["flex","text"]),field:fe.string.isRequired,renderCell:fe.func}),unstable_listView:fe.bool,unstable_onDataSourceError:fe.func,unstable_rowSpanning:fe.bool,virtualizeColumnsWithAutoRowHeight:fe.bool};const ru={fontSize:"10px",lineHeight:"12px",letterSpacing:"0.15px",color:"text.primary"},CompactFooter=()=>{const e=ds(),t=useGridSelector(e,Lt);return i.jsxs(me,{direction:"row",alignItems:"center",justifyContent:"flex-end",gap:1,sx:{pt:1},children:[i.jsxs(Ce,{sx:ru,children:[be("ui.datagrid.loadedRows")," :"]}),i.jsx(Ce,{sx:ru,children:t})]})},DataGrid=e=>{const{slotProps:t,slots:r,...n}=e,o=[{width:"100%",height:"100%","& *":{userSelect:"none"},"& .MuiDataGrid-cell:focus":{outline:"none"},"& .MuiDataGrid-cell:focus-within":{outline:"none"},"& .MuiDataGrid-row:focus-within":{outline:"none"}},n.sx].filter(Boolean);return i.jsx(tu,{sx:o,pagination:!0,pageSizeOptions:[50,100,200],disableRowSelectionOnClick:!0,checkboxSelection:!0,disableColumnSelector:!0,localeText:(()=>{const e=JMap.Language.getLocale();return(e===JLOCALES.ES?we:e===JLOCALES.FR?ve:xe).components.MuiDataGrid.defaultProps.localeText})(),hideFooterSelectedRowCount:!0,sortingOrder:["asc","desc"],slots:{loadingOverlay:()=>i.jsx(U,{}),footer:CompactFooter,...r},slotProps:{pagination:{showFirstButton:!0,showLastButton:!0},...t},...n})},CustomNoRowsOverlay=e=>i.jsx(Pl,{children:i.jsx(se,{sx:{p:2,color:"error.main",fontWeight:"bold"},children:e.message})}),dataGridSx=e=>({height:"100%",border:"none","& .MuiDataGrid-columnHeader":{borderBottom:`1px solid ${e.palette.divider}`,borderRight:"none",backgroundColor:e.palette.background.paper},"& .MuiDataGrid-columnHeader--pinnedRight":{boxShadow:`-2px 0 3px -1px ${e.palette.divider}`,backgroundColor:e.palette.background.paper,zIndex:2},"& .MuiDataGrid-cell--pinnedRight":{boxShadow:`-2px 0 3px -1px ${e.palette.divider}`,backgroundColor:e.palette.background.paper,zIndex:1},"& .MuiDataGrid-cell":{borderBottom:`1px solid ${e.palette.divider}`,borderRight:"none"},"& .MuiDataGrid-columnSeparator":{display:"none"},"& .MuiDataGrid-footerContainer":{borderTop:"none",minHeight:0,padding:0},"& .MuiCheckbox-root":{p:0},"& .MuiDataGrid-cell .hover-action-icon-button":{display:"none"},"& .MuiDataGrid-row.hovered .hover-action-icon-button":{display:"inline-flex"}}),DataGridWithCRUD=({rows:e,columns:t,canCreate:r,canDelete:n,onFilterModelChange:o,onSortModelChange:l,onRowsScrollEnd:a,onCreateRow:s,onDeleteRows:u,onZoomToRows:c,filterModel:d,sortModel:p,isFetchingNextPage:g,selectedRowIds:h,setSelectedRowIds:m,dynamicFilters:C,onDynamicFilterToggle:b,isLoading:w,hasLoadingError:v,onRowDoubleClick:x,sx:R,...y})=>{const S=ce(),{hoveredRowId:I,onMouseEnter:M,onMouseLeave:P,onMouseMove:k}=Re();return w&&0===t.length?i.jsx(me,{justifyContent:"center",alignItems:"center",sx:{height:"100%",width:"100%"},children:i.jsx(q,{size:70})}):i.jsxs(me,{sx:{height:"100%",minHeight:0,gap:1},children:[C&&C.length>0&&i.jsx(me,{gap:1,justifyContent:"flex-start",direction:"row",flexWrap:"wrap",children:C.map(e=>i.jsxs(me,{width:"fit-content",padding:"0.5rem",justifyContent:"flex-start",alignItems:"center",sx:{backgroundColor:"dark"===S.palette.mode?S.palette.mainNavigation.panelBackground:S.palette.mainNavigation.sidebarBackground,borderRadius:"0.5rem"},direction:"row",children:[i.jsx(Ce,{color:"textSecondary",children:e.name}),i.jsx(ye,{sx:{marginLeft:"1rem"},checked:e.active,onClick:t=>{t.stopPropagation(),b?.(e.resourceId,e.id,!e.active)}})]},e.id))}),(n||r||c)&&i.jsxs(me,{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",gap:1,children:[c&&i.jsx(Z,{title:be("selection.center.layer"),children:i.jsx("span",{style:{display:"inline-flex"},children:i.jsx(Se,{icon:Ie.faBullseyeArrow,disabled:0===h.length,onClick:c,"data-testid":"data-grid-center-selection"})})}),n&&i.jsx(Se,{icon:Me.faTrash,disabled:0===h.length,onClick:u,"data-testid":"data-grid-delete-selection"}),r&&i.jsx(Se,{icon:at.faPlusLarge,onClick:s,"data-testid":"table-create-button"})]}),i.jsx(se,{sx:{flex:1,minHeight:0},children:i.jsx(DataGrid,{rowType:"tr",rows:e,getRowClassName:e=>I?.toString()===e.id.toString()?"hovered":"",checkboxSelection:n||!!c,rowSelectionModel:h,onRowSelectionModelChange:m,onRowDoubleClick:x,slots:{noRowsOverlay:CustomNoRowsOverlay},slotProps:{baseCheckbox:{size:"small",sx:{pl:0}},columnHeaders:{style:{height:29}},noRowsOverlay:{message:be(v?"table.error":"table.nodata")},row:{onMouseEnter:M,onMouseLeave:P,onMouseMove:k}},columns:t,loading:w||g,onRowsScrollEnd:a,scrollEndThreshold:200,pagination:!1,pageSizeOptions:void 0,initialState:{pinnedColumns:{right:["actions"]}},sortModel:p,filterModel:d,sortingMode:"server",filterMode:"server",onSortModelChange:l,onFilterModelChange:o,rowHeight:29,columnHeaderHeight:29,sx:[dataGridSx,...Array.isArray(R)?R:R?[R]:[]],...y})})]})};const buildDataColumns=({tableColumns:e,rowTemplate:t,attributes:r,locale:n})=>0===e.length?[]:e.map(e=>{const o=t?.[e],l=void 0!==o&&!isNaN(Number(o)),i=l?"number":"string",a=r.find(t=>t.name===e);return{field:e,headerName:a?.title?.[n]||a?.name,minWidth:100,flex:1,sortable:!0,type:i,disableColumnMenu:!0,filterOperators:l?getGridNumericOperators().filter(e=>!["isEmpty","isNotEmpty","isAnyOf"].includes(e.value)):getGridStringOperators().filter(e=>["contains","equals","startsWith"].includes(e.value)).map(e=>"startsWith"===e.value?{...e,value:"inequals",label:be("label.is.not.equal")}:e),align:"left",headerAlign:"left"}}),buildRowObjectsFromPage=e=>e.rows.map(t=>{const r={};return e.columns.forEach((e,n)=>{r[e]=t[n]}),r}),buildRowObjectsFromFeaturePage=e=>e.features.map(e=>({...e.properties??{},id:`${e.id}`})),dedupeRowsById=(e,t)=>{const r=new Set,n=[];for(const o of e){const e=t(o);r.has(e)||(r.add(e),n.push(o))}return n},nu=Object.freeze(Object.defineProperty({__proto__:null,FormEmbeddedDataGridContext:({dataSource:e,attributes:t,sortingAttribute:n,filter:o})=>{const l=JMap.Language.getLocale(),a=Pe(),{data:s}=ke(e.id),{data:u=[]}=De(e.id,e.organizationId),c=!Ee(e),d=!c&&u.includes("CREATE_ROW"),p=c?u.includes("DELETE_FEATURE"):u.includes("DELETE_ROW"),g=c?u.includes("EDIT_FEATURE_ATTRIBUTES"):u.includes("EDIT_ROW"),h=Fe({dataSourceId:e.id,dataSourceOrganizationId:e.organizationId}),m=Ge({dataSourceId:e.id,dataSourceOrganizationId:e.organizationId}),C=c?h:m,[b,w]=r.useState(n?[{field:n,sort:"asc"}]:void 0),[v,x]=r.useState([]),{data:R,fetchNextPage:y,hasNextPage:S,isFetchingNextPage:I}=He({dataSourceId:e.id,dataSourceOrganizationId:e.organizationId,pageSize:50,sortModel:b,filterModel:o,attributes:t.map(e=>e.name),dataSourceType:e.type}),M=r.useMemo(()=>{const e=R.pages.flatMap(e=>"rows"in e?buildRowObjectsFromPage(e):buildRowObjectsFromFeaturePage(e)),r=dedupeRowsById(e,e=>c?e.id:e.jmap_feature_id);return Te(r,t,l)},[R,t,l]),P=r.useMemo(()=>[...buildDataColumns({tableColumns:t.map(e=>e.name),rowTemplate:M[0],attributes:t,locale:l}),{field:"actions",sortable:!1,filterable:!1,headerName:"",disableColumnMenu:!0,disableReorder:!0,hideSortIcons:!0,width:50,align:"right",renderCell:t=>s?i.jsx("div",{style:{overflow:"visible",textOverflow:"unset",whiteSpace:"normal"},children:i.jsx(te,{className:"hover-action-icon-button",size:"small",sx:{color:"text.primary"},disabled:!s,onClick:()=>{c?je.openSubForm({type:"layerUpdate",dataSourceId:e.id,organizationId:e.organizationId,featureId:t.row.id,isReadOnly:!g}):je.openSubForm({type:"tableUpdate",dataSourceId:e.id,organizationId:e.organizationId,rowId:t.row.jmap_feature_id,isReadOnly:!g})},children:i.jsx(Oe,{icon:g?Le.faFilePen:Ae.faFileCircleInfo})})}):null}],[t,M,l,s,e.id,e.organizationId,g,c]);return i.jsx(DataGridWithCRUD,{rows:M,columns:P,canCreate:d,canDelete:p,onSortModelChange:w,onRowsScrollEnd:()=>{S&&!I&&y()},onDeleteRows:()=>{$e.confirmMessage({title:be("table.dialog.delete.title"),message:be("table.dialog.delete.message",v.length),onSuccess:async()=>{await C.mutateAsync(v),x([])}})},onCreateRow:()=>{c||je.openSubForm({type:"tableCreate",dataSourceId:e.id,organizationId:e.organizationId,isReadOnly:!1,onSubmit:async()=>{x([]),await(async()=>{await a.invalidateQueries({queryKey:ze(e.id,b,o)})})()}})},sortModel:b,isFetchingNextPage:I,selectedRowIds:v,setSelectedRowIds:x,getRowId:e=>c?e.id:e.jmap_feature_id,sx:{maxHeight:400}})}},Symbol.toStringTag,{value:"Module"}));var ou,lu={};function requireFaXmarkLarge(){return ou||(ou=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});var t="xmark-large",r=[],n="e59b",o="M7.5 41C-1.8 31.6-1.8 16.4 7.5 7S32.1-2.3 41.5 7l215 215 215-215c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-215 215 215 215c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-215-215-215 215c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l215-215-215-215z";e.definition={prefix:"far",iconName:t,icon:[512,512,r,n,o]},e.faXmarkLarge=e.definition,e.prefix="far",e.iconName=t,e.width=512,e.height=512,e.ligatures=r,e.unicode=n,e.svgPathData=o,e.aliases=r}(lu)),lu}var iu=requireFaXmarkLarge();const DataGridDialogShell=({title:e,onClose:t,children:n})=>{const[o]=r.useState(()=>{const e=JMap.Application.UI.Container.getWidth(),t=JMap.Application.UI.Container.getHeight(),r=JMap.Application.UI.SidePanel.getMainPanelWidthInPixel();return{x:r+70,y:t-510,width:Math.max(200,e-r-80),height:500}});return i.jsx(Ze,{default:o,bounds:"window",dragHandleClassName:"drag-handle",style:{zIndex:3e3,pointerEvents:"auto"},minWidth:200,minHeight:200,children:i.jsxs(b,{id:"jmap-data-grid-dialog","data-testid":"data-grid-dialog",sx:{height:"100%",p:1.5,display:"flex",flexDirection:"column",gap:1},children:[i.jsxs(me,{flexDirection:"row",justifyContent:"space-between","data-testid":"data-grid-header",children:[i.jsx(Ce,{id:"jmap-table-title",variant:"h6",flex:1,color:"textPrimary",className:"drag-handle",style:{cursor:"move",lineHeight:"normal"},children:e}),i.jsx(te,{sx:{p:"2px",height:"20px",width:"20px"},onClick:t,"data-testid":"data-grid-close",children:i.jsx(Oe,{style:{height:"12px",width:"12px",color:"text.primary"},icon:iu.faXmarkLarge})})]}),i.jsx(se,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:i.jsx(Ve,{fallback:i.jsx(DataGridErrorFallback,{}),children:i.jsx(r.Suspense,{fallback:i.jsx(DataGridLoadingFallback,{}),children:n})})})]})})},DataGridLoadingFallback=()=>i.jsx(me,{sx:{height:"100%",alignItems:"center",justifyContent:"center"},children:i.jsx(q,{size:50})}),DataGridErrorFallback=()=>i.jsx(me,{sx:{height:"100%",alignItems:"center",justifyContent:"center"},children:i.jsx(Ce,{sx:{color:e=>e.palette.error.main},children:be("table.error")})}),LayerDataGridContext=({layerId:e})=>{const t=Be(t=>t.layer.allById[e]);return t?i.jsx(LayerDataGridContextInner,{layer:t}):null},LayerDataGridContextInner=({layer:e})=>{const t=JMap.Language.getLocale(),n=Pe(),{data:o}=_e(e.spatialDataSourceId,e.spatialDataSourceOrganizationId,!0),{data:l}=ke(e.spatialDataSourceId),[a,s]=r.useState(void 0),[u,c]=r.useState([]),d=e.permissions.EDIT_FEATURE_ATTRIBUTES&&e.allowClientSideEditing,p=e.permissions.DELETE_FEATURE&&e.allowClientSideEditing,g=r.useMemo(()=>((e,t)=>{const r=[e,...t.filter(e=>e.active).map(e=>e.filter).filter(e=>"string"!=typeof e&&void 0!==e)].filter(e=>Boolean(e)).map(Ne);if(0===r.length)return"";const n={id:"combined-filter",op:"and",args:r};return JSON.stringify(n)})(e.baseFilter,e.dynamicFilters),[e.baseFilter,e.dynamicFilters]),h=Fe({dataSourceId:e.spatialDataSourceId,dataSourceOrganizationId:e.spatialDataSourceOrganizationId}),m=o?.attributes??[],{data:C,fetchNextPage:b,hasNextPage:w,isFetchingNextPage:v}=He({dataSourceId:e.spatialDataSourceId,dataSourceOrganizationId:e.spatialDataSourceOrganizationId,pageSize:50,sortModel:a,filterModel:g,attributes:m.map(e=>e.name),dataSourceType:o?.type??"VectorDataSource"}),x=r.useMemo(()=>{const e=C.pages.flatMap(e=>"features"in e?buildRowObjectsFromFeaturePage(e):[]),r=dedupeRowsById(e,e=>e.id);return Te(r,m,t)},[C,m,t]),R=r.useMemo(()=>[...buildDataColumns({tableColumns:m.map(e=>e.name),rowTemplate:x[0],attributes:m,locale:t}),{field:"actions",sortable:!1,filterable:!1,headerName:"",disableColumnMenu:!0,disableReorder:!0,hideSortIcons:!0,width:50,align:"right",renderCell:t=>l?i.jsx("div",{style:{overflow:"visible",textOverflow:"unset",whiteSpace:"normal"},children:i.jsx(te,{className:"hover-action-icon-button",size:"small",sx:{color:"text.primary"},disabled:!l,onClick:()=>{je.openForm({type:"layerUpdate",layer:e,featureId:t.row.id,isReadOnly:!d})},children:i.jsx(Oe,{icon:d?Le.faFilePen:Ae.faFileCircleInfo})})}):null}],[m,x,t,l,e,d]),zoomToFeatures=async t=>{if(0!==t.length)try{const r=await Promise.all(t.map(t=>JMap.Feature.getById(e.id,t))),n=document.getElementById("jmap-data-grid-dialog"),o=n?n.clientHeight+Ue():Ue();JMap.Map.fitFeatures(r,{maxZoom:17,paddingBottom:o})}catch(r){console.error("Failed to zoom to features",r)}};return o?i.jsx(DataGridWithCRUD,{rows:x,columns:R,canCreate:!1,canDelete:p,onSortModelChange:s,onRowsScrollEnd:()=>{w&&!v&&b()},onDeleteRows:()=>{$e.confirmMessage({title:be("table.dialog.delete.title"),message:be("table.dialog.delete.message",u.length),onSuccess:async()=>{await h.mutateAsync(u),c([])}})},onZoomToRows:()=>zoomToFeatures(u),sortModel:a,isFetchingNextPage:v,selectedRowIds:u,setSelectedRowIds:c,dynamicFilters:e.dynamicFilters,onDynamicFilterToggle:(t,r,o)=>{JMap.Layer.DynamicFilter.setIsActive(e.id,r,o),n.invalidateQueries({queryKey:We.dataSourceData(e.spatialDataSourceId)})},onRowDoubleClick:e=>zoomToFeatures([e.row.id])}):null},TableDataGridContext=({table:e})=>{const{data:t}=qe(e.dataSourceId),n=JMap.Language.getLocale(),[o,l]=r.useState(void 0),[a,s]=r.useState(),[u,c]=r.useState(),[d,p]=r.useState([]),g=e.permissions.EDIT_ROW&&e.allowClientSideEditing,h=e.permissions.DELETE_ROW&&e.allowClientSideEditing,m=e.permissions.CREATE_ROW&&e.allowClientSideEditing&&!!t,C=Ke({tableId:e.id,dataSourceId:e.dataSourceId}),b=r.useMemo(()=>e.dynamicFilters.filter(e=>e.active).map(e=>e.id).sort(),[e.dynamicFilters]),{data:w,fetchNextPage:v,hasNextPage:x,isError:R,isFetchingNextPage:y,isLoading:S}=Xe({tableId:e.id,dataSourceId:e.dataSourceId,pageSize:50,sortModel:u,filterModel:a,activeDynamicFilterIds:b});r.useEffect(()=>{let t=!0;return(async()=>{try{const r=await JMap.Table.getDataSourceAttributes(e.id);t&&l(r)}catch(r){console.error(r)}})(),()=>{t=!1}},[e.id]);const I=r.useMemo(()=>w?.pages?.length?dedupeRowsById(w.pages.flatMap(buildRowObjectsFromPage),e=>e.jmap_feature_id):[],[w]),M=r.useMemo(()=>o?Te(I,o,n):I,[o,n,I]),P=r.useMemo(()=>{if(!o)return[];const r=w?.pages?.[0];if(!r)return[];return[...buildDataColumns({tableColumns:r.columns.filter(e=>"jmap_feature_id"!==e),rowTemplate:I[0],attributes:o,locale:n}),{field:"actions",sortable:!1,filterable:!1,headerName:"",disableColumnMenu:!0,disableReorder:!0,hideSortIcons:!0,width:50,align:"right",renderCell:r=>t?i.jsx("div",{style:{overflow:"visible",textOverflow:"unset",whiteSpace:"normal"},children:i.jsx(te,{className:"hover-action-icon-button","data-testid":`table-row-${r.row.jmap_feature_id}-edit`,size:"small",sx:{color:"text.primary"},disabled:!t,onClick:()=>{je.openForm({type:"tableUpdate",table:e,rowId:r.row.jmap_feature_id,isReadOnly:!g})},children:i.jsx(Oe,{icon:g?Le.faFilePen:Ae.faFileCircleInfo})})}):null}]},[o,w,I,n,t,e,g]);return i.jsx(DataGridWithCRUD,{rows:M,columns:P,canCreate:m,canDelete:h,onFilterModelChange:s,onSortModelChange:c,onRowsScrollEnd:()=>{x&&!y&&v()},onCreateRow:()=>{je.openForm({type:"tableCreate",table:e,isReadOnly:!1})},onDeleteRows:async()=>{$e.confirmMessage({title:be("table.dialog.delete.title"),message:be("table.dialog.delete.message",d.length),onSuccess:async()=>{await C.mutateAsync(d),p([])}})},filterModel:a,sortModel:u,isFetchingNextPage:y,isLoading:S,hasLoadingError:R,selectedRowIds:d,setSelectedRowIds:p,dynamicFilters:e.dynamicFilters,onDynamicFilterToggle:(e,t,r)=>{JMap.Table.setDynamicFilterActive(e,t,r)},getRowId:e=>e.jmap_feature_id})},closeDataGrid=()=>Qe().dispatch(Je.setActiveDataGrid(void 0)),au=Object.freeze(Object.defineProperty({__proto__:null,DataGridDialog:()=>{const e=Ye(e=>e.dataGrid.activeDataGrid),t=Be(t=>"table"===e?.type?t.table.tables.find(t=>t.id===e.id):void 0),r=Be(t=>"layer"===e?.type?t.layer.allById[e.id]:void 0);switch(e?.type){case"table":return t?i.jsx(DataGridDialogShell,{title:t.name,onClose:closeDataGrid,children:i.jsx(TableDataGridContext,{table:t})},`table-${t.id}`):null;case"layer":return r?i.jsx(DataGridDialogShell,{title:r.name,onClose:closeDataGrid,children:i.jsx(LayerDataGridContext,{layerId:r.id})},`layer-${r.id}`):null;default:return null}}},Symbol.toStringTag,{value:"Module"}));export{au as D,nu as F};