diff --git a/assets/AboutDialog-Btu7spuG.js b/assets/AboutDialog-DdOksUbQ.js similarity index 91% rename from assets/AboutDialog-Btu7spuG.js rename to assets/AboutDialog-DdOksUbQ.js index 2d16cd3..122d35e 100644 --- a/assets/AboutDialog-Btu7spuG.js +++ b/assets/AboutDialog-DdOksUbQ.js @@ -1,2 +1,2 @@ -import{R as e,e as o,D as n,T as l,L as t}from"./index-BW_Tl6Ao.js";const i="4.0.2";function c({onClose:r}){return e.createElement(o.Dialog,{onClose:()=>{r()},open:!0,title:"About this plugin"},e.createElement(n,null,e.createElement(l,null,"MSAView ",i," (",e.createElement(t,{href:"https://github.com/gmod/jbrowse-plugin-msaview"},"Github"),")"),e.createElement("ul",null,e.createElement("li",null,e.createElement(l,null,"We use some color schemes from the"," ",e.createElement(t,{href:"https://github.com/biotite-dev/biotite"},"biotite")," ","project, and their license is reproduced"," ",e.createElement(t,{href:"https://github.com/biotite-dev/biotite/blob/master/LICENSE.rst"},"here"))),e.createElement("li",null,e.createElement(l,null,"See this page for some information on jalview colorings"," ",e.createElement(t,{href:"https://www.jalview.org/help/html/colourSchemes/"},"here"))),e.createElement("li",null,e.createElement(l,null,"See this page for some info on the clustal, cinema, maeditor, and lesk color schemes"," ",e.createElement(t,{href:"http://www.bioinformatics.nl/~berndb/aacolour.html"},"here"))),e.createElement("li",null,e.createElement(l,null,"See this paper about the flower color scheme"," ",e.createElement(t,{href:"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7245768/"},"here"))))))}export{c as default}; -//# sourceMappingURL=AboutDialog-Btu7spuG.js.map +import{R as e,e as o,D as n,T as l,L as t}from"./index-PBHga9OU.js";const i="4.0.2";function c({onClose:r}){return e.createElement(o.Dialog,{onClose:()=>{r()},open:!0,title:"About this plugin"},e.createElement(n,null,e.createElement(l,null,"MSAView ",i," (",e.createElement(t,{href:"https://github.com/gmod/jbrowse-plugin-msaview"},"Github"),")"),e.createElement("ul",null,e.createElement("li",null,e.createElement(l,null,"We use some color schemes from the"," ",e.createElement(t,{href:"https://github.com/biotite-dev/biotite"},"biotite")," ","project, and their license is reproduced"," ",e.createElement(t,{href:"https://github.com/biotite-dev/biotite/blob/master/LICENSE.rst"},"here"))),e.createElement("li",null,e.createElement(l,null,"See this page for some information on jalview colorings"," ",e.createElement(t,{href:"https://www.jalview.org/help/html/colourSchemes/"},"here"))),e.createElement("li",null,e.createElement(l,null,"See this page for some info on the clustal, cinema, maeditor, and lesk color schemes"," ",e.createElement(t,{href:"http://www.bioinformatics.nl/~berndb/aacolour.html"},"here"))),e.createElement("li",null,e.createElement(l,null,"See this paper about the flower color scheme"," ",e.createElement(t,{href:"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7245768/"},"here"))))))}export{c as default}; +//# sourceMappingURL=AboutDialog-DdOksUbQ.js.map diff --git a/assets/AboutDialog-Btu7spuG.js.map b/assets/AboutDialog-DdOksUbQ.js.map similarity index 98% rename from assets/AboutDialog-Btu7spuG.js.map rename to assets/AboutDialog-DdOksUbQ.js.map index 681d2ec..03fd00b 100644 --- a/assets/AboutDialog-Btu7spuG.js.map +++ b/assets/AboutDialog-DdOksUbQ.js.map @@ -1 +1 @@ -{"version":3,"file":"AboutDialog-Btu7spuG.js","sources":["../../../lib/dist/version.js","../../../lib/dist/components/dialogs/AboutDialog.js"],"sourcesContent":["export const version = '4.0.2';\n//# sourceMappingURL=version.js.map","import React from 'react';\nimport { Dialog } from '@jbrowse/core/ui';\nimport { DialogContent, Typography, Link } from '@mui/material';\nimport { version } from '../../version';\nexport default function AboutDialog({ onClose }) {\n return (React.createElement(Dialog, { onClose: () => {\n onClose();\n }, open: true, title: \"About this plugin\" },\n React.createElement(DialogContent, null,\n React.createElement(Typography, null,\n \"MSAView \",\n version,\n \" (\",\n React.createElement(Link, { href: \"https://github.com/gmod/jbrowse-plugin-msaview\" }, \"Github\"),\n \")\"),\n React.createElement(\"ul\", null,\n React.createElement(\"li\", null,\n React.createElement(Typography, null,\n \"We use some color schemes from the\",\n ' ',\n React.createElement(Link, { href: \"https://github.com/biotite-dev/biotite\" }, \"biotite\"),\n ' ',\n \"project, and their license is reproduced\",\n ' ',\n React.createElement(Link, { href: \"https://github.com/biotite-dev/biotite/blob/master/LICENSE.rst\" }, \"here\"))),\n React.createElement(\"li\", null,\n React.createElement(Typography, null,\n \"See this page for some information on jalview colorings\",\n ' ',\n React.createElement(Link, { href: \"https://www.jalview.org/help/html/colourSchemes/\" }, \"here\"))),\n React.createElement(\"li\", null,\n React.createElement(Typography, null,\n \"See this page for some info on the clustal, cinema, maeditor, and lesk color schemes\",\n ' ',\n React.createElement(Link, { href: \"http://www.bioinformatics.nl/~berndb/aacolour.html\" }, \"here\"))),\n React.createElement(\"li\", null,\n React.createElement(Typography, null,\n \"See this paper about the flower color scheme\",\n ' ',\n React.createElement(Link, { href: \"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7245768/\" }, \"here\")))))));\n}\n//# sourceMappingURL=AboutDialog.js.map"],"names":["version","AboutDialog","onClose","React","Dialog","DialogContent","Typography","Link"],"mappings":"oEAAO,MAAMA,EAAU,QCIR,SAASC,EAAY,CAAE,QAAAC,GAAW,CAC7C,OAAQC,EAAM,cAAcC,SAAQ,CAAE,QAAS,IAAM,CAC7CF,GACH,EAAE,KAAM,GAAM,MAAO,mBAAqB,EAC3CC,EAAM,cAAcE,EAAe,KAC/BF,EAAM,cAAcG,EAAY,KAC5B,WACAN,EACA,KACAG,EAAM,cAAcI,EAAM,CAAE,KAAM,gDAAkD,EAAE,QAAQ,EAC9F,GAAG,EACPJ,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAcG,EAAY,KAC5B,qCACA,IACAH,EAAM,cAAcI,EAAM,CAAE,KAAM,wCAA0C,EAAE,SAAS,EACvF,IACA,2CACA,IACAJ,EAAM,cAAcI,EAAM,CAAE,KAAM,gEAAkE,EAAE,MAAM,CAAC,CAAC,EACtHJ,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAcG,EAAY,KAC5B,0DACA,IACAH,EAAM,cAAcI,EAAM,CAAE,KAAM,kDAAoD,EAAE,MAAM,CAAC,CAAC,EACxGJ,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAcG,EAAY,KAC5B,uFACA,IACAH,EAAM,cAAcI,EAAM,CAAE,KAAM,oDAAsD,EAAE,MAAM,CAAC,CAAC,EAC1GJ,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAcG,EAAY,KAC5B,+CACA,IACAH,EAAM,cAAcI,EAAM,CAAE,KAAM,uDAAyD,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAChI"} \ No newline at end of file +{"version":3,"file":"AboutDialog-DdOksUbQ.js","sources":["../../../lib/dist/version.js","../../../lib/dist/components/dialogs/AboutDialog.js"],"sourcesContent":["export const version = '4.0.2';\n//# sourceMappingURL=version.js.map","import React from 'react';\nimport { Dialog } from '@jbrowse/core/ui';\nimport { DialogContent, Typography, Link } from '@mui/material';\nimport { version } from '../../version';\nexport default function AboutDialog({ onClose }) {\n return (React.createElement(Dialog, { onClose: () => {\n onClose();\n }, open: true, title: \"About this plugin\" },\n React.createElement(DialogContent, null,\n React.createElement(Typography, null,\n \"MSAView \",\n version,\n \" (\",\n React.createElement(Link, { href: \"https://github.com/gmod/jbrowse-plugin-msaview\" }, \"Github\"),\n \")\"),\n React.createElement(\"ul\", null,\n React.createElement(\"li\", null,\n React.createElement(Typography, null,\n \"We use some color schemes from the\",\n ' ',\n React.createElement(Link, { href: \"https://github.com/biotite-dev/biotite\" }, \"biotite\"),\n ' ',\n \"project, and their license is reproduced\",\n ' ',\n React.createElement(Link, { href: \"https://github.com/biotite-dev/biotite/blob/master/LICENSE.rst\" }, \"here\"))),\n React.createElement(\"li\", null,\n React.createElement(Typography, null,\n \"See this page for some information on jalview colorings\",\n ' ',\n React.createElement(Link, { href: \"https://www.jalview.org/help/html/colourSchemes/\" }, \"here\"))),\n React.createElement(\"li\", null,\n React.createElement(Typography, null,\n \"See this page for some info on the clustal, cinema, maeditor, and lesk color schemes\",\n ' ',\n React.createElement(Link, { href: \"http://www.bioinformatics.nl/~berndb/aacolour.html\" }, \"here\"))),\n React.createElement(\"li\", null,\n React.createElement(Typography, null,\n \"See this paper about the flower color scheme\",\n ' ',\n React.createElement(Link, { href: \"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7245768/\" }, \"here\")))))));\n}\n//# sourceMappingURL=AboutDialog.js.map"],"names":["version","AboutDialog","onClose","React","Dialog","DialogContent","Typography","Link"],"mappings":"oEAAO,MAAMA,EAAU,QCIR,SAASC,EAAY,CAAE,QAAAC,GAAW,CAC7C,OAAQC,EAAM,cAAcC,SAAQ,CAAE,QAAS,IAAM,CAC7CF,GACH,EAAE,KAAM,GAAM,MAAO,mBAAqB,EAC3CC,EAAM,cAAcE,EAAe,KAC/BF,EAAM,cAAcG,EAAY,KAC5B,WACAN,EACA,KACAG,EAAM,cAAcI,EAAM,CAAE,KAAM,gDAAkD,EAAE,QAAQ,EAC9F,GAAG,EACPJ,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAcG,EAAY,KAC5B,qCACA,IACAH,EAAM,cAAcI,EAAM,CAAE,KAAM,wCAA0C,EAAE,SAAS,EACvF,IACA,2CACA,IACAJ,EAAM,cAAcI,EAAM,CAAE,KAAM,gEAAkE,EAAE,MAAM,CAAC,CAAC,EACtHJ,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAcG,EAAY,KAC5B,0DACA,IACAH,EAAM,cAAcI,EAAM,CAAE,KAAM,kDAAoD,EAAE,MAAM,CAAC,CAAC,EACxGJ,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAcG,EAAY,KAC5B,uFACA,IACAH,EAAM,cAAcI,EAAM,CAAE,KAAM,oDAAsD,EAAE,MAAM,CAAC,CAAC,EAC1GJ,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAcG,EAAY,KAC5B,+CACA,IACAH,EAAM,cAAcI,EAAM,CAAE,KAAM,uDAAyD,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAChI"} \ No newline at end of file diff --git a/assets/Checkbox2-qAuBBMke.js b/assets/Checkbox2-Bjl1T2Gs.js similarity index 67% rename from assets/Checkbox2-qAuBBMke.js rename to assets/Checkbox2-Bjl1T2Gs.js index a2f9d0f..c9590a1 100644 --- a/assets/Checkbox2-qAuBBMke.js +++ b/assets/Checkbox2-Bjl1T2Gs.js @@ -1,2 +1,2 @@ -import{R as e,C as a,i as l}from"./index-BW_Tl6Ao.js";function c(t){return e.createElement("div",null,e.createElement(l,{...t}))}function C({checked:t,label:n,disabled:o,onChange:r}){return e.createElement(c,{control:e.createElement(a,{disabled:o,checked:t,onChange:r}),label:n})}export{C}; -//# sourceMappingURL=Checkbox2-qAuBBMke.js.map +import{R as e,C as a,i as l}from"./index-PBHga9OU.js";function c(t){return e.createElement("div",null,e.createElement(l,{...t}))}function C({checked:t,label:n,disabled:o,onChange:r}){return e.createElement(c,{control:e.createElement(a,{disabled:o,checked:t,onChange:r}),label:n})}export{C}; +//# sourceMappingURL=Checkbox2-Bjl1T2Gs.js.map diff --git a/assets/Checkbox2-qAuBBMke.js.map b/assets/Checkbox2-Bjl1T2Gs.js.map similarity index 94% rename from assets/Checkbox2-qAuBBMke.js.map rename to assets/Checkbox2-Bjl1T2Gs.js.map index 61b4f40..3dff7ac 100644 --- a/assets/Checkbox2-qAuBBMke.js.map +++ b/assets/Checkbox2-Bjl1T2Gs.js.map @@ -1 +1 @@ -{"version":3,"file":"Checkbox2-qAuBBMke.js","sources":["../../../lib/dist/components/Checkbox2.js"],"sourcesContent":["import React from 'react';\nimport { Checkbox, FormControlLabel, } from '@mui/material';\nfunction FormControlLabel2(rest) {\n return (React.createElement(\"div\", null,\n React.createElement(FormControlLabel, { ...rest })));\n}\nexport default function Checkbox2({ checked, label, disabled, onChange, }) {\n return (React.createElement(FormControlLabel2, { control: React.createElement(Checkbox, { disabled: disabled, checked: checked, onChange: onChange }), label: label }));\n}\n//# sourceMappingURL=Checkbox2.js.map"],"names":["FormControlLabel2","rest","React","FormControlLabel","Checkbox2","checked","label","disabled","onChange","Checkbox"],"mappings":"sDAEA,SAASA,EAAkBC,EAAM,CAC7B,OAAQC,EAAM,cAAc,MAAO,KAC/BA,EAAM,cAAcC,EAAkB,CAAE,GAAGF,CAAI,CAAE,CAAC,CAC1D,CACe,SAASG,EAAU,CAAE,QAAAC,EAAS,MAAAC,EAAO,SAAAC,EAAU,SAAAC,CAAQ,EAAK,CACvE,OAAQN,EAAM,cAAcF,EAAmB,CAAE,QAASE,EAAM,cAAcO,EAAU,CAAE,SAAUF,EAAU,QAASF,EAAS,SAAUG,CAAU,CAAA,EAAG,MAAOF,CAAK,CAAE,CACzK"} \ No newline at end of file +{"version":3,"file":"Checkbox2-Bjl1T2Gs.js","sources":["../../../lib/dist/components/Checkbox2.js"],"sourcesContent":["import React from 'react';\nimport { Checkbox, FormControlLabel, } from '@mui/material';\nfunction FormControlLabel2(rest) {\n return (React.createElement(\"div\", null,\n React.createElement(FormControlLabel, { ...rest })));\n}\nexport default function Checkbox2({ checked, label, disabled, onChange, }) {\n return (React.createElement(FormControlLabel2, { control: React.createElement(Checkbox, { disabled: disabled, checked: checked, onChange: onChange }), label: label }));\n}\n//# sourceMappingURL=Checkbox2.js.map"],"names":["FormControlLabel2","rest","React","FormControlLabel","Checkbox2","checked","label","disabled","onChange","Checkbox"],"mappings":"sDAEA,SAASA,EAAkBC,EAAM,CAC7B,OAAQC,EAAM,cAAc,MAAO,KAC/BA,EAAM,cAAcC,EAAkB,CAAE,GAAGF,CAAI,CAAE,CAAC,CAC1D,CACe,SAASG,EAAU,CAAE,QAAAC,EAAS,MAAAC,EAAO,SAAAC,EAAU,SAAAC,CAAQ,EAAK,CACvE,OAAQN,EAAM,cAAcF,EAAmB,CAAE,QAASE,EAAM,cAAcO,EAAU,CAAE,SAAUF,EAAU,QAASF,EAAS,SAAUG,CAAU,CAAA,EAAG,MAAOF,CAAK,CAAE,CACzK"} \ No newline at end of file diff --git a/assets/ExportSVGDialog-BFFuOImy.js b/assets/ExportSVGDialog-5qJ1MiKx.js similarity index 86% rename from assets/ExportSVGDialog-BFFuOImy.js rename to assets/ExportSVGDialog-5qJ1MiKx.js index a7db962..75bd5b5 100644 --- a/assets/ExportSVGDialog-BFFuOImy.js +++ b/assets/ExportSVGDialog-5qJ1MiKx.js @@ -1,2 +1,2 @@ -import{j as l,k as v,R as e,e as c,D as y,T as C,l as h,n as x,p as S,i,q as s,h as b,B as m}from"./index-BW_Tl6Ao.js";import{C as f}from"./Checkbox2-qAuBBMke.js";function M({model:u,onClose:r}){const[n,p]=l.useState(!0),[t,E]=l.useState("viewport"),[o,d]=l.useState(),g=v();return e.createElement(c.Dialog,{onClose:()=>{r()},open:!0,title:"Export SVG"},e.createElement(y,null,o?e.createElement(c.ErrorMessage,{error:o}):null,e.createElement(C,null,"Settings:"),e.createElement(f,{label:"Include minimap?",disabled:t==="entire",checked:n,onChange:()=>{p(!n)}}),e.createElement("div",null,e.createElement(h,null,e.createElement(x,null,"Export type"),e.createElement(S,{value:t,onChange:a=>{E(a.target.value)}},e.createElement(i,{value:"entire",control:e.createElement(s,null),label:"Entire MSA"}),e.createElement(i,{value:"viewport",control:e.createElement(s,null),label:"Current viewport only"}))))),e.createElement(b,null,e.createElement(m,{variant:"contained",color:"primary",onClick:()=>{(async()=>{try{await u.exportSVG({theme:g,includeMinimap:t==="entire"?!1:n,exportType:t})}catch(a){console.error(a),d(a)}r()})()}},"Submit"),e.createElement(m,{variant:"contained",color:"secondary",onClick:()=>{r()}},"Cancel")))}export{M as default}; -//# sourceMappingURL=ExportSVGDialog-BFFuOImy.js.map +import{j as l,k as v,R as e,e as c,D as y,T as C,l as h,n as x,p as S,i,q as s,h as b,B as m}from"./index-PBHga9OU.js";import{C as f}from"./Checkbox2-Bjl1T2Gs.js";function M({model:u,onClose:r}){const[n,p]=l.useState(!0),[t,E]=l.useState("viewport"),[o,d]=l.useState(),g=v();return e.createElement(c.Dialog,{onClose:()=>{r()},open:!0,title:"Export SVG"},e.createElement(y,null,o?e.createElement(c.ErrorMessage,{error:o}):null,e.createElement(C,null,"Settings:"),e.createElement(f,{label:"Include minimap?",disabled:t==="entire",checked:n,onChange:()=>{p(!n)}}),e.createElement("div",null,e.createElement(h,null,e.createElement(x,null,"Export type"),e.createElement(S,{value:t,onChange:a=>{E(a.target.value)}},e.createElement(i,{value:"entire",control:e.createElement(s,null),label:"Entire MSA"}),e.createElement(i,{value:"viewport",control:e.createElement(s,null),label:"Current viewport only"}))))),e.createElement(b,null,e.createElement(m,{variant:"contained",color:"primary",onClick:()=>{(async()=>{try{await u.exportSVG({theme:g,includeMinimap:t==="entire"?!1:n,exportType:t})}catch(a){console.error(a),d(a)}r()})()}},"Submit"),e.createElement(m,{variant:"contained",color:"secondary",onClick:()=>{r()}},"Cancel")))}export{M as default}; +//# sourceMappingURL=ExportSVGDialog-5qJ1MiKx.js.map diff --git a/assets/ExportSVGDialog-BFFuOImy.js.map b/assets/ExportSVGDialog-5qJ1MiKx.js.map similarity index 98% rename from assets/ExportSVGDialog-BFFuOImy.js.map rename to assets/ExportSVGDialog-5qJ1MiKx.js.map index e0b8073..1e2634e 100644 --- a/assets/ExportSVGDialog-BFFuOImy.js.map +++ b/assets/ExportSVGDialog-5qJ1MiKx.js.map @@ -1 +1 @@ -{"version":3,"file":"ExportSVGDialog-BFFuOImy.js","sources":["../../../lib/dist/components/dialogs/ExportSVGDialog.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { Dialog, ErrorMessage } from '@jbrowse/core/ui';\nimport { Button, DialogContent, DialogActions, FormControlLabel, FormControl, FormLabel, RadioGroup, Radio, Typography, useTheme, } from '@mui/material';\nimport Checkbox2 from '../Checkbox2';\nexport default function ExportSVGDialog({ model, onClose, }) {\n const [includeMinimap, setIncludeMinimap] = useState(true);\n const [exportType, setExportType] = useState('viewport');\n const [error, setError] = useState();\n const theme = useTheme();\n return (React.createElement(Dialog, { onClose: () => {\n onClose();\n }, open: true, title: \"Export SVG\" },\n React.createElement(DialogContent, null,\n error ? React.createElement(ErrorMessage, { error: error }) : null,\n React.createElement(Typography, null, \"Settings:\"),\n React.createElement(Checkbox2, { label: \"Include minimap?\", disabled: exportType === 'entire', checked: includeMinimap, onChange: () => {\n setIncludeMinimap(!includeMinimap);\n } }),\n React.createElement(\"div\", null,\n React.createElement(FormControl, null,\n React.createElement(FormLabel, null, \"Export type\"),\n React.createElement(RadioGroup, { value: exportType, onChange: event => {\n setExportType(event.target.value);\n } },\n React.createElement(FormControlLabel, { value: \"entire\", control: React.createElement(Radio, null), label: \"Entire MSA\" }),\n React.createElement(FormControlLabel, { value: \"viewport\", control: React.createElement(Radio, null), label: \"Current viewport only\" }))))),\n React.createElement(DialogActions, null,\n React.createElement(Button, { variant: \"contained\", color: \"primary\", onClick: () => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n ;\n (async () => {\n try {\n await model.exportSVG({\n theme,\n includeMinimap: exportType === 'entire' ? false : includeMinimap,\n exportType,\n });\n }\n catch (e) {\n console.error(e);\n setError(e);\n }\n onClose();\n })();\n } }, \"Submit\"),\n React.createElement(Button, { variant: \"contained\", color: \"secondary\", onClick: () => {\n onClose();\n } }, \"Cancel\"))));\n}\n//# sourceMappingURL=ExportSVGDialog.js.map"],"names":["ExportSVGDialog","model","onClose","includeMinimap","setIncludeMinimap","useState","exportType","setExportType","error","setError","theme","useTheme","React","Dialog","DialogContent","ErrorMessage","Typography","Checkbox2","FormControl","FormLabel","RadioGroup","event","FormControlLabel","Radio","DialogActions","Button","e"],"mappings":"mKAIe,SAASA,EAAgB,CAAE,MAAAC,EAAO,QAAAC,GAAY,CACzD,KAAM,CAACC,EAAgBC,CAAiB,EAAIC,EAAQ,SAAC,EAAI,EACnD,CAACC,EAAYC,CAAa,EAAIF,EAAQ,SAAC,UAAU,EACjD,CAACG,EAAOC,CAAQ,EAAIJ,EAAQ,SAAA,EAC5BK,EAAQC,IACd,OAAQC,EAAM,cAAcC,SAAQ,CAAE,QAAS,IAAM,CAC7CX,GACH,EAAE,KAAM,GAAM,MAAO,YAAc,EACpCU,EAAM,cAAcE,EAAe,KAC/BN,EAAQI,EAAM,cAAcG,EAAAA,aAAc,CAAE,MAAOP,CAAO,CAAA,EAAI,KAC9DI,EAAM,cAAcI,EAAY,KAAM,WAAW,EACjDJ,EAAM,cAAcK,EAAW,CAAE,MAAO,mBAAoB,SAAUX,IAAe,SAAU,QAASH,EAAgB,SAAU,IAAM,CAChIC,EAAkB,CAACD,CAAc,CACrD,EAAmB,EACPS,EAAM,cAAc,MAAO,KACvBA,EAAM,cAAcM,EAAa,KAC7BN,EAAM,cAAcO,EAAW,KAAM,aAAa,EAClDP,EAAM,cAAcQ,EAAY,CAAE,MAAOd,EAAY,SAAUe,GAAS,CAChEd,EAAcc,EAAM,OAAO,KAAK,CAC5D,CAA2B,EACHT,EAAM,cAAcU,EAAkB,CAAE,MAAO,SAAU,QAASV,EAAM,cAAcW,EAAO,IAAI,EAAG,MAAO,YAAY,CAAE,EACzHX,EAAM,cAAcU,EAAkB,CAAE,MAAO,WAAY,QAASV,EAAM,cAAcW,EAAO,IAAI,EAAG,MAAO,uBAAyB,CAAA,CAAC,CAAC,CAAC,CAAC,EAC1JX,EAAM,cAAcY,EAAe,KAC/BZ,EAAM,cAAca,EAAQ,CAAE,QAAS,YAAa,MAAO,UAAW,QAAS,IAAM,EAG5E,SAAY,CACT,GAAI,CACA,MAAMxB,EAAM,UAAU,CAClB,MAAAS,EACA,eAAgBJ,IAAe,SAAW,GAAQH,EAClD,WAAAG,CAChC,CAA6B,CACJ,OACMoB,EAAG,CACN,QAAQ,MAAMA,CAAC,EACfjB,EAASiB,CAAC,CACb,CACDxB,GACxB,IACiB,CAAA,EAAI,QAAQ,EACjBU,EAAM,cAAca,EAAQ,CAAE,QAAS,YAAa,MAAO,YAAa,QAAS,IAAM,CAC/EvB,GACpB,GAAqB,QAAQ,CAAC,CAAC,CAC/B"} \ No newline at end of file +{"version":3,"file":"ExportSVGDialog-5qJ1MiKx.js","sources":["../../../lib/dist/components/dialogs/ExportSVGDialog.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { Dialog, ErrorMessage } from '@jbrowse/core/ui';\nimport { Button, DialogContent, DialogActions, FormControlLabel, FormControl, FormLabel, RadioGroup, Radio, Typography, useTheme, } from '@mui/material';\nimport Checkbox2 from '../Checkbox2';\nexport default function ExportSVGDialog({ model, onClose, }) {\n const [includeMinimap, setIncludeMinimap] = useState(true);\n const [exportType, setExportType] = useState('viewport');\n const [error, setError] = useState();\n const theme = useTheme();\n return (React.createElement(Dialog, { onClose: () => {\n onClose();\n }, open: true, title: \"Export SVG\" },\n React.createElement(DialogContent, null,\n error ? React.createElement(ErrorMessage, { error: error }) : null,\n React.createElement(Typography, null, \"Settings:\"),\n React.createElement(Checkbox2, { label: \"Include minimap?\", disabled: exportType === 'entire', checked: includeMinimap, onChange: () => {\n setIncludeMinimap(!includeMinimap);\n } }),\n React.createElement(\"div\", null,\n React.createElement(FormControl, null,\n React.createElement(FormLabel, null, \"Export type\"),\n React.createElement(RadioGroup, { value: exportType, onChange: event => {\n setExportType(event.target.value);\n } },\n React.createElement(FormControlLabel, { value: \"entire\", control: React.createElement(Radio, null), label: \"Entire MSA\" }),\n React.createElement(FormControlLabel, { value: \"viewport\", control: React.createElement(Radio, null), label: \"Current viewport only\" }))))),\n React.createElement(DialogActions, null,\n React.createElement(Button, { variant: \"contained\", color: \"primary\", onClick: () => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n ;\n (async () => {\n try {\n await model.exportSVG({\n theme,\n includeMinimap: exportType === 'entire' ? false : includeMinimap,\n exportType,\n });\n }\n catch (e) {\n console.error(e);\n setError(e);\n }\n onClose();\n })();\n } }, \"Submit\"),\n React.createElement(Button, { variant: \"contained\", color: \"secondary\", onClick: () => {\n onClose();\n } }, \"Cancel\"))));\n}\n//# sourceMappingURL=ExportSVGDialog.js.map"],"names":["ExportSVGDialog","model","onClose","includeMinimap","setIncludeMinimap","useState","exportType","setExportType","error","setError","theme","useTheme","React","Dialog","DialogContent","ErrorMessage","Typography","Checkbox2","FormControl","FormLabel","RadioGroup","event","FormControlLabel","Radio","DialogActions","Button","e"],"mappings":"mKAIe,SAASA,EAAgB,CAAE,MAAAC,EAAO,QAAAC,GAAY,CACzD,KAAM,CAACC,EAAgBC,CAAiB,EAAIC,EAAQ,SAAC,EAAI,EACnD,CAACC,EAAYC,CAAa,EAAIF,EAAQ,SAAC,UAAU,EACjD,CAACG,EAAOC,CAAQ,EAAIJ,EAAQ,SAAA,EAC5BK,EAAQC,IACd,OAAQC,EAAM,cAAcC,SAAQ,CAAE,QAAS,IAAM,CAC7CX,GACH,EAAE,KAAM,GAAM,MAAO,YAAc,EACpCU,EAAM,cAAcE,EAAe,KAC/BN,EAAQI,EAAM,cAAcG,EAAAA,aAAc,CAAE,MAAOP,CAAO,CAAA,EAAI,KAC9DI,EAAM,cAAcI,EAAY,KAAM,WAAW,EACjDJ,EAAM,cAAcK,EAAW,CAAE,MAAO,mBAAoB,SAAUX,IAAe,SAAU,QAASH,EAAgB,SAAU,IAAM,CAChIC,EAAkB,CAACD,CAAc,CACrD,EAAmB,EACPS,EAAM,cAAc,MAAO,KACvBA,EAAM,cAAcM,EAAa,KAC7BN,EAAM,cAAcO,EAAW,KAAM,aAAa,EAClDP,EAAM,cAAcQ,EAAY,CAAE,MAAOd,EAAY,SAAUe,GAAS,CAChEd,EAAcc,EAAM,OAAO,KAAK,CAC5D,CAA2B,EACHT,EAAM,cAAcU,EAAkB,CAAE,MAAO,SAAU,QAASV,EAAM,cAAcW,EAAO,IAAI,EAAG,MAAO,YAAY,CAAE,EACzHX,EAAM,cAAcU,EAAkB,CAAE,MAAO,WAAY,QAASV,EAAM,cAAcW,EAAO,IAAI,EAAG,MAAO,uBAAyB,CAAA,CAAC,CAAC,CAAC,CAAC,EAC1JX,EAAM,cAAcY,EAAe,KAC/BZ,EAAM,cAAca,EAAQ,CAAE,QAAS,YAAa,MAAO,UAAW,QAAS,IAAM,EAG5E,SAAY,CACT,GAAI,CACA,MAAMxB,EAAM,UAAU,CAClB,MAAAS,EACA,eAAgBJ,IAAe,SAAW,GAAQH,EAClD,WAAAG,CAChC,CAA6B,CACJ,OACMoB,EAAG,CACN,QAAQ,MAAMA,CAAC,EACfjB,EAASiB,CAAC,CACb,CACDxB,GACxB,IACiB,CAAA,EAAI,QAAQ,EACjBU,EAAM,cAAca,EAAQ,CAAE,QAAS,YAAa,MAAO,YAAa,QAAS,IAAM,CAC/EvB,GACpB,GAAqB,QAAQ,CAAC,CAAC,CAC/B"} \ No newline at end of file diff --git a/assets/FeatureDialog-DxSjQbwM.js b/assets/FeatureDialog-BKBNx8_d.js similarity index 87% rename from assets/FeatureDialog-DxSjQbwM.js rename to assets/FeatureDialog-BKBNx8_d.js index f06bed1..d6d54d4 100644 --- a/assets/FeatureDialog-DxSjQbwM.js +++ b/assets/FeatureDialog-BKBNx8_d.js @@ -1,2 +1,2 @@ -import{o as a,R as e,B as o,e as E,D as d,s as f}from"./index-BW_Tl6Ao.js";const g=a(function({model:t}){const{featureFilters:l}=t;return e.createElement("div",null,e.createElement(o,{onClick:()=>{for(const n of l.keys())t.setFilter(n,!0)}},"Toggle all on"),e.createElement(o,{onClick:()=>{for(const n of l.keys())t.setFilter(n,!1)}},"Toggle all off"))}),k=a(function({model:t}){const{tidyInterProAnnotationTypes:l,featureFilters:n}=t,c=[...l.values()],u=f(c.length-1);return e.createElement(e.Fragment,null,e.createElement(g,{model:t}),e.createElement("table",null,e.createElement("thead",null,e.createElement("tr",null,e.createElement("td",null),e.createElement("td",null,"accession"),e.createElement("td",null,"name"),e.createElement("td",null,"description"))),e.createElement("tbody",null,c.map(({accession:r,name:s,description:m},i)=>e.createElement("tr",{key:r},e.createElement("td",null,e.createElement("input",{type:"checkbox",checked:n.get(r)??!1,onChange:()=>{t.setFilter(r,!t.featureFilters.get(r))}})),e.createElement("td",null,r),e.createElement("td",null,s),e.createElement("td",null,m),e.createElement("td",null,e.createElement("div",{style:{width:20,height:20,background:u[i]||"black"}})))))))}),p=a(function({onClose:t,model:l}){return e.createElement(E.Dialog,{onClose:()=>{t()},open:!0,title:"Feature filters",maxWidth:"xl"},e.createElement(d,null,e.createElement(k,{model:l})))});export{p as default}; -//# sourceMappingURL=FeatureDialog-DxSjQbwM.js.map +import{o as a,R as e,B as o,e as E,D as d,s as f}from"./index-PBHga9OU.js";const g=a(function({model:t}){const{featureFilters:l}=t;return e.createElement("div",null,e.createElement(o,{onClick:()=>{for(const n of l.keys())t.setFilter(n,!0)}},"Toggle all on"),e.createElement(o,{onClick:()=>{for(const n of l.keys())t.setFilter(n,!1)}},"Toggle all off"))}),k=a(function({model:t}){const{tidyInterProAnnotationTypes:l,featureFilters:n}=t,c=[...l.values()],u=f(c.length-1);return e.createElement(e.Fragment,null,e.createElement(g,{model:t}),e.createElement("table",null,e.createElement("thead",null,e.createElement("tr",null,e.createElement("td",null),e.createElement("td",null,"accession"),e.createElement("td",null,"name"),e.createElement("td",null,"description"))),e.createElement("tbody",null,c.map(({accession:r,name:s,description:m},i)=>e.createElement("tr",{key:r},e.createElement("td",null,e.createElement("input",{type:"checkbox",checked:n.get(r)??!1,onChange:()=>{t.setFilter(r,!t.featureFilters.get(r))}})),e.createElement("td",null,r),e.createElement("td",null,s),e.createElement("td",null,m),e.createElement("td",null,e.createElement("div",{style:{width:20,height:20,background:u[i]||"black"}})))))))}),p=a(function({onClose:t,model:l}){return e.createElement(E.Dialog,{onClose:()=>{t()},open:!0,title:"Feature filters",maxWidth:"xl"},e.createElement(d,null,e.createElement(k,{model:l})))});export{p as default}; +//# sourceMappingURL=FeatureDialog-BKBNx8_d.js.map diff --git a/assets/FeatureDialog-DxSjQbwM.js.map b/assets/FeatureDialog-BKBNx8_d.js.map similarity index 98% rename from assets/FeatureDialog-DxSjQbwM.js.map rename to assets/FeatureDialog-BKBNx8_d.js.map index f39f75f..209e492 100644 --- a/assets/FeatureDialog-DxSjQbwM.js.map +++ b/assets/FeatureDialog-BKBNx8_d.js.map @@ -1 +1 @@ -{"version":3,"file":"FeatureDialog-DxSjQbwM.js","sources":["../../../lib/dist/components/dialogs/FeatureDialog.js"],"sourcesContent":["import React from 'react';\nimport { observer } from 'mobx-react';\nimport { Dialog } from '@jbrowse/core/ui';\nimport { Button, DialogContent } from '@mui/material';\nimport { getPalette } from '../../ggplotPalettes';\nconst Toggles = observer(function ({ model }) {\n const { featureFilters } = model;\n return (React.createElement(\"div\", null,\n React.createElement(Button, { onClick: () => {\n for (const key of featureFilters.keys()) {\n model.setFilter(key, true);\n }\n } }, \"Toggle all on\"),\n React.createElement(Button, { onClick: () => {\n for (const key of featureFilters.keys()) {\n model.setFilter(key, false);\n }\n } }, \"Toggle all off\")));\n});\nconst Table = observer(function ({ model }) {\n const { tidyInterProAnnotationTypes, featureFilters } = model;\n const values = [...tidyInterProAnnotationTypes.values()];\n const palette = getPalette(values.length - 1);\n return (React.createElement(React.Fragment, null,\n React.createElement(Toggles, { model: model }),\n React.createElement(\"table\", null,\n React.createElement(\"thead\", null,\n React.createElement(\"tr\", null,\n React.createElement(\"td\", null),\n React.createElement(\"td\", null, \"accession\"),\n React.createElement(\"td\", null, \"name\"),\n React.createElement(\"td\", null, \"description\"))),\n React.createElement(\"tbody\", null, values.map(({ accession, name, description }, idx) => (React.createElement(\"tr\", { key: accession },\n React.createElement(\"td\", null,\n React.createElement(\"input\", { type: \"checkbox\", checked: featureFilters.get(accession) ?? false, onChange: () => {\n model.setFilter(accession, !model.featureFilters.get(accession));\n } })),\n React.createElement(\"td\", null, accession),\n React.createElement(\"td\", null, name),\n React.createElement(\"td\", null, description),\n React.createElement(\"td\", null,\n React.createElement(\"div\", { style: {\n width: 20,\n height: 20,\n background: palette[idx] || 'black',\n } })))))))));\n});\nconst FeatureTypeDialog = observer(function ({ onClose, model, }) {\n return (React.createElement(Dialog, { onClose: () => {\n onClose();\n }, open: true, title: \"Feature filters\", maxWidth: \"xl\" },\n React.createElement(DialogContent, null,\n React.createElement(Table, { model: model }))));\n});\nexport default FeatureTypeDialog;\n//# sourceMappingURL=FeatureDialog.js.map"],"names":["Toggles","observer","model","featureFilters","React","Button","key","Table","tidyInterProAnnotationTypes","values","palette","getPalette","accession","name","description","idx","FeatureTypeDialog","onClose","Dialog","DialogContent"],"mappings":"2EAKA,MAAMA,EAAUC,EAAS,SAAU,CAAE,MAAAC,GAAS,CAC1C,KAAM,CAAE,eAAAC,CAAgB,EAAGD,EAC3B,OAAQE,EAAM,cAAc,MAAO,KAC/BA,EAAM,cAAcC,EAAQ,CAAE,QAAS,IAAM,CACrC,UAAWC,KAAOH,EAAe,OAC7BD,EAAM,UAAUI,EAAK,EAAI,CAEhC,CAAA,EAAI,eAAe,EACxBF,EAAM,cAAcC,EAAQ,CAAE,QAAS,IAAM,CACrC,UAAWC,KAAOH,EAAe,OAC7BD,EAAM,UAAUI,EAAK,EAAK,CAE9C,CAAe,EAAE,gBAAgB,CAAC,CAClC,CAAC,EACKC,EAAQN,EAAS,SAAU,CAAE,MAAAC,GAAS,CACxC,KAAM,CAAE,4BAAAM,EAA6B,eAAAL,CAAgB,EAAGD,EAClDO,EAAS,CAAC,GAAGD,EAA4B,OAAQ,CAAA,EACjDE,EAAUC,EAAWF,EAAO,OAAS,CAAC,EAC5C,OAAQL,EAAM,cAAcA,EAAM,SAAU,KACxCA,EAAM,cAAcJ,EAAS,CAAE,MAAOE,CAAK,CAAE,EAC7CE,EAAM,cAAc,QAAS,KACzBA,EAAM,cAAc,QAAS,KACzBA,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAc,KAAM,IAAI,EAC9BA,EAAM,cAAc,KAAM,KAAM,WAAW,EAC3CA,EAAM,cAAc,KAAM,KAAM,MAAM,EACtCA,EAAM,cAAc,KAAM,KAAM,aAAa,CAAC,CAAC,EACvDA,EAAM,cAAc,QAAS,KAAMK,EAAO,IAAI,CAAC,CAAE,UAAAG,EAAW,KAAAC,EAAM,YAAAC,CAAW,EAAIC,IAASX,EAAM,cAAc,KAAM,CAAE,IAAKQ,CAAW,EAClIR,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAc,QAAS,CAAE,KAAM,WAAY,QAASD,EAAe,IAAIS,CAAS,GAAK,GAAO,SAAU,IAAM,CAC1GV,EAAM,UAAUU,EAAW,CAACV,EAAM,eAAe,IAAIU,CAAS,CAAC,CAClE,CAAA,CAAE,CAAC,EACZR,EAAM,cAAc,KAAM,KAAMQ,CAAS,EACzCR,EAAM,cAAc,KAAM,KAAMS,CAAI,EACpCT,EAAM,cAAc,KAAM,KAAMU,CAAW,EAC3CV,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAc,MAAO,CAAE,MAAO,CAC5B,MAAO,GACP,OAAQ,GACR,WAAYM,EAAQK,CAAG,GAAK,OAC/B,CAAA,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAClC,CAAC,EACKC,EAAoBf,EAAS,SAAU,CAAE,QAAAgB,EAAS,MAAAf,CAAK,EAAK,CAC9D,OAAQE,EAAM,cAAcc,SAAQ,CAAE,QAAS,IAAM,CAC7CD,GACZ,EAAW,KAAM,GAAM,MAAO,kBAAmB,SAAU,IAAM,EACzDb,EAAM,cAAce,EAAe,KAC/Bf,EAAM,cAAcG,EAAO,CAAE,MAAOL,CAAK,CAAE,CAAC,CAAC,CACzD,CAAC"} \ No newline at end of file +{"version":3,"file":"FeatureDialog-BKBNx8_d.js","sources":["../../../lib/dist/components/dialogs/FeatureDialog.js"],"sourcesContent":["import React from 'react';\nimport { observer } from 'mobx-react';\nimport { Dialog } from '@jbrowse/core/ui';\nimport { Button, DialogContent } from '@mui/material';\nimport { getPalette } from '../../ggplotPalettes';\nconst Toggles = observer(function ({ model }) {\n const { featureFilters } = model;\n return (React.createElement(\"div\", null,\n React.createElement(Button, { onClick: () => {\n for (const key of featureFilters.keys()) {\n model.setFilter(key, true);\n }\n } }, \"Toggle all on\"),\n React.createElement(Button, { onClick: () => {\n for (const key of featureFilters.keys()) {\n model.setFilter(key, false);\n }\n } }, \"Toggle all off\")));\n});\nconst Table = observer(function ({ model }) {\n const { tidyInterProAnnotationTypes, featureFilters } = model;\n const values = [...tidyInterProAnnotationTypes.values()];\n const palette = getPalette(values.length - 1);\n return (React.createElement(React.Fragment, null,\n React.createElement(Toggles, { model: model }),\n React.createElement(\"table\", null,\n React.createElement(\"thead\", null,\n React.createElement(\"tr\", null,\n React.createElement(\"td\", null),\n React.createElement(\"td\", null, \"accession\"),\n React.createElement(\"td\", null, \"name\"),\n React.createElement(\"td\", null, \"description\"))),\n React.createElement(\"tbody\", null, values.map(({ accession, name, description }, idx) => (React.createElement(\"tr\", { key: accession },\n React.createElement(\"td\", null,\n React.createElement(\"input\", { type: \"checkbox\", checked: featureFilters.get(accession) ?? false, onChange: () => {\n model.setFilter(accession, !model.featureFilters.get(accession));\n } })),\n React.createElement(\"td\", null, accession),\n React.createElement(\"td\", null, name),\n React.createElement(\"td\", null, description),\n React.createElement(\"td\", null,\n React.createElement(\"div\", { style: {\n width: 20,\n height: 20,\n background: palette[idx] || 'black',\n } })))))))));\n});\nconst FeatureTypeDialog = observer(function ({ onClose, model, }) {\n return (React.createElement(Dialog, { onClose: () => {\n onClose();\n }, open: true, title: \"Feature filters\", maxWidth: \"xl\" },\n React.createElement(DialogContent, null,\n React.createElement(Table, { model: model }))));\n});\nexport default FeatureTypeDialog;\n//# sourceMappingURL=FeatureDialog.js.map"],"names":["Toggles","observer","model","featureFilters","React","Button","key","Table","tidyInterProAnnotationTypes","values","palette","getPalette","accession","name","description","idx","FeatureTypeDialog","onClose","Dialog","DialogContent"],"mappings":"2EAKA,MAAMA,EAAUC,EAAS,SAAU,CAAE,MAAAC,GAAS,CAC1C,KAAM,CAAE,eAAAC,CAAgB,EAAGD,EAC3B,OAAQE,EAAM,cAAc,MAAO,KAC/BA,EAAM,cAAcC,EAAQ,CAAE,QAAS,IAAM,CACrC,UAAWC,KAAOH,EAAe,OAC7BD,EAAM,UAAUI,EAAK,EAAI,CAEhC,CAAA,EAAI,eAAe,EACxBF,EAAM,cAAcC,EAAQ,CAAE,QAAS,IAAM,CACrC,UAAWC,KAAOH,EAAe,OAC7BD,EAAM,UAAUI,EAAK,EAAK,CAE9C,CAAe,EAAE,gBAAgB,CAAC,CAClC,CAAC,EACKC,EAAQN,EAAS,SAAU,CAAE,MAAAC,GAAS,CACxC,KAAM,CAAE,4BAAAM,EAA6B,eAAAL,CAAgB,EAAGD,EAClDO,EAAS,CAAC,GAAGD,EAA4B,OAAQ,CAAA,EACjDE,EAAUC,EAAWF,EAAO,OAAS,CAAC,EAC5C,OAAQL,EAAM,cAAcA,EAAM,SAAU,KACxCA,EAAM,cAAcJ,EAAS,CAAE,MAAOE,CAAK,CAAE,EAC7CE,EAAM,cAAc,QAAS,KACzBA,EAAM,cAAc,QAAS,KACzBA,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAc,KAAM,IAAI,EAC9BA,EAAM,cAAc,KAAM,KAAM,WAAW,EAC3CA,EAAM,cAAc,KAAM,KAAM,MAAM,EACtCA,EAAM,cAAc,KAAM,KAAM,aAAa,CAAC,CAAC,EACvDA,EAAM,cAAc,QAAS,KAAMK,EAAO,IAAI,CAAC,CAAE,UAAAG,EAAW,KAAAC,EAAM,YAAAC,CAAW,EAAIC,IAASX,EAAM,cAAc,KAAM,CAAE,IAAKQ,CAAW,EAClIR,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAc,QAAS,CAAE,KAAM,WAAY,QAASD,EAAe,IAAIS,CAAS,GAAK,GAAO,SAAU,IAAM,CAC1GV,EAAM,UAAUU,EAAW,CAACV,EAAM,eAAe,IAAIU,CAAS,CAAC,CAClE,CAAA,CAAE,CAAC,EACZR,EAAM,cAAc,KAAM,KAAMQ,CAAS,EACzCR,EAAM,cAAc,KAAM,KAAMS,CAAI,EACpCT,EAAM,cAAc,KAAM,KAAMU,CAAW,EAC3CV,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAc,MAAO,CAAE,MAAO,CAC5B,MAAO,GACP,OAAQ,GACR,WAAYM,EAAQK,CAAG,GAAK,OAC/B,CAAA,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAClC,CAAC,EACKC,EAAoBf,EAAS,SAAU,CAAE,QAAAgB,EAAS,MAAAf,CAAK,EAAK,CAC9D,OAAQE,EAAM,cAAcc,SAAQ,CAAE,QAAS,IAAM,CAC7CD,GACZ,EAAW,KAAM,GAAM,MAAO,kBAAmB,SAAU,IAAM,EACzDb,EAAM,cAAce,EAAe,KAC/Bf,EAAM,cAAcG,EAAO,CAAE,MAAOL,CAAK,CAAE,CAAC,CAAC,CACzD,CAAC"} \ No newline at end of file diff --git a/assets/InterProScanDialog-BxagvNTT.js b/assets/InterProScanDialog-C82LUzrO.js similarity index 97% rename from assets/InterProScanDialog-BxagvNTT.js rename to assets/InterProScanDialog-C82LUzrO.js index b022abe..b0228bd 100644 --- a/assets/InterProScanDialog-BxagvNTT.js +++ b/assets/InterProScanDialog-C82LUzrO.js @@ -1,4 +1,4 @@ -import{u as m,o as f,j as d,R as r,e as k,D as E,T as y,B as l,h as w}from"./index-BW_Tl6Ao.js";import{t as g,a as P,j as F}from"./fetchUtils-iNLkv-IC.js";const h="https://www.ebi.ac.uk/Tools/services/rest";async function I({seq:n,onProgress:a,onJobId:t,programs:c,model:o}){const i=await g(`${h}/iprscan5/run`,{method:"POST",body:new URLSearchParams({email:"colin.diesh@gmail.com",sequence:n,programs:c.join(",")})});t==null||t(i),await R({jobId:i,onProgress:a}),await $({jobId:i,model:o})}function A(n){return F(`${h}/iprscan5/result/${n}/json`)}async function R({onProgress:n,jobId:a}){const t=`${h}/iprscan5/status/${a}`;try{for(;;){for(let o=0;o<10;o++)await P(1e3),n({msg:`Checking status ${10-o}`,url:t});const c=await g(t);if(c.includes("FINISHED"))break;if(c.includes("FAILURE"))throw new Error(`Failed to run: jobId ${a}`)}}finally{n()}}async function D({algorithm:n,seq:a,programs:t,onJobId:c,onProgress:o,model:i}){try{throw o({msg:`Launching ${n} MSA`}),n==="interproscan"&&await I({seq:a,onJobId:c,onProgress:o,programs:t,model:i}),new Error("unknown algorithm")}finally{o()}}async function $({jobId:n,model:a}){try{a.setStatus({msg:`Downloading results of ${n} (for larger sequences this can be slow, click status to download and upload in the manual tab)`,url:`https://www.ebi.ac.uk/Tools/services/rest/iprscan5/result/${n}/json`});const t=await A(n);a.setInterProAnnotations(Object.fromEntries(t.results.map(c=>[c.xref[0].id,c]))),a.setShowDomains(!0),m.getSession(a).notify(`Loaded interproscan ${n} results`,"success")}catch(t){console.error(t),m.getSession(a).notifyError(`${t}`,t)}finally{a.setStatus()}}const T=f(function({handleClose:n,model:a}){const[t,c]=d.useState([{name:"NCBIfam",description:"NCBI RefSeq FAMs including TIGRFAMs",category:"Families, domains, sites & repeats",checked:!0},{name:"SFLD",description:"Structure function linkage database",category:"Families, domains, sites & repeats",checked:!0},{name:"Phobius",checked:!0,description:"A combined transmembrane topology and signal peptide predictor",category:"Other sequence features"},{name:"SignalP",checked:!0,category:"Other sequence features"},{name:"SignalP_EUK",category:"Other category",checked:!0},{name:"SignalP_GRAM_POSITIVE",category:"Other category",checked:!0},{name:"SignalP_GRAM_NEGATIVE",checked:!0,category:"Other category"},{name:"SUPERFAMILY",category:"Structural domains",checked:!0},{name:"PANTHER",category:"Families, domains, sites & repeats",checked:!0},{name:"Gene3D",category:"Structural domains",checked:!0},{name:"Hamap",category:"Families, domains, sites & repeats",checked:!0},{name:"ProSiteProfiles",category:"Families, domains, sites & repeats",checked:!0},{name:"ProSitePatterns",category:"Families, domains, sites & repeats",checked:!0},{name:"Coils",category:"Other sequence features",checked:!0},{name:"SMART",category:"Families, domains, sites & repeats",checked:!0},{name:"CDD",description:"Conserved Domains Database",category:"Families, domains, sites & repeats",checked:!0},{name:"PRINTS",category:"Families, domains, sites & repeats",checked:!0},{name:"Pfam",category:"Families, domains, sites & repeats",checked:!0},{name:"MobiDBLite",checked:!0,category:"Other sequence features"},{name:"PIRSF",checked:!0,category:"Other category"},{name:"TMHMM",checked:!0,category:"Other sequence features"},{name:"AntiFam",checked:!0,category:"Other category"},{name:"FunFam",checked:!0,category:"Other category"},{name:"PIRSR",checked:!0,category:"Families, domains, sites & repeats"}]),o=t.filter(e=>e.checked).map(e=>e.name),[i,p]=d.useState(!1);return r.createElement(k.Dialog,{maxWidth:"xl",title:"Query InterProScan API for domains",onClose:()=>{n()},open:!0},r.createElement(E,null,r.createElement(y,null,"This will run InterProScan via the InterProScan API on all rows of the current MSA"),r.createElement(l,{onClick:()=>{p(!i)}},i?"Hide":"Show"," advanced options"),i?r.createElement("div",null,r.createElement(y,null,"Select algorithms for InterProScan to run"),r.createElement("div",null,r.createElement(l,{variant:"contained",color:"secondary",onClick:()=>{c(t.map(e=>({...e,checked:!1})))}},"Select none"),r.createElement(l,{variant:"contained",color:"primary",onClick:()=>{c(t.map(e=>({...e,checked:!0})))}},"Select all")),r.createElement("table",null,r.createElement("tbody",null,t.sort((e,s)=>e.category.localeCompare(s.category)).map(({name:e,checked:s,category:S})=>r.createElement("tr",{key:e},r.createElement("td",null,r.createElement("input",{type:"checkbox",key:e,checked:s,onChange:()=>{c(t.map(u=>u.name===e?{...u,checked:!u.checked}:u))}})),r.createElement("td",null,e),r.createElement("td",null,S)))))):null),r.createElement(w,null,r.createElement(l,{variant:"contained",color:"secondary",onClick:()=>{n()}},"Cancel"),r.createElement(l,{variant:"contained",color:"primary",onClick:()=>{(async()=>{try{const{rows:e}=a;if(e.length>140)throw new Error("Too many sequences, please run InterProScan offline");await D({algorithm:"interproscan",programs:o,seq:e.map(s=>[s[0],s[1].replaceAll("-","")]).filter(s=>!!s[1]).map(s=>`>${s[0]} +import{u as m,o as f,j as d,R as r,e as k,D as E,T as y,B as l,h as w}from"./index-PBHga9OU.js";import{t as g,a as P,j as F}from"./fetchUtils-iNLkv-IC.js";const h="https://www.ebi.ac.uk/Tools/services/rest";async function I({seq:n,onProgress:a,onJobId:t,programs:c,model:o}){const i=await g(`${h}/iprscan5/run`,{method:"POST",body:new URLSearchParams({email:"colin.diesh@gmail.com",sequence:n,programs:c.join(",")})});t==null||t(i),await R({jobId:i,onProgress:a}),await $({jobId:i,model:o})}function A(n){return F(`${h}/iprscan5/result/${n}/json`)}async function R({onProgress:n,jobId:a}){const t=`${h}/iprscan5/status/${a}`;try{for(;;){for(let o=0;o<10;o++)await P(1e3),n({msg:`Checking status ${10-o}`,url:t});const c=await g(t);if(c.includes("FINISHED"))break;if(c.includes("FAILURE"))throw new Error(`Failed to run: jobId ${a}`)}}finally{n()}}async function D({algorithm:n,seq:a,programs:t,onJobId:c,onProgress:o,model:i}){try{throw o({msg:`Launching ${n} MSA`}),n==="interproscan"&&await I({seq:a,onJobId:c,onProgress:o,programs:t,model:i}),new Error("unknown algorithm")}finally{o()}}async function $({jobId:n,model:a}){try{a.setStatus({msg:`Downloading results of ${n} (for larger sequences this can be slow, click status to download and upload in the manual tab)`,url:`https://www.ebi.ac.uk/Tools/services/rest/iprscan5/result/${n}/json`});const t=await A(n);a.setInterProAnnotations(Object.fromEntries(t.results.map(c=>[c.xref[0].id,c]))),a.setShowDomains(!0),m.getSession(a).notify(`Loaded interproscan ${n} results`,"success")}catch(t){console.error(t),m.getSession(a).notifyError(`${t}`,t)}finally{a.setStatus()}}const T=f(function({handleClose:n,model:a}){const[t,c]=d.useState([{name:"NCBIfam",description:"NCBI RefSeq FAMs including TIGRFAMs",category:"Families, domains, sites & repeats",checked:!0},{name:"SFLD",description:"Structure function linkage database",category:"Families, domains, sites & repeats",checked:!0},{name:"Phobius",checked:!0,description:"A combined transmembrane topology and signal peptide predictor",category:"Other sequence features"},{name:"SignalP",checked:!0,category:"Other sequence features"},{name:"SignalP_EUK",category:"Other category",checked:!0},{name:"SignalP_GRAM_POSITIVE",category:"Other category",checked:!0},{name:"SignalP_GRAM_NEGATIVE",checked:!0,category:"Other category"},{name:"SUPERFAMILY",category:"Structural domains",checked:!0},{name:"PANTHER",category:"Families, domains, sites & repeats",checked:!0},{name:"Gene3D",category:"Structural domains",checked:!0},{name:"Hamap",category:"Families, domains, sites & repeats",checked:!0},{name:"ProSiteProfiles",category:"Families, domains, sites & repeats",checked:!0},{name:"ProSitePatterns",category:"Families, domains, sites & repeats",checked:!0},{name:"Coils",category:"Other sequence features",checked:!0},{name:"SMART",category:"Families, domains, sites & repeats",checked:!0},{name:"CDD",description:"Conserved Domains Database",category:"Families, domains, sites & repeats",checked:!0},{name:"PRINTS",category:"Families, domains, sites & repeats",checked:!0},{name:"Pfam",category:"Families, domains, sites & repeats",checked:!0},{name:"MobiDBLite",checked:!0,category:"Other sequence features"},{name:"PIRSF",checked:!0,category:"Other category"},{name:"TMHMM",checked:!0,category:"Other sequence features"},{name:"AntiFam",checked:!0,category:"Other category"},{name:"FunFam",checked:!0,category:"Other category"},{name:"PIRSR",checked:!0,category:"Families, domains, sites & repeats"}]),o=t.filter(e=>e.checked).map(e=>e.name),[i,p]=d.useState(!1);return r.createElement(k.Dialog,{maxWidth:"xl",title:"Query InterProScan API for domains",onClose:()=>{n()},open:!0},r.createElement(E,null,r.createElement(y,null,"This will run InterProScan via the InterProScan API on all rows of the current MSA"),r.createElement(l,{onClick:()=>{p(!i)}},i?"Hide":"Show"," advanced options"),i?r.createElement("div",null,r.createElement(y,null,"Select algorithms for InterProScan to run"),r.createElement("div",null,r.createElement(l,{variant:"contained",color:"secondary",onClick:()=>{c(t.map(e=>({...e,checked:!1})))}},"Select none"),r.createElement(l,{variant:"contained",color:"primary",onClick:()=>{c(t.map(e=>({...e,checked:!0})))}},"Select all")),r.createElement("table",null,r.createElement("tbody",null,t.sort((e,s)=>e.category.localeCompare(s.category)).map(({name:e,checked:s,category:S})=>r.createElement("tr",{key:e},r.createElement("td",null,r.createElement("input",{type:"checkbox",key:e,checked:s,onChange:()=>{c(t.map(u=>u.name===e?{...u,checked:!u.checked}:u))}})),r.createElement("td",null,e),r.createElement("td",null,S)))))):null),r.createElement(w,null,r.createElement(l,{variant:"contained",color:"secondary",onClick:()=>{n()}},"Cancel"),r.createElement(l,{variant:"contained",color:"primary",onClick:()=>{(async()=>{try{const{rows:e}=a;if(e.length>140)throw new Error("Too many sequences, please run InterProScan offline");await D({algorithm:"interproscan",programs:o,seq:e.map(s=>[s[0],s[1].replaceAll("-","")]).filter(s=>!!s[1]).map(s=>`>${s[0]} ${s[1]}`).join(` `),onProgress:s=>{a.setStatus(s)},model:a})}catch(e){console.error(e),m.getSession(a).notifyError(`${e}`,e)}finally{a.setStatus()}})(),n()}},"Send sequences to InterProScan")))});export{T as default}; -//# sourceMappingURL=InterProScanDialog-BxagvNTT.js.map +//# sourceMappingURL=InterProScanDialog-C82LUzrO.js.map diff --git a/assets/InterProScanDialog-BxagvNTT.js.map b/assets/InterProScanDialog-C82LUzrO.js.map similarity index 99% rename from assets/InterProScanDialog-BxagvNTT.js.map rename to assets/InterProScanDialog-C82LUzrO.js.map index 83d0e7d..842fc18 100644 --- a/assets/InterProScanDialog-BxagvNTT.js.map +++ b/assets/InterProScanDialog-C82LUzrO.js.map @@ -1 +1 @@ -{"version":3,"file":"InterProScanDialog-BxagvNTT.js","sources":["../../../lib/dist/launchInterProScan.js","../../../lib/dist/components/dialogs/InterProScanDialog.js"],"sourcesContent":["import { getSession } from '@jbrowse/core/util';\nimport { jsonfetch, textfetch, timeout } from './fetchUtils';\nconst base = 'https://www.ebi.ac.uk/Tools/services/rest';\nasync function runInterProScan({ seq, onProgress, onJobId, programs, model, }) {\n const jobId = await textfetch(`${base}/iprscan5/run`, {\n method: 'POST',\n body: new URLSearchParams({\n email: 'colin.diesh@gmail.com',\n sequence: seq,\n programs: programs.join(','),\n }),\n });\n onJobId?.(jobId);\n await wait({\n jobId,\n onProgress,\n });\n await loadInterProScanResultsWithStatus({ jobId, model });\n}\nexport function loadInterProScanResults(jobId) {\n return jsonfetch(`${base}/iprscan5/result/${jobId}/json`);\n}\nasync function wait({ onProgress, jobId, }) {\n const url = `${base}/iprscan5/status/${jobId}`;\n try {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while (true) {\n for (let i = 0; i < 10; i++) {\n await timeout(1000);\n onProgress({ msg: `Checking status ${10 - i}`, url });\n }\n const result = await textfetch(url);\n if (result.includes('FINISHED')) {\n break;\n }\n if (result.includes('FAILURE')) {\n throw new Error(`Failed to run: jobId ${jobId}`);\n }\n }\n }\n finally {\n onProgress();\n }\n}\nexport async function launchInterProScan({ algorithm, seq, programs, onJobId, onProgress, model, }) {\n try {\n onProgress({ msg: `Launching ${algorithm} MSA` });\n if (algorithm === 'interproscan') {\n await runInterProScan({\n seq,\n onJobId,\n onProgress,\n programs,\n model,\n });\n }\n throw new Error('unknown algorithm');\n }\n finally {\n onProgress();\n }\n}\nexport async function loadInterProScanResultsWithStatus({ jobId, model, }) {\n try {\n model.setStatus({\n msg: `Downloading results of ${jobId} (for larger sequences this can be slow, click status to download and upload in the manual tab)`,\n url: `https://www.ebi.ac.uk/Tools/services/rest/iprscan5/result/${jobId}/json`,\n });\n const ret = await loadInterProScanResults(jobId);\n model.setInterProAnnotations(Object.fromEntries(ret.results.map(r => [r.xref[0].id, r])));\n model.setShowDomains(true);\n getSession(model).notify(`Loaded interproscan ${jobId} results`, 'success');\n }\n catch (e) {\n console.error(e);\n getSession(model).notifyError(`${e}`, e);\n }\n finally {\n model.setStatus();\n }\n}\n//# sourceMappingURL=launchInterProScan.js.map","import React, { useState } from 'react';\nimport { observer } from 'mobx-react';\nimport { Button, DialogActions, DialogContent, Typography } from '@mui/material';\nimport { getSession } from '@jbrowse/core/util';\nimport { launchInterProScan } from '../../launchInterProScan';\nimport { Dialog } from '@jbrowse/core/ui';\nconst InterProScanDialog = observer(function ({ handleClose, model, }) {\n const [vals, setVals] = useState([\n {\n name: 'NCBIfam',\n description: 'NCBI RefSeq FAMs including TIGRFAMs',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'SFLD',\n description: 'Structure function linkage database',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'Phobius',\n checked: true,\n description: 'A combined transmembrane topology and signal peptide predictor',\n category: 'Other sequence features',\n },\n {\n name: 'SignalP',\n checked: true,\n category: 'Other sequence features',\n },\n {\n name: 'SignalP_EUK',\n category: 'Other category',\n checked: true,\n },\n {\n name: 'SignalP_GRAM_POSITIVE',\n category: 'Other category',\n checked: true,\n },\n {\n name: 'SignalP_GRAM_NEGATIVE',\n checked: true,\n category: 'Other category',\n },\n {\n name: 'SUPERFAMILY',\n category: 'Structural domains',\n checked: true,\n },\n {\n name: 'PANTHER',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'Gene3D',\n category: 'Structural domains',\n checked: true,\n },\n {\n name: 'Hamap',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'ProSiteProfiles',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'ProSitePatterns',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'Coils',\n category: 'Other sequence features',\n checked: true,\n },\n {\n name: 'SMART',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'CDD',\n description: 'Conserved Domains Database',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'PRINTS',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'Pfam',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'MobiDBLite',\n checked: true,\n category: 'Other sequence features',\n },\n {\n name: 'PIRSF',\n checked: true,\n category: 'Other category',\n },\n {\n name: 'TMHMM',\n checked: true,\n category: 'Other sequence features',\n },\n {\n name: 'AntiFam',\n checked: true,\n category: 'Other category',\n },\n {\n name: 'FunFam',\n checked: true,\n category: 'Other category',\n },\n {\n name: 'PIRSR',\n checked: true,\n category: 'Families, domains, sites & repeats',\n },\n ]);\n const programs = vals.filter(e => e.checked).map(e => e.name);\n const [show, setShow] = useState(false);\n return (React.createElement(Dialog, { maxWidth: \"xl\", title: \"Query InterProScan API for domains\", onClose: () => {\n handleClose();\n }, open: true },\n React.createElement(DialogContent, null,\n React.createElement(Typography, null, \"This will run InterProScan via the InterProScan API on all rows of the current MSA\"),\n React.createElement(Button, { onClick: () => {\n setShow(!show);\n } },\n show ? 'Hide' : 'Show',\n \" advanced options\"),\n show ? (React.createElement(\"div\", null,\n React.createElement(Typography, null, \"Select algorithms for InterProScan to run\"),\n React.createElement(\"div\", null,\n React.createElement(Button, { variant: \"contained\", color: \"secondary\", onClick: () => {\n setVals(vals.map(v => ({ ...v, checked: false })));\n } }, \"Select none\"),\n React.createElement(Button, { variant: \"contained\", color: \"primary\", onClick: () => {\n setVals(vals.map(v => ({ ...v, checked: true })));\n } }, \"Select all\")),\n React.createElement(\"table\", null,\n React.createElement(\"tbody\", null, vals\n .sort((a, b) => a.category.localeCompare(b.category))\n .map(({ name, checked, category }) => (React.createElement(\"tr\", { key: name },\n React.createElement(\"td\", null,\n React.createElement(\"input\", { type: \"checkbox\", key: name, checked: checked, onChange: () => {\n setVals(vals.map(e => e.name === name\n ? { ...e, checked: !e.checked }\n : e));\n } })),\n React.createElement(\"td\", null, name),\n React.createElement(\"td\", null, category)))))))) : null),\n React.createElement(DialogActions, null,\n React.createElement(Button, { variant: \"contained\", color: \"secondary\", onClick: () => {\n handleClose();\n } }, \"Cancel\"),\n React.createElement(Button, { variant: \"contained\", color: \"primary\", onClick: () => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n ;\n (async () => {\n try {\n const { rows } = model;\n if (rows.length > 140) {\n throw new Error('Too many sequences, please run InterProScan offline');\n }\n await launchInterProScan({\n algorithm: 'interproscan',\n programs: programs,\n seq: rows\n .map(row => [row[0], row[1].replaceAll('-', '')])\n .filter(f => !!f[1])\n .map(row => `>${row[0]}\\n${row[1]}`)\n .join('\\n'),\n onProgress: arg => {\n model.setStatus(arg);\n },\n model,\n });\n }\n catch (e) {\n console.error(e);\n getSession(model).notifyError(`${e}`, e);\n }\n finally {\n model.setStatus();\n }\n })();\n handleClose();\n } }, \"Send sequences to InterProScan\"))));\n});\nexport default InterProScanDialog;\n//# sourceMappingURL=InterProScanDialog.js.map"],"names":["base","runInterProScan","seq","onProgress","onJobId","programs","model","jobId","textfetch","wait","loadInterProScanResultsWithStatus","loadInterProScanResults","jsonfetch","url","i","timeout","result","launchInterProScan","algorithm","ret","r","getSession","e","InterProScanDialog","observer","handleClose","vals","setVals","useState","show","setShow","React","Dialog","DialogContent","Typography","Button","v","a","b","name","checked","category","DialogActions","rows","row","f","arg"],"mappings":"2JAEA,MAAMA,EAAO,4CACb,eAAeC,EAAgB,CAAE,IAAAC,EAAK,WAAAC,EAAY,QAAAC,EAAS,SAAAC,EAAU,MAAAC,GAAU,CAC3E,MAAMC,EAAQ,MAAMC,EAAU,GAAGR,CAAI,gBAAiB,CAClD,OAAQ,OACR,KAAM,IAAI,gBAAgB,CACtB,MAAO,wBACP,SAAUE,EACV,SAAUG,EAAS,KAAK,GAAG,CACvC,CAAS,CACT,CAAK,EACDD,GAAA,MAAAA,EAAUG,GACV,MAAME,EAAK,CACP,MAAAF,EACA,WAAAJ,CACR,CAAK,EACD,MAAMO,EAAkC,CAAE,MAAAH,EAAO,MAAAD,CAAO,CAAA,CAC5D,CACO,SAASK,EAAwBJ,EAAO,CAC3C,OAAOK,EAAU,GAAGZ,CAAI,oBAAoBO,CAAK,OAAO,CAC5D,CACA,eAAeE,EAAK,CAAE,WAAAN,EAAY,MAAAI,GAAU,CACxC,MAAMM,EAAM,GAAGb,CAAI,oBAAoBO,CAAK,GAC5C,GAAI,CAEA,OAAa,CACT,QAASO,EAAI,EAAGA,EAAI,GAAIA,IACpB,MAAMC,EAAQ,GAAI,EAClBZ,EAAW,CAAE,IAAK,mBAAmB,GAAKW,CAAC,GAAI,IAAAD,CAAG,CAAE,EAExD,MAAMG,EAAS,MAAMR,EAAUK,CAAG,EAClC,GAAIG,EAAO,SAAS,UAAU,EAC1B,MAEJ,GAAIA,EAAO,SAAS,SAAS,EACzB,MAAM,IAAI,MAAM,wBAAwBT,CAAK,EAAE,CAEtD,CACJ,QACO,CACJJ,GACH,CACL,CACO,eAAec,EAAmB,CAAE,UAAAC,EAAW,IAAAhB,EAAK,SAAAG,EAAU,QAAAD,EAAS,WAAAD,EAAY,MAAAG,GAAU,CAChG,GAAI,CACA,MAAAH,EAAW,CAAE,IAAK,aAAae,CAAS,MAAM,CAAE,EAC5CA,IAAc,gBACd,MAAMjB,EAAgB,CAClB,IAAAC,EACA,QAAAE,EACA,WAAAD,EACA,SAAAE,EACA,MAAAC,CAChB,CAAa,EAEC,IAAI,MAAM,mBAAmB,CACtC,QACO,CACJH,GACH,CACL,CACO,eAAeO,EAAkC,CAAE,MAAAH,EAAO,MAAAD,GAAU,CACvE,GAAI,CACAA,EAAM,UAAU,CACZ,IAAK,0BAA0BC,CAAK,kGACpC,IAAK,6DAA6DA,CAAK,OACnF,CAAS,EACD,MAAMY,EAAM,MAAMR,EAAwBJ,CAAK,EAC/CD,EAAM,uBAAuB,OAAO,YAAYa,EAAI,QAAQ,IAAIC,GAAK,CAACA,EAAE,KAAK,CAAC,EAAE,GAAIA,CAAC,CAAC,CAAC,CAAC,EACxFd,EAAM,eAAe,EAAI,EACzBe,aAAWf,CAAK,EAAE,OAAO,uBAAuBC,CAAK,WAAY,SAAS,CAC7E,OACMe,EAAG,CACN,QAAQ,MAAMA,CAAC,EACfD,EAAU,WAACf,CAAK,EAAE,YAAY,GAAGgB,CAAC,GAAIA,CAAC,CAC1C,QACO,CACJhB,EAAM,UAAS,CAClB,CACL,CC1EK,MAACiB,EAAqBC,EAAS,SAAU,CAAE,YAAAC,EAAa,MAAAnB,CAAK,EAAK,CACnE,KAAM,CAACoB,EAAMC,CAAO,EAAIC,WAAS,CAC7B,CACI,KAAM,UACN,YAAa,sCACb,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,OACN,YAAa,sCACb,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,UACN,QAAS,GACT,YAAa,iEACb,SAAU,yBACb,EACD,CACI,KAAM,UACN,QAAS,GACT,SAAU,yBACb,EACD,CACI,KAAM,cACN,SAAU,iBACV,QAAS,EACZ,EACD,CACI,KAAM,wBACN,SAAU,iBACV,QAAS,EACZ,EACD,CACI,KAAM,wBACN,QAAS,GACT,SAAU,gBACb,EACD,CACI,KAAM,cACN,SAAU,qBACV,QAAS,EACZ,EACD,CACI,KAAM,UACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,SACN,SAAU,qBACV,QAAS,EACZ,EACD,CACI,KAAM,QACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,kBACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,kBACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,QACN,SAAU,0BACV,QAAS,EACZ,EACD,CACI,KAAM,QACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,MACN,YAAa,6BACb,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,SACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,OACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,aACN,QAAS,GACT,SAAU,yBACb,EACD,CACI,KAAM,QACN,QAAS,GACT,SAAU,gBACb,EACD,CACI,KAAM,QACN,QAAS,GACT,SAAU,yBACb,EACD,CACI,KAAM,UACN,QAAS,GACT,SAAU,gBACb,EACD,CACI,KAAM,SACN,QAAS,GACT,SAAU,gBACb,EACD,CACI,KAAM,QACN,QAAS,GACT,SAAU,oCACb,CACT,CAAK,EACKvB,EAAWqB,EAAK,OAAO,GAAK,EAAE,OAAO,EAAE,IAAI,GAAK,EAAE,IAAI,EACtD,CAACG,EAAMC,CAAO,EAAIF,EAAQ,SAAC,EAAK,EACtC,OAAQG,EAAM,cAAcC,EAAAA,OAAQ,CAAE,SAAU,KAAM,MAAO,qCAAsC,QAAS,IAAM,CAC1GP,GACZ,EAAW,KAAM,EAAM,EACfM,EAAM,cAAcE,EAAe,KAC/BF,EAAM,cAAcG,EAAY,KAAM,oFAAoF,EAC1HH,EAAM,cAAcI,EAAQ,CAAE,QAAS,IAAM,CACrCL,EAAQ,CAACD,CAAI,CACjC,CAAmB,EACHA,EAAO,OAAS,OAChB,mBAAmB,EACvBA,EAAQE,EAAM,cAAc,MAAO,KAC/BA,EAAM,cAAcG,EAAY,KAAM,2CAA2C,EACjFH,EAAM,cAAc,MAAO,KACvBA,EAAM,cAAcI,EAAQ,CAAE,QAAS,YAAa,MAAO,YAAa,QAAS,IAAM,CAC/ER,EAAQD,EAAK,IAAIU,IAAM,CAAE,GAAGA,EAAG,QAAS,IAAQ,CAAC,CACpD,CAAA,EAAI,aAAa,EACtBL,EAAM,cAAcI,EAAQ,CAAE,QAAS,YAAa,MAAO,UAAW,QAAS,IAAM,CAC7ER,EAAQD,EAAK,IAAIU,IAAM,CAAE,GAAGA,EAAG,QAAS,IAAO,CAAC,CAC5E,CAA2B,EAAE,YAAY,CAAC,EAC1BL,EAAM,cAAc,QAAS,KACzBA,EAAM,cAAc,QAAS,KAAML,EAC9B,KAAK,CAACW,EAAGC,IAAMD,EAAE,SAAS,cAAcC,EAAE,QAAQ,CAAC,EACnD,IAAI,CAAC,CAAE,KAAAC,EAAM,QAAAC,EAAS,SAAAC,CAAQ,IAAQV,EAAM,cAAc,KAAM,CAAE,IAAKQ,CAAM,EAC9ER,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAc,QAAS,CAAE,KAAM,WAAY,IAAKQ,EAAM,QAASC,EAAS,SAAU,IAAM,CACtFb,EAAQD,EAAK,IAAIJ,GAAKA,EAAE,OAASiB,EAC3B,CAAE,GAAGjB,EAAG,QAAS,CAACA,EAAE,OAAS,EAC7BA,CAAC,CAAC,CACX,CAAA,CAAE,CAAC,EACZS,EAAM,cAAc,KAAM,KAAMQ,CAAI,EACpCR,EAAM,cAAc,KAAM,KAAMU,CAAQ,CAAC,CAAE,CAAC,CAAC,CAAC,EAAK,IAAI,EACvEV,EAAM,cAAcW,EAAe,KAC/BX,EAAM,cAAcI,EAAQ,CAAE,QAAS,YAAa,MAAO,YAAa,QAAS,IAAM,CAC/EV,GACH,CAAA,EAAI,QAAQ,EACjBM,EAAM,cAAcI,EAAQ,CAAE,QAAS,YAAa,MAAO,UAAW,QAAS,IAAM,EAG5E,SAAY,CACT,GAAI,CACA,KAAM,CAAE,KAAAQ,CAAM,EAAGrC,EACjB,GAAIqC,EAAK,OAAS,IACd,MAAM,IAAI,MAAM,qDAAqD,EAEzE,MAAM1B,EAAmB,CACrB,UAAW,eACX,SAAUZ,EACV,IAAKsC,EACA,IAAIC,GAAO,CAACA,EAAI,CAAC,EAAGA,EAAI,CAAC,EAAE,WAAW,IAAK,EAAE,CAAC,CAAC,EAC/C,OAAOC,GAAK,CAAC,CAACA,EAAE,CAAC,CAAC,EAClB,IAAID,GAAO,IAAIA,EAAI,CAAC,CAAC;AAAA,EAAKA,EAAI,CAAC,CAAC,EAAE,EAClC,KAAK;AAAA,CAAI,EACd,WAAYE,GAAO,CACfxC,EAAM,UAAUwC,CAAG,CACtB,EACD,MAAAxC,CAChC,CAA6B,CACJ,OACM,EAAG,CACN,QAAQ,MAAM,CAAC,EACfe,EAAU,WAACf,CAAK,EAAE,YAAY,GAAG,CAAC,GAAI,CAAC,CAC1C,QACO,CACJA,EAAM,UAAS,CAClB,CACzB,KACoBmB,GACpB,GAAqB,gCAAgC,CAAC,CAAC,CACvD,CAAC"} \ No newline at end of file +{"version":3,"file":"InterProScanDialog-C82LUzrO.js","sources":["../../../lib/dist/launchInterProScan.js","../../../lib/dist/components/dialogs/InterProScanDialog.js"],"sourcesContent":["import { getSession } from '@jbrowse/core/util';\nimport { jsonfetch, textfetch, timeout } from './fetchUtils';\nconst base = 'https://www.ebi.ac.uk/Tools/services/rest';\nasync function runInterProScan({ seq, onProgress, onJobId, programs, model, }) {\n const jobId = await textfetch(`${base}/iprscan5/run`, {\n method: 'POST',\n body: new URLSearchParams({\n email: 'colin.diesh@gmail.com',\n sequence: seq,\n programs: programs.join(','),\n }),\n });\n onJobId?.(jobId);\n await wait({\n jobId,\n onProgress,\n });\n await loadInterProScanResultsWithStatus({ jobId, model });\n}\nexport function loadInterProScanResults(jobId) {\n return jsonfetch(`${base}/iprscan5/result/${jobId}/json`);\n}\nasync function wait({ onProgress, jobId, }) {\n const url = `${base}/iprscan5/status/${jobId}`;\n try {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while (true) {\n for (let i = 0; i < 10; i++) {\n await timeout(1000);\n onProgress({ msg: `Checking status ${10 - i}`, url });\n }\n const result = await textfetch(url);\n if (result.includes('FINISHED')) {\n break;\n }\n if (result.includes('FAILURE')) {\n throw new Error(`Failed to run: jobId ${jobId}`);\n }\n }\n }\n finally {\n onProgress();\n }\n}\nexport async function launchInterProScan({ algorithm, seq, programs, onJobId, onProgress, model, }) {\n try {\n onProgress({ msg: `Launching ${algorithm} MSA` });\n if (algorithm === 'interproscan') {\n await runInterProScan({\n seq,\n onJobId,\n onProgress,\n programs,\n model,\n });\n }\n throw new Error('unknown algorithm');\n }\n finally {\n onProgress();\n }\n}\nexport async function loadInterProScanResultsWithStatus({ jobId, model, }) {\n try {\n model.setStatus({\n msg: `Downloading results of ${jobId} (for larger sequences this can be slow, click status to download and upload in the manual tab)`,\n url: `https://www.ebi.ac.uk/Tools/services/rest/iprscan5/result/${jobId}/json`,\n });\n const ret = await loadInterProScanResults(jobId);\n model.setInterProAnnotations(Object.fromEntries(ret.results.map(r => [r.xref[0].id, r])));\n model.setShowDomains(true);\n getSession(model).notify(`Loaded interproscan ${jobId} results`, 'success');\n }\n catch (e) {\n console.error(e);\n getSession(model).notifyError(`${e}`, e);\n }\n finally {\n model.setStatus();\n }\n}\n//# sourceMappingURL=launchInterProScan.js.map","import React, { useState } from 'react';\nimport { observer } from 'mobx-react';\nimport { Button, DialogActions, DialogContent, Typography } from '@mui/material';\nimport { getSession } from '@jbrowse/core/util';\nimport { launchInterProScan } from '../../launchInterProScan';\nimport { Dialog } from '@jbrowse/core/ui';\nconst InterProScanDialog = observer(function ({ handleClose, model, }) {\n const [vals, setVals] = useState([\n {\n name: 'NCBIfam',\n description: 'NCBI RefSeq FAMs including TIGRFAMs',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'SFLD',\n description: 'Structure function linkage database',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'Phobius',\n checked: true,\n description: 'A combined transmembrane topology and signal peptide predictor',\n category: 'Other sequence features',\n },\n {\n name: 'SignalP',\n checked: true,\n category: 'Other sequence features',\n },\n {\n name: 'SignalP_EUK',\n category: 'Other category',\n checked: true,\n },\n {\n name: 'SignalP_GRAM_POSITIVE',\n category: 'Other category',\n checked: true,\n },\n {\n name: 'SignalP_GRAM_NEGATIVE',\n checked: true,\n category: 'Other category',\n },\n {\n name: 'SUPERFAMILY',\n category: 'Structural domains',\n checked: true,\n },\n {\n name: 'PANTHER',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'Gene3D',\n category: 'Structural domains',\n checked: true,\n },\n {\n name: 'Hamap',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'ProSiteProfiles',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'ProSitePatterns',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'Coils',\n category: 'Other sequence features',\n checked: true,\n },\n {\n name: 'SMART',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'CDD',\n description: 'Conserved Domains Database',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'PRINTS',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'Pfam',\n category: 'Families, domains, sites & repeats',\n checked: true,\n },\n {\n name: 'MobiDBLite',\n checked: true,\n category: 'Other sequence features',\n },\n {\n name: 'PIRSF',\n checked: true,\n category: 'Other category',\n },\n {\n name: 'TMHMM',\n checked: true,\n category: 'Other sequence features',\n },\n {\n name: 'AntiFam',\n checked: true,\n category: 'Other category',\n },\n {\n name: 'FunFam',\n checked: true,\n category: 'Other category',\n },\n {\n name: 'PIRSR',\n checked: true,\n category: 'Families, domains, sites & repeats',\n },\n ]);\n const programs = vals.filter(e => e.checked).map(e => e.name);\n const [show, setShow] = useState(false);\n return (React.createElement(Dialog, { maxWidth: \"xl\", title: \"Query InterProScan API for domains\", onClose: () => {\n handleClose();\n }, open: true },\n React.createElement(DialogContent, null,\n React.createElement(Typography, null, \"This will run InterProScan via the InterProScan API on all rows of the current MSA\"),\n React.createElement(Button, { onClick: () => {\n setShow(!show);\n } },\n show ? 'Hide' : 'Show',\n \" advanced options\"),\n show ? (React.createElement(\"div\", null,\n React.createElement(Typography, null, \"Select algorithms for InterProScan to run\"),\n React.createElement(\"div\", null,\n React.createElement(Button, { variant: \"contained\", color: \"secondary\", onClick: () => {\n setVals(vals.map(v => ({ ...v, checked: false })));\n } }, \"Select none\"),\n React.createElement(Button, { variant: \"contained\", color: \"primary\", onClick: () => {\n setVals(vals.map(v => ({ ...v, checked: true })));\n } }, \"Select all\")),\n React.createElement(\"table\", null,\n React.createElement(\"tbody\", null, vals\n .sort((a, b) => a.category.localeCompare(b.category))\n .map(({ name, checked, category }) => (React.createElement(\"tr\", { key: name },\n React.createElement(\"td\", null,\n React.createElement(\"input\", { type: \"checkbox\", key: name, checked: checked, onChange: () => {\n setVals(vals.map(e => e.name === name\n ? { ...e, checked: !e.checked }\n : e));\n } })),\n React.createElement(\"td\", null, name),\n React.createElement(\"td\", null, category)))))))) : null),\n React.createElement(DialogActions, null,\n React.createElement(Button, { variant: \"contained\", color: \"secondary\", onClick: () => {\n handleClose();\n } }, \"Cancel\"),\n React.createElement(Button, { variant: \"contained\", color: \"primary\", onClick: () => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n ;\n (async () => {\n try {\n const { rows } = model;\n if (rows.length > 140) {\n throw new Error('Too many sequences, please run InterProScan offline');\n }\n await launchInterProScan({\n algorithm: 'interproscan',\n programs: programs,\n seq: rows\n .map(row => [row[0], row[1].replaceAll('-', '')])\n .filter(f => !!f[1])\n .map(row => `>${row[0]}\\n${row[1]}`)\n .join('\\n'),\n onProgress: arg => {\n model.setStatus(arg);\n },\n model,\n });\n }\n catch (e) {\n console.error(e);\n getSession(model).notifyError(`${e}`, e);\n }\n finally {\n model.setStatus();\n }\n })();\n handleClose();\n } }, \"Send sequences to InterProScan\"))));\n});\nexport default InterProScanDialog;\n//# sourceMappingURL=InterProScanDialog.js.map"],"names":["base","runInterProScan","seq","onProgress","onJobId","programs","model","jobId","textfetch","wait","loadInterProScanResultsWithStatus","loadInterProScanResults","jsonfetch","url","i","timeout","result","launchInterProScan","algorithm","ret","r","getSession","e","InterProScanDialog","observer","handleClose","vals","setVals","useState","show","setShow","React","Dialog","DialogContent","Typography","Button","v","a","b","name","checked","category","DialogActions","rows","row","f","arg"],"mappings":"2JAEA,MAAMA,EAAO,4CACb,eAAeC,EAAgB,CAAE,IAAAC,EAAK,WAAAC,EAAY,QAAAC,EAAS,SAAAC,EAAU,MAAAC,GAAU,CAC3E,MAAMC,EAAQ,MAAMC,EAAU,GAAGR,CAAI,gBAAiB,CAClD,OAAQ,OACR,KAAM,IAAI,gBAAgB,CACtB,MAAO,wBACP,SAAUE,EACV,SAAUG,EAAS,KAAK,GAAG,CACvC,CAAS,CACT,CAAK,EACDD,GAAA,MAAAA,EAAUG,GACV,MAAME,EAAK,CACP,MAAAF,EACA,WAAAJ,CACR,CAAK,EACD,MAAMO,EAAkC,CAAE,MAAAH,EAAO,MAAAD,CAAO,CAAA,CAC5D,CACO,SAASK,EAAwBJ,EAAO,CAC3C,OAAOK,EAAU,GAAGZ,CAAI,oBAAoBO,CAAK,OAAO,CAC5D,CACA,eAAeE,EAAK,CAAE,WAAAN,EAAY,MAAAI,GAAU,CACxC,MAAMM,EAAM,GAAGb,CAAI,oBAAoBO,CAAK,GAC5C,GAAI,CAEA,OAAa,CACT,QAASO,EAAI,EAAGA,EAAI,GAAIA,IACpB,MAAMC,EAAQ,GAAI,EAClBZ,EAAW,CAAE,IAAK,mBAAmB,GAAKW,CAAC,GAAI,IAAAD,CAAG,CAAE,EAExD,MAAMG,EAAS,MAAMR,EAAUK,CAAG,EAClC,GAAIG,EAAO,SAAS,UAAU,EAC1B,MAEJ,GAAIA,EAAO,SAAS,SAAS,EACzB,MAAM,IAAI,MAAM,wBAAwBT,CAAK,EAAE,CAEtD,CACJ,QACO,CACJJ,GACH,CACL,CACO,eAAec,EAAmB,CAAE,UAAAC,EAAW,IAAAhB,EAAK,SAAAG,EAAU,QAAAD,EAAS,WAAAD,EAAY,MAAAG,GAAU,CAChG,GAAI,CACA,MAAAH,EAAW,CAAE,IAAK,aAAae,CAAS,MAAM,CAAE,EAC5CA,IAAc,gBACd,MAAMjB,EAAgB,CAClB,IAAAC,EACA,QAAAE,EACA,WAAAD,EACA,SAAAE,EACA,MAAAC,CAChB,CAAa,EAEC,IAAI,MAAM,mBAAmB,CACtC,QACO,CACJH,GACH,CACL,CACO,eAAeO,EAAkC,CAAE,MAAAH,EAAO,MAAAD,GAAU,CACvE,GAAI,CACAA,EAAM,UAAU,CACZ,IAAK,0BAA0BC,CAAK,kGACpC,IAAK,6DAA6DA,CAAK,OACnF,CAAS,EACD,MAAMY,EAAM,MAAMR,EAAwBJ,CAAK,EAC/CD,EAAM,uBAAuB,OAAO,YAAYa,EAAI,QAAQ,IAAIC,GAAK,CAACA,EAAE,KAAK,CAAC,EAAE,GAAIA,CAAC,CAAC,CAAC,CAAC,EACxFd,EAAM,eAAe,EAAI,EACzBe,aAAWf,CAAK,EAAE,OAAO,uBAAuBC,CAAK,WAAY,SAAS,CAC7E,OACMe,EAAG,CACN,QAAQ,MAAMA,CAAC,EACfD,EAAU,WAACf,CAAK,EAAE,YAAY,GAAGgB,CAAC,GAAIA,CAAC,CAC1C,QACO,CACJhB,EAAM,UAAS,CAClB,CACL,CC1EK,MAACiB,EAAqBC,EAAS,SAAU,CAAE,YAAAC,EAAa,MAAAnB,CAAK,EAAK,CACnE,KAAM,CAACoB,EAAMC,CAAO,EAAIC,WAAS,CAC7B,CACI,KAAM,UACN,YAAa,sCACb,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,OACN,YAAa,sCACb,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,UACN,QAAS,GACT,YAAa,iEACb,SAAU,yBACb,EACD,CACI,KAAM,UACN,QAAS,GACT,SAAU,yBACb,EACD,CACI,KAAM,cACN,SAAU,iBACV,QAAS,EACZ,EACD,CACI,KAAM,wBACN,SAAU,iBACV,QAAS,EACZ,EACD,CACI,KAAM,wBACN,QAAS,GACT,SAAU,gBACb,EACD,CACI,KAAM,cACN,SAAU,qBACV,QAAS,EACZ,EACD,CACI,KAAM,UACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,SACN,SAAU,qBACV,QAAS,EACZ,EACD,CACI,KAAM,QACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,kBACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,kBACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,QACN,SAAU,0BACV,QAAS,EACZ,EACD,CACI,KAAM,QACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,MACN,YAAa,6BACb,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,SACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,OACN,SAAU,qCACV,QAAS,EACZ,EACD,CACI,KAAM,aACN,QAAS,GACT,SAAU,yBACb,EACD,CACI,KAAM,QACN,QAAS,GACT,SAAU,gBACb,EACD,CACI,KAAM,QACN,QAAS,GACT,SAAU,yBACb,EACD,CACI,KAAM,UACN,QAAS,GACT,SAAU,gBACb,EACD,CACI,KAAM,SACN,QAAS,GACT,SAAU,gBACb,EACD,CACI,KAAM,QACN,QAAS,GACT,SAAU,oCACb,CACT,CAAK,EACKvB,EAAWqB,EAAK,OAAO,GAAK,EAAE,OAAO,EAAE,IAAI,GAAK,EAAE,IAAI,EACtD,CAACG,EAAMC,CAAO,EAAIF,EAAQ,SAAC,EAAK,EACtC,OAAQG,EAAM,cAAcC,EAAAA,OAAQ,CAAE,SAAU,KAAM,MAAO,qCAAsC,QAAS,IAAM,CAC1GP,GACZ,EAAW,KAAM,EAAM,EACfM,EAAM,cAAcE,EAAe,KAC/BF,EAAM,cAAcG,EAAY,KAAM,oFAAoF,EAC1HH,EAAM,cAAcI,EAAQ,CAAE,QAAS,IAAM,CACrCL,EAAQ,CAACD,CAAI,CACjC,CAAmB,EACHA,EAAO,OAAS,OAChB,mBAAmB,EACvBA,EAAQE,EAAM,cAAc,MAAO,KAC/BA,EAAM,cAAcG,EAAY,KAAM,2CAA2C,EACjFH,EAAM,cAAc,MAAO,KACvBA,EAAM,cAAcI,EAAQ,CAAE,QAAS,YAAa,MAAO,YAAa,QAAS,IAAM,CAC/ER,EAAQD,EAAK,IAAIU,IAAM,CAAE,GAAGA,EAAG,QAAS,IAAQ,CAAC,CACpD,CAAA,EAAI,aAAa,EACtBL,EAAM,cAAcI,EAAQ,CAAE,QAAS,YAAa,MAAO,UAAW,QAAS,IAAM,CAC7ER,EAAQD,EAAK,IAAIU,IAAM,CAAE,GAAGA,EAAG,QAAS,IAAO,CAAC,CAC5E,CAA2B,EAAE,YAAY,CAAC,EAC1BL,EAAM,cAAc,QAAS,KACzBA,EAAM,cAAc,QAAS,KAAML,EAC9B,KAAK,CAACW,EAAGC,IAAMD,EAAE,SAAS,cAAcC,EAAE,QAAQ,CAAC,EACnD,IAAI,CAAC,CAAE,KAAAC,EAAM,QAAAC,EAAS,SAAAC,CAAQ,IAAQV,EAAM,cAAc,KAAM,CAAE,IAAKQ,CAAM,EAC9ER,EAAM,cAAc,KAAM,KACtBA,EAAM,cAAc,QAAS,CAAE,KAAM,WAAY,IAAKQ,EAAM,QAASC,EAAS,SAAU,IAAM,CACtFb,EAAQD,EAAK,IAAIJ,GAAKA,EAAE,OAASiB,EAC3B,CAAE,GAAGjB,EAAG,QAAS,CAACA,EAAE,OAAS,EAC7BA,CAAC,CAAC,CACX,CAAA,CAAE,CAAC,EACZS,EAAM,cAAc,KAAM,KAAMQ,CAAI,EACpCR,EAAM,cAAc,KAAM,KAAMU,CAAQ,CAAC,CAAE,CAAC,CAAC,CAAC,EAAK,IAAI,EACvEV,EAAM,cAAcW,EAAe,KAC/BX,EAAM,cAAcI,EAAQ,CAAE,QAAS,YAAa,MAAO,YAAa,QAAS,IAAM,CAC/EV,GACH,CAAA,EAAI,QAAQ,EACjBM,EAAM,cAAcI,EAAQ,CAAE,QAAS,YAAa,MAAO,UAAW,QAAS,IAAM,EAG5E,SAAY,CACT,GAAI,CACA,KAAM,CAAE,KAAAQ,CAAM,EAAGrC,EACjB,GAAIqC,EAAK,OAAS,IACd,MAAM,IAAI,MAAM,qDAAqD,EAEzE,MAAM1B,EAAmB,CACrB,UAAW,eACX,SAAUZ,EACV,IAAKsC,EACA,IAAIC,GAAO,CAACA,EAAI,CAAC,EAAGA,EAAI,CAAC,EAAE,WAAW,IAAK,EAAE,CAAC,CAAC,EAC/C,OAAOC,GAAK,CAAC,CAACA,EAAE,CAAC,CAAC,EAClB,IAAID,GAAO,IAAIA,EAAI,CAAC,CAAC;AAAA,EAAKA,EAAI,CAAC,CAAC,EAAE,EAClC,KAAK;AAAA,CAAI,EACd,WAAYE,GAAO,CACfxC,EAAM,UAAUwC,CAAG,CACtB,EACD,MAAAxC,CAChC,CAA6B,CACJ,OACM,EAAG,CACN,QAAQ,MAAM,CAAC,EACfe,EAAU,WAACf,CAAK,EAAE,YAAY,GAAG,CAAC,GAAI,CAAC,CAC1C,QACO,CACJA,EAAM,UAAS,CAClB,CACzB,KACoBmB,GACpB,GAAqB,gCAAgC,CAAC,CAAC,CACvD,CAAC"} \ No newline at end of file diff --git a/assets/MetadataDialog-Cp5aJYvv.js b/assets/MetadataDialog-BO5LB64f.js similarity index 53% rename from assets/MetadataDialog-Cp5aJYvv.js rename to assets/MetadataDialog-BO5LB64f.js index a107e5c..aeb7168 100644 --- a/assets/MetadataDialog-Cp5aJYvv.js +++ b/assets/MetadataDialog-BO5LB64f.js @@ -1,2 +1,2 @@ -import{o as s,R as e,e as n,D as l}from"./index-BW_Tl6Ao.js";import{B as a,S as i}from"./SequenceTextArea-BH6U8IgE.js";import"./Checkbox2-qAuBBMke.js";const d=s(function({model:t,onClose:r}){const{header:o}=t;return e.createElement(n.Dialog,{onClose:()=>{r()},open:!0,title:"Metadata",maxWidth:"xl"},e.createElement(l,null,e.createElement(a.Attributes,{attributes:o}),e.createElement(a.BaseCard,{title:"sequence"},e.createElement(i,{str:t.rows}))))});export{d as default}; -//# sourceMappingURL=MetadataDialog-Cp5aJYvv.js.map +import{o as s,R as e,e as n,D as l}from"./index-PBHga9OU.js";import{B as a,S as i}from"./SequenceTextArea-9Ex0cwEv.js";import"./Checkbox2-Bjl1T2Gs.js";const d=s(function({model:t,onClose:r}){const{header:o}=t;return e.createElement(n.Dialog,{onClose:()=>{r()},open:!0,title:"Metadata",maxWidth:"xl"},e.createElement(l,null,e.createElement(a.Attributes,{attributes:o}),e.createElement(a.BaseCard,{title:"sequence"},e.createElement(i,{str:t.rows}))))});export{d as default}; +//# sourceMappingURL=MetadataDialog-BO5LB64f.js.map diff --git a/assets/MetadataDialog-Cp5aJYvv.js.map b/assets/MetadataDialog-BO5LB64f.js.map similarity index 95% rename from assets/MetadataDialog-Cp5aJYvv.js.map rename to assets/MetadataDialog-BO5LB64f.js.map index 062b0f1..0855d2d 100644 --- a/assets/MetadataDialog-Cp5aJYvv.js.map +++ b/assets/MetadataDialog-BO5LB64f.js.map @@ -1 +1 @@ -{"version":3,"file":"MetadataDialog-Cp5aJYvv.js","sources":["../../../lib/dist/components/dialogs/MetadataDialog.js"],"sourcesContent":["import React from 'react';\nimport { DialogContent } from '@mui/material';\nimport { observer } from 'mobx-react';\nimport { Dialog } from '@jbrowse/core/ui';\nimport { Attributes, BaseCard, } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail';\nimport SequenceTextArea from '../SequenceTextArea';\nconst MetadataDialog = observer(function ({ model, onClose, }) {\n const { header } = model;\n return (React.createElement(Dialog, { onClose: () => {\n onClose();\n }, open: true, title: \"Metadata\", maxWidth: \"xl\" },\n React.createElement(DialogContent, null,\n React.createElement(Attributes, { attributes: header }),\n React.createElement(BaseCard, { title: \"sequence\" },\n React.createElement(SequenceTextArea, { str: model.rows })))));\n});\nexport default MetadataDialog;\n//# sourceMappingURL=MetadataDialog.js.map"],"names":["MetadataDialog","observer","model","onClose","header","React","Dialog","DialogContent","Attributes","BaseCard","SequenceTextArea"],"mappings":"uJAMK,MAACA,EAAiBC,EAAS,SAAU,CAAE,MAAAC,EAAO,QAAAC,CAAO,EAAK,CAC3D,KAAM,CAAE,OAAAC,CAAQ,EAAGF,EACnB,OAAQG,EAAM,cAAcC,SAAQ,CAAE,QAAS,IAAM,CAC7CH,GACZ,EAAW,KAAM,GAAM,MAAO,WAAY,SAAU,IAAM,EAClDE,EAAM,cAAcE,EAAe,KAC/BF,EAAM,cAAcG,EAAAA,WAAY,CAAE,WAAYJ,CAAM,CAAE,EACtDC,EAAM,cAAcI,EAAAA,SAAU,CAAE,MAAO,UAAY,EAC/CJ,EAAM,cAAcK,EAAkB,CAAE,IAAKR,EAAM,IAAI,CAAE,CAAC,CAAC,CAAC,CAC5E,CAAC"} \ No newline at end of file +{"version":3,"file":"MetadataDialog-BO5LB64f.js","sources":["../../../lib/dist/components/dialogs/MetadataDialog.js"],"sourcesContent":["import React from 'react';\nimport { DialogContent } from '@mui/material';\nimport { observer } from 'mobx-react';\nimport { Dialog } from '@jbrowse/core/ui';\nimport { Attributes, BaseCard, } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail';\nimport SequenceTextArea from '../SequenceTextArea';\nconst MetadataDialog = observer(function ({ model, onClose, }) {\n const { header } = model;\n return (React.createElement(Dialog, { onClose: () => {\n onClose();\n }, open: true, title: \"Metadata\", maxWidth: \"xl\" },\n React.createElement(DialogContent, null,\n React.createElement(Attributes, { attributes: header }),\n React.createElement(BaseCard, { title: \"sequence\" },\n React.createElement(SequenceTextArea, { str: model.rows })))));\n});\nexport default MetadataDialog;\n//# sourceMappingURL=MetadataDialog.js.map"],"names":["MetadataDialog","observer","model","onClose","header","React","Dialog","DialogContent","Attributes","BaseCard","SequenceTextArea"],"mappings":"uJAMK,MAACA,EAAiBC,EAAS,SAAU,CAAE,MAAAC,EAAO,QAAAC,CAAO,EAAK,CAC3D,KAAM,CAAE,OAAAC,CAAQ,EAAGF,EACnB,OAAQG,EAAM,cAAcC,SAAQ,CAAE,QAAS,IAAM,CAC7CH,GACZ,EAAW,KAAM,GAAM,MAAO,WAAY,SAAU,IAAM,EAClDE,EAAM,cAAcE,EAAe,KAC/BF,EAAM,cAAcG,EAAAA,WAAY,CAAE,WAAYJ,CAAM,CAAE,EACtDC,EAAM,cAAcI,EAAAA,SAAU,CAAE,MAAO,UAAY,EAC/CJ,EAAM,cAAcK,EAAkB,CAAE,IAAKR,EAAM,IAAI,CAAE,CAAC,CAAC,CAAC,CAC5E,CAAC"} \ No newline at end of file diff --git a/assets/SequenceTextArea-9Ex0cwEv.js b/assets/SequenceTextArea-9Ex0cwEv.js new file mode 100644 index 0000000..5436f1d --- /dev/null +++ b/assets/SequenceTextArea-9Ex0cwEv.js @@ -0,0 +1,52 @@ +import{t as fi,v as Ju,x as Zu,y as v,z as Uo,H as ed,A as rn,E as td,j as i,G as nd,I as od,J as Y,K as Dt,e as qt,N as It,O as dt,P as gi,Q as rd,U as ld,V as Wo,W as sd,X as je,Y as mi,Z as h,$ as ne,a0 as hi,a1 as Kr,a2 as me,a3 as pi,a4 as id,a5 as Ci,a6 as Kt,a7 as qo,a8 as ad,a9 as Se,aa as cd,M as yt,ab as Vt,ac as ud,ad as yn,ae as Vl,af as dd,ag as fd,ah as gd,ai as Xr,aj as Te,ak as md,al as vn,am as hd,i as Nl,an as Bl,f as Yr,ao as pd,ap as Cd,aq as bd,ar as wd,as as Ul,C as Sd,l as yd,at as xd,B as bi,au as vd,av as Id,aw as Md,ax as Pd,ay as Ed,az as Fd,aA as kd,m as Dd,R as fn}from"./index-PBHga9OU.js";import{C as Wl}from"./Checkbox2-Bjl1T2Gs.js";var wi={exports:{}},Td="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Od=Td,Hd=Od;function Si(){}function yi(){}yi.resetWarningCache=Si;var _d=function(){function e(r,o,l,s,a,c){if(c!==Hd){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:yi,resetWarningCache:Si};return n.PropTypes=n,n};wi.exports=_d();var Ld=wi.exports;const V=fi(Ld);var Gd={},Ko={},Rd=Zu;Object.defineProperty(Ko,"__esModule",{value:!0});Ko.default=void 0;var $d=Rd(Ju()),Ad=v;Ko.default=(0,$d.default)((0,Ad.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var xi={},Qr={};const jd=Uo(ed);var mo={},ho={},ql;function vi(){if(ql)return ho;ql=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.useFeatureSequence=o;const e=i,t=rn(),n=td(),r=5e5;function o(l,s,a,c){const[u,d]=(0,e.useState)(),[f,g]=(0,e.useState)();return(0,e.useEffect)(()=>{var m,C;if(!l)return;const{assemblyManager:b,rpcManager:p}=(0,t.getSession)(l),S=((C=(m=l.view)===null||m===void 0?void 0:m.assemblyNames)===null||C===void 0?void 0:C[0])||"";async function x(D,E,H){const G=await b.waitForAssembly(S);if(!G)throw new Error("assembly not found");const A="getSequence",F=await p.call(A,"CoreGetFeatures",{adapterConfig:(0,n.getConf)(G,["sequence","adapter"]),sessionId:A,regions:[{start:D,end:E,refName:G.getCanonicalRefName(H),assemblyName:S}]}),[y]=F;return(y==null?void 0:y.get("seq"))||""}(async()=>{try{g(void 0);const{start:D,end:E,refName:H}=s;if(!c&&E-D>r)d({error:`Genomic sequence larger than ${r}bp, use "force load" button to display`});else{const G=D-a,A=E+a,F=await x(D,E,H),y=await x(Math.max(0,G),D,H),_=await x(E,A,H);d({seq:F,upstream:y,downstream:_})}}catch(D){console.error(D),g(D)}})()},[s,l,a,c]),{sequence:u,error:f}}return ho}var po={};const zd=Uo(nd),Ii=Uo(od);var Co={},Kl;function Vd(){if(Kl)return Co;Kl=1;var e=Y&&Y.__createBinding||(Object.create?function(g,m,C,b){b===void 0&&(b=C);var p=Object.getOwnPropertyDescriptor(m,C);(!p||("get"in p?!m.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return m[C]}}),Object.defineProperty(g,b,p)}:function(g,m,C,b){b===void 0&&(b=C),g[b]=m[C]}),t=Y&&Y.__setModuleDefault||(Object.create?function(g,m){Object.defineProperty(g,"default",{enumerable:!0,value:m})}:function(g,m){g.default=m}),n=Y&&Y.__importStar||function(g){if(g&&g.__esModule)return g;var m={};if(g!=null)for(var C in g)C!=="default"&&Object.prototype.hasOwnProperty.call(g,C)&&e(m,g,C);return t(m,g),m};Object.defineProperty(Co,"__esModule",{value:!0});const r=n(i),o=Dt,l=qt,s=It,a=dt,c=(0,s.makeStyles)()(g=>({formElt:{margin:g.spacing(3),width:400},dialogContent:{width:"80em"},root:{padding:4}}));function u(g){return r.default.createElement("div",null,r.default.createElement(o.TextField,{...g}))}function d({children:g}){return r.default.createElement("div",null,r.default.createElement(o.FormControl,null,g))}const f=(0,a.observer)(function({handleClose:g,model:m}){const{classes:C}=c(),{upperCaseCDS:b}=m,[p,S]=(0,r.useState)(`${m.intronBp}`),[x,D]=(0,r.useState)(`${m.upDownBp}`),E=!Number.isNaN(+p),H=!Number.isNaN(+x);return r.default.createElement(l.Dialog,{maxWidth:"xl",open:!0,onClose:()=>{g()},title:"Feature sequence settings"},r.default.createElement(o.DialogContent,{className:C.dialogContent},r.default.createElement(u,{label:"Number of intronic bases around splice site to display",className:C.formElt,value:p,helperText:E?"":"Not a number",error:!E,onChange:G=>{S(G.target.value)}}),r.default.createElement(u,{label:"Number of bases up/down stream of feature to display",className:C.formElt,value:x,helperText:H?"":"Not a number",error:!H,onChange:G=>{D(G.target.value)}}),r.default.createElement(d,null,r.default.createElement(o.FormLabel,null,"Sequence capitalization"),r.default.createElement(o.RadioGroup,{value:b?"cds":"unchanged",onChange:G=>{m.setUpperCaseCDS(G.target.value==="cds")}},r.default.createElement(o.FormControlLabel,{value:"cds",control:r.default.createElement(o.Radio,{className:C.root,size:"small"}),label:"Capitalize CDS and lower case everything else"}),r.default.createElement(o.FormControlLabel,{value:"unchanged",control:r.default.createElement(o.Radio,{className:C.root,size:"small"}),label:"Capitalization from reference genome sequence"})))),r.default.createElement(o.DialogActions,null,r.default.createElement(o.Button,{onClick:()=>{m.setIntronBp(+p),m.setUpDownBp(+x),g()},disabled:!E||!H,color:"primary",variant:"contained"},"Submit"),r.default.createElement(o.Button,{onClick:()=>{g()},color:"secondary",autoFocus:!0,variant:"contained"},"Cancel")))});return Co.default=f,Co}var Xl;function Mi(){if(Xl)return po;Xl=1;var e=Y&&Y.__createBinding||(Object.create?function(m,C,b,p){p===void 0&&(p=b);var S=Object.getOwnPropertyDescriptor(C,b);(!S||("get"in S?!C.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return C[b]}}),Object.defineProperty(m,p,S)}:function(m,C,b,p){p===void 0&&(p=b),m[p]=C[b]}),t=Y&&Y.__setModuleDefault||(Object.create?function(m,C){Object.defineProperty(m,"default",{enumerable:!0,value:C})}:function(m,C){m.default=C}),n=Y&&Y.__importStar||function(m){if(m&&m.__esModule)return m;var C={};if(m!=null)for(var b in m)b!=="default"&&Object.prototype.hasOwnProperty.call(m,b)&&e(C,m,b);return t(C,m),C},r=Y&&Y.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(po,"__esModule",{value:!0});const o=n(i),l=dt,s=r(gi()),a=ld,c=r(rd),u=r(zd),d=r(Ii),f=(0,o.lazy)(()=>Promise.resolve().then(()=>n(Vd()))),g=(0,l.observer)(o.default.forwardRef(function({model:C,extraItems:b=[]},p){if(typeof p=="function")throw new Error("needs a non function ref");const[S,x]=(0,o.useState)(!1),{showCoordinatesSetting:D,showGenomicCoordsOption:E}=C;return o.default.createElement(o.default.Fragment,null,o.default.createElement(c.default,{menuItems:[{label:"Copy plaintext",onClick:()=>{const H=p==null?void 0:p.current;H&&(0,s.default)(H.textContent||"",{format:"text/plain"})}},{label:"Copy HTML",onClick:()=>{const H=p==null?void 0:p.current;H&&(0,s.default)(H.outerHTML,{format:"text/html"})}},{label:"Download plaintext",onClick:()=>{const H=p==null?void 0:p.current;H&&(0,a.saveAs)(new Blob([H.textContent||""],{type:"text/plain;charset=utf-8"}),"sequence.txt")}},{label:"Download HTML",onClick:()=>{const H=p==null?void 0:p.current;H&&(0,a.saveAs)(new Blob([H.outerHTML||""],{type:"text/html;charset=utf-8"}),"sequence.html")}},...b,{label:"Show coordinates?",type:"subMenu",subMenu:[{label:"No coordinates",type:"radio",checked:D==="none",onClick:()=>{C.setShowCoordinates("none")}},{label:"Coordinates relative to feature start",type:"radio",checked:D==="relative",onClick:()=>{C.setShowCoordinates("relative")}},...E?[{label:"Coordinates relative to genome (only available for continuous genome based sequence types)",type:"radio",checked:D==="genomic",onClick:()=>{C.setShowCoordinates("genomic")}}]:[]]},{label:"Settings",icon:d.default,onClick:()=>{x(!0)}}]},o.default.createElement(u.default,null)),S?o.default.createElement(f,{model:C,handleClose:()=>{x(!1)}}):null)}));return po.default=g,po}var bo={},Yl;function Pi(){if(Yl)return bo;Yl=1;var e=Y&&Y.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(bo,"__esModule",{value:!0});const t=e(i),n=Dt,r=dt,l=(0,It.makeStyles)()({formControl:{margin:0,marginLeft:4}}),s=(0,r.observer)(function({model:a}){const{classes:c}=l(),{intronBp:u,upDownBp:d,mode:f,hasCDS:g,hasExonOrCDS:m}=a;return t.default.createElement(n.FormControl,{className:c.formControl},t.default.createElement(n.Select,{size:"small",value:f,onChange:C=>{a.setMode(C.target.value)}},Object.entries({...g?{cds:"CDS"}:{},...g?{protein:"Protein"}:{},...m?{cdna:"cDNA"}:{},...m?{gene:"Genomic w/ full introns"}:{},...m?{gene_updownstream:`Genomic w/ full introns +/- ${d}bp up+down stream`}:{},...m?{gene_collapsed_intron:`Genomic w/ ${u}bp intron`}:{},...m?{gene_updownstream_collapsed_intron:`Genomic w/ ${u}bp intron +/- ${d}bp up+down stream `}:{},...m?{}:{genomic:"Genomic"},...m?{}:{genomic_sequence_updownstream:`Genomic +/- ${d}bp up+down stream`}}).map(([C,b])=>t.default.createElement(n.MenuItem,{key:C,value:C},b))))});return bo.default=s,bo}var wo={},Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.stitch=Nd;Mt.dedupe=Bd;Mt.revlist=Ud;Mt.calculateUTRs=Wd;Mt.calculateUTRs2=qd;Mt.ellipses=Kd;function Nd(e,t){return e.map(n=>t.slice(n.start,n.end)).join("")}function Ql(e){return`${e.start}-${e.end}`}function Bd(e){return e.filter((t,n,r)=>!n||Ql(t)!==Ql(r[n-1]))}function Ud(e,t){return e.map(n=>({...n,start:t-n.end,end:t-n.start})).sort((n,r)=>n.start-r.start)}function Wd(e,t){if(!e.length)return[];const n=e.at(0),r=e.at(-1),o=t.findIndex(d=>d.end>=n.start&&d.start<=n.start),l=t.findIndex(d=>d.end>=r.end&&d.start<=r.end),s=t[l],a=t[o],c=[...t.slice(0,o),{start:a.start,end:n.start}].map(d=>({...d,type:"five_prime_UTR"})),u=[{start:r.end,end:s.end},...t.slice(l+1)].map(d=>({...d,type:"three_prime_UTR"}));return[...c,...u]}function qd(e,t){if(!e.length)return[];const n=e.at(0),r=e.at(-1),o=[{start:t.start,end:n.start}].map(s=>({...s,type:"five_prime_UTR"})),l=[{start:r.end,end:t.end}].map(s=>({...s,type:"three_prime_UTR"}));return[...o,...l]}function Kd(e){return e.length>20?`${e.slice(0,20)}...`:e}var So={},Qe={},Jl;function Xo(){if(Jl)return Qe;Jl=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.genomeColor=Qe.updownstreamColor=Qe.cdsColor=Qe.proteinColor=Qe.utrColor=Qe.intronColor=void 0,Qe.splitString=e,Qe.intronColor=void 0,Qe.utrColor="rgb(200,240,240)",Qe.proteinColor="rgb(220,160,220)",Qe.cdsColor="rgb(220,220,180)",Qe.updownstreamColor="rgba(250,200,200)",Qe.genomeColor="rgb(200,280,200)";function e({str:t,charactersPerRow:n,showCoordinates:r,currRemainder:o=0,splitSize:l=10}){var s;const a=Math.ceil(t.length/n),c=new Array(a);let u=o%10,d=0,f=0;for(;d{var C;const b=c-l%d,p=m===0&&l%d===0||m>0?`${`${b+m*a*d}`.padStart(4)} `:"",S=m===o.length-1&&(((C=o.at(-1))===null||C===void 0?void 0:C.replaceAll(" ","").length)||0)+(m===0?l%d:0)!==d?null:f?` +`:"";return t.default.createElement(t.default.Fragment,{key:`${g}-${m}`},f?p:null,t.default.createElement("span",{style:{background:s}},g),S)})});return yo.default=r,yo}var es;function Xd(){if(es)return So;es=1;var e=Y&&Y.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(So,"__esModule",{value:!0});const t=e(i),n=dt,r=Xo(),o=e(Yo()),l=(0,n.observer)(function({utr:s,cds:a,exons:c,sequence:u,upstream:d,downstream:f,feature:g,includeIntrons:m,collapseIntron:C,model:b}){var p;const{upperCaseCDS:S,intronBp:x,charactersPerRow:D,showCoordinates:E,showCoordinatesSetting:H}=b,G=a.length>0,A=(a.length?[...a,...s].sort((T,R)=>T.start-R.start):c).filter(T=>T.start!==T.end),F=T=>S?T.toLowerCase():T,y=T=>S?T.toUpperCase():T,_=g.strand===-1?-1:1,$=H==="genomic"&&m&&!C,O=$?_:1;let P=$?_>0?g.start+1-((d==null?void 0:d.length)||0):g.end+((d==null?void 0:d.length)||0):0,L=0,I=0,M=null;if(d){const{segments:T,remainder:R}=(0,r.splitString)({str:F(d),charactersPerRow:D,showCoordinates:E});M=t.default.createElement(o.default,{model:b,color:r.updownstreamColor,strand:O,start:L,coordStart:P,chunks:T}),I=R,L=L+d.length*O,P=P+d.length*O}const w=[];for(let T=0;Tx*2?`${z.slice(0,x)}...${z.slice(-x)}`:z),{segments:q,remainder:te}=(0,r.splitString)({str:X,charactersPerRow:D,currRemainder:I,showCoordinates:E});q.length&&(w.push(t.default.createElement(o.default,{key:`${JSON.stringify(R)}-intron`,model:b,strand:O,coordStart:P,start:L,chunks:q})),I=te,L=L+X.length*O,P=P+X.length*O)}}let j=null;if(f){const{segments:T}=(0,r.splitString)({str:F(f),charactersPerRow:D,currRemainder:I,showCoordinates:E});j=t.default.createElement(o.default,{start:L,model:b,strand:O,chunks:T,coordStart:P,color:r.updownstreamColor})}return t.default.createElement(t.default.Fragment,null,M,w,j)});return So.default=l,So}var xo={},ts;function Yd(){if(ts)return xo;ts=1;var e=Y&&Y.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(xo,"__esModule",{value:!0});const t=e(i),n=dt,r=Mt,o=Xo(),l=e(Yo()),s=(0,n.observer)(function({cds:a,sequence:c,codonTable:u,model:d}){const{charactersPerRow:f,showCoordinates:g}=d,m=(0,r.stitch)(a,c);let C="";for(let p=0;p0?c.start+1-((a==null?void 0:a.length)||0):c.end+((a==null?void 0:a.length)||0):0;if(a){const{segments:y,remainder:_}=(0,r.splitString)({str:a,charactersPerRow:f,showCoordinates:m});b=t.default.createElement(o.default,{model:d,color:r.updownstreamColor,start:C,coordStart:E,chunks:y}),p=_,C=C+a.length*D,E=E+a.length*D}const{segments:H,remainder:G}=(0,r.splitString)({str:s,charactersPerRow:f,showCoordinates:m,currRemainder:p}),A=t.default.createElement(o.default,{model:d,color:r.genomeColor,start:C,coordStart:E,chunks:H});p=G,C+=s.length*D,E=E+s.length*D;let F=null;if(u){const{segments:y}=(0,r.splitString)({str:u,charactersPerRow:f,currRemainder:p,showCoordinates:m});F=t.default.createElement(o.default,{start:C,model:d,chunks:y,coordStart:E,color:r.updownstreamColor})}return t.default.createElement(t.default.Fragment,null,b,A,F)});return vo.default=l,vo}var Io={},os;function Jd(){if(os)return Io;os=1;var e=Y&&Y.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Io,"__esModule",{value:!0});const t=e(i),n=dt,r=Xo(),o=Mt,l=e(Yo()),s=(0,n.observer)(function({cds:a,sequence:c,model:u}){const{charactersPerRow:d,showCoordinates:f}=u,{segments:g}=(0,r.splitString)({str:(0,o.stitch)(a,c),charactersPerRow:d,showCoordinates:f});return t.default.createElement(l.default,{model:u,color:r.cdsColor,chunks:g,start:0})});return Io.default=s,Io}var rs;function Ei(){if(rs)return wo;rs=1;var e=Y&&Y.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(wo,"__esModule",{value:!0});const t=e(i),n=dt,r=rn(),o=Mt,l=e(Xd()),s=e(Yd()),a=e(Qd()),c=e(Jd());function u(m){return m===-1?"(-)":m===1?"(+)":""}function d({children:m}){return t.default.createElement("pre",{style:{fontFamily:"monospace",color:"black",fontSize:11}},m)}function f({children:m}){return t.default.createElement("div",{style:{fontFamily:"monospace",color:"black",fontSize:11,maxWidth:600,whiteSpace:"wrap",wordBreak:"break-all"}},m)}const g=(0,n.observer)(t.default.forwardRef(function(C,b){const{model:p,feature:S}=C,{showCoordinates:x,mode:D}=p;let{sequence:{seq:E,upstream:H="",downstream:G=""}}=C;const{subfeatures:A=[]}=S,F=A.sort((L,I)=>L.start-I.start).map(L=>({...L,start:L.start-S.start,end:L.end-S.start}));let y=(0,o.dedupe)(F.filter(L=>L.type==="CDS")),_=(0,o.dedupe)(F.filter(L=>{var I;return(I=L.type)===null||I===void 0?void 0:I.match(/utr/i)})),$=(0,o.dedupe)(F.filter(L=>L.type==="exon"));!_.length&&y.length&&$.length&&(_=(0,o.calculateUTRs)(y,$)),!_.length&&y.length&&!$.length&&(_=(0,o.calculateUTRs2)(y,{start:0,end:S.end-S.start,type:"gene"})),S.strand===-1&&([E,H,G]=[(0,r.revcom)(E),(0,r.revcom)(G),(0,r.revcom)(H)],y=(0,o.revlist)(y,E.length),$=(0,o.revlist)($,E.length),_=(0,o.revlist)(_,E.length));const O=(0,r.generateCodonTable)(r.defaultCodonTable),P=x?d:f;return t.default.createElement("div",{"data-testid":"sequence_panel",ref:b,style:{maxHeight:300,overflow:"auto"}},t.default.createElement(P,null,t.default.createElement("div",{style:{background:"white"}},`>${[`${S.name||S.id}-${D}`,`${S.refName}:${(0,r.toLocale)(S.start+1)}-${(0,r.toLocale)(S.end)}${u(S.strand)}`,D.endsWith("updownstream")?`+/- ${(0,r.toLocale)(p.upDownBp)} up/downstream bp`:""].filter(L=>!!L).join(" ")} +`),D==="genomic"?t.default.createElement(a.default,{feature:S,model:p,sequence:E}):D==="genomic_sequence_updownstream"?t.default.createElement(a.default,{model:p,feature:S,sequence:E,upstream:H,downstream:G}):D==="cds"?t.default.createElement(c.default,{model:p,cds:y,sequence:E}):D==="cdna"?t.default.createElement(l.default,{model:p,exons:$,feature:S,cds:y,utr:_,sequence:E}):D==="protein"?t.default.createElement(s.default,{model:p,cds:y,codonTable:O,sequence:E}):D==="gene"?t.default.createElement(l.default,{model:p,exons:$,feature:S,cds:y,utr:_,sequence:E,includeIntrons:!0}):D==="gene_collapsed_intron"?t.default.createElement(l.default,{model:p,exons:$,feature:S,cds:y,sequence:E,utr:_,includeIntrons:!0,collapseIntron:!0}):D==="gene_updownstream"?t.default.createElement(l.default,{model:p,exons:$,feature:S,cds:y,sequence:E,utr:_,upstream:H,downstream:G,includeIntrons:!0}):D==="gene_updownstream_collapsed_intron"?t.default.createElement(l.default,{model:p,exons:$,feature:S,cds:y,sequence:E,utr:_,upstream:H,downstream:G,includeIntrons:!0,collapseIntron:!0}):t.default.createElement("div",null,"Unknown type")))}));return wo.default=g,wo}var Mo={},ls;function Zd(){if(ls)return Mo;ls=1;var e=Y&&Y.__createBinding||(Object.create?function(b,p,S,x){x===void 0&&(x=S);var D=Object.getOwnPropertyDescriptor(p,S);(!D||("get"in D?!p.__esModule:D.writable||D.configurable))&&(D={enumerable:!0,get:function(){return p[S]}}),Object.defineProperty(b,x,D)}:function(b,p,S,x){x===void 0&&(x=S),b[x]=p[S]}),t=Y&&Y.__setModuleDefault||(Object.create?function(b,p){Object.defineProperty(b,"default",{enumerable:!0,value:p})}:function(b,p){b.default=p}),n=Y&&Y.__importStar||function(b){if(b&&b.__esModule)return b;var p={};if(b!=null)for(var S in b)S!=="default"&&Object.prototype.hasOwnProperty.call(b,S)&&e(p,b,S);return t(p,b),p},r=Y&&Y.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(Mo,"__esModule",{value:!0});const o=n(i),l=Dt,s=qt,a=It,c=dt,u=vi(),d=r(Ei()),f=r(Mi()),g=r(Pi()),m=(0,a.makeStyles)()({dialogContent:{width:"80em"},formControl:{margin:0,marginLeft:4}}),C=(0,c.observer)(function({handleClose:b,model:p,feature:S}){const{sequenceFeatureDetails:x}=p,{upDownBp:D}=x,{classes:E}=m(),H=(0,o.useRef)(null),[G,A]=(0,o.useState)(!1),{sequence:F,error:y}=(0,u.useFeatureSequence)(p,S,D,G);return o.default.createElement(s.Dialog,{maxWidth:"xl",open:!0,onClose:()=>{b()},title:"Sequence view"},o.default.createElement(l.DialogContent,{className:E.dialogContent},o.default.createElement("div",null,o.default.createElement(g.default,{model:x}),o.default.createElement(f.default,{ref:H,model:x})),o.default.createElement("div",null,S.type==="gene"?o.default.createElement(l.Typography,null,"Note: inspect subfeature sequences for protein/CDS computations"):null,y?o.default.createElement(s.ErrorMessage,{error:y}):F?"error"in F?o.default.createElement(o.default.Fragment,null,o.default.createElement(l.Typography,{color:"error"},F.error),o.default.createElement(l.Button,{variant:"contained",color:"inherit",onClick:()=>{A(!0)}},"Force load")):o.default.createElement(o.Suspense,{fallback:o.default.createElement(s.LoadingEllipses,null)},o.default.createElement(d.default,{ref:H,feature:S,sequence:F,model:x})):o.default.createElement(s.LoadingEllipses,null))),o.default.createElement(l.DialogActions,null,o.default.createElement(l.Button,{onClick:()=>{b()},variant:"contained"},"Close")))});return Mo.default=C,Mo}var ss;function ef(){if(ss)return mo;ss=1;var e=Y&&Y.__createBinding||(Object.create?function(C,b,p,S){S===void 0&&(S=p);var x=Object.getOwnPropertyDescriptor(b,p);(!x||("get"in x?!b.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return b[p]}}),Object.defineProperty(C,S,x)}:function(C,b,p,S){S===void 0&&(S=p),C[S]=b[p]}),t=Y&&Y.__setModuleDefault||(Object.create?function(C,b){Object.defineProperty(C,"default",{enumerable:!0,value:b})}:function(C,b){C.default=b}),n=Y&&Y.__importStar||function(C){if(C&&C.__esModule)return C;var b={};if(C!=null)for(var p in C)p!=="default"&&Object.prototype.hasOwnProperty.call(C,p)&&e(b,C,p);return t(b,C),b},r=Y&&Y.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(mo,"__esModule",{value:!0});const o=n(i),l=Dt,s=dt,a=vi(),c=qt,u=r(Mi()),d=r(Pi()),f=(0,o.lazy)(()=>Promise.resolve().then(()=>n(Ei()))),g=(0,o.lazy)(()=>Promise.resolve().then(()=>n(Zd()))),m=(0,s.observer)(function({model:C,feature:b}){const{sequenceFeatureDetails:p}=C,{upDownBp:S}=p,x=(0,o.useRef)(null),[D,E]=(0,o.useState)(!1),[H,G]=(0,o.useState)(!1),{sequence:A,error:F}=(0,a.useFeatureSequence)(C,b,S,H);return(0,o.useEffect)(()=>{p.setFeature(b)},[p,b]),o.default.createElement(o.default.Fragment,null,o.default.createElement("div",null,o.default.createElement(d.default,{model:p}),o.default.createElement(u.default,{ref:x,model:p,extraItems:[{label:"Open in dialog",onClick:()=>{setTimeout(()=>{E(!0)},1)}}]})),D?o.default.createElement("div",null,"Open in dialog...",o.default.createElement(o.Suspense,{fallback:o.default.createElement(c.LoadingEllipses,null)},o.default.createElement(g,{model:C,feature:b,handleClose:()=>{E(!1)}}))):o.default.createElement("div",null,b.type==="gene"?o.default.createElement(l.Typography,null,"Note: inspect subfeature sequences for protein/CDS computations"):null,F?o.default.createElement(c.ErrorMessage,{error:F}):A?"error"in A?o.default.createElement(o.default.Fragment,null,o.default.createElement(l.Typography,{color:"error"},A.error),o.default.createElement(l.Button,{variant:"contained",color:"inherit",onClick:()=>{G(!0)}},"Force load")):o.default.createElement(o.Suspense,{fallback:o.default.createElement(c.LoadingEllipses,null)},o.default.createElement(f,{ref:x,feature:b,sequence:A,model:p})):o.default.createElement(c.LoadingEllipses,null)))});return mo.default=m,mo}var Po={},is;function tf(){if(is)return Po;is=1;var e=Y&&Y.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Po,"__esModule",{value:!0}),Po.default=l;const t=e(i),n=Dt,r=qt,o=e(Ii);function l({handleClose:s}){return t.default.createElement(r.Dialog,{maxWidth:"xl",open:!0,onClose:()=>{s()},title:"Feature sequence panel help"},t.default.createElement(n.DialogContent,null,t.default.createElement(n.Typography,{paragraph:!0},'The "Feature sequence" panel shows the underlying genomic sequence for a given feature, fetched from the reference genome.'),t.default.createElement(n.Typography,null,"For gene features, this panel does special calculations to e.g. stitch together the coding sequence, the options are:"),t.default.createElement("ul",null,t.default.createElement("li",null,"CDS - shows the stitched together CDS sequences"),t.default.createElement("li",null,'Protein - the translated coding sequence, with the "standard" genetic code'),t.default.createElement("li",null,"cDNA - shows the 'copy DNA' of transcript, formed from exon sequences"),t.default.createElement("li",null,"Genomic w/ introns +/- Nbp up+down stream - the sequence underlying the entire gene including including introns, with UTR and CDS highlighted")),t.default.createElement(n.Typography,{paragraph:!0},"For other feature types, the options are:"),t.default.createElement("ul",null,t.default.createElement("li",null,"Genomic +/- Nbp up+down stream - the reference genome sequence underlying the feature, with the up and downstream sequence")),t.default.createElement(n.Typography,null,'Note 1: you can use the "gear icon" ',t.default.createElement(o.default,null)," to edit the number of bp displayed up/downstream and in the intron region"),t.default.createElement(n.Typography,null,"Note 2: The 'Copy HTML' function retains the colors from the sequence panel but cannot be pasted into some programs like notepad that only expect plain text.")),t.default.createElement(n.DialogActions,null,t.default.createElement(n.Button,{onClick:()=>{s()},autoFocus:!0,variant:"contained"},"Close")))}return Po}var nf=Y&&Y.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),of=Y&&Y.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Jr=Y&&Y.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&nf(t,e,n);return of(t,e),t},rf=Y&&Y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qr,"__esModule",{value:!0});const gt=Jr(i),gr=Dt,lf=dt,sf=It,af=qt,cf=rn(),uf=rf(jd),df=(0,gt.lazy)(()=>Promise.resolve().then(()=>Jr(ef()))),ff=(0,gt.lazy)(()=>Promise.resolve().then(()=>Jr(tf()))),gf=(0,sf.makeStyles)()(e=>({formControl:{margin:0},container:{marginTop:e.spacing(4),marginBottom:e.spacing(4)}})),mf=(0,lf.observer)(function({model:e,feature:t}){const{classes:n}=gf(),[r,o]=(0,gt.useState)(!1);return gt.default.createElement("div",{className:n.container},gt.default.createElement(gr.FormControl,{className:n.formControl},gt.default.createElement(gr.Button,{variant:"contained",onClick:()=>{o(!r)}},r?"Hide feature sequence":"Show feature sequence")),gt.default.createElement(gr.IconButton,{onClick:()=>{(0,cf.getSession)(e).queueDialog(l=>[ff,{handleClose:l}])}},gt.default.createElement(uf.default,null)),r?gt.default.createElement(gt.Suspense,{fallback:gt.default.createElement(af.LoadingEllipses,null)},gt.default.createElement(df,{key:t.uniqueId,model:e,feature:t})):null)});Qr.default=mf;(function(e){var t=Y&&Y.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=Qr;Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t(n).default}})})(xi);var Qo={},Fn={},hf=Y&&Y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.default=wf;const mr=hf(i),pf=Dt,Cf=It,bf=(0,Cf.makeStyles)()(e=>({fieldDescription:{"&:hover":{background:e.palette.mode==="dark"?"#e65100":"yellow"}},fieldName:{wordBreak:"break-all",minWidth:90,borderBottom:"1px solid #0003",fontSize:12,background:e.palette.action.disabledBackground,marginRight:e.spacing(1),padding:e.spacing(.5)}}));function wf({description:e,name:t,width:n,prefix:r=[]}){const{classes:o,cx:l}=bf(),s=[...r,t].join(".");return e?mr.default.createElement(pf.Tooltip,{title:e,placement:"left"},mr.default.createElement("div",{className:l(o.fieldDescription,o.fieldName)},s)):mr.default.createElement("div",{className:o.fieldName,style:{width:n}},s)}var Xn={},Fi=Y&&Y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.default=Mf;const Eo=Fi(i),Sf=It,yf=Fi(Wo),xf=Dt,vf=qt,If=(0,Sf.makeStyles)()(e=>({fieldValue:{wordBreak:"break-word",maxHeight:300,fontSize:12,padding:e.spacing(.5),overflow:"auto"}}));function Mf({value:e}){const{classes:t}=If(),n=/^https?:\/\//.exec(`${e}`);return Eo.default.createElement("div",{className:t.fieldValue},Eo.default.isValidElement(e)?e:n?Eo.default.createElement(xf.Link,{href:`${e}`},`${e}`):Eo.default.createElement(vf.SanitizedHTML,{html:(0,yf.default)(e)?JSON.stringify(e):String(e)}))}var Zr=Y&&Y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qo,"__esModule",{value:!0});Qo.default=Df;const hr=Zr(i),Pf=It,Ef=Zr(Fn),Ff=Zr(Xn),kf=(0,Pf.makeStyles)()({field:{display:"flex",flexWrap:"wrap"}});function Df({name:e,value:t,description:n,prefix:r,width:o}){const{classes:l}=kf();return t!=null?hr.default.createElement("div",{className:l.field},hr.default.createElement(Ef.default,{prefix:r,description:n,name:e,width:o}),hr.default.createElement(Ff.default,{value:t})):null}var Fo={},ln={},Tf=Y&&Y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ln,"__esModule",{value:!0});ln.isEmpty=Hf;ln.generateTitle=_f;ln.generateMaxWidth=Lf;ln.accessNested=Gf;const as=Tf(Wo),cs=rn(),Of=Mt;function Hf(e){return Object.keys(e).length===0}function _f(e,t,n){return[(0,Of.ellipses)(`${e||t||""}`),`${n}`].filter(r=>!!r).join(" - ")}function Lf(e,t){return Math.ceil((0,cs.max)(e.map(n=>(0,cs.measureText)([...t,n[0]].join("."),12))))+10}function Gf(e,t={}){let n=t;return e.forEach(r=>{(0,as.default)(n)&&(n=n[r])}),typeof n=="string"?n:(0,as.default)(n)&&typeof n.Description=="string"?n.Description:void 0}var el={};const tl=i.createContext(void 0);function ie(){const e=i.useContext(tl);if(e===void 0)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(` +`));return e}const Rf=()=>i.useRef({}),ki=i.createContext(void 0),Z=()=>{const e=i.useContext(ki);if(!e)throw new Error("MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e};function de(e,t,n=void 0){const r={};return Object.keys(e).forEach(o=>{r[o]=e[o].reduce((l,s)=>{if(s){const a=t(s);a!==""&&l.push(a),n&&n[s]&&l.push(n[s])}return l},[]).join(" ")}),r}function $f(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n{e.apply(this,o)};clearTimeout(n),n=setTimeout(l,t)}return r.clear=()=>{clearTimeout(n)},r}function Nt(e){return e&&e.ownerDocument||document}function Af(e){return Nt(e).defaultView||window}function jf(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const Ye=typeof window<"u"?i.useLayoutEffect:i.useEffect;let us=0;function zf(e){const[t,n]=i.useState(e),r=t;return i.useEffect(()=>{t==null&&(us+=1,n(`mui-${us}`))},[t]),r}const ds=sd.useId;function _e(e){return ds!==void 0?ds():zf(e)}function Re(e){const t=i.useRef(e);return Ye(()=>{t.current=e}),i.useRef((...n)=>(0,t.current)(...n)).current}function Gt(...e){return i.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{jf(n,t)})},e)}const fs={};function Xt(e,t){const n=i.useRef(fs);return n.current===fs&&(n.current=e(t)),n}const Vf=[];function Yn(e){i.useEffect(e,Vf)}class nl{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new nl}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function Dn(){const e=Xt(nl.create).current;return Yn(e.disposeEffect),e}const gs=e=>e,Nf=()=>{let e=gs;return{configure(t){e=t},generate(t){return e(t)},reset(){e=gs}}},Bf=Nf(),Uf={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Ti(e,t,n="Mui"){const r=Uf[t];return r?`${n}-${r}`:`${Bf.generate(e)}-${t}`}function Oi(e,t,n="Mui"){const r={};return t.forEach(o=>{r[o]=Ti(e,o,n)}),r}const Wf=Object.is;function Hi(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(const o in e)if(n+=1,!Wf(e[o],t[o])||!(o in t))return!1;for(const o in t)r+=1;return n===r}function Yt(e){return i.memo(e,Hi)}const qf=!1,_i={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",toolbarDensity:"Density",toolbarDensityLabel:"Density",toolbarDensityCompact:"Compact",toolbarDensityStandard:"Standard",toolbarDensityComfortable:"Comfortable",toolbarColumns:"Columns",toolbarColumnsLabel:"Select columns",toolbarFilters:"Filters",toolbarFiltersLabel:"Show filters",toolbarFiltersTooltipHide:"Hide filters",toolbarFiltersTooltipShow:"Show filters",toolbarFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,toolbarQuickFilterPlaceholder:"Search…",toolbarQuickFilterLabel:"Search",toolbarQuickFilterDeleteIconLabel:"Clear",toolbarExport:"Export",toolbarExportLabel:"Export",toolbarExportCSV:"Download as CSV",toolbarExportPrint:"Print",toolbarExportExcel:"Download as Excel",columnsManagementSearchTitle:"Search",columnsManagementNoColumns:"No columns",columnsManagementShowHideAllText:"Show/Hide All",columnsManagementReset:"Reset",filterPanelAddFilter:"Add filter",filterPanelRemoveAll:"Remove all",filterPanelDeleteIconLabel:"Delete",filterPanelLogicOperator:"Logic operator",filterPanelOperator:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorDoesNotContain:"does not contain",filterOperatorEquals:"equals",filterOperatorDoesNotEqual:"does not equal",filterOperatorStartsWith:"starts with",filterOperatorEndsWith:"ends with",filterOperatorIs:"is",filterOperatorNot:"is not",filterOperatorAfter:"is after",filterOperatorOnOrAfter:"is on or after",filterOperatorBefore:"is before",filterOperatorOnOrBefore:"is on or before",filterOperatorIsEmpty:"is empty",filterOperatorIsNotEmpty:"is not empty",filterOperatorIsAnyOf:"is any of","filterOperator=":"=","filterOperator!=":"!=","filterOperator>":">","filterOperator>=":">=","filterOperator<":"<","filterOperator<=":"<=",headerFilterOperatorContains:"Contains",headerFilterOperatorDoesNotContain:"Does not contain",headerFilterOperatorEquals:"Equals",headerFilterOperatorDoesNotEqual:"Does not equal",headerFilterOperatorStartsWith:"Starts with",headerFilterOperatorEndsWith:"Ends with",headerFilterOperatorIs:"Is",headerFilterOperatorNot:"Is not",headerFilterOperatorAfter:"Is after",headerFilterOperatorOnOrAfter:"Is on or after",headerFilterOperatorBefore:"Is before",headerFilterOperatorOnOrBefore:"Is on or before",headerFilterOperatorIsEmpty:"Is empty",headerFilterOperatorIsNotEmpty:"Is not empty",headerFilterOperatorIsAnyOf:"Is any of","headerFilterOperator=":"Equals","headerFilterOperator!=":"Not equals","headerFilterOperator>":"Greater than","headerFilterOperator>=":"Greater than or equal to","headerFilterOperator<":"Less than","headerFilterOperator<=":"Less than or equal to",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuShowColumns:"Show columns",columnMenuManageColumns:"Manage columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide column",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnHeaderFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:e=>e!==1?`${e.toLocaleString()} rows selected`:`${e.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(e,t)=>`${e.toLocaleString()} of ${t.toLocaleString()}`,checkboxSelectionHeaderName:"Checkbox selection",checkboxSelectionSelectAllRows:"Select all rows",checkboxSelectionUnselectAllRows:"Unselect all rows",checkboxSelectionSelectRow:"Select row",checkboxSelectionUnselectRow:"Unselect row",booleanCellTrueLabel:"yes",booleanCellFalseLabel:"no",actionsCellMore:"more",pinToLeft:"Pin to left",pinToRight:"Pin to right",unpin:"Unpin",treeDataGroupingHeaderName:"Group",treeDataExpand:"see children",treeDataCollapse:"hide children",groupingColumnHeaderName:"Group",groupColumn:e=>`Group by ${e}`,unGroupColumn:e=>`Stop grouping by ${e}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",MuiTablePagination:{},rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size"};function ue(e){return Ti("MuiDataGrid",e)}const k=Oi("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","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","scrollbar","scrollbar--vertical","scrollbar--horizontal","scrollbarFiller","scrollbarFiller--header","scrollbarFiller--borderTop","scrollbarFiller--borderBottom","scrollbarFiller--pinnedRight","selectedRowCount","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","pinnedRows","pinnedRows--top","pinnedRows--bottom","pinnedRowsRenderZone"]),ms=1e3;class Kf{constructor(t=ms){this.timeouts=new Map,this.cleanupTimeout=ms,this.cleanupTimeout=t}register(t,n,r){this.timeouts||(this.timeouts=new Map);const o=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,o)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class Xf{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,n,r){this.registry.register(t,n,r)}unregister(t){this.registry.unregister(t)}reset(){}}var ht=function(e){return e.DataGrid="DataGrid",e.DataGridPro="DataGridPro",e.DataGridPremium="DataGridPremium",e}(ht||{});class Yf{}function Li(e){let t=0;return function(r,o,l,s){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new Xf:new Kf);const[a]=i.useState(new Yf),c=i.useRef(null),u=i.useRef();u.current=l;const d=i.useRef(null);if(!c.current&&u.current){const f=(g,m,C)=>{var b;m.defaultMuiPrevented||(b=u.current)==null||b.call(u,g,m,C)};c.current=r.current.subscribeEvent(o,f,s),t+=1,d.current={cleanupToken:t},e.registry.register(a,()=>{var g;(g=c.current)==null||g.call(c),c.current=null,d.current=null},d.current)}else!u.current&&c.current&&(c.current(),c.current=null,d.current&&(e.registry.unregister(d.current),d.current=null));i.useEffect(()=>{if(!c.current&&u.current){const f=(g,m,C)=>{var b;m.defaultMuiPrevented||(b=u.current)==null||b.call(u,g,m,C)};c.current=r.current.subscribeEvent(o,f,s)}return d.current&&e.registry&&(e.registry.unregister(d.current),d.current=null),()=>{var f;(f=c.current)==null||f.call(c),c.current=null}},[r,o,s])}}const Fr={registry:null},Qf=()=>{var e;(e=Fr.registry)==null||e.reset(),Fr.registry=null},ee=Li(Fr),Jf={isFirst:!0};function De(e,t,n){ee(e,t,n,Jf)}function Zf(e){return e.acceptsApiRef}function hs(e,t){return Zf(t)?t(e):t(e.current.state)}const eg=Object.is,Gi=Hi,tg=()=>({state:null,equals:null,selector:null}),U=(e,t,n=eg)=>{const r=Xt(tg),o=r.current.selector!==null,[l,s]=i.useState(o?null:hs(e,t));return r.current.state=l,r.current.equals=n,r.current.selector=t,Yn(()=>e.current.store.subscribe(()=>{const a=hs(e,r.current.selector);r.current.equals(r.current.state,a)||(r.current.state=a,s(a))})),l},nt=e=>e.dimensions;var Go=Symbol("NOT_FOUND");function ng(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function og(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function rg(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var ps=e=>Array.isArray(e)?e:[e];function lg(e){const t=Array.isArray(e[0])?e[0]:e;return rg(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function sg(e,t){const n=[],{length:r}=e;for(let o=0;ot(a,u.key));if(c>-1){const u=n[c];return c>0&&(n.splice(c,1),n.unshift(u)),u.value}return Go}function o(a,c){r(a)===Go&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function l(){return n}function s(){n=[]}return{get:r,put:o,getEntries:l,clear:s}}var cg=(e,t)=>e===t;function ug(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let l=0;ll(m.value,d));g&&(d=g.value,a!==0&&a--)}c.put(arguments,d)}return d}return u.clearCache=()=>{c.clear(),u.resetResultsCount()},u.resultsCount=()=>a,u.resetResultsCount=()=>{a=0},u}var dg=class{constructor(e){this.value=e}deref(){return this.value}},fg=typeof WeakRef<"u"?WeakRef:dg,gg=0,Cs=1;function ko(){return{s:gg,v:void 0,o:null,p:null}}function $i(e,t={}){let n=ko();const{resultEqualityCheck:r}=t;let o,l=0;function s(){var f;let a=n;const{length:c}=arguments;for(let g=0,m=c;g{n=ko(),s.resetResultsCount()},s.resultsCount=()=>l,s.resetResultsCount=()=>{l=0},s}function Ai(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let l=0,s=0,a,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),ng(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const d={...n,...c},{memoize:f,memoizeOptions:g=[],argsMemoize:m=$i,argsMemoizeOptions:C=[],devModeChecks:b={}}=d,p=ps(g),S=ps(C),x=lg(o),D=f(function(){return l++,u.apply(null,arguments)},...p),E=m(function(){s++;const G=sg(x,arguments);return a=D.apply(null,G),a},...S);return Object.assign(E,{resultFunc:u,memoizedResultFunc:D,dependencies:x,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>a,recomputations:()=>l,resetRecomputations:()=>{l=0},memoize:f,argsMemoize:m})};return Object.assign(r,{withTypes:()=>r}),r}var mg=Ai($i),hg=Object.assign((e,t=mg)=>{og(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(l=>e[l]);return t(r,(...l)=>l.reduce((s,a,c)=>(s[n[c]]=a,s),{}))},{withTypes:()=>hg});const pg=Ai({memoize:Ri,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),bs=new WeakMap;function Cn(e){return"current"in e&&"instanceId"in e.current}const bn={id:"default"},re=(e,t,n,r,o,l,...s)=>{if(s.length>0)throw new Error("Unsupported number of selectors");let a;if(e&&t&&n&&r&&o&&l)a=(c,u)=>{const d=Cn(c),f=u??(d?c.current.instanceId:bn),g=d?c.current.state:c,m=e(g,f),C=t(g,f),b=n(g,f),p=r(g,f),S=o(g,f);return l(m,C,b,p,S)};else if(e&&t&&n&&r&&o)a=(c,u)=>{const d=Cn(c),f=u??(d?c.current.instanceId:bn),g=d?c.current.state:c,m=e(g,f),C=t(g,f),b=n(g,f),p=r(g,f);return o(m,C,b,p)};else if(e&&t&&n&&r)a=(c,u)=>{const d=Cn(c),f=u??(d?c.current.instanceId:bn),g=d?c.current.state:c,m=e(g,f),C=t(g,f),b=n(g,f);return r(m,C,b)};else if(e&&t&&n)a=(c,u)=>{const d=Cn(c),f=u??(d?c.current.instanceId:bn),g=d?c.current.state:c,m=e(g,f),C=t(g,f);return n(m,C)};else if(e&&t)a=(c,u)=>{const d=Cn(c),f=u??(d?c.current.instanceId:bn),g=d?c.current.state:c,m=e(g,f);return t(m)};else throw new Error("Missing arguments");return a.acceptsApiRef=!0,a},Pe=(...e)=>{const t=(n,r)=>{const o=Cn(n),l=o?n.current.instanceId:r??bn,s=o?n.current.state:n,a=bs.get(l),c=a??new Map,u=c==null?void 0:c.get(e);if(c&&u)return u(s,l);const d=pg(...e);return a||bs.set(l,c),c.set(e,d),d(s,l)};return t.acceptsApiRef=!0,t},ji=.7,zi=1.3,Cg={compact:ji,comfortable:zi,standard:1},zt=e=>e.density,Tn=re(zt,e=>Cg[e]);let Me=function(e){return e.LEFT="left",e.RIGHT="right",e}({});const Ro={left:[],right:[]},bg=e=>e.isRtl,xt=e=>e.columns,kt=re(xt,e=>e.orderedFields),Pt=re(xt,e=>e.lookup),pt=Pe(kt,Pt,(e,t)=>e.map(n=>t[n])),ut=re(xt,e=>e.columnVisibilityModel),Ne=Pe(pt,ut,(e,t)=>e.filter(n=>t[n.field]!==!1)),sn=Pe(Ne,e=>e.map(t=>t.field)),Vi=e=>e.pinnedColumns,On=Pe(xt,Vi,sn,bg,(e,t,n,r)=>{const o=wg(t,n,r);return{left:o.left.map(s=>e.lookup[s]),right:o.right.map(s=>e.lookup[s])}});function wg(e,t,n){var a,c;if(!Array.isArray(e.left)&&!Array.isArray(e.right)||((a=e.left)==null?void 0:a.length)===0&&((c=e.right)==null?void 0:c.length)===0)return Ro;const r=(u,d)=>Array.isArray(u)?u.filter(f=>d.includes(f)):[],o=r(e.left,t),l=t.filter(u=>!o.includes(u)),s=r(e.right,l);return n?{left:s,right:o}:{left:o,right:s}}const Rt=Pe(Ne,e=>{const t=[];let n=0;for(let r=0;r{const n=e.length;return n===0?0:t[n-1]+e[n-1].computedWidth}),ol=Pe(pt,e=>e.filter(t=>t.filterable)),Ni=Pe(pt,e=>e.reduce((t,n)=>(n.filterable&&(t[n.field]=n),t),{})),Bi=Pe(pt,e=>e.some(t=>t.colSpan!==void 0)),Sg=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange"],yg=e=>{const{classes:t}=e;return de({root:["editInputCell"]},ue,t)},xg=je(mi,{name:"MuiDataGrid",slot:"EditInputCell",overridesResolver:(e,t)=>t.editInputCell})(({theme:e})=>h({},e.typography.body2,{padding:"1px 0","& input":{padding:"0 16px",height:"100%"}})),Ui=i.forwardRef((e,t)=>{const n=Z(),{id:r,value:o,field:l,colDef:s,hasFocus:a,debounceMs:c=200,isProcessingProps:u,onValueChange:d}=e,f=ne(e,Sg),g=ie(),m=i.useRef(),[C,b]=i.useState(o),p=yg(n),S=i.useCallback(async D=>{const E=D.target.value;d&&await d(D,E);const H=g.current.getColumn(l);let G=E;H.valueParser&&(G=H.valueParser(E,g.current.getRow(r),H,g)),b(G),g.current.setEditCellValue({id:r,field:l,value:G,debounceMs:c,unstable_skipValueParser:!0},D)},[g,c,l,r,d]),x=g.current.unstable_getEditCellMeta(r,l);return i.useEffect(()=>{(x==null?void 0:x.changeReason)!=="debouncedSetEditCellValue"&&b(o)},[x,o]),Ye(()=>{a&&m.current.focus()},[a]),v.jsx(xg,h({ref:t,inputRef:m,className:p.root,ownerState:n,fullWidth:!0,type:s.type==="number"?s.type:"text",value:C??"",onChange:S,endAdornment:u?v.jsx(n.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},f))}),Wi=e=>v.jsx(Ui,h({},e)),qi=(e,t)=>t&&e.length>1?[e[0]]:e,ws=(e,t)=>n=>h({},n,{sorting:h({},n.sorting,{sortModel:qi(e,t)})}),vg=e=>e==="desc",Ig=(e,t)=>{const n=t.current.getColumn(e.field);if(!n||e.sort===null)return null;let r;return n.getSortComparator?r=n.getSortComparator(e.sort):r=vg(e.sort)?(...l)=>-1*n.sortComparator(...l):n.sortComparator,r?{getSortCellParams:l=>({id:l,field:n.field,rowNode:t.current.getRowNode(l),value:t.current.getCellValue(l,n.field),api:t.current}),comparator:r}:null},Mg=(e,t,n)=>e.reduce((r,o,l)=>{if(r!==0)return r;const s=t.params[l],a=n.params[l];return r=o.comparator(s.value,a.value,s,a),r},0),Pg=(e,t)=>{const n=e.map(r=>Ig(r,t)).filter(r=>!!r);return n.length===0?null:r=>r.map(o=>({node:o,params:n.map(l=>l.getSortCellParams(o.id))})).sort((o,l)=>Mg(n,o,l)).map(o=>o.node.id)},Ss=(e,t)=>{const n=e.indexOf(t);return!t||n===-1||n+1===e.length?e[0]:e[n+1]},rl=(e,t)=>e==null&&t!=null?-1:t==null&&e!=null?1:e==null&&t==null?0:null,Eg=new Intl.Collator,Ki=(e,t)=>{const n=rl(e,t);return n!==null?n:typeof e=="string"?Eg.compare(e.toString(),t.toString()):e-t},ll=(e,t)=>{const n=rl(e,t);return n!==null?n:Number(e)-Number(t)},sl=(e,t)=>{const n=rl(e,t);return n!==null?n:e>t?1:e{const{value:G}=H.target;C(String(G)),p(!0),g.start(x.filterDebounceMs,()=>{const A=h({},t,{value:G,fromInput:S});n(A),p(!1)})},[S,n,t,x.filterDebounceMs,g]);return i.useEffect(()=>{(t.fromInput!==S||t.value===void 0)&&C(String(t.value??""))},[S,t]),v.jsx(x.slots.baseTextField,h({id:S,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),value:m,onChange:D,variant:d,type:r||"text",InputProps:h({},b||c?{endAdornment:b?v.jsx(x.slots.loadIcon,{fontSize:"small",color:"action"}):c}:{},{disabled:a},u,{inputProps:h({tabIndex:s},u==null?void 0:u.inputProps)}),InputLabelProps:{shrink:!0},inputRef:l},f,(E=x.slotProps)==null?void 0:E.baseTextField))}function kg(e){return typeof e=="number"&&!Number.isNaN(e)}function Xi(e){return typeof e=="function"}function il(e){return typeof e=="object"&&e!==null}function Dg(){try{const e="__some_random_key_you_are_not_going_to_use__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}function $o(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const Lt=(e,t,n)=>Math.max(t,Math.min(n,e));function ys(e,t){return Array.from({length:t-e}).map((n,r)=>e+r)}function Bt(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const o=e.length;if(o!==t.length)return!1;for(let l=0;l{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function Og(e){const t=Tg(e);return(n,r)=>n+(r-n)*t()}function Yi(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}const Hg=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],_g=["key"];function al(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:l,color:s,error:a,helperText:c,size:u,variant:d="standard"}=e,f=ne(e,Hg),g={color:s,error:a,helperText:c,size:u,variant:d},[m,C]=i.useState(t.value||[]),b=_e(),p=Z();i.useEffect(()=>{const x=t.value??[];C(x.map(String))},[t.value]);const S=i.useCallback((x,D)=>{C(D.map(String)),n(h({},t,{value:[...D]}))},[n,t]);return v.jsx(hi,h({multiple:!0,freeSolo:!0,options:[],filterOptions:(x,D)=>{const{inputValue:E}=D;return E==null||E===""?[]:[E]},id:b,value:m,onChange:S,renderTags:(x,D)=>x.map((E,H)=>{const G=D({index:H}),{key:A}=G,F=ne(G,_g);return v.jsx(p.slots.baseChip,h({variant:"outlined",size:"small",label:E},F),A)}),renderInput:x=>{var D;return v.jsx(p.slots.baseTextField,h({},x,{label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:h({},x.InputLabelProps,{shrink:!0}),inputRef:l,type:r||"text"},g,(D=p.slotProps)==null?void 0:D.baseTextField))}},f))}var vt=function(e){return e.Cell="cell",e.Row="row",e}(vt||{}),xe=function(e){return e.Edit="edit",e.View="view",e}(xe||{}),ke=function(e){return e.Edit="edit",e.View="view",e}(ke||{}),Ze=function(e){return e.And="and",e.Or="or",e}(Ze||{}),Ft=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e.pasteKeyDown="pasteKeyDown",e}(Ft||{}),mt=function(e){return e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(mt||{}),Ot=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e}(Ot||{}),St=function(e){return e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(St||{});function cl(e){return e.field!==void 0}const In=()=>({items:[],logicOperator:Ze.And,quickFilterValues:[],quickFilterLogicOperator:Ze.And});function Qi(e){return{current:e.current.getPublicApi()}}let Gn;function Lg(){if(Gn!==void 0)return Gn;try{Gn=new Function("return true")()}catch{Gn=!1}return Gn}const kr=(e,t)=>{const n=h({},e);if(n.id==null&&(n.id=Math.round(Math.random()*1e5)),n.operator==null){const r=Pt(t)[n.field];n.operator=r&&r.filterOperators[0].value}return n},ul=(e,t,n)=>{const r=e.items.length>1;let o;r&&t?o=[e.items[0]]:o=e.items;const l=r&&o.some(a=>a.id==null);return o.some(a=>a.operator==null)||l?h({},e,{items:o.map(a=>kr(a,n))}):e.items!==o?h({},e,{items:o}):e},xs=(e,t,n)=>r=>h({},r,{filterModel:ul(e,t,n)}),Nn=e=>typeof e=="string"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,Ji=(e,t)=>{var d;if(!e.field||!e.operator)return null;const n=t.current.getColumn(e.field);if(!n)return null;let r;if(n.valueParser){const f=n.valueParser;r=Array.isArray(e.value)?(d=e.value)==null?void 0:d.map(g=>f(g,void 0,n,t)):f(e.value,void 0,n,t)}else r=e.value;const{ignoreDiacritics:o}=t.current.rootProps;o&&(r=Nn(r));const l=h({},e,{value:r}),s=n.filterOperators;if(!(s!=null&&s.length))throw new Error(`MUI X: No filter operators found for column '${n.field}'.`);const a=s.find(f=>f.value===l.operator);if(!a)throw new Error(`MUI X: No filter operator found for column '${n.field}' and operator value '${l.operator}'.`);const c=Qi(t),u=a.getApplyFilterFn(l,n);return typeof u!="function"?null:{item:l,fn:f=>{let g=t.current.getRowValue(f,n);return o&&(g=Nn(g)),u(g,f,n,c)}}};let vs=1;const Gg=(e,t,n)=>{const{items:r}=e,o=r.map(a=>Ji(a,t)).filter(a=>!!a);if(o.length===0)return null;if(n||!Lg())return(a,c)=>{const u={};for(let d=0;d`const shouldApply${c} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(a.item.field)});`).join(` +`)} + +const result$$ = { +${o.map((a,c)=>` ${JSON.stringify(String(a.item.id))}: !shouldApply${c} ? false : appliers[${c}].fn(row),`).join(` +`)} +}; + +return result$$;`.replaceAll("$$",String(vs)));return vs+=1,(a,c)=>l(o,a,c)},Zi=e=>e.quickFilterExcludeHiddenColumns??!0,Rg=(e,t)=>{var a;const n=((a=e.quickFilterValues)==null?void 0:a.filter(Boolean))??[];if(n.length===0)return null;const r=Zi(e)?sn(t):kt(t),o=[],{ignoreDiacritics:l}=t.current.rootProps,s=Qi(t);return r.forEach(c=>{const u=t.current.getColumn(c),d=u==null?void 0:u.getApplyQuickFilterFn;d&&o.push({column:u,appliers:n.map(f=>{const g=l?Nn(f):f;return{fn:d(g,u,s)}})})}),function(u,d){const f={};e:for(let g=0;g{const r=Gg(e,t,n),o=Rg(e,t);return function(s,a,c){c.passingFilterItems=(r==null?void 0:r(s,a))??null,c.passingQuickFilterValues=(o==null?void 0:o(s,a))??null}},Is=e=>e!=null,Ag=(e,t,n)=>(e.cleanedFilterItems||(e.cleanedFilterItems=n.filter(r=>Ji(r,t)!==null)),e.cleanedFilterItems),jg=(e,t,n,r,o)=>{const l=Ag(o,r,n.items),s=e.filter(Is),a=t.filter(Is);if(s.length>0){const c=d=>s.some(f=>f[d.id]);if((n.logicOperator??In().logicOperator)===Ze.And){if(!l.every(c))return!1}else if(!l.some(c))return!1}if(a.length>0&&n.quickFilterValues!=null){const c=d=>a.some(f=>f[d]);if((n.quickFilterLogicOperator??In().quickFilterLogicOperator)===Ze.And){if(!n.quickFilterValues.every(c))return!1}else if(!n.quickFilterValues.some(c))return!1}return!0},ea=e=>{if(!e)return null;const t=new RegExp($o(e),"i");return(n,r,o,l)=>{let s=l.current.getRowFormattedValue(r,o);return l.current.ignoreDiacritics&&(s=Nn(s)),s!=null?t.test(s.toString()):!1}},Ms=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),o=new RegExp($o(r),"i");return l=>{if(l==null)return t;const s=o.test(String(l));return t?!s:s}},Ps=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),o=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return l=>{if(l==null)return t;const s=o.compare(r,l.toString())===0;return t?!s:s}},Es=e=>()=>t=>{const n=t===""||t==null;return e?!n:n},ta=(e=!1)=>[{value:"contains",getApplyFilterFn:Ms(e,!1),InputComponent:ct},{value:"doesNotContain",getApplyFilterFn:Ms(e,!0),InputComponent:ct},{value:"equals",getApplyFilterFn:Ps(e,!1),InputComponent:ct},{value:"doesNotEqual",getApplyFilterFn:Ps(e,!0),InputComponent:ct},{value:"startsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`^${$o(n)}.*$`,"i");return o=>o!=null?r.test(o.toString()):!1},InputComponent:ct},{value:"endsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`.*${$o(n)}$`,"i");return o=>o!=null?r.test(o.toString()):!1},InputComponent:ct},{value:"isEmpty",getApplyFilterFn:Es(!1),requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:Es(!0),requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:t=>{if(!Array.isArray(t.value)||t.value.length===0)return null;const n=e?t.value:t.value.map(o=>o.trim()),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return o=>o!=null?n.some(l=>r.compare(l,o.toString()||"")===0):!1},InputComponent:al}],Ct={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,editable:!1,sortComparator:Ki,type:"string",align:"left",filterOperators:ta(),renderEditCell:Wi,getApplyQuickFilterFn:ea},zg=["open","target","onClose","children","position","className","onExited"],Vg=e=>{const{classes:t}=e;return de({root:["menu"]},ue,t)},Ng=je(Kr,{name:"MuiDataGrid",slot:"Menu",overridesResolver:(e,t)=>t.menu})(({theme:e})=>({zIndex:e.zIndex.modal,[`& .${k.menuList}`]:{outline:0}})),Bg={"bottom-start":"top left","bottom-end":"top right"};function Qn(e){var b;const{open:t,target:n,onClose:r,children:o,position:l,className:s,onExited:a}=e,c=ne(e,zg),u=ie(),d=Z(),f=Vg(d),g=i.useRef(null);Ye(()=>{var p,S;t?g.current=document.activeElement instanceof HTMLElement?document.activeElement:null:((S=(p=g.current)==null?void 0:p.focus)==null||S.call(p),g.current=null)},[t]),i.useEffect(()=>{const p=t?"menuOpen":"menuClose";u.current.publishEvent(p,{target:n})},[u,t,n]);const m=p=>S=>{p&&p(),a&&a(S)},C=p=>{p.target&&(n===p.target||n!=null&&n.contains(p.target))||r(p)};return v.jsx(Ng,h({as:d.slots.basePopper,className:me(s,f.root),ownerState:d,open:t,anchorEl:n,transition:!0,placement:l},c,(b=d.slotProps)==null?void 0:b.basePopper,{children:({TransitionProps:p,placement:S})=>v.jsx(pi,{onClickAway:C,mouseEvent:"onMouseDown",children:v.jsx(id,h({},p,{style:{transformOrigin:Bg[S]},onExited:m(p==null?void 0:p.onExited),children:v.jsx(Ci,{children:o})}))})}))}const Ug=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","focusElementRef"],Wg=e=>typeof e.getActions=="function";function na(e){var I;const{colDef:t,id:n,hasFocus:r,tabIndex:o,position:l="bottom-end",focusElementRef:s}=e,a=ne(e,Ug),[c,u]=i.useState(-1),[d,f]=i.useState(!1),g=ie(),m=i.useRef(null),C=i.useRef(null),b=i.useRef(!1),p=i.useRef({}),S=Kt(),x=_e(),D=_e(),E=Z();if(!Wg(t))throw new Error("MUI X: Missing the `getActions` property in the `GridColDef`.");const H=t.getActions(g.current.getRowParams(n)),G=H.filter(M=>!M.props.showInMenu),A=H.filter(M=>M.props.showInMenu),F=G.length+(A.length?1:0);i.useLayoutEffect(()=>{r||Object.entries(p.current).forEach(([M,w])=>{w==null||w.stop({},()=>{delete p.current[M]})})},[r]),i.useEffect(()=>{if(c<0||!m.current||c>=m.current.children.length)return;m.current.children[c].focus({preventScroll:!0})},[c]),i.useEffect(()=>{r||(u(-1),b.current=!1)},[r]),i.useImperativeHandle(s,()=>({focus(){if(!b.current){const M=H.findIndex(w=>!w.props.disabled);u(M)}}}),[H]),i.useEffect(()=>{c>=F&&u(F-1)},[c,F]);const y=()=>{f(!0),u(F-1),b.current=!0},_=()=>{f(!1)},$=M=>w=>{p.current[M]=w},O=(M,w)=>j=>{u(M),b.current=!0,w&&w(j)},P=M=>{if(F<=1)return;const w=(T,R)=>{var B;if(T<0||T>H.length)return T;const N=(R==="left"?-1:1)*(S?-1:1);return(B=H[T+N])!=null&&B.props.disabled?w(T+N,R):T+N};let j=c;M.key==="ArrowRight"?j=w(c,"right"):M.key==="ArrowLeft"&&(j=w(c,"left")),!(j<0||j>=F)&&j!==c&&(M.preventDefault(),M.stopPropagation(),u(j))},L=M=>{M.key==="Tab"&&M.preventDefault(),["Tab","Escape"].includes(M.key)&&_()};return v.jsxs("div",h({role:"menu",ref:m,tabIndex:-1,className:k.actionsCell,onKeyDown:P},a,{children:[G.map((M,w)=>i.cloneElement(M,{key:w,touchRippleRef:$(w),onClick:O(w,M.props.onClick),tabIndex:c===w?o:-1})),A.length>0&&D&&v.jsx(E.slots.baseIconButton,h({ref:C,id:D,"aria-label":g.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":d,"aria-controls":d?x:void 0,role:"menuitem",size:"small",onClick:y,touchRippleRef:$(D),tabIndex:c===G.length?o:-1},(I=E.slotProps)==null?void 0:I.baseIconButton,{children:v.jsx(E.slots.moreActionsIcon,{fontSize:"small"})})),A.length>0&&v.jsx(Qn,{open:d,target:C.current,position:l,onClose:_,children:v.jsx(qo,{id:x,className:k.menuList,onKeyDown:L,"aria-labelledby":D,variant:"menu",autoFocusItem:!0,children:A.map((M,w)=>i.cloneElement(M,{key:w,closeMenu:_}))})})]}))}const oa=e=>v.jsx(na,h({},e)),Jn="actions",ra=h({},Ct,{sortable:!1,filterable:!1,aggregable:!1,width:100,display:"flex",align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:oa,getApplyQuickFilterFn:void 0}),wt=e=>e.rows,Zn=re(wt,e=>e.totalRowCount),la=re(wt,e=>e.loading),sa=re(wt,e=>e.totalTopLevelRowCount),_t=re(wt,e=>e.dataRowIdToModelLookup),Bn=re(wt,e=>e.dataRowIdToIdLookup),rt=re(wt,e=>e.tree),qg=re(wt,e=>e.groupsToFetch),ia=re(wt,e=>e.groupingName),Dr=re(wt,e=>e.treeDepths),eo=Pe(wt,e=>{const t=Object.entries(e.treeDepths);return t.length===0?1:t.filter(([,n])=>n>0).map(([n])=>Number(n)).sort((n,r)=>r-n)[0]+1}),An=re(wt,e=>e.dataRowIds),Kg=re(wt,e=>e==null?void 0:e.additionalRowGroups),an=Pe(Kg,e=>{var n,r;const t=e==null?void 0:e.pinnedRows;return{bottom:((n=t==null?void 0:t.bottom)==null?void 0:n.map(o=>({id:o.id,model:o.model??{}})))??[],top:((r=t==null?void 0:t.top)==null?void 0:r.map(o=>({id:o.id,model:o.model??{}})))??[]}}),Xg=re(an,e=>{var t,n;return(((t=e==null?void 0:e.top)==null?void 0:t.length)||0)+(((n=e==null?void 0:e.bottom)==null?void 0:n.length)||0)}),et="auto-generated-group-node-root",en=Symbol("mui.id_autogenerated"),Yg=()=>({type:"group",id:et,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null});function aa(e,t,n="A row was provided without id in the rows prop:"){if(e==null)throw new Error(["MUI X: The data grid component requires all rows to have a unique `id` property.","Alternatively, you can use the `getRowId` prop to specify a custom id for each row.",n,JSON.stringify(t)].join(` +`))}const Zo=(e,t,n)=>{const r=t?t(e):e.id;return aa(r,e,n),r},Oo=({rows:e,getRowId:t,loading:n,rowCount:r})=>{const o={type:"full",rows:[]},l={},s={};for(let a=0;a{const n=e[et];return Math.max(t,n.children.length+(n.footerId==null?0:1))},ua=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:r,previousTreeDepths:o,previousGroupsToFetch:l})=>{const s=e.current.caches.rows,{tree:a,treeDepths:c,dataRowIds:u,groupingName:d,groupsToFetch:f=[]}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:r,previousTreeDepths:o,updates:s.updates,dataRowIdToIdLookup:s.dataRowIdToIdLookup,dataRowIdToModelLookup:s.dataRowIdToModelLookup,previousGroupsToFetch:l}),g=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:a,treeDepths:c,dataRowIdToIdLookup:s.dataRowIdToIdLookup,dataRowIds:u,dataRowIdToModelLookup:s.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},h({},g,{totalRowCount:Math.max(t,g.dataRowIds.length),totalTopLevelRowCount:ca({tree:g.tree,rowCountProp:t}),groupingName:d,loading:n,groupsToFetch:f})},Qg=e=>en in e,Mn=e=>e.type==="skeletonRow"||e.type==="footer"||e.type==="group"&&e.isAutoGenerated||e.type==="pinnedRow"&&e.isAutoGenerated,dl=(e,t,n)=>{const r=e[t];if(r.type!=="group")return[];const o=[];for(let l=0;l{if(e.updates.type==="full")throw new Error("MUI X: Unable to prepare a partial update if a full update is not applied yet.");const o=new Map;n.forEach(d=>{const f=Zo(d,t,"A row was provided without id when calling updateRows():");o.has(f)?o.set(f,h({},o.get(f),d)):o.set(f,d)});const l={type:"partial",actions:{insert:[...e.updates.actions.insert??[]],modify:[...e.updates.actions.modify??[]],remove:[...e.updates.actions.remove??[]]},idToActionLookup:h({},e.updates.idToActionLookup),groupKeys:r},s=h({},e.dataRowIdToModelLookup),a=h({},e.dataRowIdToIdLookup),c={insert:{},modify:{},remove:{}};o.forEach((d,f)=>{const g=l.idToActionLookup[f];if(d._action==="delete"){if(g==="remove"||!s[f])return;g!=null&&(c[g][f]=!0),l.actions.remove.push(f),delete s[f],delete a[f];return}const m=s[f];if(m){g==="remove"?(c.remove[f]=!0,l.actions.modify.push(f)):g==null&&l.actions.modify.push(f),s[f]=h({},m,d);return}g==="remove"?(c.remove[f]=!0,l.actions.insert.push(f)):g==null&&l.actions.insert.push(f),s[f]=d,a[f]=f});const u=Object.keys(c);for(let d=0;d0&&(l.actions[f]=l.actions[f].filter(m=>!g[m]))}return{dataRowIdToModelLookup:s,dataRowIdToIdLookup:a,updates:l,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}};function Jg(e){var o,l;const t=an(e),n=((o=t==null?void 0:t.top)==null?void 0:o.reduce((s,a)=>(s+=e.current.unstable_getRowHeight(a.id),s),0))||0,r=((l=t==null?void 0:t.bottom)==null?void 0:l.reduce((s,a)=>(s+=e.current.unstable_getRowHeight(a.id),s),0))||0;return{top:n,bottom:r}}function da(e){return`var(--DataGrid-overlayHeight, ${2*nt(e.current.state).rowHeight}px)`}function ks(e,t,n){const r=[];return t.forEach(o=>{const l=Zo(o,n,"A row was provided without id when calling updateRows():"),s=e.current.getRowNode(l);if((s==null?void 0:s.type)==="pinnedRow"){const a=e.current.caches.pinnedRows,c=a.idLookup[l];c&&(a.idLookup[l]=h({},c,o))}else r.push(o)}),r}const Zg=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","hideDescendantCount"],em=e=>{const{classes:t}=e;return de({root:["booleanCell"]},ue,t)};function tm(e){const{value:t}=e,n=ne(e,Zg),r=ie(),o=Z(),l={classes:o.classes},s=em(l),a=i.useMemo(()=>t?o.slots.booleanCellTrueIcon:o.slots.booleanCellFalseIcon,[o.slots.booleanCellFalseIcon,o.slots.booleanCellTrueIcon,t]);return v.jsx(a,h({fontSize:"small",className:s.root,titleAccess:r.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!t},n))}const fa=i.memo(tm),ga=e=>e.field!=="__row_group_by_columns_group__"&&Mn(e.rowNode)?"":v.jsx(fa,h({},e)),nm=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"],om=e=>{const{classes:t}=e;return de({root:["editBooleanCell"]},ue,t)};function ma(e){var S;const{id:t,value:n,field:r,className:o,hasFocus:l,onValueChange:s}=e,a=ne(e,nm),c=ie(),u=i.useRef(null),d=_e(),[f,g]=i.useState(n),m=Z(),C={classes:m.classes},b=om(C),p=i.useCallback(async x=>{const D=x.target.checked;s&&await s(x,D),g(D),await c.current.setEditCellValue({id:t,field:r,value:D},x)},[c,r,t,s]);return i.useEffect(()=>{g(n)},[n]),Ye(()=>{l&&u.current.focus()},[l]),v.jsx("label",h({htmlFor:d,className:me(b.root,o)},a,{children:v.jsx(m.slots.baseCheckbox,h({id:d,inputRef:u,checked:!!f,onChange:p,size:"small"},(S=m.slotProps)==null?void 0:S.baseCheckbox))}))}const ha=e=>v.jsx(ma,h({},e)),rm=["item","applyValue","apiRef","focusElementRef","isFilterActive","clearButton","tabIndex","label","variant","InputLabelProps"],lm=je("div")({display:"flex",alignItems:"center",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function pa(e){var E,H,G;const{item:t,applyValue:n,apiRef:r,focusElementRef:o,clearButton:l,tabIndex:s,label:a,variant:c="standard"}=e,u=ne(e,rm),[d,f]=i.useState(t.value||""),g=Z(),m=_e(),C=_e(),b=((E=g.slotProps)==null?void 0:E.baseSelect)||{},p=b.native??!1,S=((H=g.slotProps)==null?void 0:H.baseSelectOption)||{},x=i.useCallback(A=>{const F=A.target.value;f(F),n(h({},t,{value:F}))},[n,t]);i.useEffect(()=>{f(t.value||"")},[t.value]);const D=a??r.current.getLocaleText("filterPanelInputLabel");return v.jsxs(lm,{children:[v.jsxs(g.slots.baseFormControl,{fullWidth:!0,children:[v.jsx(g.slots.baseInputLabel,h({},(G=g.slotProps)==null?void 0:G.baseInputLabel,{id:m,shrink:!0,variant:c,children:D})),v.jsxs(g.slots.baseSelect,h({labelId:m,id:C,label:D,value:d,onChange:x,variant:c,notched:c==="outlined"?!0:void 0,native:p,displayEmpty:!0,inputProps:{ref:o,tabIndex:s}},u,b,{children:[v.jsx(g.slots.baseSelectOption,h({},S,{native:p,value:"",children:r.current.getLocaleText("filterValueAny")})),v.jsx(g.slots.baseSelectOption,h({},S,{native:p,value:"true",children:r.current.getLocaleText("filterValueTrue")})),v.jsx(g.slots.baseSelectOption,h({},S,{native:p,value:"false",children:r.current.getLocaleText("filterValueFalse")}))]}))]}),l]})}const Ca=()=>[{value:"is",getApplyFilterFn:e=>{if(!e.value)return null;const t=String(e.value)==="true";return n=>!!n===t},InputComponent:pa}],sm=(e,t,n,r)=>e?r.current.getLocaleText("booleanCellTrueLabel"):r.current.getLocaleText("booleanCellFalseLabel"),im=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}},fl=h({},Ct,{type:"boolean",display:"flex",align:"center",headerAlign:"center",renderCell:ga,renderEditCell:ha,sortComparator:ll,valueFormatter:sm,filterOperators:Ca(),getApplyQuickFilterFn:void 0,aggregable:!1,pastedValueParser:e=>im(e)}),am=["field","id","value","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],cm=e=>{const{classes:t}=e;return de({root:["checkboxInput"]},ue,t)},ba=i.forwardRef(function(t,n){var H;const{field:r,id:o,value:l,rowNode:s,hasFocus:a,tabIndex:c}=t,u=ne(t,am),d=ie(),f=Z(),g={classes:f.classes},m=cm(g),C=i.useRef(null),b=i.useRef(null),p=Gt(C,n),S=G=>{const A={value:G.target.checked,id:o};d.current.publishEvent("rowSelectionCheckboxChange",A,G)};i.useLayoutEffect(()=>{if(c===0){const G=d.current.getCellElement(o,r);G&&(G.tabIndex=-1)}},[d,c,o,r]),i.useEffect(()=>{var G;if(a){const A=(G=C.current)==null?void 0:G.querySelector("input");A==null||A.focus({preventScroll:!0})}else b.current&&b.current.stop({})},[a]);const x=i.useCallback(G=>{G.key===" "&&G.stopPropagation()},[]);if(s.type==="footer"||s.type==="pinnedRow")return null;const D=d.current.isRowSelectable(o),E=d.current.getLocaleText(l?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return v.jsx(f.slots.baseCheckbox,h({ref:p,tabIndex:c,checked:l,onChange:S,className:m.root,inputProps:{"aria-label":E},onKeyDown:x,disabled:!D,touchRippleRef:b},(H=f.slotProps)==null?void 0:H.baseCheckbox,u))}),wa=ba;function gl(e){return e.signature===ht.DataGrid?e.checkboxSelection&&e.disableMultipleRowSelection!==!0:!e.disableMultipleRowSelection}const to=e=>e.focus,st=re(to,e=>e.cell),Sa=re(to,e=>e.columnHeader),um=re(to,e=>e.columnHeaderFilter),Un=re(to,e=>e.columnGroupHeader),no=e=>e.tabIndex,er=re(no,e=>e.cell),ml=re(no,e=>e.columnHeader),dm=re(no,e=>e.columnHeaderFilter),ya=re(no,e=>e.columnGroupHeader),it=e=>e.rowSelection,xa=re(it,e=>e.length),va=Pe(it,_t,(e,t)=>new Map(e.map(n=>[n,t[n]]))),Pn=Pe(it,e=>e.reduce((t,n)=>(t[n]=n,t),{})),Ia=e=>e.sorting,tr=re(Ia,e=>e.sortedRows),nr=Pe(tr,_t,rt,(e,t,n)=>e.reduce((r,o)=>{const l=t[o];l&&r.push({id:o,model:l});const s=n[o];return s&&Mn(s)&&r.push({id:o,model:{[en]:o}}),r},[])),at=re(Ia,e=>e.sortModel),Ma=Pe(at,e=>e.reduce((n,r,o)=>(n[r.field]={sortDirection:r.sort,sortIndex:e.length>1?o+1:void 0},n),{})),or=e=>e.filter,We=re(or,e=>e.filterModel),Pa=re(We,e=>e.quickFilterValues),Ea=e=>e.visibleRowsLookup,hl=re(or,e=>e.filteredRowsLookup);re(or,e=>e.filteredChildrenCountLookup);const fm=re(or,e=>e.filteredDescendantCountLookup),$t=Pe(Ea,nr,(e,t)=>t.filter(n=>e[n.id]!==!1)),tn=Pe($t,e=>e.map(t=>t.id)),pl=Pe(hl,nr,(e,t)=>t.filter(n=>e[n.id]!==!1)),Cl=Pe(pl,e=>e.map(t=>t.id));Pe(tn,rt,(e,t)=>{const n={};let r=0;return e.reduce((o,l)=>{const s=t[l];return n[s.depth]||(n[s.depth]=0),s.depth>r&&(n[s.depth]=0),r=s.depth,n[s.depth]+=1,o[l]=n[s.depth],o},{})});const bl=Pe($t,rt,eo,(e,t,n)=>n<2?e:e.filter(r=>{var o;return((o=t[r.id])==null?void 0:o.depth)===0})),rr=re($t,e=>e.length),lr=re(bl,e=>e.length),Fa=re(pl,e=>e.length),gm=re(Fa,lr,(e,t)=>e-t),wl=Pe(We,Pt,(e,t)=>{var n;return(n=e.items)==null?void 0:n.filter(r=>{var s,a;if(!r.field)return!1;const o=t[r.field];if(!(o!=null&&o.filterOperators)||((s=o==null?void 0:o.filterOperators)==null?void 0:s.length)===0)return!1;const l=o.filterOperators.find(c=>c.value===r.operator);return l?!l.InputComponent||r.value!=null&&((a=r.value)==null?void 0:a.toString())!=="":!1})}),ka=Pe(wl,e=>e.reduce((n,r)=>(n[r.field]?n[r.field].push(r):n[r.field]=[r],n),{}));function ce(e,t,n){const r=i.useRef(!0);i.useEffect(()=>{r.current=!1,e.current.register(n,t)},[e,n,t]),r.current&&e.current.register(n,t)}function Ue(e,t){const n=i.useRef(null);if(n.current)return n.current;const r=e.current.getLogger(t);return n.current=r,r}const Sl=(e,t,n,r,o)=>{const l=Ue(e,"useNativeEventListener"),[s,a]=i.useState(!1),c=i.useRef(r),u=Xi(t)?t():(t==null?void 0:t.current)??null,d=i.useCallback(f=>c.current&&c.current(f),[]);i.useEffect(()=>{c.current=r},[r]),i.useEffect(()=>{if(u&&n&&!s){l.debug(`Binding native ${n} event`),u.addEventListener(n,d,o),a(!0);const f=()=>{l.debug(`Clearing native ${n} event`),u.removeEventListener(n,d,o)};e.current.subscribeEvent("unmount",f)}},[u,d,n,s,l,o,e])},Hn=e=>{const t=i.useRef(!0);t.current&&(t.current=!1,e())},mm=()=>{},Da=(e,t)=>{const n=i.useRef(!1);Ye(()=>n.current||!e?mm:(n.current=!0,t()),[n.current||e])},hm=100,pm=e=>e?0:100,Ta=(e,t,n)=>t>0&&e>0?Math.ceil(e/t):e===-1?n+2:0,Oa=e=>({page:0,pageSize:e?0:100}),Cm=(e,t=0)=>t===0?e:Math.max(Math.min(e,t-1),0),Ha=(e,t)=>{if(t===ht.DataGrid&&e>hm)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(` +`))},oo=e=>e.pagination,Je=re(oo,e=>e.paginationModel),Zt=re(oo,e=>e.rowCount),xn=re(oo,e=>e.meta),_a=re(Je,e=>e.page),La=re(Je,e=>e.pageSize),yl=re(Je,Zt,(e,t)=>Ta(t,e.pageSize,e.page)),sr=Pe(Je,rt,eo,$t,bl,(e,t,n,r,o)=>{var m;const l=o.length,s=Math.min(e.pageSize*e.page,l-1),a=Math.min(s+e.pageSize-1,l-1);if(s===-1||a===-1)return null;if(n<2)return{firstRowIndex:s,lastRowIndex:a};const c=o[s],u=a-s+1,d=r.findIndex(C=>C.id===c.id);let f=d,g=0;for(;f0)&&(f+=1),b===0&&(g+=1))}return{firstRowIndex:d,lastRowIndex:f-1}}),Ga=Pe($t,sr,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),xl=Pe(tn,sr,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),bm=["field","colDef"],wm=e=>{const{classes:t}=e;return de({root:["checkboxInput"]},ue,t)},Ra=i.forwardRef(function(t,n){var F;const r=ne(t,bm),[,o]=i.useState(!1),l=ie(),s=Z(),a={classes:s.classes},c=wm(a),u=U(l,ml),d=U(l,it),f=U(l,tn),g=U(l,xl),m=i.useMemo(()=>typeof s.isRowSelectable!="function"?d:d.filter(y=>l.current.getRow(y)?s.isRowSelectable(l.current.getRowParams(y)):!1),[l,s.isRowSelectable,d]),C=i.useMemo(()=>(!s.pagination||!s.checkboxSelectionVisibleOnly?f:g).reduce((_,$)=>(_[$]=!0,_),{}),[s.pagination,s.checkboxSelectionVisibleOnly,g,f]),b=i.useMemo(()=>m.filter(y=>C[y]).length,[m,C]),p=b>0&&b0,x=y=>{const _={value:y.target.checked};l.current.publishEvent("headerSelectionCheckboxChange",_)},D=u!==null&&u.field===t.field?0:-1;i.useLayoutEffect(()=>{const y=l.current.getColumnHeaderElement(t.field);D===0&&y&&(y.tabIndex=-1)},[D,l,t.field]);const E=i.useCallback(y=>{y.key===" "&&l.current.publishEvent("headerSelectionCheckboxChange",{value:!S})},[l,S]),H=i.useCallback(()=>{o(y=>!y)},[]);i.useEffect(()=>l.current.subscribeEvent("rowSelectionChange",H),[l,H]);const G=l.current.getLocaleText(S?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows"),A=s.indeterminateCheckboxAction==="select"?S&&!p:S;return v.jsx(s.slots.baseCheckbox,h({ref:n,indeterminate:p,checked:A,onChange:x,className:c.root,inputProps:{"aria-label":G},tabIndex:D,onKeyDown:E,disabled:!gl(s)},(F=s.slotProps)==null?void 0:F.baseCheckbox,r))}),Ht="__check__",cn=h({},fl,{type:"custom",field:Ht,width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,display:"flex",valueGetter:(e,t,n,r)=>{const o=Pn(r),l=r.current.getRowId(t);return o[l]!==void 0},renderHeader:e=>v.jsx(Ra,h({},e)),renderCell:e=>v.jsx(wa,h({},e))}),Sm=["item","applyValue","type","apiRef","focusElementRef","InputProps","isFilterActive","clearButton","tabIndex","disabled"];function Ds(e,t){if(e==null)return"";const n=new Date(e);return Number.isNaN(n.getTime())?"":t==="date"?n.toISOString().substring(0,10):t==="datetime-local"?(n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n.toISOString().substring(0,19)):n.toISOString().substring(0,10)}function Jt(e){var D;const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:l,InputProps:s,clearButton:a,tabIndex:c,disabled:u}=e,d=ne(e,Sm),f=Dn(),[g,m]=i.useState(()=>Ds(t.value,r)),[C,b]=i.useState(!1),p=_e(),S=Z(),x=i.useCallback(E=>{f.clear();const H=E.target.value;m(H),b(!0),f.start(S.filterDebounceMs,()=>{const G=new Date(H);n(h({},t,{value:Number.isNaN(G.getTime())?void 0:G})),b(!1)})},[n,t,S.filterDebounceMs,f]);return i.useEffect(()=>{const E=Ds(t.value,r);m(E)},[t.value,r]),v.jsx(S.slots.baseTextField,h({fullWidth:!0,id:p,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),value:g,onChange:x,variant:"standard",type:r||"text",InputLabelProps:{shrink:!0},inputRef:l,InputProps:h({},C||a?{endAdornment:C?v.jsx(S.slots.loadIcon,{fontSize:"small",color:"action"}):a}:{},{disabled:u},s,{inputProps:h({max:r==="datetime-local"?"9999-12-31T23:59":"9999-12-31",tabIndex:c},s==null?void 0:s.inputProps)})},d,(D=S.slotProps)==null?void 0:D.baseTextField))}function gn(e,t,n,r){if(!e.value)return null;const o=new Date(e.value);n?o.setSeconds(0,0):(o.setMinutes(o.getMinutes()+o.getTimezoneOffset()),o.setHours(0,0,0,0));const l=o.getTime();return s=>{if(!s)return!1;if(r)return t(s.getTime(),l);const a=new Date(s);return n?a.setSeconds(0,0):a.setHours(0,0,0,0),t(a.getTime(),l)}}const vl=e=>[{value:"is",getApplyFilterFn:t=>gn(t,(n,r)=>n===r,e),InputComponent:Jt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFn:t=>gn(t,(n,r)=>n!==r,e),InputComponent:Jt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFn:t=>gn(t,(n,r)=>n>r,e),InputComponent:Jt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:t=>gn(t,(n,r)=>n>=r,e),InputComponent:Jt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFn:t=>gn(t,(n,r)=>ngn(t,(n,r)=>n<=r,e),InputComponent:Jt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>t=>t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>t=>t!=null,requiresFilterValue:!1}],ym=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange"],xm=je(mi)({fontSize:"inherit"}),vm=e=>{const{classes:t}=e;return de({root:["editInputCell"]},ue,t)};function $a(e){const{id:t,value:n,field:r,colDef:o,hasFocus:l,inputProps:s,onValueChange:a}=e,c=ne(e,ym),u=o.type==="dateTime",d=ie(),f=i.useRef(),g=i.useMemo(()=>{let E;n==null?E=null:n instanceof Date?E=n:E=new Date((n??"").toString());let H;return E==null||Number.isNaN(E.getTime())?H="":H=new Date(E.getTime()-E.getTimezoneOffset()*60*1e3).toISOString().substr(0,u?16:10),{parsed:E,formatted:H}},[n,u]),[m,C]=i.useState(g),p={classes:Z().classes},S=vm(p),x=i.useCallback(E=>{if(E==="")return null;const[H,G]=E.split("T"),[A,F,y]=H.split("-"),_=new Date;if(_.setFullYear(Number(A),Number(F)-1,Number(y)),_.setHours(0,0,0,0),G){const[$,O]=G.split(":");_.setHours(Number($),Number(O),0,0)}return _},[]),D=i.useCallback(async E=>{const H=E.target.value,G=x(H);a&&await a(E,G),C({parsed:G,formatted:H}),d.current.setEditCellValue({id:t,field:r,value:G},E)},[d,r,t,a,x]);return i.useEffect(()=>{C(E=>{var H,G;return g.parsed!==E.parsed&&((H=g.parsed)==null?void 0:H.getTime())!==((G=E.parsed)==null?void 0:G.getTime())?g:E})},[g]),Ye(()=>{l&&f.current.focus()},[l]),v.jsx(xm,h({inputRef:f,fullWidth:!0,className:S.root,type:u?"datetime-local":"date",inputProps:h({max:u?"9999-12-31T23:59":"9999-12-31"},s),value:m.formatted,onChange:D},c))}const Il=e=>v.jsx($a,h({},e));function Aa({value:e,columnType:t,rowId:n,field:r}){if(!(e instanceof Date))throw new Error([`MUI X: \`${t}\` column type only accepts \`Date\` objects as values.`,"Use `valueGetter` to transform the value into a `Date` object.",`Row ID: ${n}, field: "${r}".`].join(` +`))}const ja=(e,t,n,r)=>{if(!e)return"";const o=r.current.getRowId(t);return Aa({value:e,columnType:"date",rowId:o,field:n.field}),e.toLocaleDateString()},za=(e,t,n,r)=>{if(!e)return"";const o=r.current.getRowId(t);return Aa({value:e,columnType:"dateTime",rowId:o,field:n.field}),e.toLocaleString()},Va=h({},Ct,{type:"date",sortComparator:sl,valueFormatter:ja,filterOperators:vl(),renderEditCell:Il,pastedValueParser:e=>new Date(e)}),Na=h({},Ct,{type:"dateTime",sortComparator:sl,valueFormatter:za,filterOperators:vl(!0),renderEditCell:Il,pastedValueParser:e=>new Date(e)}),jt=e=>e==null?null:Number(e),Ba=e=>e==null||Number.isNaN(e)||e===""?null:t=>jt(t)===jt(e),Ua=()=>[{value:"=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>jt(t)===e.value,InputComponent:ct,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>jt(t)!==e.value,InputComponent:ct,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:jt(t)>e.value,InputComponent:ct,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:jt(t)>=e.value,InputComponent:ct,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:jt(t)e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:jt(t)<=e.value,InputComponent:ct,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFn:()=>e=>e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>e!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:e=>!Array.isArray(e.value)||e.value.length===0?null:t=>t!=null&&e.value.includes(Number(t)),InputComponent:al,InputComponentProps:{type:"number"}}],Wa=h({},Ct,{type:"number",align:"right",headerAlign:"right",sortComparator:ll,valueParser:e=>e===""?null:Number(e),valueFormatter:e=>kg(e)?e.toLocaleString():e||"",filterOperators:Ua(),getApplyQuickFilterFn:Ba});function En(e){return(e==null?void 0:e.type)==="singleSelect"}function nn(e,t){if(e)return typeof e.valueOptions=="function"?e.valueOptions(h({field:e.field},t)):e.valueOptions}function Ao(e,t,n){if(t===void 0)return;const r=t.find(o=>{const l=n(o);return String(l)===String(e)});return n(r)}const Im=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen"],Mm=["MenuProps"];function Pm(e){return!!e.key}function qa(e){var O,P;const t=Z(),{id:n,value:r,field:o,row:l,colDef:s,hasFocus:a,error:c,onValueChange:u,initialOpen:d=t.editMode===vt.Cell}=e,f=ne(e,Im),g=ie(),m=i.useRef(),C=i.useRef(),[b,p]=i.useState(d),x=(((O=t.slotProps)==null?void 0:O.baseSelect)||{}).native??!1,D=((P=t.slotProps)==null?void 0:P.baseSelect)||{},{MenuProps:E}=D,H=ne(D,Mm);if(Ye(()=>{var L;a&&((L=C.current)==null||L.focus())},[a]),!En(s))return null;const G=nn(s,{id:n,row:l});if(!G)return null;const A=s.getOptionValue,F=s.getOptionLabel,y=async L=>{if(!En(s)||!G)return;p(!1);const I=L.target,M=Ao(I.value,G,A);u&&await u(L,M),await g.current.setEditCellValue({id:n,field:o,value:M},L)},_=(L,I)=>{if(t.editMode===vt.Row){p(!1);return}if(I==="backdropClick"||L.key==="Escape"){const M=g.current.getCellParams(n,o);g.current.publishEvent("cellEditStop",h({},M,{reason:L.key==="Escape"?mt.escapeKeyDown:mt.cellFocusOut}))}},$=L=>{Pm(L)&&L.key==="Enter"||p(!0)};return!G||!s?null:v.jsx(t.slots.baseSelect,h({ref:m,inputRef:C,value:r,onChange:y,open:b,onOpen:$,MenuProps:h({onClose:_},E),error:c,native:x,fullWidth:!0},f,H,{children:G.map(L=>{var M;const I=A(L);return i.createElement(t.slots.baseSelectOption,h({},((M=t.slotProps)==null?void 0:M.baseSelectOption)||{},{native:x,key:I,value:I}),F(L))})}))}const Ka=e=>v.jsx(qa,h({},e)),Em=["item","applyValue","type","apiRef","focusElementRef","placeholder","tabIndex","label","variant","isFilterActive","clearButton","InputLabelProps"],Fm=({column:e,OptionComponent:t,getOptionLabel:n,getOptionValue:r,isSelectNative:o,baseSelectOptionProps:l})=>["",...nn(e)||[]].map(a=>{const c=r(a);let u=n(a);return u===""&&(u=" "),i.createElement(t,h({},l,{native:o,key:c,value:c}),u)}),km=je("div")({display:"flex",alignItems:"flex-end",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function Tr(e){var A,F,y,_,$;const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:l,placeholder:s,tabIndex:a,label:c,variant:u="standard",clearButton:d}=e,f=ne(e,Em),g=t.value??"",m=_e(),C=_e(),b=Z(),p=((F=(A=b.slotProps)==null?void 0:A.baseSelect)==null?void 0:F.native)??!1;let S=null;if(t.field){const O=o.current.getColumn(t.field);En(O)&&(S=O)}const x=S==null?void 0:S.getOptionValue,D=S==null?void 0:S.getOptionLabel,E=i.useMemo(()=>nn(S),[S]),H=i.useCallback(O=>{let P=O.target.value;P=Ao(P,E,x),n(h({},t,{value:P}))},[E,x,n,t]);if(!En(S))return null;const G=c??o.current.getLocaleText("filterPanelInputLabel");return v.jsxs(km,{children:[v.jsxs(b.slots.baseFormControl,{fullWidth:!0,children:[v.jsx(b.slots.baseInputLabel,h({},(y=b.slotProps)==null?void 0:y.baseInputLabel,{id:C,htmlFor:m,shrink:!0,variant:u,children:G})),v.jsx(b.slots.baseSelect,h({id:m,label:G,labelId:C,value:g,onChange:H,variant:u,type:r||"text",inputProps:{tabIndex:a,ref:l,placeholder:s??o.current.getLocaleText("filterPanelInputPlaceholder")},native:p,notched:u==="outlined"?!0:void 0},f,(_=b.slotProps)==null?void 0:_.baseSelect,{children:Fm({column:S,OptionComponent:b.slots.baseSelectOption,getOptionLabel:D,getOptionValue:x,isSelectNative:p,baseSelectOptionProps:($=b.slotProps)==null?void 0:$.baseSelectOption})}))]}),d]})}const Dm=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],Tm=["key"],Om=ad();function Xa(e){const{item:t,applyValue:n,apiRef:r,focusElementRef:o,color:l,error:s,helperText:a,size:c,variant:u="standard"}=e,d=ne(e,Dm),f={color:l,error:s,helperText:a,size:c,variant:u},g=_e(),m=Z();let C=null;if(t.field){const H=r.current.getColumn(t.field);En(H)&&(C=H)}const b=C==null?void 0:C.getOptionValue,p=C==null?void 0:C.getOptionLabel,S=i.useCallback((H,G)=>b(H)===b(G),[b]),x=i.useMemo(()=>nn(C)||[],[C]),D=i.useMemo(()=>Array.isArray(t.value)?t.value.reduce((H,G)=>{const A=x.find(F=>b(F)===G);return A!=null&&H.push(A),H},[]):[],[b,t.value,x]),E=i.useCallback((H,G)=>{n(h({},t,{value:G.map(b)}))},[n,t,b]);return v.jsx(hi,h({multiple:!0,options:x,isOptionEqualToValue:S,filterOptions:Om,id:g,value:D,onChange:E,getOptionLabel:p,renderTags:(H,G)=>H.map((A,F)=>{const y=G({index:F}),{key:_}=y,$=ne(y,Tm);return v.jsx(m.slots.baseChip,h({variant:"outlined",size:"small",label:p(A)},$),_)}),renderInput:H=>{var G;return v.jsx(m.slots.baseTextField,h({},H,{label:r.current.getLocaleText("filterPanelInputLabel"),placeholder:r.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:h({},H.InputLabelProps,{shrink:!0}),inputRef:o,type:"singleSelect"},f,(G=m.slotProps)==null?void 0:G.baseTextField))}},d))}const mn=e=>e==null||!il(e)?e:e.value,Ya=()=>[{value:"is",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>mn(t)===mn(e.value),InputComponent:Tr},{value:"not",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>mn(t)!==mn(e.value),InputComponent:Tr},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||e.value.length===0)return null;const t=e.value.map(mn);return n=>t.includes(mn(n))},InputComponent:Xa}],Hm=e=>typeof e[0]=="object",_m=e=>il(e)?e.value:e,Lm=e=>il(e)?e.label:String(e),Qa=h({},Ct,{type:"singleSelect",getOptionLabel:Lm,getOptionValue:_m,valueFormatter(e,t,n,r){const o=r.current.getRowId(t);if(!En(n))return"";const l=nn(n,{id:o,row:t});if(e==null)return"";if(!l)return e;if(!Hm(l))return n.getOptionLabel(e);const s=l.find(a=>n.getOptionValue(a)===e);return s?n.getOptionLabel(s):""},renderEditCell:Ka,filterOperators:Ya(),pastedValueParser:(e,t,n)=>{const r=n,o=nn(r)||[],l=r.getOptionValue;if(o.find(a=>l(a)===e))return e}}),Ja="string",Za=()=>({string:Ct,number:Wa,date:Va,dateTime:Na,boolean:fl,singleSelect:Qa,[Jn]:ra,custom:Ct}),ir=e=>e.headerFiltering,ec=re(ir,e=>(e==null?void 0:e.enabled)??!1),tc=re(ir,e=>e.editing),nc=re(ir,e=>e.menuOpen),ro=e=>e.columnGrouping,Ml=Pe(ro,e=>(e==null?void 0:e.unwrappedGroupingModel)??{}),Pl=Pe(ro,e=>(e==null?void 0:e.lookup)??{}),oc=Pe(ro,e=>(e==null?void 0:e.headerStructure)??[]),_n=re(ro,e=>(e==null?void 0:e.maxDepth)??0),rc=["maxWidth","minWidth","width","flex"],pr=Za();function Gm({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const r=new Set(n.map(s=>s.field)),o={all:{},frozenFields:[],freeze:s=>{const a=o.all[s];a&&a.frozen!==!0&&(o.all[s].frozen=!0,o.frozenFields.push(s))}};function l(){if(o.frozenFields.length===r.size)return;const s={min:{},max:{}};let a=e,c=t,u=0;o.frozenFields.forEach(d=>{a-=o.all[d].computedWidth,c-=o.all[d].flex});for(let d=0;df.maxWidth&&(u+=f.maxWidth-m,m=f.maxWidth,s.max[f.field]=!0),o.all[f.field]={frozen:!1,computedWidth:m,flex:f.flex}}u<0?Object.keys(s.max).forEach(d=>{o.freeze(d)}):u>0?Object.keys(s.min).forEach(d=>{o.freeze(d)}):n.forEach(({field:d})=>{o.freeze(d)}),l()}return l(),o.all}const Or=(e,t)=>{const n={};let r=0,o=0;const l=[];e.orderedFields.forEach(c=>{let u=e.lookup[c],d=0,f=!1;e.columnVisibilityModel[c]!==!1&&(u.flex&&u.flex>0?(r+=u.flex,f=!0):d=Lt(u.width||Ct.width,u.minWidth||Ct.minWidth,u.maxWidth||Ct.maxWidth),o+=d),u.computedWidth!==d&&(u=h({},u,{computedWidth:d})),f&&l.push(u),n[c]=u});const s=t===void 0?0:t.viewportOuterSize.width-(t.hasScrollY?t.scrollbarSize:0),a=Math.max(s-o,0);if(r>0&&s>0){const c=Gm({initialFreeSpace:a,totalFlexUnits:r,flexColumns:l});Object.keys(c).forEach(u=>{n[u].computedWidth=c[u].computedWidth})}return h({},e,{lookup:n})},Rm=(e,t)=>{if(!t)return e;const{orderedFields:n=[],dimensions:r={}}=t,o=Object.keys(r);if(o.length===0&&n.length===0)return e;const l={},s=[];for(let d=0;d!l[d])],c=h({},e.lookup);for(let d=0;d{g[m]=C===-1?1/0:C}),c[f]=g}return h({},e,{orderedFields:a,lookup:c})};function Ts(e){let t=pr[Ja];return e&&pr[e]&&(t=pr[e]),t}const wn=({apiRef:e,columnsToUpsert:t,initialState:n,columnVisibilityModel:r=ut(e),keepOnlyColumnsToUpsert:o=!1})=>{var d,f;const l=!e.current.state.columns;let s;if(l)s={orderedFields:[],lookup:{},columnVisibilityModel:r};else{const g=xt(e.current.state);s={orderedFields:o?[]:[...g.orderedFields],lookup:h({},g.lookup),columnVisibilityModel:r}}let a={};o&&!l&&(a=Object.keys(s.lookup).reduce((g,m)=>h({},g,{[m]:!1}),{})),t.forEach(g=>{const{field:m}=g;a[m]=!0;let C=s.lookup[m];C==null?(C=h({},Ts(g.type),{field:m,hasBeenResized:!1}),s.orderedFields.push(m)):o&&s.orderedFields.push(m),C&&C.type!==g.type&&(C=h({},Ts(g.type),{field:m}));let b=C.hasBeenResized;rc.forEach(p=>{g[p]!==void 0&&(b=!0,g[p]===-1&&(g[p]=1/0))}),s.lookup[m]=h({},C,g,{hasBeenResized:b})}),o&&!l&&Object.keys(s.lookup).forEach(g=>{a[g]||delete s.lookup[g]});const c=e.current.unstable_applyPipeProcessors("hydrateColumns",s),u=Rm(c,n);return Or(u,((f=(d=e.current).getRootDimensions)==null?void 0:f.call(d))??void 0)};function $m({firstColumnToRender:e,apiRef:t,firstRowToRender:n,lastRowToRender:r,visibleRows:o}){let l=e;for(let s=n;s{const{scrollDirection:t,classes:n}=e,r={root:["scrollArea",`scrollArea--${t}`]};return de(r,ue,n)},zm=Se("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${k["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${k["scrollArea--right"]}`]:t["scrollArea--right"]},t.scrollArea]})(()=>({position:"absolute",top:0,zIndex:101,width:20,bottom:0,[`&.${k["scrollArea--left"]}`]:{left:0},[`&.${k["scrollArea--right"]}`]:{right:0}}));function Vm(e){const{scrollDirection:t}=e,n=i.useRef(null),r=ie(),o=Dn(),l=U(r,Tn),s=U(r,Jo),a=U(r,nt),c=i.useRef({left:0,top:0}),u=()=>{if(t==="left")return c.current.left>0;if(t==="right"){const F=s-a.viewportInnerSize.width;return c.current.left{c.current=F,m(u)},H=Re(F=>{let y;if(F.preventDefault(),t==="left")y=F.clientX-n.current.getBoundingClientRect().right;else if(t==="right")y=Math.max(1,F.clientX-n.current.getBoundingClientRect().left);else throw new Error("MUI X: Wrong drag direction");y=(y-Os)*Am+Os,o.start(0,()=>{r.current.scroll({left:c.current.left+y,top:c.current.top})})}),G=Re(()=>{f(!0)}),A=Re(()=>{f(!1)});return ee(r,"scrollPositionChange",E),ee(r,"columnHeaderDragStart",G),ee(r,"columnHeaderDragEnd",A),!d||!g?null:v.jsx(zm,{ref:n,className:me(p.root),ownerState:b,onDragOver:H,style:D})}const Hs=Yt(Vm),Nm=typeof window<"u"?i.useLayoutEffect:i.useEffect,Bm=()=>{};function Um(e,t,n){const r=i.useRef(null);r.current=t,Nm(()=>{if(typeof ResizeObserver>"u")return Bm;const o=e.current,l=new ResizeObserver(s=>{r.current(s)});return o&&l.observe(o),()=>{l.disconnect()}},[e,n])}const lc=i.createContext(void 0);function Et(){const e=i.useContext(lc);if(e===void 0)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(` +`));return e}const Wn=(e,t)=>{let n,r;return t.pagination&&t.paginationMode==="client"?(r=sr(e),n=Ga(e)):(n=$t(e),n.length===0?r=null:r={firstRowIndex:0,lastRowIndex:n.length-1}),{rows:n,range:r}},Qt=(e,t)=>{const n=Wn(e,t);return i.useMemo(()=>({rows:n.rows,range:n.range}),[n.rows,n.range])},Wm=typeof navigator<"u"?navigator.userAgent.toLowerCase():"empty",qm=Wm.includes("firefox"),un=e=>e.rowsMeta,lo=e=>e.virtualization,Km=re(lo,e=>e.enabled),ar=re(lo,e=>e.enabledForColumns),sc=re(lo,e=>e.enabledForRows),so=re(lo,e=>e.renderContext),ic=Pe(e=>e.virtualization.renderContext.firstColumnIndex,e=>e.virtualization.renderContext.lastColumnIndex,(e,t)=>({firstColumnIndex:e,lastColumnIndex:t})),Fl={firstRowIndex:0,lastRowIndex:0,firstColumnIndex:0,lastColumnIndex:0},ac=(e,t)=>{const{disableVirtualization:n,autoHeight:r}=t;return h({},e,{virtualization:{enabled:!n,enabledForColumns:!n,enabledForRows:!n&&!r,renderContext:Fl}})};function cc(e,t){const n=l=>{e.current.setState(s=>h({},s,{virtualization:h({},s.virtualization,{enabled:l,enabledForColumns:l,enabledForRows:l&&!t.autoHeight})}))};ce(e,{unstable_setVirtualization:n,unstable_setColumnVirtualization:l=>{e.current.setState(s=>h({},s,{virtualization:h({},s.virtualization,{enabledForColumns:l})}))}},"public"),i.useEffect(()=>{n(!t.disableVirtualization)},[t.disableVirtualization,t.autoHeight])}const kl=e=>e.rowSpanning,uc=re(kl,e=>e.hiddenCells),Xm=re(kl,e=>e.spannedCells),Ym=re(kl,e=>e.hiddenCellOriginMap),Cr=50;var Ve=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}(Ve||{});const _s={top:0,left:0},Qm=Object.freeze(new Map),Jm=(e,t,n,r,o)=>({direction:Ve.NONE,buffer:fc(e,Ve.NONE,t,n,r,o)});let Hr=!1;try{typeof window<"u"&&(Hr=/jsdom/.test(window.navigator.userAgent))}catch{}const Zm=()=>{const e=Et(),t=Z(),n=U(e,Ne),r=U(e,sc)&&!Hr,o=U(e,ar)&&!Hr,l=U(e,nt),s=l.viewportOuterSize,a=U(e,an),c=U(e,On),u=a.bottom.length>0,[d,f]=i.useState(Qm),g=Kt(),m=U(e,st),C=U(e,er),b=U(e,un),p=U(e,Pn),S=Qt(e,t),x=e.current.rootElementRef,D=e.current.mainElementRef,E=e.current.virtualScrollerRef,H=i.useRef(null),G=i.useRef(null),A=l.contentSize.height,F=l.columnsTotalWidth,y=U(e,Bi);Um(D,()=>e.current.resize());const _=i.useRef(_s),$=i.useRef(_s),O=i.useRef(Fl),P=U(e,so),L=Dn(),I=i.useRef(void 0),M=Xt(()=>Jm(g,t.rowBufferPx,t.columnBufferPx,l.rowHeight*15,Cr*6)).current,w={rowIndex:i.useMemo(()=>m?S.rows.findIndex(K=>K.id===m.id):-1,[m,S.rows]),columnIndex:i.useMemo(()=>m?n.findIndex(K=>K.field===m.field):-1,[m,n])},j=i.useCallback(K=>{if(nh(K,e.current.state.virtualization.renderContext))return;const Q=K.firstRowIndex!==O.current.firstRowIndex||K.lastRowIndex!==O.current.lastRowIndex;e.current.setState(J=>h({},J,{virtualization:h({},J.virtualization,{renderContext:K})})),l.isReady&&Q&&(O.current=K,e.current.publishEvent("renderedRowsIntervalChange",K)),$.current=_.current},[e,l.isReady]),T=()=>{const K={top:E.current.scrollTop,left:E.current.scrollLeft},Q=K.left-_.current.left,J=K.top-_.current.top,se=Q!==0||J!==0;_.current=K;const oe=se?oh(Q,J):Ve.NONE,ae=Math.abs(_.current.top-$.current.top),Le=Math.abs(_.current.left-$.current.left),Oe=ae>=l.rowHeight||Le>=Cr,He=M.direction!==oe;if(!(Oe||He))return P;if(He)switch(oe){case Ve.NONE:case Ve.LEFT:case Ve.RIGHT:I.current=void 0;break;default:I.current=P;break}M.direction=oe,M.buffer=fc(g,oe,t.rowBufferPx,t.columnBufferPx,l.rowHeight*15,Cr*6);const Ge=br(e,t,r,o),qe=wr(Ge,_.current,M);return cd.flushSync(()=>{j(qe)}),L.start(1e3,T),qe},R=()=>{const K=br(e,t,r,o),Q=wr(K,_.current,M);I.current=void 0,j(Q)},z=Re(K=>{const{scrollTop:Q,scrollLeft:J}=K.currentTarget;if(Q<0||!g&&J<0||g&&J>0)return;const se=T();e.current.publishEvent("scrollPositionChange",{top:Q,left:J,renderContext:se})}),N=Re(K=>{e.current.publishEvent("virtualScrollerWheel",{},K)}),B=Re(K=>{e.current.publishEvent("virtualScrollerTouchMove",{},K)}),W=(K={})=>{var ft;if(!K.rows&&!S.range)return[];const Q=K.renderContext??P,J=!u&&K.position===void 0||u&&K.position==="bottom",se=K.position!==void 0;let oe;switch(K.position){case"top":oe=0;break;case"bottom":oe=a.top.length+S.rows.length;break;case void 0:oe=a.top.length;break}const ae=K.rows??S.rows,Le=Q.firstRowIndex,Oe=Math.min(Q.lastRowIndex,ae.length),He=K.rows?ys(0,K.rows.length):ys(Le,Oe);let ve=-1;!se&&w.rowIndex!==-1&&(w.rowIndex=Oe&&(ve=w.rowIndex,He.push(ve)));const Ge=[],qe=(ft=t.slotProps)==null?void 0:ft.row,ot=Rt(e);return He.forEach(Ae=>{var co,uo,fo;const{id:be,model:fe}=ae[Ae],ye=(((co=S==null?void 0:S.range)==null?void 0:co.firstRowIndex)||0)+oe+Ae;if(y){const dn=c.left.length,go=n.length-c.right.length;e.current.calculateColSpan({rowId:be,minFirstColumn:dn,maxLastColumn:go,columns:n}),c.left.length>0&&e.current.calculateColSpan({rowId:be,minFirstColumn:0,maxLastColumn:c.left.length,columns:n}),c.right.length>0&&e.current.calculateColSpan({rowId:be,minFirstColumn:n.length-c.right.length,maxLastColumn:n.length,columns:n})}const Ee=(m==null?void 0:m.id)===be,Fe=e.current.rowHasAutoHeight(be)?"auto":e.current.unstable_getRowHeight(be);let Ce;p[be]==null?Ce=!1:Ce=e.current.isRowSelectable(be);let Be=!1;K.position===void 0&&(Be=Ae===0);let ze=!1;const le=Ae===ae.length-1;if(J)if(se)ze=le;else{const dn=S.rows.length-1;Ae===dn&&(ze=!0)}const pe=Ae===ve;let ge=null;C!==null&&C.id===be&&(ge=e.current.getCellParams(be,C.field).cellMode==="view"?C.field:null);let we=Q;!se&&I.current&&Ae>=I.current.firstRowIndex&&Ae=s.width,q=i.useMemo(()=>({overflowX:X?void 0:"hidden",overflowY:t.autoHeight?"hidden":void 0}),[X,t.autoHeight]),te=i.useMemo(()=>{const K={width:X?F:"auto",height:A};return t.autoHeight&&S.rows.length===0&&(K.height=da(e)),K},[e,F,A,X,t.autoHeight,S.rows.length]);return i.useEffect(()=>{e.current.publishEvent("virtualScrollerContentSizeChange")},[e,te]),Ye(()=>{e.current.resize()},[e,b.currentPageTotalHeight]),Ye(()=>{o&&(E.current.scrollLeft=0),r&&(E.current.scrollTop=0)},[o,r,x,E]),Da(s.width!==0,()=>{const K=br(e,t,r,o),Q=wr(K,_.current,M);j(Q),e.current.publishEvent("scrollPositionChange",{top:_.current.top,left:_.current.left,renderContext:Q})}),e.current.register("private",{updateRenderContext:R}),ee(e,"columnsChange",R),ee(e,"filteredRowsSet",R),ee(e,"rowExpansionChange",R),{renderContext:P,setPanels:f,getRows:W,getContainerProps:()=>({ref:D}),getScrollerProps:()=>({ref:E,onScroll:z,onWheel:N,onTouchMove:B,style:q,role:"presentation",tabIndex:qm?-1:void 0}),getContentProps:()=>({style:te,role:"presentation"}),getRenderZoneProps:()=>({role:"rowgroup"}),getScrollbarVerticalProps:()=>({ref:H,role:"presentation"}),getScrollbarHorizontalProps:()=>({ref:G,role:"presentation"})}};function br(e,t,n,r){const o=nt(e.current.state),l=Wn(e,t),s=Ne(e),a=Ym(e),c=e.current.state.rows.dataRowIds.at(-1),u=s.at(-1);return{enabledForRows:n,enabledForColumns:r,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:c!==void 0?e.current.unstable_getRowHeight(c):0,lastColumnWidth:(u==null?void 0:u.computedWidth)??0,rowsMeta:un(e.current.state),columnPositions:Rt(e),rows:l.rows,range:l.range,pinnedColumns:On(e),visibleColumns:s,hiddenCellsOriginMap:a}}function wr(e,t,n){const r={firstRowIndex:0,lastRowIndex:e.rows.length,firstColumnIndex:0,lastColumnIndex:e.visibleColumns.length},{top:o,left:l}=t,s=Math.abs(l)+e.leftPinnedWidth;if(e.enabledForRows){let c=Math.min(Ls(e,o,{atStart:!0,lastPosition:e.rowsMeta.positions[e.rowsMeta.positions.length-1]+e.lastRowHeight}),e.rowsMeta.positions.length-1);const u=e.hiddenCellsOriginMap[c];if(u){const f=Math.min(...Object.values(u));c=Math.min(c,f)}const d=e.autoHeight?c+e.rows.length:Ls(e,o+e.viewportInnerHeight);r.firstRowIndex=c,r.lastRowIndex=d}if(e.enabledForColumns){let c=0,u=e.columnPositions.length,d=!1;const[f,g]=_r({firstIndex:r.firstRowIndex,lastIndex:r.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight});for(let m=f;m=e.range.lastRowIndex);const l=Lt(r-(((a=e.range)==null?void 0:a.firstRowIndex)||0),0,e.rowsMeta.positions.length);return o||e.rowsMeta.positions[l]>=t?Ut(t,e.rowsMeta.positions,n):th(t,e.rowsMeta.positions,l,n)}function eh(e,t,n){const[r,o]=_r({firstIndex:t.firstRowIndex,lastIndex:t.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight}),[l,s]=_r({firstIndex:t.firstColumnIndex,lastIndex:t.lastColumnIndex,minFirstIndex:e.pinnedColumns.left.length,maxLastIndex:e.visibleColumns.length-e.pinnedColumns.right.length,bufferBefore:n.buffer.columnBefore,bufferAfter:n.buffer.columnAfter,positions:e.columnPositions,lastSize:e.lastColumnWidth}),a=$m({firstColumnToRender:l,apiRef:e.apiRef,firstRowToRender:r,lastRowToRender:o,visibleRows:e.rows});return{firstRowIndex:r,lastRowIndex:o,firstColumnIndex:a,lastColumnIndex:s}}function Ut(e,t,n=void 0,r=0,o=t.length){if(t.length<=0)return-1;if(r>=o)return r;const l=r+Math.floor((o-r)/2),s=t[l];let a;if(n!=null&&n.atStart){const c=(l===t.length-1?n.lastPosition:t[l+1])-s;a=e-c=Math.abs(e)?t>0?Ve.DOWN:Ve.UP:e>0?Ve.RIGHT:Ve.LEFT}function fc(e,t,n,r,o,l){if(e)switch(t){case Ve.LEFT:t=Ve.RIGHT;break;case Ve.RIGHT:t=Ve.LEFT;break}switch(t){case Ve.NONE:return{rowAfter:n,rowBefore:n,columnAfter:r,columnBefore:r};case Ve.LEFT:return{rowAfter:0,rowBefore:0,columnAfter:0,columnBefore:l};case Ve.RIGHT:return{rowAfter:0,rowBefore:0,columnAfter:l,columnBefore:0};case Ve.UP:return{rowAfter:0,rowBefore:o,columnAfter:0,columnBefore:0};case Ve.DOWN:return{rowAfter:o,rowBefore:0,columnAfter:0,columnBefore:0};default:throw new Error("unreachable")}}const rh=()=>{var d,f;const e=ie(),t=Z(),n=U(e,Zn),r=U(e,rr),o=n===0,l=U(e,la),s=!l&&o,a=!l&&n>0&&r===0;let c=null,u=null;return s&&(c="noRowsOverlay"),a&&(c="noResultsOverlay"),l&&(c="loadingOverlay",u=((f=(d=t.slotProps)==null?void 0:d.loadingOverlay)==null?void 0:f[o?"noRowsVariant":"variant"])||null),{overlayType:c,loadingOverlayVariant:u}},lh=Se("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapper})(({overlayType:e,loadingOverlayVariant:t})=>t!=="skeleton"?{position:"sticky",top:"var(--DataGrid-headersTotalHeight)",left:0,width:0,height:0,zIndex:e==="loadingOverlay"?5:4}:{}),sh=Se("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapperInner})({}),ih=e=>{const{classes:t}=e;return de({root:["overlayWrapper"],inner:["overlayWrapperInner"]},ue,t)};function ah(e){const t=ie(),n=Z(),r=Qt(t,n),o=U(t,nt);let l=o.viewportOuterSize.height-o.topContainerHeight-o.bottomContainerHeight-(o.hasScrollX?o.scrollbarSize:0);(n.autoHeight&&r.rows.length===0||l===0)&&(l=da(t));const s=ih(h({},e,{classes:n.classes}));return v.jsx(lh,h({className:me(s.root)},e,{children:v.jsx(sh,h({className:me(s.inner),style:{height:l,width:o.viewportOuterSize.width}},e))}))}function gc(e){var l,s;const{overlayType:t}=e,n=Z();if(!t)return null;const r=(l=n.slots)==null?void 0:l[t],o=(s=n.slotProps)==null?void 0:s[t];return v.jsx(ah,h({},e,{children:v.jsx(r,h({},o))}))}const zn=e=>e.columnMenu;function ch(){var p;const e=Et(),t=Z(),n=U(e,Ne),r=U(e,ka),o=U(e,Ma),l=U(e,ml),s=U(e,er),a=U(e,ya),c=U(e,Sa),u=U(e,Un),d=U(e,_n),f=U(e,zn),g=U(e,ut),m=U(e,oc),C=!(a===null&&l===null&&s===null),b=e.current.columnHeadersContainerRef;return v.jsx(t.slots.columnHeaders,h({ref:b,visibleColumns:n,filterColumnLookup:r,sortColumnLookup:o,columnHeaderTabIndexState:l,columnGroupHeaderTabIndexState:a,columnHeaderFocus:c,columnGroupHeaderFocus:u,headerGroupingMaxDepth:d,columnMenuState:f,columnVisibility:g,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:C},(p=t.slotProps)==null?void 0:p.columnHeaders))}const uh=Yt(ch),mc=i.createContext(void 0),hc=()=>{const e=i.useContext(mc);if(e===void 0)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(` +`));return e},dh=Se("div")({position:"absolute",top:"var(--DataGrid-headersTotalHeight)",left:0}),fh=Se("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>t.main})({flexGrow:1,position:"relative",overflow:"hidden"}),gh=i.forwardRef((e,t)=>{const n=Z(),o=hc().hooks.useGridAriaAttributes();return v.jsxs(fh,h({ref:t,ownerState:n,className:e.className,tabIndex:-1},o,{children:[v.jsx(dh,{role:"presentation","data-id":"gridPanelAnchor"}),e.children]}))}),mh=()=>de({root:["topContainer"]},ue,{}),hh=Se("div")({position:"sticky",zIndex:4,top:0});function ph(e){const t=mh();return v.jsx(hh,h({},e,{className:me(t.root,e.className,k["container--top"]),role:"presentation"}))}const Ch=()=>de({root:["bottomContainer"]},ue,{}),bh=Se("div")({position:"sticky",zIndex:4,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});function wh(e){const t=Ch();return v.jsx(bh,h({},e,{className:me(t.root,e.className,k["container--bottom"]),role:"presentation"}))}const Sh=(e,t)=>{const{classes:n}=e;return de({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},ue,n)},yh=Se("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>t.virtualScrollerContent})({}),xh=i.forwardRef(function(t,n){var s;const r=Z(),o=!r.autoHeight&&((s=t.style)==null?void 0:s.minHeight)==="auto",l=Sh(r,o);return v.jsx(yh,h({ref:n},t,{ownerState:r,className:me(l.root,t.className)}))}),vh=Se("div")({display:"flex",flexDirection:"row",width:"var(--DataGrid-rowWidth)",boxSizing:"border-box"}),pc=Se("div")({position:"sticky",height:"100%",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",backgroundColor:"var(--DataGrid-pinnedBackground)"}),Ih=Se(pc)({left:0,borderRight:"1px solid var(--rowBorderColor)"}),Mh=Se(pc)({right:0,borderLeft:"1px solid var(--rowBorderColor)"}),Ph=Se("div")({flexGrow:1,borderTop:"1px solid var(--rowBorderColor)"});function Eh({rowsLength:e}){const t=ie(),{viewportOuterSize:n,minimumSize:r,hasScrollX:o,hasScrollY:l,scrollbarSize:s,leftPinnedWidth:a,rightPinnedWidth:c}=U(t,nt),u=o?s:0,d=n.height-r.height-u,f=Math.max(u,d);return f===0?null:v.jsxs(vh,{className:k.filler,role:"presentation",style:{height:f,"--rowBorderColor":e===0?"transparent":"var(--DataGrid-rowBorderColor)"},children:[a>0&&v.jsx(Ih,{className:k["filler--pinnedLeft"],style:{width:a}}),v.jsx(Ph,{}),c>0&&v.jsx(Mh,{className:k["filler--pinnedRight"],style:{width:c+(l?s:0)}})]})}const Fh=Yt(Eh),kh=["className"],Dh=e=>{const{classes:t}=e;return de({root:["virtualScrollerRenderZone"]},ue,t)},Th=Se("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone",overridesResolver:(e,t)=>t.virtualScrollerRenderZone})({position:"absolute",display:"flex",flexDirection:"column"}),Oh=i.forwardRef(function(t,n){const{className:r}=t,o=ne(t,kh),l=ie(),s=Z(),a=Dh(s),c=U(l,()=>{const u=so(l);return un(l.current.state).positions[u.firstRowIndex]??0});return v.jsx(Th,h({ref:n,className:me(a.root,r),ownerState:s,style:{transform:`translate3d(0, ${c}px, 0)`}},o))}),Cc=e=>e.columnResize,Hh=re(Cc,e=>e.resizingColumnField),bc={includeHeaders:!0,includeOutliers:!1,outliersFactor:1.5,expand:!1},Xe=e=>e.editRows,Wt=e=>e.preferencePanel;var bt=function(e){return e.filters="filters",e.columns="columns",e}(bt||{});const _h=(e,t)=>{const{classes:n}=e,r={root:["scrollbar",`scrollbar--${t}`],content:["scrollbarContent"]};return de(r,ue,n)},wc=Se("div")({position:"absolute",display:"inline-block",zIndex:6,"& > div":{display:"inline-block"},"--size":"calc(max(var(--DataGrid-scrollbarSize), 14px))"}),Lh=Se(wc)({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"}),Gh=Se(wc)({width:"100%",height:"var(--size)",overflowY:"hidden",overflowX:"auto",outline:0,"& > div":{height:"var(--size)"},bottom:"0px"}),Rh=Se("div")({display:"inline-block"}),Gs=i.forwardRef(function(t,n){const r=Et(),o=Z(),l=i.useRef(!1),s=i.useRef(0),a=i.useRef(null),c=i.useRef(null),u=_h(o,t.position),d=U(r,nt),f=t.position==="vertical"?"height":"width",g=t.position==="vertical"?"scrollTop":"scrollLeft",m=t.position==="vertical"?d.hasScrollX:d.hasScrollY,C=d.minimumSize[f]+(m?d.scrollbarSize:0),p=(t.position==="vertical"?d.viewportInnerSize.height:d.viewportOuterSize.width)*(C/d.viewportOuterSize[f]),S=Re(()=>{const E=r.current.virtualScrollerRef.current,H=a.current;if(E[g]===s.current)return;if(l.current){l.current=!1;return}l.current=!0;const G=E[g]/C;H[g]=G*p,s.current=E[g]}),x=Re(()=>{const E=r.current.virtualScrollerRef.current,H=a.current;if(l.current){l.current=!1;return}l.current=!0;const G=H[g]/p;E[g]=G*C});Yn(()=>{const E=r.current.virtualScrollerRef.current,H=a.current;return E.addEventListener("scroll",S,{capture:!0}),H.addEventListener("scroll",x,{capture:!0}),()=>{E.removeEventListener("scroll",S,{capture:!0}),H.removeEventListener("scroll",x,{capture:!0})}}),i.useEffect(()=>{c.current.style.setProperty(f,`${p}px`)},[p,f]);const D=t.position==="vertical"?Lh:Gh;return v.jsx(D,{ref:Gt(n,a),className:u.root,tabIndex:-1,"aria-hidden":"true",children:v.jsx(Rh,{ref:c,className:u.content})})}),$h=(e,t,n)=>{const{classes:r}=e,o={root:["main",t.rightPinnedWidth>0&&"main--hasPinnedRight",n==="skeleton"&&"main--hasSkeletonLoadingOverlay"],scroller:["virtualScroller",t.hasScrollX&&"virtualScroller--hasScrollX"]};return de(o,ue,r)},Ah=Se("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>t.virtualScroller})({position:"relative",height:"100%",overflow:"scroll",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},"@media print":{overflow:"hidden"},zIndex:0});function Sc(e){const t=ie(),n=Z(),r=U(t,nt),o=rh(),l=$h(n,r,o.loadingOverlayVariant),s=Zm(),{getContainerProps:a,getScrollerProps:c,getContentProps:u,getRenderZoneProps:d,getScrollbarVerticalProps:f,getScrollbarHorizontalProps:g,getRows:m}=s,C=m();return v.jsxs(gh,h({className:l.root},a(),{children:[v.jsx(Hs,{scrollDirection:"left"}),v.jsx(Hs,{scrollDirection:"right"}),v.jsxs(Ah,h({className:l.scroller},c(),{ownerState:n,children:[v.jsxs(ph,{children:[v.jsx(uh,{}),v.jsx(n.slots.pinnedRows,{position:"top",virtualScroller:s})]}),v.jsx(gc,h({},o)),v.jsx(xh,h({},u(),{children:v.jsxs(Oh,h({},d(),{children:[C,v.jsx(n.slots.detailPanels,{virtualScroller:s})]}))})),v.jsx(Fh,{rowsLength:C.length}),v.jsx(wh,{children:v.jsx(n.slots.pinnedRows,{position:"bottom",virtualScroller:s})})]})),r.hasScrollY&&v.jsx(Gs,h({position:"vertical"},f())),r.hasScrollX&&v.jsx(Gs,h({position:"horizontal"},g())),e.children]}))}function yc(){var t;const e=Z();return e.hideFooter?null:v.jsx(e.slots.footer,h({},(t=e.slotProps)==null?void 0:t.footer))}let Sr;function jh(){return Sr===void 0&&document.createElement("div").focus({get preventScroll(){return Sr=!0,!1}}),Sr}function zh(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function jo(e,t){return e.closest(`.${t}`)}function At(e){return e.replace(/["\\]/g,"\\$&")}function Vh(e,t){return e.querySelector(`[role="columnheader"][data-field="${At(t)}"]`)}function xc(e){return`.${k.row}[data-id="${At(String(e))}"]`}function Nh(e,t){return e.querySelector(xc(t))}function Bh(e,{id:t,field:n}){const r=xc(t),o=`.${k.cell}[data-field="${At(n)}"]`,l=`${r} ${o}`;return e.querySelector(l)}function io(e){return e.target.nodeType===1&&!e.currentTarget.contains(e.target)}function Uh(e){return e.getAttribute("data-field")}function Wh(e,t){return e.querySelector(`[data-field="${At(t)}"]`)}function qh(e){return e.getAttribute("data-fields").slice(2,-2).split("-|-")}function Kh(e,t){return Array.from(e.querySelectorAll(`[data-fields*="|-${At(t)}-|"]`)??[])}function Xh(e,t){var s;if(!jo(e,k.root))throw new Error("MUI X: The root element is not found.");const r=e.getAttribute("aria-colindex");if(!r)return[];const o=Number(r)-1,l=[];return(s=t.virtualScrollerRef)!=null&&s.current?(Mc(t).forEach(a=>{const c=a.getAttribute("data-id");if(!c)return;let u=o;const d=t.unstable_getCellColSpanInfo(c,o);d&&d.spannedByColSpan&&(u=d.leftVisibleCellIndex);const f=a.querySelector(`[data-colindex="${u}"]`);f&&l.push(f)}),l):[]}function Rs(e,t){return e.rootElementRef.current.querySelector(`.${k[t]}`)}const vc=({api:e,colIndex:t,position:n,filterFn:r})=>{if(t===null)return[];const o=[];return Mc(e).forEach(l=>{l.getAttribute("data-id")&&l.querySelectorAll(`.${k[n==="left"?"cell--pinnedLeft":"cell--pinnedRight"]}`).forEach(a=>{const c=Ln(a);c!==null&&r(c)&&o.push(a)})}),o};function Yh(e,t,n){const r=Ln(t);return vc({api:e,colIndex:r,position:n?"right":"left",filterFn:o=>n?or})}function Qh(e,t,n){const r=Ln(t);return vc({api:e,colIndex:r,position:n?"left":"right",filterFn:o=>n?o>r:o{var l;if(!((l=e.columnHeadersContainerRef)!=null&&l.current))return[];if(t===null)return[];const o=[];return e.columnHeadersContainerRef.current.querySelectorAll(`.${k[n==="left"?"columnHeader--pinnedLeft":"columnHeader--pinnedRight"]}`).forEach(s=>{const a=Ln(s);a!==null&&r(a)&&o.push(s)}),o};function Jh(e,t,n){const r=Ln(t);return Ic({api:e,position:n?"right":"left",colIndex:r,filterFn:o=>n?or})}function Zh(e,t,n){const r=Ln(t);return Ic({api:e,position:n?"left":"right",colIndex:r,filterFn:o=>n?o>r:o div > [data-field="${At(t)}"][role="columnheader"]`)}function tp(e,t){const n=e.virtualScrollerRef.current;return Array.from(n.querySelectorAll(`:scope > div > div > div > [data-field="${At(t)}"][role="gridcell"]`))}function Mc(e){return e.virtualScrollerRef.current.querySelectorAll(`:scope > div > div > .${k.row}`)}function Ln(e){const t=e.getAttribute("aria-colindex");return t?Number(t)-1:null}class Ho extends Error{}function np(e){const t=i.useCallback(f=>({field:f,colDef:e.current.getColumn(f)}),[e]),n=i.useCallback(f=>{const g=e.current.getRow(f);if(!g)throw new Ho(`No row with id #${f} found`);return{id:f,columns:e.current.getAllColumns(),row:g}},[e]),r=i.useCallback((f,g)=>{const m=e.current.getColumn(g),C=e.current.getRow(f),b=e.current.getRowNode(f);if(!C||!b)throw new Ho(`No row with id #${f} found`);const p=C[g],S=m!=null&&m.valueGetter?m.valueGetter(p,C,m,e):p,x=st(e),D=er(e),E={id:f,field:g,row:C,rowNode:b,colDef:m,cellMode:e.current.getCellMode(f,g),hasFocus:x!==null&&x.field===g&&x.id===f,tabIndex:D&&D.field===g&&D.id===f?0:-1,value:S,formattedValue:S,isEditable:!1,api:{}};return m&&m.valueFormatter&&(E.formattedValue=m.valueFormatter(S,C,m,e)),E.isEditable=m&&e.current.isCellEditable(E),E},[e]),o=i.useCallback((f,g)=>{const m=e.current.getColumn(g),C=e.current.getRow(f);if(!C)throw new Ho(`No row with id #${f} found`);return!m||!m.valueGetter?C[g]:m.valueGetter(C[m.field],C,m,e)},[e]),l=i.useCallback((f,g)=>{const m=g.field;if(!g||!g.valueGetter)return f[m];const C=f[g.field];return g.valueGetter(C,f,g,e)},[e]),s=i.useCallback((f,g)=>{const m=l(f,g);return!g||!g.valueFormatter?m:g.valueFormatter(m,f,g,e)},[e,l]),a=i.useCallback(f=>e.current.rootElementRef.current?Vh(e.current.rootElementRef.current,f):null,[e]),c=i.useCallback(f=>e.current.rootElementRef.current?Nh(e.current.rootElementRef.current,f):null,[e]),u=i.useCallback((f,g)=>e.current.rootElementRef.current?Bh(e.current.rootElementRef.current,{id:f,field:g}):null,[e]);ce(e,{getCellValue:o,getCellParams:r,getCellElement:u,getRowValue:l,getRowFormattedValue:s,getRowParams:n,getRowElement:c,getColumnHeaderParams:t,getColumnHeaderElement:a},"public")}const cr=(e,t,n,r,o)=>{const l=t===n-1;return e===Me.LEFT&&l?!0:r?e===Me.LEFT?!0:e===Me.RIGHT?!l:!l||o:!1},ur=(e,t)=>e===Me.RIGHT&&t===0,op=["column","rowId","editCellState","align","children","colIndex","width","className","style","gridHasScrollX","colSpan","disableDragEvents","isNotVisible","pinnedOffset","pinnedPosition","sectionIndex","sectionLength","gridHasFiller","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver"],rp=["changeReason","unstable_updateValueOnRender"];let lt=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 Pc={[lt.LEFT]:Me.LEFT,[lt.RIGHT]:Me.RIGHT,[lt.NONE]:void 0,[lt.VIRTUAL]:void 0},$s={id:-1,field:"__unset__",row:{},rowNode:{id:-1,depth:0,type:"leaf",parent:-1,groupingKey:null},colDef:{type:"string",field:"__unset__",computedWidth:0},cellMode:xe.View,hasFocus:!1,tabIndex:-1,value:null,formattedValue:"__unset__",isEditable:!1,api:{}},lp=e=>{const{align:t,showLeftBorder:n,showRightBorder:r,pinnedPosition:o,isEditable:l,isSelected:s,isSelectionMode:a,classes:c}=e,u={root:["cell",`cell--text${kn(t)}`,s&&"selected",l&&"cell--editable",n&&"cell--withLeftBorder",r&&"cell--withRightBorder",o===lt.LEFT&&"cell--pinnedLeft",o===lt.RIGHT&&"cell--pinnedRight",a&&!l&&"cell--selectionMode"]};return de(u,ue,c)},sp=i.forwardRef(function(t,n){var le,he,pe;const{column:r,rowId:o,editCellState:l,align:s,colIndex:a,width:c,className:u,style:d,colSpan:f,disableDragEvents:g,isNotVisible:m,pinnedOffset:C,pinnedPosition:b,sectionIndex:p,sectionLength:S,gridHasFiller:x,onClick:D,onDoubleClick:E,onMouseDown:H,onMouseUp:G,onMouseOver:A,onKeyDown:F,onKeyUp:y,onDragEnter:_,onDragOver:$}=t,O=ne(t,op),P=ie(),L=Z(),I=Kt(),M=r.field,w=U(P,()=>{try{const ge=P.current.getCellParams(o,M);return ge.api=P.current,ge}catch(ge){if(ge instanceof Ho)return $s;throw ge}},Gi),j=U(P,()=>P.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:o,field:M})),T=U(P,uc),R=U(P,Xm),{cellMode:z,hasFocus:N,isEditable:B=!1,value:W}=w,X=r.type==="actions"&&((le=r.getActions)==null?void 0:le.call(r,P.current.getRowParams(o)).some(ge=>!ge.props.disabled)),q=(z==="view"||!B)&&!X?w.tabIndex:-1,{classes:te,getCellClassName:K}=L,J=[U(P,()=>P.current.unstable_applyPipeProcessors("cellClassName",[],{id:o,field:M}).filter(Boolean).join(" "))];r.cellClassName&&J.push(typeof r.cellClassName=="function"?r.cellClassName(w):r.cellClassName),r.display==="flex"&&J.push(k["cell--flex"]),K&&J.push(K(w));const se=w.formattedValue??W,oe=i.useRef(null),ae=Gt(n,oe),Le=i.useRef(null),Oe=L.cellSelection??!1,He=Pc[b],ve=ur(He,p),Ge=cr(He,p,S,L.showCellVerticalBorder,x),qe={align:s,showLeftBorder:ve,showRightBorder:Ge,isEditable:B,classes:L.classes,pinnedPosition:b,isSelected:j,isSelectionMode:Oe},ot=lp(qe),ft=i.useCallback(ge=>we=>{const Ie=P.current.getCellParams(o,M||"");P.current.publishEvent(ge,Ie,we),G&&G(we)},[P,M,G,o]),Ae=i.useCallback(ge=>we=>{const Ie=P.current.getCellParams(o,M||"");P.current.publishEvent(ge,Ie,we),H&&H(we)},[P,M,H,o]),be=i.useCallback((ge,we)=>Ie=>{if(!P.current.getRow(o))return;const tt=P.current.getCellParams(o,M||"");P.current.publishEvent(ge,tt,Ie),we&&we(Ie)},[P,M,o]),fe=((he=T[o])==null?void 0:he[M])??!1,ye=((pe=R[o])==null?void 0:pe[M])??1,Ee=i.useMemo(()=>{if(m)return{padding:0,opacity:0,width:0,border:0};const ge=h({"--width":`${c}px`},d),we=b===lt.LEFT,Ie=b===lt.RIGHT;if(we||Ie){let tt=we?"left":"right";I&&(tt=we?"right":"left"),ge[tt]=C}return ye>1&&(ge.height=`calc(var(--height) * ${ye})`,ge.zIndex=5),ge},[c,m,d,C,b,I,ye]);if(i.useEffect(()=>{if(!N||z===xe.Edit)return;const ge=Nt(P.current.rootElementRef.current);if(oe.current&&!oe.current.contains(ge.activeElement)){const we=oe.current.querySelector('[tabindex="0"]'),Ie=Le.current||we||oe.current;if(jh())Ie.focus({preventScroll:!0});else{const tt=P.current.getScrollPosition();Ie.focus(),P.current.scroll(tt)}}},[N,z,P]),fe)return v.jsx("div",{"data-colindex":a,role:"presentation",style:h({},Ee,{minWidth:"var(--width)",maxWidth:"var(--width)"})});if(w===$s)return null;let Fe=O.onFocus,Ce,Be;if(l===null&&r.renderCell&&(Ce=r.renderCell(w)),l!==null&&r.renderEditCell){const ge=P.current.getRowWithUpdatedValues(o,r.field),we=ne(l,rp),Ie=r.valueFormatter?r.valueFormatter(l.value,ge,r,P):w.formattedValue,tt=h({},w,{row:ge,formattedValue:Ie},we);Ce=r.renderEditCell(tt),J.push(k["cell--editing"]),J.push(te==null?void 0:te["cell--editing"])}if(Ce===void 0){const ge=se==null?void 0:se.toString();Ce=ge,Be=ge}i.isValidElement(Ce)&&X&&(Ce=i.cloneElement(Ce,{focusElementRef:Le}));const ze=g?null:{onDragEnter:be("cellDragEnter",_),onDragOver:be("cellDragOver",$)};return v.jsx("div",h({ref:ae,className:me(u,J,ot.root),role:"gridcell","data-field":M,"data-colindex":a,"aria-colindex":a+1,"aria-colspan":f,"aria-rowspan":ye,style:Ee,title:Be,tabIndex:q,onClick:be("cellClick",D),onDoubleClick:be("cellDoubleClick",E),onMouseOver:be("cellMouseOver",A),onMouseDown:Ae("cellMouseDown"),onMouseUp:ft("cellMouseUp"),onKeyDown:be("cellKeyDown",F),onKeyUp:be("cellKeyUp",y)},ze,O,{onFocus:Fe,children:Ce}))}),Ec=Yt(sp),ip=["label","icon","showInMenu","onClick"],ap=["label","icon","showInMenu","onClick","closeMenuOnClick","closeMenu"],cp=i.forwardRef((e,t)=>{var d;const n=Z();if(!e.showInMenu){const{label:f,icon:g,onClick:m}=e,C=ne(e,ip),b=p=>{m==null||m(p)};return v.jsx(n.slots.baseIconButton,h({ref:t,size:"small",role:"menuitem","aria-label":f},C,{onClick:b},(d=n.slotProps)==null?void 0:d.baseIconButton,{children:i.cloneElement(g,{fontSize:"small"})}))}const{label:r,icon:o,onClick:l,closeMenuOnClick:s=!0,closeMenu:a}=e,c=ne(e,ap),u=f=>{l==null||l(f),s&&(a==null||a())};return v.jsxs(yt,h({ref:t},c,{onClick:u,children:[o&&v.jsx(Vt,{children:o}),r]}))}),up=["field","type","align","width","height","empty","style","className"],As="1.3em",dp="1.2em",js=[40,80],fp={number:[40,60],string:[40,80],date:[40,60],dateTime:[60,80],singleSelect:[40,80]},gp=e=>{const{align:t,classes:n,empty:r}=e,o={root:["cell","cellSkeleton",`cell--text${t?kn(t):"Left"}`,r&&"cellEmpty"]};return de(o,ue,n)},mp=Og(12345);function hp(e){const{field:t,type:n,align:r,width:o,height:l,empty:s=!1,style:a,className:c}=e,u=ne(e,up),f={classes:Z().classes,align:r,empty:s},g=gp(f),m=i.useMemo(()=>{if(n==="boolean"||n==="actions")return{variant:"circular",width:As,height:As};const[b,p]=n?fp[n]??js:js;return{variant:"text",width:`${Math.round(mp(b,p))}%`,height:dp}},[n]);return v.jsx("div",h({"data-field":t,className:me(g.root,c),style:h({height:l,maxWidth:o,minWidth:o},a)},u,{children:!s&&v.jsx(ud,h({},m))}))}const Fc=Yt(hp);function pp(e){return e.vars?e.vars.palette.TableCell.border:e.palette.mode==="light"?fd(yn(e.palette.divider,1),.88):gd(yn(e.palette.divider,1),.68)}const zs={[`& .${k.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${k.menuIcon}`]:{width:"auto",visibility:"visible"}},Cp=10,Do=-5,hn=1,Vs={width:3,rx:1.5,x:10.5},bp="/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */",wp=je("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[{[`&.${k.autoHeight}`]:t.autoHeight},{[`&.${k.aggregationColumnHeader}`]:t.aggregationColumnHeader},{[`&.${k["aggregationColumnHeader--alignLeft"]}`]:t["aggregationColumnHeader--alignLeft"]},{[`&.${k["aggregationColumnHeader--alignCenter"]}`]:t["aggregationColumnHeader--alignCenter"]},{[`&.${k["aggregationColumnHeader--alignRight"]}`]:t["aggregationColumnHeader--alignRight"]},{[`&.${k.aggregationColumnHeaderLabel}`]:t.aggregationColumnHeaderLabel},{[`&.${k["root--disableUserSelection"]} .${k.cell}`]:t["root--disableUserSelection"]},{[`&.${k.autosizing}`]:t.autosizing},{[`& .${k.editBooleanCell}`]:t.editBooleanCell},{[`& .${k.cell}`]:t.cell},{[`& .${k["cell--editing"]}`]:t["cell--editing"]},{[`& .${k["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${k["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${k["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${k["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${k["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${k["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${k["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${k["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${k.cellCheckbox}`]:t.cellCheckbox},{[`& .${k.cellSkeleton}`]:t.cellSkeleton},{[`& .${k.checkboxInput}`]:t.checkboxInput},{[`& .${k["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${k["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${k["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${k["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${k["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${k["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${k["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${k["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${k["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${k.columnHeader}`]:t.columnHeader},{[`& .${k.headerFilterRow}`]:t.headerFilterRow},{[`& .${k.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${k.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${k.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${k["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${k["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${k.columnSeparator}`]:t.columnSeparator},{[`& .${k.filterIcon}`]:t.filterIcon},{[`& .${k.iconSeparator}`]:t.iconSeparator},{[`& .${k.menuIcon}`]:t.menuIcon},{[`& .${k.menuIconButton}`]:t.menuIconButton},{[`& .${k.menuOpen}`]:t.menuOpen},{[`& .${k.menuList}`]:t.menuList},{[`& .${k["row--editable"]}`]:t["row--editable"]},{[`& .${k["row--editing"]}`]:t["row--editing"]},{[`& .${k["row--dragging"]}`]:t["row--dragging"]},{[`& .${k.row}`]:t.row},{[`& .${k.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${k.rowReorderCell}`]:t.rowReorderCell},{[`& .${k["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${k.sortIcon}`]:t.sortIcon},{[`& .${k.withBorderColor}`]:t.withBorderColor},{[`& .${k.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${k.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${k.treeDataGroupingCellLoadingContainer}`]:t.treeDataGroupingCellLoadingContainer},{[`& .${k.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${k["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},t.root]})(({theme:e})=>{var x,D;const t=Et(),n=U(t,nt),r=pp(e),o=e.shape.borderRadius,l=e.vars?e.vars.palette.background.default:((x=e.mixins.MuiDataGrid)==null?void 0:x.containerBackground)??e.palette.background.default,s=((D=e.mixins.MuiDataGrid)==null?void 0:D.pinnedBackground)??l,a=e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:yn(e.palette.background.default,e.palette.action.disabledOpacity),c=(e.vars||e).palette.action.hoverOpacity,u=(e.vars||e).palette.action.hover,d=(e.vars||e).palette.action.selectedOpacity,f=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${d})`:yn(e.palette.primary.main,d),g=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc( + ${e.vars.palette.action.selectedOpacity} + + ${e.vars.palette.action.hoverOpacity} + ))`:yn(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),m=e.vars?u:yr(s,u,c),C=e.vars?f:yr(s,f,d),b=e.vars?u:yr(C,u,c),p={backgroundColor:f,"&:hover":{backgroundColor:g,"@media (hover: none)":{backgroundColor:f}}};return h({"--unstable_DataGrid-radius":typeof o=="number"?`${o}px`:o,"--unstable_DataGrid-headWeight":e.typography.fontWeightMedium,"--unstable_DataGrid-overlayBackground":a,"--DataGrid-containerBackground":l,"--DataGrid-pinnedBackground":s,"--DataGrid-rowBorderColor":r,"--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:r,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",[`.${k.main} > *:first-child${bp}`]:{borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"},[`&.${k.autoHeight}`]:{height:"auto"},[`&.${k.autosizing}`]:{[`& .${k.columnHeaderTitleContainerContent} > *`]:{overflow:"visible !important"},"@media (hover: hover)":{[`& .${k.iconButtonContainer}`]:{width:"0 !important",visibility:"hidden !important"},[`& .${k.menuIcon}`]:{width:"0 !important",visibility:"hidden !important"}},[`& .${k.cell}`]:{overflow:"visible !important",whiteSpace:"nowrap",minWidth:"max-content !important",maxWidth:"max-content !important"},[`& .${k.groupingCriteriaCell}`]:{width:"unset"},[`& .${k.treeDataGroupingCell}`]:{width:"unset"}},[`& .${k.columnHeader}, & .${k.cell}`]:{WebkitTapHighlightColor:"transparent",padding:"0 10px",boxSizing:"border-box"},[`& .${k.columnHeader}:focus-within, & .${k.cell}:focus-within`]:{outline:`solid ${e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.5)`:yn(e.palette.primary.main,.5)} ${hn}px`,outlineOffset:hn*-1},[`& .${k.columnHeader}:focus, & .${k.cell}:focus`]:{outline:`solid ${e.palette.primary.main} ${hn}px`,outlineOffset:hn*-1},[`& .${k.columnHeader}:focus, + & .${k["columnHeader--withLeftBorder"]}, + & .${k["columnHeader--withRightBorder"]}, + & .${k["columnHeader--siblingFocused"]}, + & .${k["virtualScroller--hasScrollX"]} .${k["columnHeader--lastUnpinned"]}, + & .${k["virtualScroller--hasScrollX"]} .${k["columnHeader--last"]} + `]:{[`& .${k.columnSeparator}`]:{opacity:0},"@media (hover: none)":{[`& .${k["columnSeparator--resizable"]}`]:{opacity:1}},[`& .${k["columnSeparator--resizable"]}:hover`]:{opacity:1}},[`&.${k["root--noToolbar"]} [aria-rowindex="1"] [aria-colindex="1"]`]:{borderTopLeftRadius:"calc(var(--unstable_DataGrid-radius) - 1px)"},[`&.${k["root--noToolbar"]} [aria-rowindex="1"] .${k["columnHeader--last"]}`]:{borderTopRightRadius:n.hasScrollX&&(!n.hasScrollY||n.scrollbarSize===0)?"calc(var(--unstable_DataGrid-radius) - 1px)":void 0},[`& .${k.columnHeaderCheckbox}, & .${k.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${k.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center"},[`& .${k["virtualScroller--hasScrollX"]} .${k["columnHeader--last"]}`]:{overflow:"hidden"},[`& .${k["columnHeader--sorted"]} .${k.iconButtonContainer}, & .${k["columnHeader--filtered"]} .${k.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${k.columnHeader}:not(.${k["columnHeader--sorted"]}) .${k.sortIcon}`]:{opacity:0,transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter})},[`& .${k.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",gap:e.spacing(.25),minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden"},[`& .${k.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${k["columnHeader--filledGroup"]} .${k.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${k.sortIcon}, & .${k.filterIcon}`]:{fontSize:"inherit"},[`& .${k["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${k["columnHeader--alignCenter"]} .${k.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${k["columnHeader--alignRight"]} .${k.columnHeaderDraggableContainer}, & .${k["columnHeader--alignRight"]} .${k.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${k["columnHeader--alignCenter"]} .${k.menuIcon}`]:{marginLeft:"auto"},[`& .${k["columnHeader--alignRight"]} .${k.menuIcon}`]:{marginRight:"auto",marginLeft:-5},[`& .${k["columnHeader--moving"]}`]:{backgroundColor:(e.vars||e).palette.action.hover},[`& .${k["columnHeader--pinnedLeft"]}, & .${k["columnHeader--pinnedRight"]}`]:{position:"sticky",zIndex:4,background:"var(--DataGrid-pinnedBackground)"},[`& .${k.columnSeparator}`]:{position:"absolute",overflow:"hidden",zIndex:3,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",maxWidth:Cp,color:r},[`& .${k.columnHeaders}`]:{width:"var(--DataGrid-rowWidth)"},"@media (hover: hover)":{[`& .${k.columnHeader}:hover`]:zs,[`& .${k.columnHeader}:not(.${k["columnHeader--sorted"]}):hover .${k.sortIcon}`]:{opacity:.5}},"@media (hover: none)":{[`& .${k.columnHeader}`]:zs,[`& .${k.columnHeader}:focus, + & .${k["columnHeader--siblingFocused"]}`]:{[`.${k["columnSeparator--resizable"]}`]:{color:(e.vars||e).palette.primary.main}}},[`& .${k["columnSeparator--sideLeft"]}`]:{left:Do},[`& .${k["columnSeparator--sideRight"]}`]:{right:Do},[`& .${k["columnHeader--withRightBorder"]} .${k["columnSeparator--sideLeft"]}`]:{left:Do-.5},[`& .${k["columnHeader--withRightBorder"]} .${k["columnSeparator--sideRight"]}`]:{right:Do-.5},[`& .${k["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none",[`&.${k["columnSeparator--resizing"]}`]:{color:(e.vars||e).palette.primary.main},"@media (hover: none)":{[`& .${k.iconSeparator} rect`]:Vs},"@media (hover: hover)":{"&:hover":{color:(e.vars||e).palette.primary.main,[`& .${k.iconSeparator} rect`]:Vs}},"& svg":{pointerEvents:"none"}},[`& .${k.iconSeparator}`]:{color:"inherit",transition:e.transitions.create(["color","width"],{duration:e.transitions.duration.shortest})},[`& .${k.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-5,display:"flex",alignItems:"center"},[`.${k.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${k.headerFilterRow}`]:{[`& .${k.columnHeader}`]:{boxSizing:"border-box",borderBottom:"1px solid var(--DataGrid-rowBorderColor)"}},[`& .${k["row--borderBottom"]} .${k.columnHeader}, + & .${k["row--borderBottom"]} .${k.filler}, + & .${k["row--borderBottom"]} .${k.scrollbarFiller}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${k["row--borderBottom"]} .${k.cell}`]:{borderBottom:"1px solid var(--rowBorderColor)"},[`.${k.row}`]:{display:"flex",width:"var(--DataGrid-rowWidth)",breakInside:"avoid","--rowBorderColor":"var(--DataGrid-rowBorderColor)",[`&.${k["row--firstVisible"]}`]:{"--rowBorderColor":"transparent"},"&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${k.rowSkeleton}:hover`]:{backgroundColor:"transparent"},"&.Mui-selected":p},[`& .${k["container--top"]}, & .${k["container--bottom"]}`]:{"[role=row]":{background:"var(--DataGrid-containerBackground)"}},[`& .${k.cell}`]:{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":p},[`& .${k["virtualScrollerContent--overflowed"]} .${k["row--lastVisible"]} .${k.cell}`]:{borderTopColor:"transparent"},[`& .${k["pinnedRows--top"]} :first-of-type`]:{[`& .${k.cell}, .${k.scrollbarFiller}`]:{borderTop:"none"}},[`&.${k["root--disableUserSelection"]} .${k.cell}`]:{userSelect:"none"},[`& .${k["row--dynamicHeight"]} > .${k.cell}`]:{whiteSpace:"initial",lineHeight:"inherit"},[`& .${k.cellEmpty}`]:{padding:0,height:"unset"},[`& .${k.cell}.${k["cell--selectionMode"]}`]:{cursor:"default"},[`& .${k.cell}.${k["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:e.shadows[2],backgroundColor:(e.vars||e).palette.background.paper,"&:focus-within":{outline:`${hn}px solid ${(e.vars||e).palette.primary.main}`,outlineOffset:hn*-1}},[`& .${k["row--editing"]}`]:{boxShadow:e.shadows[2]},[`& .${k["row--editing"]} .${k.cell}`]:{boxShadow:e.shadows[0],backgroundColor:(e.vars||e).palette.background.paper},[`& .${k.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${k.booleanCell}[data-value="true"]`]:{color:(e.vars||e).palette.text.secondary},[`& .${k.booleanCell}[data-value="false"]`]:{color:(e.vars||e).palette.text.disabled},[`& .${k.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:e.spacing(1)},[`& .${k.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${k["rowReorderCell--draggable"]}`]:{cursor:"move",opacity:1},[`& .${k.rowReorderCellContainer}`]:{padding:0,display:"flex",alignItems:"stretch"},[`.${k.withBorderColor}`]:{borderColor:r},[`& .${k["cell--withLeftBorder"]}, & .${k["columnHeader--withLeftBorder"]}`]:{borderLeftColor:"var(--DataGrid-rowBorderColor)",borderLeftWidth:"1px",borderLeftStyle:"solid"},[`& .${k["cell--withRightBorder"]}, & .${k["columnHeader--withRightBorder"]}`]:{borderRightColor:"var(--DataGrid-rowBorderColor)",borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${k["cell--flex"]}`]:{display:"flex",alignItems:"center",lineHeight:"inherit"},[`& .${k["cell--textLeft"]}`]:{textAlign:"left",justifyContent:"flex-start"},[`& .${k["cell--textRight"]}`]:{textAlign:"right",justifyContent:"flex-end"},[`& .${k["cell--textCenter"]}`]:{textAlign:"center",justifyContent:"center"},[`& .${k["cell--pinnedLeft"]}, & .${k["cell--pinnedRight"]}`]:{position:"sticky",zIndex:3,background:"var(--DataGrid-pinnedBackground)"},[`& .${k.virtualScrollerContent} .${k.row}`]:{"&:hover":{[`& .${k["cell--pinnedLeft"]}, & .${k["cell--pinnedRight"]}`]:{backgroundColor:m}},"&.Mui-selected":{[`& .${k["cell--pinnedLeft"]}, & .${k["cell--pinnedRight"]}`]:{backgroundColor:C},"&:hover":{[`& .${k["cell--pinnedLeft"]}, & .${k["cell--pinnedRight"]}`]:{backgroundColor:b}}}},[`& .${k.cellOffsetLeft}`]:{flex:"0 0 auto",display:"inline-block"},[`& .${k.cellSkeleton}`]:{flex:"0 0 auto",height:"100%",display:"inline-flex",alignItems:"center"},[`& .${k.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${k.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${k["columnHeader--dragging"]}, & .${k["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${k["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity,[`& .${k.rowReorderCellPlaceholder}`]:{display:"flex"}},[`& .${k.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${k.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`& .${k.treeDataGroupingCellLoadingContainer}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},[`& .${k.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${k.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`.${k.scrollbarFiller}`]:{minWidth:"calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",alignSelf:"stretch",[`&.${k["scrollbarFiller--borderTop"]}`]:{borderTop:"1px solid var(--DataGrid-rowBorderColor)"},[`&.${k["scrollbarFiller--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`&.${k["scrollbarFiller--pinnedRight"]}`]:{backgroundColor:"var(--DataGrid-pinnedBackground)",position:"sticky",right:0}},[`& .${k.filler}`]:{flex:1},[`& .${k["filler--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${k["main--hasSkeletonLoadingOverlay"]}`]:{[`& .${k.virtualScrollerContent}`]:{position:"fixed",visibility:"hidden"},[`& .${k["scrollbar--vertical"]}, & .${k.pinnedRows}, & .${k.virtualScroller} > .${k.filler}`]:{display:"none"}}})});function yr(e,t,n,r=1){const o=(c,u)=>Math.round((c**(1/r)*(1-n)+u**(1/r)*n)**r),l=Vl(e),s=Vl(t),a=[o(l.values[0],s.values[0]),o(l.values[1],s.values[1]),o(l.values[2],s.values[2])];return dd({type:"rgb",values:a})}const Sp=["className"],yp=(e,t)=>{const{autoHeight:n,classes:r,showCellVerticalBorder:o}=e,l={root:["root",n&&"autoHeight",`root--density${kn(t)}`,e.slots.toolbar===null&&"root--noToolbar","withBorderColor",o&&"withVerticalBorder"]};return de(l,ue,r)},kc=i.forwardRef(function(t,n){const r=Z(),{className:o}=t,l=ne(t,Sp),s=Et(),a=U(s,zt),c=s.current.rootElementRef,u=Gt(c,n),d=r,f=yp(d,a),[g,m]=i.useState(!1);return Ye(()=>{m(!0)},[]),g?v.jsx(wp,h({ref:u,className:me(o,f.root),ownerState:d},l)):null}),xp=["className"],vp=e=>{const{classes:t}=e;return de({root:["footerContainer","withBorderColor"]},ue,t)},Ip=Se("div",{name:"MuiDataGrid",slot:"FooterContainer",overridesResolver:(e,t)=>t.footerContainer})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),Dc=i.forwardRef(function(t,n){const{className:r}=t,o=ne(t,xp),l=Z(),s=vp(l);return v.jsx(Ip,h({ref:n,className:me(s.root,r),ownerState:l},o))}),Mp=["className"],Pp=e=>{const{classes:t}=e;return de({root:["overlay"]},ue,t)},Ep=Se("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)"}),dr=i.forwardRef(function(t,n){const{className:r}=t,o=ne(t,Mp),l=Z(),s=Pp(l);return v.jsx(Ep,h({ref:n,className:me(s.root,r),ownerState:l},o))}),Fp=["className","children"],kp=e=>{const{classes:t}=e;return de({root:["toolbarContainer"]},ue,t)},Dp=Se("div",{name:"MuiDataGrid",slot:"ToolbarContainer",overridesResolver:(e,t)=>t.toolbarContainer})(({theme:e})=>({display:"flex",alignItems:"center",flexWrap:"wrap",gap:e.spacing(1),padding:e.spacing(.5,.5,0)})),Tc=i.forwardRef(function(t,n){const{className:r,children:o}=t,l=ne(t,Fp),s=Z(),a=kp(s);return o?v.jsx(Dp,h({ref:n,className:me(r,a.root),ownerState:s},l,{children:o})):null}),Tp=e=>{const{classes:t,open:n}=e;return de({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},ue,t)},Op=i.memo(e=>{var f,g;const{colDef:t,open:n,columnMenuId:r,columnMenuButtonId:o,iconButtonRef:l}=e,s=ie(),a=Z(),c=h({},e,{classes:a.classes}),u=Tp(c),d=i.useCallback(m=>{m.preventDefault(),m.stopPropagation(),s.current.toggleColumnMenu(t.field)},[s,t.field]);return v.jsx("div",{className:u.root,children:v.jsx(a.slots.baseTooltip,h({title:s.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},(f=a.slotProps)==null?void 0:f.baseTooltip,{children:v.jsx(a.slots.baseIconButton,h({ref:l,tabIndex:-1,className:u.button,"aria-label":s.current.getLocaleText("columnMenuLabel"),size:"small",onClick:d,"aria-haspopup":"menu","aria-expanded":n,"aria-controls":n?r:void 0,id:o},(g=a.slotProps)==null?void 0:g.baseIconButton,{children:v.jsx(a.slots.columnMenuIcon,{fontSize:"inherit"})}))}))})});function Oc({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:r,field:o,open:l,target:s,onExited:a}){const c=ie(),u=c.current.getColumn(o),d=Re(f=>{f&&(f.stopPropagation(),s!=null&&s.contains(f.target))||c.current.hideColumnMenu()});return!s||!u?null:v.jsx(Qn,{placement:`bottom-${u.align==="right"?"start":"end"}`,open:l,target:s,onClose:d,onExited:a,children:v.jsx(n,h({colDef:u,hideMenu:d,open:l,id:e,labelledby:t},r))})}const Hp=["className","aria-label"],_p=e=>{const{classes:t}=e;return de({root:["columnHeaderTitle"]},ue,t)},Lp=Se("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle",overridesResolver:(e,t)=>t.columnHeaderTitle})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)",lineHeight:"normal"}),Gp=i.forwardRef(function(t,n){const{className:r}=t,o=ne(t,Hp),l=Z(),s=_p(l);return v.jsx(Lp,h({ref:n,className:me(s.root,r),ownerState:l},o))});function Hc(e){var c;const{label:t,description:n}=e,r=Z(),o=i.useRef(null),[l,s]=i.useState(""),a=i.useCallback(()=>{if(!n&&(o!=null&&o.current)){const u=zh(o.current);s(u?t:"")}},[n,t]);return v.jsx(r.slots.baseTooltip,h({title:n||l},(c=r.slotProps)==null?void 0:c.baseTooltip,{children:v.jsx(Gp,{onMouseOver:a,ref:o,children:t})}))}const Rp=["resizable","resizing","height","side"];var fr=function(e){return e.Left="left",e.Right="right",e}(fr||{});const $p=e=>{const{resizable:t,resizing:n,classes:r,side:o}=e,l={root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",o&&`columnSeparator--side${kn(o)}`],icon:["iconSeparator"]};return de(l,ue,r)};function Ap(e){const{height:t,side:n=fr.Right}=e,r=ne(e,Rp),o=Z(),l=h({},e,{side:n,classes:o.classes}),s=$p(l),a=i.useCallback(c=>{c.preventDefault(),c.stopPropagation()},[]);return v.jsx("div",h({className:s.root,style:{minHeight:t}},r,{onClick:a,children:v.jsx(o.slots.columnResizeIcon,{className:s.icon})}))}const _c=i.memo(Ap),jp=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps","style"],Lc=i.forwardRef(function(t,n){const{classes:r,colIndex:o,height:l,isResizing:s,sortDirection:a,hasFocus:c,tabIndex:u,separatorSide:d,isDraggable:f,headerComponent:g,description:m,width:C,columnMenuIconButton:b=null,columnMenu:p=null,columnTitleIconButtons:S=null,headerClassName:x,label:D,resizable:E,draggableContainerProps:H,columnHeaderSeparatorProps:G,style:A}=t,F=ne(t,jp),y=Et(),_=Z(),$=i.useRef(null),O=Gt($,n);let P="none";return a!=null&&(P=a==="asc"?"ascending":"descending"),i.useLayoutEffect(()=>{var I;const L=y.current.state.columnMenu;if(c&&!L.open){const w=$.current.querySelector('[tabindex="0"]')||$.current;w==null||w.focus(),(I=y.current.columnHeadersContainerRef)!=null&&I.current&&(y.current.columnHeadersContainerRef.current.scrollLeft=0)}},[y,c]),v.jsxs("div",h({ref:O,className:me(r.root,x),style:h({},A,{height:l,width:C}),role:"columnheader",tabIndex:u,"aria-colindex":o+1,"aria-sort":P},F,{children:[v.jsxs("div",h({className:r.draggableContainer,draggable:f,role:"presentation"},H,{children:[v.jsxs("div",{className:r.titleContainer,role:"presentation",children:[v.jsx("div",{className:r.titleContainerContent,children:g!==void 0?g:v.jsx(Hc,{label:D,description:m,columnWidth:C})}),S]}),b]})),v.jsx(_c,h({resizable:!_.disableColumnResize&&!!E,resizing:s,height:l,side:d},G)),p]}))}),zp=e=>{const{colDef:t,classes:n,isDragging:r,sortDirection:o,showRightBorder:l,showLeftBorder:s,filterItemsCounter:a,pinnedPosition:c,isLastUnpinned:u,isSiblingFocused:d}=e,f=o!=null,g=a!=null&&a>0,m=t.type==="number",C={root:["columnHeader",t.headerAlign==="left"&&"columnHeader--alignLeft",t.headerAlign==="center"&&"columnHeader--alignCenter",t.headerAlign==="right"&&"columnHeader--alignRight",t.sortable&&"columnHeader--sortable",r&&"columnHeader--moving",f&&"columnHeader--sorted",g&&"columnHeader--filtered",m&&"columnHeader--numeric","withBorderColor",l&&"columnHeader--withRightBorder",s&&"columnHeader--withLeftBorder",c==="left"&&"columnHeader--pinnedLeft",c==="right"&&"columnHeader--pinnedRight",u&&"columnHeader--lastUnpinned",d&&"columnHeader--siblingFocused"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return de(C,ue,n)};function Vp(e){var Q,J,se;const{colDef:t,columnMenuOpen:n,colIndex:r,headerHeight:o,isResizing:l,isLast:s,sortDirection:a,sortIndex:c,filterItemsCounter:u,hasFocus:d,tabIndex:f,disableReorder:g,separatorSide:m,style:C,pinnedPosition:b,indexInSection:p,sectionLength:S,gridHasFiller:x}=e,D=Et(),E=Z(),H=i.useRef(null),G=_e(),A=_e(),F=i.useRef(null),[y,_]=i.useState(n),$=i.useMemo(()=>!E.disableColumnReorder&&!g&&!t.disableReorder,[E.disableColumnReorder,g,t.disableReorder]);let O;t.renderHeader&&(O=t.renderHeader(D.current.getColumnHeaderParams(t.field)));const P=ur(b,p),L=cr(b,p,S,E.showColumnVerticalBorder,x),I=h({},e,{classes:E.classes,showRightBorder:L,showLeftBorder:P}),M=zp(I),w=i.useCallback(oe=>ae=>{io(ae)||D.current.publishEvent(oe,D.current.getColumnHeaderParams(t.field),ae)},[D,t.field]),j=i.useMemo(()=>({onClick:w("columnHeaderClick"),onDoubleClick:w("columnHeaderDoubleClick"),onMouseOver:w("columnHeaderOver"),onMouseOut:w("columnHeaderOut"),onMouseEnter:w("columnHeaderEnter"),onMouseLeave:w("columnHeaderLeave"),onKeyDown:w("columnHeaderKeyDown"),onFocus:w("columnHeaderFocus"),onBlur:w("columnHeaderBlur")}),[w]),T=i.useMemo(()=>$?{onDragStart:w("columnHeaderDragStart"),onDragEnter:w("columnHeaderDragEnter"),onDragOver:w("columnHeaderDragOver"),onDragEnd:w("columnHeaderDragEnd")}:{},[$,w]),R=i.useMemo(()=>({onMouseDown:w("columnSeparatorMouseDown"),onDoubleClick:w("columnSeparatorDoubleClick")}),[w]);i.useEffect(()=>{y||_(n)},[y,n]);const z=i.useCallback(()=>{_(!1)},[]),N=!E.disableColumnMenu&&!t.disableColumnMenu&&v.jsx(Op,{colDef:t,columnMenuId:G,columnMenuButtonId:A,open:y,iconButtonRef:F}),B=v.jsx(Oc,{columnMenuId:G,columnMenuButtonId:A,field:t.field,open:n,target:F.current,ContentComponent:E.slots.columnMenu,contentComponentProps:(Q=E.slotProps)==null?void 0:Q.columnMenu,onExited:z}),W=t.sortingOrder??E.sortingOrder,X=(t.sortable||a!=null)&&!t.hideSortIcons&&!E.disableColumnSorting,q=v.jsxs(i.Fragment,{children:[!E.disableColumnFilter&&v.jsx(E.slots.columnHeaderFilterIconButton,h({field:t.field,counter:u},(J=E.slotProps)==null?void 0:J.columnHeaderFilterIconButton)),X&&v.jsx(E.slots.columnHeaderSortIcon,h({field:t.field,direction:a,index:c,sortingOrder:W,disabled:!t.sortable},(se=E.slotProps)==null?void 0:se.columnHeaderSortIcon))]});i.useLayoutEffect(()=>{var ae;const oe=D.current.state.columnMenu;if(d&&!oe.open){const Oe=H.current.querySelector('[tabindex="0"]')||H.current;Oe==null||Oe.focus(),(ae=D.current.columnHeadersContainerRef)!=null&&ae.current&&(D.current.columnHeadersContainerRef.current.scrollLeft=0)}},[D,d]);const te=typeof t.headerClassName=="function"?t.headerClassName({field:t.field,colDef:t}):t.headerClassName,K=t.headerName??t.field;return v.jsx(Lc,h({ref:H,classes:M,columnMenuOpen:n,colIndex:r,height:o,isResizing:l,sortDirection:a,hasFocus:d,tabIndex:f,separatorSide:m,isDraggable:$,headerComponent:O,description:t.description,elementId:t.field,width:t.computedWidth,columnMenuIconButton:N,columnTitleIconButtons:q,headerClassName:me(te,s&&k["columnHeader--last"]),label:K,resizable:!E.disableColumnResize&&!!t.resizable,"data-field":t.field,columnMenu:B,draggableContainerProps:T,columnHeaderSeparatorProps:R,style:C},j))}const Gc=Yt(Vp),Np=["className"],Bp=e=>{const{classes:t}=e;return de({root:["iconButtonContainer"]},ue,t)},Up=Se("div",{name:"MuiDataGrid",slot:"IconButtonContainer",overridesResolver:(e,t)=>t.iconButtonContainer})(()=>({display:"flex",visibility:"hidden",width:0})),Rc=i.forwardRef(function(t,n){const{className:r}=t,o=ne(t,Np),l=Z(),s=Bp(l);return v.jsx(Up,h({ref:n,className:me(s.root,r),ownerState:l},o))}),Wp=["direction","index","sortingOrder","disabled"],qp=e=>{const{classes:t}=e;return de({icon:["sortIcon"]},ue,t)};function Kp(e,t,n,r){let o;const l={};return t==="asc"?o=e.columnSortedAscendingIcon:t==="desc"?o=e.columnSortedDescendingIcon:(o=e.columnUnsortedIcon,l.sortingOrder=r),o?v.jsx(o,h({fontSize:"small",className:n},l)):null}function Xp(e){var g;const{direction:t,index:n,sortingOrder:r,disabled:o}=e,l=ne(e,Wp),s=ie(),a=Z(),c=h({},e,{classes:a.classes}),u=qp(c),d=Kp(a.slots,t,u.icon,r);if(!d)return null;const f=v.jsx(a.slots.baseIconButton,h({tabIndex:-1,"aria-label":s.current.getLocaleText("columnHeaderSortIconLabel"),title:s.current.getLocaleText("columnHeaderSortIconLabel"),size:"small",disabled:o},(g=a.slotProps)==null?void 0:g.baseIconButton,l,{children:d}));return v.jsxs(Rc,{children:[n!=null&&v.jsx(Xr,{badgeContent:n,color:"default",overlap:"circular",children:f}),n==null&&f]})}const $c=i.memo(Xp),Yp=e=>{const{classes:t}=e;return de({icon:["filterIcon"]},ue,t)};function Ac(e){var C,b;const{counter:t,field:n,onClick:r}=e,o=ie(),l=Z(),s=h({},e,{classes:l.classes}),a=Yp(s),c=U(o,Wt),u=_e(),d=_e(),f=i.useCallback(p=>{p.preventDefault(),p.stopPropagation();const{open:S,openedPanelValue:x}=Wt(o.current.state);S&&x===bt.filters?o.current.hideFilterPanel():o.current.showFilterPanel(void 0,d,u),r&&r(o.current.getColumnHeaderParams(n),p)},[o,n,r,d,u]);if(!t)return null;const g=c.open&&c.labelId===u,m=v.jsx(l.slots.baseIconButton,h({id:u,onClick:f,color:"default","aria-label":o.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":g,"aria-controls":g?d:void 0},(C=l.slotProps)==null?void 0:C.baseIconButton,{children:v.jsx(l.slots.columnFilteredIcon,{className:a.icon,fontSize:"small"})}));return v.jsx(l.slots.baseTooltip,h({title:o.current.getLocaleText("columnHeaderFiltersTooltipActive")(t),enterDelay:1e3},(b=l.slotProps)==null?void 0:b.baseTooltip,{children:v.jsxs(Rc,{children:[t>1&&v.jsx(Xr,{badgeContent:t,color:"default",children:m}),t===1&&m]})}))}const Lr=Te(v.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward"),Gr=Te(v.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward"),Rr=Te(v.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight"),$r=Te(v.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),jc=Te(v.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),Ar=Te(v.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"),zc=Te(v.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"),Qp=Te(v.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu"),Jp=Te(v.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"),Vc=Te(v.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"),Nc=Te(v.jsx("rect",{width:"1",height:"24",x:"11.5",rx:"0.5"}),"Separator"),Bc=Te(v.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"}),"ViewHeadline"),Uc=Te(v.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"}),"TableRows"),Wc=Te(v.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"}),"ViewStream"),qc=Te(v.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"),_o=Te(v.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"),jr=Te(v.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),Kc=Te(v.jsx("path",{d:"M19 13H5v-2h14v2z"}),"Remove"),Xc=Te(v.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"),zr=Te(v.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"),Yc=Te(v.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"),Qc=Te(v.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),Jc=Te(v.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"),Zc=Te(v.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"),eu=Te(v.jsx("g",{children:v.jsx("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})}),"ViewColumn"),tu=Te(v.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"),Zp=Te(v.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"),nu=Te(v.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 ou(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}const zo=e=>e.indexOf("Arrow")===0||e.indexOf("Page")===0||e===" "||e==="Home"||e==="End",eC=e=>!!e.key,Dl=e=>e==="Tab"||e==="Escape";function ru(e){return!!((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()==="v"&&!e.shiftKey&&!e.altKey)}const tC=["hideMenu","colDef","id","labelledby","className","children","open"],nC=je(qo)(()=>({minWidth:248})),lu=i.forwardRef(function(t,n){const{hideMenu:r,id:o,labelledby:l,className:s,children:a,open:c}=t,u=ne(t,tC),d=i.useCallback(f=>{f.key==="Tab"&&f.preventDefault(),Dl(f.key)&&r(f)},[r]);return v.jsx(nC,h({id:o,ref:n,className:me(k.menuList,s),"aria-labelledby":l,onKeyDown:d,autoFocus:c},u,{children:a}))}),oC=["displayOrder"],rC=e=>{const t=Et(),{defaultSlots:n,defaultSlotProps:r,slots:o={},slotProps:l={},hideMenu:s,colDef:a,addDividers:c=!0}=e,u=i.useMemo(()=>h({},n,o),[n,o]),d=i.useMemo(()=>{if(!l||Object.keys(l).length===0)return r;const m=h({},l);return Object.entries(r).forEach(([C,b])=>{m[C]=h({},b,l[C]||{})}),m},[r,l]),f=t.current.unstable_applyPipeProcessors("columnMenu",[],e.colDef),g=i.useMemo(()=>{const m=Object.keys(n);return Object.keys(o).filter(C=>!m.includes(C))},[o,n]);return i.useMemo(()=>{const b=Array.from(new Set([...f,...g])).filter(p=>u[p]!=null).sort((p,S)=>{const x=d[p],D=d[S],E=Number.isFinite(x==null?void 0:x.displayOrder)?x.displayOrder:100,H=Number.isFinite(D==null?void 0:D.displayOrder)?D.displayOrder:100;return E-H});return b.reduce((p,S,x)=>{let D={colDef:a,onClick:s};const E=d[S];if(E){const H=ne(E,oC);D=h({},D,H)}return c&&x!==b.length-1?[...p,[u[S],D],[md,{}]]:[...p,[u[S],D]]},[])},[c,a,f,s,u,d,g])};function su(e){const{colDef:t,onClick:n}=e,r=ie(),o=Z(),a=Ne(r).filter(u=>u.disableColumnMenu!==!0).length===1,c=i.useCallback(u=>{a||(r.current.setColumnVisibility(t.field,!1),n(u))},[r,t.field,n,a]);return o.disableColumnSelector||t.hideable===!1?null:v.jsxs(yt,{onClick:c,disabled:a,children:[v.jsx(Vt,{children:v.jsx(o.slots.columnMenuHideIcon,{fontSize:"small"})}),v.jsx(vn,{children:r.current.getLocaleText("columnMenuHideColumn")})]})}function iu(e){const{onClick:t}=e,n=ie(),r=Z(),o=i.useCallback(l=>{t(l),n.current.showPreferences(bt.columns)},[n,t]);return r.disableColumnSelector?null:v.jsxs(yt,{onClick:o,children:[v.jsx(Vt,{children:v.jsx(r.slots.columnMenuManageColumnsIcon,{fontSize:"small"})}),v.jsx(vn,{children:n.current.getLocaleText("columnMenuManageColumns")})]})}function au(e){return v.jsxs(i.Fragment,{children:[v.jsx(su,h({},e)),v.jsx(iu,h({},e))]})}function cu(e){const{colDef:t,onClick:n}=e,r=ie(),o=Z(),l=i.useCallback(s=>{n(s),r.current.showFilterPanel(t.field)},[r,t.field,n]);return o.disableColumnFilter||!t.filterable?null:v.jsxs(yt,{onClick:l,children:[v.jsx(Vt,{children:v.jsx(o.slots.columnMenuFilterIcon,{fontSize:"small"})}),v.jsx(vn,{children:r.current.getLocaleText("columnMenuFilter")})]})}function uu(e){const{colDef:t,onClick:n}=e,r=ie(),o=U(r,at),l=Z(),s=i.useMemo(()=>{if(!t)return null;const d=o.find(f=>f.field===t.field);return d==null?void 0:d.sort},[t,o]),a=t.sortingOrder??l.sortingOrder,c=i.useCallback(d=>{n(d);const f=d.currentTarget.getAttribute("data-value")||null;r.current.sortColumn(t.field,f===s?null:f)},[r,t,n,s]);if(l.disableColumnSorting||!t||!t.sortable||!a.some(d=>!!d))return null;const u=d=>{const f=r.current.getLocaleText(d);return typeof f=="function"?f(t):f};return v.jsxs(i.Fragment,{children:[a.includes("asc")&&s!=="asc"?v.jsxs(yt,{onClick:c,"data-value":"asc",children:[v.jsx(Vt,{children:v.jsx(l.slots.columnMenuSortAscendingIcon,{fontSize:"small"})}),v.jsx(vn,{children:u("columnMenuSortAsc")})]}):null,a.includes("desc")&&s!=="desc"?v.jsxs(yt,{onClick:c,"data-value":"desc",children:[v.jsx(Vt,{children:v.jsx(l.slots.columnMenuSortDescendingIcon,{fontSize:"small"})}),v.jsx(vn,{children:u("columnMenuSortDesc")})]}):null,a.includes(null)&&s!=null?v.jsxs(yt,{onClick:c,children:[v.jsx(Vt,{}),v.jsx(vn,{children:r.current.getLocaleText("columnMenuUnsort")})]}):null]})}const lC=["defaultSlots","defaultSlotProps","slots","slotProps"],du={columnMenuSortItem:uu,columnMenuFilterItem:cu,columnMenuColumnsItem:au},fu={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},gu=i.forwardRef(function(t,n){const{defaultSlots:r,defaultSlotProps:o,slots:l,slotProps:s}=t,a=ne(t,lC),c=rC(h({},a,{defaultSlots:r,defaultSlotProps:o,slots:l,slotProps:s}));return v.jsx(lu,h({ref:n},a,{children:c.map(([u,d],f)=>v.jsx(u,h({},d),f))}))}),mu=i.forwardRef(function(t,n){return v.jsx(gu,h({},t,{ref:n,defaultSlots:du,defaultSlotProps:fu}))}),sC=["className","slotProps"],iC=e=>{const{classes:t}=e;return de({root:["panelWrapper"]},ue,t)},aC=je("div",{name:"MuiDataGrid",slot:"PanelWrapper",overridesResolver:(e,t)=>t.panelWrapper})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),cC=()=>!0,Tl=i.forwardRef(function(t,n){const{className:r,slotProps:o={}}=t,l=ne(t,sC),s=Z(),a=iC(s);return v.jsx(hd,h({open:!0,disableEnforceFocus:!0,isEnabled:cC},o.TrapFocus,{children:v.jsx(aC,h({ref:n,tabIndex:-1,className:me(r,a.root),ownerState:s},l))}))}),uC=(e,t)=>{const n=new Set(Object.keys(e).filter(l=>e[l]===!1)),r=new Set(Object.keys(t).filter(l=>t[l]===!1));if(n.size!==r.size)return!1;let o=!0;return n.forEach(l=>{r.has(l)||(o=!1)}),o},dC=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1,fC=e=>{const{classes:t}=e;return de({root:["columnsManagement"],header:["columnsManagementHeader"],footer:["columnsManagementFooter"],row:["columnsManagementRow"]},ue,t)},Ns=new Intl.Collator;function Ol(e){var P,L,I;const t=ie(),n=i.useRef(null),r=U(t,pt),o=Xt(()=>ut(t)).current,l=U(t,ut),s=Z(),[a,c]=i.useState(""),u=fC(s),{sort:d,searchPredicate:f=dC,autoFocusSearchField:g=!0,disableShowHideToggle:m=!1,disableResetButton:C=!1,toggleAllMode:b="all",getTogglableColumns:p}=e,S=i.useMemo(()=>uC(l,o),[l,o]),x=i.useMemo(()=>{switch(d){case"asc":return[...r].sort((M,w)=>Ns.compare(M.headerName||M.field,w.headerName||w.field));case"desc":return[...r].sort((M,w)=>-Ns.compare(M.headerName||M.field,w.headerName||w.field));default:return r}},[r,d]),D=M=>{const{name:w}=M.target;t.current.setColumnVisibility(w,l[w]===!1)},E=i.useMemo(()=>{const M=p?p(x):null,w=M?x.filter(({field:j})=>M.includes(j)):x;return a?w.filter(j=>f(j,a.toLowerCase())):w},[x,a,f,p]),H=i.useCallback(M=>{const w=ut(t),j=h({},w),T=p?p(r):null;return(b==="filteredOnly"?E:r).forEach(R=>{R.hideable&&(T==null||T.includes(R.field))&&(M?delete j[R.field]:j[R.field]=!1)}),t.current.setColumnVisibilityModel(j)},[t,r,p,b,E]),G=i.useCallback(M=>{c(M.target.value)},[]),A=i.useMemo(()=>E.filter(M=>M.hideable),[E]),F=i.useMemo(()=>A.every(M=>l[M.field]==null||l[M.field]!==!1),[l,A]),y=i.useMemo(()=>A.every(M=>l[M.field]===!1),[l,A]),_=i.useRef(null);i.useEffect(()=>{g?n.current.focus():_.current&&typeof _.current.focus=="function"&&_.current.focus()},[g]);let $=!1;const O=M=>$===!1&&M.hideable!==!1?($=!0,!0):!1;return v.jsxs(i.Fragment,{children:[v.jsx(mC,{className:u.header,ownerState:s,children:v.jsx(s.slots.baseTextField,h({placeholder:t.current.getLocaleText("columnsManagementSearchTitle"),inputRef:n,value:a,onChange:G,variant:"outlined",size:"small",InputProps:{startAdornment:v.jsx(s.slots.baseInputAdornment,{position:"start",children:v.jsx(s.slots.quickFilterIcon,{})}),sx:{pl:1.5}},fullWidth:!0},(P=s.slotProps)==null?void 0:P.baseTextField))}),v.jsxs(gC,{className:u.root,ownerState:s,children:[E.map(M=>{var w;return v.jsx(Nl,{className:u.row,control:v.jsx(s.slots.baseCheckbox,h({disabled:M.hideable===!1,checked:l[M.field]!==!1,onClick:D,name:M.field,sx:{p:.5},inputRef:O(M)?_:void 0},(w=s.slotProps)==null?void 0:w.baseCheckbox)),label:M.headerName||M.field},M.field)}),E.length===0&&v.jsx(pC,{ownerState:s,children:t.current.getLocaleText("columnsManagementNoColumns")})]}),(!m||!C)&&E.length>0?v.jsxs(hC,{ownerState:s,className:u.footer,children:[m?v.jsx("span",{}):v.jsx(Nl,{control:v.jsx(s.slots.baseCheckbox,h({disabled:A.length===0,checked:F,indeterminate:!F&&!y,onClick:()=>H(!F),name:t.current.getLocaleText("columnsManagementShowHideAllText"),sx:{p:.5}},(L=s.slotProps)==null?void 0:L.baseCheckbox)),label:t.current.getLocaleText("columnsManagementShowHideAllText")}),C?null:v.jsx(s.slots.baseButton,h({onClick:()=>t.current.setColumnVisibilityModel(o),disabled:S},(I=s.slotProps)==null?void 0:I.baseButton,{children:t.current.getLocaleText("columnsManagementReset")}))]}):null]})}const gC=je("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"})),mC=je("div",{name:"MuiDataGrid",slot:"ColumnsManagementHeader",overridesResolver:(e,t)=>t.columnsManagementHeader})(({theme:e})=>({padding:e.spacing(1.5,3)})),hC=je("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}`})),pC=je("div")(({theme:e})=>({padding:e.spacing(.5,0),color:e.palette.grey[500]}));function hu(e){var n;const t=Z();return v.jsx(Tl,h({},e,{children:v.jsx(Ol,h({},(n=t.slotProps)==null?void 0:n.columnsManagement))}))}const CC=["children","className","classes"],pu=Oi("MuiDataGrid",["panel","paper"]),bC=je(Kr,{name:"MuiDataGrid",slot:"Panel",overridesResolver:(e,t)=>t.panel})(({theme:e})=>({zIndex:e.zIndex.modal})),wC=je(Ci,{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"})),Cu=i.forwardRef((e,t)=>{const{children:n,className:r}=e,o=ne(e,CC),l=ie(),s=Z(),a=pu,[c,u]=i.useState(!1),d=i.useCallback(()=>{l.current.hidePreferences()},[l]),f=i.useCallback(b=>{b.key==="Escape"&&l.current.hidePreferences()},[l]),g=i.useMemo(()=>[{name:"flip",enabled:!0,options:{rootBoundary:"document"}},{name:"isPlaced",enabled:!0,phase:"main",fn:()=>{u(!0)},effect:()=>()=>{u(!1)}}],[]),[m,C]=i.useState(null);return i.useEffect(()=>{var p,S;const b=(S=(p=l.current.rootElementRef)==null?void 0:p.current)==null?void 0:S.querySelector('[data-id="gridPanelAnchor"]');b&&C(b)},[l]),m?v.jsx(bC,h({ref:t,placement:"bottom-start",className:me(r,a.panel),ownerState:s,anchorEl:m,modifiers:g},o,{children:v.jsx(pi,{mouseEvent:"onMouseUp",onClickAway:d,children:v.jsx(wC,{className:a.paper,ownerState:s,elevation:8,onKeyDown:f,children:c&&n})})})):null}),SC=["className"],yC=e=>{const{classes:t}=e;return de({root:["panelContent"]},ue,t)},xC=Se("div",{name:"MuiDataGrid",slot:"PanelContent",overridesResolver:(e,t)=>t.panelContent})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400});function bu(e){const{className:t}=e,n=ne(e,SC),r=Z(),o=yC(r);return v.jsx(xC,h({className:me(t,o.root),ownerState:r},n))}const vC=["className"],IC=e=>{const{classes:t}=e;return de({root:["panelFooter"]},ue,t)},MC=Se("div",{name:"MuiDataGrid",slot:"PanelFooter",overridesResolver:(e,t)=>t.panelFooter})(({theme:e})=>({padding:e.spacing(.5),display:"flex",justifyContent:"space-between"}));function wu(e){const{className:t}=e,n=ne(e,vC),r=Z(),o=IC(r);return v.jsx(MC,h({className:me(t,o.root),ownerState:r},n))}const PC=["className"],EC=e=>{const{classes:t}=e;return de({root:["panelHeader"]},ue,t)},FC=Se("div",{name:"MuiDataGrid",slot:"PanelHeader",overridesResolver:(e,t)=>t.panelHeader})(({theme:e})=>({padding:e.spacing(1)}));function kC(e){const{className:t}=e,n=ne(e,PC),r=Z(),o=EC(r);return v.jsx(FC,h({className:me(t,o.root),ownerState:r},n))}const DC=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","readOnly","children"],TC=["InputComponentProps"],OC=e=>{const{classes:t}=e;return de({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},ue,t)},HC=je("div",{name:"MuiDataGrid",slot:"FilterForm",overridesResolver:(e,t)=>t.filterForm})(({theme:e})=>({display:"flex",padding:e.spacing(1)})),_C=je("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)})),LC=je("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput",overridesResolver:(e,t)=>t.filterFormLogicOperatorInput})({minWidth:55,marginRight:5,justifyContent:"end"}),GC=je("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput",overridesResolver:(e,t)=>t.filterFormColumnInput})({width:150}),RC=je("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput",overridesResolver:(e,t)=>t.filterFormOperatorInput})({width:150}),$C=je("div",{name:"MuiDataGrid",slot:"FilterFormValueInput",overridesResolver:(e,t)=>t.filterFormValueInput})({width:190}),AC=e=>{switch(e){case Ze.And:return"filterPanelOperatorAnd";case Ze.Or:return"filterPanelOperatorOr";default:throw new Error("MUI X: Invalid `logicOperator` property in the `GridFilterPanel`.")}},Rn=e=>e.headerName||e.field,Bs=new Intl.Collator,Vr=i.forwardRef(function(t,n){var Oe,He,ve,Ge,qe,ot,ft,Ae,be;const{item:r,hasMultipleFilters:o,deleteFilter:l,applyFilterChanges:s,showMultiFilterOperators:a,disableMultiFilterOperator:c,applyMultiFilterOperatorChanges:u,focusElementRef:d,logicOperators:f=[Ze.And,Ze.Or],columnsSort:g,filterColumns:m,deleteIconProps:C={},logicOperatorInputProps:b={},operatorInputProps:p={},columnInputProps:S={},valueInputProps:x={},readOnly:D}=t,E=ne(t,DC),H=ie(),G=U(H,Pt),A=U(H,ol),F=U(H,We),y=_e(),_=_e(),$=_e(),O=_e(),P=Z(),L=OC(P),I=i.useRef(null),M=i.useRef(null),w=F.logicOperator??Ze.And,j=o&&f.length>0,T=((Oe=P.slotProps)==null?void 0:Oe.baseFormControl)||{},z=(((He=P.slotProps)==null?void 0:He.baseSelect)||{}).native??!1,N=((ve=P.slotProps)==null?void 0:ve.baseInputLabel)||{},B=((Ge=P.slotProps)==null?void 0:Ge.baseSelectOption)||{},{InputComponentProps:W}=x,X=ne(x,TC),{filteredColumns:q,selectedField:te}=i.useMemo(()=>{let fe=r.field;const ye=G[r.field].filterable===!1?G[r.field]:null;if(ye)return{filteredColumns:[ye],selectedField:fe};if(m===void 0||typeof m!="function")return{filteredColumns:A,selectedField:fe};const Ee=m({field:r.field,columns:A,currentFilters:(F==null?void 0:F.items)||[]});return{filteredColumns:A.filter(Fe=>{const Ce=Ee.includes(Fe.field);return Fe.field===r.field&&!Ce&&(fe=void 0),Ce}),selectedField:fe}},[m,F==null?void 0:F.items,A,r.field,G]),K=i.useMemo(()=>{switch(g){case"asc":return q.sort((fe,ye)=>Bs.compare(Rn(fe),Rn(ye)));case"desc":return q.sort((fe,ye)=>-Bs.compare(Rn(fe),Rn(ye)));default:return q}},[q,g]),Q=r.field?H.current.getColumn(r.field):null,J=i.useMemo(()=>{var fe;return!r.operator||!Q?null:(fe=Q.filterOperators)==null?void 0:fe.find(ye=>ye.value===r.operator)},[r,Q]),se=i.useCallback(fe=>{const ye=fe.target.value,Ee=H.current.getColumn(ye);if(Ee.field===Q.field)return;const Fe=Ee.filterOperators.find(ze=>ze.value===r.operator)||Ee.filterOperators[0];let Be=!Fe.InputComponent||Fe.InputComponent!==(J==null?void 0:J.InputComponent)||Ee.type!==Q.type?void 0:r.value;if(Ee.type==="singleSelect"&&Be!==void 0){const ze=Ee,le=nn(ze);Array.isArray(Be)?Be=Be.filter(he=>Ao(he,le,ze==null?void 0:ze.getOptionValue)!==void 0):Ao(r.value,le,ze==null?void 0:ze.getOptionValue)===void 0&&(Be=void 0)}s(h({},r,{field:ye,operator:Fe.value,value:Be}))},[H,s,r,Q,J]),oe=i.useCallback(fe=>{const ye=fe.target.value,Ee=Q==null?void 0:Q.filterOperators.find(Ce=>Ce.value===ye),Fe=!(Ee!=null&&Ee.InputComponent)||(Ee==null?void 0:Ee.InputComponent)!==(J==null?void 0:J.InputComponent);s(h({},r,{operator:ye,value:Fe?void 0:r.value}))},[s,r,Q,J]),ae=i.useCallback(fe=>{const ye=fe.target.value===Ze.And.toString()?Ze.And:Ze.Or;u(ye)},[u]),Le=()=>{l(r)};return i.useImperativeHandle(d,()=>({focus:()=>{var fe;J!=null&&J.InputComponent?(fe=I==null?void 0:I.current)==null||fe.focus():M.current.focus()}}),[J]),v.jsxs(HC,h({ref:n,className:L.root,"data-id":r.id,ownerState:P},E,{children:[v.jsx(_C,h({variant:"standard",as:P.slots.baseFormControl},T,C,{className:me(L.deleteIcon,T.className,C.className),ownerState:P,children:v.jsx(P.slots.baseIconButton,h({"aria-label":H.current.getLocaleText("filterPanelDeleteIconLabel"),title:H.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:Le,size:"small",disabled:D},(qe=P.slotProps)==null?void 0:qe.baseIconButton,{children:v.jsx(P.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),v.jsx(LC,h({variant:"standard",as:P.slots.baseFormControl},T,b,{sx:[j?{display:"flex"}:{display:"none"},a?{visibility:"visible"}:{visibility:"hidden"},T.sx,b.sx],className:me(L.logicOperatorInput,T.className,b.className),ownerState:P,children:v.jsx(P.slots.baseSelect,h({inputProps:{"aria-label":H.current.getLocaleText("filterPanelLogicOperator")},value:w??"",onChange:ae,disabled:!!c||f.length===1,native:z},(ot=P.slotProps)==null?void 0:ot.baseSelect,{children:f.map(fe=>i.createElement(P.slots.baseSelectOption,h({},B,{native:z,key:fe.toString(),value:fe.toString()}),H.current.getLocaleText(AC(fe))))}))})),v.jsxs(GC,h({variant:"standard",as:P.slots.baseFormControl},T,S,{className:me(L.columnInput,T.className,S.className),ownerState:P,children:[v.jsx(P.slots.baseInputLabel,h({},N,{htmlFor:y,id:_,children:H.current.getLocaleText("filterPanelColumns")})),v.jsx(P.slots.baseSelect,h({labelId:_,id:y,label:H.current.getLocaleText("filterPanelColumns"),value:te??"",onChange:se,native:z,disabled:D},(ft=P.slotProps)==null?void 0:ft.baseSelect,{children:K.map(fe=>i.createElement(P.slots.baseSelectOption,h({},B,{native:z,key:fe.field,value:fe.field}),Rn(fe)))}))]})),v.jsxs(RC,h({variant:"standard",as:P.slots.baseFormControl},T,p,{className:me(L.operatorInput,T.className,p.className),ownerState:P,children:[v.jsx(P.slots.baseInputLabel,h({},N,{htmlFor:$,id:O,children:H.current.getLocaleText("filterPanelOperator")})),v.jsx(P.slots.baseSelect,h({labelId:O,label:H.current.getLocaleText("filterPanelOperator"),id:$,value:r.operator,onChange:oe,native:z,inputRef:M,disabled:D},(Ae=P.slotProps)==null?void 0:Ae.baseSelect,{children:(be=Q==null?void 0:Q.filterOperators)==null?void 0:be.map(fe=>i.createElement(P.slots.baseSelectOption,h({},B,{native:z,key:fe.value,value:fe.value}),fe.label||H.current.getLocaleText(`filterOperator${kn(fe.value)}`)))}))]})),v.jsx($C,h({variant:"standard",as:P.slots.baseFormControl},T,X,{className:me(L.valueInput,T.className,X.className),ownerState:P,children:J!=null&&J.InputComponent?v.jsx(J.InputComponent,h({apiRef:H,item:r,applyValue:s,focusElementRef:I,disabled:D},J.InputComponentProps,W),r.field):null}))]}))}),jC=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],Us=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(Math.random()*1e5)}),Su=i.forwardRef(function(t,n){var O,P;const r=ie(),o=Z(),l=U(r,We),s=U(r,ol),a=U(r,Ni),c=i.useRef(null),u=i.useRef(null),{logicOperators:d=[Ze.And,Ze.Or],columnsSort:f,filterFormProps:g,getColumnForNewFilter:m,disableAddFilterButton:C=!1,disableRemoveAllButton:b=!1}=t,p=ne(t,jC),S=r.current.upsertFilterItem,x=i.useCallback(L=>{r.current.setFilterLogicOperator(L)},[r]),D=i.useCallback(()=>{let L;if(m&&typeof m=="function"){const I=m({currentFilters:(l==null?void 0:l.items)||[],columns:s});if(I===null)return null;L=s.find(({field:M})=>M===I)}else L=s.find(I=>{var M;return(M=I.filterOperators)==null?void 0:M.length});return L?Us(L):null},[l==null?void 0:l.items,s,m]),E=i.useCallback(()=>{if(m===void 0||typeof m!="function")return D();const L=l.items.length?l.items:[D()].filter(Boolean),I=m({currentFilters:L,columns:s});if(I===null)return null;const M=s.find(({field:w})=>w===I);return M?Us(M):null},[l.items,s,m,D]),H=i.useMemo(()=>l.items.length?l.items:(u.current||(u.current=D()),u.current?[u.current]:[]),[l.items,D]),G=H.length>1,{readOnlyFilters:A,validFilters:F}=i.useMemo(()=>H.reduce((L,I)=>(a[I.field]?L.validFilters.push(I):L.readOnlyFilters.push(I),L),{readOnlyFilters:[],validFilters:[]}),[H,a]),y=i.useCallback(()=>{const L=E();L&&r.current.upsertFilterItems([...H,L])},[r,E,H]),_=i.useCallback(L=>{const I=F.length===1;r.current.deleteFilterItem(L),I&&r.current.hideFilterPanel()},[r,F.length]),$=i.useCallback(()=>F.length===1&&F[0].value===void 0?(r.current.deleteFilterItem(F[0]),r.current.hideFilterPanel()):r.current.setFilterModel(h({},l,{items:A}),"removeAllFilterItems"),[r,A,l,F]);return i.useEffect(()=>{d.length>0&&l.logicOperator&&!d.includes(l.logicOperator)&&x(d[0])},[d,x,l.logicOperator]),i.useEffect(()=>{F.length>0&&c.current.focus()},[F.length]),v.jsxs(Tl,h({ref:n},p,{children:[v.jsxs(bu,{children:[A.map((L,I)=>v.jsx(Vr,h({item:L,applyFilterChanges:S,deleteFilter:_,hasMultipleFilters:G,showMultiFilterOperators:I>0,disableMultiFilterOperator:I!==1,applyMultiFilterOperatorChanges:x,focusElementRef:null,readOnly:!0,logicOperators:d,columnsSort:f},g),L.id==null?I:L.id)),F.map((L,I)=>v.jsx(Vr,h({item:L,applyFilterChanges:S,deleteFilter:_,hasMultipleFilters:G,showMultiFilterOperators:A.length+I>0,disableMultiFilterOperator:A.length+I!==1,applyMultiFilterOperatorChanges:x,focusElementRef:I===F.length-1?c:null,logicOperators:d,columnsSort:f},g),L.id==null?I+A.length:L.id))]}),!o.disableMultipleColumnsFiltering&&!(C&&b)?v.jsxs(wu,{children:[C?v.jsx("span",{}):v.jsx(o.slots.baseButton,h({onClick:y,startIcon:v.jsx(o.slots.filterPanelAddIcon,{})},(O=o.slotProps)==null?void 0:O.baseButton,{children:r.current.getLocaleText("filterPanelAddFilter")})),!b&&F.length>0?v.jsx(o.slots.baseButton,h({onClick:$,startIcon:v.jsx(o.slots.filterPanelRemoveAllIcon,{})},(P=o.slotProps)==null?void 0:P.baseButton,{children:r.current.getLocaleText("filterPanelRemoveAll")})):null]}):null]}))}),yu=i.forwardRef(function(t,n){var m,C;const{slotProps:r={}}=t,o=r.button||{},l=r.tooltip||{},s=Bl(),a=Bl(),c=ie(),u=Z(),d=U(c,Wt),f=b=>{var p;d.open&&d.openedPanelValue===bt.columns?c.current.hidePreferences():c.current.showPreferences(bt.columns,a,s),(p=o.onClick)==null||p.call(o,b)};if(u.disableColumnSelector)return null;const g=d.open&&d.panelId===a;return v.jsx(u.slots.baseTooltip,h({title:c.current.getLocaleText("toolbarColumnsLabel"),enterDelay:1e3},l,(m=u.slotProps)==null?void 0:m.baseTooltip,{children:v.jsx(u.slots.baseButton,h({ref:n,id:s,size:"small","aria-label":c.current.getLocaleText("toolbarColumnsLabel"),"aria-haspopup":"menu","aria-expanded":g,"aria-controls":g?a:void 0,startIcon:v.jsx(u.slots.columnSelectorIcon,{})},o,{onClick:f},(C=u.slotProps)==null?void 0:C.baseButton,{children:c.current.getLocaleText("toolbarColumns")}))}))}),xu=i.forwardRef(function(t,n){var G,A;const{slotProps:r={}}=t,o=r.button||{},l=r.tooltip||{},s=ie(),a=Z(),c=U(s,zt),u=_e(),d=_e(),[f,g]=i.useState(!1),m=i.useRef(null),C=Gt(n,m),b=[{icon:v.jsx(a.slots.densityCompactIcon,{}),label:s.current.getLocaleText("toolbarDensityCompact"),value:"compact"},{icon:v.jsx(a.slots.densityStandardIcon,{}),label:s.current.getLocaleText("toolbarDensityStandard"),value:"standard"},{icon:v.jsx(a.slots.densityComfortableIcon,{}),label:s.current.getLocaleText("toolbarDensityComfortable"),value:"comfortable"}],p=i.useMemo(()=>{switch(c){case"compact":return v.jsx(a.slots.densityCompactIcon,{});case"comfortable":return v.jsx(a.slots.densityComfortableIcon,{});default:return v.jsx(a.slots.densityStandardIcon,{})}},[c,a]),S=F=>{var y;g(_=>!_),(y=o.onClick)==null||y.call(o,F)},x=()=>{g(!1)},D=F=>{s.current.setDensity(F),g(!1)},E=F=>{F.key==="Tab"&&F.preventDefault(),Dl(F.key)&&g(!1)};if(a.disableDensitySelector)return null;const H=b.map((F,y)=>v.jsxs(yt,{onClick:()=>D(F.value),selected:F.value===c,children:[v.jsx(Vt,{children:F.icon}),F.label]},y));return v.jsxs(i.Fragment,{children:[v.jsx(a.slots.baseTooltip,h({title:s.current.getLocaleText("toolbarDensityLabel"),enterDelay:1e3},l,(G=a.slotProps)==null?void 0:G.baseTooltip,{children:v.jsx(a.slots.baseButton,h({ref:C,size:"small",startIcon:p,"aria-label":s.current.getLocaleText("toolbarDensityLabel"),"aria-haspopup":"menu","aria-expanded":f,"aria-controls":f?d:void 0,id:u},o,{onClick:S},(A=a.slotProps)==null?void 0:A.baseButton,{children:s.current.getLocaleText("toolbarDensity")}))})),v.jsx(Qn,{open:f,target:m.current,onClose:x,position:"bottom-start",children:v.jsx(qo,{id:d,className:k.menuList,"aria-labelledby":u,onKeyDown:E,autoFocusItem:f,children:H})})]})}),zC=e=>{const{classes:t}=e;return de({root:["toolbarFilterList"]},ue,t)},VC=je("ul",{name:"MuiDataGrid",slot:"ToolbarFilterList",overridesResolver:(e,t)=>t.toolbarFilterList})(({theme:e})=>({margin:e.spacing(1,1,.5),padding:e.spacing(0,1)})),vu=i.forwardRef(function(t,n){var S,x;const{slotProps:r={}}=t,o=r.button||{},l=r.tooltip||{},s=ie(),a=Z(),c=U(s,wl),u=U(s,Pt),d=U(s,Wt),f=zC(a),g=_e(),m=_e(),C=i.useMemo(()=>{if(d.open)return s.current.getLocaleText("toolbarFiltersTooltipHide");if(c.length===0)return s.current.getLocaleText("toolbarFiltersTooltipShow");const D=H=>u[H.field].filterOperators.find(G=>G.value===H.operator).label||s.current.getLocaleText(`filterOperator${kn(H.operator)}`).toString(),E=H=>{const{getValueAsString:G}=u[H.field].filterOperators.find(A=>A.value===H.operator);return G?G(H.value):H.value};return v.jsxs("div",{children:[s.current.getLocaleText("toolbarFiltersTooltipActive")(c.length),v.jsx(VC,{className:f.root,ownerState:a,children:c.map((H,G)=>h({},u[H.field]&&v.jsx("li",{children:`${u[H.field].headerName||H.field} + ${D(H)} + ${H.value!=null?E(H):""}`},G)))})]})},[s,a,d.open,c,u,f]),b=D=>{var G;const{open:E,openedPanelValue:H}=d;E&&H===bt.filters?s.current.hidePreferences():s.current.showPreferences(bt.filters,m,g),(G=o.onClick)==null||G.call(o,D)};if(a.disableColumnFilter)return null;const p=d.open&&d.panelId===m;return v.jsx(a.slots.baseTooltip,h({title:C,enterDelay:1e3},l,(S=a.slotProps)==null?void 0:S.baseTooltip,{children:v.jsx(a.slots.baseButton,h({ref:n,id:g,size:"small","aria-label":s.current.getLocaleText("toolbarFiltersLabel"),"aria-controls":p?m:void 0,"aria-expanded":p,"aria-haspopup":!0,startIcon:v.jsx(Xr,{badgeContent:c.length,color:"primary",children:v.jsx(a.slots.openFilterButtonIcon,{})})},o,{onClick:b},(x=a.slotProps)==null?void 0:x.baseButton,{children:s.current.getLocaleText("toolbarFilters")}))}))}),Iu=i.forwardRef(function(t,n){var x,D;const{children:r,slotProps:o={}}=t,l=o.button||{},s=o.tooltip||{},a=ie(),c=Z(),u=_e(),d=_e(),[f,g]=i.useState(!1),m=i.useRef(null),C=Gt(n,m),b=E=>{var H;g(G=>!G),(H=l.onClick)==null||H.call(l,E)},p=()=>g(!1),S=E=>{E.key==="Tab"&&E.preventDefault(),Dl(E.key)&&p()};return r==null?null:v.jsxs(i.Fragment,{children:[v.jsx(c.slots.baseTooltip,h({title:a.current.getLocaleText("toolbarExportLabel"),enterDelay:1e3},s,(x=c.slotProps)==null?void 0:x.baseTooltip,{children:v.jsx(c.slots.baseButton,h({ref:C,size:"small",startIcon:v.jsx(c.slots.exportIcon,{}),"aria-expanded":f,"aria-label":a.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-controls":f?d:void 0,id:u},l,{onClick:b},(D=c.slotProps)==null?void 0:D.baseButton,{children:a.current.getLocaleText("toolbarExport")}))})),v.jsx(Qn,{open:f,target:m.current,onClose:p,position:"bottom-start",children:v.jsx(qo,{id:d,className:k.menuList,"aria-labelledby":u,onKeyDown:S,autoFocusItem:f,children:i.Children.map(r,E=>i.isValidElement(E)?i.cloneElement(E,{hideMenu:p}):E)})})]})}),NC=["hideMenu","options"],BC=["hideMenu","options"],UC=["csvOptions","printOptions","excelOptions"];function Mu(e){const t=ie(),{hideMenu:n,options:r}=e,o=ne(e,NC);return v.jsx(yt,h({onClick:()=>{t.current.exportDataAsCsv(r),n==null||n()}},o,{children:t.current.getLocaleText("toolbarExportCSV")}))}function Pu(e){const t=ie(),{hideMenu:n,options:r}=e,o=ne(e,BC);return v.jsx(yt,h({onClick:()=>{t.current.exportDataAsPrint(r),n==null||n()}},o,{children:t.current.getLocaleText("toolbarExportPrint")}))}const Eu=i.forwardRef(function(t,n){const{csvOptions:r={},printOptions:o={},excelOptions:l}=t,s=ne(t,UC),c=ie().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:l,csvOptions:r,printOptions:o}).sort((u,d)=>u.componentName>d.componentName?1:-1);return c.length===0?null:v.jsx(Iu,h({},s,{ref:n,children:c.map((u,d)=>i.cloneElement(u.component,{key:d}))}))}),WC=["quickFilterParser","quickFilterFormatter","debounceMs","className"],qC=e=>{const{classes:t}=e;return de({root:["toolbarQuickFilter"]},ue,t)},KC=je(Yr,{name:"MuiDataGrid",slot:"ToolbarQuickFilter",overridesResolver:(e,t)=>t.toolbarQuickFilter})(({theme:e})=>({width:"auto",paddingBottom:e.spacing(.5),"& input":{marginLeft:e.spacing(.5)},"& .MuiInput-underline:before":{borderBottom:`1px solid ${(e.vars||e).palette.divider}`},'& input[type="search"]::-webkit-search-decoration,\n & input[type="search"]::-webkit-search-cancel-button,\n & input[type="search"]::-webkit-search-results-button,\n & input[type="search"]::-webkit-search-results-decoration':{display:"none"}})),XC=e=>e.split(" ").filter(t=>t!==""),YC=e=>e.join(" ");function Fu(e){var S,x;const t=ie(),n=Z(),r=qC(n),o=U(t,Pa),{quickFilterParser:l=XC,quickFilterFormatter:s=YC,debounceMs:a=n.filterDebounceMs,className:c}=e,u=ne(e,WC),[d,f]=i.useState(()=>s(o??[])),g=i.useRef(o);i.useEffect(()=>{Bt(g.current,o)||(g.current=o,f(D=>Bt(l(D),o)?D:s(o??[])))},[o,s,l]);const m=i.useCallback(D=>{const E=l(D);g.current=E,t.current.setQuickFilterValues(E)},[t,l]),C=i.useMemo(()=>Di(m,a),[m,a]),b=i.useCallback(D=>{const E=D.target.value;f(E),C(E)},[C]),p=i.useCallback(()=>{f(""),m("")},[m]);return v.jsx(KC,h({as:n.slots.baseTextField,ownerState:n,variant:"standard",value:d,onChange:b,className:me(c,r.root),placeholder:t.current.getLocaleText("toolbarQuickFilterPlaceholder"),"aria-label":t.current.getLocaleText("toolbarQuickFilterLabel"),type:"search"},u,{InputProps:h({startAdornment:v.jsx(n.slots.quickFilterIcon,{fontSize:"small"}),endAdornment:v.jsx(n.slots.baseIconButton,h({"aria-label":t.current.getLocaleText("toolbarQuickFilterDeleteIconLabel"),size:"small",sx:[d?{visibility:"visible"}:{visibility:"hidden"}],onClick:p},(S=n.slotProps)==null?void 0:S.baseIconButton,{children:v.jsx(n.slots.quickFilterClearIcon,{fontSize:"small"})}))},u.InputProps)},(x=n.slotProps)==null?void 0:x.baseTextField))}const QC=["className","csvOptions","printOptions","excelOptions","showQuickFilter","quickFilterProps"],JC=i.forwardRef(function(t,n){const{csvOptions:r,printOptions:o,excelOptions:l,showQuickFilter:s=!1,quickFilterProps:a={}}=t,c=ne(t,QC),u=Z();return u.disableColumnFilter&&u.disableColumnSelector&&u.disableDensitySelector&&!s?null:v.jsxs(Tc,h({ref:n},c,{children:[v.jsx(yu,{}),v.jsx(vu,{}),v.jsx(xu,{}),v.jsx(Eu,{csvOptions:r,printOptions:o,excelOptions:l}),v.jsx(pd,{sx:{flex:1}}),s&&v.jsx(Fu,h({},a))]}))}),ZC=["className","selectedRowCount"],eb=e=>{const{classes:t}=e;return de({root:["selectedRowCount"]},ue,t)},tb=Se("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"}})),ku=i.forwardRef(function(t,n){const{className:r,selectedRowCount:o}=t,l=ne(t,ZC),s=ie(),a=Z(),c=eb(a),u=s.current.getLocaleText("footerRowSelected")(o);return v.jsx(tb,h({ref:n,className:me(c.root,r),ownerState:a},l,{children:u}))}),Du=i.forwardRef(function(t,n){var f,g;const r=ie(),o=Z(),l=U(r,sa),s=U(r,xa),a=U(r,lr),c=!o.hideFooterSelectedRowCount&&s>0?v.jsx(ku,{selectedRowCount:s}):v.jsx("div",{}),u=!o.hideFooterRowCount&&!o.pagination?v.jsx(o.slots.footerRowCount,h({},(f=o.slotProps)==null?void 0:f.footerRowCount,{rowCount:l,visibleRowCount:a})):null,d=o.pagination&&!o.hideFooterPagination&&o.slots.pagination&&v.jsx(o.slots.pagination,h({},(g=o.slotProps)==null?void 0:g.pagination));return v.jsxs(Dc,h({ref:n},t,{children:[c,u,d]}))});function nb(){var l,s;const e=ie(),t=U(e,pt),n=Z(),r=U(e,Wt),o=e.current.unstable_applyPipeProcessors("preferencePanel",null,r.openedPanelValue??bt.filters);return v.jsx(n.slots.panel,h({as:n.slots.basePopper,open:t.length>0&&r.open,id:r.panelId,"aria-labelledby":r.labelId},(l=n.slotProps)==null?void 0:l.panel,(s=n.slotProps)==null?void 0:s.basePopper,{children:o}))}function Tu(){var t;const e=Z();return v.jsxs(i.Fragment,{children:[v.jsx(nb,{}),e.slots.toolbar&&v.jsx(e.slots.toolbar,h({},(t=e.slotProps)==null?void 0:t.toolbar))]})}const Hl=(e,t,n,r,o)=>{const l=o.hasScrollY?o.scrollbarSize:0;let s;switch(e){case Me.LEFT:s=r[n];break;case Me.RIGHT:s=o.columnsTotalWidth-r[n]-t+l;break;default:s=0;break}return s},$n={root:k.scrollbarFiller,header:k["scrollbarFiller--header"],borderTop:k["scrollbarFiller--borderTop"],borderBottom:k["scrollbarFiller--borderBottom"],pinnedRight:k["scrollbarFiller--pinnedRight"]};function _l({header:e,borderTop:t=!0,borderBottom:n,pinnedRight:r}){return v.jsx("div",{role:"presentation",className:me($n.root,e&&$n.header,t&&$n.borderTop,n&&$n.borderBottom,r&&$n.pinnedRight)})}const ob=Se("div",{name:"MuiDataGrid",slot:"SkeletonLoadingOverlay",overridesResolver:(e,t)=>t.skeletonLoadingOverlay})({minWidth:"100%",width:"max-content",height:"100%",overflow:"clip"}),rb=e=>{const{classes:t}=e;return de({root:["skeletonLoadingOverlay"]},ue,t)},Ws=e=>parseInt(e.getAttribute("data-colindex"),10),lb=i.forwardRef(function(t,n){const r=Z(),{slots:o}=r,l=rb({classes:r.classes}),s=i.useRef(null),a=Gt(s,n),c=ie(),u=U(c,nt),d=(u==null?void 0:u.viewportInnerSize.height)??0,f=Math.ceil(d/u.rowHeight),g=U(c,Jo),m=U(c,Rt),C=i.useMemo(()=>m.filter(G=>G<=g).length,[g,m]),b=U(c,Ne),p=i.useMemo(()=>b.slice(0,C),[b,C]),S=U(c,On),x=i.useCallback((G,A,F)=>{const y=Hl(F,G,A,m,u);return{[F]:y}},[u,m]),D=i.useCallback(G=>{if(S.left.findIndex(A=>A.field===G)!==-1)return Me.LEFT;if(S.right.findIndex(A=>A.field===G)!==-1)return Me.RIGHT},[S.left,S.right]),E=i.useMemo(()=>{const G=[];for(let A=0;AQ.field===_.field):y-S.left.length,M=$&&x(_.computedWidth,y,$),w=u.columnsTotalWidth0},`skeleton-scrollbar-filler-${A}`))}G.push(v.jsx("div",{className:me(k.row,k.rowSkeleton,A===0&&k["row--firstVisible"]),children:F},`skeleton-row-${A}`))}return G},[o,p,S,f,r.showCellVerticalBorder,u.columnsTotalWidth,u.viewportOuterSize.width,u.rowHeight,u.hasScrollY,u.scrollbarSize,D,x]);return ee(c,"columnResize",G=>{var M,w,j;const{colDef:A,width:F}=G,y=(M=s.current)==null?void 0:M.querySelectorAll(`[data-field="${At(A.field)}"]`);if(!y)throw new Error("MUI X: Expected skeleton cells to be defined with `data-field` attribute.");const _=p.findIndex(T=>T.field===A.field),$=D(A.field),O=$===Me.LEFT,P=$===Me.RIGHT,L=getComputedStyle(y[0]).getPropertyValue("--width"),I=parseInt(L,10)-F;if(y&&y.forEach(T=>{T.style.setProperty("--width",`${F}px`)}),O){const T=(w=s.current)==null?void 0:w.querySelectorAll(`.${k["cell--pinnedLeft"]}`);T==null||T.forEach(R=>{Ws(R)>_&&(R.style.left=`${parseInt(getComputedStyle(R).left,10)-I}px`)})}if(P){const T=(j=s.current)==null?void 0:j.querySelectorAll(`.${k["cell--pinnedRight"]}`);T==null||T.forEach(R=>{Ws(R)<_&&(R.style.right=`${parseInt(getComputedStyle(R).right,10)+I}px`)})}}),v.jsx(ob,h({className:l.root,ref:a},t,{children:E}))}),sb=["variant","noRowsVariant","style"],ib={"circular-progress":{component:Cd,style:{}},"linear-progress":{component:bd,style:{display:"block"}},skeleton:{component:lb,style:{display:"block"}}},Ou=i.forwardRef(function(t,n){const{variant:r="circular-progress",noRowsVariant:o="circular-progress",style:l}=t,s=ne(t,sb),a=ie(),c=U(a,Zn),u=ib[c===0?o:r];return v.jsx(dr,h({ref:n,style:h({},u.style,l)},s,{children:v.jsx(u.component,{})}))}),Hu=i.forwardRef(function(t,n){const o=ie().current.getLocaleText("noRowsLabel");return v.jsx(dr,h({ref:n},t,{children:o}))}),ab=je(wd)(({theme:e})=>({maxHeight:"calc(100% + 1px)",[`& .${Ul.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${Ul.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),cb=(e,t)=>({from:n,to:r,count:o,page:l})=>e({from:n,to:r,count:o,page:l,estimated:t}),ub=({from:e,to:t,count:n,estimated:r})=>r?`${e}–${t} of ${n!==-1?n:`more than ${r>t?r:t}`}`:`${e}–${t} of ${n!==-1?n:`more than ${t}`}`,_u=i.forwardRef(function(t,n){const r=ie(),o=Z(),l=U(r,Je),s=U(r,Zt),a=U(r,yl),{paginationMode:c,loading:u,estimatedRowCount:d}=o,f=i.useMemo(()=>s===-1&&c==="server"&&u?{backIconButtonProps:{disabled:!0},nextIconButtonProps:{disabled:!0}}:{},[u,c,s]),g=i.useMemo(()=>Math.max(0,a-1),[a]),m=i.useMemo(()=>s===-1||l.page<=g?l.page:g,[g,l.page,s]),C=i.useCallback(E=>{const H=Number(E.target.value);r.current.setPageSize(H)},[r]),b=i.useCallback((E,H)=>{r.current.setPage(H)},[r]),S=(E=>{for(let H=0;H{const{classes:t}=e;return de({root:["rowCount"]},ue,t)},gb=Se("div",{name:"MuiDataGrid",slot:"RowCount",overridesResolver:(e,t)=>t.rowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2)})),Lu=i.forwardRef(function(t,n){const{className:r,rowCount:o,visibleRowCount:l}=t,s=ne(t,db),a=ie(),c=Z(),u=fb(c);if(o===0)return null;const d=l=f.left.length&&b=C.lastColumnIndex,Q=mb(L.classes,{root:["row",r&&"selected",X&&"row--editable",W&&"row--editing",p&&"row--firstVisible",S&&"row--lastVisible",D&&"row--borderBottom",c==="auto"&&"row--dynamicHeight"]}),J=O.hooks.useGridRowAriaAttributes();i.useLayoutEffect(()=>{if(I.range){const ge=$.current.getRowIndexRelativeToVisibleRows(o);ge!=null&&$.current.unstable_setLastMeasuredRowIndex(ge)}const le=P.current;if(!le||c!=="auto"||typeof ResizeObserver>"u")return;const pe=new ResizeObserver(ge=>{const[we]=ge,Ie=we.borderBoxSize&&we.borderBoxSize.length>0?we.borderBoxSize[0].blockSize:we.contentRect.height;$.current.unstable_storeRowHeightMeasurement(o,Ie)});return pe.observe(le),()=>pe.disconnect()},[$,I.range,s,c,o]);const se=i.useCallback((le,he)=>pe=>{io(pe)||$.current.getRow(o)&&($.current.publishEvent(le,$.current.getRowParams(o),pe),he&&he(pe))},[$,o]),oe=i.useCallback(le=>{const he=jo(le.target,k.cell),pe=he==null?void 0:he.getAttribute("data-field");if(pe){if(pe===cn.field||pe===Ll||pe==="__reorder__"||$.current.getCellMode(o,pe)===xe.Edit)return;const ge=$.current.getColumn(pe);if((ge==null?void 0:ge.type)===Jn)return}se("rowClick",E)(le)},[$,E,se,o]),{slots:ae,slotProps:Le,disableColumnReorder:Oe}=L,He=L.rowReordering,ve=U($,()=>h({},$.current.unstable_getRowInternalSizes(o)),Gi);let Ge=c;Ge==="auto"&&ve&&(ve.baseCenter??0)>0;const qe=i.useMemo(()=>{if(x)return{opacity:0,width:0,height:0};const le=h({},a,{maxHeight:c==="auto"?"none":c,minHeight:Ge,"--height":typeof c=="number"?`${c}px`:c});if(ve!=null&&ve.spacingTop){const he=L.rowSpacingType==="border"?"borderTopWidth":"marginTop";le[he]=ve.spacingTop}if(ve!=null&&ve.spacingBottom){const he=L.rowSpacingType==="border"?"borderBottomWidth":"marginBottom";let pe=le[he];typeof pe!="number"&&(pe=parseInt(pe||"0",10)),pe+=ve.spacingBottom,le[he]=pe}return le},[x,c,a,Ge,ve,L.rowSpacingType]),ot=$.current.unstable_applyPipeProcessors("rowClassName",[],o),ft=z?J(z,s):void 0;if(typeof L.getRowClassName=="function"){const le=s-(((ze=I.range)==null?void 0:ze.firstRowIndex)||0),he=h({},$.current.getRowParams(o),{isFirstVisible:le===0,isLastVisible:le===I.rows.length-1,indexRelativeToCurrentPage:le});ot.push(L.getRowClassName(he))}const Ae=(le,he,pe,ge,we=lt.NONE)=>{var zl;const Ie=$.current.unstable_getCellColSpanInfo(o,pe);if(Ie!=null&&Ie.spannedByColSpan)return null;const tt=(Ie==null?void 0:Ie.cellProps.width)??le.computedWidth,ao=(Ie==null?void 0:Ie.cellProps.colSpan)??1,co=Hl(Pc[we],le.computedWidth,pe,j,m);if((z==null?void 0:z.type)==="skeletonRow")return v.jsx(ae.skeletonCell,{type:le.type,width:tt,height:c,field:le.field,align:le.align},le.field);const uo=((zl=T[o])==null?void 0:zl[le.field])??null,fo=le.field==="__reorder__",dn=Object.keys(T).length>0,go=!(Oe||le.disableReorder),Xu=He&&!M.length&&w<=1&&!dn,Yu=!(go||fo&&Xu),Qu=we===lt.VIRTUAL;return v.jsx(ae.cell,h({column:le,width:tt,rowId:o,align:le.align||"left",colIndex:pe,colSpan:ao,disableDragEvents:Yu,editCellState:uo,isNotVisible:Qu,pinnedOffset:co,pinnedPosition:we,sectionIndex:he,sectionLength:ge,gridHasFiller:B},Le==null?void 0:Le.cell),le.field)};if(!z)return null;const be=f.left.map((le,he)=>Ae(le,he,he,f.left.length,lt.LEFT)),fe=f.right.map((le,he)=>{const pe=d.length-f.right.length+he;return Ae(le,he,pe,f.right.length,lt.RIGHT)}),ye=d.length-f.left.length-f.right.length,Ee=[];te&&Ee.push(Ae(d[b],b-f.left.length,b,ye,lt.VIRTUAL));for(let le=C.firstColumnIndex;le0&&v.jsx(pb,{width:Be}),fe.length>0&&v.jsx("div",{role:"presentation",className:k.filler}),fe,N!==0&&v.jsx(_l,{pinnedRight:f.right.length>0})]}))}),Gu=Yt(Cb),bb=()=>{const e=Et(),t=Z(),n=U(e,Ne),r=U(e,rr),o=U(e,_n),l=U(e,Xg);return{role:"grid","aria-colcount":n.length,"aria-rowcount":o+1+l+r,"aria-multiselectable":gl(t)}},wb=()=>{const e=Et(),t=U(e,Pn),n=U(e,_n);return i.useCallback((r,o)=>{const l={},s=o+n+2;return l["aria-rowindex"]=s,e.current.isRowSelectable(r.id)&&(l["aria-selected"]=t[r.id]!==void 0),l},[e,t,n])};function Ru({privateApiRef:e,configuration:t,props:n,children:r}){const o=i.useRef(e.current.getPublicApi());return v.jsx(mc.Provider,{value:t,children:v.jsx(ki.Provider,{value:n,children:v.jsx(lc.Provider,{value:e,children:v.jsx(tl.Provider,{value:o,children:r})})})})}const Sb=e=>{const t=i.useRef(null),n=i.useRef(null),r=i.useRef(null),o=i.useRef(null);e.current.register("public",{rootElementRef:t}),e.current.register("private",{mainElementRef:n,virtualScrollerRef:r,columnHeadersContainerRef:o})},yb=e=>{const t=Kt();e.current.state.isRtl===void 0&&(e.current.state.isRtl=t);const n=i.useRef(!0);i.useEffect(()=>{n.current?n.current=!1:e.current.setState(r=>h({},r,{isRtl:t}))},[e,t])},xb=Dg()&&window.localStorage.getItem("DEBUG")!=null,jn=()=>{},vb={debug:jn,info:jn,warn:jn,error:jn},qs=["debug","info","warn","error"];function Ks(e,t,n=console){const r=qs.indexOf(t);if(r===-1)throw new Error(`MUI X: Log level ${t} not recognized.`);return qs.reduce((l,s,a)=>(a>=r?l[s]=(...c)=>{const[u,...d]=c;n[s](`MUI X: ${e} - ${u}`,...d)}:l[s]=jn,l),{})}const Ib=(e,t)=>{const n=i.useCallback(r=>xb?Ks(r,"debug",t.logger):t.logLevel?Ks(r,t.logLevel.toString(),t.logger):vb,[t.logLevel,t.logger]);ce(e,{getLogger:n},"private")};class Mb{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,r={}){let o=this.events[t];o||(o={highPriority:new Map,regular:new Map},this.events[t]=o),r.isFirst?o.highPriority.set(n,!0):o.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const o=Array.from(r.highPriority.keys()),l=Array.from(r.regular.keys());for(let s=o.length-1;s>=0;s-=1){const a=o[s];r.highPriority.has(a)&&a.apply(this,n)}for(let s=0;s(this.listeners.add(n),()=>{this.listeners.delete(n)}),this.getSnapshot=()=>this.value,this.update=n=>{this.value=n,this.listeners.forEach(r=>r(n))},this.value=t,this.listeners=new Set}}const $u=Symbol("mui.api_private"),Pb=e=>e.isPropagationStopped!==void 0;let Xs=0;function Eb(e){var o;const t=(o=e.current)==null?void 0:o[$u];if(t)return t;const n={},r={state:n,store:Gl.create(n),instanceId:{id:Xs}};return Xs+=1,r.getPublicApi=()=>e.current,r.register=(l,s)=>{Object.keys(s).forEach(a=>{const c=s[a],u=r[a];if((u==null?void 0:u.spying)===!0?u.target=c:r[a]=c,l==="public"){const d=e.current,f=d[a];(f==null?void 0:f.spying)===!0?f.target=c:d[a]=c}})},r.register("private",{caches:{},eventManager:new Mb}),r}function Fb(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[$u]:e.current}}function kb(e,t){var s;const n=i.useRef(),r=i.useRef();r.current||(r.current=Eb(n)),n.current||(n.current=Fb(r));const o=i.useCallback((...a)=>{const[c,u,d={}]=a;if(d.defaultMuiPrevented=!1,Pb(d)&&d.isPropagationStopped())return;const f=t.signature===ht.DataGridPro||t.signature===ht.DataGridPremium?{api:r.current.getPublicApi()}:{};r.current.eventManager.emit(c,u,d,f)},[r,t.signature]),l=i.useCallback((a,c,u)=>{r.current.eventManager.on(a,c,u);const d=r.current;return()=>{d.eventManager.removeListener(a,c)}},[r]);return ce(r,{subscribeEvent:l,publishEvent:o},"public"),e&&!((s=e.current)!=null&&s.state)&&(e.current=n.current),i.useImperativeHandle(e,()=>n.current,[n]),i.useEffect(()=>{const a=r.current;return()=>{a.publishEvent("unmount")}},[r]),r}const Db=(e,t)=>{const n=i.useCallback(r=>{if(t.localeText[r]==null)throw new Error(`Missing translation for key ${r}.`);return t.localeText[r]},[t.localeText]);e.current.register("public",{getLocaleText:n})};function qn(e){"@babel/helpers - typeof";return qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qn(e)}function Tb(e,t){if(qn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Kn(e){var t=Tb(e,"string");return qn(t)=="symbol"?t:t+""}const Ob=e=>{const t=i.useRef({}),n=i.useRef(!1),r=i.useCallback(d=>{n.current||!d||(n.current=!0,Object.values(d.appliers).forEach(f=>{f()}),n.current=!1)},[]),o=i.useCallback((d,f,g)=>{t.current[d]||(t.current[d]={processors:new Map,processorsAsArray:[],appliers:{}});const m=t.current[d];return m.processors.get(f)!==g&&(m.processors.set(f,g),m.processorsAsArray=Array.from(t.current[d].processors.values()),r(m)),()=>{t.current[d].processors.delete(f),t.current[d].processorsAsArray=Array.from(t.current[d].processors.values())}},[r]),l=i.useCallback((d,f,g)=>(t.current[d]||(t.current[d]={processors:new Map,processorsAsArray:[],appliers:{}}),t.current[d].appliers[f]=g,()=>{const m=t.current[d].appliers,C=ne(m,[f].map(Kn));t.current[d].appliers=C}),[]),s=i.useCallback(d=>{r(t.current[d])},[r]),a=i.useCallback((...d)=>{const[f,g,m]=d;if(!t.current[f])return g;const C=t.current[f].processorsAsArray;let b=g;for(let p=0;p{const r=i.useRef(),o=i.useRef(`mui-${Math.round(Math.random()*1e9)}`),l=i.useCallback(()=>{r.current=e.current.registerPipeProcessor(t,o.current,n)},[e,n,t]);Hn(()=>{l()});const s=i.useRef(!0);i.useEffect(()=>(s.current?s.current=!1:l(),()=>{r.current&&(r.current(),r.current=null)}),[l])},Rl=(e,t,n)=>{const r=i.useRef(),o=i.useRef(`mui-${Math.round(Math.random()*1e9)}`),l=i.useCallback(()=>{r.current=e.current.registerPipeApplier(t,o.current,n)},[e,n,t]);Hn(()=>{l()});const s=i.useRef(!0);i.useEffect(()=>(s.current?s.current=!1:l(),()=>{r.current&&(r.current(),r.current=null)}),[l])},Vo=(e,t,n,r)=>{const o=i.useCallback(()=>{e.current.registerStrategyProcessor(t,n,r)},[e,r,n,t]);Hn(()=>{o()});const l=i.useRef(!0);i.useEffect(()=>{l.current?l.current=!1:o()},[o])},on="none",Ys={rowTreeCreation:"rowTree",filtering:"rowTree",sorting:"rowTree",visibleRowsLookupCreation:"rowTree"},Hb=e=>{const t=i.useRef(new Map),n=i.useRef({}),r=i.useCallback((c,u,d)=>{const f=()=>{const C=n.current[u],b=ne(C,[c].map(Kn));n.current[u]=b};n.current[u]||(n.current[u]={});const g=n.current[u],m=g[c];return g[c]=d,!m||m===d||c===e.current.getActiveStrategy(Ys[u])&&e.current.publishEvent("activeStrategyProcessorChange",u),f},[e]),o=i.useCallback((c,u)=>{const d=e.current.getActiveStrategy(Ys[c]);if(d==null)throw new Error("Can't apply a strategy processor before defining an active strategy");const f=n.current[c];if(!f||!f[d])throw new Error(`No processor found for processor "${c}" on strategy "${d}"`);const g=f[d];return g(u)},[e]),l=i.useCallback(c=>{const d=Array.from(t.current.entries()).find(([,f])=>f.group!==c?!1:f.isAvailable());return(d==null?void 0:d[0])??on},[]),s=i.useCallback((c,u,d)=>{t.current.set(u,{group:c,isAvailable:d}),e.current.publishEvent("strategyAvailabilityChange")},[e]);ce(e,{registerStrategyProcessor:r,applyStrategyProcessor:o,getActiveStrategy:l,setStrategyAvailability:s},"private")},_b=e=>{const t=i.useRef({}),[,n]=i.useState(),r=i.useCallback(u=>{t.current[u.stateId]=u},[]),o=i.useCallback((u,d)=>{let f;if(Xi(u)?f=u(e.current.state):f=u,e.current.state===f)return!1;let g=!1;const m=[];if(Object.keys(t.current).forEach(C=>{const b=t.current[C],p=b.stateSelector(e.current.state,e.current.instanceId),S=b.stateSelector(f,e.current.instanceId);S!==p&&(m.push({stateId:b.stateId,hasPropChanged:S!==b.propModel}),b.propModel!==void 0&&S!==b.propModel&&(g=!0))}),m.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${m[0].stateId}, therefore, you're not allowed to update ${m.map(C=>C.stateId).join(", ")} in the same transaction.`);if(g||(e.current.state=f,e.current.publishEvent("stateChange",f),e.current.store.update(f)),m.length===1){const{stateId:C,hasPropChanged:b}=m[0],p=t.current[C],S=p.stateSelector(f,e.current.instanceId);p.propOnChange&&b&&p.propOnChange(S,{reason:d,api:e.current}),g||e.current.publishEvent(p.changeEvent,S,{reason:d})}return!g},[e]),l=i.useCallback((u,d,f)=>e.current.setState(g=>h({},g,{[u]:d(g[u])}),f),[e]),s=i.useCallback(()=>n(()=>e.current.state),[e]),a={setState:o,forceUpdate:s},c={updateControlState:l,registerControlState:r};ce(e,a,"public"),ce(e,c,"private")},Lb=(e,t)=>{const n=kb(e,t);return Sb(n),yb(n),Ib(n,t),_b(n),Ob(n),Hb(n),Db(n,t),n.current.register("private",{rootProps:t}),n},Ke=(e,t,n)=>{const r=i.useRef(!1);r.current||(t.current.state=e(t.current.state,n,t),r.current=!0)};function Nr(e,t){if(e==null)return"";const n=typeof e=="string"?e:`${e}`;if(t.shouldAppendQuotes||t.escapeFormulas){const r=n.replace(/"/g,'""');return t.escapeFormulas&&["=","+","-","@"," ","\r"].includes(r[0])?`"'${r}"`:[t.delimiter,` +`,"\r",'"'].some(o=>n.includes(o))?`"${r}"`:r}return n}const Au=(e,t)=>{var l,s;const{csvOptions:n,ignoreValueFormatter:r}=t;let o;if(r){const a=e.colDef.type;a==="number"?o=String(e.value):a==="date"||a==="dateTime"?o=(l=e.value)==null?void 0:l.toISOString():typeof((s=e.value)==null?void 0:s.toString)=="function"?o=e.value.toString():o=e.value}else o=e.formattedValue;return Nr(o,n)};class Br{constructor(t){this.options=void 0,this.rowString="",this.isEmpty=!0,this.options=t}addValue(t){this.isEmpty||(this.rowString+=this.options.csvOptions.delimiter),typeof this.options.sanitizeCellValue=="function"?this.rowString+=this.options.sanitizeCellValue(t,this.options.csvOptions):this.rowString+=t,this.isEmpty=!1}getRowString(){return this.rowString}}const Gb=({id:e,columns:t,getCellParams:n,csvOptions:r,ignoreValueFormatter:o})=>{const l=new Br({csvOptions:r});return t.forEach(s=>{const a=n(e,s.field);l.addValue(Au(a,{ignoreValueFormatter:o,csvOptions:r}))}),l.getRowString()};function Rb(e){const{columns:t,rowIds:n,csvOptions:r,ignoreValueFormatter:o,apiRef:l}=e,s=n.reduce((f,g)=>`${f}${Gb({id:g,columns:t,getCellParams:l.current.getCellParams,ignoreValueFormatter:o,csvOptions:r})}\r +`,"").trim();if(!r.includeHeaders)return s;const a=t.filter(f=>f.field!==cn.field),c=[];if(r.includeColumnGroupsHeaders){const f=l.current.getAllGroupDetails();let g=0;const m=a.reduce((C,b)=>{const p=l.current.getColumnGroupPath(b.field);return C[b.field]=p,g=Math.max(g,p.length),C},{});for(let C=0;C{const S=(m[p.field]||[])[C],x=f[S];b.addValue(x?x.headerName||x.groupId:"")})}}const u=new Br({csvOptions:r,sanitizeCellValue:Nr});return a.forEach(f=>{u.addValue(f.headerName||f.field)}),c.push(u),`${`${c.map(f=>f.getRowString()).join(`\r +`)}\r +`}${s}`.trim()}function Qs(e){const t=document.createElement("span");t.style.whiteSpace="pre",t.style.userSelect="all",t.style.opacity="0px",t.textContent=e,document.body.appendChild(t);const n=document.createRange();n.selectNode(t);const r=window.getSelection();r.removeAllRanges(),r.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(t)}}function $b(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>{Qs(e)}):Qs(e)}function Ab(e){var t;return!!((t=window.getSelection())!=null&&t.toString()||e&&(e.selectionEnd||0)-(e.selectionStart||0)>0)}const jb=(e,t)=>{const n=t.ignoreValueFormatterDuringExport,r=(typeof n=="object"?n==null?void 0:n.clipboardExport:n)||!1,o=t.clipboardCopyCellDelimiter,l=i.useCallback(s=>{if(!((s.ctrlKey||s.metaKey)&&s.key.toLowerCase()==="c"&&!s.shiftKey&&!s.altKey)||Ab(s.target))return;let a="";if(e.current.getSelectedRows().size>0)a=e.current.getDataAsCsv({includeHeaders:!1,delimiter:o,shouldAppendQuotes:!1,escapeFormulas:!1});else{const u=st(e);if(u){const d=e.current.getCellParams(u.id,u.field);a=Au(d,{csvOptions:{delimiter:o,shouldAppendQuotes:!1,escapeFormulas:!1},ignoreValueFormatter:r})}}a=e.current.unstable_applyPipeProcessors("clipboardCopy",a),a&&($b(a),e.current.publishEvent("clipboardCopy",a))},[e,r,o]);Sl(e,e.current.rootElementRef,"keydown",l),De(e,"clipboardCopy",t.onClipboardCopy)},zb=e=>h({},e,{columnMenu:{open:!1}}),Vb=e=>{const t=Ue(e,"useGridColumnMenu"),n=i.useCallback(s=>{const a=zn(e.current.state),c={open:!0,field:s};(c.open!==a.open||c.field!==a.field)&&(e.current.setState(d=>d.columnMenu.open&&d.columnMenu.field===s?d:(t.debug("Opening Column Menu"),h({},d,{columnMenu:{open:!0,field:s}}))),e.current.hidePreferences(),e.current.forceUpdate())},[e,t]),r=i.useCallback(()=>{const s=zn(e.current.state);if(s.field){const u=Pt(e),d=ut(e),f=kt(e);let g=s.field;if(u[g]||(g=f[0]),d[g]===!1){const m=f.filter(b=>b===g?!0:d[b]!==!1),C=m.indexOf(g);g=m[C+1]||m[C-1]}e.current.setColumnHeaderFocus(g)}const a={open:!1,field:void 0};(a.open!==s.open||a.field!==s.field)&&(e.current.setState(u=>(t.debug("Hiding Column Menu"),h({},u,{columnMenu:a}))),e.current.forceUpdate())},[e,t]),o=i.useCallback(s=>{t.debug("Toggle Column Menu");const a=zn(e.current.state);!a.open||a.field!==s?n(s):r()},[e,t,n,r]);ce(e,{showColumnMenu:n,hideColumnMenu:r,toggleColumnMenu:o},"public"),ee(e,"columnResizeStart",r),ee(e,"virtualScrollerWheel",e.current.hideColumnMenu),ee(e,"virtualScrollerTouchMove",e.current.hideColumnMenu)},Nb=(e,t,n)=>{var o,l,s;const r=wn({apiRef:n,columnsToUpsert:t.columns,initialState:(o=t.initialState)==null?void 0:o.columns,columnVisibilityModel:t.columnVisibilityModel??((s=(l=t.initialState)==null?void 0:l.columns)==null?void 0:s.columnVisibilityModel)??{},keepOnlyColumnsToUpsert:!0});return h({},e,{columns:r,pinnedColumns:e.pinnedColumns??Ro})};function Bb(e,t){var _,$;const n=Ue(e,"useGridColumns"),r=i.useRef(t.columns);e.current.registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:ut,changeEvent:"columnVisibilityModelChange"});const o=i.useCallback(O=>{var P,L;n.debug("Updating columns state."),e.current.setState(Js(O)),e.current.publishEvent("columnsChange",O.orderedFields),(L=(P=e.current).updateRenderContext)==null||L.call(P),e.current.forceUpdate()},[n,e]),l=i.useCallback(O=>Pt(e)[O],[e]),s=i.useCallback(()=>pt(e),[e]),a=i.useCallback(()=>Ne(e),[e]),c=i.useCallback((O,P=!0)=>(P?Ne(e):pt(e)).findIndex(I=>I.field===O),[e]),u=i.useCallback(O=>{const P=c(O);return Rt(e)[P]},[e,c]),d=i.useCallback(O=>{var L,I;ut(e)!==O&&(e.current.setState(M=>h({},M,{columns:wn({apiRef:e,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:O,keepOnlyColumnsToUpsert:!1})})),(I=(L=e.current).updateRenderContext)==null||I.call(L),e.current.forceUpdate())},[e]),f=i.useCallback(O=>{const P=wn({apiRef:e,columnsToUpsert:O,initialState:void 0,keepOnlyColumnsToUpsert:!1});o(P)},[e,o]),g=i.useCallback((O,P)=>{const L=ut(e),I=L[O]??!0;if(P!==I){const M=h({},L,{[O]:P});e.current.setColumnVisibilityModel(M)}},[e]),m=i.useCallback(O=>kt(e).findIndex(L=>L===O),[e]),C=i.useCallback((O,P)=>{const L=kt(e),I=m(O);if(I===P)return;n.debug(`Moving column ${O} to index ${P}`);const M=[...L],w=M.splice(I,1)[0];M.splice(P,0,w),o(h({},xt(e.current.state),{orderedFields:M}));const j={column:e.current.getColumn(O),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(O),oldIndex:I};e.current.publishEvent("columnIndexChange",j)},[e,n,o,m]),b=i.useCallback((O,P)=>{n.debug(`Updating column ${O} width to ${P}`);const L=xt(e.current.state),I=L.lookup[O],M=h({},I,{width:P,hasBeenResized:!0});o(Or(h({},L,{lookup:h({},L.lookup,{[O]:M})}),e.current.getRootDimensions())),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(O),colDef:M,width:P})},[e,n,o]),p={getColumn:l,getAllColumns:s,getColumnIndex:c,getColumnPosition:u,getVisibleColumns:a,getColumnIndexRelativeToVisibleColumns:m,updateColumns:f,setColumnVisibilityModel:d,setColumnVisibility:g,setColumnWidth:b},S={setColumnIndex:C};ce(e,p,"public"),ce(e,S,t.signature===ht.DataGrid?"private":"public");const x=i.useCallback((O,P)=>{var T,R;const L={},I=ut(e);(!P.exportOnlyDirtyModels||t.columnVisibilityModel!=null||Object.keys(((R=(T=t.initialState)==null?void 0:T.columns)==null?void 0:R.columnVisibilityModel)??{}).length>0||Object.keys(I).length>0)&&(L.columnVisibilityModel=I),L.orderedFields=kt(e);const w=pt(e),j={};return w.forEach(z=>{if(z.hasBeenResized){const N={};rc.forEach(B=>{let W=z[B];W===1/0&&(W=-1),N[B]=W}),j[z.field]=N}}),Object.keys(j).length>0&&(L.dimensions=j),h({},O,{columns:L})},[e,t.columnVisibilityModel,(_=t.initialState)==null?void 0:_.columns]),D=i.useCallback((O,P)=>{var w;const L=(w=P.stateToRestore.columns)==null?void 0:w.columnVisibilityModel,I=P.stateToRestore.columns;if(L==null&&I==null)return O;const M=wn({apiRef:e,columnsToUpsert:[],initialState:I,columnVisibilityModel:L,keepOnlyColumnsToUpsert:!1});return e.current.setState(Js(M)),I!=null&&e.current.publishEvent("columnsChange",M.orderedFields),O},[e]),E=i.useCallback((O,P)=>{var L;if(P===bt.columns){const I=t.slots.columnsPanel;return v.jsx(I,h({},(L=t.slotProps)==null?void 0:L.columnsPanel))}return O},[t.slots.columnsPanel,($=t.slotProps)==null?void 0:$.columnsPanel]),H=i.useCallback(O=>t.disableColumnSelector?O:[...O,"columnMenuColumnsItem"],[t.disableColumnSelector]);$e(e,"columnMenu",H),$e(e,"exportState",x),$e(e,"restoreState",D),$e(e,"preferencePanel",E);const G=i.useRef(null);ee(e,"viewportInnerSizeChange",O=>{G.current!==O.width&&(G.current=O.width,o(Or(xt(e.current.state),e.current.getRootDimensions())))});const F=i.useCallback(()=>{n.info("Columns pipe processing have changed, regenerating the columns");const O=wn({apiRef:e,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1});o(O)},[e,n,o]);Rl(e,"hydrateColumns",F);const y=i.useRef(!0);i.useEffect(()=>{if(y.current){y.current=!1;return}if(n.info(`GridColumns have changed, new length ${t.columns.length}`),r.current===t.columns)return;const O=wn({apiRef:e,initialState:void 0,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0});r.current=t.columns,o(O)},[n,e,o,t.columns]),i.useEffect(()=>{t.columnVisibilityModel!==void 0&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,n,t.columnVisibilityModel])}function Js(e){return t=>h({},t,{columns:e})}const Ub=(e,t)=>{var n;return h({},e,{density:((n=t.initialState)==null?void 0:n.density)??t.density??"standard"})},Wb=(e,t)=>{var a;const n=Ue(e,"useDensity");e.current.registerControlState({stateId:"density",propModel:t.density,propOnChange:t.onDensityChange,stateSelector:zt,changeEvent:"densityChange"});const o={setDensity:Re(c=>{zt(e.current.state)!==c&&(n.debug(`Set grid density to ${c}`),e.current.setState(d=>h({},d,{density:c})))})};ce(e,o,"public");const l=i.useCallback((c,u)=>{var g;const d=zt(e.current.state);return!u.exportOnlyDirtyModels||t.density!=null||((g=t.initialState)==null?void 0:g.density)!=null?h({},c,{density:d}):c},[e,t.density,(a=t.initialState)==null?void 0:a.density]),s=i.useCallback((c,u)=>{var f;const d=(f=u.stateToRestore)!=null&&f.density?u.stateToRestore.density:zt(e.current.state);return e.current.setState(g=>h({},g,{density:d})),c},[e]);$e(e,"exportState",l),$e(e,"restoreState",s),i.useEffect(()=>{t.density&&e.current.setDensity(t.density)},[e,t.density])};function qb(e,t="csv",n=document.title||"untitled"){const r=`${n}.${t}`;if("download"in HTMLAnchorElement.prototype){const o=URL.createObjectURL(e),l=document.createElement("a");l.href=o,l.download=r,l.click(),setTimeout(()=>{URL.revokeObjectURL(o)});return}throw new Error("MUI X: exportAs not supported.")}const ju=({apiRef:e,options:t})=>{const n=pt(e);return t.fields?t.fields.reduce((o,l)=>{const s=n.find(a=>a.field===l);return s&&o.push(s),o},[]):(t.allColumns?n:Ne(e)).filter(o=>!o.disableExport)},zu=({apiRef:e})=>{var c,u;const t=Cl(e),n=rt(e),r=e.current.getSelectedRows(),o=t.filter(d=>n[d].type!=="footer"),l=an(e),s=((c=l==null?void 0:l.top)==null?void 0:c.map(d=>d.id))||[],a=((u=l==null?void 0:l.bottom)==null?void 0:u.map(d=>d.id))||[];return o.unshift(...s),o.push(...a),r.size>0?o.filter(d=>r.has(d)):o},Kb=(e,t)=>{const n=Ue(e,"useGridCsvExport"),r=t.ignoreValueFormatterDuringExport,o=(typeof r=="object"?r==null?void 0:r.csvExport:r)||!1,l=i.useCallback((u={})=>{n.debug("Get data as CSV");const d=ju({apiRef:e,options:u}),g=(u.getRowsToExport??zu)({apiRef:e});return Rb({columns:d,rowIds:g,csvOptions:{delimiter:u.delimiter||",",shouldAppendQuotes:u.shouldAppendQuotes??!0,includeHeaders:u.includeHeaders??!0,includeColumnGroupsHeaders:u.includeColumnGroupsHeaders??!0,escapeFormulas:u.escapeFormulas??!0},ignoreValueFormatter:o,apiRef:e})},[n,e,o]),s=i.useCallback(u=>{n.debug("Export data as CSV");const d=l(u),f=new Blob([u!=null&&u.utf8WithBom?new Uint8Array([239,187,191]):"",d],{type:"text/csv"});qb(f,"csv",u==null?void 0:u.fileName)},[n,l]);ce(e,{getDataAsCsv:l,exportDataAsCsv:s},"public");const c=i.useCallback((u,d)=>{var f;return(f=d.csvOptions)!=null&&f.disableToolbarButton?u:[...u,{component:v.jsx(Mu,{options:d.csvOptions}),componentName:"csvExport"}]},[]);$e(e,"exportMenu",c)},Lo=(e,t,n)=>{let r=e.paginationModel;const o=e.rowCount,l=(n==null?void 0:n.pageSize)??r.pageSize,s=(n==null?void 0:n.page)??r.page,a=Ta(o,l,s);n&&((n==null?void 0:n.page)!==r.page||(n==null?void 0:n.pageSize)!==r.pageSize)&&(r=n);const c=Cm(r.page,a);return c!==r.page&&(r=h({},r,{page:c})),Ha(r.pageSize,t),r},Xb=(e,t)=>{var C,b;const n=Ue(e,"useGridPaginationModel"),r=U(e,Tn),o=Math.floor(t.rowHeight*r);e.current.registerControlState({stateId:"paginationModel",propModel:t.paginationModel,propOnChange:t.onPaginationModelChange,stateSelector:Je,changeEvent:"paginationModelChange"});const l=i.useCallback(p=>{const S=Je(e);p!==S.page&&(n.debug(`Setting page to ${p}`),e.current.setPaginationModel({page:p,pageSize:S.pageSize}))},[e,n]),s=i.useCallback(p=>{const S=Je(e);p!==S.pageSize&&(n.debug(`Setting page size to ${p}`),e.current.setPaginationModel({pageSize:p,page:S.page}))},[e,n]),a=i.useCallback(p=>{const S=Je(e);p!==S&&(n.debug("Setting 'paginationModel' to",p),e.current.setState(x=>h({},x,{pagination:h({},x.pagination,{paginationModel:Lo(x.pagination,t.signature,p)})})))},[e,n,t.signature]);ce(e,{setPage:l,setPageSize:s,setPaginationModel:a},"public");const u=i.useCallback((p,S)=>{var E,H;const x=Je(e);return!S.exportOnlyDirtyModels||t.paginationModel!=null||((H=(E=t.initialState)==null?void 0:E.pagination)==null?void 0:H.paginationModel)!=null||x.page!==0&&x.pageSize!==pm(t.autoPageSize)?h({},p,{pagination:h({},p.pagination,{paginationModel:x})}):p},[e,t.paginationModel,(b=(C=t.initialState)==null?void 0:C.pagination)==null?void 0:b.paginationModel,t.autoPageSize]),d=i.useCallback((p,S)=>{var D,E;const x=(D=S.stateToRestore.pagination)!=null&&D.paginationModel?h({},Oa(t.autoPageSize),(E=S.stateToRestore.pagination)==null?void 0:E.paginationModel):Je(e);return e.current.setState(H=>h({},H,{pagination:h({},H.pagination,{paginationModel:Lo(H.pagination,t.signature,x)})})),p},[e,t.autoPageSize,t.signature]);$e(e,"exportState",u),$e(e,"restoreState",d);const f=()=>{var S;const p=Je(e);(S=e.current.virtualScrollerRef)!=null&&S.current&&e.current.scrollToIndexes({rowIndex:p.page*p.pageSize})},g=i.useCallback(()=>{if(!t.autoPageSize)return;const p=e.current.getRootDimensions(),S=Math.floor(p.viewportInnerSize.height/o);e.current.setPageSize(S)},[e,t.autoPageSize,o]),m=i.useCallback(p=>{if(p==null)return;const S=Je(e),x=yl(e);S.page>x-1&&e.current.setPage(Math.max(0,x-1))},[e]);ee(e,"viewportInnerSizeChange",g),ee(e,"paginationModelChange",f),ee(e,"rowCountChange",m),i.useEffect(()=>{e.current.setState(p=>h({},p,{pagination:h({},p.pagination,{paginationModel:Lo(p.pagination,t.signature,t.paginationModel)})}))},[e,t.paginationModel,t.paginationMode,t.signature]),i.useEffect(g,[g])};function Yb(){return new Promise(e=>{requestAnimationFrame(()=>{e()})})}function Qb(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}const Jb=(e,t)=>{const n=e.current.rootElementRef.current!==null,r=Ue(e,"useGridPrintExport"),o=i.useRef(null),l=i.useRef(null),s=i.useRef({}),a=i.useRef([]),c=i.useRef();i.useEffect(()=>{o.current=Nt(e.current.rootElementRef.current)},[e,n]);const u=i.useCallback((p,S,x)=>new Promise(D=>{const E=ju({apiRef:e,options:{fields:p,allColumns:S}}).map(A=>A.field),H=pt(e),G={};H.forEach(A=>{G[A.field]=E.includes(A.field)}),x&&(G[cn.field]=!0),e.current.setColumnVisibilityModel(G),D()}),[e]),d=i.useCallback(p=>{const x=p({apiRef:e}).reduce((D,E)=>{const H=e.current.getRow(E);return H[en]||D.push(H),D},[]);e.current.setRows(x)},[e]),f=i.useCallback((p,S)=>{var L,I,M,w;const x=h({copyStyles:!0,hideToolbar:!1,hideFooter:!1,includeCheckboxes:!1},S),D=p.contentDocument;if(!D)return;const E=un(e.current.state),H=e.current.rootElementRef.current,G=H.cloneNode(!0),A=G.querySelector(`.${k.main}`);A.style.overflow="visible",G.style.contain="size";let F=((L=H.querySelector(`.${k.toolbarContainer}`))==null?void 0:L.offsetHeight)||0,y=((I=H.querySelector(`.${k.footerContainer}`))==null?void 0:I.offsetHeight)||0;x.hideToolbar&&((M=G.querySelector(`.${k.toolbarContainer}`))==null||M.remove(),F=0),x.hideFooter&&((w=G.querySelector(`.${k.footerContainer}`))==null||w.remove(),y=0);const _=E.currentPageTotalHeight+El(e,t)+F+y;if(G.style.height=`${_}px`,G.style.boxSizing="content-box",!x.hideFooter){const j=G.querySelector(`.${k.footerContainer}`);j.style.position="absolute",j.style.width="100%",j.style.top=`${_-y}px`}const $=document.createElement("div");$.appendChild(G),D.body.style.marginTop="0px",D.body.innerHTML=$.innerHTML;const O=typeof x.pageStyle=="function"?x.pageStyle():x.pageStyle;if(typeof O=="string"){const j=D.createElement("style");j.appendChild(D.createTextNode(O)),D.head.appendChild(j)}x.bodyClassName&&D.body.classList.add(...x.bodyClassName.split(" "));const P=[];if(x.copyStyles){const j=H.getRootNode(),R=(j.constructor.name==="ShadowRoot"?j:o.current).querySelectorAll("style, link[rel='stylesheet']");for(let z=0;z{B.addEventListener("load",()=>W())})),D.head.appendChild(B)}}}Promise.all(P).then(()=>{p.contentWindow.print()})},[e,o,t]),g=i.useCallback(p=>{var S,x;o.current.body.removeChild(p),e.current.restoreState(l.current||{}),(x=(S=l.current)==null?void 0:S.columns)!=null&&x.columnVisibilityModel||e.current.setColumnVisibilityModel(s.current),e.current.setState(D=>h({},D,{virtualization:c.current})),e.current.setRows(a.current),l.current=null,s.current={},a.current=[]},[e]),C={exportDataAsPrint:i.useCallback(async p=>{if(r.debug("Export data as Print"),!e.current.rootElementRef.current)throw new Error("MUI X: No grid root element available.");if(l.current=e.current.exportState(),s.current=ut(e),a.current=e.current.getSortedRows().filter(x=>!x[en]),t.pagination){const D={page:0,pageSize:rr(e)};e.current.setState(E=>h({},E,{pagination:h({},E.pagination,{paginationModel:Lo(E.pagination,"DataGridPro",D)})}))}c.current=e.current.state.virtualization,e.current.setState(x=>h({},x,{virtualization:h({},x.virtualization,{enabled:!1,enabledForColumns:!1})})),await u(p==null?void 0:p.fields,p==null?void 0:p.allColumns,p==null?void 0:p.includeCheckboxes),d((p==null?void 0:p.getRowsToExport)??zu),await Yb();const S=Qb(p==null?void 0:p.fileName);S.onload=()=>{f(S,p),S.contentWindow.matchMedia("print").addEventListener("change",D=>{D.matches===!1&&g(S)})},o.current.body.appendChild(S)},[t,r,e,f,g,u,d])};ce(e,C,"public");const b=i.useCallback((p,S)=>{var x;return(x=S.printOptions)!=null&&x.disableToolbarButton?p:[...p,{component:v.jsx(Pu,{options:S.printOptions}),componentName:"printExport"}]},[]);$e(e,"exportMenu",b)},Zb=(e,t,n)=>{var o,l;const r=t.filterModel??((l=(o=t.initialState)==null?void 0:o.filter)==null?void 0:l.filterModel)??In();return h({},e,{filter:{filterModel:ul(r,t.disableMultipleColumnsFiltering,n),filteredRowsLookup:{},filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}},visibleRowsLookup:{}})},ew=e=>e.filteredRowsLookup;function Zs(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}function tw(){return Ri(Object.values)}const nw=(e,t)=>{var y,_,$;const n=Ue(e,"useGridFilter");e.current.registerControlState({stateId:"filter",propModel:t.filterModel,propOnChange:t.onFilterModelChange,stateSelector:We,changeEvent:"filterModelChange"});const r=i.useCallback(()=>{e.current.setState(O=>{const P=We(O,e.current.instanceId),L=e.current.getFilterState(P),I=h({},O,{filter:h({},O.filter,L)}),M=Zs(e,I);return h({},I,{visibleRowsLookup:M})}),e.current.publishEvent("filteredRowsSet")},[e]),o=i.useCallback((O,P)=>P==null||P.filterable===!1||t.disableColumnFilter?O:[...O,"columnMenuFilterItem"],[t.disableColumnFilter]),l=i.useCallback(()=>{r(),e.current.forceUpdate()},[e,r]),s=i.useCallback(O=>{const P=We(e),L=[...P.items],I=L.findIndex(M=>M.id===O.id);I===-1?L.push(O):L[I]=O,e.current.setFilterModel(h({},P,{items:L}),"upsertFilterItem")},[e]),a=i.useCallback(O=>{const P=We(e),L=[...P.items];O.forEach(I=>{const M=L.findIndex(w=>w.id===I.id);M===-1?L.push(I):L[M]=I}),e.current.setFilterModel(h({},P,{items:L}),"upsertFilterItems")},[e]),c=i.useCallback(O=>{const P=We(e),L=P.items.filter(I=>I.id!==O.id);L.length!==P.items.length&&e.current.setFilterModel(h({},P,{items:L}),"deleteFilterItem")},[e]),u=i.useCallback((O,P,L)=>{if(n.debug("Displaying filter panel"),O){const I=We(e),M=I.items.filter(R=>{var W;if(R.value!==void 0)return!(Array.isArray(R.value)&&R.value.length===0);const N=(W=e.current.getColumn(R.field).filterOperators)==null?void 0:W.find(X=>X.value===R.operator);return!(typeof(N==null?void 0:N.requiresFilterValue)>"u"?!0:N==null?void 0:N.requiresFilterValue)});let w;const j=M.find(R=>R.field===O),T=e.current.getColumn(O);j?w=M:t.disableMultipleColumnsFiltering?w=[kr({field:O,operator:T.filterOperators[0].value},e)]:w=[...M,kr({field:O,operator:T.filterOperators[0].value},e)],e.current.setFilterModel(h({},I,{items:w}))}e.current.showPreferences(bt.filters,P,L)},[e,n,t.disableMultipleColumnsFiltering]),d=i.useCallback(()=>{n.debug("Hiding filter panel"),e.current.hidePreferences()},[e,n]),f=i.useCallback(O=>{const P=We(e);P.logicOperator!==O&&e.current.setFilterModel(h({},P,{logicOperator:O}),"changeLogicOperator")},[e]),g=i.useCallback(O=>{const P=We(e);Bt(P.quickFilterValues,O)||e.current.setFilterModel(h({},P,{quickFilterValues:[...O]}))},[e]),m=i.useCallback((O,P)=>{We(e)!==O&&(n.debug("Setting filter model"),e.current.updateControlState("filter",xs(O,t.disableMultipleColumnsFiltering,e),P),e.current.unstable_applyFilters())},[e,n,t.disableMultipleColumnsFiltering]),C=i.useCallback(O=>{const P=ul(O,t.disableMultipleColumnsFiltering,e),L=t.filterMode==="client"?$g(P,e,t.disableEval):null,I=e.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:L,filterModel:P??In()});return h({},I,{filterModel:P})},[t.disableMultipleColumnsFiltering,t.filterMode,t.disableEval,e]),b={setFilterLogicOperator:f,unstable_applyFilters:l,deleteFilterItem:c,upsertFilterItem:s,upsertFilterItems:a,setFilterModel:m,showFilterPanel:u,hideFilterPanel:d,setQuickFilterValues:g,ignoreDiacritics:t.ignoreDiacritics,getFilterState:C};ce(e,b,"public");const p=i.useCallback((O,P)=>{var M,w;const L=We(e);return!P.exportOnlyDirtyModels||t.filterModel!=null||((w=(M=t.initialState)==null?void 0:M.filter)==null?void 0:w.filterModel)!=null||!Bt(L,In())?h({},O,{filter:{filterModel:L}}):O},[e,t.filterModel,(_=(y=t.initialState)==null?void 0:y.filter)==null?void 0:_.filterModel]),S=i.useCallback((O,P)=>{var I;const L=(I=P.stateToRestore.filter)==null?void 0:I.filterModel;return L==null?O:(e.current.updateControlState("filter",xs(L,t.disableMultipleColumnsFiltering,e),"restoreState"),h({},O,{callbacks:[...O.callbacks,e.current.unstable_applyFilters]}))},[e,t.disableMultipleColumnsFiltering]),x=i.useCallback((O,P)=>{var L;if(P===bt.filters){const I=t.slots.filterPanel;return v.jsx(I,h({},(L=t.slotProps)==null?void 0:L.filterPanel))}return O},[t.slots.filterPanel,($=t.slotProps)==null?void 0:$.filterPanel]),{getRowId:D}=t,E=Xt(tw),H=i.useCallback(O=>{if(t.filterMode!=="client"||!O.isRowMatchingFilters)return{filteredRowsLookup:{},filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}};const P=_t(e),L={},{isRowMatchingFilters:I}=O,M={},w={passingFilterItems:null,passingQuickFilterValues:null},j=E.current(e.current.state.rows.dataRowIdToModelLookup);for(let z=0;z{n.debug("onColUpdated - GridColumns changed, applying filters");const O=We(e),P=Pt(e),L=O.items.filter(I=>I.field&&P[I.field]);L.length{O==="filtering"&&e.current.unstable_applyFilters()},[e]),F=i.useCallback(()=>{e.current.setState(O=>h({},O,{visibleRowsLookup:Zs(e,O)})),e.current.forceUpdate()},[e]);ee(e,"rowsSet",r),ee(e,"columnsChange",G),ee(e,"activeStrategyProcessorChange",A),ee(e,"rowExpansionChange",F),ee(e,"columnVisibilityModelChange",()=>{const O=We(e);O.quickFilterValues&&Zi(O)&&e.current.unstable_applyFilters()}),Hn(()=>{e.current.unstable_applyFilters()}),Ye(()=>{t.filterModel!==void 0&&e.current.setFilterModel(t.filterModel)},[e,n,t.filterModel])},ow=e=>h({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),rw=(e,t)=>{const n=Ue(e,"useGridFocus"),r=i.useRef(null),o=e.current.rootElementRef.current!==null,l=i.useCallback((F,y)=>{F&&e.current.getRow(F.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(F.id,F.field),y)},[e]),s=i.useCallback((F,y)=>{const _=st(e);(_==null?void 0:_.id)===F&&(_==null?void 0:_.field)===y||(e.current.setState($=>(n.debug(`Focusing on cell with id=${F} and field=${y}`),h({},$,{tabIndex:{cell:{id:F,field:y},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},focus:{cell:{id:F,field:y},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))),e.current.forceUpdate(),e.current.getRow(F)&&(_&&l(_,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(F,y))))},[e,n,l]),a=i.useCallback((F,y={})=>{const _=st(e);l(_,y),e.current.setState($=>(n.debug(`Focusing on column header with colIndex=${F}`),h({},$,{tabIndex:{columnHeader:{field:F},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:F},columnHeaderFilter:null,cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,l]),c=i.useCallback((F,y={})=>{const _=st(e);l(_,y),e.current.setState($=>(n.debug(`Focusing on column header filter with colIndex=${F}`),h({},$,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:F},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:F},cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,l]),u=i.useCallback((F,y,_={})=>{const $=st(e);$&&e.current.publishEvent("cellFocusOut",e.current.getCellParams($.id,$.field),_),e.current.setState(O=>h({},O,{tabIndex:{columnGroupHeader:{field:F,depth:y},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:F,depth:y},columnHeader:null,columnHeaderFilter:null,cell:null}})),e.current.forceUpdate()},[e]),d=i.useCallback(()=>Un(e),[e]),f=i.useCallback((F,y,_)=>{let $=e.current.getColumnIndex(y);const O=Ne(e),P=Wn(e,{pagination:t.pagination,paginationMode:t.paginationMode}),L=an(e),I=[].concat(L.top||[],P.rows,L.bottom||[]);let M=I.findIndex(R=>R.id===F);_==="right"?$+=1:_==="left"?$-=1:M+=1,$>=O.length?(M+=1,M=0&&($=O.length-1)),M=Lt(M,0,I.length-1);const w=I[M];if(!w)return;const j=e.current.unstable_getCellColSpanInfo(w.id,$);j&&j.spannedByColSpan&&(_==="left"||_==="below"?$=j.leftVisibleCellIndex:_==="right"&&($=j.rightVisibleCellIndex)),$=Lt($,0,O.length-1);const T=O[$];e.current.setCellFocus(w.id,T.field)},[e,t.pagination,t.paginationMode]),g=i.useCallback(({id:F,field:y})=>{e.current.setCellFocus(F,y)},[e]),m=i.useCallback((F,y)=>{y.key==="Enter"||y.key==="Tab"||y.key==="Shift"||zo(y.key)||e.current.setCellFocus(F.id,F.field)},[e]),C=i.useCallback(({field:F},y)=>{y.target===y.currentTarget&&e.current.setColumnHeaderFocus(F,y)},[e]),b=i.useCallback(({fields:F,depth:y},_)=>{if(_.target!==_.currentTarget)return;const $=Un(e);$!==null&&$.depth===y&&F.includes($.field)||e.current.setColumnGroupHeaderFocus(F[0],y,_)},[e]),p=i.useCallback((F,y)=>{var _,$;($=(_=y.relatedTarget)==null?void 0:_.getAttribute("class"))!=null&&$.includes(k.columnHeader)||(n.debug("Clearing focus"),e.current.setState(O=>h({},O,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[n,e]),S=i.useCallback(F=>{r.current=F},[]),x=i.useCallback(F=>{const y=r.current;r.current=null;const _=st(e);if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:F,cell:y}))return;if(!_){y&&e.current.setCellFocus(y.id,y.field);return}if((y==null?void 0:y.id)===_.id&&(y==null?void 0:y.field)===_.field)return;const O=e.current.getCellElement(_.id,_.field);O!=null&&O.contains(F.target)||(y?e.current.setCellFocus(y.id,y.field):(e.current.setState(P=>h({},P,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),e.current.forceUpdate(),l(_,F)))},[e,l]),D=i.useCallback(F=>{if(F.cellMode==="view")return;const y=st(e);((y==null?void 0:y.id)!==F.id||(y==null?void 0:y.field)!==F.field)&&e.current.setCellFocus(F.id,F.field)},[e]),E=i.useCallback(()=>{const F=st(e);F&&!e.current.getRow(F.id)&&e.current.setState(y=>h({},y,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))},[e]),H=Re(()=>{const F=st(e);if(!F)return;const y=Wn(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(y.rows.find(O=>O.id===F.id))return;const $=Ne(e);e.current.setState(O=>h({},O,{tabIndex:{cell:{id:y.rows[0].id,field:$[0].field},columnGroupHeader:null,columnHeader:null,columnHeaderFilter:null}}))}),G={setCellFocus:s,setColumnHeaderFocus:a,setColumnHeaderFilterFocus:c},A={moveFocusToRelativeCell:f,setColumnGroupHeaderFocus:u,getColumnGroupHeaderFocus:d};ce(e,G,"public"),ce(e,A,"private"),i.useEffect(()=>{const F=Nt(e.current.rootElementRef.current);return F.addEventListener("mouseup",x),()=>{F.removeEventListener("mouseup",x)}},[e,o,x]),ee(e,"columnHeaderBlur",p),ee(e,"cellDoubleClick",g),ee(e,"cellMouseDown",S),ee(e,"cellKeyDown",m),ee(e,"cellModeChange",D),ee(e,"columnHeaderFocus",C),ee(e,"columnGroupHeaderFocus",b),ee(e,"rowsSet",E),ee(e,"paginationModelChange",H)};function lw(e,t){const n=an(e)||{};return[...n.top||[],...t,...n.bottom||[]]}const xr=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(et)return e-1;return null},vr=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(e>t)return e-1}else if(!r&&e=0&&s{const n=Ue(e,"useGridKeyboardNavigation"),r=Qt(e,t).rows,o=Kt(),l=i.useMemo(()=>lw(e,r),[e,r]),s=t.signature!=="DataGrid"&&t.headerFilters,a=i.useCallback((S,x,D="left",E="up")=>{const H=$t(e),G=e.current.unstable_getCellColSpanInfo(x,S);G&&G.spannedByColSpan&&(D==="left"?S=G.leftVisibleCellIndex:D==="right"&&(S=G.rightVisibleCellIndex));const A=sn(e)[S],F=sw(e,x,A,E),y=H.findIndex(_=>_.id===F);n.debug(`Navigating to cell row ${y}, col ${S}`),e.current.scrollToIndexes({colIndex:S,rowIndex:y}),e.current.setCellFocus(F,A)},[e,n]),c=i.useCallback((S,x)=>{n.debug(`Navigating to header col ${S}`),e.current.scrollToIndexes({colIndex:S});const D=e.current.getVisibleColumns()[S].field;e.current.setColumnHeaderFocus(D,x)},[e,n]),u=i.useCallback((S,x)=>{n.debug(`Navigating to header filter col ${S}`),e.current.scrollToIndexes({colIndex:S});const D=e.current.getVisibleColumns()[S].field;e.current.setColumnHeaderFilterFocus(D,x)},[e,n]),d=i.useCallback((S,x,D)=>{n.debug(`Navigating to header col ${S}`),e.current.scrollToIndexes({colIndex:S});const{field:E}=e.current.getVisibleColumns()[S];e.current.setColumnGroupHeaderFocus(E,x,D)},[e,n]),f=i.useCallback(S=>{var x;return(x=l[S])==null?void 0:x.id},[l]),g=i.useCallback((S,x)=>{const D=x.currentTarget.querySelector(`.${k.columnHeaderTitleContainerContent}`);if(!!D&&D.contains(x.target)&&S.field!==cn.field)return;const H=e.current.getViewportPageSize(),G=S.field?e.current.getColumnIndex(S.field):0,A=l.length>0?0:null,F=l.length-1,y=0,_=Ne(e).length-1,$=_n(e);let O=!0;switch(x.key){case"ArrowDown":{A!==null&&(s?u(G,x):a(G,f(A)));break}case"ArrowRight":{const P=vr({currentColIndex:G,firstColIndex:y,lastColIndex:_,isRtl:o});P!==null&&c(P,x);break}case"ArrowLeft":{const P=xr({currentColIndex:G,firstColIndex:y,lastColIndex:_,isRtl:o});P!==null&&c(P,x);break}case"ArrowUp":{$>0&&d(G,$-1,x);break}case"PageDown":{A!==null&&F!==null&&a(G,f(Math.min(A+H,F)));break}case"Home":{c(y,x);break}case"End":{c(_,x);break}case"Enter":{(x.ctrlKey||x.metaKey)&&e.current.toggleColumnMenu(S.field);break}case" ":break;default:O=!1}O&&x.preventDefault()},[e,l.length,s,u,a,f,o,c,d]),m=i.useCallback((S,x)=>{const D=tc(e)===S.field,E=nc(e)===S.field;if(D||E||!zo(x.key))return;const H=e.current.getViewportPageSize(),G=S.field?e.current.getColumnIndex(S.field):0,A=0,F=l.length-1,y=0,_=Ne(e).length-1;let $=!0;switch(x.key){case"ArrowDown":{const O=f(A);O!=null&&a(G,O);break}case"ArrowRight":{const O=vr({currentColIndex:G,firstColIndex:y,lastColIndex:_,isRtl:o});O!==null&&u(O,x);break}case"ArrowLeft":{const O=xr({currentColIndex:G,firstColIndex:y,lastColIndex:_,isRtl:o});O!==null?u(O,x):e.current.setColumnHeaderFilterFocus(S.field,x);break}case"ArrowUp":{c(G,x);break}case"PageDown":{F!==null&&a(G,f(Math.min(A+H,F)));break}case"Home":{u(y,x);break}case"End":{u(_,x);break}case" ":break;default:$=!1}$&&x.preventDefault()},[e,l.length,u,o,c,a,f]),C=i.useCallback((S,x)=>{const D=Un(e);if(D===null)return;const{field:E,depth:H}=D,{fields:G,depth:A,maxDepth:F}=S,y=e.current.getViewportPageSize(),_=e.current.getColumnIndex(E),$=E?e.current.getColumnIndex(E):0,O=0,P=l.length-1,L=0,I=Ne(e).length-1;let M=!0;switch(x.key){case"ArrowDown":{A===F-1?c(_,x):d(_,H+1,x);break}case"ArrowUp":{A>0&&d(_,H-1,x);break}case"ArrowRight":{const w=G.length-G.indexOf(E)-1;_+w+1<=I&&d(_+w+1,H,x);break}case"ArrowLeft":{const w=G.indexOf(E);_-w-1>=L&&d(_-w-1,H,x);break}case"PageDown":{P!==null&&a($,f(Math.min(O+y,P)));break}case"Home":{d(L,H,x);break}case"End":{d(I,H,x);break}case" ":break;default:M=!1}M&&x.preventDefault()},[e,l.length,c,d,a,f]),b=i.useCallback((S,x)=>{if(io(x))return;const D=e.current.getCellParams(S.id,S.field);if(D.cellMode===xe.Edit||!zo(x.key)||!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:x,cell:D})||l.length===0)return;const H=e.current.getViewportPageSize(),G=S.field?e.current.getColumnIndex(S.field):0,A=l.findIndex(P=>P.id===S.id),F=0,y=l.length-1,_=0,$=Ne(e).length-1;let O=!0;switch(x.key){case"ArrowDown":{AF?a(G,f(A-1)):s?u(G,x):c(G,x);break}case"ArrowRight":{const P=vr({currentColIndex:G,firstColIndex:_,lastColIndex:$,isRtl:o});P!==null&&a(P,f(A),o?"left":"right");break}case"ArrowLeft":{const P=xr({currentColIndex:G,firstColIndex:_,lastColIndex:$,isRtl:o});P!==null&&a(P,f(A),o?"right":"left");break}case"Tab":{x.shiftKey&&G>_?a(G-1,f(A),"left"):!x.shiftKey&&G<$&&a(G+1,f(A),"right");break}case" ":{if(S.field===Ll)break;const L=S.colDef;if(L&&L.field==="__tree_data_group__")break;!x.shiftKey&&A=F?a(G,f(P)):c(G,x);break}case"Home":{x.ctrlKey||x.metaKey||x.shiftKey?a(_,f(F)):a(_,f(A));break}case"End":{x.ctrlKey||x.metaKey||x.shiftKey?a($,f(y)):a($,f(A));break}default:O=!1}O&&x.preventDefault()},[e,l,o,a,f,s,u,c]),p=i.useCallback((S,{event:x})=>x.key===" "?!1:S,[]);$e(e,"canStartEditing",p),ee(e,"columnHeaderKeyDown",g),ee(e,"headerFilterKeyDown",m),ee(e,"columnGroupHeaderKeyDown",C),ee(e,"cellKeyDown",b)},aw=(e,t)=>{var C,b;const n=Ue(e,"useGridRowCount"),r=U(e,lr),o=U(e,Zt),l=U(e,xn),s=U(e,Je),a=Xt(()=>Je(e).pageSize);e.current.registerControlState({stateId:"paginationRowCount",propModel:t.rowCount,propOnChange:t.onRowCountChange,stateSelector:Zt,changeEvent:"rowCountChange"});const u={setRowCount:i.useCallback(p=>{o!==p&&(n.debug("Setting 'rowCount' to",p),e.current.setState(S=>h({},S,{pagination:h({},S.pagination,{rowCount:p})})))},[e,n,o])};ce(e,u,"public");const d=i.useCallback((p,S)=>{var E,H;const x=Zt(e);return!S.exportOnlyDirtyModels||t.rowCount!=null||((H=(E=t.initialState)==null?void 0:E.pagination)==null?void 0:H.rowCount)!=null?h({},p,{pagination:h({},p.pagination,{rowCount:x})}):p},[e,t.rowCount,(b=(C=t.initialState)==null?void 0:C.pagination)==null?void 0:b.rowCount]),f=i.useCallback((p,S)=>{var D;const x=(D=S.stateToRestore.pagination)!=null&&D.rowCount?S.stateToRestore.pagination.rowCount:Zt(e);return e.current.setState(E=>h({},E,{pagination:h({},E.pagination,{rowCount:x})})),p},[e]);$e(e,"exportState",d),$e(e,"restoreState",f);const g=i.useCallback(p=>{t.paginationMode==="client"||!a.current||p.pageSize!==a.current&&(a.current=p.pageSize,o===-1&&e.current.setPage(0))},[t.paginationMode,a,o,e]);ee(e,"paginationModelChange",g),i.useEffect(()=>{t.paginationMode==="client"?e.current.setRowCount(r):t.rowCount!=null&&e.current.setRowCount(t.rowCount)},[e,t.paginationMode,r,t.rowCount]);const m=l.hasNextPage===!1;i.useEffect(()=>{m&&o===-1&&e.current.setRowCount(s.pageSize*s.page+r)},[e,r,m,o,s])},cw=(e,t)=>{var c,u;const n=Ue(e,"useGridPaginationMeta"),r=U(e,xn);e.current.registerControlState({stateId:"paginationMeta",propModel:t.paginationMeta,propOnChange:t.onPaginationMetaChange,stateSelector:xn,changeEvent:"paginationMetaChange"});const l={setPaginationMeta:i.useCallback(d=>{r!==d&&(n.debug("Setting 'paginationMeta' to",d),e.current.setState(f=>h({},f,{pagination:h({},f.pagination,{meta:d})})))},[e,n,r])};ce(e,l,"public");const s=i.useCallback((d,f)=>{var C,b;const g=xn(e);return!f.exportOnlyDirtyModels||t.paginationMeta!=null||((b=(C=t.initialState)==null?void 0:C.pagination)==null?void 0:b.meta)!=null?h({},d,{pagination:h({},d.pagination,{meta:g})}):d},[e,t.paginationMeta,(u=(c=t.initialState)==null?void 0:c.pagination)==null?void 0:u.meta]),a=i.useCallback((d,f)=>{var m;const g=(m=f.stateToRestore.pagination)!=null&&m.meta?f.stateToRestore.pagination.meta:xn(e);return e.current.setState(C=>h({},C,{pagination:h({},C.pagination,{meta:g})})),d},[e]);$e(e,"exportState",s),$e(e,"restoreState",a),i.useEffect(()=>{t.paginationMeta&&e.current.setPaginationMeta(t.paginationMeta)},[e,t.paginationMeta])},uw=(e,t)=>{var l,s,a,c,u,d;const n=h({},Oa(t.autoPageSize),t.paginationModel??((s=(l=t.initialState)==null?void 0:l.pagination)==null?void 0:s.paginationModel));Ha(n.pageSize,t.signature);const r=t.rowCount??((c=(a=t.initialState)==null?void 0:a.pagination)==null?void 0:c.rowCount),o=t.paginationMeta??((d=(u=t.initialState)==null?void 0:u.pagination)==null?void 0:d.meta)??{};return h({},e,{pagination:{paginationModel:n,rowCount:r,meta:o}})},dw=(e,t)=>{cw(e,t),Xb(e,t),aw(e,t)},fw=(e,t)=>{var n;return h({},e,{preferencePanel:((n=t.initialState)==null?void 0:n.preferencePanel)??{open:!1}})},gw=(e,t)=>{var f;const n=Ue(e,"useGridPreferencesPanel"),r=i.useRef(),o=i.useRef(),l=i.useCallback(()=>{n.debug("Hiding Preferences Panel");const g=Wt(e.current.state);g.openedPanelValue&&e.current.publishEvent("preferencePanelClose",{openedPanelValue:g.openedPanelValue}),e.current.setState(m=>h({},m,{preferencePanel:{open:!1}})),e.current.forceUpdate()},[e,n]),s=i.useCallback(()=>{o.current=setTimeout(()=>clearTimeout(r.current),0)},[]),a=i.useCallback(()=>{r.current=setTimeout(l,100)},[l]),c=i.useCallback((g,m,C)=>{n.debug("Opening Preferences Panel"),s(),e.current.setState(b=>h({},b,{preferencePanel:h({},b.preferencePanel,{open:!0,openedPanelValue:g,panelId:m,labelId:C})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:g}),e.current.forceUpdate()},[n,s,e]);ce(e,{showPreferences:c,hidePreferences:a},"public");const u=i.useCallback((g,m)=>{var p;const C=Wt(e.current.state);return!m.exportOnlyDirtyModels||((p=t.initialState)==null?void 0:p.preferencePanel)!=null||C.open?h({},g,{preferencePanel:C}):g},[e,(f=t.initialState)==null?void 0:f.preferencePanel]),d=i.useCallback((g,m)=>{const C=m.stateToRestore.preferencePanel;return C!=null&&e.current.setState(b=>h({},b,{preferencePanel:C})),g},[e]);$e(e,"exportState",u),$e(e,"restoreState",d),i.useEffect(()=>()=>{clearTimeout(r.current),clearTimeout(o.current)},[])},Vu=e=>{switch(e.type){case"boolean":return!1;case"date":case"dateTime":case"number":return;case"singleSelect":return null;case"string":default:return""}},mw=["id","field"],hw=["id","field"],pw=(e,t)=>{const[n,r]=i.useState({}),o=i.useRef(n),l=i.useRef({}),{processRowUpdate:s,onProcessRowUpdateError:a,cellModesModel:c,onCellModesModelChange:u}=t,d=I=>(...M)=>{t.editMode===vt.Cell&&I(...M)},f=i.useCallback((I,M)=>{const w=e.current.getCellParams(I,M);if(!e.current.isCellEditable(w))throw new Error(`MUI X: The cell with id=${I} and field=${M} is not editable.`)},[e]),g=i.useCallback((I,M,w)=>{if(e.current.getCellMode(I,M)!==w)throw new Error(`MUI X: The cell with id=${I} and field=${M} is not in ${w} mode.`)},[e]),m=i.useCallback((I,M)=>{if(!I.isEditable||I.cellMode===xe.Edit)return;const w=h({},I,{reason:Ft.cellDoubleClick});e.current.publishEvent("cellEditStart",w,M)},[e]),C=i.useCallback((I,M)=>{if(I.cellMode===xe.View||e.current.getCellMode(I.id,I.field)===xe.View)return;const w=h({},I,{reason:mt.cellFocusOut});e.current.publishEvent("cellEditStop",w,M)},[e]),b=i.useCallback((I,M)=>{if(I.cellMode===xe.Edit){if(M.which===229)return;let w;if(M.key==="Escape"?w=mt.escapeKeyDown:M.key==="Enter"?w=mt.enterKeyDown:M.key==="Tab"&&(w=M.shiftKey?mt.shiftTabKeyDown:mt.tabKeyDown,M.preventDefault()),w){const j=h({},I,{reason:w});e.current.publishEvent("cellEditStop",j,M)}}else if(I.isEditable){let w;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:M,cellParams:I,editMode:"cell"}))return;if(ou(M)?w=Ft.printableKeyDown:ru(M)?w=Ft.pasteKeyDown:M.key==="Enter"?w=Ft.enterKeyDown:(M.key==="Backspace"||M.key==="Delete")&&(w=Ft.deleteKeyDown),w){const T=h({},I,{reason:w,key:M.key});e.current.publishEvent("cellEditStart",T,M)}}},[e]),p=i.useCallback(I=>{const{id:M,field:w,reason:j}=I,T={id:M,field:w};(j===Ft.printableKeyDown||j===Ft.deleteKeyDown||j===Ft.pasteKeyDown)&&(T.deleteValue=!0),e.current.startCellEditMode(T)},[e]),S=i.useCallback(I=>{const{id:M,field:w,reason:j}=I;e.current.runPendingEditCellValueMutation(M,w);let T;j===mt.enterKeyDown?T="below":j===mt.tabKeyDown?T="right":j===mt.shiftTabKeyDown&&(T="left");const R=j==="escapeKeyDown";e.current.stopCellEditMode({id:M,field:w,ignoreModifications:R,cellToFocusAfter:T})},[e]),x=I=>async(...M)=>{var w;if(I){const{id:j,field:T}=M[0];((w=e.current.state.editRows[j][T])==null?void 0:w.error)||I(...M)}};ee(e,"cellDoubleClick",d(m)),ee(e,"cellFocusOut",d(C)),ee(e,"cellKeyDown",d(b)),ee(e,"cellEditStart",d(p)),ee(e,"cellEditStop",d(S)),De(e,"cellEditStart",t.onCellEditStart),De(e,"cellEditStop",x(t.onCellEditStop));const D=i.useCallback((I,M)=>{const w=Xe(e.current.state);return w[I]&&w[I][M]?xe.Edit:xe.View},[e]),E=Re(I=>{const M=I!==t.cellModesModel;u&&M&&u(I,{api:e.current}),!(t.cellModesModel&&M)&&(r(I),o.current=I,e.current.publishEvent("cellModesModelChange",I))}),H=i.useCallback((I,M,w)=>{const j=h({},o.current);if(w!==null)j[I]=h({},j[I],{[M]:h({},w)});else{const T=j[I],R=ne(T,[M].map(Kn));j[I]=R,Object.keys(j[I]).length===0&&delete j[I]}E(j)},[E]),G=i.useCallback((I,M,w)=>{e.current.setState(j=>{const T=h({},j.editRows);return w!==null?T[I]=h({},T[I],{[M]:h({},w)}):(delete T[I][M],Object.keys(T[I]).length===0&&delete T[I]),h({},j,{editRows:T})}),e.current.forceUpdate()},[e]),A=i.useCallback(I=>{const{id:M,field:w}=I,j=ne(I,mw);f(M,w),g(M,w,xe.View),H(M,w,h({mode:xe.Edit},j))},[f,g,H]),F=Re(I=>{const{id:M,field:w,deleteValue:j,initialValue:T}=I;let R=e.current.getCellValue(M,w);j?R=Vu(e.current.getColumn(w)):T&&(R=T),G(M,w,{value:R,error:!1,isProcessingProps:!1}),e.current.setCellFocus(M,w)}),y=i.useCallback(I=>{const{id:M,field:w}=I,j=ne(I,hw);g(M,w,xe.Edit),H(M,w,h({mode:xe.View},j))},[g,H]),_=Re(async I=>{const{id:M,field:w,ignoreModifications:j,cellToFocusAfter:T="none"}=I;g(M,w,xe.Edit),e.current.runPendingEditCellValueMutation(M,w);const R=()=>{G(M,w,null),H(M,w,null),T!=="none"&&e.current.moveFocusToRelativeCell(M,w,T)};if(j){R();return}const z=Xe(e.current.state),{error:N,isProcessingProps:B}=z[M][w];if(N||B){l.current[M][w].mode=xe.Edit,H(M,w,{mode:xe.Edit});return}const W=e.current.getRowWithUpdatedValuesFromCellEditing(M,w);if(s){const X=q=>{l.current[M][w].mode=xe.Edit,H(M,w,{mode:xe.Edit}),a&&a(q)};try{const q=e.current.getRow(M);Promise.resolve(s(W,q)).then(te=>{e.current.updateRows([te]),R()}).catch(X)}catch(q){X(q)}}else e.current.updateRows([W]),R()}),$=i.useCallback(async I=>{var q,te;const{id:M,field:w,value:j,debounceMs:T,unstable_skipValueParser:R}=I;f(M,w),g(M,w,xe.Edit);const z=e.current.getColumn(w),N=e.current.getRow(M);let B=j;z.valueParser&&!R&&(B=z.valueParser(j,N,z,e));let W=Xe(e.current.state),X=h({},W[M][w],{value:B,changeReason:T?"debouncedSetEditCellValue":"setEditCellValue"});if(z.preProcessEditCellProps){const K=j!==W[M][w].value;X=h({},X,{isProcessingProps:!0}),G(M,w,X),X=await Promise.resolve(z.preProcessEditCellProps({id:M,row:N,props:X,hasChanged:K}))}return e.current.getCellMode(M,w)===xe.View?!1:(W=Xe(e.current.state),X=h({},X,{isProcessingProps:!1}),X.value=z.preProcessEditCellProps?W[M][w].value:B,G(M,w,X),W=Xe(e.current.state),!((te=(q=W[M])==null?void 0:q[w])!=null&&te.error))},[e,f,g,G]),O=i.useCallback((I,M)=>{const w=e.current.getColumn(M),j=Xe(e.current.state),T=e.current.getRow(I);if(!j[I]||!j[I][M])return e.current.getRow(I);const{value:R}=j[I][M];return w.valueSetter?w.valueSetter(R,T,w,e):h({},T,{[M]:R})},[e]),P={getCellMode:D,startCellEditMode:A,stopCellEditMode:y},L={setCellEditingEditCellValue:$,getRowWithUpdatedValuesFromCellEditing:O};ce(e,P,"public"),ce(e,L,"private"),i.useEffect(()=>{c&&E(c)},[c,E]),Ye(()=>{const I=Bn(e),M=l.current;l.current=Yi(n),Object.entries(n).forEach(([w,j])=>{Object.entries(j).forEach(([T,R])=>{var B,W;const z=((W=(B=M[w])==null?void 0:B[T])==null?void 0:W.mode)||xe.View,N=I[w]??w;R.mode===xe.Edit&&z===xe.View?F(h({id:N,field:T},R)):R.mode===xe.View&&z===xe.Edit&&_(h({id:N,field:T},R))})})},[e,n,F,_])},Cw=["id"],bw=["id"],ww=(e,t)=>{const[n,r]=i.useState({}),o=i.useRef(n),l=i.useRef({}),s=i.useRef(),a=i.useRef(null),{processRowUpdate:c,onProcessRowUpdateError:u,rowModesModel:d,onRowModesModelChange:f}=t,g=T=>(...R)=>{t.editMode===vt.Row&&T(...R)},m=i.useCallback((T,R)=>{const z=e.current.getCellParams(T,R);if(!e.current.isCellEditable(z))throw new Error(`MUI X: The cell with id=${T} and field=${R} is not editable.`)},[e]),C=i.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=i.useCallback(T=>{const R=Xe(e.current.state);return Object.values(R[T]).some(z=>z.error)},[e]),p=i.useCallback((T,R)=>{if(!T.isEditable||e.current.getRowMode(T.id)===ke.Edit)return;const z=e.current.getRowParams(T.id),N=h({},z,{field:T.field,reason:Ot.cellDoubleClick});e.current.publishEvent("rowEditStart",N,R)},[e]),S=i.useCallback(T=>{a.current=T},[]),x=i.useCallback((T,R)=>{T.isEditable&&e.current.getRowMode(T.id)!==ke.View&&(a.current=null,s.current=setTimeout(()=>{var z;if(((z=a.current)==null?void 0:z.id)!==T.id){if(!e.current.getRow(T.id)||e.current.getRowMode(T.id)===ke.View||b(T.id))return;const N=e.current.getRowParams(T.id),B=h({},N,{field:T.field,reason:St.rowFocusOut});e.current.publishEvent("rowEditStop",B,R)}}))},[e,b]);i.useEffect(()=>()=>{clearTimeout(s.current)},[]);const D=i.useCallback((T,R)=>{if(T.cellMode===ke.Edit){if(R.which===229)return;let z;if(R.key==="Escape")z=St.escapeKeyDown;else if(R.key==="Enter")z=St.enterKeyDown;else if(R.key==="Tab"){const N=sn(e).filter(B=>e.current.getColumn(B).type===Jn?!0:e.current.isCellEditable(e.current.getCellParams(T.id,B)));if(R.shiftKey?T.field===N[0]&&(z=St.shiftTabKeyDown):T.field===N[N.length-1]&&(z=St.tabKeyDown),R.preventDefault(),!z){const B=N.findIndex(X=>X===T.field),W=N[R.shiftKey?B-1:B+1];e.current.setCellFocus(T.id,W)}}if(z){if(z!==St.escapeKeyDown&&b(T.id))return;const N=h({},e.current.getRowParams(T.id),{reason:z,field:T.field});e.current.publishEvent("rowEditStop",N,R)}}else if(T.isEditable){let z;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:R,cellParams:T,editMode:"row"}))return;if(ou(R)||ru(R)?z=Ot.printableKeyDown:R.key==="Enter"?z=Ot.enterKeyDown:(R.key==="Backspace"||R.key==="Delete")&&(z=Ot.deleteKeyDown),z){const B=e.current.getRowParams(T.id),W=h({},B,{field:T.field,reason:z});e.current.publishEvent("rowEditStart",W,R)}}},[e,b]),E=i.useCallback(T=>{const{id:R,field:z,reason:N}=T,B={id:R,fieldToFocus:z};(N===Ot.printableKeyDown||N===Ot.deleteKeyDown)&&(B.deleteValue=!!z),e.current.startRowEditMode(B)},[e]),H=i.useCallback(T=>{const{id:R,reason:z,field:N}=T;e.current.runPendingEditCellValueMutation(R);let B;z===St.enterKeyDown?B="below":z===St.tabKeyDown?B="right":z===St.shiftTabKeyDown&&(B="left");const W=z==="escapeKeyDown";e.current.stopRowEditMode({id:R,ignoreModifications:W,field:N,cellToFocusAfter:B})},[e]);ee(e,"cellDoubleClick",g(p)),ee(e,"cellFocusIn",g(S)),ee(e,"cellFocusOut",g(x)),ee(e,"cellKeyDown",g(D)),ee(e,"rowEditStart",g(E)),ee(e,"rowEditStop",g(H)),De(e,"rowEditStart",t.onRowEditStart),De(e,"rowEditStop",t.onRowEditStop);const G=i.useCallback(T=>{if(t.editMode===vt.Cell)return ke.View;const R=Xe(e.current.state);return R[T]&&Object.keys(R[T]).length>0?ke.Edit:ke.View},[e,t.editMode]),A=Re(T=>{const R=T!==t.rowModesModel;f&&R&&f(T,{api:e.current}),!(t.rowModesModel&&R)&&(r(T),o.current=T,e.current.publishEvent("rowModesModelChange",T))}),F=i.useCallback((T,R)=>{const z=h({},o.current);R!==null?z[T]=h({},R):delete z[T],A(z)},[A]),y=i.useCallback((T,R)=>{e.current.setState(z=>{const N=h({},z.editRows);return R!==null?N[T]=R:delete N[T],h({},z,{editRows:N})}),e.current.forceUpdate()},[e]),_=i.useCallback((T,R,z)=>{e.current.setState(N=>{const B=h({},N.editRows);return z!==null?B[T]=h({},B[T],{[R]:h({},z)}):(delete B[T][R],Object.keys(B[T]).length===0&&delete B[T]),h({},N,{editRows:B})}),e.current.forceUpdate()},[e]),$=i.useCallback(T=>{const{id:R}=T,z=ne(T,Cw);C(R,ke.View),F(R,h({mode:ke.Edit},z))},[C,F]),O=Re(T=>{const{id:R,fieldToFocus:z,deleteValue:N,initialValue:B}=T,X=kt(e).reduce((q,te)=>{if(!e.current.getCellParams(R,te).isEditable)return q;let Q=e.current.getCellValue(R,te);return z===te&&(N||B)&&(N?Q=Vu(e.current.getColumn(te)):B&&(Q=B)),q[te]={value:Q,error:!1,isProcessingProps:!1},q},{});y(R,X),z&&e.current.setCellFocus(R,z)}),P=i.useCallback(T=>{const{id:R}=T,z=ne(T,bw);C(R,ke.Edit),F(R,h({mode:ke.View},z))},[C,F]),L=Re(T=>{const{id:R,ignoreModifications:z,field:N,cellToFocusAfter:B="none"}=T;e.current.runPendingEditCellValueMutation(R);const W=()=>{B!=="none"&&N&&e.current.moveFocusToRelativeCell(R,N,B),y(R,null),F(R,null)};if(z){W();return}const X=Xe(e.current.state),q=e.current.getRow(R);if(Object.values(X[R]).some(Q=>Q.isProcessingProps)){l.current[R].mode=ke.Edit;return}if(b(R)){l.current[R].mode=ke.Edit,F(R,{mode:ke.Edit});return}const K=e.current.getRowWithUpdatedValuesFromRowEditing(R);if(c){const Q=J=>{l.current[R].mode=ke.Edit,F(R,{mode:ke.Edit}),u&&u(J)};try{Promise.resolve(c(K,q)).then(J=>{e.current.updateRows([J]),W()}).catch(Q)}catch(J){Q(J)}}else e.current.updateRows([K]),W()}),I=i.useCallback(T=>{const{id:R,field:z,value:N,debounceMs:B,unstable_skipValueParser:W}=T;m(R,z);const X=e.current.getColumn(z),q=e.current.getRow(R);let te=N;X.valueParser&&!W&&(te=X.valueParser(N,q,X,e));let K=Xe(e.current.state),Q=h({},K[R][z],{value:te,changeReason:B?"debouncedSetEditCellValue":"setEditCellValue"});return X.preProcessEditCellProps||_(R,z,Q),new Promise(J=>{const se=[];if(X.preProcessEditCellProps){const oe=Q.value!==K[R][z].value;Q=h({},Q,{isProcessingProps:!0}),_(R,z,Q);const ae=K[R],Le=ne(ae,[z].map(Kn)),Oe=Promise.resolve(X.preProcessEditCellProps({id:R,row:q,props:Q,hasChanged:oe,otherFieldsProps:Le})).then(He=>{if(e.current.getRowMode(R)===ke.View){J(!1);return}K=Xe(e.current.state),He=h({},He,{isProcessingProps:!1}),He.value=X.preProcessEditCellProps?K[R][z].value:te,_(R,z,He)});se.push(Oe)}Object.entries(K[R]).forEach(([oe,ae])=>{if(oe===z)return;const Le=e.current.getColumn(oe);if(!Le.preProcessEditCellProps)return;ae=h({},ae,{isProcessingProps:!0}),_(R,oe,ae),K=Xe(e.current.state);const Oe=K[R],He=ne(Oe,[oe].map(Kn)),ve=Promise.resolve(Le.preProcessEditCellProps({id:R,row:q,props:ae,hasChanged:!1,otherFieldsProps:He})).then(Ge=>{if(e.current.getRowMode(R)===ke.View){J(!1);return}Ge=h({},Ge,{isProcessingProps:!1}),_(R,oe,Ge)});se.push(ve)}),Promise.all(se).then(()=>{e.current.getRowMode(R)===ke.Edit?(K=Xe(e.current.state),J(!K[R][z].error)):J(!1)})})},[e,m,_]),M=i.useCallback(T=>{const R=Xe(e.current.state),z=e.current.getRow(T);if(!R[T])return e.current.getRow(T);let N=h({},z);return Object.entries(R[T]).forEach(([B,W])=>{const X=e.current.getColumn(B);X.valueSetter?N=X.valueSetter(W.value,N,X,e):N[B]=W.value}),N},[e]),w={getRowMode:G,startRowEditMode:$,stopRowEditMode:P},j={setRowEditingEditCellValue:I,getRowWithUpdatedValuesFromRowEditing:M};ce(e,w,"public"),ce(e,j,"private"),i.useEffect(()=>{d&&A(d)},[d,A]),Ye(()=>{const T=Bn(e),R=l.current;l.current=Yi(n);const z=new Set([...Object.keys(n),...Object.keys(R)]);Array.from(z).forEach(N=>{var q;const B=n[N]??{mode:ke.View},W=((q=R[N])==null?void 0:q.mode)||ke.View,X=T[N]??N;B.mode===ke.Edit&&W===ke.View?O(h({id:X},B)):B.mode===ke.View&&W===ke.Edit&&L(h({id:X},B))})},[e,n,O,L])},Sw=e=>h({},e,{editRows:{}}),yw=(e,t)=>{pw(e,t),ww(e,t);const n=i.useRef({}),{isCellEditable:r}=t,o=i.useCallback(g=>Mn(g.rowNode)||!g.colDef.editable||!g.colDef.renderEditCell?!1:r?r(g):!0,[r]),l=(g,m,C,b)=>{if(!C){b();return}if(n.current[g]||(n.current[g]={}),n.current[g][m]){const[x]=n.current[g][m];clearTimeout(x)}const p=()=>{const[x]=n.current[g][m];clearTimeout(x),b(),delete n.current[g][m]},S=setTimeout(()=>{b(),delete n.current[g][m]},C);n.current[g][m]=[S,p]};i.useEffect(()=>{const g=n.current;return()=>{Object.entries(g).forEach(([m,C])=>{Object.keys(C).forEach(b=>{const[p]=g[m][b];clearTimeout(p),delete g[m][b]})})}},[]);const s=i.useCallback((g,m)=>{if(n.current[g]){if(!m)Object.keys(n.current[g]).forEach(C=>{const[,b]=n.current[g][C];b()});else if(n.current[g][m]){const[,C]=n.current[g][m];C()}}},[]),a=i.useCallback(g=>{const{id:m,field:C,debounceMs:b}=g;return new Promise(p=>{l(m,C,b,async()=>{const S=t.editMode===vt.Row?e.current.setRowEditingEditCellValue:e.current.setCellEditingEditCellValue;if(e.current.getCellMode(m,C)===xe.Edit){const x=await S(g);p(x)}})})},[e,t.editMode]),c=i.useCallback((g,m)=>t.editMode===vt.Cell?e.current.getRowWithUpdatedValuesFromCellEditing(g,m):e.current.getRowWithUpdatedValuesFromRowEditing(g),[e,t.editMode]),u=i.useCallback((g,m)=>{var b;return((b=Xe(e.current.state)[g])==null?void 0:b[m])??null},[e]),d={isCellEditable:o,setEditCellValue:a,getRowWithUpdatedValues:c,unstable_getEditCellMeta:u},f={runPendingEditCellValueMutation:s};ce(e,d,"public"),ce(e,f,"private")},xw=(e,t,n)=>{const r=!!t.unstable_dataSource;return n.current.caches.rows=Oo({rows:r?[]:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),h({},e,{rows:ua({apiRef:n,rowCountProp:t.rowCount,loadingProp:r?!0:t.loading,previousTree:null,previousTreeDepths:null})})},vw=(e,t)=>{const n=Ue(e,"useGridRows"),r=Qt(e,t),o=i.useRef(Date.now()),l=i.useRef(t.rowCount),s=Dn(),a=i.useCallback(w=>{const j=_t(e)[w];if(j)return j;const T=e.current.getRowNode(w);return T&&Mn(T)?{[en]:w}:null},[e]),c=t.getRowId,u=i.useCallback(w=>en in w?w[en]:c?c(w):w.id,[c]),d=i.useMemo(()=>r.rows.reduce((w,{id:j},T)=>(w[j]=T,w),{}),[r.rows]),f=i.useCallback(({cache:w,throttle:j})=>{const T=()=>{o.current=Date.now(),e.current.setState(z=>h({},z,{rows:ua({apiRef:e,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:rt(e),previousTreeDepths:Dr(e),previousGroupsToFetch:qg(e)})})),e.current.publishEvent("rowsSet"),e.current.forceUpdate()};if(s.clear(),e.current.caches.rows=w,!j){T();return}const R=t.throttleRowsMs-(Date.now()-o.current);if(R>0){s.start(R,T);return}T()},[t.throttleRowsMs,t.rowCount,t.loading,e,s]),g=i.useCallback(w=>{n.debug(`Updating all rows, new length ${w.length}`);const j=Oo({rows:w,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),T=e.current.caches.rows;j.rowsBeforePartialUpdates=T.rowsBeforePartialUpdates,f({cache:j,throttle:!0})},[n,t.getRowId,t.loading,t.rowCount,f,e]),m=i.useCallback(w=>{if(t.signature===ht.DataGrid&&w.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(` +`));const j=ks(e,w,t.getRowId),T=Fs({updates:j,getRowId:t.getRowId,previousCache:e.current.caches.rows});f({cache:T,throttle:!0})},[t.signature,t.getRowId,f,e]),C=i.useCallback((w,j)=>{const T=ks(e,w,t.getRowId),R=Fs({updates:T,getRowId:t.getRowId,previousCache:e.current.caches.rows,groupKeys:j??[]});f({cache:R,throttle:!1})},[t.getRowId,f,e]),b=i.useCallback(w=>{w!==t.loading&&(n.debug(`Setting loading to ${w}`),e.current.setState(j=>h({},j,{rows:h({},j.rows,{loading:w})})),e.current.caches.rows.loadingPropBeforePartialUpdates=w)},[t.loading,e,n]),p=i.useCallback(()=>{const w=An(e),j=_t(e);return new Map(w.map(T=>[T,j[T]??{}]))},[e]),S=i.useCallback(()=>Zn(e),[e]),x=i.useCallback(()=>An(e),[e]),D=i.useCallback(w=>d[w],[d]),E=i.useCallback((w,j)=>{const T=e.current.getRowNode(w);if(!T)throw new Error(`MUI X: No row with id #${w} found.`);if(T.type!=="group")throw new Error("MUI X: Only group nodes can be expanded or collapsed.");const R=h({},T,{childrenExpanded:j});e.current.setState(z=>h({},z,{rows:h({},z.rows,{tree:h({},z.rows.tree,{[w]:R})})})),e.current.forceUpdate(),e.current.publishEvent("rowExpansionChange",R)},[e]),H=i.useCallback(w=>rt(e)[w]??null,[e]),G=i.useCallback(({skipAutoGeneratedRows:w=!0,groupId:j,applySorting:T,applyFiltering:R})=>{const z=rt(e);let N;if(T){const B=z[j];if(!B)return[];const W=tr(e);N=[];const X=W.findIndex(q=>q===j)+1;for(let q=X;qB.depth;q+=1){const te=W[q];(!w||!Mn(z[te]))&&N.push(te)}}else N=dl(z,j,w);if(R){const B=hl(e);N=N.filter(W=>B[W]!==!1)}return N},[e]),A=i.useCallback((w,j)=>{const T=e.current.getRowNode(w);if(!T)throw new Error(`MUI X: No row with id #${w} found.`);if(T.parent!==et)throw new Error("MUI X: The row reordering do not support reordering of grouped rows yet.");if(T.type!=="leaf")throw new Error("MUI X: The row reordering do not support reordering of footer or grouping rows.");e.current.setState(R=>{const z=rt(R,e.current.instanceId)[et],N=z.children,B=N.findIndex(X=>X===w);if(B===-1||B===j)return R;n.debug(`Moving row ${w} to index ${j}`);const W=[...N];return W.splice(j,0,W.splice(B,1)[0]),h({},R,{rows:h({},R.rows,{tree:h({},R.rows.tree,{[et]:h({},z,{children:W})})})})}),e.current.publishEvent("rowsSet")},[e,n]),F=i.useCallback((w,j)=>{if(t.signature===ht.DataGrid&&j.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(` +`));if(j.length===0)return;if(eo(e)>1)throw new Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");const R=h({},rt(e)),z=h({},_t(e)),N=h({},Bn(e)),B=R[et],W=[...B.children],X=new Set;for(let te=0;te{var K;return((K=R[te])==null?void 0:K.type)==="leaf"});e.current.caches.rows.dataRowIdToModelLookup=z,e.current.caches.rows.dataRowIdToIdLookup=N,e.current.setState(te=>h({},te,{rows:h({},te.rows,{dataRowIdToModelLookup:z,dataRowIdToIdLookup:N,dataRowIds:q,tree:R})})),e.current.publishEvent("rowsSet")},[e,t.signature,t.getRowId]),y={getRow:a,setLoading:b,getRowId:u,getRowModels:p,getRowsCount:S,getAllRowIds:x,setRows:g,updateRows:m,getRowNode:H,getRowIndexRelativeToVisibleRows:D,unstable_replaceRows:F},_={setRowIndex:A,setRowChildrenExpansion:E,getRowGroupChildren:G},$={updateServerRows:C},O=i.useCallback(()=>{n.info("Row grouping pre-processing have changed, regenerating the row tree");let w;e.current.caches.rows.rowsBeforePartialUpdates===t.rows?w=h({},e.current.caches.rows,{updates:{type:"full",rows:An(e)}}):w=Oo({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),f({cache:w,throttle:!1})},[n,e,t.rows,t.getRowId,t.loading,t.rowCount,f]),P=i.useCallback(w=>{w==="rowTreeCreation"&&O()},[O]),L=i.useCallback(()=>{e.current.getActiveStrategy("rowTree")!==ia(e)&&O()},[e,O]);ee(e,"activeStrategyProcessorChange",P),ee(e,"strategyAvailabilityChange",L);const I=i.useCallback(()=>{e.current.setState(w=>{const j=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:rt(w,e.current.instanceId),treeDepths:Dr(w,e.current.instanceId),dataRowIds:An(w,e.current.instanceId),dataRowIdToModelLookup:_t(w,e.current.instanceId),dataRowIdToIdLookup:Bn(w,e.current.instanceId)});return h({},w,{rows:h({},w.rows,j,{totalTopLevelRowCount:ca({tree:j.tree,rowCountProp:t.rowCount})})})}),e.current.publishEvent("rowsSet"),e.current.forceUpdate()},[e,t.rowCount]);Rl(e,"hydrateRows",I),ce(e,y,"public"),ce(e,_,t.signature===ht.DataGrid?"private":"public"),ce(e,$,"private");const M=i.useRef(!0);i.useEffect(()=>{var z;if(M.current){M.current=!1;return}let w=!1;t.rowCount!==l.current&&(w=!0,l.current=t.rowCount);const j=e.current.caches.rows.rowsBeforePartialUpdates===t.rows,T=e.current.caches.rows.loadingPropBeforePartialUpdates===t.loading,R=e.current.caches.rows.rowCountPropBeforePartialUpdates===t.rowCount;j&&(T||(e.current.setState(N=>h({},N,{rows:h({},N.rows,{loading:t.loading})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t.loading,e.current.forceUpdate()),R||(e.current.setState(N=>h({},N,{rows:h({},N.rows,{totalRowCount:Math.max(t.rowCount||0,N.rows.totalRowCount),totalTopLevelRowCount:Math.max(t.rowCount||0,N.rows.totalTopLevelRowCount)})})),e.current.caches.rows.rowCountPropBeforePartialUpdates=t.rowCount,e.current.forceUpdate()),!w)||(n.debug(`Updating all rows, new length ${(z=t.rows)==null?void 0:z.length}`),f({cache:Oo({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),throttle:!1}))},[t.rows,t.rowCount,t.getRowId,t.loading,n,f,e])},Iw=e=>{const t={[et]:h({},Yg(),{children:e})};for(let n=0;n{const n=h({},e),r={};for(let s=0;s!r[s])),n[et]=h({},o,{children:l}),{groupingName:on,tree:n,treeDepths:{0:l.length},dataRowIds:l}},Pw=e=>e.updates.type==="full"?Iw(e.updates.rows):Mw({previousTree:e.previousTree,actions:e.updates.actions}),Ew=e=>{Vo(e,on,"rowTreeCreation",Pw)},Nu=(e,t)=>e==null||Array.isArray(e)?e:t&&t[0]===e?t:[e],Fw=(e,t)=>h({},e,{rowSelection:t.rowSelection?Nu(t.rowSelectionModel)??[]:[]}),kw=(e,t)=>{const n=Ue(e,"useGridSelection"),r=P=>(...L)=>{t.rowSelection&&P(...L)},o=i.useMemo(()=>Nu(t.rowSelectionModel,it(e.current.state)),[e,t.rowSelectionModel]),l=i.useRef(null);e.current.registerControlState({stateId:"rowSelection",propModel:o,propOnChange:t.onRowSelectionModelChange,stateSelector:it,changeEvent:"rowSelectionChange"});const{checkboxSelection:s,disableRowSelectionOnClick:a,isRowSelectable:c}=t,u=gl(t),d=Qt(e,t),f=i.useCallback(P=>{let L=P;const I=l.current??P,M=e.current.isRowSelected(P);if(M){const w=tn(e),j=w.findIndex(R=>R===I),T=w.findIndex(R=>R===L);if(j===T)return;j>T?L=w[T+1]:L=w[T-1]}l.current=P,e.current.selectRowRange({startId:I,endId:L},!M)},[e]),g=i.useCallback(P=>{if(t.signature===ht.DataGrid&&!u&&Array.isArray(P)&&P.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(` +`));it(e.current.state)!==P&&(n.debug("Setting selection model"),e.current.setState(I=>h({},I,{rowSelection:t.rowSelection?P:[]})),e.current.forceUpdate())},[e,n,t.rowSelection,t.signature,u]),m=i.useCallback(P=>it(e.current.state).includes(P),[e]),C=i.useCallback(P=>{if(t.rowSelection===!1||c&&!c(e.current.getRowParams(P)))return!1;const L=e.current.getRowNode(P);return!((L==null?void 0:L.type)==="footer"||(L==null?void 0:L.type)==="pinnedRow")},[e,t.rowSelection,c]),b=i.useCallback(()=>va(e),[e]),p=i.useCallback((P,L=!0,I=!1)=>{if(e.current.isRowSelectable(P))if(l.current=P,I)n.debug(`Setting selection for row ${P}`),e.current.setRowSelectionModel(L?[P]:[]);else{n.debug(`Toggling selection for row ${P}`);const w=it(e.current.state).filter(T=>T!==P);L&&w.push(P),(w.length<2||u)&&e.current.setRowSelectionModel(w)}},[e,n,u]),S=i.useCallback((P,L=!0,I=!1)=>{n.debug("Setting selection for several rows");const M=P.filter(T=>e.current.isRowSelectable(T));let w;if(I)w=L?M:[];else{const T=h({},Pn(e));M.forEach(R=>{L?T[R]=R:delete T[R]}),w=Object.values(T)}(w.length<2||u)&&e.current.setRowSelectionModel(w)},[e,n,u]),x=i.useCallback(({startId:P,endId:L},I=!0,M=!1)=>{if(!e.current.getRow(P)||!e.current.getRow(L))return;n.debug(`Expanding selection from row ${P} to row ${L}`);const w=tn(e),j=w.indexOf(P),T=w.indexOf(L),[R,z]=j>T?[T,j]:[j,T],N=w.slice(R,z+1);e.current.selectRows(N,I,M)},[e,n]),D={selectRow:p,setRowSelectionModel:g,getSelectedRows:b,isRowSelected:m,isRowSelectable:C},E={selectRows:S,selectRowRange:x};ce(e,D,"public"),ce(e,E,t.signature===ht.DataGrid?"private":"public");const H=i.useCallback(()=>{if(t.keepNonExistentRowsSelected)return;const P=it(e.current.state),L=_t(e),I=h({},Pn(e));let M=!1;P.forEach(w=>{L[w]||(delete I[w],M=!0)}),M&&e.current.setRowSelectionModel(Object.values(I))},[e,t.keepNonExistentRowsSelected]),G=i.useCallback((P,L)=>{const I=L.metaKey||L.ctrlKey,M=!s&&!I&&!eC(L),w=!u||M,j=e.current.isRowSelected(P);w?e.current.selectRow(P,M?!0:!j,!0):e.current.selectRow(P,!j,!1)},[e,u,s]),A=i.useCallback((P,L)=>{var w;if(a)return;const I=(w=L.target.closest(`.${k.cell}`))==null?void 0:w.getAttribute("data-field");if(I===cn.field||I===Ll)return;if(I){const j=e.current.getColumn(I);if((j==null?void 0:j.type)===Jn)return}e.current.getRowNode(P.id).type!=="pinnedRow"&&(L.shiftKey&&u?f(P.id):G(P.id,L))},[a,u,e,f,G]),F=i.useCallback((P,L)=>{var I;u&&L.shiftKey&&((I=window.getSelection())==null||I.removeAllRanges())},[u]),y=i.useCallback((P,L)=>{u&&L.nativeEvent.shiftKey?f(P.id):e.current.selectRow(P.id,P.value,!u)},[e,f,u]),_=i.useCallback(P=>{const L=t.pagination&&t.checkboxSelectionVisibleOnly&&t.paginationMode==="client"?xl(e):tn(e),I=We(e);e.current.selectRows(L,P.value,(I==null?void 0:I.items.length)>0)},[e,t.checkboxSelectionVisibleOnly,t.pagination,t.paginationMode]),$=i.useCallback((P,L)=>{if(e.current.getCellMode(P.id,P.field)!==xe.Edit&&!io(L)){if(zo(L.key)&&L.shiftKey){const I=st(e);if(I&&I.id!==P.id){L.preventDefault();const M=e.current.isRowSelected(I.id);if(!u){e.current.selectRow(I.id,!M,!0);return}const w=e.current.getRowIndexRelativeToVisibleRows(I.id),j=e.current.getRowIndexRelativeToVisibleRows(P.id);let T,R;w>j?M?(T=j,R=w-1):(T=j,R=w):M?(T=w+1,R=j):(T=w,R=j);const z=d.rows.slice(T,R+1).map(N=>N.id);e.current.selectRows(z,!M);return}}if(L.key===" "&&L.shiftKey){L.preventDefault(),G(P.id,L);return}L.key==="a"&&(L.ctrlKey||L.metaKey)&&(L.preventDefault(),S(e.current.getAllRowIds(),!0))}},[e,G,S,d.rows,u]);ee(e,"sortedRowsSet",r(H)),ee(e,"rowClick",r(A)),ee(e,"rowSelectionCheckboxChange",r(y)),ee(e,"headerSelectionCheckboxChange",_),ee(e,"cellMouseDown",r(F)),ee(e,"cellKeyDown",r($)),i.useEffect(()=>{o!==void 0&&e.current.setRowSelectionModel(o)},[e,o,t.rowSelection]),i.useEffect(()=>{t.rowSelection||e.current.setRowSelectionModel([])},[e,t.rowSelection]);const O=o!=null;i.useEffect(()=>{if(O||!t.rowSelection)return;const P=it(e.current.state);if(C){const L=P.filter(I=>C(I));L.length{if(!t.rowSelection||O)return;const P=it(e.current.state);!u&&P.length>1&&e.current.setRowSelectionModel([])},[e,u,s,O,t.rowSelection])},Dw=e=>{const{classes:t}=e;return i.useMemo(()=>de({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},ue,t),[t])},Tw=(e,t)=>{const n={classes:t.classes},r=Dw(n),o=i.useCallback(l=>{const s=h({},cn,{cellClassName:r.cellCheckbox,headerClassName:r.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),a=t.checkboxSelection,c=l.lookup[Ht]!=null;return a&&!c?(l.lookup[Ht]=s,l.orderedFields=[Ht,...l.orderedFields]):!a&&c?(delete l.lookup[Ht],l.orderedFields=l.orderedFields.filter(u=>u!==Ht)):a&&c&&(l.lookup[Ht]=h({},s,l.lookup[Ht])),l},[e,r,t.checkboxSelection]);$e(e,"hydrateColumns",o)},Ow=(e,t)=>{var r,o;const n=t.sortModel??((o=(r=t.initialState)==null?void 0:r.sorting)==null?void 0:o.sortModel)??[];return h({},e,{sorting:{sortModel:qi(n,t.disableMultipleColumnsSorting),sortedRows:[]}})},Hw=(e,t)=>{var H,G;const n=Ue(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:at,changeEvent:"sortModelChange"});const r=i.useCallback((A,F)=>{const y=at(e),_=y.findIndex(O=>O.field===A);let $=[...y];return _>-1?(F==null?void 0:F.sort)==null?$.splice(_,1):$.splice(_,1,F):$=[...y,F],$},[e]),o=i.useCallback((A,F)=>{const _=at(e).find($=>$.field===A.field);if(_){const $=F===void 0?Ss(A.sortingOrder??t.sortingOrder,_.sort):F;return $===void 0?void 0:h({},_,{sort:$})}return{field:A.field,sort:F===void 0?Ss(A.sortingOrder??t.sortingOrder):F}},[e,t.sortingOrder]),l=i.useCallback((A,F)=>F==null||F.sortable===!1||t.disableColumnSorting?A:(F.sortingOrder||t.sortingOrder).some(_=>!!_)?[...A,"columnMenuSortItem"]:A,[t.sortingOrder,t.disableColumnSorting]),s=i.useCallback(()=>{e.current.setState(A=>{if(t.sortingMode==="server")return n.debug("Skipping sorting rows as sortingMode = server"),h({},A,{sorting:h({},A.sorting,{sortedRows:dl(rt(e),et,!1)})});const F=at(A,e.current.instanceId),y=Pg(F,e),_=e.current.applyStrategyProcessor("sorting",{sortRowList:y});return h({},A,{sorting:h({},A.sorting,{sortedRows:_})})}),e.current.publishEvent("sortedRowsSet"),e.current.forceUpdate()},[e,n,t.sortingMode]),a=i.useCallback(A=>{at(e)!==A&&(n.debug("Setting sort model"),e.current.setState(ws(A,t.disableMultipleColumnsSorting)),e.current.forceUpdate(),e.current.applySorting())},[e,n,t.disableMultipleColumnsSorting]),c=i.useCallback((A,F,y)=>{const _=e.current.getColumn(A),$=o(_,F);let O;!y||t.disableMultipleColumnsSorting?O=($==null?void 0:$.sort)==null?[]:[$]:O=r(_.field,$),e.current.setSortModel(O)},[e,r,o,t.disableMultipleColumnsSorting]),u=i.useCallback(()=>at(e),[e]),d=i.useCallback(()=>nr(e).map(F=>F.model),[e]),f=i.useCallback(()=>tr(e),[e]),g=i.useCallback(A=>e.current.getSortedRowIds()[A],[e]);ce(e,{getSortModel:u,getSortedRows:d,getSortedRowIds:f,getRowIdFromRowIndex:g,setSortModel:a,sortColumn:c,applySorting:s},"public");const C=i.useCallback((A,F)=>{var $,O;const y=at(e);return!F.exportOnlyDirtyModels||t.sortModel!=null||((O=($=t.initialState)==null?void 0:$.sorting)==null?void 0:O.sortModel)!=null||y.length>0?h({},A,{sorting:{sortModel:y}}):A},[e,t.sortModel,(G=(H=t.initialState)==null?void 0:H.sorting)==null?void 0:G.sortModel]),b=i.useCallback((A,F)=>{var _;const y=(_=F.stateToRestore.sorting)==null?void 0:_.sortModel;return y==null?A:(e.current.setState(ws(y,t.disableMultipleColumnsSorting)),h({},A,{callbacks:[...A.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),p=i.useCallback(A=>{const F=rt(e),y=F[et],_=A.sortRowList?A.sortRowList(y.children.map($=>F[$])):[...y.children];return y.footerId!=null&&_.push(y.footerId),_},[e]);$e(e,"exportState",C),$e(e,"restoreState",b),Vo(e,on,"sorting",p);const S=i.useCallback(({field:A,colDef:F},y)=>{if(!F.sortable||t.disableColumnSorting)return;const _=y.shiftKey||y.metaKey||y.ctrlKey;c(A,void 0,_)},[c,t.disableColumnSorting]),x=i.useCallback(({field:A,colDef:F},y)=>{!F.sortable||t.disableColumnSorting||y.key==="Enter"&&!y.ctrlKey&&!y.metaKey&&c(A,void 0,y.shiftKey)},[c,t.disableColumnSorting]),D=i.useCallback(()=>{const A=at(e),F=Pt(e);if(A.length>0){const y=A.filter(_=>F[_.field]);y.length{A==="sorting"&&e.current.applySorting()},[e]);$e(e,"columnMenu",l),ee(e,"columnHeaderClick",S),ee(e,"columnHeaderKeyDown",x),ee(e,"rowsSet",e.current.applySorting),ee(e,"columnsChange",D),ee(e,"activeStrategyProcessorChange",E),Hn(()=>{e.current.applySorting()}),Ye(()=>{t.sortModel!==void 0&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};function ei(e){const{clientHeight:t,scrollTop:n,offsetHeight:r,offsetTop:o}=e,l=o+r;if(r>t)return o;if(l-t>n)return l-t;if(o{const n=Kt(),r=Ue(e,"useGridScroll"),o=e.current.columnHeadersContainerRef,l=e.current.virtualScrollerRef,s=U(e,$t),a=i.useCallback(f=>{var S;const g=nt(e.current.state),m=Zn(e),C=Ne(e);if(!(f.rowIndex==null)&&m===0||C.length===0)return!1;r.debug(`Scrolling to cell at row ${f.rowIndex}, col: ${f.colIndex} `);let p={};if(f.colIndex!==void 0){const x=Rt(e);let D;if(typeof f.rowIndex<"u"){const E=(S=s[f.rowIndex])==null?void 0:S.id,H=e.current.unstable_getCellColSpanInfo(E,f.colIndex);H&&!H.spannedByColSpan&&(D=H.cellProps.width)}typeof D>"u"&&(D=C[f.colIndex].computedWidth),p.left=ei({clientHeight:g.viewportInnerSize.width,scrollTop:Math.abs(l.current.scrollLeft),offsetHeight:D,offsetTop:x[f.colIndex]})}if(f.rowIndex!==void 0){const x=un(e.current.state),D=_a(e),E=La(e),H=t.pagination?f.rowIndex-D*E:f.rowIndex,G=x.positions[H+1]?x.positions[H+1]-x.positions[H]:x.currentPageTotalHeight-x.positions[H];p.top=ei({clientHeight:g.viewportInnerSize.height,scrollTop:l.current.scrollTop,offsetHeight:G,offsetTop:x.positions[H]})}return p=e.current.unstable_applyPipeProcessors("scrollToIndexes",p,f),typeof p.left!==void 0||typeof p.top!==void 0?(e.current.scroll(p),!0):!1},[r,e,l,t.pagination,s]),c=i.useCallback(f=>{if(l.current&&f.left!==void 0&&o.current){const g=n?-1:1;o.current.scrollLeft=f.left,l.current.scrollLeft=g*f.left,r.debug(`Scrolling left: ${f.left}`)}l.current&&f.top!==void 0&&(l.current.scrollTop=f.top,r.debug(`Scrolling top: ${f.top}`)),r.debug("Scrolling, updating container, and viewport")},[l,n,o,r]),u=i.useCallback(()=>l!=null&&l.current?{top:l.current.scrollTop,left:l.current.scrollLeft}:{top:0,left:0},[l]);ce(e,{scroll:c,scrollToIndexes:a,getScrollPosition:u},"public")};function Lw(e,t){De(e,"columnHeaderClick",t.onColumnHeaderClick),De(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),De(e,"columnHeaderOver",t.onColumnHeaderOver),De(e,"columnHeaderOut",t.onColumnHeaderOut),De(e,"columnHeaderEnter",t.onColumnHeaderEnter),De(e,"columnHeaderLeave",t.onColumnHeaderLeave),De(e,"cellClick",t.onCellClick),De(e,"cellDoubleClick",t.onCellDoubleClick),De(e,"cellKeyDown",t.onCellKeyDown),De(e,"preferencePanelClose",t.onPreferencePanelClose),De(e,"preferencePanelOpen",t.onPreferencePanelOpen),De(e,"menuOpen",t.onMenuOpen),De(e,"menuClose",t.onMenuClose),De(e,"rowDoubleClick",t.onRowDoubleClick),De(e,"rowClick",t.onRowClick),De(e,"stateChange",t.onStateChange)}function Gw(e,t=166){let n,r;const o=()=>{n=void 0,e(...r)};function l(...s){r=s,n===void 0&&(n=setTimeout(o,t))}return l.clear=()=>{clearTimeout(n),n=void 0},l}const Sn={width:0,height:0},Rw={isReady:!1,root:Sn,viewportOuterSize:Sn,viewportInnerSize:Sn,contentSize:Sn,minimumSize:Sn,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},$w=e=>h({},e,{dimensions:Rw});function Aw(e,t){const n=Ue(e,"useResizeContainer"),r=i.useRef(!1),o=i.useRef(Sn),l=U(e,nt),s=U(e,un),a=U(e,On),c=U(e,Tn),u=Math.floor(t.rowHeight*c),d=Math.floor(t.columnHeaderHeight*c),f=Math.floor((t.columnGroupHeaderHeight??t.columnHeaderHeight)*c),g=Math.floor((t.headerFilterHeight??t.columnHeaderHeight)*c),m=zw(Jo(e),6),C=El(e,t),b=a.left.reduce((I,M)=>I+M.computedWidth,0),p=a.right.reduce((I,M)=>I+M.computedWidth,0),[S,x]=i.useState(),D=i.useMemo(()=>Gw(x,t.resizeThrottleMs),[t.resizeThrottleMs]),E=i.useRef(),H=()=>e.current.state.dimensions,G=Re(I=>{e.current.setState(M=>h({},M,{dimensions:I}))}),A=i.useCallback(()=>{const I=e.current.mainElementRef.current;if(!I)return;const M=Af(I).getComputedStyle(I),w={width:parseFloat(M.width)||0,height:parseFloat(M.height)||0};(!E.current||!ti(E.current,w))&&(e.current.publishEvent("resize",w),E.current=w)},[e]),F=i.useCallback(()=>{const I=nt(e.current.state);if(!I.isReady)return 0;const M=Wn(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(t.getRowHeight){const j=so(e),T=j.lastRowIndex-j.firstRowIndex;return Math.min(T-1,M.rows.length)}const w=Math.floor(I.viewportInnerSize.height/u);return Math.min(w,M.rows.length)},[e,t.pagination,t.paginationMode,t.getRowHeight,u]),y=i.useCallback(()=>{var J,se;const I=e.current.rootElementRef.current,M=Jg(e),w=jw(I,m,t.scrollbarSize),j=C+M.top,T=M.bottom,z={width:m-b-p,height:s.currentPageTotalHeight};let N,B,W=!1,X=!1;if(t.autoHeight)X=!1,W=Math.round(m)>Math.round(o.current.width),N={width:o.current.width,height:j+T+z.height},B={width:Math.max(0,N.width-(X?w:0)),height:Math.max(0,N.height-(W?w:0))};else{N={width:o.current.width,height:o.current.height},B={width:Math.max(0,N.width-b-p),height:Math.max(0,N.height-j-T)};const oe=z,ae=B,Le=oe.width>ae.width,Oe=oe.height>ae.height;(Le||Oe)&&(X=Oe,W=oe.width+(X?w:0)>ae.width,W&&(X=oe.height+w>ae.height)),X&&(B.width-=w),W&&(B.height-=w)}const q=Math.max(N.width,m+(X?w:0)),te={width:m,height:j+z.height+T},K={isReady:!0,root:o.current,viewportOuterSize:N,viewportInnerSize:B,contentSize:z,minimumSize:te,hasScrollX:W,hasScrollY:X,scrollbarSize:w,headerHeight:d,groupHeaderHeight:f,headerFilterHeight:g,rowWidth:q,rowHeight:u,columnsTotalWidth:m,leftPinnedWidth:b,rightPinnedWidth:p,headersTotalHeight:C,topContainerHeight:j,bottomContainerHeight:T},Q=e.current.state.dimensions;G(K),ti(K.viewportInnerSize,Q.viewportInnerSize)||e.current.publishEvent("viewportInnerSizeChange",K.viewportInnerSize),(se=(J=e.current).updateRenderContext)==null||se.call(J)},[e,G,t.scrollbarSize,t.autoHeight,s.currentPageTotalHeight,u,d,f,g,m,C,b,p]),_={resize:A,getRootDimensions:H},$={updateDimensions:y,getViewportPageSize:F};ce(e,_,"public"),ce(e,$,"private"),Ye(()=>{S&&(y(),e.current.publishEvent("debouncedResize",o.current))},[e,S,y]);const O=e.current.rootElementRef.current;Ye(()=>{if(!O)return;const I=(M,w)=>O.style.setProperty(M,w);I("--DataGrid-width",`${l.viewportOuterSize.width}px`),I("--DataGrid-hasScrollX",`${Number(l.hasScrollX)}`),I("--DataGrid-hasScrollY",`${Number(l.hasScrollY)}`),I("--DataGrid-scrollbarSize",`${l.scrollbarSize}px`),I("--DataGrid-rowWidth",`${l.rowWidth}px`),I("--DataGrid-columnsTotalWidth",`${l.columnsTotalWidth}px`),I("--DataGrid-leftPinnedWidth",`${l.leftPinnedWidth}px`),I("--DataGrid-rightPinnedWidth",`${l.rightPinnedWidth}px`),I("--DataGrid-headerHeight",`${l.headerHeight}px`),I("--DataGrid-headersTotalHeight",`${l.headersTotalHeight}px`),I("--DataGrid-topContainerHeight",`${l.topContainerHeight}px`),I("--DataGrid-bottomContainerHeight",`${l.bottomContainerHeight}px`),I("--height",`${l.rowHeight}px`)},[O,l]);const P=i.useRef(!0),L=i.useCallback(I=>{o.current=I;const M=/jsdom/.test(window.navigator.userAgent);if(I.height===0&&!r.current&&!t.autoHeight&&!M&&(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(` +`)),r.current=!0),I.width===0&&!r.current&&!M&&(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(` +`)),r.current=!0),P.current){x(I),P.current=!1;return}D(I)},[t.autoHeight,D,n]);Ye(y,[y]),De(e,"sortedRowsSet",y),De(e,"paginationModelChange",y),De(e,"columnsChange",y),ee(e,"resize",L),De(e,"debouncedResize",t.onResize)}function jw(e,t,n){if(n!==void 0)return n;if(e===null||t===0)return 0;const o=Nt(e).createElement("div");o.style.width="99px",o.style.height="99px",o.style.position="absolute",o.style.overflow="scroll",o.className="scrollDiv",e.appendChild(o);const l=o.offsetWidth-o.clientWidth;return e.removeChild(o),l}function zw(e,t){return Math.round(e*10**t)/10**t}function ti(e,t){return e.width===t.width&&e.height===t.height}const Vw=e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:o,showLeftBorder:l,showRightBorder:s,groupId:a,pinnedPosition:c}=e;return de({root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",s&&"columnHeader--withRightBorder",l&&"columnHeader--withLeftBorder","withBorderColor",a===null?"columnHeader--emptyGroup":"columnHeader--filledGroup",c==="left"&&"columnHeader--pinnedLeft",c==="right"&&"columnHeader--pinnedRight",o&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]},ue,t)};function Nw(e){var z;const{groupId:t,width:n,depth:r,maxDepth:o,fields:l,height:s,colIndex:a,hasFocus:c,tabIndex:u,isLastColumn:d,pinnedPosition:f,style:g,indexInSection:m,sectionLength:C,gridHasFiller:b}=e,p=Z(),S=i.useRef(null),x=ie(),D=U(x,Pl),E=t?D[t]:{},{headerName:H=t??"",description:G="",headerAlign:A=void 0}=E;let F;const y=t&&((z=D[t])==null?void 0:z.renderHeaderGroup),_=i.useMemo(()=>({groupId:t,headerName:H,description:G,depth:r,maxDepth:o,fields:l,colIndex:a,isLastColumn:d}),[t,H,G,r,o,l,a,d]);t&&y&&(F=y(_));const $=ur(f,m),O=cr(f,m,C,p.showColumnVerticalBorder,b),P=h({},e,{classes:p.classes,showLeftBorder:$,showRightBorder:O,headerAlign:A,depth:r,isDragging:!1}),L=H??t,I=_e(),M=t===null?`empty-group-cell-${I}`:t,w=Vw(P);i.useLayoutEffect(()=>{if(c){const B=S.current.querySelector('[tabindex="0"]')||S.current;B==null||B.focus()}},[x,c]);const j=i.useCallback(N=>B=>{io(B)||x.current.publishEvent(N,_,B)},[x,_]),T=i.useMemo(()=>({onKeyDown:j("columnGroupHeaderKeyDown"),onFocus:j("columnGroupHeaderFocus"),onBlur:j("columnGroupHeaderBlur")}),[j]),R=typeof E.headerClassName=="function"?E.headerClassName(_):E.headerClassName;return v.jsx(Lc,h({ref:S,classes:w,columnMenuOpen:!1,colIndex:a,height:s,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:u,isDraggable:!1,headerComponent:F,headerClassName:R,description:G,elementId:M,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:L,"aria-colspan":l.length,"data-fields":`|-${l.join("-|-")}-|`,style:g},T))}const ni=je("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})({display:"flex"}),Bw=e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:r,columnHeaderTabIndexState:o,columnGroupHeaderTabIndexState:l,columnHeaderFocus:s,columnGroupHeaderFocus:a,headerGroupingMaxDepth:c,columnMenuState:u,columnVisibility:d,columnGroupsHeaderStructure:f,hasOtherElementInTabSequence:g}=e,[m,C]=i.useState(""),[b,p]=i.useState(""),S=Et(),x=Kt(),D=Z(),E=U(S,nt),H=U(S,ar),G=U(S,Ml),A=U(S,Rt),F=U(S,ic),y=U(S,On),_=U(S,Pt),$=dc(A,F,y.left.length),O=E.columnsTotalWidth{S.current.columnHeadersContainerRef.current.scrollLeft=0},[S]);const P=i.useCallback(q=>p(q.field),[]),L=i.useCallback(()=>p(""),[]),I=i.useCallback(q=>C(q.field),[]),M=i.useCallback(()=>C(""),[]),w=i.useMemo(()=>y.left.length?{firstColumnIndex:0,lastColumnIndex:y.left.length}:null,[y.left.length]),j=i.useMemo(()=>y.right.length?{firstColumnIndex:t.length-y.right.length,lastColumnIndex:t.length}:null,[y.right.length,t.length]);ee(S,"columnResizeStart",P),ee(S,"columnResizeStop",L),ee(S,"columnHeaderDragStart",I),ee(S,"columnHeaderDragEnd",M);const T=q=>{const{renderContext:te=F,maxLastColumn:K=t.length}=q||{},Q=te.firstColumnIndex,J=H?te.lastColumnIndex:K;return{renderedColumns:t.slice(Q,J),firstColumnToRender:Q,lastColumnToRender:J}},R=(q,te,K,Q=!1)=>{const J=(q==null?void 0:q.position)===Me.RIGHT,se=(q==null?void 0:q.position)===void 0,oe=y.right.length>0&&J||y.right.length===0&&se,ae=$-K;return v.jsxs(i.Fragment,{children:[se&&v.jsx("div",{role:"presentation",style:{width:ae}}),te,se&&v.jsx("div",{role:"presentation",className:me(k.filler,Q&&k["filler--borderBottom"])}),oe&&v.jsx(_l,{header:!0,pinnedRight:J,borderBottom:Q,borderTop:!1})]})},z=({pinnedPosition:q,columnIndex:te,computedWidth:K})=>{let Q;const J=q===Me.LEFT,se=q===Me.RIGHT;if(J||se){const oe=Hl(q,K,te,A,E);let ae=J?"left":"right";x&&(ae=J?"right":"left"),q==="left"&&(Q={[ae]:oe}),q==="right"&&(Q={[ae]:oe})}return Q},N=(q,te={})=>{const{renderedColumns:K,firstColumnToRender:Q}=T(q),J=[];for(let se=0;sev.jsxs(ni,{role:"row","aria-rowindex":c+1,ownerState:D,className:k["row--borderBottom"],children:[w&&N({position:Me.LEFT,renderContext:w,maxLastColumn:w.lastColumnIndex},{disableReorder:!0}),N({renderContext:F,maxLastColumn:t.length-y.right.length}),j&&N({position:Me.RIGHT,renderContext:j,maxLastColumn:j.lastColumnIndex},{disableReorder:!0,separatorSide:fr.Left})]}),W=({depth:q,params:te})=>{var ye,Ee;const K=T(te);if(K.renderedColumns.length===0)return null;const{renderedColumns:Q,firstColumnToRender:J,lastColumnToRender:se}=K,oe=f[q],ae=t[J].field,Le=((ye=G[ae])==null?void 0:ye[q])??null,Oe=oe.findIndex(({groupId:Fe,columnFields:Ce})=>Fe===Le&&Ce.includes(ae)),He=t[se-1].field,ve=((Ee=G[He])==null?void 0:Ee[q])??null,Ge=oe.findIndex(({groupId:Fe,columnFields:Ce})=>Fe===ve&&Ce.includes(He)),qe=oe.slice(Oe,Ge+1).map(Fe=>h({},Fe,{columnFields:Fe.columnFields.filter(Ce=>d[Ce]!==!1)})).filter(Fe=>Fe.columnFields.length>0),ot=qe[0].columnFields.indexOf(ae),Ae=qe[0].columnFields.slice(0,ot).reduce((Fe,Ce)=>{const Be=_[Ce];return Fe+(Be.computedWidth??0)},0);let be=J;const fe=qe.map(({groupId:Fe,columnFields:Ce},Be)=>{const ze=a!==null&&a.depth===q&&Ce.includes(a.field),le=l!==null&&l.depth===q&&Ce.includes(l.field)?0:-1,he={groupId:Fe,width:Ce.reduce((Ie,tt)=>Ie+_[tt].computedWidth,0),fields:Ce,colIndex:be,hasFocus:ze,tabIndex:le},pe=te.position,ge=z({pinnedPosition:pe,columnIndex:be,computedWidth:he.width});be+=Ce.length;let we=Be;return pe==="left"&&(we=be-1),v.jsx(Nw,{groupId:Fe,width:he.width,fields:he.fields,colIndex:he.colIndex,depth:q,isLastColumn:he.colIndex===t.length-he.fields.length,maxDepth:c,height:E.groupHeaderHeight,hasFocus:ze,tabIndex:le,pinnedPosition:pe,style:ge,indexInSection:we,sectionLength:Q.length,gridHasFiller:O},Be)});return R(te,fe,Ae)};return{renderContext:F,leftRenderContext:w,rightRenderContext:j,pinnedColumns:y,visibleColumns:t,getCellOffsetStyle:z,getFillers:R,getColumnHeadersRow:B,getColumnsToRender:T,getColumnGroupHeadersRows:()=>{if(c===0)return null;const q=[];for(let te=0;te({role:"rowgroup"})}},Uw=["className"],Ww=e=>{const{classes:t}=e;return de({root:["columnHeaders"]},ue,t)},qw=Se("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),Kw=i.forwardRef(function(t,n){const{className:r}=t,o=ne(t,Uw),l=Z(),s=Ww(l);return v.jsx(qw,h({ref:n,className:me(r,s.root),ownerState:l},o,{role:"presentation"}))}),Xw=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],Yw=i.forwardRef(function(t,n){const{visibleColumns:r,sortColumnLookup:o,filterColumnLookup:l,columnHeaderTabIndexState:s,columnGroupHeaderTabIndexState:a,columnHeaderFocus:c,columnGroupHeaderFocus:u,headerGroupingMaxDepth:d,columnMenuState:f,columnVisibility:g,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:C}=t,b=ne(t,Xw),{getInnerProps:p,getColumnHeadersRow:S,getColumnGroupHeadersRows:x}=Bw({visibleColumns:r,sortColumnLookup:o,filterColumnLookup:l,columnHeaderTabIndexState:s,columnGroupHeaderTabIndexState:a,columnHeaderFocus:c,columnGroupHeaderFocus:u,headerGroupingMaxDepth:d,columnMenuState:f,columnVisibility:g,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:C});return v.jsxs(Kw,h({ref:n},b,p(),{children:[x(),S()]}))}),Bu=Yt(Yw);function Qw(e){return null}function Jw(e){return null}const Zw=i.forwardRef(function(t,n){const o=ie().current.getLocaleText("noResultsOverlayLabel");return v.jsx(dr,h({ref:n},t,{children:o}))}),eS=["sortingOrder"],tS=i.memo(function(t){const{sortingOrder:n}=t,r=ne(t,eS),o=Z(),[l]=n,s=l==="asc"?o.slots.columnSortedAscendingIcon:o.slots.columnSortedDescendingIcon;return s?v.jsx(s,h({},r)):null}),nS=["native"];function oS(e){let{native:t}=e,n=ne(e,nS);return t?v.jsx("option",h({},n)):v.jsx(yt,h({},n))}const rS={booleanCellTrueIcon:Qc,booleanCellFalseIcon:_o,columnMenuIcon:qc,openFilterButtonIcon:jc,filterPanelDeleteIcon:_o,columnFilteredIcon:Ar,columnSelectorIcon:Vc,columnUnsortedIcon:tS,columnSortedAscendingIcon:Lr,columnSortedDescendingIcon:Gr,columnResizeIcon:Nc,densityCompactIcon:Bc,densityStandardIcon:Uc,densityComfortableIcon:Wc,exportIcon:Yc,moreActionsIcon:Jc,treeDataCollapseIcon:$r,treeDataExpandIcon:Rr,groupingCriteriaCollapseIcon:$r,groupingCriteriaExpandIcon:Rr,detailPanelExpandIcon:jr,detailPanelCollapseIcon:Kc,rowReorderIcon:zr,quickFilterIcon:zc,quickFilterClearIcon:_o,columnMenuHideIcon:Zc,columnMenuSortAscendingIcon:Lr,columnMenuSortDescendingIcon:Gr,columnMenuFilterIcon:Ar,columnMenuManageColumnsIcon:eu,columnMenuClearIcon:tu,loadIcon:Xc,filterPanelAddIcon:jr,filterPanelRemoveAllIcon:nu,columnReorderIcon:zr},lS=h({},rS,{baseCheckbox:Sd,baseTextField:Yr,baseFormControl:yd,baseSelect:xd,baseButton:bi,baseIconButton:vd,baseInputAdornment:Id,baseTooltip:Md,basePopper:Kr,baseInputLabel:Pd,baseSelectOption:oS,baseChip:Ed}),sS=h({},lS,{cell:Ec,skeletonCell:Fc,columnHeaderFilterIconButton:Ac,columnHeaderSortIcon:$c,columnMenu:mu,columnHeaders:Bu,detailPanels:Qw,footer:Du,footerRowCount:Lu,toolbar:null,pinnedRows:Jw,loadingOverlay:Ou,noResultsOverlay:Zw,noRowsOverlay:Hu,pagination:_u,filterPanel:Su,columnsPanel:hu,columnsManagement:Ol,panel:Cu,row:Gu});function iS({defaultSlots:e,slots:t}){const n=t;if(!n||Object.keys(n).length===0)return e;const r=h({},e);return Object.keys(n).forEach(o=>{const l=o;n[l]!==void 0&&(r[l]=n[l])}),r}function aS(e){const t=Object.keys(e);if(!t.some(o=>o.startsWith("aria-")||o.startsWith("data-")))return e;const n={},r=e.forwardedProps??{};for(let o=0;oaS(e),[e])}const uS={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid"},No={autoHeight:!1,autoPageSize:!1,autosizeOnMount:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,clipboardCopyCellDelimiter:" ",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:vt.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",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},dS=sS,fS=e=>{const t=cS(Fd({props:e,name:"MuiDataGrid"})),n=i.useMemo(()=>h({},_i,t.localeText),[t.localeText]),r=i.useMemo(()=>iS({defaultSlots:dS,slots:t.slots}),[t.slots]),o=i.useMemo(()=>Object.keys(No).reduce((l,s)=>(l[s]=t[s]??No[s],l),{}),[t]);return i.useMemo(()=>h({},t,o,{localeText:n,slots:r},uS),[t,n,r,o])},gS=e=>h({},e,{rowsMeta:{currentPageTotalHeight:0,positions:[]}}),oi=(e,t,n)=>typeof e=="number"&&e>0?e:t,mS=(e,t)=>{const{getRowHeight:n,getRowSpacing:r,getEstimatedRowHeight:o}=t,l=i.useRef(Object.create(null)),s=i.useRef(-1),a=i.useRef(!1),c=U(e,Tn),u=U(e,We),d=U(e,oo),f=U(e,at),g=Qt(e,t),m=U(e,an),C=oi(t.rowHeight,No.rowHeight),b=Math.floor(C*c),p=i.useCallback(()=>{var I,M;a.current=!1;const O=w=>{l.current[w.id]||(l.current[w.id]={sizes:{baseCenter:b},isResized:!1,autoHeight:!1,needsFirstMeasurement:!0});const{isResized:j,needsFirstMeasurement:T,sizes:R}=l.current[w.id];let z=typeof b=="number"&&b>0?b:52;const N=R.baseCenter;if(j)z=N;else if(n){const X=n(h({},w,{densityFactor:c}));X==="auto"?(T?z=(o?o(h({},w,{densityFactor:c})):b)??b:z=N,a.current=!0,l.current[w.id].autoHeight=!0):(z=oi(X,b),l.current[w.id].needsFirstMeasurement=!1,l.current[w.id].autoHeight=!1)}else l.current[w.id].needsFirstMeasurement=!1;const B={baseCenter:z};if(r){const X=e.current.getRowIndexRelativeToVisibleRows(w.id),q=r(h({},w,{isFirstVisible:X===0,isLastVisible:X===g.rows.length-1,indexRelativeToCurrentPage:X}));B.spacingTop=q.top??0,B.spacingBottom=q.bottom??0}const W=e.current.unstable_applyPipeProcessors("rowHeight",B,w);return l.current[w.id].sizes=W,W},P=[],L=g.rows.reduce((w,j)=>{P.push(w);let T=0;const R=O(j);for(const z in R){const N=R[z];z!=="baseCenter"&&(T+=N)}return w+R.baseCenter+T},0);(I=m==null?void 0:m.top)==null||I.forEach(w=>{O(w)}),(M=m==null?void 0:m.bottom)==null||M.forEach(w=>{O(w)}),e.current.setState(w=>h({},w,{rowsMeta:{currentPageTotalHeight:L,positions:P}})),a.current||(s.current=1/0),e.current.forceUpdate()},[e,g.rows,b,n,r,o,m,c]),S=i.useCallback(O=>{const P=l.current[O];return P?P.sizes.baseCenter:b},[b]),x=O=>{var P;return(P=l.current[O])==null?void 0:P.sizes},D=i.useCallback((O,P)=>{l.current[O].sizes.baseCenter=P,l.current[O].isResized=!0,l.current[O].needsFirstMeasurement=!1,p()},[p]),E=i.useMemo(()=>Di(p,t.rowPositionsDebounceMs),[p,t.rowPositionsDebounceMs]),H=i.useCallback((O,P)=>{if(!l.current[O]||!l.current[O].autoHeight)return;const L=l.current[O].sizes.baseCenter!==P;l.current[O].needsFirstMeasurement=!1,l.current[O].sizes.baseCenter=P,L&&E()},[E]),G=i.useCallback(O=>{var P;return((P=l.current[O])==null?void 0:P.autoHeight)||!1},[]),A=i.useCallback(()=>s.current,[]),F=i.useCallback(O=>{a.current&&O>s.current&&(s.current=O)},[]),y=i.useCallback(()=>{l.current={},p()},[p]);i.useEffect(()=>{p()},[b,u,d,f,p]),Rl(e,"rowHeight",p);const _={unstable_setLastMeasuredRowIndex:F,unstable_getRowHeight:S,unstable_getRowInternalSizes:x,unstable_setRowHeight:D,unstable_storeRowHeightMeasurement:H,resetRowHeights:y},$={getLastMeasuredRowIndex:A,rowHasAutoHeight:G};ce(e,_,"public"),ce(e,$,"private")},hS=e=>{const t=i.useCallback((o={})=>e.current.unstable_applyPipeProcessors("exportState",{},o),[e]),n=i.useCallback(o=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:o}).callbacks.forEach(s=>{s()}),e.current.forceUpdate()},[e]);ce(e,{exportState:t,restoreState:n},"public")},pS=e=>{const t=i.useRef({}),n=(a,c)=>{var u;return(u=t.current[a])==null?void 0:u[c]},r=()=>{t.current={}},o=i.useCallback(({rowId:a,minFirstColumn:c,maxLastColumn:u,columns:d})=>{for(let f=c;f1&&(f+=g.colSpan-1)}},[e]),l={unstable_getCellColSpanInfo:n},s={resetColSpan:r,calculateColSpan:o};ce(e,l,"public"),ce(e,s,"private"),ee(e,"columnOrderChange",r)};function CS(e){const{apiRef:t,lookup:n,columnIndex:r,rowId:o,minFirstColumnIndex:l,maxLastColumnIndex:s,columns:a}=e,c=a.length,u=a[r],d=t.current.getRow(o),f=t.current.getRowValue(d,u),g=typeof u.colSpan=="function"?u.colSpan(f,d,u,t):u.colSpan;if(!g||g===1)return Ir(n,o,r,{spannedByColSpan:!1,cellProps:{colSpan:1,width:u.computedWidth}}),{colSpan:1};let m=u.computedWidth;for(let C=1;C=l&&b{if(cl(e)){if(n[e.field]!==void 0)throw new Error(["MUI X: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join(` +`));n[e.field]=t;return}const{groupId:r,children:o}=e;o.forEach(l=>{Uu(l,[...t,r],n)})},Ur=e=>{if(!e)return{};const t={};return e.forEach(n=>{Uu(n,[],t)}),t},Wr=(e,t,n)=>{const r=c=>t[c]??[],o=[],l=Math.max(...e.map(c=>r(c).length)),s=(c,u,d)=>Bt(r(c).slice(0,d+1),r(u).slice(0,d+1)),a=(c,u)=>!!(n!=null&&n.left&&n.left.includes(c)&&!n.left.includes(u)||n!=null&&n.right&&!n.right.includes(c)&&n.right.includes(u));for(let c=0;c{const g=r(f)[c]??null;if(d.length===0)return[{columnFields:[f],groupId:g}];const m=d[d.length-1],C=m.columnFields[m.columnFields.length-1];return m.groupId!==g||!s(C,f,c)||a(C,f)?[...d,{columnFields:[f],groupId:g}]:[...d.slice(0,d.length-1),{columnFields:[...m.columnFields,f],groupId:g}]},[]);o.push(u)}return o},bS=["groupId","children"],$l=e=>{let t={};return e.forEach(n=>{if(cl(n))return;const{groupId:r,children:o}=n,l=ne(n,bS);if(!r)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");const s=h({},l,{groupId:r}),a=$l(o);if(a[r]!==void 0||t[r]!==void 0)throw new Error(`MUI X: The groupId ${r} is used multiple times in the columnGroupingModel.`);t=h({},t,a,{[r]:s})}),h({},t)},wS=(e,t,n)=>{if(!t.columnGroupingModel)return e;const r=kt(n),o=sn(n),l=$l(t.columnGroupingModel??[]),s=Ur(t.columnGroupingModel??[]),a=Wr(r,s,n.current.state.pinnedColumns??{}),c=o.length===0?0:Math.max(...o.map(u=>{var d;return((d=s[u])==null?void 0:d.length)??0}));return h({},e,{columnGrouping:{lookup:l,unwrappedGroupingModel:s,headerStructure:a,maxDepth:c}})},SS=(e,t)=>{const n=i.useCallback(a=>Ml(e)[a]??[],[e]),r=i.useCallback(()=>Pl(e),[e]);ce(e,{getColumnGroupPath:n,getAllGroupDetails:r},"public");const l=i.useCallback(()=>{const a=Ur(t.columnGroupingModel??[]);e.current.setState(c=>{var g;const u=((g=c.columns)==null?void 0:g.orderedFields)??[],d=c.pinnedColumns??{},f=Wr(u,a,d);return h({},c,{columnGrouping:h({},c.columnGrouping,{headerStructure:f})})})},[e,t.columnGroupingModel]),s=i.useCallback(a=>{var b,p;const c=((p=(b=e.current).getPinnedColumns)==null?void 0:p.call(b))??{},u=kt(e),d=sn(e),f=$l(a??[]),g=Ur(a??[]),m=Wr(u,g,c),C=d.length===0?0:Math.max(...d.map(S=>{var x;return((x=g[S])==null?void 0:x.length)??0}));e.current.setState(S=>h({},S,{columnGrouping:{lookup:f,unwrappedGroupingModel:g,headerStructure:m,maxDepth:C}}))},[e]);ee(e,"columnIndexChange",l),ee(e,"columnsChange",()=>{s(t.columnGroupingModel)}),ee(e,"columnVisibilityModelChange",()=>{s(t.columnGroupingModel)}),i.useEffect(()=>{s(t.columnGroupingModel)},[s,t.columnGroupingModel])};function yS(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function ri(e,t){if(t!==void 0&&e.changedTouches){for(let n=0;nar(e),r=U(e,n);return i.useEffect(()=>{t.current&&r===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(n()===!1)return Promise.resolve();t.current=yS()}return t.current}}function PS(e,t){if(e.length<4)return e;const n=e.slice();n.sort((a,c)=>a-c);const r=n[Math.floor(n.length*.25)],o=n[Math.floor(n.length*.75)-1],l=o-r,s=l<5?5:l*t;return n.filter(a=>a>r-s&&a{const a=tp(e.current,l.field).map(C=>C.getBoundingClientRect().width??0),c=t.includeOutliers?a:PS(a,t.outliersFactor);if(t.includeHeaders){const C=ep(e.current,l.field);if(C){const b=C.querySelector(`.${k.columnHeaderTitle}`),p=C.querySelector(`.${k.columnHeaderTitleContainerContent}`),S=C.querySelector(`.${k.iconButtonContainer}`),x=C.querySelector(`.${k.menuIcon}`),D=b??p,E=window.getComputedStyle(C,null),H=parseInt(E.paddingLeft,10)+parseInt(E.paddingRight,10),A=D.scrollWidth+1+H+((S==null?void 0:S.clientWidth)??0)+((x==null?void 0:x.clientWidth)??0);c.push(A)}}const u=l.minWidth!==-1/0&&l.minWidth!==void 0,d=l.maxWidth!==1/0&&l.maxWidth!==void 0,f=u?l.minWidth:0,g=d?l.maxWidth:1/0,m=c.length===0?0:Math.max(...c);r[l.field]=Lt(m,f,g)}),o.classList.remove(k.autosizing),r}const FS=e=>h({},e,{columnResize:{resizingColumnField:""}});function kS(){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 DS=(e,t)=>{const n=Kt(),r=Ue(e,"useGridColumnResize"),o=Xt(kS).current,l=i.useRef(),s=i.useRef(),a=Dn(),c=i.useRef(),u=y=>{var M,w;r.debug(`Updating width to ${y} for col ${o.colDef.field}`);const _=o.columnHeaderElement.offsetWidth,$=y-_,O=y-o.initialColWidth,P=o.initialTotalWidth+O;(w=(M=e.current.rootElementRef)==null?void 0:M.current)==null||w.style.setProperty("--DataGrid-rowWidth",`${P}px`),o.colDef.computedWidth=y,o.colDef.width=y,o.colDef.flex=0,o.columnHeaderElement.style.width=`${y}px`;const L=o.headerFilterElement;L&&(L.style.width=`${y}px`),o.groupHeaderElements.forEach(j=>{const T=j;let R;T.getAttribute("aria-colspan")==="1"?R=`${y}px`:R=`${T.offsetWidth+$}px`,T.style.width=R}),o.cellElements.forEach(j=>{const T=j;let R;T.getAttribute("aria-colspan")==="1"?R=`${y}px`:R=`${T.offsetWidth+$}px`,T.style.setProperty("--width",R)});const I=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);I===Me.LEFT&&(pn(o.fillerLeft,"width",$),o.leftPinnedCellsAfter.forEach(j=>{pn(j,"left",$)}),o.leftPinnedHeadersAfter.forEach(j=>{pn(j,"left",$)})),I===Me.RIGHT&&(pn(o.fillerRight,"width",$),o.rightPinnedCellsBefore.forEach(j=>{pn(j,"right",$)}),o.rightPinnedHeadersBefore.forEach(j=>{pn(j,"right",$)}))},d=y=>{if(S(),o.previousMouseClickEvent){const _=o.previousMouseClickEvent,$=_.timeStamp,O=_.clientX,P=_.clientY;if(y.timeStamp-$<300&&y.clientX===O&&y.clientY===P){o.previousMouseClickEvent=void 0,e.current.publishEvent("columnResizeStop",null,y);return}}if(o.colDef){e.current.setColumnWidth(o.colDef.field,o.colDef.width),r.debug(`Updating col ${o.colDef.field} with new width: ${o.colDef.width}`);const _=xt(e.current.state);o.groupHeaderElements.forEach($=>{const O=qh($),P=$,I=`${O.reduce((M,w)=>_.columnVisibilityModel[w]!==!1?M+_.lookup[w].computedWidth:M,0)}px`;P.style.width=I})}a.start(0,()=>{e.current.publishEvent("columnResizeStop",null,y)})},f=(y,_,$)=>{var I;const O=e.current.rootElementRef.current;o.initialColWidth=y.computedWidth,o.initialTotalWidth=e.current.getRootDimensions().rowWidth,o.colDef=y,o.columnHeaderElement=Wh(e.current.columnHeadersContainerRef.current,y.field);const P=O.querySelector(`.${k.headerFilterRow} [data-field="${At(y.field)}"]`);P&&(o.headerFilterElement=P),o.groupHeaderElements=Kh((I=e.current.columnHeadersContainerRef)==null?void 0:I.current,y.field),o.cellElements=Xh(o.columnHeaderElement,e.current),o.fillerLeft=Rs(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),o.fillerRight=Rs(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const L=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);o.leftPinnedCellsAfter=L!==Me.LEFT?[]:Yh(e.current,o.columnHeaderElement,n),o.rightPinnedCellsBefore=L!==Me.RIGHT?[]:Qh(e.current,o.columnHeaderElement,n),o.leftPinnedHeadersAfter=L!==Me.LEFT?[]:Jh(e.current,o.columnHeaderElement,n),o.rightPinnedHeadersBefore=L!==Me.RIGHT?[]:Zh(e.current,o.columnHeaderElement,n),s.current=IS(_,n),l.current=xS($,o.columnHeaderElement.getBoundingClientRect(),s.current)},g=Re(d),m=Re(y=>{if(y.buttons===0){g(y);return}let _=li(l.current,y.clientX,o.columnHeaderElement.getBoundingClientRect(),s.current);_=Lt(_,o.colDef.minWidth,o.colDef.maxWidth),u(_);const $={element:o.columnHeaderElement,colDef:o.colDef,width:_};e.current.publishEvent("columnResize",$,y)}),C=Re(y=>{ri(y,c.current)&&d(y)}),b=Re(y=>{const _=ri(y,c.current);if(!_)return;if(y.type==="mousemove"&&y.buttons===0){C(y);return}let $=li(l.current,_.x,o.columnHeaderElement.getBoundingClientRect(),s.current);$=Lt($,o.colDef.minWidth,o.colDef.maxWidth),u($);const O={element:o.columnHeaderElement,colDef:o.colDef,width:$};e.current.publishEvent("columnResize",O,y)}),p=Re(y=>{const _=jo(y.target,k["columnSeparator--resizable"]);if(!_)return;const $=y.changedTouches[0];$!=null&&(c.current=$.identifier);const O=jo(y.target,k.columnHeader),P=Uh(O),L=e.current.getColumn(P);r.debug(`Start Resize on col ${L.field}`),e.current.publishEvent("columnResizeStart",{field:P},y),f(L,_,$.clientX);const I=Nt(y.currentTarget);I.addEventListener("touchmove",b),I.addEventListener("touchend",C)}),S=i.useCallback(()=>{const y=Nt(e.current.rootElementRef.current);y.body.style.removeProperty("cursor"),y.removeEventListener("mousemove",m),y.removeEventListener("mouseup",g),y.removeEventListener("touchmove",b),y.removeEventListener("touchend",C),setTimeout(()=>{y.removeEventListener("click",si,!0)},100),o.columnHeaderElement&&(o.columnHeaderElement.style.pointerEvents="unset")},[e,o,m,g,b,C]),x=i.useCallback(({field:y})=>{e.current.setState(_=>h({},_,{columnResize:h({},_.columnResize,{resizingColumnField:y})})),e.current.forceUpdate()},[e]),D=i.useCallback(()=>{e.current.setState(y=>h({},y,{columnResize:h({},y.columnResize,{resizingColumnField:""})})),e.current.forceUpdate()},[e]),E=Re(({colDef:y},_)=>{if(_.button!==0||!_.currentTarget.classList.contains(k["columnSeparator--resizable"]))return;_.preventDefault(),r.debug(`Start Resize on col ${y.field}`),e.current.publishEvent("columnResizeStart",{field:y.field},_),f(y,_.currentTarget,_.clientX);const $=Nt(e.current.rootElementRef.current);$.body.style.cursor="col-resize",o.previousMouseClickEvent=_.nativeEvent,$.addEventListener("mousemove",m),$.addEventListener("mouseup",g),$.addEventListener("click",si,!0)}),H=Re((y,_)=>{if(t.disableAutosize||_.button!==0)return;const $=e.current.state.columns.lookup[y.field];$.resizable!==!1&&e.current.autosizeColumns(h({},t.autosizeOptions,{columns:[$.field]}))}),G=MS(e),A=i.useRef(!1),F=i.useCallback(async y=>{var L;if(!((L=e.current.rootElementRef)==null?void 0:L.current)||A.current)return;A.current=!0;const $=xt(e.current.state),O=h({},bc,y,{columns:(y==null?void 0:y.columns)??$.orderedFields});O.columns=O.columns.filter(I=>$.columnVisibilityModel[I]!==!1);const P=O.columns.map(I=>e.current.state.columns.lookup[I]);try{e.current.unstable_setColumnVirtualization(!1),await G();const I=ES(e,O,P),M=P.map(w=>h({},w,{width:I[w.field],computedWidth:I[w.field]}));if(O.expand){const j=$.orderedFields.map(z=>$.lookup[z]).filter(z=>$.columnVisibilityModel[z.field]!==!1).reduce((z,N)=>z+(I[N.field]??N.computedWidth??N.width),0),R=e.current.getRootDimensions().viewportInnerSize.width-j;if(R>0){const z=R/(M.length||1);M.forEach(N=>{N.width+=z,N.computedWidth+=z})}}e.current.updateColumns(M),M.forEach((w,j)=>{if(w.width!==P[j].width){const T=w.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(w.field),colDef:w,width:T})}})}finally{e.current.unstable_setColumnVirtualization(!0),A.current=!1}},[e,G]);i.useEffect(()=>S,[S]),Yn(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),Sl(e,()=>{var y;return(y=e.current.columnHeadersContainerRef)==null?void 0:y.current},"touchstart",p,{passive:!0}),ce(e,{autosizeColumns:F},"public"),ee(e,"columnResizeStop",D),ee(e,"columnResizeStart",x),ee(e,"columnSeparatorMouseDown",E),ee(e,"columnSeparatorDoubleClick",H),De(e,"columnResize",t.onColumnResize),De(e,"columnWidthChange",t.onColumnWidthChange)};function pn(e,t,n){e&&(e.style[t]=`${parseInt(e.style[t],10)+n}px`)}function TS(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{if(!e)return null;let r=e[t.field];const o=t.rowSpanValueGetter??t.valueGetter;return o&&(r=o(r,e,t,n)),r},Bo={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},Vn={firstRowIndex:0,lastRowIndex:0},HS=new Set(["__check__","__reorder__","__detail_panel_toggle__"]),Wu=20,qu=(e,t,n,r,o,l,s)=>{const a=l?{}:h({},e.current.state.rowSpanning.spannedCells),c=l?{}:h({},e.current.state.rowSpanning.hiddenCells),u=l?{}:h({},e.current.state.rowSpanning.hiddenCellOriginMap);return l&&(s=Vn),t.forEach(d=>{var f;if(!HS.has(d.field)){for(let g=o.firstRowIndex;g<=o.lastRowIndex;g+=1){const m=n[g];if((f=c[m.id])!=null&&f[d.field])continue;const C=Mr(m.model,d,e);if(C==null)continue;let b=m.id,p=g,S=0;const x=[];if(g===o.firstRowIndex){let E=g-1;const H=n[E];for(;E>=r.firstRowIndex&&Mr(H.model,d,e)===C;){const G=n[E+1];c[G.id]?c[G.id][d.field]=!0:c[G.id]={[d.field]:!0},x.push(g),S+=1,b=H.id,p=E,E-=1}}x.forEach(E=>{u[E]?u[E][d.field]=p:u[E]={[d.field]:p}});let D=g+1;for(;D<=r.lastRowIndex&&n[D]&&Mr(n[D].model,d,e)===C;){const E=n[D];c[E.id]?c[E.id][d.field]=!0:c[E.id]={[d.field]:!0},u[D]?u[D][d.field]=p:u[D]={[d.field]:p},D+=1,S+=1}S>0&&(a[b]?a[b][d.field]=S+1:a[b]={[d.field]:S+1})}s={firstRowIndex:Math.min(s.firstRowIndex,o.firstRowIndex),lastRowIndex:Math.max(s.lastRowIndex,o.lastRowIndex)}}}),{spannedCells:a,hiddenCells:c,hiddenCellOriginMap:u,processedRange:s}},_S=(e,t,n)=>{var r;if(t.unstable_rowSpanning){const o=e.rows.dataRowIds||[],l=e.columns.orderedFields||[],s=e.rows.dataRowIdToModelLookup,a=e.columns.lookup,c=!!e.filter.filterModel.items.length||!!((r=e.filter.filterModel.quickFilterValues)!=null&&r.length);if(!o.length||!l.length||!s||!a||c)return h({},e,{rowSpanning:Bo});const u={firstRowIndex:0,lastRowIndex:Math.min(Wu-1,Math.max(o.length-1,0))},d=o.map(b=>({id:b,model:s[b]})),f=l.map(b=>a[b]),{spannedCells:g,hiddenCells:m,hiddenCellOriginMap:C}=qu(n,f,d,u,u,!0,Vn);return h({},e,{rowSpanning:{spannedCells:g,hiddenCells:m,hiddenCellOriginMap:C}})}return h({},e,{rowSpanning:Bo})},LS=(e,t)=>{const{range:n,rows:r}=Qt(e,t),o=U(e,so),l=U(e,Ne),s=Xt(()=>Object.keys(e.current.state.rowSpanning.spannedCells).length>0?{firstRowIndex:0,lastRowIndex:Math.min(Wu-1,Math.max(e.current.state.rows.dataRowIds.length-1,0))}:Vn),a=i.useRef(Vn),c=i.useCallback((g=!0)=>{if(!t.unstable_rowSpanning){e.current.state.rowSpanning!==Bo&&e.current.setState(A=>h({},A,{rowSpanning:Bo}));return}if(n===null||!OS(o))return;g&&(s.current=Vn);const m=TS({firstRowIndex:o.firstRowIndex,lastRowIndex:o.lastRowIndex-1},s.current);if(m===null)return;const{spannedCells:C,hiddenCells:b,hiddenCellOriginMap:p,processedRange:S}=qu(e,l,r,n,m,g,s.current);s.current=S;const x=Object.keys(C).length,D=Object.keys(b).length,E=Object.keys(e.current.state.rowSpanning.spannedCells).length,H=Object.keys(e.current.state.rowSpanning.hiddenCells).length;(g||x!==E||D!==H)&&e.current.setState(A=>h({},A,{rowSpanning:{spannedCells:C,hiddenCells:b,hiddenCellOriginMap:p}}))},[e,t.unstable_rowSpanning,n,o,r,l,s]),u=i.useRef(o),d=i.useRef(!0),f=i.useRef(!1);i.useEffect(()=>{const g=d.current;if(d.current&&(d.current=!1),n&&a.current&&ii(n,a.current)&&(a.current=n,f.current=!0),!g&&u.current!==o){ii(u.current,o)&&(c(f.current),f.current=!1),u.current=o;return}c()},[c,o,n,a])},GS=(e,t)=>{const n=Lb(e,t);return Tw(n,t),Ew(n),Ke($w,n,t),Ke(Fw,n,t),Ke(Nb,n,t),Ke(xw,n,t),Ke(Sw,n,t),Ke(ow,n,t),Ke(Ow,n,t),Ke(fw,n,t),Ke(Zb,n,t),Ke(_S,n,t),Ke(Ub,n,t),Ke(FS,n,t),Ke(uw,n,t),Ke(gS,n,t),Ke(zb,n,t),Ke(wS,n,t),Ke(ac,n,t),iw(n,t),kw(n,t),Bb(n,t),vw(n,t),LS(n,t),np(n),pS(n),SS(n,t),yw(n,t),rw(n,t),gw(n,t),nw(n,t),Hw(n,t),Wb(n,t),DS(n,t),dw(n,t),mS(n,t),_w(n,t),Vb(n),Kb(n,t),Jb(n,t),jb(n,t),Aw(n,t),Lw(n,t),hS(n),cc(n,t),n},RS={hooks:{useGridAriaAttributes:bb,useGridRowAriaAttributes:wb}},Ku=i.forwardRef(function(t,n){const r=fS(t),o=GS(r.apiRef,r);return v.jsx(Ru,{privateApiRef:o,configuration:RS,props:r,children:v.jsxs(kc,h({className:r.className,style:r.style,sx:r.sx,ref:n},r.forwardedProps,{children:[v.jsx(Tu,{}),v.jsx(Sc,{}),v.jsx(yc,{})]}))})}),$S=i.memo(Ku);Ku.propTypes={apiRef:V.shape({current:V.object.isRequired}),"aria-label":V.string,"aria-labelledby":V.string,autoHeight:V.bool,autoPageSize:V.bool,autosizeOnMount:V.bool,autosizeOptions:V.shape({columns:V.arrayOf(V.string),expand:V.bool,includeHeaders:V.bool,includeOutliers:V.bool,outliersFactor:V.number}),cellModesModel:V.object,checkboxSelection:V.bool,classes:V.object,clipboardCopyCellDelimiter:V.string,columnBufferPx:V.number,columnGroupHeaderHeight:V.number,columnGroupingModel:V.arrayOf(V.object),columnHeaderHeight:V.number,columns:V.arrayOf(V.object).isRequired,columnVisibilityModel:V.object,density:V.oneOf(["comfortable","compact","standard"]),disableAutosize:V.bool,disableColumnFilter:V.bool,disableColumnMenu:V.bool,disableColumnResize:V.bool,disableColumnSelector:V.bool,disableColumnSorting:V.bool,disableDensitySelector:V.bool,disableEval:V.bool,disableMultipleRowSelection:V.bool,disableRowSelectionOnClick:V.bool,disableVirtualization:V.bool,editMode:V.oneOf(["cell","row"]),estimatedRowCount:V.number,experimentalFeatures:V.shape({warnIfFocusStateIsNotSynced:V.bool}),filterDebounceMs:V.number,filterMode:V.oneOf(["client","server"]),filterModel:V.shape({items:V.arrayOf(V.shape({field:V.string.isRequired,id:V.oneOfType([V.number,V.string]),operator:V.string.isRequired,value:V.any})).isRequired,logicOperator:V.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:V.bool,quickFilterLogicOperator:V.oneOf(["and","or"]),quickFilterValues:V.array}),forwardedProps:V.object,getCellClassName:V.func,getDetailPanelContent:V.func,getEstimatedRowHeight:V.func,getRowClassName:V.func,getRowHeight:V.func,getRowId:V.func,getRowSpacing:V.func,hideFooter:V.bool,hideFooterPagination:V.bool,hideFooterSelectedRowCount:V.bool,ignoreDiacritics:V.bool,ignoreValueFormatterDuringExport:V.oneOfType([V.shape({clipboardExport:V.bool,csvExport:V.bool}),V.bool]),indeterminateCheckboxAction:V.oneOf(["deselect","select"]),initialState:V.object,isCellEditable:V.func,isRowSelectable:V.func,keepNonExistentRowsSelected:V.bool,loading:V.bool,localeText:V.object,logger:V.shape({debug:V.func.isRequired,error:V.func.isRequired,info:V.func.isRequired,warn:V.func.isRequired}),logLevel:V.oneOf(["debug","error","info","warn",!1]),nonce:V.string,onCellClick:V.func,onCellDoubleClick:V.func,onCellEditStart:V.func,onCellEditStop:V.func,onCellKeyDown:V.func,onCellModesModelChange:V.func,onClipboardCopy:V.func,onColumnHeaderClick:V.func,onColumnHeaderDoubleClick:V.func,onColumnHeaderEnter:V.func,onColumnHeaderLeave:V.func,onColumnHeaderOut:V.func,onColumnHeaderOver:V.func,onColumnOrderChange:V.func,onColumnResize:V.func,onColumnVisibilityModelChange:V.func,onColumnWidthChange:V.func,onDensityChange:V.func,onFilterModelChange:V.func,onMenuClose:V.func,onMenuOpen:V.func,onPaginationMetaChange:V.func,onPaginationModelChange:V.func,onPreferencePanelClose:V.func,onPreferencePanelOpen:V.func,onProcessRowUpdateError:V.func,onResize:V.func,onRowClick:V.func,onRowCountChange:V.func,onRowDoubleClick:V.func,onRowEditStart:V.func,onRowEditStop:V.func,onRowModesModelChange:V.func,onRowSelectionModelChange:V.func,onSortModelChange:V.func,onStateChange:V.func,pageSizeOptions:V.arrayOf(V.oneOfType([V.number,V.shape({label:V.string.isRequired,value:V.number.isRequired})]).isRequired),pagination:V.oneOf([!0]),paginationMeta:V.shape({hasNextPage:V.bool}),paginationMode:V.oneOf(["client","server"]),paginationModel:V.shape({page:V.number.isRequired,pageSize:V.number.isRequired}),processRowUpdate:V.func,resizeThrottleMs:V.number,rowBufferPx:V.number,rowCount:V.number,rowHeight:V.number,rowModesModel:V.object,rowPositionsDebounceMs:V.number,rows:V.arrayOf(V.object),rowSelection:V.bool,rowSelectionModel:V.oneOfType([V.arrayOf(V.oneOfType([V.number,V.string]).isRequired),V.number,V.string]),rowSpacingType:V.oneOf(["border","margin"]),scrollbarSize:V.number,showCellVerticalBorder:V.bool,showColumnVerticalBorder:V.bool,slotProps:V.object,slots:V.object,sortingMode:V.oneOf(["client","server"]),sortingOrder:V.arrayOf(V.oneOf(["asc","desc"])),sortModel:V.arrayOf(V.shape({field:V.string.isRequired,sort:V.oneOf(["asc","desc"])})),sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),unstable_rowSpanning:V.bool};/** + * @mui/x-data-grid v7.18.0 + * + * @license MIT + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */const AS=Object.freeze(Object.defineProperty({__proto__:null,COMFORTABLE_DENSITY_FACTOR:zi,COMPACT_DENSITY_FACTOR:ji,DATA_GRID_PROPS_DEFAULT_VALUES:No,DEFAULT_GRID_AUTOSIZE_OPTIONS:bc,DEFAULT_GRID_COL_TYPE_KEY:Ja,DataGrid:$S,EMPTY_PINNED_COLUMN_FIELDS:Ro,EMPTY_RENDER_CONTEXT:Fl,GRID_ACTIONS_COLUMN_TYPE:Jn,GRID_ACTIONS_COL_DEF:ra,GRID_BOOLEAN_COL_DEF:fl,GRID_CHECKBOX_SELECTION_COL_DEF:cn,GRID_CHECKBOX_SELECTION_FIELD:Ht,GRID_COLUMN_MENU_SLOTS:du,GRID_COLUMN_MENU_SLOT_PROPS:fu,GRID_DATETIME_COL_DEF:Na,GRID_DATE_COL_DEF:Va,GRID_DEFAULT_LOCALE_TEXT:_i,GRID_EXPERIMENTAL_ENABLED:qf,GRID_NUMERIC_COL_DEF:Wa,GRID_ROOT_GROUP_ID:et,GRID_SINGLE_SELECT_COL_DEF:Qa,GRID_STRING_COL_DEF:Ct,GridActionsCell:na,GridActionsCellItem:cp,GridAddIcon:jr,GridApiContext:tl,GridArrowDownwardIcon:Gr,GridArrowUpwardIcon:Lr,GridBody:Sc,GridBooleanCell:fa,GridCell:Ec,GridCellCheckboxForwardRef:ba,GridCellCheckboxRenderer:wa,GridCellEditStartReasons:Ft,GridCellEditStopReasons:mt,GridCellModes:xe,GridCheckCircleIcon:Jp,GridCheckIcon:Qc,GridClearIcon:tu,GridCloseIcon:_o,GridColumnHeaderFilterIconButton:Ac,GridColumnHeaderItem:Gc,GridColumnHeaderMenu:Oc,GridColumnHeaderSeparator:_c,GridColumnHeaderSeparatorSides:fr,GridColumnHeaderSortIcon:$c,GridColumnHeaderTitle:Hc,GridColumnHeaders:Bu,GridColumnIcon:Vc,GridColumnMenu:mu,GridColumnMenuColumnsItem:au,GridColumnMenuContainer:lu,GridColumnMenuFilterItem:cu,GridColumnMenuHideItem:su,GridColumnMenuManageItem:iu,GridColumnMenuSortItem:uu,GridColumnsManagement:Ol,GridColumnsPanel:hu,GridContextProvider:Ru,GridCsvExportMenuItem:Mu,GridDeleteForeverIcon:nu,GridDeleteIcon:Zp,GridDragIcon:zr,GridEditBooleanCell:ma,GridEditDateCell:$a,GridEditInputCell:Ui,GridEditModes:vt,GridEditSingleSelectCell:qa,GridExpandMoreIcon:$r,GridFilterAltIcon:Ar,GridFilterForm:Vr,GridFilterInputBoolean:pa,GridFilterInputDate:Jt,GridFilterInputMultipleSingleSelect:Xa,GridFilterInputMultipleValue:al,GridFilterInputSingleSelect:Tr,GridFilterInputValue:ct,GridFilterListIcon:jc,GridFilterPanel:Su,GridFooter:Du,GridFooterContainer:Dc,GridFooterPlaceholder:yc,GridGenericColumnMenu:gu,GridHeader:Tu,GridHeaderCheckbox:Ra,GridKeyboardArrowRight:Rr,GridLoadIcon:Xc,GridLoadingOverlay:Ou,GridLogicOperator:Ze,GridMenu:Qn,GridMenuIcon:Qp,GridMoreVertIcon:Jc,GridNoRowsOverlay:Hu,GridOverlay:dr,GridOverlays:gc,GridPagination:_u,GridPanel:Cu,GridPanelContent:bu,GridPanelFooter:wu,GridPanelHeader:kC,GridPanelWrapper:Tl,GridPinnedColumnPosition:Me,GridPreferencePanelsValue:bt,GridPrintExportMenuItem:Pu,GridRemoveIcon:Kc,GridRoot:kc,GridRow:Gu,GridRowCount:Lu,GridRowEditStartReasons:Ot,GridRowEditStopReasons:St,GridRowModes:ke,GridSaveAltIcon:Yc,GridSearchIcon:zc,GridSelectedRowCount:ku,GridSeparatorIcon:Nc,GridSignature:ht,GridSkeletonCell:Fc,GridTableRowsIcon:Uc,GridToolbar:JC,GridToolbarColumnsButton:yu,GridToolbarContainer:Tc,GridToolbarDensitySelector:xu,GridToolbarExport:Eu,GridToolbarExportContainer:Iu,GridToolbarFilterButton:vu,GridToolbarQuickFilter:Fu,GridTripleDotsVerticalIcon:qc,GridViewColumnIcon:eu,GridViewHeadlineIcon:Bc,GridViewStreamIcon:Wc,GridVisibilityOffIcon:Zc,checkGridRowIdIsValid:aa,createUseGridApiEventHandler:Li,getDataGridUtilityClass:ue,getDefaultGridFilterModel:In,getGridBooleanOperators:Ca,getGridDateOperators:vl,getGridDefaultColumnTypes:Za,getGridNumericOperators:Ua,getGridNumericQuickFilterFn:Ba,getGridSingleSelectOperators:Ya,getGridStringOperators:ta,getGridStringQuickFilterFn:ea,gridClasses:k,gridColumnDefinitionsSelector:pt,gridColumnFieldsSelector:kt,gridColumnGroupingSelector:ro,gridColumnGroupsHeaderMaxDepthSelector:_n,gridColumnGroupsHeaderStructureSelector:oc,gridColumnGroupsLookupSelector:Pl,gridColumnGroupsUnwrappedModelSelector:Ml,gridColumnLookupSelector:Pt,gridColumnMenuSelector:zn,gridColumnPositionsSelector:Rt,gridColumnResizeSelector:Cc,gridColumnVisibilityModelSelector:ut,gridColumnsStateSelector:xt,gridColumnsTotalWidthSelector:Jo,gridDataRowIdsSelector:An,gridDateComparator:sl,gridDateFormatter:ja,gridDateTimeFormatter:za,gridDensityFactorSelector:Tn,gridDensitySelector:zt,gridDimensionsSelector:nt,gridEditRowsStateSelector:Xe,gridExpandedRowCountSelector:rr,gridExpandedSortedRowEntriesSelector:$t,gridExpandedSortedRowIdsSelector:tn,gridFilterActiveItemsLookupSelector:ka,gridFilterActiveItemsSelector:wl,gridFilterModelSelector:We,gridFilterableColumnDefinitionsSelector:ol,gridFilterableColumnLookupSelector:Ni,gridFilteredDescendantCountLookupSelector:fm,gridFilteredDescendantRowCountSelector:gm,gridFilteredRowCountSelector:Fa,gridFilteredRowsLookupSelector:hl,gridFilteredSortedRowEntriesSelector:pl,gridFilteredSortedRowIdsSelector:Cl,gridFilteredSortedTopLevelRowEntriesSelector:bl,gridFilteredTopLevelRowCountSelector:lr,gridFocusCellSelector:st,gridFocusColumnGroupHeaderSelector:Un,gridFocusColumnHeaderFilterSelector:um,gridFocusColumnHeaderSelector:Sa,gridFocusStateSelector:to,gridHasColSpanSelector:Bi,gridHeaderFilteringEditFieldSelector:tc,gridHeaderFilteringEnabledSelector:ec,gridHeaderFilteringMenuSelector:nc,gridHeaderFilteringStateSelector:ir,gridNumberComparator:ll,gridPageCountSelector:yl,gridPageSelector:_a,gridPageSizeSelector:La,gridPaginatedVisibleSortedGridRowEntriesSelector:Ga,gridPaginatedVisibleSortedGridRowIdsSelector:xl,gridPaginationMetaSelector:xn,gridPaginationModelSelector:Je,gridPaginationRowCountSelector:Zt,gridPaginationRowRangeSelector:sr,gridPaginationSelector:oo,gridPanelClasses:pu,gridPinnedColumnsSelector:Vi,gridPreferencePanelStateSelector:Wt,gridQuickFilterValuesSelector:Pa,gridRenderContextColumnsSelector:ic,gridRenderContextSelector:so,gridResizingColumnFieldSelector:Hh,gridRowCountSelector:Zn,gridRowGroupingNameSelector:ia,gridRowMaximumTreeDepthSelector:eo,gridRowSelectionStateSelector:it,gridRowTreeDepthsSelector:Dr,gridRowTreeSelector:rt,gridRowsDataRowIdToIdLookupSelector:Bn,gridRowsLoadingSelector:la,gridRowsLookupSelector:_t,gridRowsMetaSelector:un,gridSortColumnLookupSelector:Ma,gridSortModelSelector:at,gridSortedRowEntriesSelector:nr,gridSortedRowIdsSelector:tr,gridStringOrNumberComparator:Ki,gridTabIndexCellSelector:er,gridTabIndexColumnGroupHeaderSelector:ya,gridTabIndexColumnHeaderFilterSelector:dm,gridTabIndexColumnHeaderSelector:ml,gridTabIndexStateSelector:no,gridTopLevelRowCountSelector:sa,gridVirtualizationColumnEnabledSelector:ar,gridVirtualizationEnabledSelector:Km,gridVirtualizationRowEnabledSelector:sc,gridVirtualizationSelector:lo,gridVisibleColumnDefinitionsSelector:Ne,gridVisibleColumnFieldsSelector:sn,gridVisiblePinnedColumnDefinitionsSelector:On,gridVisibleRowsLookupSelector:Ea,isAutogeneratedRow:Qg,isLeaf:cl,renderActionsCell:oa,renderBooleanCell:ga,renderEditBooleanCell:ha,renderEditDateCell:Il,renderEditInputCell:Wi,renderEditSingleSelectCell:Ka,selectedGridRowsCountSelector:xa,selectedGridRowsSelector:va,selectedIdsLookupSelector:Pn,unstable_resetCleanupTracking:Qf,useFirstRender:Hn,useGridApiContext:ie,useGridApiEventHandler:ee,useGridApiMethod:ce,useGridApiOptionHandler:De,useGridApiRef:Rf,useGridLogger:Ue,useGridNativeEventListener:Sl,useGridRootProps:Z,useGridSelector:U,useGridVirtualization:cc,useOnMount:Yn,useRunOnce:Da,virtualizationStateInitializer:ac},Symbol.toStringTag,{value:"Module"})),jS=Uo(AS);var zS=Y&&Y.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),VS=Y&&Y.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),NS=Y&&Y.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&zS(t,e,n);return VS(t,e),t},BS=Y&&Y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(el,"__esModule",{value:!0});el.default=XS;const Tt=NS(i),US=It,ai=jS,Pr=Dt,ci=rn(),WS=BS(Fn),qS=qt,KS=(0,US.makeStyles)()(e=>({margin:{marginBottom:e.spacing(4)},cell:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}));function XS({value:e,prefix:t,name:n}){const{classes:r}=KS(),[o,l]=(0,Tt.useState)(!1),s=Object.keys(e[0]).sort(),a=new Set(s),c=Object.entries(e).map(([f,g])=>{const{id:m,...C}=g;return{id:f,identifier:m,...C}});for(const f of e)for(const g of Object.keys(f))a.add(g);let u;a.has("id")?(a.delete("id"),u=["identifier",...a]):u=[...a];const d=u.map(f=>(0,ci.measureGridWidth)(c.map(g=>g[f])));return a.size{l(f.target.checked)}}),label:Tt.default.createElement(Pr.Typography,{variant:"body2"},"Show options")}),Tt.default.createElement(ai.DataGrid,{autoHeight:!0,disableRowSelectionOnClick:!0,rows:c,rowHeight:20,columnHeaderHeight:35,hideFooter:c.length<25,slots:{toolbar:o?ai.GridToolbar:null},slotProps:{toolbar:{printOptions:{disableToolbarButton:!0}}},columns:u.map((f,g)=>({field:f,renderCell:m=>{const C=m.value;return Tt.default.createElement("div",{className:r.cell},Tt.default.createElement(qS.SanitizedHTML,{html:(0,ci.getStr)(C||"")}))},width:d[g]}))})):null}var To={},ui;function YS(){if(ui)return To;ui=1;var e=Y&&Y.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(To,"__esModule",{value:!0}),To.default=c;const t=e(i),n=e(Wo),r=It,o=e(qr()),l=e(Fn),s=e(Xn),a=(0,r.makeStyles)()(u=>({field:{display:"flex",flexWrap:"wrap"},fieldSubvalue:{wordBreak:"break-word",maxHeight:300,padding:u.spacing(.5),border:`1px solid ${u.palette.action.selected}`,boxSizing:"border-box",overflow:"auto"}}));function c({name:u,value:d,description:f,prefix:g=[]}){const{classes:m}=a();return d.length===1?(0,n.default)(d[0])?t.default.createElement(o.default,{attributes:d[0],prefix:[...g,u]}):t.default.createElement("div",{className:m.field},t.default.createElement(l.default,{prefix:g,description:f,name:u}),t.default.createElement(s.default,{value:d[0]})):d.every(C=>(0,n.default)(C))?t.default.createElement(t.default.Fragment,null,d.map((C,b)=>t.default.createElement(o.default,{key:`${JSON.stringify(C)}-${b}`,attributes:C,prefix:[...g,`${u}-${b}`]}))):t.default.createElement("div",{className:m.field},t.default.createElement(l.default,{prefix:g,description:f,name:u}),d.map((C,b)=>t.default.createElement("div",{key:`${JSON.stringify(C)}-${b}`,className:m.fieldSubvalue},t.default.createElement(s.default,{value:C}))))}return To}var Al={},jl=Y&&Y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Al,"__esModule",{value:!0});Al.default=ty;const Er=jl(i),QS=jl(Fn),JS=It,ZS=jl(Xn),ey=(0,JS.makeStyles)()({field:{display:"flex",flexWrap:"wrap"}});function ty({value:e,prefix:t,name:n}){const{classes:r}=ey(),{uri:o,baseUri:l=""}=e;let s;try{s=new URL(o,l).href}catch{s=o}return Er.default.createElement("div",{className:r.field},Er.default.createElement(QS.default,{prefix:t,name:n}),Er.default.createElement(ZS.default,{value:s}))}var di;function qr(){if(di)return Fo;di=1;var e=Y&&Y.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.default=f;const t=e(i),n=e(Wo),r=ln,o=rn(),l=e(el),s=e(YS()),a=e(Al),c=e(Qo),u=170,d=["__jbrowsefmt","length","position","subfeatures","uniqueId","exonFrames","parentId","thickStart","thickEnd"];function f(g){const{attributes:m,omit:C=[],omitSingleLevel:b=[],descriptions:p,formatter:S=y=>y,hideUris:x,prefix:D=[]}=g,E=new Set([...C,...d,...b]),{__jbrowsefmt:H,...G}=m,A={...G,...H},F=(0,r.generateMaxWidth)(Object.entries(A).filter(([y,_])=>_!==void 0&&!E.has(y)),D);return t.default.createElement(t.default.Fragment,null,Object.entries(A).filter(([y,_])=>_!==void 0&&!E.has(y)).map(([y,_])=>{const $=(0,r.accessNested)([...D,y],p);if(Array.isArray(_))return _.length>1&&_.every(O=>(0,n.default)(O))?t.default.createElement(l.default,{key:y,name:y,prefix:D,value:_}):t.default.createElement(s.default,{key:y,name:y,value:_,description:$,prefix:D});if((0,n.default)(_)){const{omitSingleLevel:O,...P}=g;return(0,o.isUriLocation)(_)?x?null:t.default.createElement(a.default,{key:y,name:y,prefix:D,value:_}):t.default.createElement(f,{key:y,...P,attributes:_,descriptions:p,prefix:[...D,y]})}else return t.default.createElement(c.default,{key:y,name:y,value:S(_,y),description:$,prefix:D,width:Math.min(F,u)})}))}return Fo}(function(e){var t=Y&&Y.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(e,"__esModule",{value:!0}),e.Attributes=e.BaseAttributes=e.BaseCoreDetails=void 0,e.BaseCard=p,e.FeatureDetails=H;const n=t(i),r=kd,o=Dt,l=It,s=dt,a=t(Ko),c=rn(),u=qt,d=t(xi),f=t(Qo),g=t(qr()),m=ln,C=["name","start","end","strand","refName","description","type"],b=(0,l.makeStyles)()(F=>({expansionPanelDetails:{display:"block",padding:F.spacing(1)},icon:{color:F.palette.tertiary.contrastText||"#fff"}}));function p({children:F,title:y,defaultExpanded:_=!0}){const{classes:$}=b();return n.default.createElement(o.Accordion,{defaultExpanded:_},n.default.createElement(o.AccordionSummary,{expandIcon:n.default.createElement(a.default,{className:$.icon})},n.default.createElement(o.Typography,{variant:"button"},y)),n.default.createElement(o.AccordionDetails,{className:$.expansionPanelDetails},F))}function S(F){const{feature:y}=F,_=y.strand,$={"-1":"-",0:"",1:"+"},O=$[_]?`(${$[_]})`:"",P=(0,c.assembleLocString)(y);return n.default.createElement(n.default.Fragment,null,`${P} ${O}`)}function x(F){const{feature:y}=F,_=y,$={..._,..._.__jbrowsefmt},{start:O,end:P}=$,L={...$,length:(0,c.toLocale)(P-O)},I={description:"Description",name:"Name",length:"Length",type:"Type"};return n.default.createElement(n.default.Fragment,null,n.default.createElement(f.default,{name:"Position",value:n.default.createElement(S,{...F,feature:$})}),Object.entries(I).map(([M,w])=>[w,L[M]]).filter(([,M])=>M!=null).map(([M,w])=>n.default.createElement(f.default,{key:M,name:M,value:w})))}const D=F=>{const{title:y="Primary data"}=F;return n.default.createElement(p,{...F,title:y},n.default.createElement(x,{...F}))};e.BaseCoreDetails=D;const E=F=>{const{feature:y}=F;return n.default.createElement(p,{...F,title:"Attributes"},n.default.createElement(g.default,{...F,attributes:y}))};e.BaseAttributes=E;function H(F){const{omit:y=[],model:_,feature:$,depth:O=0}=F,{maxDepth:P}=_,{mate:L,name:I="",id:M="",type:w="",subfeatures:j,uniqueId:T}=$,R=(0,c.getEnv)(_).pluginManager,z=(0,c.getSession)(_),N=R.evaluateExtensionPoint("Core-extraFeaturePanel",null,{session:z,feature:$,model:_}),B=L;return n.default.createElement(p,{title:(0,m.generateTitle)(I,M,w)},n.default.createElement(o.Typography,null,"Core details"),n.default.createElement(x,{...F}),B?n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Divider,null),n.default.createElement(o.Typography,null,"Mate details"),n.default.createElement(x,{...F,feature:{...B,start:B.start,end:B.end,refName:B.refName,uniqueId:`${T}-mate`}})):null,n.default.createElement(o.Divider,null),n.default.createElement(o.Typography,null,"Attributes"),n.default.createElement(g.default,{attributes:$,...F,omit:y,omitSingleLevel:C}),n.default.createElement(r.ErrorBoundary,{FallbackComponent:W=>n.default.createElement(u.ErrorMessage,{error:W.error})},n.default.createElement(d.default,{...F})),N?n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Divider,null),n.default.createElement(p,{title:N.name},n.default.createElement(N.Component,{...F}))):null,On.default.createElement(H,{key:JSON.stringify(W),feature:{...W,uniqueId:`${T}_${X}`},model:_,depth:O+1}))):null)}const G=(0,s.observer)(function({model:F}){const{error:y,featureData:_}=F;if(y)return n.default.createElement(u.ErrorMessage,{error:y});if(!_)return null;const $=JSON.parse(JSON.stringify(_,(O,P)=>P===void 0?null:P));return(0,m.isEmpty)($)?null:n.default.createElement(H,{model:F,feature:$})});e.default=G;var A=qr();Object.defineProperty(e,"Attributes",{enumerable:!0,get:function(){return t(A).default}})})(Gd);var ny=gi();const oy=fi(ny),ry=Dd()({textAreaFont:{fontFamily:"Courier New",wordWrap:"break-word"},dialogContent:{background:"lightgrey",margin:4,minWidth:"80em"}});function iy({str:e}){const{classes:t}=ry(),[n,r]=i.useState(!1),[o,l]=i.useState(!1),[s,a]=i.useState(!1),c=e.map(([u,d])=>[u,o?d:d.replaceAll("-","")]).filter(u=>s?!0:!!u[1]).map(([u,d])=>`>${u} +${o?d:d.replaceAll("-","")}`).join(` +`);return fn.createElement(fn.Fragment,null,fn.createElement(bi,{color:"primary",variant:"contained",onClick:()=>{oy(c),r(!0),setTimeout(()=>{r(!1)},500)}},n?"Copied!":"Copy to clipboard"),fn.createElement(Wl,{label:"Show gaps",checked:o,onChange:()=>{l(!o)}}),fn.createElement(Wl,{label:"Show empty",checked:s,onChange:()=>{a(!s)}}),fn.createElement(Yr,{variant:"outlined",multiline:!0,className:t.dialogContent,minRows:5,maxRows:10,fullWidth:!0,value:c,InputProps:{readOnly:!0,classes:{input:t.textAreaFont}}}))}export{Gd as B,iy as S}; +//# sourceMappingURL=SequenceTextArea-9Ex0cwEv.js.map diff --git a/assets/SequenceTextArea-9Ex0cwEv.js.map b/assets/SequenceTextArea-9Ex0cwEv.js.map new file mode 100644 index 0000000..ff70e3d --- /dev/null +++ b/assets/SequenceTextArea-9Ex0cwEv.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SequenceTextArea-9Ex0cwEv.js","sources":["../../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../../node_modules/prop-types/factoryWithThrowingShims.js","../../../node_modules/prop-types/index.js","../../../node_modules/@mui/icons-material/ExpandMore.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/hooks.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/util.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/util.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/SequenceFeatureDetails/index.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/FieldName.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/util.js","../../../node_modules/@mui/x-data-grid/components/GridApiContext.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useGridApiContext.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useGridApiRef.js","../../../node_modules/@mui/x-data-grid/context/GridRootPropsContext.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useGridRootProps.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/composeClasses/composeClasses.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/formatMuiErrorMessage/formatMuiErrorMessage.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/capitalize/capitalize.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/debounce/debounce.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/ownerDocument/ownerDocument.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/ownerWindow/ownerWindow.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/setRef/setRef.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/useId/useId.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/useForkRef/useForkRef.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/useLazyRef/useLazyRef.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/useOnMount/useOnMount.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/useTimeout/useTimeout.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/ClassNameGenerator/ClassNameGenerator.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js","../../../node_modules/@mui/x-data-grid/node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js","../../../node_modules/@mui/x-internals/fastObjectShallowCompare/fastObjectShallowCompare.js","../../../node_modules/@mui/x-internals/fastMemo/fastMemo.js","../../../node_modules/@mui/x-data-grid/constants/envConstants.js","../../../node_modules/@mui/x-data-grid/constants/localeTextConstants.js","../../../node_modules/@mui/x-data-grid/constants/gridClasses.js","../../../node_modules/@mui/x-data-grid/utils/cleanupTracking/TimerBasedCleanupTracking.js","../../../node_modules/@mui/x-data-grid/utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useGridApiEventHandler.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useGridSelector.js","../../../node_modules/@mui/x-data-grid/hooks/features/dimensions/gridDimensionsSelectors.js","../../../node_modules/reselect/dist/reselect.mjs","../../../node_modules/@mui/x-data-grid/utils/createSelector.js","../../../node_modules/@mui/x-data-grid/hooks/features/density/densitySelector.js","../../../node_modules/@mui/x-data-grid/hooks/features/columns/gridColumnsInterfaces.js","../../../node_modules/@mui/x-data-grid/hooks/core/gridCoreSelector.js","../../../node_modules/@mui/x-data-grid/hooks/features/columns/gridColumnsSelector.js","../../../node_modules/@mui/x-data-grid/components/cell/GridEditInputCell.js","../../../node_modules/@mui/x-data-grid/hooks/features/sorting/gridSortingUtils.js","../../../node_modules/@mui/x-data-grid/components/panel/filterPanel/GridFilterInputValue.js","../../../node_modules/@mui/x-data-grid/utils/utils.js","../../../node_modules/@mui/x-data-grid/components/panel/filterPanel/GridFilterInputMultipleValue.js","../../../node_modules/@mui/x-data-grid/models/gridEditRowModel.js","../../../node_modules/@mui/x-data-grid/models/gridFilterItem.js","../../../node_modules/@mui/x-data-grid/models/params/gridEditCellParams.js","../../../node_modules/@mui/x-data-grid/models/params/gridRowParams.js","../../../node_modules/@mui/x-data-grid/models/gridColumnGrouping.js","../../../node_modules/@mui/x-data-grid/hooks/features/filter/gridFilterState.js","../../../node_modules/@mui/x-data-grid/utils/getPublicApiRef.js","../../../node_modules/@mui/x-data-grid/hooks/features/filter/gridFilterUtils.js","../../../node_modules/@mui/x-data-grid/colDef/gridStringOperators.js","../../../node_modules/@mui/x-data-grid/colDef/gridStringColDef.js","../../../node_modules/@mui/x-data-grid/components/menu/GridMenu.js","../../../node_modules/@mui/x-data-grid/components/cell/GridActionsCell.js","../../../node_modules/@mui/x-data-grid/colDef/gridActionsColDef.js","../../../node_modules/@mui/x-data-grid/hooks/features/rows/gridRowsSelector.js","../../../node_modules/@mui/x-data-grid/hooks/features/rows/gridRowsUtils.js","../../../node_modules/@mui/x-data-grid/components/cell/GridBooleanCell.js","../../../node_modules/@mui/x-data-grid/components/cell/GridEditBooleanCell.js","../../../node_modules/@mui/x-data-grid/components/panel/filterPanel/GridFilterInputBoolean.js","../../../node_modules/@mui/x-data-grid/colDef/gridBooleanOperators.js","../../../node_modules/@mui/x-data-grid/colDef/gridBooleanColDef.js","../../../node_modules/@mui/x-data-grid/components/columnSelection/GridCellCheckboxRenderer.js","../../../node_modules/@mui/x-data-grid/hooks/features/rowSelection/utils.js","../../../node_modules/@mui/x-data-grid/hooks/features/focus/gridFocusStateSelector.js","../../../node_modules/@mui/x-data-grid/hooks/features/rowSelection/gridRowSelectionSelector.js","../../../node_modules/@mui/x-data-grid/hooks/features/sorting/gridSortingSelector.js","../../../node_modules/@mui/x-data-grid/hooks/features/filter/gridFilterSelector.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useGridApiMethod.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useGridLogger.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useGridNativeEventListener.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useFirstRender.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useRunOnce.js","../../../node_modules/@mui/x-data-grid/hooks/features/pagination/gridPaginationUtils.js","../../../node_modules/@mui/x-data-grid/hooks/features/pagination/gridPaginationSelector.js","../../../node_modules/@mui/x-data-grid/components/columnSelection/GridHeaderCheckbox.js","../../../node_modules/@mui/x-data-grid/colDef/gridCheckboxSelectionColDef.js","../../../node_modules/@mui/x-data-grid/components/panel/filterPanel/GridFilterInputDate.js","../../../node_modules/@mui/x-data-grid/colDef/gridDateOperators.js","../../../node_modules/@mui/x-data-grid/components/cell/GridEditDateCell.js","../../../node_modules/@mui/x-data-grid/colDef/gridDateColDef.js","../../../node_modules/@mui/x-data-grid/colDef/gridNumericOperators.js","../../../node_modules/@mui/x-data-grid/colDef/gridNumericColDef.js","../../../node_modules/@mui/x-data-grid/components/panel/filterPanel/filterPanelUtils.js","../../../node_modules/@mui/x-data-grid/components/cell/GridEditSingleSelectCell.js","../../../node_modules/@mui/x-data-grid/components/panel/filterPanel/GridFilterInputSingleSelect.js","../../../node_modules/@mui/x-data-grid/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js","../../../node_modules/@mui/x-data-grid/colDef/gridSingleSelectOperators.js","../../../node_modules/@mui/x-data-grid/colDef/gridSingleSelectColDef.js","../../../node_modules/@mui/x-data-grid/colDef/gridDefaultColumnTypes.js","../../../node_modules/@mui/x-data-grid/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js","../../../node_modules/@mui/x-data-grid/hooks/features/columnGrouping/gridColumnGroupsSelector.js","../../../node_modules/@mui/x-data-grid/hooks/features/columns/gridColumnsUtils.js","../../../node_modules/@mui/x-data-grid/components/GridScrollArea.js","../../../node_modules/@mui/x-internals/node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js","../../../node_modules/@mui/x-internals/useResizeObserver/useResizeObserver.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useGridPrivateApiContext.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useGridVisibleRows.js","../../../node_modules/@mui/x-data-grid/utils/platform.js","../../../node_modules/@mui/x-data-grid/hooks/features/rows/gridRowsMetaSelector.js","../../../node_modules/@mui/x-data-grid/hooks/features/virtualization/gridVirtualizationSelectors.js","../../../node_modules/@mui/x-data-grid/hooks/features/virtualization/useGridVirtualization.js","../../../node_modules/@mui/x-data-grid/hooks/features/rows/gridRowSpanningSelectors.js","../../../node_modules/@mui/x-data-grid/hooks/features/virtualization/useGridVirtualScroller.js","../../../node_modules/@mui/x-data-grid/hooks/features/overlays/useGridOverlays.js","../../../node_modules/@mui/x-data-grid/components/base/GridOverlays.js","../../../node_modules/@mui/x-data-grid/hooks/features/columnMenu/columnMenuSelector.js","../../../node_modules/@mui/x-data-grid/components/GridHeaders.js","../../../node_modules/@mui/x-data-grid/components/GridConfigurationContext.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useGridConfiguration.js","../../../node_modules/@mui/x-data-grid/components/virtualization/GridMainContainer.js","../../../node_modules/@mui/x-data-grid/components/virtualization/GridTopContainer.js","../../../node_modules/@mui/x-data-grid/components/virtualization/GridBottomContainer.js","../../../node_modules/@mui/x-data-grid/components/virtualization/GridVirtualScrollerContent.js","../../../node_modules/@mui/x-data-grid/components/virtualization/GridVirtualScrollerFiller.js","../../../node_modules/@mui/x-data-grid/components/virtualization/GridVirtualScrollerRenderZone.js","../../../node_modules/@mui/x-data-grid/hooks/features/columnResize/columnResizeSelector.js","../../../node_modules/@mui/x-data-grid/hooks/features/columnResize/gridColumnResizeApi.js","../../../node_modules/@mui/x-data-grid/hooks/features/editing/gridEditingSelectors.js","../../../node_modules/@mui/x-data-grid/hooks/features/preferencesPanel/gridPreferencePanelSelector.js","../../../node_modules/@mui/x-data-grid/hooks/features/preferencesPanel/gridPreferencePanelsValue.js","../../../node_modules/@mui/x-data-grid/components/virtualization/GridVirtualScrollbar.js","../../../node_modules/@mui/x-data-grid/components/virtualization/GridVirtualScroller.js","../../../node_modules/@mui/x-data-grid/components/base/GridFooterPlaceholder.js","../../../node_modules/@mui/x-data-grid/utils/doesSupportPreventScroll.js","../../../node_modules/@mui/x-data-grid/utils/domUtils.js","../../../node_modules/@mui/x-data-grid/hooks/features/rows/useGridParamsApi.js","../../../node_modules/@mui/x-data-grid/utils/cellBorderUtils.js","../../../node_modules/@mui/x-data-grid/components/cell/GridCell.js","../../../node_modules/@mui/x-data-grid/components/cell/GridActionsCellItem.js","../../../node_modules/@mui/x-data-grid/components/cell/GridSkeletonCell.js","../../../node_modules/@mui/x-data-grid/components/containers/GridRootStyles.js","../../../node_modules/@mui/x-data-grid/components/containers/GridRoot.js","../../../node_modules/@mui/x-data-grid/components/containers/GridFooterContainer.js","../../../node_modules/@mui/x-data-grid/components/containers/GridOverlay.js","../../../node_modules/@mui/x-data-grid/components/containers/GridToolbarContainer.js","../../../node_modules/@mui/x-data-grid/components/columnHeaders/ColumnHeaderMenuIcon.js","../../../node_modules/@mui/x-data-grid/components/menu/columnMenu/GridColumnHeaderMenu.js","../../../node_modules/@mui/x-data-grid/components/columnHeaders/GridColumnHeaderTitle.js","../../../node_modules/@mui/x-data-grid/components/columnHeaders/GridColumnHeaderSeparator.js","../../../node_modules/@mui/x-data-grid/components/columnHeaders/GridGenericColumnHeaderItem.js","../../../node_modules/@mui/x-data-grid/components/columnHeaders/GridColumnHeaderItem.js","../../../node_modules/@mui/x-data-grid/components/columnHeaders/GridIconButtonContainer.js","../../../node_modules/@mui/x-data-grid/components/columnHeaders/GridColumnHeaderSortIcon.js","../../../node_modules/@mui/x-data-grid/components/columnHeaders/GridColumnHeaderFilterIconButton.js","../../../node_modules/@mui/x-data-grid/material/icons/index.js","../../../node_modules/@mui/x-data-grid/utils/keyboardUtils.js","../../../node_modules/@mui/x-data-grid/components/menu/columnMenu/GridColumnMenuContainer.js","../../../node_modules/@mui/x-data-grid/hooks/features/columnMenu/useGridColumnMenuSlots.js","../../../node_modules/@mui/x-data-grid/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js","../../../node_modules/@mui/x-data-grid/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js","../../../node_modules/@mui/x-data-grid/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.js","../../../node_modules/@mui/x-data-grid/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js","../../../node_modules/@mui/x-data-grid/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js","../../../node_modules/@mui/x-data-grid/components/menu/columnMenu/GridColumnMenu.js","../../../node_modules/@mui/x-data-grid/components/panel/GridPanelWrapper.js","../../../node_modules/@mui/x-data-grid/components/columnsManagement/utils.js","../../../node_modules/@mui/x-data-grid/components/columnsManagement/GridColumnsManagement.js","../../../node_modules/@mui/x-data-grid/components/panel/GridColumnsPanel.js","../../../node_modules/@mui/x-data-grid/components/panel/GridPanel.js","../../../node_modules/@mui/x-data-grid/components/panel/GridPanelContent.js","../../../node_modules/@mui/x-data-grid/components/panel/GridPanelFooter.js","../../../node_modules/@mui/x-data-grid/components/panel/GridPanelHeader.js","../../../node_modules/@mui/x-data-grid/components/panel/filterPanel/GridFilterForm.js","../../../node_modules/@mui/x-data-grid/components/panel/filterPanel/GridFilterPanel.js","../../../node_modules/@mui/x-data-grid/components/toolbar/GridToolbarColumnsButton.js","../../../node_modules/@mui/x-data-grid/components/toolbar/GridToolbarDensitySelector.js","../../../node_modules/@mui/x-data-grid/components/toolbar/GridToolbarFilterButton.js","../../../node_modules/@mui/x-data-grid/components/toolbar/GridToolbarExportContainer.js","../../../node_modules/@mui/x-data-grid/components/toolbar/GridToolbarExport.js","../../../node_modules/@mui/x-data-grid/components/toolbar/GridToolbarQuickFilter.js","../../../node_modules/@mui/x-data-grid/components/toolbar/GridToolbar.js","../../../node_modules/@mui/x-data-grid/components/GridSelectedRowCount.js","../../../node_modules/@mui/x-data-grid/components/GridFooter.js","../../../node_modules/@mui/x-data-grid/components/panel/GridPreferencesPanel.js","../../../node_modules/@mui/x-data-grid/components/GridHeader.js","../../../node_modules/@mui/x-data-grid/internals/utils/getPinnedCellOffset.js","../../../node_modules/@mui/x-data-grid/components/GridScrollbarFillerCell.js","../../../node_modules/@mui/x-data-grid/components/GridSkeletonLoadingOverlay.js","../../../node_modules/@mui/x-data-grid/components/GridLoadingOverlay.js","../../../node_modules/@mui/x-data-grid/components/GridNoRowsOverlay.js","../../../node_modules/@mui/x-data-grid/components/GridPagination.js","../../../node_modules/@mui/x-data-grid/components/GridRowCount.js","../../../node_modules/@mui/x-data-grid/utils/composeGridClasses.js","../../../node_modules/@mui/x-data-grid/constants/gridDetailPanelToggleField.js","../../../node_modules/@mui/x-data-grid/components/GridRow.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useGridAriaAttributes.js","../../../node_modules/@mui/x-data-grid/hooks/features/rows/useGridRowAriaAttributes.js","../../../node_modules/@mui/x-data-grid/context/GridContextProvider.js","../../../node_modules/@mui/x-data-grid/hooks/core/useGridRefs.js","../../../node_modules/@mui/x-data-grid/hooks/core/useGridIsRtl.js","../../../node_modules/@mui/x-data-grid/hooks/core/useGridLoggerFactory.js","../../../node_modules/@mui/x-internals/EventManager/EventManager.js","../../../node_modules/@mui/x-data-grid/utils/Store.js","../../../node_modules/@mui/x-data-grid/hooks/core/useGridApiInitialization.js","../../../node_modules/@mui/x-data-grid/hooks/core/useGridLocaleText.js","../../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../../node_modules/@mui/x-data-grid/hooks/core/pipeProcessing/useGridPipeProcessing.js","../../../node_modules/@mui/x-data-grid/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js","../../../node_modules/@mui/x-data-grid/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js","../../../node_modules/@mui/x-data-grid/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js","../../../node_modules/@mui/x-data-grid/hooks/core/strategyProcessing/useGridStrategyProcessing.js","../../../node_modules/@mui/x-data-grid/hooks/core/useGridStateInitialization.js","../../../node_modules/@mui/x-data-grid/hooks/core/useGridInitialization.js","../../../node_modules/@mui/x-data-grid/hooks/utils/useGridInitializeState.js","../../../node_modules/@mui/x-data-grid/hooks/features/export/serializers/csvSerializer.js","../../../node_modules/@mui/x-data-grid/hooks/features/clipboard/useGridClipboard.js","../../../node_modules/@mui/x-data-grid/hooks/features/columnMenu/useGridColumnMenu.js","../../../node_modules/@mui/x-data-grid/hooks/features/columns/useGridColumns.js","../../../node_modules/@mui/x-data-grid/hooks/features/density/useGridDensity.js","../../../node_modules/@mui/x-data-grid/utils/exportAs.js","../../../node_modules/@mui/x-data-grid/hooks/features/export/utils.js","../../../node_modules/@mui/x-data-grid/hooks/features/export/useGridCsvExport.js","../../../node_modules/@mui/x-data-grid/hooks/features/pagination/useGridPaginationModel.js","../../../node_modules/@mui/x-data-grid/hooks/features/export/useGridPrintExport.js","../../../node_modules/@mui/x-data-grid/hooks/features/filter/useGridFilter.js","../../../node_modules/@mui/x-data-grid/hooks/features/focus/useGridFocus.js","../../../node_modules/@mui/x-data-grid/hooks/features/keyboardNavigation/utils.js","../../../node_modules/@mui/x-data-grid/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js","../../../node_modules/@mui/x-data-grid/hooks/features/pagination/useGridRowCount.js","../../../node_modules/@mui/x-data-grid/hooks/features/pagination/useGridPaginationMeta.js","../../../node_modules/@mui/x-data-grid/hooks/features/pagination/useGridPagination.js","../../../node_modules/@mui/x-data-grid/hooks/features/preferencesPanel/useGridPreferencesPanel.js","../../../node_modules/@mui/x-data-grid/hooks/features/editing/utils.js","../../../node_modules/@mui/x-data-grid/hooks/features/editing/useGridCellEditing.js","../../../node_modules/@mui/x-data-grid/hooks/features/editing/useGridRowEditing.js","../../../node_modules/@mui/x-data-grid/hooks/features/editing/useGridEditing.js","../../../node_modules/@mui/x-data-grid/hooks/features/rows/useGridRows.js","../../../node_modules/@mui/x-data-grid/hooks/features/rows/useGridRowsPreProcessors.js","../../../node_modules/@mui/x-data-grid/hooks/features/rowSelection/useGridRowSelection.js","../../../node_modules/@mui/x-data-grid/hooks/features/rowSelection/useGridRowSelectionPreProcessors.js","../../../node_modules/@mui/x-data-grid/hooks/features/sorting/useGridSorting.js","../../../node_modules/@mui/x-data-grid/hooks/features/scroll/useGridScroll.js","../../../node_modules/@mui/x-data-grid/hooks/features/events/useGridEvents.js","../../../node_modules/@mui/x-internals/throttle/throttle.js","../../../node_modules/@mui/x-data-grid/hooks/features/dimensions/useGridDimensions.js","../../../node_modules/@mui/x-data-grid/components/columnHeaders/GridColumnGroupHeader.js","../../../node_modules/@mui/x-data-grid/hooks/features/columnHeaders/useGridColumnHeaders.js","../../../node_modules/@mui/x-data-grid/components/columnHeaders/GridBaseColumnHeaders.js","../../../node_modules/@mui/x-data-grid/components/GridColumnHeaders.js","../../../node_modules/@mui/x-data-grid/components/GridDetailPanels.js","../../../node_modules/@mui/x-data-grid/components/GridPinnedRows.js","../../../node_modules/@mui/x-data-grid/components/GridNoResultsOverlay.js","../../../node_modules/@mui/x-data-grid/material/icons/GridColumnUnsortedIcon.js","../../../node_modules/@mui/x-data-grid/material/components/MUISelectOption.js","../../../node_modules/@mui/x-data-grid/material/index.js","../../../node_modules/@mui/x-data-grid/constants/defaultGridSlotsComponents.js","../../../node_modules/@mui/x-data-grid/internals/utils/computeSlots.js","../../../node_modules/@mui/x-data-grid/internals/utils/useProps.js","../../../node_modules/@mui/x-data-grid/DataGrid/useDataGridProps.js","../../../node_modules/@mui/x-data-grid/hooks/features/rows/useGridRowsMeta.js","../../../node_modules/@mui/x-data-grid/hooks/features/statePersistence/useGridStatePersistence.js","../../../node_modules/@mui/x-data-grid/hooks/features/columns/useGridColumnSpanning.js","../../../node_modules/@mui/x-data-grid/hooks/features/columnGrouping/gridColumnGroupsUtils.js","../../../node_modules/@mui/x-data-grid/hooks/features/columnGrouping/useGridColumnGrouping.js","../../../node_modules/@mui/x-data-grid/utils/createControllablePromise.js","../../../node_modules/@mui/x-data-grid/hooks/features/columnResize/useGridColumnResize.js","../../../node_modules/@mui/x-data-grid/hooks/features/rows/gridRowSpanningUtils.js","../../../node_modules/@mui/x-data-grid/hooks/features/rows/useGridRowSpanning.js","../../../node_modules/@mui/x-data-grid/DataGrid/useDataGridComponent.js","../../../node_modules/@mui/x-data-grid/DataGrid/DataGrid.js","../../../node_modules/@mui/x-data-grid/index.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/UriField.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/Attributes.js","../../../node_modules/@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/index.js","../../../lib/dist/components/SequenceTextArea.js"],"sourcesContent":["/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z\"\n}), 'ExpandMore');","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useFeatureSequence = useFeatureSequence;\nconst react_1 = require(\"react\");\nconst util_1 = require(\"../../util\");\nconst configuration_1 = require(\"../../configuration\");\nconst BPLIMIT = 500000;\nfunction useFeatureSequence(model, feature, upDownBp, forceLoad) {\n const [sequence, setSequence] = (0, react_1.useState)();\n const [error, setError] = (0, react_1.useState)();\n (0, react_1.useEffect)(() => {\n var _a, _b;\n if (!model) {\n return;\n }\n const { assemblyManager, rpcManager } = (0, util_1.getSession)(model);\n const assemblyName = ((_b = (_a = model.view) === null || _a === void 0 ? void 0 : _a.assemblyNames) === null || _b === void 0 ? void 0 : _b[0]) || '';\n async function fetchSeq(start, end, refName) {\n const assembly = await assemblyManager.waitForAssembly(assemblyName);\n if (!assembly) {\n throw new Error('assembly not found');\n }\n const sessionId = 'getSequence';\n const feats = await rpcManager.call(sessionId, 'CoreGetFeatures', {\n adapterConfig: (0, configuration_1.getConf)(assembly, ['sequence', 'adapter']),\n sessionId,\n regions: [\n {\n start,\n end,\n refName: assembly.getCanonicalRefName(refName),\n assemblyName,\n },\n ],\n });\n const [feat] = feats;\n return (feat === null || feat === void 0 ? void 0 : feat.get('seq')) || '';\n }\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n ;\n (async () => {\n try {\n setError(undefined);\n const { start, end, refName } = feature;\n if (!forceLoad && end - start > BPLIMIT) {\n setSequence({\n error: `Genomic sequence larger than ${BPLIMIT}bp, use \"force load\" button to display`,\n });\n }\n else {\n const b = start - upDownBp;\n const e = end + upDownBp;\n const seq = await fetchSeq(start, end, refName);\n const up = await fetchSeq(Math.max(0, b), start, refName);\n const down = await fetchSeq(end, e, refName);\n setSequence({ seq, upstream: up, downstream: down });\n }\n }\n catch (e) {\n console.error(e);\n setError(e);\n }\n })();\n }, [feature, model, upDownBp, forceLoad]);\n return { sequence, error };\n}\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __importStar(require(\"react\"));\nconst material_1 = require(\"@mui/material\");\nconst ui_1 = require(\"@jbrowse/core/ui\");\nconst mui_1 = require(\"tss-react/mui\");\nconst mobx_react_1 = require(\"mobx-react\");\nconst useStyles = (0, mui_1.makeStyles)()(theme => ({\n formElt: {\n margin: theme.spacing(3),\n width: 400,\n },\n dialogContent: {\n width: '80em',\n },\n root: {\n padding: 4,\n },\n}));\nfunction TextField2(props) {\n return (react_1.default.createElement(\"div\", null,\n react_1.default.createElement(material_1.TextField, { ...props })));\n}\nfunction FormControl2({ children }) {\n return (react_1.default.createElement(\"div\", null,\n react_1.default.createElement(material_1.FormControl, null, children)));\n}\nconst SequenceFeatureSettingsDialog = (0, mobx_react_1.observer)(function ({ handleClose, model, }) {\n const { classes } = useStyles();\n const { upperCaseCDS } = model;\n const [intronBp, setIntronBp] = (0, react_1.useState)(`${model.intronBp}`);\n const [upDownBp, setUpDownBp] = (0, react_1.useState)(`${model.upDownBp}`);\n const intronBpValid = !Number.isNaN(+intronBp);\n const upDownBpValid = !Number.isNaN(+upDownBp);\n return (react_1.default.createElement(ui_1.Dialog, { maxWidth: \"xl\", open: true, onClose: () => {\n handleClose();\n }, title: \"Feature sequence settings\" },\n react_1.default.createElement(material_1.DialogContent, { className: classes.dialogContent },\n react_1.default.createElement(TextField2, { label: \"Number of intronic bases around splice site to display\", className: classes.formElt, value: intronBp, helperText: !intronBpValid ? 'Not a number' : '', error: !intronBpValid, onChange: event => {\n setIntronBp(event.target.value);\n } }),\n react_1.default.createElement(TextField2, { label: \"Number of bases up/down stream of feature to display\", className: classes.formElt, value: upDownBp, helperText: !upDownBpValid ? 'Not a number' : '', error: !upDownBpValid, onChange: event => {\n setUpDownBp(event.target.value);\n } }),\n react_1.default.createElement(FormControl2, null,\n react_1.default.createElement(material_1.FormLabel, null, \"Sequence capitalization\"),\n react_1.default.createElement(material_1.RadioGroup, { value: upperCaseCDS ? 'cds' : 'unchanged', onChange: e => {\n model.setUpperCaseCDS(e.target.value === 'cds');\n } },\n react_1.default.createElement(material_1.FormControlLabel, { value: \"cds\", control: react_1.default.createElement(material_1.Radio, { className: classes.root, size: \"small\" }), label: \"Capitalize CDS and lower case everything else\" }),\n react_1.default.createElement(material_1.FormControlLabel, { value: \"unchanged\", control: react_1.default.createElement(material_1.Radio, { className: classes.root, size: \"small\" }), label: \"Capitalization from reference genome sequence\" })))),\n react_1.default.createElement(material_1.DialogActions, null,\n react_1.default.createElement(material_1.Button, { onClick: () => {\n model.setIntronBp(+intronBp);\n model.setUpDownBp(+upDownBp);\n handleClose();\n }, disabled: !intronBpValid || !upDownBpValid, color: \"primary\", variant: \"contained\" }, \"Submit\"),\n react_1.default.createElement(material_1.Button, { onClick: () => {\n handleClose();\n }, color: \"secondary\", autoFocus: true, variant: \"contained\" }, \"Cancel\"))));\n});\nexports.default = SequenceFeatureSettingsDialog;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __importStar(require(\"react\"));\nconst mobx_react_1 = require(\"mobx-react\");\nconst copy_to_clipboard_1 = __importDefault(require(\"copy-to-clipboard\"));\nconst file_saver_1 = require(\"file-saver\");\n// locals\nconst CascadingMenuButton_1 = __importDefault(require(\"../../../ui/CascadingMenuButton\"));\n// icons\nconst MoreVert_1 = __importDefault(require(\"@mui/icons-material/MoreVert\"));\nconst Settings_1 = __importDefault(require(\"@mui/icons-material/Settings\"));\n// lazies\nconst SequenceFeatureSettingsDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./SettingsDialog'))));\nconst SequenceFeatureMenu = (0, mobx_react_1.observer)(react_1.default.forwardRef(function SequenceFeatureMenu2({ model, extraItems = [] }, ref) {\n if (typeof ref === 'function') {\n throw new Error('needs a non function ref');\n }\n const [showSettings, setShowSettings] = (0, react_1.useState)(false);\n const { showCoordinatesSetting, showGenomicCoordsOption } = model;\n return (react_1.default.createElement(react_1.default.Fragment, null,\n react_1.default.createElement(CascadingMenuButton_1.default, { menuItems: [\n {\n label: 'Copy plaintext',\n onClick: () => {\n const r = ref === null || ref === void 0 ? void 0 : ref.current;\n if (r) {\n (0, copy_to_clipboard_1.default)(r.textContent || '', { format: 'text/plain' });\n }\n },\n },\n {\n label: 'Copy HTML',\n onClick: () => {\n const r = ref === null || ref === void 0 ? void 0 : ref.current;\n if (r) {\n (0, copy_to_clipboard_1.default)(r.outerHTML, { format: 'text/html' });\n }\n },\n },\n {\n label: 'Download plaintext',\n onClick: () => {\n const r = ref === null || ref === void 0 ? void 0 : ref.current;\n if (r) {\n (0, file_saver_1.saveAs)(new Blob([r.textContent || ''], {\n type: 'text/plain;charset=utf-8',\n }), 'sequence.txt');\n }\n },\n },\n {\n label: 'Download HTML',\n onClick: () => {\n const r = ref === null || ref === void 0 ? void 0 : ref.current;\n if (r) {\n (0, file_saver_1.saveAs)(new Blob([r.outerHTML || ''], {\n type: 'text/html;charset=utf-8',\n }), 'sequence.html');\n }\n },\n },\n ...extraItems,\n {\n label: 'Show coordinates?',\n type: 'subMenu',\n subMenu: [\n {\n label: 'No coordinates',\n type: 'radio',\n checked: showCoordinatesSetting === 'none',\n onClick: () => {\n model.setShowCoordinates('none');\n },\n },\n {\n label: 'Coordinates relative to feature start',\n type: 'radio',\n checked: showCoordinatesSetting === 'relative',\n onClick: () => {\n model.setShowCoordinates('relative');\n },\n },\n ...(showGenomicCoordsOption\n ? [\n {\n label: 'Coordinates relative to genome (only available for continuous genome based sequence types)',\n type: 'radio',\n checked: showCoordinatesSetting === 'genomic',\n onClick: () => {\n model.setShowCoordinates('genomic');\n },\n },\n ]\n : []),\n ],\n },\n {\n label: 'Settings',\n icon: Settings_1.default,\n onClick: () => {\n setShowSettings(true);\n },\n },\n ] },\n react_1.default.createElement(MoreVert_1.default, null)),\n showSettings ? (react_1.default.createElement(SequenceFeatureSettingsDialog, { model: model, handleClose: () => {\n setShowSettings(false);\n } })) : null));\n}));\nexports.default = SequenceFeatureMenu;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __importDefault(require(\"react\"));\nconst material_1 = require(\"@mui/material\");\nconst mobx_react_1 = require(\"mobx-react\");\nconst mui_1 = require(\"tss-react/mui\");\nconst useStyles = (0, mui_1.makeStyles)()({\n formControl: {\n margin: 0,\n marginLeft: 4,\n },\n});\nconst SequenceTypeSelector = (0, mobx_react_1.observer)(function ({ model, }) {\n const { classes } = useStyles();\n const { intronBp, upDownBp, mode, hasCDS, hasExonOrCDS } = model;\n return (react_1.default.createElement(material_1.FormControl, { className: classes.formControl },\n react_1.default.createElement(material_1.Select, { size: \"small\", value: mode, onChange: event => {\n model.setMode(event.target.value);\n } }, Object.entries({\n ...(hasCDS\n ? {\n cds: 'CDS',\n }\n : {}),\n ...(hasCDS\n ? {\n protein: 'Protein',\n }\n : {}),\n ...(hasExonOrCDS\n ? {\n cdna: 'cDNA',\n }\n : {}),\n ...(hasExonOrCDS\n ? {\n gene: 'Genomic w/ full introns',\n }\n : {}),\n ...(hasExonOrCDS\n ? {\n gene_updownstream: `Genomic w/ full introns +/- ${upDownBp}bp up+down stream`,\n }\n : {}),\n ...(hasExonOrCDS\n ? {\n gene_collapsed_intron: `Genomic w/ ${intronBp}bp intron`,\n }\n : {}),\n ...(hasExonOrCDS\n ? {\n gene_updownstream_collapsed_intron: `Genomic w/ ${intronBp}bp intron +/- ${upDownBp}bp up+down stream `,\n }\n : {}),\n ...(!hasExonOrCDS\n ? {\n genomic: 'Genomic',\n }\n : {}),\n ...(!hasExonOrCDS\n ? {\n genomic_sequence_updownstream: `Genomic +/- ${upDownBp}bp up+down stream`,\n }\n : {}),\n }).map(([key, val]) => (react_1.default.createElement(material_1.MenuItem, { key: key, value: key }, val))))));\n});\nexports.default = SequenceTypeSelector;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.stitch = stitch;\nexports.dedupe = dedupe;\nexports.revlist = revlist;\nexports.calculateUTRs = calculateUTRs;\nexports.calculateUTRs2 = calculateUTRs2;\nexports.ellipses = ellipses;\nfunction stitch(subfeats, sequence) {\n return subfeats.map(sub => sequence.slice(sub.start, sub.end)).join('');\n}\n// filter items if they have the same \"ID\" or location\nfunction getItemId(feat) {\n return `${feat.start}-${feat.end}`;\n}\n// filters if successive elements share same start/end\nfunction dedupe(list) {\n return list.filter((item, pos, ary) => !pos || getItemId(item) !== getItemId(ary[pos - 1]));\n}\nfunction revlist(list, seqlen) {\n return list\n .map(sub => ({\n ...sub,\n start: seqlen - sub.end,\n end: seqlen - sub.start,\n }))\n .sort((a, b) => a.start - b.start);\n}\nfunction calculateUTRs(cds, exons) {\n // checking length ensures the .at below are valid\n if (!cds.length) {\n return [];\n }\n const firstCds = cds.at(0);\n const lastCds = cds.at(-1);\n const firstCdsIdx = exons.findIndex(exon => exon.end >= firstCds.start && exon.start <= firstCds.start);\n const lastCdsIdx = exons.findIndex(exon => exon.end >= lastCds.end && exon.start <= lastCds.end);\n const lastCdsExon = exons[lastCdsIdx];\n const firstCdsExon = exons[firstCdsIdx];\n const fiveUTRs = [\n ...exons.slice(0, firstCdsIdx),\n { start: firstCdsExon.start, end: firstCds.start },\n ].map(elt => ({ ...elt, type: 'five_prime_UTR' }));\n const threeUTRs = [\n { start: lastCds.end, end: lastCdsExon.end },\n ...exons.slice(lastCdsIdx + 1),\n ].map(elt => ({ ...elt, type: 'three_prime_UTR' }));\n return [...fiveUTRs, ...threeUTRs];\n}\n// calculates UTRs using impliedUTRs logic, but there are no exon subfeatures\nfunction calculateUTRs2(cds, parentFeat) {\n if (!cds.length) {\n return [];\n }\n const firstCds = cds.at(0);\n const lastCds = cds.at(-1);\n const fiveUTRs = [{ start: parentFeat.start, end: firstCds.start }].map(elt => ({ ...elt, type: 'five_prime_UTR' }));\n const threeUTRs = [{ start: lastCds.end, end: parentFeat.end }].map(elt => ({\n ...elt,\n type: 'three_prime_UTR',\n }));\n return [...fiveUTRs, ...threeUTRs];\n}\nfunction ellipses(slug) {\n return slug.length > 20 ? `${slug.slice(0, 20)}...` : slug;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.genomeColor = exports.updownstreamColor = exports.cdsColor = exports.proteinColor = exports.utrColor = exports.intronColor = void 0;\nexports.splitString = splitString;\n// note that these are currently put into the style section instead of being\n// defined in classes to aid copy and paste to an external document e.g. word\nexports.intronColor = undefined;\nexports.utrColor = 'rgb(200,240,240)';\nexports.proteinColor = 'rgb(220,160,220)';\nexports.cdsColor = 'rgb(220,220,180)';\nexports.updownstreamColor = 'rgba(250,200,200)';\nexports.genomeColor = 'rgb(200,280,200)';\nfunction splitString({ str, charactersPerRow, showCoordinates, currRemainder = 0, splitSize = 10, }) {\n var _a;\n const numChunks = Math.ceil(str.length / charactersPerRow);\n const chunks = new Array(numChunks);\n let splitStart = currRemainder % 10;\n let iter = 0;\n let offset = 0;\n for (; iter < numChunks + 1; ++iter) {\n const inc = iter === 0 ? charactersPerRow - currRemainder : charactersPerRow;\n const r = str.slice(offset, offset + inc);\n if (!r) {\n break;\n }\n if (showCoordinates) {\n let res = '';\n for (let i = 0, j = splitStart; i < r.length; i++, j++) {\n // note: this adds a space at the start but it causes trouble to try to\n // say e.g. j%splitSize==0 && j to try to only add non-zero spaces\n if (j % splitSize === 0) {\n res += ' ';\n j = 0;\n }\n res += r[i];\n }\n if (res) {\n chunks[iter] = res;\n }\n }\n else {\n chunks[iter] = r;\n }\n splitStart = 0; // after newline, reset\n offset += inc;\n }\n return {\n segments: chunks,\n remainder: ((((_a = chunks.at(-1)) === null || _a === void 0 ? void 0 : _a.replaceAll(' ', '').length) || 0) +\n (iter < 2 ? currRemainder : 0)) %\n charactersPerRow,\n };\n}\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __importDefault(require(\"react\"));\nconst mobx_react_1 = require(\"mobx-react\");\nconst SequenceDisplay = (0, mobx_react_1.observer)(function ({ chunks, start, color, strand = 1, coordStart = start, model, }) {\n const { charactersPerRow, showCoordinates } = model;\n return chunks.map((chunk, idx) => {\n var _a;\n const f = coordStart - (start % charactersPerRow);\n const prefix = (idx === 0 && start % charactersPerRow === 0) || idx > 0\n ? `${`${f + idx * strand * charactersPerRow}`.padStart(4)} `\n : '';\n const postfix = idx === chunks.length - 1 &&\n (((_a = chunks.at(-1)) === null || _a === void 0 ? void 0 : _a.replaceAll(' ', '').length) || 0) +\n (idx === 0 ? start % charactersPerRow : 0) !==\n charactersPerRow\n ? null\n : showCoordinates\n ? ' \\n'\n : '';\n return (\n /* biome-ignore lint/suspicious/noArrayIndexKey: */\n react_1.default.createElement(react_1.default.Fragment, { key: `${chunk}-${idx}` },\n showCoordinates ? prefix : null,\n react_1.default.createElement(\"span\", { style: { background: color } }, chunk),\n postfix));\n });\n});\nexports.default = SequenceDisplay;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __importDefault(require(\"react\"));\nconst mobx_react_1 = require(\"mobx-react\");\nconst util_1 = require(\"../util\");\nconst SequenceDisplay_1 = __importDefault(require(\"./SequenceDisplay\"));\nconst CDNASequence = (0, mobx_react_1.observer)(function ({ utr, cds, exons, sequence, upstream, downstream, feature, includeIntrons, collapseIntron, model, }) {\n var _a;\n const { upperCaseCDS, intronBp, charactersPerRow, showCoordinates, showCoordinatesSetting, } = model;\n const hasCds = cds.length > 0;\n const chunks = (cds.length ? [...cds, ...utr].sort((a, b) => a.start - b.start) : exons).filter(f => f.start !== f.end);\n const toLower = (s) => (upperCaseCDS ? s.toLowerCase() : s);\n const toUpper = (s) => (upperCaseCDS ? s.toUpperCase() : s);\n const strand = feature.strand === -1 ? -1 : 1;\n const fullGenomicCoordinates = showCoordinatesSetting === 'genomic' && includeIntrons && !collapseIntron;\n const mult = fullGenomicCoordinates ? strand : 1;\n let coordStart = fullGenomicCoordinates\n ? strand > 0\n ? feature.start + 1 - ((upstream === null || upstream === void 0 ? void 0 : upstream.length) || 0)\n : feature.end + ((upstream === null || upstream === void 0 ? void 0 : upstream.length) || 0)\n : 0;\n let currStart = 0;\n let currRemainder = 0;\n let upstreamChunk = null;\n if (upstream) {\n const { segments, remainder } = (0, util_1.splitString)({\n str: toLower(upstream),\n charactersPerRow,\n showCoordinates,\n });\n upstreamChunk = (react_1.default.createElement(SequenceDisplay_1.default, { model: model, color: util_1.updownstreamColor, strand: mult, start: currStart, coordStart: coordStart, chunks: segments }));\n currRemainder = remainder;\n currStart = currStart + upstream.length * mult;\n coordStart = coordStart + upstream.length * mult;\n }\n const middleChunks = [];\n for (let idx = 0; idx < chunks.length; idx++) {\n const chunk = chunks[idx];\n const intron = sequence.slice(chunk.end, (_a = chunks[idx + 1]) === null || _a === void 0 ? void 0 : _a.start);\n const s = sequence.slice(chunk.start, chunk.end);\n const { segments, remainder } = (0, util_1.splitString)({\n str: hasCds\n ? chunk.type === 'CDS'\n ? toUpper(s)\n : toLower(s)\n : toUpper(s),\n charactersPerRow,\n currRemainder,\n showCoordinates,\n });\n middleChunks.push(react_1.default.createElement(SequenceDisplay_1.default, { key: `${JSON.stringify(chunk)}-mid`, model: model, color: chunk.type === 'CDS' ? util_1.cdsColor : util_1.utrColor, strand: mult, start: currStart, coordStart: coordStart, chunks: segments }));\n currRemainder = remainder;\n currStart = currStart + s.length * mult;\n coordStart = coordStart + s.length * mult;\n if (intron && includeIntrons && idx < chunks.length - 1) {\n const str = toLower(collapseIntron && intron.length > intronBp * 2\n ? `${intron.slice(0, intronBp)}...${intron.slice(-intronBp)}`\n : intron);\n const { segments, remainder } = (0, util_1.splitString)({\n str,\n charactersPerRow,\n currRemainder,\n showCoordinates,\n });\n if (segments.length) {\n middleChunks.push(react_1.default.createElement(SequenceDisplay_1.default, { key: `${JSON.stringify(chunk)}-intron`, model: model, strand: mult, coordStart: coordStart, start: currStart, chunks: segments }));\n currRemainder = remainder;\n currStart = currStart + str.length * mult;\n coordStart = coordStart + str.length * mult;\n }\n }\n }\n let downstreamChunk = null;\n if (downstream) {\n const { segments } = (0, util_1.splitString)({\n str: toLower(downstream),\n charactersPerRow,\n currRemainder,\n showCoordinates,\n });\n downstreamChunk = (react_1.default.createElement(SequenceDisplay_1.default, { start: currStart, model: model, strand: mult, chunks: segments, coordStart: coordStart, color: util_1.updownstreamColor }));\n }\n return (react_1.default.createElement(react_1.default.Fragment, null,\n upstreamChunk,\n middleChunks,\n downstreamChunk));\n});\nexports.default = CDNASequence;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __importDefault(require(\"react\"));\nconst mobx_react_1 = require(\"mobx-react\");\n// locals\nconst util_1 = require(\"../../util\");\nconst util_2 = require(\"../util\");\nconst SequenceDisplay_1 = __importDefault(require(\"./SequenceDisplay\"));\nconst ProteinSequence = (0, mobx_react_1.observer)(function ({ cds, sequence, codonTable, model, }) {\n const { charactersPerRow, showCoordinates } = model;\n const str = (0, util_1.stitch)(cds, sequence);\n let protein = '';\n for (let i = 0; i < str.length; i += 3) {\n // use & symbol for undefined codon, or partial slice\n protein += codonTable[str.slice(i, i + 3)] || '&';\n }\n const { segments } = (0, util_2.splitString)({\n str: protein,\n charactersPerRow,\n showCoordinates,\n });\n return (react_1.default.createElement(SequenceDisplay_1.default, { model: model, color: util_2.proteinColor, chunks: segments, start: 0 }));\n});\nexports.default = ProteinSequence;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __importDefault(require(\"react\"));\nconst mobx_react_1 = require(\"mobx-react\");\n// locals\nconst util_1 = require(\"../util\");\nconst SequenceDisplay_1 = __importDefault(require(\"./SequenceDisplay\"));\nconst GenomicSequence = (0, mobx_react_1.observer)(function ({ sequence, upstream, feature, downstream, model, }) {\n const { charactersPerRow, showCoordinatesSetting, showCoordinates } = model;\n let currStart = 0;\n let upstreamChunk = null;\n let currRemainder = 0;\n const strand = feature.strand === -1 ? -1 : 1;\n const fullGenomicCoordinates = showCoordinatesSetting === 'genomic';\n const mult = fullGenomicCoordinates ? strand : 1;\n let coordStart = fullGenomicCoordinates\n ? strand > 0\n ? feature.start + 1 - ((upstream === null || upstream === void 0 ? void 0 : upstream.length) || 0)\n : feature.end + ((upstream === null || upstream === void 0 ? void 0 : upstream.length) || 0)\n : 0;\n if (upstream) {\n const { segments, remainder } = (0, util_1.splitString)({\n str: upstream,\n charactersPerRow,\n showCoordinates,\n });\n upstreamChunk = (react_1.default.createElement(SequenceDisplay_1.default, { model: model, color: util_1.updownstreamColor, start: currStart, coordStart: coordStart, chunks: segments }));\n currRemainder = remainder;\n currStart = currStart + upstream.length * mult;\n coordStart = coordStart + upstream.length * mult;\n }\n const { segments, remainder } = (0, util_1.splitString)({\n str: sequence,\n charactersPerRow,\n showCoordinates,\n currRemainder,\n });\n const middleChunk = (react_1.default.createElement(SequenceDisplay_1.default, { model: model, color: util_1.genomeColor, start: currStart, coordStart: coordStart, chunks: segments }));\n currRemainder = remainder;\n currStart += sequence.length * mult;\n coordStart = coordStart + sequence.length * mult;\n let downstreamChunk = null;\n if (downstream) {\n const { segments } = (0, util_1.splitString)({\n str: downstream,\n charactersPerRow,\n currRemainder,\n showCoordinates,\n });\n downstreamChunk = (react_1.default.createElement(SequenceDisplay_1.default, { start: currStart, model: model, chunks: segments, coordStart: coordStart, color: util_1.updownstreamColor }));\n }\n return (react_1.default.createElement(react_1.default.Fragment, null,\n upstreamChunk,\n middleChunk,\n downstreamChunk));\n});\nexports.default = GenomicSequence;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __importDefault(require(\"react\"));\nconst mobx_react_1 = require(\"mobx-react\");\n// locals\nconst util_1 = require(\"../util\");\nconst util_2 = require(\"../../util\");\nconst SequenceDisplay_1 = __importDefault(require(\"./SequenceDisplay\"));\nconst CDSSequence = (0, mobx_react_1.observer)(function ({ cds, sequence, model, }) {\n const { charactersPerRow, showCoordinates } = model;\n const { segments } = (0, util_1.splitString)({\n str: (0, util_2.stitch)(cds, sequence),\n charactersPerRow,\n showCoordinates,\n });\n return (react_1.default.createElement(SequenceDisplay_1.default, { model: model, color: util_1.cdsColor, chunks: segments, start: 0 }));\n});\nexports.default = CDSSequence;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __importDefault(require(\"react\"));\nconst mobx_react_1 = require(\"mobx-react\");\n// locals\nconst util_1 = require(\"../../util\");\nconst util_2 = require(\"../util\");\n// panel types\nconst CDNASequence_1 = __importDefault(require(\"./seqtypes/CDNASequence\"));\nconst ProteinSequence_1 = __importDefault(require(\"./seqtypes/ProteinSequence\"));\nconst GenomicSequence_1 = __importDefault(require(\"./seqtypes/GenomicSequence\"));\nconst CDSSequence_1 = __importDefault(require(\"./seqtypes/CDSSequence\"));\nfunction getStrand(strand) {\n if (strand === -1) {\n return '(-)';\n }\n else if (strand === 1) {\n return '(+)';\n }\n else {\n return '';\n }\n}\nfunction WordWrap({ children }) {\n return (react_1.default.createElement(\"pre\", { style: {\n /* raw styles instead of className so that html copy works */\n fontFamily: 'monospace',\n color: 'black',\n fontSize: 11,\n } }, children));\n}\nfunction NoWordWrap({ children }) {\n return (react_1.default.createElement(\"div\", { style: {\n /* raw styles instead of className so that html copy works */\n fontFamily: 'monospace',\n color: 'black',\n fontSize: 11,\n maxWidth: 600,\n whiteSpace: 'wrap',\n wordBreak: 'break-all',\n } }, children));\n}\nconst SequencePanel = (0, mobx_react_1.observer)(react_1.default.forwardRef(function S(props, ref) {\n const { model, feature } = props;\n const { showCoordinates, mode } = model;\n let { sequence: { seq, upstream = '', downstream = '' }, } = props;\n const { subfeatures = [] } = feature;\n const children = subfeatures\n .sort((a, b) => a.start - b.start)\n .map(sub => ({\n ...sub,\n start: sub.start - feature.start,\n end: sub.end - feature.start,\n }));\n // we filter duplicate entries in cds and exon lists duplicate entries\n // may be rare but was seen in Gencode v36 track NCList, likely a bug\n // on GFF3 or probably worth ignoring here (produces broken protein\n // translations if included)\n //\n // position 1:224,800,006..225,203,064 gene ENSG00000185842.15 first\n // transcript ENST00000445597.6\n //\n // http://localhost:3000/?config=test_data%2Fconfig.json&session=share-FUl7G1isvF&password=HXh5Y\n let cds = (0, util_2.dedupe)(children.filter(sub => sub.type === 'CDS'));\n let utr = (0, util_2.dedupe)(children.filter(sub => { var _a; return (_a = sub.type) === null || _a === void 0 ? void 0 : _a.match(/utr/i); }));\n let exons = (0, util_2.dedupe)(children.filter(sub => sub.type === 'exon'));\n if (!utr.length && cds.length && exons.length) {\n utr = (0, util_2.calculateUTRs)(cds, exons);\n }\n if (!utr.length && cds.length && !exons.length) {\n utr = (0, util_2.calculateUTRs2)(cds, {\n start: 0,\n end: feature.end - feature.start,\n type: 'gene',\n });\n }\n if (feature.strand === -1) {\n // doing this in a single assignment is needed because downstream and\n // upstream are swapped so this avoids a temp variable\n ;\n [seq, upstream, downstream] = [\n (0, util_1.revcom)(seq),\n (0, util_1.revcom)(downstream),\n (0, util_1.revcom)(upstream),\n ];\n cds = (0, util_2.revlist)(cds, seq.length);\n exons = (0, util_2.revlist)(exons, seq.length);\n utr = (0, util_2.revlist)(utr, seq.length);\n }\n const codonTable = (0, util_1.generateCodonTable)(util_1.defaultCodonTable);\n const Container = showCoordinates ? WordWrap : NoWordWrap;\n return (react_1.default.createElement(\"div\", { \"data-testid\": \"sequence_panel\", ref: ref, style: { maxHeight: 300, overflow: 'auto' } },\n react_1.default.createElement(Container, null,\n react_1.default.createElement(\"div\", { style: { background: 'white' } }, `>${[\n `${feature.name || feature.id}-${mode}`,\n `${feature.refName}:${(0, util_1.toLocale)(feature.start + 1)}-${(0, util_1.toLocale)(feature.end)}${getStrand(feature.strand)}`,\n mode.endsWith('updownstream')\n ? `+/- ${(0, util_1.toLocale)(model.upDownBp)} up/downstream bp`\n : '',\n ]\n .filter(f => !!f)\n .join(' ')}\\n`),\n mode === 'genomic' ? (react_1.default.createElement(GenomicSequence_1.default, { feature: feature, model: model, sequence: seq })) : mode === 'genomic_sequence_updownstream' ? (react_1.default.createElement(GenomicSequence_1.default, { model: model, feature: feature, sequence: seq, upstream: upstream, downstream: downstream })) : mode === 'cds' ? (react_1.default.createElement(CDSSequence_1.default, { model: model, cds: cds, sequence: seq })) : mode === 'cdna' ? (react_1.default.createElement(CDNASequence_1.default, { model: model, exons: exons, feature: feature, cds: cds, utr: utr, sequence: seq })) : mode === 'protein' ? (react_1.default.createElement(ProteinSequence_1.default, { model: model, cds: cds, codonTable: codonTable, sequence: seq })) : mode === 'gene' ? (react_1.default.createElement(CDNASequence_1.default, { model: model, exons: exons, feature: feature, cds: cds, utr: utr, sequence: seq, includeIntrons: true })) : mode === 'gene_collapsed_intron' ? (react_1.default.createElement(CDNASequence_1.default, { model: model, exons: exons, feature: feature, cds: cds, sequence: seq, utr: utr, includeIntrons: true, collapseIntron: true })) : mode === 'gene_updownstream' ? (react_1.default.createElement(CDNASequence_1.default, { model: model, exons: exons, feature: feature, cds: cds, sequence: seq, utr: utr, upstream: upstream, downstream: downstream, includeIntrons: true })) : mode === 'gene_updownstream_collapsed_intron' ? (react_1.default.createElement(CDNASequence_1.default, { model: model, exons: exons, feature: feature, cds: cds, sequence: seq, utr: utr, upstream: upstream, downstream: downstream, includeIntrons: true, collapseIntron: true })) : (react_1.default.createElement(\"div\", null, \"Unknown type\")))));\n}));\nexports.default = SequencePanel;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __importStar(require(\"react\"));\nconst material_1 = require(\"@mui/material\");\nconst ui_1 = require(\"@jbrowse/core/ui\");\nconst mui_1 = require(\"tss-react/mui\");\nconst mobx_react_1 = require(\"mobx-react\");\n// locals\nconst hooks_1 = require(\"../hooks\");\nconst SequencePanel_1 = __importDefault(require(\"../SequencePanel\"));\nconst SequenceFeatureMenu_1 = __importDefault(require(\"./SequenceFeatureMenu\"));\nconst SequenceTypeSelector_1 = __importDefault(require(\"./SequenceTypeSelector\"));\nconst useStyles = (0, mui_1.makeStyles)()({\n dialogContent: {\n width: '80em',\n },\n formControl: {\n margin: 0,\n marginLeft: 4,\n },\n});\nconst SequenceDialog = (0, mobx_react_1.observer)(function ({ handleClose, model, feature, }) {\n const { sequenceFeatureDetails } = model;\n const { upDownBp } = sequenceFeatureDetails;\n const { classes } = useStyles();\n const seqPanelRef = (0, react_1.useRef)(null);\n const [force, setForce] = (0, react_1.useState)(false);\n const { sequence, error } = (0, hooks_1.useFeatureSequence)(model, feature, upDownBp, force);\n return (react_1.default.createElement(ui_1.Dialog, { maxWidth: \"xl\", open: true, onClose: () => {\n handleClose();\n }, title: \"Sequence view\" },\n react_1.default.createElement(material_1.DialogContent, { className: classes.dialogContent },\n react_1.default.createElement(\"div\", null,\n react_1.default.createElement(SequenceTypeSelector_1.default, { model: sequenceFeatureDetails }),\n react_1.default.createElement(SequenceFeatureMenu_1.default, { ref: seqPanelRef, model: sequenceFeatureDetails })),\n react_1.default.createElement(\"div\", null,\n feature.type === 'gene' ? (react_1.default.createElement(material_1.Typography, null, \"Note: inspect subfeature sequences for protein/CDS computations\")) : null,\n error ? (react_1.default.createElement(ui_1.ErrorMessage, { error: error })) : !sequence ? (react_1.default.createElement(ui_1.LoadingEllipses, null)) : 'error' in sequence ? (react_1.default.createElement(react_1.default.Fragment, null,\n react_1.default.createElement(material_1.Typography, { color: \"error\" }, sequence.error),\n react_1.default.createElement(material_1.Button, { variant: \"contained\", color: \"inherit\", onClick: () => {\n setForce(true);\n } }, \"Force load\"))) : (react_1.default.createElement(react_1.Suspense, { fallback: react_1.default.createElement(ui_1.LoadingEllipses, null) },\n react_1.default.createElement(SequencePanel_1.default, { ref: seqPanelRef, feature: feature, sequence: sequence, model: sequenceFeatureDetails }))))),\n react_1.default.createElement(material_1.DialogActions, null,\n react_1.default.createElement(material_1.Button, { onClick: () => {\n handleClose();\n }, variant: \"contained\" }, \"Close\"))));\n});\nexports.default = SequenceDialog;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __importStar(require(\"react\"));\nconst material_1 = require(\"@mui/material\");\nconst mobx_react_1 = require(\"mobx-react\");\n// locals\nconst hooks_1 = require(\"./hooks\");\nconst ui_1 = require(\"../../ui\");\n// icons\nconst SequenceFeatureMenu_1 = __importDefault(require(\"./dialogs/SequenceFeatureMenu\"));\nconst SequenceTypeSelector_1 = __importDefault(require(\"./dialogs/SequenceTypeSelector\"));\n// lazies\nconst SequencePanel = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./SequencePanel'))));\nconst SequenceDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./dialogs/SequenceDialog'))));\n// set the key on this component to feature.id to clear state after new feature\n// is selected\nconst SequenceFeatureDetails = (0, mobx_react_1.observer)(function ({ model, feature, }) {\n const { sequenceFeatureDetails } = model;\n const { upDownBp } = sequenceFeatureDetails;\n const seqPanelRef = (0, react_1.useRef)(null);\n const [openInDialog, setOpenInDialog] = (0, react_1.useState)(false);\n const [force, setForce] = (0, react_1.useState)(false);\n const { sequence, error } = (0, hooks_1.useFeatureSequence)(model, feature, upDownBp, force);\n (0, react_1.useEffect)(() => {\n sequenceFeatureDetails.setFeature(feature);\n }, [sequenceFeatureDetails, feature]);\n return (react_1.default.createElement(react_1.default.Fragment, null,\n react_1.default.createElement(\"div\", null,\n react_1.default.createElement(SequenceTypeSelector_1.default, { model: sequenceFeatureDetails }),\n react_1.default.createElement(SequenceFeatureMenu_1.default, { ref: seqPanelRef, model: sequenceFeatureDetails, extraItems: [\n {\n label: 'Open in dialog',\n onClick: () => {\n // this is given a setTimeout because it allows the menu to\n // close before dialog opens\n setTimeout(() => {\n setOpenInDialog(true);\n }, 1);\n },\n },\n ] })),\n openInDialog ? (react_1.default.createElement(\"div\", null,\n \"Open in dialog...\",\n react_1.default.createElement(react_1.Suspense, { fallback: react_1.default.createElement(ui_1.LoadingEllipses, null) },\n react_1.default.createElement(SequenceDialog, { model: model, feature: feature, handleClose: () => {\n setOpenInDialog(false);\n } })))) : (react_1.default.createElement(\"div\", null,\n feature.type === 'gene' ? (react_1.default.createElement(material_1.Typography, null, \"Note: inspect subfeature sequences for protein/CDS computations\")) : null,\n error ? (react_1.default.createElement(ui_1.ErrorMessage, { error: error })) : !sequence ? (react_1.default.createElement(ui_1.LoadingEllipses, null)) : 'error' in sequence ? (react_1.default.createElement(react_1.default.Fragment, null,\n react_1.default.createElement(material_1.Typography, { color: \"error\" }, sequence.error),\n react_1.default.createElement(material_1.Button, { variant: \"contained\", color: \"inherit\", onClick: () => {\n setForce(true);\n } }, \"Force load\"))) : (react_1.default.createElement(react_1.Suspense, { fallback: react_1.default.createElement(ui_1.LoadingEllipses, null) },\n react_1.default.createElement(SequencePanel, { ref: seqPanelRef, feature: feature, sequence: sequence, model: sequenceFeatureDetails })))))));\n});\nexports.default = SequenceFeatureDetails;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = HelpDialog;\nconst react_1 = __importDefault(require(\"react\"));\nconst material_1 = require(\"@mui/material\");\nconst ui_1 = require(\"@jbrowse/core/ui\");\n// icons\nconst Settings_1 = __importDefault(require(\"@mui/icons-material/Settings\"));\nfunction HelpDialog({ handleClose, }) {\n return (react_1.default.createElement(ui_1.Dialog, { maxWidth: \"xl\", open: true, onClose: () => {\n handleClose();\n }, title: \"Feature sequence panel help\" },\n react_1.default.createElement(material_1.DialogContent, null,\n react_1.default.createElement(material_1.Typography, { paragraph: true }, \"The \\\"Feature sequence\\\" panel shows the underlying genomic sequence for a given feature, fetched from the reference genome.\"),\n react_1.default.createElement(material_1.Typography, null, \"For gene features, this panel does special calculations to e.g. stitch together the coding sequence, the options are:\"),\n react_1.default.createElement(\"ul\", null,\n react_1.default.createElement(\"li\", null, \"CDS - shows the stitched together CDS sequences\"),\n react_1.default.createElement(\"li\", null, \"Protein - the translated coding sequence, with the \\\"standard\\\" genetic code\"),\n react_1.default.createElement(\"li\", null, \"cDNA - shows the 'copy DNA' of transcript, formed from exon sequences\"),\n react_1.default.createElement(\"li\", null, \"Genomic w/ introns +/- Nbp up+down stream - the sequence underlying the entire gene including including introns, with UTR and CDS highlighted\")),\n react_1.default.createElement(material_1.Typography, { paragraph: true }, \"For other feature types, the options are:\"),\n react_1.default.createElement(\"ul\", null,\n react_1.default.createElement(\"li\", null, \"Genomic +/- Nbp up+down stream - the reference genome sequence underlying the feature, with the up and downstream sequence\")),\n react_1.default.createElement(material_1.Typography, null,\n \"Note 1: you can use the \\\"gear icon\\\" \",\n react_1.default.createElement(Settings_1.default, null),\n \" to edit the number of bp displayed up/downstream and in the intron region\"),\n react_1.default.createElement(material_1.Typography, null, \"Note 2: The 'Copy HTML' function retains the colors from the sequence panel but cannot be pasted into some programs like notepad that only expect plain text.\")),\n react_1.default.createElement(material_1.DialogActions, null,\n react_1.default.createElement(material_1.Button, { onClick: () => {\n handleClose();\n }, autoFocus: true, variant: \"contained\" }, \"Close\"))));\n}\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __importStar(require(\"react\"));\nconst material_1 = require(\"@mui/material\");\nconst mobx_react_1 = require(\"mobx-react\");\nconst mui_1 = require(\"tss-react/mui\");\n// locals\nconst ui_1 = require(\"../../ui\");\nconst util_1 = require(\"../../util\");\n// icons\nconst Help_1 = __importDefault(require(\"@mui/icons-material/Help\"));\n// lazies\nconst SequenceFeatureDetails = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./SequenceFeatureDetails'))));\nconst HelpDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./dialogs/HelpDialog'))));\nconst useStyles = (0, mui_1.makeStyles)()(theme => ({\n formControl: {\n margin: 0,\n },\n container: {\n marginTop: theme.spacing(4),\n marginBottom: theme.spacing(4),\n },\n}));\n// display the stitched-together sequence of a gene's CDS, cDNA, or protein\n// sequence. this is a best effort and weird genomic phenomena could lead these\n// to not be 100% accurate\nconst SequenceFeaturePanel = (0, mobx_react_1.observer)(function ({ model, feature, }) {\n const { classes } = useStyles();\n const [shown, setShown] = (0, react_1.useState)(false);\n return (react_1.default.createElement(\"div\", { className: classes.container },\n react_1.default.createElement(material_1.FormControl, { className: classes.formControl },\n react_1.default.createElement(material_1.Button, { variant: \"contained\", onClick: () => {\n setShown(!shown);\n } }, shown ? 'Hide feature sequence' : 'Show feature sequence')),\n react_1.default.createElement(material_1.IconButton, { onClick: () => {\n (0, util_1.getSession)(model).queueDialog(handleClose => [\n HelpDialog,\n { handleClose },\n ]);\n } },\n react_1.default.createElement(Help_1.default, null)),\n shown ? (react_1.default.createElement(react_1.Suspense, { fallback: react_1.default.createElement(ui_1.LoadingEllipses, null) },\n react_1.default.createElement(SequenceFeatureDetails, { key: feature.uniqueId, model: model, feature: feature }))) : null));\n});\nexports.default = SequenceFeaturePanel;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = void 0;\nvar SequenceFeaturePanel_1 = require(\"./SequenceFeaturePanel\");\nObject.defineProperty(exports, \"default\", { enumerable: true, get: function () { return __importDefault(SequenceFeaturePanel_1).default; } });\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = FieldName;\nconst react_1 = __importDefault(require(\"react\"));\nconst material_1 = require(\"@mui/material\");\nconst mui_1 = require(\"tss-react/mui\");\nconst useStyles = (0, mui_1.makeStyles)()(theme => ({\n fieldDescription: {\n '&:hover': {\n background: theme.palette.mode === 'dark' ? '#e65100' : 'yellow',\n },\n },\n fieldName: {\n wordBreak: 'break-all',\n minWidth: 90,\n borderBottom: '1px solid #0003',\n fontSize: 12,\n background: theme.palette.action.disabledBackground,\n marginRight: theme.spacing(1),\n padding: theme.spacing(0.5),\n },\n}));\nfunction FieldName({ description, name, width, prefix = [], }) {\n const { classes, cx } = useStyles();\n const val = [...prefix, name].join('.');\n return description ? (react_1.default.createElement(material_1.Tooltip, { title: description, placement: \"left\" },\n react_1.default.createElement(\"div\", { className: cx(classes.fieldDescription, classes.fieldName) }, val))) : (react_1.default.createElement(\"div\", { className: classes.fieldName, style: { width: width } }, val));\n}\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = BasicValue;\nconst react_1 = __importDefault(require(\"react\"));\nconst mui_1 = require(\"tss-react/mui\");\nconst is_object_1 = __importDefault(require(\"is-object\"));\nconst material_1 = require(\"@mui/material\");\n// locals\nconst ui_1 = require(\"../../ui\");\nconst useStyles = (0, mui_1.makeStyles)()(theme => ({\n fieldValue: {\n wordBreak: 'break-word',\n maxHeight: 300,\n fontSize: 12,\n padding: theme.spacing(0.5),\n overflow: 'auto',\n },\n}));\nfunction BasicValue({ value }) {\n const { classes } = useStyles();\n const isLink = /^https?:\\/\\//.exec(`${value}`);\n return (react_1.default.createElement(\"div\", { className: classes.fieldValue }, react_1.default.isValidElement(value) ? (value) : isLink ? (react_1.default.createElement(material_1.Link, { href: `${value}` }, `${value}`)) : (react_1.default.createElement(ui_1.SanitizedHTML, { html: (0, is_object_1.default)(value) ? JSON.stringify(value) : String(value) }))));\n}\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = SimpleField;\nconst react_1 = __importDefault(require(\"react\"));\nconst mui_1 = require(\"tss-react/mui\");\nconst FieldName_1 = __importDefault(require(\"./FieldName\"));\nconst BasicValue_1 = __importDefault(require(\"./BasicValue\"));\nconst useStyles = (0, mui_1.makeStyles)()({\n field: {\n display: 'flex',\n flexWrap: 'wrap',\n },\n});\nfunction SimpleField({ name, value, description, prefix, width, }) {\n const { classes } = useStyles();\n return value !== null && value !== undefined ? (react_1.default.createElement(\"div\", { className: classes.field },\n react_1.default.createElement(FieldName_1.default, { prefix: prefix, description: description, name: name, width: width }),\n react_1.default.createElement(BasicValue_1.default, { value: value }))) : null;\n}\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isEmpty = isEmpty;\nexports.generateTitle = generateTitle;\nexports.generateMaxWidth = generateMaxWidth;\nexports.accessNested = accessNested;\nconst is_object_1 = __importDefault(require(\"is-object\"));\nconst util_1 = require(\"../../util\");\nconst util_2 = require(\"../util\");\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction generateTitle(name, id, type) {\n return [(0, util_2.ellipses)(`${name || id || ''}`), `${type}`]\n .filter(f => !!f)\n .join(' - ');\n}\nfunction generateMaxWidth(array, prefix) {\n return (Math.ceil((0, util_1.max)(array.map(key => (0, util_1.measureText)([...prefix, key[0]].join('.'), 12)))) + 10);\n}\n// pick using a path from an object, similar to _.get from lodash with special\n// logic for Descriptions from e.g. VCF headers\n//\n// @param arr example ['a','b'], obj = {a:{b:'hello}}\n// @returns hello (with special addition to grab description also)\nfunction accessNested(arr, obj = {}) {\n let obj2 = obj;\n arr.forEach(elt => {\n if ((0, is_object_1.default)(obj2)) {\n obj2 = obj2[elt];\n }\n });\n return typeof obj2 === 'string'\n ? obj2\n : (0, is_object_1.default)(obj2) && typeof obj2.Description === 'string'\n ? obj2.Description\n : undefined;\n}\n","import * as React from 'react';\nexport const GridApiContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== 'production') {\n GridApiContext.displayName = 'GridApiContext';\n}","import * as React from 'react';\nimport { GridApiContext } from \"../../components/GridApiContext.js\";\nexport function useGridApiContext() {\n const apiRef = React.useContext(GridApiContext);\n if (apiRef === undefined) {\n 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'));\n }\n return apiRef;\n}","import * as React from 'react';\n/**\n * Hook that instantiate a [[GridApiRef]].\n */\nexport const useGridApiRef = () => React.useRef({});","import * as React from 'react';\nconst GridRootPropsContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== 'production') {\n GridRootPropsContext.displayName = 'GridRootPropsContext';\n}\nexport { GridRootPropsContext };","import * as React from 'react';\nimport { GridRootPropsContext } from \"../../context/GridRootPropsContext.js\";\nexport const useGridRootProps = () => {\n const contextValue = React.useContext(GridRootPropsContext);\n if (!contextValue) {\n throw new Error('MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.');\n }\n return contextValue;\n};","export default function composeClasses(slots, getUtilityClass, classes = undefined) {\n const output = {};\n Object.keys(slots).forEach(\n // `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.\n // @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208\n slot => {\n output[slot] = slots[slot].reduce((acc, key) => {\n if (key) {\n const utilityClass = getUtilityClass(key);\n if (utilityClass !== '') {\n acc.push(utilityClass);\n }\n if (classes && classes[key]) {\n acc.push(classes[key]);\n }\n }\n return acc;\n }, []).join(' ');\n });\n return output;\n}","/**\n * WARNING: Don't import this directly.\n * Use `MuiError` from `@mui/internal-babel-macros/MuiError.macro` instead.\n * @param {number} code\n */\nexport default function formatMuiErrorMessage(code) {\n // Apply babel-plugin-transform-template-literals in loose mode\n // loose mode is safe if we're concatenating primitives\n // see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose\n /* eslint-disable prefer-template */\n let url = 'https://mui.com/production-error/?code=' + code;\n for (let i = 1; i < arguments.length; i += 1) {\n // rest params over-transpile for this case\n // eslint-disable-next-line prefer-rest-params\n url += '&args[]=' + encodeURIComponent(arguments[i]);\n }\n return 'Minified MUI error #' + code + '; visit ' + url + ' for the full message.';\n /* eslint-enable prefer-template */\n}","import _formatMuiErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\n// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.\n//\n// A strict capitalization should uppercase the first letter of each word in the sentence.\n// We only handle the first word.\nexport default function capitalize(string) {\n if (typeof string !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`capitalize(string)\\` expects a string argument.` : _formatMuiErrorMessage(7));\n }\n return string.charAt(0).toUpperCase() + string.slice(1);\n}","// Corresponds to 10 frames at 60 Hz.\n// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.\nexport default function debounce(func, wait = 166) {\n let timeout;\n function debounced(...args) {\n const later = () => {\n // @ts-ignore\n func.apply(this, args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n debounced.clear = () => {\n clearTimeout(timeout);\n };\n return debounced;\n}","export default function ownerDocument(node) {\n return node && node.ownerDocument || document;\n}","import ownerDocument from '../ownerDocument';\nexport default function ownerWindow(node) {\n const doc = ownerDocument(node);\n return doc.defaultView || window;\n}","/**\n * TODO v5: consider making it private\n *\n * passes {value} to {ref}\n *\n * WARNING: Be sure to only call this inside a callback that is passed as a ref.\n * Otherwise, make sure to cleanup the previous {ref} if it changes. See\n * https://github.com/mui/material-ui/issues/13539\n *\n * Useful if you want to expose the ref of an inner component to the public API\n * while still using it inside the component.\n * @param ref A ref callback or ref object. If anything falsy, this is a no-op.\n */\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.\n * This is useful for effects that are only needed for client-side rendering but not for SSR.\n *\n * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * and confirm it doesn't apply to your use-case.\n */\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nexport default useEnhancedEffect;","'use client';\n\nimport * as React from 'react';\nlet globalId = 0;\nfunction useGlobalId(idOverride) {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`mui-${globalId}`);\n }\n }, [defaultId]);\n return id;\n}\n\n// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814\nconst maybeReactUseId = React['useId'.toString()];\n/**\n *\n * @example
\n * @param idOverride\n * @returns {string}\n */\nexport default function useId(idOverride) {\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride != null ? idOverride : reactId;\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride);\n}","'use client';\n\nimport * as React from 'react';\nimport useEnhancedEffect from '../useEnhancedEffect';\n\n/**\n * Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892\n * See RFC in https://github.com/reactjs/rfcs/pull/220\n */\n\nfunction useEventCallback(fn) {\n const ref = React.useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return React.useRef((...args) =>\n // @ts-expect-error hide `this`\n (0, ref.current)(...args)).current;\n}\nexport default useEventCallback;","'use client';\n\nimport * as React from 'react';\nimport setRef from '../setRef';\nexport default function useForkRef(...refs) {\n /**\n * This will create a new function if the refs passed to this hook change and are all defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior.\n */\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return instance => {\n refs.forEach(ref => {\n setRef(ref, instance);\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}","'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized lazily with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useLazyRef(sortColumns, columns)\n */\nexport default function useLazyRef(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}","'use client';\n\nimport * as React from 'react';\nconst EMPTY = [];\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport default function useOnMount(fn) {\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}","'use client';\n\nimport useLazyRef from '../useLazyRef/useLazyRef';\nimport useOnMount from '../useOnMount/useOnMount';\nexport class Timeout {\n constructor() {\n this.currentId = null;\n this.clear = () => {\n if (this.currentId !== null) {\n clearTimeout(this.currentId);\n this.currentId = null;\n }\n };\n this.disposeEffect = () => {\n return this.clear;\n };\n }\n static create() {\n return new Timeout();\n }\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n start(delay, fn) {\n this.clear();\n this.currentId = setTimeout(() => {\n this.currentId = null;\n fn();\n }, delay);\n }\n}\nexport default function useTimeout() {\n const timeout = useLazyRef(Timeout.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","const defaultGenerator = componentName => componentName;\nconst createClassNameGenerator = () => {\n let generate = defaultGenerator;\n return {\n configure(generator) {\n generate = generator;\n },\n generate(componentName) {\n return generate(componentName);\n },\n reset() {\n generate = defaultGenerator;\n }\n };\n};\nconst ClassNameGenerator = createClassNameGenerator();\nexport default ClassNameGenerator;","import ClassNameGenerator from '../ClassNameGenerator';\nexport const globalStateClasses = {\n active: 'active',\n checked: 'checked',\n completed: 'completed',\n disabled: 'disabled',\n error: 'error',\n expanded: 'expanded',\n focused: 'focused',\n focusVisible: 'focusVisible',\n open: 'open',\n readOnly: 'readOnly',\n required: 'required',\n selected: 'selected'\n};\nexport default function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {\n const globalStateClass = globalStateClasses[slot];\n return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;\n}\nexport function isGlobalState(slot) {\n return globalStateClasses[slot] !== undefined;\n}","import generateUtilityClass from '../generateUtilityClass';\nexport default function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {\n const result = {};\n slots.forEach(slot => {\n result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);\n });\n return result;\n}","const is = Object.is;\nexport function fastObjectShallowCompare(a, b) {\n if (a === b) {\n return true;\n }\n if (!(a instanceof Object) || !(b instanceof Object)) {\n return false;\n }\n let aLength = 0;\n let bLength = 0;\n\n /* eslint-disable guard-for-in */\n for (const key in a) {\n aLength += 1;\n if (!is(a[key], b[key])) {\n return false;\n }\n if (!(key in b)) {\n return false;\n }\n }\n\n /* eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars */\n for (const _ in b) {\n bLength += 1;\n }\n return aLength === bLength;\n}","import * as React from 'react';\nimport { fastObjectShallowCompare } from \"../fastObjectShallowCompare/index.js\";\nexport function fastMemo(component) {\n return /*#__PURE__*/React.memo(component, fastObjectShallowCompare);\n}","// A guide to feature toggling (deprecated)\n//\n// The feature toggle is:\n// - independent from the NODE_ENV\n// - isn't pruning code in production, as the objective is to eventually ship the code.\n// - doesn't allow to cherry-pick which feature to enable\n//\n// By default, the experimental features are only enabled in:\n// - the local environment\n// - the pull request previews\n//\n// Reviewers can force the value with the local storage and the GRID_EXPERIMENTAL_ENABLED key:\n// - 'true' => force it to be enabled\n// - 'false' => force it to be disabled\n//\n// Developers (users) are discouraged to enable the experimental feature by setting the GRID_EXPERIMENTAL_ENABLED env.\n// Instead, prefer exposing experimental APIs, for instance, a prop or a new `unstable_` module.\n\nexport const GRID_EXPERIMENTAL_ENABLED = false;","export const GRID_DEFAULT_LOCALE_TEXT = {\n // Root\n noRowsLabel: 'No rows',\n noResultsOverlayLabel: 'No results found.',\n // Density selector toolbar button text\n toolbarDensity: 'Density',\n toolbarDensityLabel: 'Density',\n toolbarDensityCompact: 'Compact',\n toolbarDensityStandard: 'Standard',\n toolbarDensityComfortable: 'Comfortable',\n // Columns selector toolbar button text\n toolbarColumns: 'Columns',\n toolbarColumnsLabel: 'Select columns',\n // Filters toolbar button text\n toolbarFilters: 'Filters',\n toolbarFiltersLabel: 'Show filters',\n toolbarFiltersTooltipHide: 'Hide filters',\n toolbarFiltersTooltipShow: 'Show filters',\n toolbarFiltersTooltipActive: count => count !== 1 ? `${count} active filters` : `${count} active filter`,\n // Quick filter toolbar field\n toolbarQuickFilterPlaceholder: 'Search…',\n toolbarQuickFilterLabel: 'Search',\n toolbarQuickFilterDeleteIconLabel: 'Clear',\n // Export selector toolbar button text\n toolbarExport: 'Export',\n toolbarExportLabel: 'Export',\n toolbarExportCSV: 'Download as CSV',\n toolbarExportPrint: 'Print',\n toolbarExportExcel: 'Download as Excel',\n // Columns management text\n columnsManagementSearchTitle: 'Search',\n columnsManagementNoColumns: 'No columns',\n columnsManagementShowHideAllText: 'Show/Hide All',\n columnsManagementReset: 'Reset',\n // Filter panel text\n filterPanelAddFilter: 'Add filter',\n filterPanelRemoveAll: 'Remove all',\n filterPanelDeleteIconLabel: 'Delete',\n filterPanelLogicOperator: 'Logic operator',\n filterPanelOperator: 'Operator',\n filterPanelOperatorAnd: 'And',\n filterPanelOperatorOr: 'Or',\n filterPanelColumns: 'Columns',\n filterPanelInputLabel: 'Value',\n filterPanelInputPlaceholder: 'Filter value',\n // Filter operators text\n filterOperatorContains: 'contains',\n filterOperatorDoesNotContain: 'does not contain',\n filterOperatorEquals: 'equals',\n filterOperatorDoesNotEqual: 'does not equal',\n filterOperatorStartsWith: 'starts with',\n filterOperatorEndsWith: 'ends with',\n filterOperatorIs: 'is',\n filterOperatorNot: 'is not',\n filterOperatorAfter: 'is after',\n filterOperatorOnOrAfter: 'is on or after',\n filterOperatorBefore: 'is before',\n filterOperatorOnOrBefore: 'is on or before',\n filterOperatorIsEmpty: 'is empty',\n filterOperatorIsNotEmpty: 'is not empty',\n filterOperatorIsAnyOf: 'is any of',\n 'filterOperator=': '=',\n 'filterOperator!=': '!=',\n 'filterOperator>': '>',\n 'filterOperator>=': '>=',\n 'filterOperator<': '<',\n 'filterOperator<=': '<=',\n // Header filter operators text\n headerFilterOperatorContains: 'Contains',\n headerFilterOperatorDoesNotContain: 'Does not contain',\n headerFilterOperatorEquals: 'Equals',\n headerFilterOperatorDoesNotEqual: 'Does not equal',\n headerFilterOperatorStartsWith: 'Starts with',\n headerFilterOperatorEndsWith: 'Ends with',\n headerFilterOperatorIs: 'Is',\n headerFilterOperatorNot: 'Is not',\n headerFilterOperatorAfter: 'Is after',\n headerFilterOperatorOnOrAfter: 'Is on or after',\n headerFilterOperatorBefore: 'Is before',\n headerFilterOperatorOnOrBefore: 'Is on or before',\n headerFilterOperatorIsEmpty: 'Is empty',\n headerFilterOperatorIsNotEmpty: 'Is not empty',\n headerFilterOperatorIsAnyOf: 'Is any of',\n 'headerFilterOperator=': 'Equals',\n 'headerFilterOperator!=': 'Not equals',\n 'headerFilterOperator>': 'Greater than',\n 'headerFilterOperator>=': 'Greater than or equal to',\n 'headerFilterOperator<': 'Less than',\n 'headerFilterOperator<=': 'Less than or equal to',\n // Filter values text\n filterValueAny: 'any',\n filterValueTrue: 'true',\n filterValueFalse: 'false',\n // Column menu text\n columnMenuLabel: 'Menu',\n columnMenuShowColumns: 'Show columns',\n columnMenuManageColumns: 'Manage columns',\n columnMenuFilter: 'Filter',\n columnMenuHideColumn: 'Hide column',\n columnMenuUnsort: 'Unsort',\n columnMenuSortAsc: 'Sort by ASC',\n columnMenuSortDesc: 'Sort by DESC',\n // Column header text\n columnHeaderFiltersTooltipActive: count => count !== 1 ? `${count} active filters` : `${count} active filter`,\n columnHeaderFiltersLabel: 'Show filters',\n columnHeaderSortIconLabel: 'Sort',\n // Rows selected footer text\n footerRowSelected: count => count !== 1 ? `${count.toLocaleString()} rows selected` : `${count.toLocaleString()} row selected`,\n // Total row amount footer text\n footerTotalRows: 'Total Rows:',\n // Total visible row amount footer text\n footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} of ${totalCount.toLocaleString()}`,\n // Checkbox selection text\n checkboxSelectionHeaderName: 'Checkbox selection',\n checkboxSelectionSelectAllRows: 'Select all rows',\n checkboxSelectionUnselectAllRows: 'Unselect all rows',\n checkboxSelectionSelectRow: 'Select row',\n checkboxSelectionUnselectRow: 'Unselect row',\n // Boolean cell text\n booleanCellTrueLabel: 'yes',\n booleanCellFalseLabel: 'no',\n // Actions cell more text\n actionsCellMore: 'more',\n // Column pinning text\n pinToLeft: 'Pin to left',\n pinToRight: 'Pin to right',\n unpin: 'Unpin',\n // Tree Data\n treeDataGroupingHeaderName: 'Group',\n treeDataExpand: 'see children',\n treeDataCollapse: 'hide children',\n // Grouping columns\n groupingColumnHeaderName: 'Group',\n groupColumn: name => `Group by ${name}`,\n unGroupColumn: name => `Stop grouping by ${name}`,\n // Master/detail\n detailPanelToggle: 'Detail panel toggle',\n expandDetailPanel: 'Expand',\n collapseDetailPanel: 'Collapse',\n // Used core components translation keys\n MuiTablePagination: {},\n // Row reordering text\n rowReorderingHeaderName: 'Row reordering',\n // Aggregation\n aggregationMenuItemHeader: 'Aggregation',\n aggregationFunctionLabelSum: 'sum',\n aggregationFunctionLabelAvg: 'avg',\n aggregationFunctionLabelMin: 'min',\n aggregationFunctionLabelMax: 'max',\n aggregationFunctionLabelSize: 'size'\n};","import { unstable_generateUtilityClasses as generateUtilityClasses, unstable_generateUtilityClass as generateUtilityClass } from '@mui/utils';\nexport function getDataGridUtilityClass(slot) {\n return generateUtilityClass('MuiDataGrid', slot);\n}\nexport const gridClasses = generateUtilityClasses('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', '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', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--header', 'scrollbarFiller--borderTop', 'scrollbarFiller--borderBottom', 'scrollbarFiller--pinnedRight', 'selectedRowCount', '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', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);","// If no effect ran after this amount of time, we assume that the render was not committed by React\nconst CLEANUP_TIMER_LOOP_MILLIS = 1000;\nexport class TimerBasedCleanupTracking {\n constructor(timeout = CLEANUP_TIMER_LOOP_MILLIS) {\n this.timeouts = new Map();\n this.cleanupTimeout = CLEANUP_TIMER_LOOP_MILLIS;\n this.cleanupTimeout = timeout;\n }\n register(object, unsubscribe, unregisterToken) {\n if (!this.timeouts) {\n this.timeouts = new Map();\n }\n const timeout = setTimeout(() => {\n if (typeof unsubscribe === 'function') {\n unsubscribe();\n }\n this.timeouts.delete(unregisterToken.cleanupToken);\n }, this.cleanupTimeout);\n this.timeouts.set(unregisterToken.cleanupToken, timeout);\n }\n unregister(unregisterToken) {\n const timeout = this.timeouts.get(unregisterToken.cleanupToken);\n if (timeout) {\n this.timeouts.delete(unregisterToken.cleanupToken);\n clearTimeout(timeout);\n }\n }\n reset() {\n if (this.timeouts) {\n this.timeouts.forEach((value, key) => {\n this.unregister({\n cleanupToken: key\n });\n });\n this.timeouts = undefined;\n }\n }\n}","export class FinalizationRegistryBasedCleanupTracking {\n constructor() {\n this.registry = new FinalizationRegistry(unsubscribe => {\n if (typeof unsubscribe === 'function') {\n unsubscribe();\n }\n });\n }\n register(object, unsubscribe, unregisterToken) {\n this.registry.register(object, unsubscribe, unregisterToken);\n }\n unregister(unregisterToken) {\n this.registry.unregister(unregisterToken);\n }\n\n // eslint-disable-next-line class-methods-use-this\n reset() {}\n}","import * as React from 'react';\nimport { TimerBasedCleanupTracking } from \"../../utils/cleanupTracking/TimerBasedCleanupTracking.js\";\nimport { FinalizationRegistryBasedCleanupTracking } from \"../../utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.js\";\n/**\n * Signal to the underlying logic what version of the public component API\n * of the data grid is exposed.\n */\nvar GridSignature = /*#__PURE__*/function (GridSignature) {\n GridSignature[\"DataGrid\"] = \"DataGrid\";\n GridSignature[\"DataGridPro\"] = \"DataGridPro\";\n GridSignature[\"DataGridPremium\"] = \"DataGridPremium\";\n return GridSignature;\n}(GridSignature || {});\n// We use class to make it easier to detect in heap snapshots by name\nclass ObjectToBeRetainedByReact {}\n\n// Based on https://github.com/Bnaya/use-dispose-uncommitted/blob/main/src/finalization-registry-based-impl.ts\n// Check https://github.com/facebook/react/issues/15317 to get more information\nexport function createUseGridApiEventHandler(registryContainer) {\n let cleanupTokensCounter = 0;\n return function useGridApiEventHandler(apiRef, eventName, handler, options) {\n if (registryContainer.registry === null) {\n registryContainer.registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistryBasedCleanupTracking() : new TimerBasedCleanupTracking();\n }\n const [objectRetainedByReact] = React.useState(new ObjectToBeRetainedByReact());\n const subscription = React.useRef(null);\n const handlerRef = React.useRef();\n handlerRef.current = handler;\n const cleanupTokenRef = React.useRef(null);\n if (!subscription.current && handlerRef.current) {\n const enhancedHandler = (params, event, details) => {\n if (!event.defaultMuiPrevented) {\n handlerRef.current?.(params, event, details);\n }\n };\n subscription.current = apiRef.current.subscribeEvent(eventName, enhancedHandler, options);\n cleanupTokensCounter += 1;\n cleanupTokenRef.current = {\n cleanupToken: cleanupTokensCounter\n };\n registryContainer.registry.register(objectRetainedByReact,\n // The callback below will be called once this reference stops being retained\n () => {\n subscription.current?.();\n subscription.current = null;\n cleanupTokenRef.current = null;\n }, cleanupTokenRef.current);\n } else if (!handlerRef.current && subscription.current) {\n subscription.current();\n subscription.current = null;\n if (cleanupTokenRef.current) {\n registryContainer.registry.unregister(cleanupTokenRef.current);\n cleanupTokenRef.current = null;\n }\n }\n React.useEffect(() => {\n if (!subscription.current && handlerRef.current) {\n const enhancedHandler = (params, event, details) => {\n if (!event.defaultMuiPrevented) {\n handlerRef.current?.(params, event, details);\n }\n };\n subscription.current = apiRef.current.subscribeEvent(eventName, enhancedHandler, options);\n }\n if (cleanupTokenRef.current && registryContainer.registry) {\n // If the effect was called, it means that this render was committed\n // so we can trust the cleanup function to remove the listener.\n registryContainer.registry.unregister(cleanupTokenRef.current);\n cleanupTokenRef.current = null;\n }\n return () => {\n subscription.current?.();\n subscription.current = null;\n };\n }, [apiRef, eventName, options]);\n };\n}\nconst registryContainer = {\n registry: null\n};\n\n// TODO: move to @mui/x-data-grid/internals\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const unstable_resetCleanupTracking = () => {\n registryContainer.registry?.reset();\n registryContainer.registry = null;\n};\nexport const useGridApiEventHandler = createUseGridApiEventHandler(registryContainer);\nconst optionsSubscriberOptions = {\n isFirst: true\n};\nexport function useGridApiOptionHandler(apiRef, eventName, handler) {\n useGridApiEventHandler(apiRef, eventName, handler, optionsSubscriberOptions);\n}\nexport { GridSignature };","import * as React from 'react';\nimport { fastObjectShallowCompare } from '@mui/x-internals/fastObjectShallowCompare';\nimport { warnOnce } from '@mui/x-internals/warning';\nimport { useLazyRef } from \"./useLazyRef.js\";\nimport { useOnMount } from \"./useOnMount.js\";\nfunction isOutputSelector(selector) {\n return selector.acceptsApiRef;\n}\n// TODO v8: Remove this function\nfunction applySelector(apiRef, selector) {\n if (isOutputSelector(selector)) {\n return selector(apiRef);\n }\n return selector(apiRef.current.state);\n}\n\n// TODO v8: Rename this function to `applySelector`\nfunction applySelectorV8(apiRef, selector, args, instanceId) {\n if (isOutputSelector(selector)) {\n return selector(apiRef, args);\n }\n return selector(apiRef.current.state, instanceId);\n}\nconst defaultCompare = Object.is;\nexport const objectShallowCompare = fastObjectShallowCompare;\nconst createRefs = () => ({\n state: null,\n equals: null,\n selector: null\n});\n\n// TODO v8: Remove this function\nexport const useGridSelector = (apiRef, selector, equals = defaultCompare) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!apiRef.current.state) {\n warnOnce(['MUI X: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);\n }\n }\n const refs = useLazyRef(createRefs);\n const didInit = refs.current.selector !== null;\n const [state, setState] = React.useState(\n // We don't use an initialization function to avoid allocations\n didInit ? null : applySelector(apiRef, selector));\n refs.current.state = state;\n refs.current.equals = equals;\n refs.current.selector = selector;\n useOnMount(() => {\n return apiRef.current.store.subscribe(() => {\n const newState = applySelector(apiRef, refs.current.selector);\n if (!refs.current.equals(refs.current.state, newState)) {\n refs.current.state = newState;\n setState(newState);\n }\n });\n });\n return state;\n};\n\n// TODO v8: Rename this function to `useGridSelector`\nexport const useGridSelectorV8 = (apiRef, selector, args = undefined, equals = defaultCompare) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!apiRef.current.state) {\n warnOnce(['MUI X: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);\n }\n }\n const refs = useLazyRef(createRefs);\n const didInit = refs.current.selector !== null;\n const [state, setState] = React.useState(\n // We don't use an initialization function to avoid allocations\n didInit ? null : applySelectorV8(apiRef, selector, args, apiRef.current.instanceId));\n refs.current.state = state;\n refs.current.equals = equals;\n refs.current.selector = selector;\n useOnMount(() => {\n return apiRef.current.store.subscribe(() => {\n const newState = applySelectorV8(apiRef, refs.current.selector, args, apiRef.current.instanceId);\n if (!refs.current.equals(refs.current.state, newState)) {\n refs.current.state = newState;\n setState(newState);\n }\n });\n });\n return state;\n};","export const gridDimensionsSelector = state => state.dimensions;","// src/devModeChecks/identityFunctionCheck.ts\nvar runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => {\n if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) {\n let isInputSameAsOutput = false;\n try {\n const emptyObject = {};\n if (resultFunc(emptyObject) === emptyObject)\n isInputSameAsOutput = true;\n } catch {\n }\n if (isInputSameAsOutput) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"The result function returned its own inputs without modification. e.g\\n`createSelector([state => state.todos], todos => todos)`\\nThis could lead to inefficient memoization and unnecessary re-renders.\\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.\",\n { stack }\n );\n }\n }\n};\n\n// src/devModeChecks/inputStabilityCheck.ts\nvar runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => {\n const { memoize, memoizeOptions } = options;\n const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject;\n const createAnEmptyObject = memoize(() => ({}), ...memoizeOptions);\n const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy);\n if (!areInputSelectorResultsEqual) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"An input selector returned a different result when passed same arguments.\\nThis means your output selector will likely run more frequently than intended.\\nAvoid returning a new reference inside your input selector, e.g.\\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`\",\n {\n arguments: inputSelectorArgs,\n firstInputs: inputSelectorResults,\n secondInputs: inputSelectorResultsCopy,\n stack\n }\n );\n }\n};\n\n// src/devModeChecks/setGlobalDevModeChecks.ts\nvar globalDevModeChecks = {\n inputStabilityCheck: \"once\",\n identityFunctionCheck: \"once\"\n};\nvar setGlobalDevModeChecks = (devModeChecks) => {\n Object.assign(globalDevModeChecks, devModeChecks);\n};\n\n// src/utils.ts\nvar NOT_FOUND = /* @__PURE__ */ Symbol(\"NOT_FOUND\");\nfunction assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) {\n if (typeof func !== \"function\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsObject(object, errorMessage = `expected an object, instead received ${typeof object}`) {\n if (typeof object !== \"object\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) {\n if (!array.every((item) => typeof item === \"function\")) {\n const itemTypes = array.map(\n (item) => typeof item === \"function\" ? `function ${item.name || \"unnamed\"}()` : typeof item\n ).join(\", \");\n throw new TypeError(`${errorMessage}[${itemTypes}]`);\n }\n}\nvar ensureIsArray = (item) => {\n return Array.isArray(item) ? item : [item];\n};\nfunction getDependencies(createSelectorArgs) {\n const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs;\n assertIsArrayOfFunctions(\n dependencies,\n `createSelector expects all input-selectors to be functions, but received the following types: `\n );\n return dependencies;\n}\nfunction collectInputSelectorResults(dependencies, inputSelectorArgs) {\n const inputSelectorResults = [];\n const { length } = dependencies;\n for (let i = 0; i < length; i++) {\n inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs));\n }\n return inputSelectorResults;\n}\nvar getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => {\n const { identityFunctionCheck, inputStabilityCheck } = {\n ...globalDevModeChecks,\n ...devModeChecks\n };\n return {\n identityFunctionCheck: {\n shouldRun: identityFunctionCheck === \"always\" || identityFunctionCheck === \"once\" && firstRun,\n run: runIdentityFunctionCheck\n },\n inputStabilityCheck: {\n shouldRun: inputStabilityCheck === \"always\" || inputStabilityCheck === \"once\" && firstRun,\n run: runInputStabilityCheck\n }\n };\n};\n\n// src/autotrackMemoize/autotracking.ts\nvar $REVISION = 0;\nvar CURRENT_TRACKER = null;\nvar Cell = class {\n revision = $REVISION;\n _value;\n _lastValue;\n _isEqual = tripleEq;\n constructor(initialValue, isEqual = tripleEq) {\n this._value = this._lastValue = initialValue;\n this._isEqual = isEqual;\n }\n // Whenever a storage value is read, it'll add itself to the current tracker if\n // one exists, entangling its state with that cache.\n get value() {\n CURRENT_TRACKER?.add(this);\n return this._value;\n }\n // Whenever a storage value is updated, we bump the global revision clock,\n // assign the revision for this storage to the new value, _and_ we schedule a\n // rerender. This is important, and it's what makes autotracking _pull_\n // based. We don't actively tell the caches which depend on the storage that\n // anything has happened. Instead, we recompute the caches when needed.\n set value(newValue) {\n if (this.value === newValue)\n return;\n this._value = newValue;\n this.revision = ++$REVISION;\n }\n};\nfunction tripleEq(a, b) {\n return a === b;\n}\nvar TrackingCache = class {\n _cachedValue;\n _cachedRevision = -1;\n _deps = [];\n hits = 0;\n fn;\n constructor(fn) {\n this.fn = fn;\n }\n clear() {\n this._cachedValue = void 0;\n this._cachedRevision = -1;\n this._deps = [];\n this.hits = 0;\n }\n get value() {\n if (this.revision > this._cachedRevision) {\n const { fn } = this;\n const currentTracker = /* @__PURE__ */ new Set();\n const prevTracker = CURRENT_TRACKER;\n CURRENT_TRACKER = currentTracker;\n this._cachedValue = fn();\n CURRENT_TRACKER = prevTracker;\n this.hits++;\n this._deps = Array.from(currentTracker);\n this._cachedRevision = this.revision;\n }\n CURRENT_TRACKER?.add(this);\n return this._cachedValue;\n }\n get revision() {\n return Math.max(...this._deps.map((d) => d.revision), 0);\n }\n};\nfunction getValue(cell) {\n if (!(cell instanceof Cell)) {\n console.warn(\"Not a valid cell! \", cell);\n }\n return cell.value;\n}\nfunction setValue(storage, value) {\n if (!(storage instanceof Cell)) {\n throw new TypeError(\n \"setValue must be passed a tracked store created with `createStorage`.\"\n );\n }\n storage.value = storage._lastValue = value;\n}\nfunction createCell(initialValue, isEqual = tripleEq) {\n return new Cell(initialValue, isEqual);\n}\nfunction createCache(fn) {\n assertIsFunction(\n fn,\n \"the first parameter to `createCache` must be a function\"\n );\n return new TrackingCache(fn);\n}\n\n// src/autotrackMemoize/tracking.ts\nvar neverEq = (a, b) => false;\nfunction createTag() {\n return createCell(null, neverEq);\n}\nfunction dirtyTag(tag, value) {\n setValue(tag, value);\n}\nvar consumeCollection = (node) => {\n let tag = node.collectionTag;\n if (tag === null) {\n tag = node.collectionTag = createTag();\n }\n getValue(tag);\n};\nvar dirtyCollection = (node) => {\n const tag = node.collectionTag;\n if (tag !== null) {\n dirtyTag(tag, null);\n }\n};\n\n// src/autotrackMemoize/proxy.ts\nvar REDUX_PROXY_LABEL = Symbol();\nvar nextId = 0;\nvar proto = Object.getPrototypeOf({});\nvar ObjectTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy(this, objectProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar objectProxyHandler = {\n get(node, key) {\n function calculateResult() {\n const { value } = node;\n const childValue = Reflect.get(value, key);\n if (typeof key === \"symbol\") {\n return childValue;\n }\n if (key in proto) {\n return childValue;\n }\n if (typeof childValue === \"object\" && childValue !== null) {\n let childNode = node.children[key];\n if (childNode === void 0) {\n childNode = node.children[key] = createNode(childValue);\n }\n if (childNode.tag) {\n getValue(childNode.tag);\n }\n return childNode.proxy;\n } else {\n let tag = node.tags[key];\n if (tag === void 0) {\n tag = node.tags[key] = createTag();\n tag.value = childValue;\n }\n getValue(tag);\n return childValue;\n }\n }\n const res = calculateResult();\n return res;\n },\n ownKeys(node) {\n consumeCollection(node);\n return Reflect.ownKeys(node.value);\n },\n getOwnPropertyDescriptor(node, prop) {\n return Reflect.getOwnPropertyDescriptor(node.value, prop);\n },\n has(node, prop) {\n return Reflect.has(node.value, prop);\n }\n};\nvar ArrayTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy([this], arrayProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar arrayProxyHandler = {\n get([node], key) {\n if (key === \"length\") {\n consumeCollection(node);\n }\n return objectProxyHandler.get(node, key);\n },\n ownKeys([node]) {\n return objectProxyHandler.ownKeys(node);\n },\n getOwnPropertyDescriptor([node], prop) {\n return objectProxyHandler.getOwnPropertyDescriptor(node, prop);\n },\n has([node], prop) {\n return objectProxyHandler.has(node, prop);\n }\n};\nfunction createNode(value) {\n if (Array.isArray(value)) {\n return new ArrayTreeNode(value);\n }\n return new ObjectTreeNode(value);\n}\nfunction updateNode(node, newValue) {\n const { value, tags, children } = node;\n node.value = newValue;\n if (Array.isArray(value) && Array.isArray(newValue) && value.length !== newValue.length) {\n dirtyCollection(node);\n } else {\n if (value !== newValue) {\n let oldKeysSize = 0;\n let newKeysSize = 0;\n let anyKeysAdded = false;\n for (const _key in value) {\n oldKeysSize++;\n }\n for (const key in newValue) {\n newKeysSize++;\n if (!(key in value)) {\n anyKeysAdded = true;\n break;\n }\n }\n const isDifferent = anyKeysAdded || oldKeysSize !== newKeysSize;\n if (isDifferent) {\n dirtyCollection(node);\n }\n }\n }\n for (const key in tags) {\n const childValue = value[key];\n const newChildValue = newValue[key];\n if (childValue !== newChildValue) {\n dirtyCollection(node);\n dirtyTag(tags[key], newChildValue);\n }\n if (typeof newChildValue === \"object\" && newChildValue !== null) {\n delete tags[key];\n }\n }\n for (const key in children) {\n const childNode = children[key];\n const newChildValue = newValue[key];\n const childValue = childNode.value;\n if (childValue === newChildValue) {\n continue;\n } else if (typeof newChildValue === \"object\" && newChildValue !== null) {\n updateNode(childNode, newChildValue);\n } else {\n deleteNode(childNode);\n delete children[key];\n }\n }\n}\nfunction deleteNode(node) {\n if (node.tag) {\n dirtyTag(node.tag, null);\n }\n dirtyCollection(node);\n for (const key in node.tags) {\n dirtyTag(node.tags[key], null);\n }\n for (const key in node.children) {\n deleteNode(node.children[key]);\n }\n}\n\n// src/lruMemoize.ts\nfunction createSingletonCache(equals) {\n let entry;\n return {\n get(key) {\n if (entry && equals(entry.key, key)) {\n return entry.value;\n }\n return NOT_FOUND;\n },\n put(key, value) {\n entry = { key, value };\n },\n getEntries() {\n return entry ? [entry] : [];\n },\n clear() {\n entry = void 0;\n }\n };\n}\nfunction createLruCache(maxSize, equals) {\n let entries = [];\n function get(key) {\n const cacheIndex = entries.findIndex((entry) => equals(key, entry.key));\n if (cacheIndex > -1) {\n const entry = entries[cacheIndex];\n if (cacheIndex > 0) {\n entries.splice(cacheIndex, 1);\n entries.unshift(entry);\n }\n return entry.value;\n }\n return NOT_FOUND;\n }\n function put(key, value) {\n if (get(key) === NOT_FOUND) {\n entries.unshift({ key, value });\n if (entries.length > maxSize) {\n entries.pop();\n }\n }\n }\n function getEntries() {\n return entries;\n }\n function clear() {\n entries = [];\n }\n return { get, put, getEntries, clear };\n}\nvar referenceEqualityCheck = (a, b) => a === b;\nfunction createCacheKeyComparator(equalityCheck) {\n return function areArgumentsShallowlyEqual(prev, next) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n const { length } = prev;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n return true;\n };\n}\nfunction lruMemoize(func, equalityCheckOrOptions) {\n const providedOptions = typeof equalityCheckOrOptions === \"object\" ? equalityCheckOrOptions : { equalityCheck: equalityCheckOrOptions };\n const {\n equalityCheck = referenceEqualityCheck,\n maxSize = 1,\n resultEqualityCheck\n } = providedOptions;\n const comparator = createCacheKeyComparator(equalityCheck);\n let resultsCount = 0;\n const cache = maxSize <= 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);\n function memoized() {\n let value = cache.get(arguments);\n if (value === NOT_FOUND) {\n value = func.apply(null, arguments);\n resultsCount++;\n if (resultEqualityCheck) {\n const entries = cache.getEntries();\n const matchingEntry = entries.find(\n (entry) => resultEqualityCheck(entry.value, value)\n );\n if (matchingEntry) {\n value = matchingEntry.value;\n resultsCount !== 0 && resultsCount--;\n }\n }\n cache.put(arguments, value);\n }\n return value;\n }\n memoized.clearCache = () => {\n cache.clear();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/autotrackMemoize/autotrackMemoize.ts\nfunction autotrackMemoize(func) {\n const node = createNode(\n []\n );\n let lastArgs = null;\n const shallowEqual = createCacheKeyComparator(referenceEqualityCheck);\n const cache = createCache(() => {\n const res = func.apply(null, node.proxy);\n return res;\n });\n function memoized() {\n if (!shallowEqual(lastArgs, arguments)) {\n updateNode(node, arguments);\n lastArgs = arguments;\n }\n return cache.value;\n }\n memoized.clearCache = () => {\n return cache.clear();\n };\n return memoized;\n}\n\n// src/weakMapMemoize.ts\nvar StrongRef = class {\n constructor(value) {\n this.value = value;\n }\n deref() {\n return this.value;\n }\n};\nvar Ref = typeof WeakRef !== \"undefined\" ? WeakRef : StrongRef;\nvar UNTERMINATED = 0;\nvar TERMINATED = 1;\nfunction createCacheNode() {\n return {\n s: UNTERMINATED,\n v: void 0,\n o: null,\n p: null\n };\n}\nfunction weakMapMemoize(func, options = {}) {\n let fnNode = createCacheNode();\n const { resultEqualityCheck } = options;\n let lastResult;\n let resultsCount = 0;\n function memoized() {\n let cacheNode = fnNode;\n const { length } = arguments;\n for (let i = 0, l = length; i < l; i++) {\n const arg = arguments[i];\n if (typeof arg === \"function\" || typeof arg === \"object\" && arg !== null) {\n let objectCache = cacheNode.o;\n if (objectCache === null) {\n cacheNode.o = objectCache = /* @__PURE__ */ new WeakMap();\n }\n const objectNode = objectCache.get(arg);\n if (objectNode === void 0) {\n cacheNode = createCacheNode();\n objectCache.set(arg, cacheNode);\n } else {\n cacheNode = objectNode;\n }\n } else {\n let primitiveCache = cacheNode.p;\n if (primitiveCache === null) {\n cacheNode.p = primitiveCache = /* @__PURE__ */ new Map();\n }\n const primitiveNode = primitiveCache.get(arg);\n if (primitiveNode === void 0) {\n cacheNode = createCacheNode();\n primitiveCache.set(arg, cacheNode);\n } else {\n cacheNode = primitiveNode;\n }\n }\n }\n const terminatedNode = cacheNode;\n let result;\n if (cacheNode.s === TERMINATED) {\n result = cacheNode.v;\n } else {\n result = func.apply(null, arguments);\n resultsCount++;\n if (resultEqualityCheck) {\n const lastResultValue = lastResult?.deref?.() ?? lastResult;\n if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) {\n result = lastResultValue;\n resultsCount !== 0 && resultsCount--;\n }\n const needsWeakRef = typeof result === \"object\" && result !== null || typeof result === \"function\";\n lastResult = needsWeakRef ? new Ref(result) : result;\n }\n }\n terminatedNode.s = TERMINATED;\n terminatedNode.v = result;\n return result;\n }\n memoized.clearCache = () => {\n fnNode = createCacheNode();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/createSelectorCreator.ts\nfunction createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) {\n const createSelectorCreatorOptions = typeof memoizeOrOptions === \"function\" ? {\n memoize: memoizeOrOptions,\n memoizeOptions: memoizeOptionsFromArgs\n } : memoizeOrOptions;\n const createSelector2 = (...createSelectorArgs) => {\n let recomputations = 0;\n let dependencyRecomputations = 0;\n let lastResult;\n let directlyPassedOptions = {};\n let resultFunc = createSelectorArgs.pop();\n if (typeof resultFunc === \"object\") {\n directlyPassedOptions = resultFunc;\n resultFunc = createSelectorArgs.pop();\n }\n assertIsFunction(\n resultFunc,\n `createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]`\n );\n const combinedOptions = {\n ...createSelectorCreatorOptions,\n ...directlyPassedOptions\n };\n const {\n memoize,\n memoizeOptions = [],\n argsMemoize = weakMapMemoize,\n argsMemoizeOptions = [],\n devModeChecks = {}\n } = combinedOptions;\n const finalMemoizeOptions = ensureIsArray(memoizeOptions);\n const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions);\n const dependencies = getDependencies(createSelectorArgs);\n const memoizedResultFunc = memoize(function recomputationWrapper() {\n recomputations++;\n return resultFunc.apply(\n null,\n arguments\n );\n }, ...finalMemoizeOptions);\n let firstRun = true;\n const selector = argsMemoize(function dependenciesChecker() {\n dependencyRecomputations++;\n const inputSelectorResults = collectInputSelectorResults(\n dependencies,\n arguments\n );\n lastResult = memoizedResultFunc.apply(null, inputSelectorResults);\n if (process.env.NODE_ENV !== \"production\") {\n const { identityFunctionCheck, inputStabilityCheck } = getDevModeChecksExecutionInfo(firstRun, devModeChecks);\n if (identityFunctionCheck.shouldRun) {\n identityFunctionCheck.run(\n resultFunc,\n inputSelectorResults,\n lastResult\n );\n }\n if (inputStabilityCheck.shouldRun) {\n const inputSelectorResultsCopy = collectInputSelectorResults(\n dependencies,\n arguments\n );\n inputStabilityCheck.run(\n { inputSelectorResults, inputSelectorResultsCopy },\n { memoize, memoizeOptions: finalMemoizeOptions },\n arguments\n );\n }\n if (firstRun)\n firstRun = false;\n }\n return lastResult;\n }, ...finalArgsMemoizeOptions);\n return Object.assign(selector, {\n resultFunc,\n memoizedResultFunc,\n dependencies,\n dependencyRecomputations: () => dependencyRecomputations,\n resetDependencyRecomputations: () => {\n dependencyRecomputations = 0;\n },\n lastResult: () => lastResult,\n recomputations: () => recomputations,\n resetRecomputations: () => {\n recomputations = 0;\n },\n memoize,\n argsMemoize\n });\n };\n Object.assign(createSelector2, {\n withTypes: () => createSelector2\n });\n return createSelector2;\n}\nvar createSelector = /* @__PURE__ */ createSelectorCreator(weakMapMemoize);\n\n// src/createStructuredSelector.ts\nvar createStructuredSelector = Object.assign(\n (inputSelectorsObject, selectorCreator = createSelector) => {\n assertIsObject(\n inputSelectorsObject,\n `createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof inputSelectorsObject}`\n );\n const inputSelectorKeys = Object.keys(inputSelectorsObject);\n const dependencies = inputSelectorKeys.map(\n (key) => inputSelectorsObject[key]\n );\n const structuredSelector = selectorCreator(\n dependencies,\n (...inputSelectorResults) => {\n return inputSelectorResults.reduce((composition, value, index) => {\n composition[inputSelectorKeys[index]] = value;\n return composition;\n }, {});\n }\n );\n return structuredSelector;\n },\n { withTypes: () => createStructuredSelector }\n);\nexport {\n createSelector,\n createSelectorCreator,\n createStructuredSelector,\n lruMemoize,\n referenceEqualityCheck,\n setGlobalDevModeChecks,\n autotrackMemoize as unstable_autotrackMemoize,\n weakMapMemoize\n};\n//# sourceMappingURL=reselect.mjs.map","import { lruMemoize, createSelectorCreator } from 'reselect';\nimport { warnOnce } from '@mui/x-internals/warning';\nconst reselectCreateSelector = createSelectorCreator({\n memoize: lruMemoize,\n memoizeOptions: {\n maxSize: 1,\n equalityCheck: Object.is\n }\n});\n\n// TODO v8: Remove this type\n\n// TODO v8: Rename this type to `OutputSelector`\n\n// TODO v8: Remove this type\n\n// TODO v8: Rename this type to `SelectorArgs`\n\n// TODO v8: Remove this type\n\n// TODO v8: Rename this type to `CreateSelectorFunction`\n\nconst cache = new WeakMap();\nfunction checkIsAPIRef(value) {\n return 'current' in value && 'instanceId' in value.current;\n}\nconst DEFAULT_INSTANCE_ID = {\n id: 'default'\n};\n\n// TODO v8: Remove this function\nexport const createSelector = (a, b, c, d, e, f, ...other) => {\n if (other.length > 0) {\n throw new Error('Unsupported number of selectors');\n }\n let selector;\n if (a && b && c && d && e && f) {\n selector = (stateOrApiRef, instanceIdParam) => {\n const isAPIRef = checkIsAPIRef(stateOrApiRef);\n const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);\n const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;\n const va = a(state, instanceId);\n const vb = b(state, instanceId);\n const vc = c(state, instanceId);\n const vd = d(state, instanceId);\n const ve = e(state, instanceId);\n return f(va, vb, vc, vd, ve);\n };\n } else if (a && b && c && d && e) {\n selector = (stateOrApiRef, instanceIdParam) => {\n const isAPIRef = checkIsAPIRef(stateOrApiRef);\n const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);\n const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;\n const va = a(state, instanceId);\n const vb = b(state, instanceId);\n const vc = c(state, instanceId);\n const vd = d(state, instanceId);\n return e(va, vb, vc, vd);\n };\n } else if (a && b && c && d) {\n selector = (stateOrApiRef, instanceIdParam) => {\n const isAPIRef = checkIsAPIRef(stateOrApiRef);\n const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);\n const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;\n const va = a(state, instanceId);\n const vb = b(state, instanceId);\n const vc = c(state, instanceId);\n return d(va, vb, vc);\n };\n } else if (a && b && c) {\n selector = (stateOrApiRef, instanceIdParam) => {\n const isAPIRef = checkIsAPIRef(stateOrApiRef);\n const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);\n const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;\n const va = a(state, instanceId);\n const vb = b(state, instanceId);\n return c(va, vb);\n };\n } else if (a && b) {\n selector = (stateOrApiRef, instanceIdParam) => {\n const isAPIRef = checkIsAPIRef(stateOrApiRef);\n const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);\n const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;\n const va = a(state, instanceId);\n return b(va);\n };\n } else {\n throw new Error('Missing arguments');\n }\n\n // We use this property to detect if the selector was created with createSelector\n // or it's only a simple function the receives the state and returns part of it.\n selector.acceptsApiRef = true;\n return selector;\n};\n\n// TODO v8: Rename this function to `createSelector`\nexport const createSelectorV8 = (a, b, c, d, e, f, ...other) => {\n if (other.length > 0) {\n throw new Error('Unsupported number of selectors');\n }\n let selector;\n if (a && b && c && d && e && f) {\n selector = (stateOrApiRef, args, instanceIdParam) => {\n const isAPIRef = checkIsAPIRef(stateOrApiRef);\n const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);\n const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;\n const va = a(state, args, instanceId);\n const vb = b(state, args, instanceId);\n const vc = c(state, args, instanceId);\n const vd = d(state, args, instanceId);\n const ve = e(state, args, instanceId);\n return f(va, vb, vc, vd, ve, args);\n };\n } else if (a && b && c && d && e) {\n selector = (stateOrApiRef, args, instanceIdParam) => {\n const isAPIRef = checkIsAPIRef(stateOrApiRef);\n const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);\n const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;\n const va = a(state, args, instanceId);\n const vb = b(state, args, instanceId);\n const vc = c(state, args, instanceId);\n const vd = d(state, args, instanceId);\n return e(va, vb, vc, vd, args);\n };\n } else if (a && b && c && d) {\n selector = (stateOrApiRef, args, instanceIdParam) => {\n const isAPIRef = checkIsAPIRef(stateOrApiRef);\n const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);\n const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;\n const va = a(state, args, instanceId);\n const vb = b(state, args, instanceId);\n const vc = c(state, args, instanceId);\n return d(va, vb, vc, args);\n };\n } else if (a && b && c) {\n selector = (stateOrApiRef, args, instanceIdParam) => {\n const isAPIRef = checkIsAPIRef(stateOrApiRef);\n const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);\n const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;\n const va = a(state, args, instanceId);\n const vb = b(state, args, instanceId);\n return c(va, vb, args);\n };\n } else if (a && b) {\n selector = (stateOrApiRef, args, instanceIdParam) => {\n const isAPIRef = checkIsAPIRef(stateOrApiRef);\n const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);\n const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;\n const va = a(state, args, instanceId);\n return b(va, args);\n };\n } else {\n throw new Error('Missing arguments');\n }\n\n // We use this property to detect if the selector was created with createSelector\n // or it's only a simple function the receives the state and returns part of it.\n selector.acceptsApiRef = true;\n return selector;\n};\n\n// TODO v8: Remove this function\nexport const createSelectorMemoized = (...args) => {\n const selector = (stateOrApiRef, instanceId) => {\n const isAPIRef = checkIsAPIRef(stateOrApiRef);\n const cacheKey = isAPIRef ? stateOrApiRef.current.instanceId : instanceId ?? DEFAULT_INSTANCE_ID;\n const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;\n if (process.env.NODE_ENV !== 'production') {\n if (cacheKey.id === 'default') {\n warnOnce(['MUI X: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, for example `mySelector(apiRef)`, or pass the instance ID explicitly, for example `mySelector(state, apiRef.current.instanceId)`.']);\n }\n }\n const cacheArgsInit = cache.get(cacheKey);\n const cacheArgs = cacheArgsInit ?? new Map();\n const cacheFn = cacheArgs?.get(args);\n if (cacheArgs && cacheFn) {\n // We pass the cache key because the called selector might have as\n // dependency another selector created with this `createSelector`.\n return cacheFn(state, cacheKey);\n }\n const fn = reselectCreateSelector(...args);\n if (!cacheArgsInit) {\n cache.set(cacheKey, cacheArgs);\n }\n cacheArgs.set(args, fn);\n return fn(state, cacheKey);\n };\n\n // We use this property to detect if the selector was created with createSelector\n // or it's only a simple function the receives the state and returns part of it.\n selector.acceptsApiRef = true;\n return selector;\n};\n\n// TODO v8: Rename this function to `createSelectorMemoized`\nexport const createSelectorMemoizedV8 = (...args) => {\n const selector = (stateOrApiRef, selectorArgs, instanceId) => {\n const isAPIRef = checkIsAPIRef(stateOrApiRef);\n const cacheKey = isAPIRef ? stateOrApiRef.current.instanceId : instanceId ?? DEFAULT_INSTANCE_ID;\n const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;\n if (process.env.NODE_ENV !== 'production') {\n if (cacheKey.id === 'default') {\n warnOnce(['MUI X: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, for example `mySelector(apiRef)`, or pass the instance ID explicitly, for example `mySelector(state, apiRef.current.instanceId)`.']);\n }\n }\n const cacheArgsInit = cache.get(cacheKey);\n const cacheArgs = cacheArgsInit ?? new Map();\n const cacheFn = cacheArgs?.get(args);\n if (cacheArgs && cacheFn) {\n // We pass the cache key because the called selector might have as\n // dependency another selector created with this `createSelector`.\n return cacheFn(state, selectorArgs, cacheKey);\n }\n const fn = reselectCreateSelector(...args);\n if (!cacheArgsInit) {\n cache.set(cacheKey, cacheArgs);\n }\n cacheArgs.set(args, fn);\n return fn(state, selectorArgs, cacheKey);\n };\n\n // We use this property to detect if the selector was created with createSelector\n // or it's only a simple function the receives the state and returns part of it.\n selector.acceptsApiRef = true;\n return selector;\n};","import { createSelector } from \"../../../utils/createSelector.js\";\nexport const COMPACT_DENSITY_FACTOR = 0.7;\nexport const COMFORTABLE_DENSITY_FACTOR = 1.3;\nconst DENSITY_FACTORS = {\n compact: COMPACT_DENSITY_FACTOR,\n comfortable: COMFORTABLE_DENSITY_FACTOR,\n standard: 1\n};\nexport const gridDensitySelector = state => state.density;\nexport const gridDensityFactorSelector = createSelector(gridDensitySelector, density => DENSITY_FACTORS[density]);","export let GridPinnedColumnPosition = /*#__PURE__*/function (GridPinnedColumnPosition) {\n GridPinnedColumnPosition[\"LEFT\"] = \"left\";\n GridPinnedColumnPosition[\"RIGHT\"] = \"right\";\n return GridPinnedColumnPosition;\n}({});\nexport const EMPTY_PINNED_COLUMN_FIELDS = {\n left: [],\n right: []\n};","/**\n * Get the theme state\n * @category Core\n */\nexport const gridIsRtlSelector = state => state.isRtl;","import { createSelector, createSelectorMemoized } from \"../../../utils/createSelector.js\";\nimport { EMPTY_PINNED_COLUMN_FIELDS } from \"./gridColumnsInterfaces.js\";\nimport { gridIsRtlSelector } from \"../../core/gridCoreSelector.js\";\n\n/**\n * Get the columns state\n * @category Columns\n */\nexport const gridColumnsStateSelector = state => state.columns;\n\n/**\n * Get an array of column fields in the order rendered on screen.\n * @category Columns\n */\nexport const gridColumnFieldsSelector = createSelector(gridColumnsStateSelector, columnsState => columnsState.orderedFields);\n\n/**\n * Get the columns as a lookup (an object containing the field for keys and the definition for values).\n * @category Columns\n */\nexport const gridColumnLookupSelector = createSelector(gridColumnsStateSelector, columnsState => columnsState.lookup);\n\n/**\n * Get an array of column definitions in the order rendered on screen..\n * @category Columns\n */\nexport const gridColumnDefinitionsSelector = createSelectorMemoized(gridColumnFieldsSelector, gridColumnLookupSelector, (allFields, lookup) => allFields.map(field => lookup[field]));\n\n/**\n * Get the column visibility model, containing the visibility status of each column.\n * If a column is not registered in the model, it is visible.\n * @category Visible Columns\n */\nexport const gridColumnVisibilityModelSelector = createSelector(gridColumnsStateSelector, columnsState => columnsState.columnVisibilityModel);\n\n/**\n * Get the visible columns as a lookup (an object containing the field for keys and the definition for values).\n * @category Visible Columns\n */\nexport const gridVisibleColumnDefinitionsSelector = createSelectorMemoized(gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector, (columns, columnVisibilityModel) => columns.filter(column => columnVisibilityModel[column.field] !== false));\n\n/**\n * Get the field of each visible column.\n * @category Visible Columns\n */\nexport const gridVisibleColumnFieldsSelector = createSelectorMemoized(gridVisibleColumnDefinitionsSelector, visibleColumns => visibleColumns.map(column => column.field));\n\n/**\n * Get the visible pinned columns model.\n * @category Visible Columns\n */\nexport const gridPinnedColumnsSelector = state => state.pinnedColumns;\n\n/**\n * Get the visible pinned columns.\n * @category Visible Columns\n */\nexport const gridVisiblePinnedColumnDefinitionsSelector = createSelectorMemoized(gridColumnsStateSelector, gridPinnedColumnsSelector, gridVisibleColumnFieldsSelector, gridIsRtlSelector, (columnsState, model, visibleColumnFields, isRtl) => {\n const visiblePinnedFields = filterVisibleColumns(model, visibleColumnFields, isRtl);\n const visiblePinnedColumns = {\n left: visiblePinnedFields.left.map(field => columnsState.lookup[field]),\n right: visiblePinnedFields.right.map(field => columnsState.lookup[field])\n };\n return visiblePinnedColumns;\n});\nfunction filterVisibleColumns(pinnedColumns, columns, invert) {\n if (!Array.isArray(pinnedColumns.left) && !Array.isArray(pinnedColumns.right)) {\n return EMPTY_PINNED_COLUMN_FIELDS;\n }\n if (pinnedColumns.left?.length === 0 && pinnedColumns.right?.length === 0) {\n return EMPTY_PINNED_COLUMN_FIELDS;\n }\n const filter = (newPinnedColumns, remainingColumns) => {\n if (!Array.isArray(newPinnedColumns)) {\n return [];\n }\n return newPinnedColumns.filter(field => remainingColumns.includes(field));\n };\n const leftPinnedColumns = filter(pinnedColumns.left, columns);\n const columnsWithoutLeftPinnedColumns = columns.filter(\n // Filter out from the remaining columns those columns already pinned to the left\n field => !leftPinnedColumns.includes(field));\n const rightPinnedColumns = filter(pinnedColumns.right, columnsWithoutLeftPinnedColumns);\n if (invert) {\n return {\n left: rightPinnedColumns,\n right: leftPinnedColumns\n };\n }\n return {\n left: leftPinnedColumns,\n right: rightPinnedColumns\n };\n}\n\n/**\n * Get the left position in pixel of each visible columns relative to the left of the first column.\n * @category Visible Columns\n */\nexport const gridColumnPositionsSelector = createSelectorMemoized(gridVisibleColumnDefinitionsSelector, visibleColumns => {\n const positions = [];\n let currentPosition = 0;\n for (let i = 0; i < visibleColumns.length; i += 1) {\n positions.push(currentPosition);\n currentPosition += visibleColumns[i].computedWidth;\n }\n return positions;\n});\n\n/**\n * Get the summed width of all the visible columns.\n * @category Visible Columns\n */\nexport const gridColumnsTotalWidthSelector = createSelector(gridVisibleColumnDefinitionsSelector, gridColumnPositionsSelector, (visibleColumns, positions) => {\n const colCount = visibleColumns.length;\n if (colCount === 0) {\n return 0;\n }\n return positions[colCount - 1] + visibleColumns[colCount - 1].computedWidth;\n});\n\n/**\n * Get the filterable columns as an array.\n * @category Columns\n */\nexport const gridFilterableColumnDefinitionsSelector = createSelectorMemoized(gridColumnDefinitionsSelector, columns => columns.filter(col => col.filterable));\n\n/**\n * Get the filterable columns as a lookup (an object containing the field for keys and the definition for values).\n * @category Columns\n */\nexport const gridFilterableColumnLookupSelector = createSelectorMemoized(gridColumnDefinitionsSelector, columns => columns.reduce((acc, col) => {\n if (col.filterable) {\n acc[col.field] = col;\n }\n return acc;\n}, {}));\n\n/**\n * Checks if some column has a colSpan field.\n * @category Columns\n * @ignore - Do not document\n */\nexport const gridHasColSpanSelector = createSelectorMemoized(gridColumnDefinitionsSelector, columns => columns.some(column => column.colSpan !== undefined));","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"id\", \"value\", \"formattedValue\", \"api\", \"field\", \"row\", \"rowNode\", \"colDef\", \"cellMode\", \"isEditable\", \"tabIndex\", \"hasFocus\", \"isValidating\", \"debounceMs\", \"isProcessingProps\", \"onValueChange\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';\nimport { styled } from '@mui/material/styles';\nimport InputBase from '@mui/material/InputBase';\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['editInputCell']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridEditInputCellRoot = styled(InputBase, {\n name: 'MuiDataGrid',\n slot: 'EditInputCell',\n overridesResolver: (props, styles) => styles.editInputCell\n})(({\n theme\n}) => _extends({}, theme.typography.body2, {\n padding: '1px 0',\n '& input': {\n padding: '0 16px',\n height: '100%'\n }\n}));\nconst GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {\n const rootProps = useGridRootProps();\n const {\n id,\n value,\n field,\n colDef,\n hasFocus,\n debounceMs = 200,\n isProcessingProps,\n onValueChange\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const inputRef = React.useRef();\n const [valueState, setValueState] = React.useState(value);\n const classes = useUtilityClasses(rootProps);\n const handleChange = React.useCallback(async event => {\n const newValue = event.target.value;\n if (onValueChange) {\n await onValueChange(event, newValue);\n }\n const column = apiRef.current.getColumn(field);\n let parsedValue = newValue;\n if (column.valueParser) {\n parsedValue = column.valueParser(newValue, apiRef.current.getRow(id), column, apiRef);\n }\n setValueState(parsedValue);\n apiRef.current.setEditCellValue({\n id,\n field,\n value: parsedValue,\n debounceMs,\n unstable_skipValueParser: true\n }, event);\n }, [apiRef, debounceMs, field, id, onValueChange]);\n const meta = apiRef.current.unstable_getEditCellMeta(id, field);\n React.useEffect(() => {\n if (meta?.changeReason !== 'debouncedSetEditCellValue') {\n setValueState(value);\n }\n }, [meta, value]);\n useEnhancedEffect(() => {\n if (hasFocus) {\n inputRef.current.focus();\n }\n }, [hasFocus]);\n return /*#__PURE__*/_jsx(GridEditInputCellRoot, _extends({\n ref: ref,\n inputRef: inputRef,\n className: classes.root,\n ownerState: rootProps,\n fullWidth: true,\n type: colDef.type === 'number' ? colDef.type : 'text',\n value: valueState ?? '',\n onChange: handleChange,\n endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {\n fontSize: \"small\",\n color: \"action\"\n }) : undefined\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridEditInputCell.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * GridApi that let you manipulate the grid.\n */\n api: PropTypes.object.isRequired,\n /**\n * The mode of the cell.\n */\n cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,\n changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),\n /**\n * The column of the row that the current cell belongs to.\n */\n colDef: PropTypes.object.isRequired,\n debounceMs: PropTypes.number,\n /**\n * The column field of the cell that triggered the event.\n */\n field: PropTypes.string.isRequired,\n /**\n * The cell value formatted with the column valueFormatter.\n */\n formattedValue: PropTypes.any,\n /**\n * If true, the cell is the active element.\n */\n hasFocus: PropTypes.bool.isRequired,\n /**\n * The grid row id.\n */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n /**\n * If true, the cell is editable.\n */\n isEditable: PropTypes.bool,\n isProcessingProps: PropTypes.bool,\n isValidating: PropTypes.bool,\n /**\n * Callback called when the value is changed by the user.\n * @param {React.ChangeEvent} event The event source of the callback.\n * @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.\n * @returns {Promise | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`\n */\n onValueChange: PropTypes.func,\n /**\n * The row model of the row that the current cell belongs to.\n */\n row: PropTypes.any.isRequired,\n /**\n * The node of the row that the current cell belongs to.\n */\n rowNode: PropTypes.object.isRequired,\n /**\n * the tabIndex value.\n */\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\n /**\n * The cell value.\n * If the column has `valueGetter`, use `params.row` to directly access the fields.\n */\n value: PropTypes.any\n} : void 0;\nexport { GridEditInputCell };\nexport const renderEditInputCell = params => /*#__PURE__*/_jsx(GridEditInputCell, _extends({}, params));","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { warnOnce } from '@mui/x-internals/warning';\nexport const sanitizeSortModel = (model, disableMultipleColumnsSorting) => {\n if (disableMultipleColumnsSorting && model.length > 1) {\n if (process.env.NODE_ENV !== 'production') {\n warnOnce(['MUI X: The `sortModel` can only contain a single item when the `disableMultipleColumnsSorting` prop is set to `true`.', 'If you are using the community version of the `DataGrid`, this prop is always `true`.'], 'error');\n }\n return [model[0]];\n }\n return model;\n};\nexport const mergeStateWithSortModel = (sortModel, disableMultipleColumnsSorting) => state => _extends({}, state, {\n sorting: _extends({}, state.sorting, {\n sortModel: sanitizeSortModel(sortModel, disableMultipleColumnsSorting)\n })\n});\nconst isDesc = direction => direction === 'desc';\n\n/**\n * Transform an item of the sorting model into a method comparing two rows.\n * @param {GridSortItem} sortItem The sort item we want to apply.\n * @param {React.MutableRefObject} apiRef The API of the grid.\n * @returns {GridParsedSortItem | null} The parsed sort item. Returns `null` is the sort item is not valid.\n */\nconst parseSortItem = (sortItem, apiRef) => {\n const column = apiRef.current.getColumn(sortItem.field);\n if (!column || sortItem.sort === null) {\n return null;\n }\n let comparator;\n if (column.getSortComparator) {\n comparator = column.getSortComparator(sortItem.sort);\n } else {\n comparator = isDesc(sortItem.sort) ? (...args) => -1 * column.sortComparator(...args) : column.sortComparator;\n }\n if (!comparator) {\n return null;\n }\n const getSortCellParams = id => ({\n id,\n field: column.field,\n rowNode: apiRef.current.getRowNode(id),\n value: apiRef.current.getCellValue(id, column.field),\n api: apiRef.current\n });\n return {\n getSortCellParams,\n comparator\n };\n};\n/**\n * Compare two rows according to a list of valid sort items.\n * The `row1Params` and `row2Params` must have the same length as `parsedSortItems`,\n * and each of their index must contain the `GridSortCellParams` of the sort item with the same index.\n * @param {GridParsedSortItem[]} parsedSortItems All the sort items with which we want to compare the rows.\n * @param {GridRowAggregatedSortingParams} row1 The node and params of the 1st row for each sort item.\n * @param {GridRowAggregatedSortingParams} row2 The node and params of the 2nd row for each sort item.\n */\nconst compareRows = (parsedSortItems, row1, row2) => {\n return parsedSortItems.reduce((res, item, index) => {\n if (res !== 0) {\n // return the results of the first comparator which distinguish the two rows\n return res;\n }\n const sortCellParams1 = row1.params[index];\n const sortCellParams2 = row2.params[index];\n res = item.comparator(sortCellParams1.value, sortCellParams2.value, sortCellParams1, sortCellParams2);\n return res;\n }, 0);\n};\n\n/**\n * Generates a method to easily sort a list of rows according to the current sort model.\n * @param {GridSortModel} sortModel The model with which we want to sort the rows.\n * @param {React.MutableRefObject} apiRef The API of the grid.\n * @returns {GridSortingModelApplier | null} A method that generates a list of sorted row ids from a list of rows according to the current sort model. If `null`, we consider that the rows should remain in the order there were provided.\n */\nexport const buildAggregatedSortingApplier = (sortModel, apiRef) => {\n const comparatorList = sortModel.map(item => parseSortItem(item, apiRef)).filter(comparator => !!comparator);\n if (comparatorList.length === 0) {\n return null;\n }\n return rowList => rowList.map(node => ({\n node,\n params: comparatorList.map(el => el.getSortCellParams(node.id))\n })).sort((a, b) => compareRows(comparatorList, a, b)).map(row => row.node.id);\n};\nexport const getNextGridSortDirection = (sortingOrder, current) => {\n const currentIdx = sortingOrder.indexOf(current);\n if (!current || currentIdx === -1 || currentIdx + 1 === sortingOrder.length) {\n return sortingOrder[0];\n }\n return sortingOrder[currentIdx + 1];\n};\nconst gridNillComparator = (v1, v2) => {\n if (v1 == null && v2 != null) {\n return -1;\n }\n if (v2 == null && v1 != null) {\n return 1;\n }\n if (v1 == null && v2 == null) {\n return 0;\n }\n return null;\n};\nconst collator = new Intl.Collator();\nexport const gridStringOrNumberComparator = (value1, value2) => {\n const nillResult = gridNillComparator(value1, value2);\n if (nillResult !== null) {\n return nillResult;\n }\n if (typeof value1 === 'string') {\n return collator.compare(value1.toString(), value2.toString());\n }\n return value1 - value2;\n};\nexport const gridNumberComparator = (value1, value2) => {\n const nillResult = gridNillComparator(value1, value2);\n if (nillResult !== null) {\n return nillResult;\n }\n return Number(value1) - Number(value2);\n};\nexport const gridDateComparator = (value1, value2) => {\n const nillResult = gridNillComparator(value1, value2);\n if (nillResult !== null) {\n return nillResult;\n }\n if (value1 > value2) {\n return 1;\n }\n if (value1 < value2) {\n return -1;\n }\n return 0;\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"item\", \"applyValue\", \"type\", \"apiRef\", \"focusElementRef\", \"tabIndex\", \"disabled\", \"isFilterActive\", \"clearButton\", \"InputProps\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useId as useId } from '@mui/utils';\nimport { useTimeout } from \"../../../hooks/utils/useTimeout.js\";\nimport { useGridRootProps } from \"../../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction GridFilterInputValue(props) {\n const {\n item,\n applyValue,\n type,\n apiRef,\n focusElementRef,\n tabIndex,\n disabled,\n clearButton,\n InputProps,\n variant = 'standard'\n } = props,\n others = _objectWithoutPropertiesLoose(props, _excluded);\n const filterTimeout = useTimeout();\n const [filterValueState, setFilterValueState] = React.useState(item.value ?? '');\n const [applying, setIsApplying] = React.useState(false);\n const id = useId();\n const rootProps = useGridRootProps();\n const onFilterChange = React.useCallback(event => {\n const {\n value\n } = event.target;\n setFilterValueState(String(value));\n setIsApplying(true);\n filterTimeout.start(rootProps.filterDebounceMs, () => {\n const newItem = _extends({}, item, {\n value,\n fromInput: id\n });\n applyValue(newItem);\n setIsApplying(false);\n });\n }, [id, applyValue, item, rootProps.filterDebounceMs, filterTimeout]);\n React.useEffect(() => {\n const itemPlusTag = item;\n if (itemPlusTag.fromInput !== id || item.value === undefined) {\n setFilterValueState(String(item.value ?? ''));\n }\n }, [id, item]);\n return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({\n id: id,\n label: apiRef.current.getLocaleText('filterPanelInputLabel'),\n placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),\n value: filterValueState,\n onChange: onFilterChange,\n variant: variant,\n type: type || 'text',\n InputProps: _extends({}, applying || clearButton ? {\n endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {\n fontSize: \"small\",\n color: \"action\"\n }) : clearButton\n } : {}, {\n disabled\n }, InputProps, {\n inputProps: _extends({\n tabIndex\n }, InputProps?.inputProps)\n }),\n InputLabelProps: {\n shrink: true\n },\n inputRef: focusElementRef\n }, others, rootProps.slotProps?.baseTextField));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridFilterInputValue.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n apiRef: PropTypes.shape({\n current: PropTypes.object.isRequired\n }).isRequired,\n applyValue: PropTypes.func.isRequired,\n clearButton: PropTypes.node,\n focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),\n /**\n * It is `true` if the filter either has a value or an operator with no value\n * required is selected (for example `isEmpty`)\n */\n isFilterActive: PropTypes.bool,\n item: PropTypes.shape({\n field: PropTypes.string.isRequired,\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n operator: PropTypes.string.isRequired,\n value: PropTypes.any\n }).isRequired\n} : void 0;\nexport { GridFilterInputValue };","export function isNumber(value) {\n return typeof value === 'number' && !Number.isNaN(value);\n}\nexport function isFunction(value) {\n return typeof value === 'function';\n}\nexport function isObject(value) {\n return typeof value === 'object' && value !== null;\n}\nexport function localStorageAvailable() {\n try {\n // Incognito mode might reject access to the localStorage for security reasons.\n // window isn't defined on Node.js\n // https://stackoverflow.com/questions/16427636/check-if-localstorage-is-available\n const key = '__some_random_key_you_are_not_going_to_use__';\n window.localStorage.setItem(key, key);\n window.localStorage.removeItem(key);\n return true;\n } catch (err) {\n return false;\n }\n}\nexport function escapeRegExp(value) {\n return value.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n}\n\n/**\n * Follows the CSS specification behavior for min and max\n * If min > max, then the min have priority\n */\nexport const clamp = (value, min, max) => Math.max(min, Math.min(max, value));\n\n/**\n * Create an array containing the range [from, to[\n */\nexport function range(from, to) {\n return Array.from({\n length: to - from\n }).map((_, i) => from + i);\n}\n\n/**\n * Based on `fast-deep-equal`\n *\n * MIT License\n *\n * Copyright (c) 2017 Evgeny Poberezkin\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * We only type the public interface to avoid dozens of `as` in the function.\n */\n\nexport function isDeepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n if (a.constructor !== b.constructor) {\n return false;\n }\n if (Array.isArray(a)) {\n const length = a.length;\n if (length !== b.length) {\n return false;\n }\n for (let i = 0; i < length; i += 1) {\n if (!isDeepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n if (a instanceof Map && b instanceof Map) {\n if (a.size !== b.size) {\n return false;\n }\n const entriesA = Array.from(a.entries());\n for (let i = 0; i < entriesA.length; i += 1) {\n if (!b.has(entriesA[i][0])) {\n return false;\n }\n }\n for (let i = 0; i < entriesA.length; i += 1) {\n const entryA = entriesA[i];\n if (!isDeepEqual(entryA[1], b.get(entryA[0]))) {\n return false;\n }\n }\n return true;\n }\n if (a instanceof Set && b instanceof Set) {\n if (a.size !== b.size) {\n return false;\n }\n const entries = Array.from(a.entries());\n for (let i = 0; i < entries.length; i += 1) {\n if (!b.has(entries[i][0])) {\n return false;\n }\n }\n return true;\n }\n if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n const length = a.length;\n if (length !== b.length) {\n return false;\n }\n for (let i = 0; i < length; i += 1) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }\n if (a.constructor === RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n if (a.valueOf !== Object.prototype.valueOf) {\n return a.valueOf() === b.valueOf();\n }\n if (a.toString !== Object.prototype.toString) {\n return a.toString() === b.toString();\n }\n const keys = Object.keys(a);\n const length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (let i = 0; i < length; i += 1) {\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (let i = 0; i < length; i += 1) {\n const key = keys[i];\n if (!isDeepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n\n // true if both NaN, false otherwise\n // eslint-disable-next-line no-self-compare\n return a !== a && b !== b;\n}\n\n// Pseudo random number. See https://stackoverflow.com/a/47593316\nfunction mulberry32(a) {\n return () => {\n /* eslint-disable */\n let t = a += 0x6d2b79f5;\n t = Math.imul(t ^ t >>> 15, t | 1);\n t ^= t + Math.imul(t ^ t >>> 7, t | 61);\n return ((t ^ t >>> 14) >>> 0) / 4294967296;\n /* eslint-enable */\n };\n}\n\n/**\n * Create a random number generator from a seed. The seed\n * ensures that the random number generator produces the\n * same sequence of 'random' numbers on every render. It\n * returns a function that generates a random number between\n * a specified min and max.\n */\nexport function createRandomNumberGenerator(seed) {\n const random = mulberry32(seed);\n return (min, max) => min + (max - min) * random();\n}\nexport function deepClone(obj) {\n if (typeof structuredClone === 'function') {\n return structuredClone(obj);\n }\n return JSON.parse(JSON.stringify(obj));\n}\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/**\n * Mark a value as used so eslint doesn't complain. Use this instead\n * of a `eslint-disable-next-line react-hooks/exhaustive-deps` because\n * that hint disables checks on all values instead of just one.\n */\nexport function eslintUseValue(_) {}\n/* eslint-enable @typescript-eslint/no-unused-vars */","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"item\", \"applyValue\", \"type\", \"apiRef\", \"focusElementRef\", \"color\", \"error\", \"helperText\", \"size\", \"variant\"],\n _excluded2 = [\"key\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport Autocomplete from '@mui/material/Autocomplete';\nimport { unstable_useId as useId } from '@mui/utils';\nimport { useGridRootProps } from \"../../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction GridFilterInputMultipleValue(props) {\n const {\n item,\n applyValue,\n type,\n apiRef,\n focusElementRef,\n color,\n error,\n helperText,\n size,\n variant = 'standard'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const TextFieldProps = {\n color,\n error,\n helperText,\n size,\n variant\n };\n const [filterValueState, setFilterValueState] = React.useState(item.value || []);\n const id = useId();\n const rootProps = useGridRootProps();\n React.useEffect(() => {\n const itemValue = item.value ?? [];\n setFilterValueState(itemValue.map(String));\n }, [item.value]);\n const handleChange = React.useCallback((event, value) => {\n setFilterValueState(value.map(String));\n applyValue(_extends({}, item, {\n value: [...value]\n }));\n }, [applyValue, item]);\n return /*#__PURE__*/_jsx(Autocomplete, _extends({\n multiple: true,\n freeSolo: true,\n options: [],\n filterOptions: (options, params) => {\n const {\n inputValue\n } = params;\n return inputValue == null || inputValue === '' ? [] : [inputValue];\n },\n id: id,\n value: filterValueState,\n onChange: handleChange,\n renderTags: (value, getTagProps) => value.map((option, index) => {\n const _getTagProps = getTagProps({\n index\n }),\n {\n key\n } = _getTagProps,\n tagProps = _objectWithoutPropertiesLoose(_getTagProps, _excluded2);\n return /*#__PURE__*/_jsx(rootProps.slots.baseChip, _extends({\n variant: \"outlined\",\n size: \"small\",\n label: option\n }, tagProps), key);\n }),\n renderInput: params => /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({}, params, {\n label: apiRef.current.getLocaleText('filterPanelInputLabel'),\n placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),\n InputLabelProps: _extends({}, params.InputLabelProps, {\n shrink: true\n }),\n inputRef: focusElementRef,\n type: type || 'text'\n }, TextFieldProps, rootProps.slotProps?.baseTextField))\n }, other));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridFilterInputMultipleValue.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n apiRef: PropTypes.shape({\n current: PropTypes.object.isRequired\n }).isRequired,\n applyValue: PropTypes.func.isRequired,\n focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),\n item: PropTypes.shape({\n field: PropTypes.string.isRequired,\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n operator: PropTypes.string.isRequired,\n value: PropTypes.any\n }).isRequired,\n type: PropTypes.oneOf(['date', 'datetime-local', 'number', 'text'])\n} : void 0;\nexport { GridFilterInputMultipleValue };","var GridEditModes = /*#__PURE__*/function (GridEditModes) {\n GridEditModes[\"Cell\"] = \"cell\";\n GridEditModes[\"Row\"] = \"row\";\n return GridEditModes;\n}(GridEditModes || {});\nvar GridCellModes = /*#__PURE__*/function (GridCellModes) {\n GridCellModes[\"Edit\"] = \"edit\";\n GridCellModes[\"View\"] = \"view\";\n return GridCellModes;\n}(GridCellModes || {});\nvar GridRowModes = /*#__PURE__*/function (GridRowModes) {\n GridRowModes[\"Edit\"] = \"edit\";\n GridRowModes[\"View\"] = \"view\";\n return GridRowModes;\n}(GridRowModes || {});\nexport { GridEditModes, GridCellModes, GridRowModes };","/**\n * Filter item definition interface.\n * @demos\n * - [Custom filter operator](/x/react-data-grid/filtering/customization/#create-a-custom-operator)\n */\nvar GridLogicOperator = /*#__PURE__*/function (GridLogicOperator) {\n GridLogicOperator[\"And\"] = \"and\";\n GridLogicOperator[\"Or\"] = \"or\";\n return GridLogicOperator;\n}(GridLogicOperator || {});\nexport { GridLogicOperator };","/**\n * Params passed to `apiRef.current.setEditCellValue`.\n */\nvar GridCellEditStartReasons = /*#__PURE__*/function (GridCellEditStartReasons) {\n GridCellEditStartReasons[\"enterKeyDown\"] = \"enterKeyDown\";\n GridCellEditStartReasons[\"cellDoubleClick\"] = \"cellDoubleClick\";\n GridCellEditStartReasons[\"printableKeyDown\"] = \"printableKeyDown\";\n GridCellEditStartReasons[\"deleteKeyDown\"] = \"deleteKeyDown\";\n GridCellEditStartReasons[\"pasteKeyDown\"] = \"pasteKeyDown\";\n return GridCellEditStartReasons;\n}(GridCellEditStartReasons || {});\n/**\n * Params passed to the `cellEditStart` event.\n */\nvar GridCellEditStopReasons = /*#__PURE__*/function (GridCellEditStopReasons) {\n GridCellEditStopReasons[\"cellFocusOut\"] = \"cellFocusOut\";\n GridCellEditStopReasons[\"escapeKeyDown\"] = \"escapeKeyDown\";\n GridCellEditStopReasons[\"enterKeyDown\"] = \"enterKeyDown\";\n GridCellEditStopReasons[\"tabKeyDown\"] = \"tabKeyDown\";\n GridCellEditStopReasons[\"shiftTabKeyDown\"] = \"shiftTabKeyDown\";\n return GridCellEditStopReasons;\n}(GridCellEditStopReasons || {});\n/**\n * Params passed to the `cellEditStop event.\n */\n// https://github.com/mui/mui-x/pull/3738#discussion_r798504277\nexport { GridCellEditStartReasons, GridCellEditStopReasons };","/**\n * Object passed as parameter in the row callbacks.\n * @demos\n * - [Master detail](/x/react-data-grid/master-detail/)\n */\n/**\n * Object passed as parameter in the row `getRowClassName` callback prop.\n * @demos\n * - [Styling rows](/x/react-data-grid/style/#styling-rows)\n */\n/**\n * Object passed as parameter in the row `getRowHeight` callback prop.\n */\n/**\n * The getRowHeight return value.\n */\nvar GridRowEditStartReasons = /*#__PURE__*/function (GridRowEditStartReasons) {\n GridRowEditStartReasons[\"enterKeyDown\"] = \"enterKeyDown\";\n GridRowEditStartReasons[\"cellDoubleClick\"] = \"cellDoubleClick\";\n GridRowEditStartReasons[\"printableKeyDown\"] = \"printableKeyDown\";\n GridRowEditStartReasons[\"deleteKeyDown\"] = \"deleteKeyDown\";\n return GridRowEditStartReasons;\n}(GridRowEditStartReasons || {});\n/**\n * Params passed to the `rowEditStart` event.\n */\nvar GridRowEditStopReasons = /*#__PURE__*/function (GridRowEditStopReasons) {\n GridRowEditStopReasons[\"rowFocusOut\"] = \"rowFocusOut\";\n GridRowEditStopReasons[\"escapeKeyDown\"] = \"escapeKeyDown\";\n GridRowEditStopReasons[\"enterKeyDown\"] = \"enterKeyDown\";\n GridRowEditStopReasons[\"tabKeyDown\"] = \"tabKeyDown\";\n GridRowEditStopReasons[\"shiftTabKeyDown\"] = \"shiftTabKeyDown\";\n return GridRowEditStopReasons;\n}(GridRowEditStopReasons || {});\n/**\n * Object passed as parameter in the row `getRowSpacing` callback prop.\n * @demos\n * - [Row spacing](/x/react-data-grid/row-height/#row-spacing)\n */\n/**\n * The getRowSpacing return value.\n */\n// https://github.com/mui/mui-x/pull/3738#discussion_r798504277\nexport { GridRowEditStartReasons, GridRowEditStopReasons };","export function isLeaf(node) {\n return node.field !== undefined;\n}\n\n/**\n * A function used to process headerClassName params.\n */\n\n/**\n * The union type representing the [[GridColDef]] column header class type.\n */","import { GridLogicOperator } from \"../../../models/gridFilterItem.js\";\nexport const getDefaultGridFilterModel = () => ({\n items: [],\n logicOperator: GridLogicOperator.And,\n quickFilterValues: [],\n quickFilterLogicOperator: GridLogicOperator.And\n});\n\n/**\n * @param {GridRowId} rowId The id of the row we want to filter.\n * @param {(filterItem: GridFilterItem) => boolean} shouldApplyItem An optional callback to allow the filtering engine to only apply some items.\n */\n\n/**\n * Visibility status for each row.\n * A row is visible if it is passing the filters AND if its parents are expanded.\n * If a row is not registered in this lookup, it is visible.\n */","export function getPublicApiRef(apiRef) {\n return {\n current: apiRef.current.getPublicApi()\n };\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { warnOnce } from '@mui/x-internals/warning';\nimport { GridLogicOperator } from \"../../../models/index.js\";\nimport { getDefaultGridFilterModel } from \"./gridFilterState.js\";\nimport { getPublicApiRef } from \"../../../utils/getPublicApiRef.js\";\nimport { gridColumnFieldsSelector, gridColumnLookupSelector, gridVisibleColumnFieldsSelector } from \"../columns/index.js\";\nlet hasEval;\nfunction getHasEval() {\n if (hasEval !== undefined) {\n return hasEval;\n }\n try {\n hasEval = new Function('return true')();\n } catch (_) {\n hasEval = false;\n }\n return hasEval;\n}\n/**\n * Adds default values to the optional fields of a filter items.\n * @param {GridFilterItem} item The raw filter item.\n * @param {React.MutableRefObject} apiRef The API of the grid.\n * @return {GridFilterItem} The clean filter item with an uniq ID and an always-defined operator.\n * TODO: Make the typing reflect the different between GridFilterInputItem and GridFilterItem.\n */\nexport const cleanFilterItem = (item, apiRef) => {\n const cleanItem = _extends({}, item);\n if (cleanItem.id == null) {\n cleanItem.id = Math.round(Math.random() * 1e5);\n }\n if (cleanItem.operator == null) {\n // Selects a default operator\n // We don't use `apiRef.current.getColumn` because it is not ready during state initialization\n const column = gridColumnLookupSelector(apiRef)[cleanItem.field];\n cleanItem.operator = column && column.filterOperators[0].value;\n }\n return cleanItem;\n};\nexport const sanitizeFilterModel = (model, disableMultipleColumnsFiltering, apiRef) => {\n const hasSeveralItems = model.items.length > 1;\n let items;\n if (hasSeveralItems && disableMultipleColumnsFiltering) {\n if (process.env.NODE_ENV !== 'production') {\n warnOnce(['MUI X: The `filterModel` can only contain a single item when the `disableMultipleColumnsFiltering` prop is set to `true`.', 'If you are using the community version of the `DataGrid`, this prop is always `true`.'], 'error');\n }\n items = [model.items[0]];\n } else {\n items = model.items;\n }\n const hasItemsWithoutIds = hasSeveralItems && items.some(item => item.id == null);\n const hasItemWithoutOperator = items.some(item => item.operator == null);\n if (process.env.NODE_ENV !== 'production') {\n if (hasItemsWithoutIds) {\n warnOnce('MUI X: The `id` field is required on `filterModel.items` when you use multiple filters.', 'error');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n if (hasItemWithoutOperator) {\n warnOnce('MUI X: The `operator` field is required on `filterModel.items`, one or more of your filtering item has no `operator` provided.', 'error');\n }\n }\n if (hasItemWithoutOperator || hasItemsWithoutIds) {\n return _extends({}, model, {\n items: items.map(item => cleanFilterItem(item, apiRef))\n });\n }\n if (model.items !== items) {\n return _extends({}, model, {\n items\n });\n }\n return model;\n};\nexport const mergeStateWithFilterModel = (filterModel, disableMultipleColumnsFiltering, apiRef) => filteringState => _extends({}, filteringState, {\n filterModel: sanitizeFilterModel(filterModel, disableMultipleColumnsFiltering, apiRef)\n});\nexport const removeDiacritics = value => {\n if (typeof value === 'string') {\n return value.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n }\n return value;\n};\nconst getFilterCallbackFromItem = (filterItem, apiRef) => {\n if (!filterItem.field || !filterItem.operator) {\n return null;\n }\n const column = apiRef.current.getColumn(filterItem.field);\n if (!column) {\n return null;\n }\n let parsedValue;\n if (column.valueParser) {\n const parser = column.valueParser;\n parsedValue = Array.isArray(filterItem.value) ? filterItem.value?.map(x => parser(x, undefined, column, apiRef)) : parser(filterItem.value, undefined, column, apiRef);\n } else {\n parsedValue = filterItem.value;\n }\n const {\n ignoreDiacritics\n } = apiRef.current.rootProps;\n if (ignoreDiacritics) {\n parsedValue = removeDiacritics(parsedValue);\n }\n const newFilterItem = _extends({}, filterItem, {\n value: parsedValue\n });\n const filterOperators = column.filterOperators;\n if (!filterOperators?.length) {\n throw new Error(`MUI X: No filter operators found for column '${column.field}'.`);\n }\n const filterOperator = filterOperators.find(operator => operator.value === newFilterItem.operator);\n if (!filterOperator) {\n throw new Error(`MUI X: No filter operator found for column '${column.field}' and operator value '${newFilterItem.operator}'.`);\n }\n const publicApiRef = getPublicApiRef(apiRef);\n const applyFilterOnRow = filterOperator.getApplyFilterFn(newFilterItem, column);\n if (typeof applyFilterOnRow !== 'function') {\n return null;\n }\n return {\n item: newFilterItem,\n fn: row => {\n let value = apiRef.current.getRowValue(row, column);\n if (ignoreDiacritics) {\n value = removeDiacritics(value);\n }\n return applyFilterOnRow(value, row, column, publicApiRef);\n }\n };\n};\nlet filterItemsApplierId = 1;\n\n/**\n * Generates a method to easily check if a row is matching the current filter model.\n * @param {GridFilterModel} filterModel The model with which we want to filter the rows.\n * @param {React.MutableRefObject} apiRef The API of the grid.\n * @returns {GridAggregatedFilterItemApplier | null} A method that checks if a row is matching the current filter model. If `null`, we consider that all the rows are matching the filters.\n */\nconst buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) => {\n const {\n items\n } = filterModel;\n const appliers = items.map(item => getFilterCallbackFromItem(item, apiRef)).filter(callback => !!callback);\n if (appliers.length === 0) {\n return null;\n }\n if (disableEval || !getHasEval()) {\n // This is the original logic, which is used if `eval()` is not supported (aka prevented by CSP).\n return (row, shouldApplyFilter) => {\n const resultPerItemId = {};\n for (let i = 0; i < appliers.length; i += 1) {\n const applier = appliers[i];\n if (!shouldApplyFilter || shouldApplyFilter(applier.item.field)) {\n resultPerItemId[applier.item.id] = applier.fn(row);\n }\n }\n return resultPerItemId;\n };\n }\n\n // We generate a new function with `new Function()` to avoid expensive patterns for JS engines\n // such as a dynamic object assignment, for example `{ [dynamicKey]: value }`.\n const filterItemCore = new Function('appliers', 'row', 'shouldApplyFilter', `\"use strict\";\n${appliers.map((applier, i) => `const shouldApply${i} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(applier.item.field)});`).join('\\n')}\n\nconst result$$ = {\n${appliers.map((applier, i) => ` ${JSON.stringify(String(applier.item.id))}: !shouldApply${i} ? false : appliers[${i}].fn(row),`).join('\\n')}\n};\n\nreturn result$$;`.replaceAll('$$', String(filterItemsApplierId)));\n filterItemsApplierId += 1;\n\n // Assign to the arrow function a name to help debugging\n const filterItem = (row, shouldApplyItem) => filterItemCore(appliers, row, shouldApplyItem);\n return filterItem;\n};\nexport const shouldQuickFilterExcludeHiddenColumns = filterModel => {\n return filterModel.quickFilterExcludeHiddenColumns ?? true;\n};\n\n/**\n * Generates a method to easily check if a row is matching the current quick filter.\n * @param {any[]} filterModel The model with which we want to filter the rows.\n * @param {React.MutableRefObject} apiRef The API of the grid.\n * @returns {GridAggregatedFilterItemApplier | null} A method that checks if a row is matching the current filter model. If `null`, we consider that all the rows are matching the filters.\n */\nconst buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {\n const quickFilterValues = filterModel.quickFilterValues?.filter(Boolean) ?? [];\n if (quickFilterValues.length === 0) {\n return null;\n }\n const columnFields = shouldQuickFilterExcludeHiddenColumns(filterModel) ? gridVisibleColumnFieldsSelector(apiRef) : gridColumnFieldsSelector(apiRef);\n const appliersPerField = [];\n const {\n ignoreDiacritics\n } = apiRef.current.rootProps;\n const publicApiRef = getPublicApiRef(apiRef);\n columnFields.forEach(field => {\n const column = apiRef.current.getColumn(field);\n const getApplyQuickFilterFn = column?.getApplyQuickFilterFn;\n if (getApplyQuickFilterFn) {\n appliersPerField.push({\n column,\n appliers: quickFilterValues.map(quickFilterValue => {\n const value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;\n return {\n fn: getApplyQuickFilterFn(value, column, publicApiRef)\n };\n })\n });\n }\n });\n return function isRowMatchingQuickFilter(row, shouldApplyFilter) {\n const result = {};\n\n /* eslint-disable no-labels */\n outer: for (let v = 0; v < quickFilterValues.length; v += 1) {\n const filterValue = quickFilterValues[v];\n for (let i = 0; i < appliersPerField.length; i += 1) {\n const {\n column,\n appliers\n } = appliersPerField[i];\n const {\n field\n } = column;\n if (shouldApplyFilter && !shouldApplyFilter(field)) {\n continue;\n }\n const applier = appliers[v];\n let value = apiRef.current.getRowValue(row, column);\n if (applier.fn === null) {\n continue;\n }\n if (ignoreDiacritics) {\n value = removeDiacritics(value);\n }\n const isMatching = applier.fn(value, row, column, publicApiRef);\n if (isMatching) {\n result[filterValue] = true;\n continue outer;\n }\n }\n result[filterValue] = false;\n }\n return result;\n };\n};\nexport const buildAggregatedFilterApplier = (filterModel, apiRef, disableEval) => {\n const isRowMatchingFilterItems = buildAggregatedFilterItemsApplier(filterModel, apiRef, disableEval);\n const isRowMatchingQuickFilter = buildAggregatedQuickFilterApplier(filterModel, apiRef);\n return function isRowMatchingFilters(row, shouldApplyFilter, result) {\n result.passingFilterItems = isRowMatchingFilterItems?.(row, shouldApplyFilter) ?? null;\n result.passingQuickFilterValues = isRowMatchingQuickFilter?.(row, shouldApplyFilter) ?? null;\n };\n};\nconst isNotNull = result => result != null;\nconst filterModelItems = (cache, apiRef, items) => {\n if (!cache.cleanedFilterItems) {\n cache.cleanedFilterItems = items.filter(item => getFilterCallbackFromItem(item, apiRef) !== null);\n }\n return cache.cleanedFilterItems;\n};\nexport const passFilterLogic = (allFilterItemResults, allQuickFilterResults, filterModel, apiRef, cache) => {\n const cleanedFilterItems = filterModelItems(cache, apiRef, filterModel.items);\n const cleanedFilterItemResults = allFilterItemResults.filter(isNotNull);\n const cleanedQuickFilterResults = allQuickFilterResults.filter(isNotNull);\n\n // get result for filter items model\n if (cleanedFilterItemResults.length > 0) {\n // Return true if the item pass with one of the rows\n const filterItemPredicate = item => {\n return cleanedFilterItemResults.some(filterItemResult => filterItemResult[item.id]);\n };\n const logicOperator = filterModel.logicOperator ?? getDefaultGridFilterModel().logicOperator;\n if (logicOperator === GridLogicOperator.And) {\n const passesAllFilters = cleanedFilterItems.every(filterItemPredicate);\n if (!passesAllFilters) {\n return false;\n }\n } else {\n const passesSomeFilters = cleanedFilterItems.some(filterItemPredicate);\n if (!passesSomeFilters) {\n return false;\n }\n }\n }\n\n // get result for quick filter model\n if (cleanedQuickFilterResults.length > 0 && filterModel.quickFilterValues != null) {\n // Return true if the item pass with one of the rows\n const quickFilterValuePredicate = value => {\n return cleanedQuickFilterResults.some(quickFilterValueResult => quickFilterValueResult[value]);\n };\n const quickFilterLogicOperator = filterModel.quickFilterLogicOperator ?? getDefaultGridFilterModel().quickFilterLogicOperator;\n if (quickFilterLogicOperator === GridLogicOperator.And) {\n const passesAllQuickFilterValues = filterModel.quickFilterValues.every(quickFilterValuePredicate);\n if (!passesAllQuickFilterValues) {\n return false;\n }\n } else {\n const passesSomeQuickFilterValues = filterModel.quickFilterValues.some(quickFilterValuePredicate);\n if (!passesSomeQuickFilterValues) {\n return false;\n }\n }\n }\n return true;\n};","import { GridFilterInputValue } from \"../components/panel/filterPanel/GridFilterInputValue.js\";\nimport { escapeRegExp } from \"../utils/utils.js\";\nimport { GridFilterInputMultipleValue } from \"../components/panel/filterPanel/GridFilterInputMultipleValue.js\";\nimport { removeDiacritics } from \"../hooks/features/filter/gridFilterUtils.js\";\nexport const getGridStringQuickFilterFn = value => {\n if (!value) {\n return null;\n }\n const filterRegex = new RegExp(escapeRegExp(value), 'i');\n return (_, row, column, apiRef) => {\n let columnValue = apiRef.current.getRowFormattedValue(row, column);\n if (apiRef.current.ignoreDiacritics) {\n columnValue = removeDiacritics(columnValue);\n }\n return columnValue != null ? filterRegex.test(columnValue.toString()) : false;\n };\n};\nconst createContainsFilterFn = (disableTrim, negate) => filterItem => {\n if (!filterItem.value) {\n return null;\n }\n const trimmedValue = disableTrim ? filterItem.value : filterItem.value.trim();\n const filterRegex = new RegExp(escapeRegExp(trimmedValue), 'i');\n return value => {\n if (value == null) {\n return negate;\n }\n const matches = filterRegex.test(String(value));\n return negate ? !matches : matches;\n };\n};\nconst createEqualityFilterFn = (disableTrim, negate) => filterItem => {\n if (!filterItem.value) {\n return null;\n }\n const trimmedValue = disableTrim ? filterItem.value : filterItem.value.trim();\n const collator = new Intl.Collator(undefined, {\n sensitivity: 'base',\n usage: 'search'\n });\n return value => {\n if (value == null) {\n return negate;\n }\n const isEqual = collator.compare(trimmedValue, value.toString()) === 0;\n return negate ? !isEqual : isEqual;\n };\n};\nconst createEmptyFilterFn = negate => () => {\n return value => {\n const isEmpty = value === '' || value == null;\n return negate ? !isEmpty : isEmpty;\n };\n};\nexport const getGridStringOperators = (disableTrim = false) => [{\n value: 'contains',\n getApplyFilterFn: createContainsFilterFn(disableTrim, false),\n InputComponent: GridFilterInputValue\n}, {\n value: 'doesNotContain',\n getApplyFilterFn: createContainsFilterFn(disableTrim, true),\n InputComponent: GridFilterInputValue\n}, {\n value: 'equals',\n getApplyFilterFn: createEqualityFilterFn(disableTrim, false),\n InputComponent: GridFilterInputValue\n}, {\n value: 'doesNotEqual',\n getApplyFilterFn: createEqualityFilterFn(disableTrim, true),\n InputComponent: GridFilterInputValue\n}, {\n value: 'startsWith',\n getApplyFilterFn: filterItem => {\n if (!filterItem.value) {\n return null;\n }\n const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();\n const filterRegex = new RegExp(`^${escapeRegExp(filterItemValue)}.*$`, 'i');\n return value => {\n return value != null ? filterRegex.test(value.toString()) : false;\n };\n },\n InputComponent: GridFilterInputValue\n}, {\n value: 'endsWith',\n getApplyFilterFn: filterItem => {\n if (!filterItem.value) {\n return null;\n }\n const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();\n const filterRegex = new RegExp(`.*${escapeRegExp(filterItemValue)}$`, 'i');\n return value => {\n return value != null ? filterRegex.test(value.toString()) : false;\n };\n },\n InputComponent: GridFilterInputValue\n}, {\n value: 'isEmpty',\n getApplyFilterFn: createEmptyFilterFn(false),\n requiresFilterValue: false\n}, {\n value: 'isNotEmpty',\n getApplyFilterFn: createEmptyFilterFn(true),\n requiresFilterValue: false\n}, {\n value: 'isAnyOf',\n getApplyFilterFn: filterItem => {\n if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {\n return null;\n }\n const filterItemValue = disableTrim ? filterItem.value : filterItem.value.map(val => val.trim());\n const collator = new Intl.Collator(undefined, {\n sensitivity: 'base',\n usage: 'search'\n });\n return value => value != null ? filterItemValue.some(filterValue => {\n return collator.compare(filterValue, value.toString() || '') === 0;\n }) : false;\n },\n InputComponent: GridFilterInputMultipleValue\n}];","import { renderEditInputCell } from \"../components/cell/GridEditInputCell.js\";\nimport { gridStringOrNumberComparator } from \"../hooks/features/sorting/gridSortingUtils.js\";\nimport { getGridStringOperators, getGridStringQuickFilterFn } from \"./gridStringOperators.js\";\n\n/**\n * TODO: Move pro and premium properties outside of this Community file\n */\nexport const GRID_STRING_COL_DEF = {\n width: 100,\n minWidth: 50,\n maxWidth: Infinity,\n hideable: true,\n sortable: true,\n resizable: true,\n filterable: true,\n groupable: true,\n pinnable: true,\n // @ts-ignore\n aggregable: true,\n editable: false,\n sortComparator: gridStringOrNumberComparator,\n type: 'string',\n align: 'left',\n filterOperators: getGridStringOperators(),\n renderEditCell: renderEditInputCell,\n getApplyQuickFilterFn: getGridStringQuickFilterFn\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"open\", \"target\", \"onClose\", \"children\", \"position\", \"className\", \"onExited\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport ClickAwayListener from '@mui/material/ClickAwayListener';\nimport { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect, HTMLElementType } from '@mui/utils';\nimport Grow from '@mui/material/Grow';\nimport Paper from '@mui/material/Paper';\nimport Popper from '@mui/material/Popper';\nimport { styled } from '@mui/material/styles';\nimport { getDataGridUtilityClass, gridClasses } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['menu']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridMenuRoot = styled(Popper, {\n name: 'MuiDataGrid',\n slot: 'Menu',\n overridesResolver: (_, styles) => styles.menu\n})(({\n theme\n}) => ({\n zIndex: theme.zIndex.modal,\n [`& .${gridClasses.menuList}`]: {\n outline: 0\n }\n}));\nconst transformOrigin = {\n 'bottom-start': 'top left',\n 'bottom-end': 'top right'\n};\nfunction GridMenu(props) {\n const {\n open,\n target,\n onClose,\n children,\n position,\n className,\n onExited\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n const savedFocusRef = React.useRef(null);\n useEnhancedEffect(() => {\n if (open) {\n savedFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n } else {\n savedFocusRef.current?.focus?.();\n savedFocusRef.current = null;\n }\n }, [open]);\n React.useEffect(() => {\n // Emit menuOpen or menuClose events\n const eventName = open ? 'menuOpen' : 'menuClose';\n apiRef.current.publishEvent(eventName, {\n target\n });\n }, [apiRef, open, target]);\n const handleExited = popperOnExited => node => {\n if (popperOnExited) {\n popperOnExited();\n }\n if (onExited) {\n onExited(node);\n }\n };\n const handleClickAway = event => {\n if (event.target && (target === event.target || target?.contains(event.target))) {\n return;\n }\n onClose(event);\n };\n return /*#__PURE__*/_jsx(GridMenuRoot, _extends({\n as: rootProps.slots.basePopper,\n className: clsx(className, classes.root),\n ownerState: rootProps,\n open: open,\n anchorEl: target,\n transition: true,\n placement: position\n }, other, rootProps.slotProps?.basePopper, {\n children: ({\n TransitionProps,\n placement\n }) => /*#__PURE__*/_jsx(ClickAwayListener, {\n onClickAway: handleClickAway,\n mouseEvent: \"onMouseDown\",\n children: /*#__PURE__*/_jsx(Grow, _extends({}, TransitionProps, {\n style: {\n transformOrigin: transformOrigin[placement]\n },\n onExited: handleExited(TransitionProps?.onExited),\n children: /*#__PURE__*/_jsx(Paper, {\n children: children\n })\n }))\n })\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridMenu.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n children: PropTypes.node,\n onClose: PropTypes.func.isRequired,\n onExited: PropTypes.func,\n /**\n * If `true`, the component is shown.\n */\n open: PropTypes.bool.isRequired,\n position: PropTypes.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),\n target: HTMLElementType\n} : void 0;\nexport { GridMenu };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"api\", \"colDef\", \"id\", \"hasFocus\", \"isEditable\", \"field\", \"value\", \"formattedValue\", \"row\", \"rowNode\", \"cellMode\", \"tabIndex\", \"position\", \"focusElementRef\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport MenuList from '@mui/material/MenuList';\nimport { useRtl } from '@mui/system/RtlProvider';\nimport { unstable_useId as useId } from '@mui/utils';\nimport { gridClasses } from \"../../constants/gridClasses.js\";\nimport { GridMenu } from \"../menu/GridMenu.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst hasActions = colDef => typeof colDef.getActions === 'function';\nfunction GridActionsCell(props) {\n const {\n colDef,\n id,\n hasFocus,\n tabIndex,\n position = 'bottom-end',\n focusElementRef\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const [focusedButtonIndex, setFocusedButtonIndex] = React.useState(-1);\n const [open, setOpen] = React.useState(false);\n const apiRef = useGridApiContext();\n const rootRef = React.useRef(null);\n const buttonRef = React.useRef(null);\n const ignoreCallToFocus = React.useRef(false);\n const touchRippleRefs = React.useRef({});\n const isRtl = useRtl();\n const menuId = useId();\n const buttonId = useId();\n const rootProps = useGridRootProps();\n if (!hasActions(colDef)) {\n throw new Error('MUI X: Missing the `getActions` property in the `GridColDef`.');\n }\n const options = colDef.getActions(apiRef.current.getRowParams(id));\n const iconButtons = options.filter(option => !option.props.showInMenu);\n const menuButtons = options.filter(option => option.props.showInMenu);\n const numberOfButtons = iconButtons.length + (menuButtons.length ? 1 : 0);\n React.useLayoutEffect(() => {\n if (!hasFocus) {\n Object.entries(touchRippleRefs.current).forEach(([index, ref]) => {\n ref?.stop({}, () => {\n delete touchRippleRefs.current[index];\n });\n });\n }\n }, [hasFocus]);\n React.useEffect(() => {\n if (focusedButtonIndex < 0 || !rootRef.current) {\n return;\n }\n if (focusedButtonIndex >= rootRef.current.children.length) {\n return;\n }\n const child = rootRef.current.children[focusedButtonIndex];\n child.focus({\n preventScroll: true\n });\n }, [focusedButtonIndex]);\n React.useEffect(() => {\n if (!hasFocus) {\n setFocusedButtonIndex(-1);\n ignoreCallToFocus.current = false;\n }\n }, [hasFocus]);\n React.useImperativeHandle(focusElementRef, () => ({\n focus() {\n // If ignoreCallToFocus is true, then one of the buttons was clicked and the focus is already set\n if (!ignoreCallToFocus.current) {\n // find the first focusable button and pass the index to the state\n const focusableButtonIndex = options.findIndex(o => !o.props.disabled);\n setFocusedButtonIndex(focusableButtonIndex);\n }\n }\n }), [options]);\n React.useEffect(() => {\n if (focusedButtonIndex >= numberOfButtons) {\n setFocusedButtonIndex(numberOfButtons - 1);\n }\n }, [focusedButtonIndex, numberOfButtons]);\n const showMenu = () => {\n setOpen(true);\n setFocusedButtonIndex(numberOfButtons - 1);\n ignoreCallToFocus.current = true;\n };\n const hideMenu = () => {\n setOpen(false);\n };\n const handleTouchRippleRef = index => instance => {\n touchRippleRefs.current[index] = instance;\n };\n const handleButtonClick = (index, onClick) => event => {\n setFocusedButtonIndex(index);\n ignoreCallToFocus.current = true;\n if (onClick) {\n onClick(event);\n }\n };\n const handleRootKeyDown = event => {\n if (numberOfButtons <= 1) {\n return;\n }\n const getNewIndex = (index, direction) => {\n if (index < 0 || index > options.length) {\n return index;\n }\n\n // for rtl mode we need to reverse the direction\n const rtlMod = isRtl ? -1 : 1;\n const indexMod = (direction === 'left' ? -1 : 1) * rtlMod;\n\n // if the button that should receive focus is disabled go one more step\n return options[index + indexMod]?.props.disabled ? getNewIndex(index + indexMod, direction) : index + indexMod;\n };\n let newIndex = focusedButtonIndex;\n if (event.key === 'ArrowRight') {\n newIndex = getNewIndex(focusedButtonIndex, 'right');\n } else if (event.key === 'ArrowLeft') {\n newIndex = getNewIndex(focusedButtonIndex, 'left');\n }\n if (newIndex < 0 || newIndex >= numberOfButtons) {\n return; // We're already in the first or last item = do nothing and let the grid listen the event\n }\n if (newIndex !== focusedButtonIndex) {\n event.preventDefault(); // Prevent scrolling\n event.stopPropagation(); // Don't stop propagation for other keys, for example ArrowUp\n setFocusedButtonIndex(newIndex);\n }\n };\n const handleListKeyDown = event => {\n if (event.key === 'Tab') {\n event.preventDefault();\n }\n if (['Tab', 'Escape'].includes(event.key)) {\n hideMenu();\n }\n };\n return /*#__PURE__*/_jsxs(\"div\", _extends({\n role: \"menu\",\n ref: rootRef,\n tabIndex: -1,\n className: gridClasses.actionsCell,\n onKeyDown: handleRootKeyDown\n }, other, {\n children: [iconButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {\n key: index,\n touchRippleRef: handleTouchRippleRef(index),\n onClick: handleButtonClick(index, button.props.onClick),\n tabIndex: focusedButtonIndex === index ? tabIndex : -1\n })), menuButtons.length > 0 && buttonId && /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({\n ref: buttonRef,\n id: buttonId,\n \"aria-label\": apiRef.current.getLocaleText('actionsCellMore'),\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": open,\n \"aria-controls\": open ? menuId : undefined,\n role: \"menuitem\",\n size: \"small\",\n onClick: showMenu,\n touchRippleRef: handleTouchRippleRef(buttonId),\n tabIndex: focusedButtonIndex === iconButtons.length ? tabIndex : -1\n }, rootProps.slotProps?.baseIconButton, {\n children: /*#__PURE__*/_jsx(rootProps.slots.moreActionsIcon, {\n fontSize: \"small\"\n })\n })), menuButtons.length > 0 && /*#__PURE__*/_jsx(GridMenu, {\n open: open,\n target: buttonRef.current,\n position: position,\n onClose: hideMenu,\n children: /*#__PURE__*/_jsx(MenuList, {\n id: menuId,\n className: gridClasses.menuList,\n onKeyDown: handleListKeyDown,\n \"aria-labelledby\": buttonId,\n variant: \"menu\",\n autoFocusItem: true,\n children: menuButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {\n key: index,\n closeMenu: hideMenu\n }))\n })\n })]\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridActionsCell.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n api: PropTypes.object,\n /**\n * The mode of the cell.\n */\n cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,\n /**\n * The column of the row that the current cell belongs to.\n */\n colDef: PropTypes.object.isRequired,\n /**\n * The column field of the cell that triggered the event.\n */\n field: PropTypes.string.isRequired,\n /**\n * A ref allowing to set imperative focus.\n * It can be passed to the element that should receive focus.\n * @ignore - do not document.\n */\n focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.shape({\n focus: PropTypes.func.isRequired\n })\n })]),\n /**\n * The cell value formatted with the column valueFormatter.\n */\n formattedValue: PropTypes.any,\n /**\n * If true, the cell is the active element.\n */\n hasFocus: PropTypes.bool.isRequired,\n /**\n * The grid row id.\n */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n /**\n * If true, the cell is editable.\n */\n isEditable: PropTypes.bool,\n position: PropTypes.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),\n /**\n * The row model of the row that the current cell belongs to.\n */\n row: PropTypes.any.isRequired,\n /**\n * The node of the row that the current cell belongs to.\n */\n rowNode: PropTypes.object.isRequired,\n /**\n * the tabIndex value.\n */\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\n /**\n * The cell value.\n * If the column has `valueGetter`, use `params.row` to directly access the fields.\n */\n value: PropTypes.any\n} : void 0;\nexport { GridActionsCell };\nexport const renderActionsCell = params => /*#__PURE__*/_jsx(GridActionsCell, _extends({}, params));","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { GRID_STRING_COL_DEF } from \"./gridStringColDef.js\";\nimport { renderActionsCell } from \"../components/cell/GridActionsCell.js\";\nexport const GRID_ACTIONS_COLUMN_TYPE = 'actions';\nexport const GRID_ACTIONS_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {\n sortable: false,\n filterable: false,\n // @ts-ignore\n aggregable: false,\n width: 100,\n display: 'flex',\n align: 'center',\n headerAlign: 'center',\n headerName: '',\n disableColumnMenu: true,\n disableExport: true,\n renderCell: renderActionsCell,\n getApplyQuickFilterFn: undefined\n});","import { createSelector, createSelectorMemoized } from \"../../../utils/createSelector.js\";\nconst gridRowsStateSelector = state => state.rows;\nexport const gridRowCountSelector = createSelector(gridRowsStateSelector, rows => rows.totalRowCount);\nexport const gridRowsLoadingSelector = createSelector(gridRowsStateSelector, rows => rows.loading);\nexport const gridTopLevelRowCountSelector = createSelector(gridRowsStateSelector, rows => rows.totalTopLevelRowCount);\n\n// TODO rows v6: Rename\nexport const gridRowsLookupSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIdToModelLookup);\nexport const gridRowsDataRowIdToIdLookupSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIdToIdLookup);\nexport const gridRowTreeSelector = createSelector(gridRowsStateSelector, rows => rows.tree);\nexport const gridRowGroupsToFetchSelector = createSelector(gridRowsStateSelector, rows => rows.groupsToFetch);\nexport const gridRowGroupingNameSelector = createSelector(gridRowsStateSelector, rows => rows.groupingName);\nexport const gridRowTreeDepthsSelector = createSelector(gridRowsStateSelector, rows => rows.treeDepths);\nexport const gridRowMaximumTreeDepthSelector = createSelectorMemoized(gridRowsStateSelector, rows => {\n const entries = Object.entries(rows.treeDepths);\n if (entries.length === 0) {\n return 1;\n }\n return entries.filter(([, nodeCount]) => nodeCount > 0).map(([depth]) => Number(depth)).sort((a, b) => b - a)[0] + 1;\n});\nexport const gridDataRowIdsSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIds);\n\n/**\n * @ignore - do not document.\n */\nexport const gridAdditionalRowGroupsSelector = createSelector(gridRowsStateSelector, rows => rows?.additionalRowGroups);\n\n/**\n * @ignore - do not document.\n */\nexport const gridPinnedRowsSelector = createSelectorMemoized(gridAdditionalRowGroupsSelector, additionalRowGroups => {\n const rawPinnedRows = additionalRowGroups?.pinnedRows;\n return {\n bottom: rawPinnedRows?.bottom?.map(rowEntry => ({\n id: rowEntry.id,\n model: rowEntry.model ?? {}\n })) ?? [],\n top: rawPinnedRows?.top?.map(rowEntry => ({\n id: rowEntry.id,\n model: rowEntry.model ?? {}\n })) ?? []\n };\n});\n\n/**\n * @ignore - do not document.\n */\nexport const gridPinnedRowsCountSelector = createSelector(gridPinnedRowsSelector, pinnedRows => {\n return (pinnedRows?.top?.length || 0) + (pinnedRows?.bottom?.length || 0);\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { gridPinnedRowsSelector } from \"./gridRowsSelector.js\";\nimport { gridDimensionsSelector } from \"../dimensions/gridDimensionsSelectors.js\";\nexport const GRID_ROOT_GROUP_ID = `auto-generated-group-node-root`;\nexport const GRID_ID_AUTOGENERATED = Symbol('mui.id_autogenerated');\nexport const buildRootGroup = () => ({\n type: 'group',\n id: GRID_ROOT_GROUP_ID,\n depth: -1,\n groupingField: null,\n groupingKey: null,\n isAutoGenerated: true,\n children: [],\n childrenFromPath: {},\n childrenExpanded: true,\n parent: null\n});\n\n/**\n * A helper function to check if the id provided is valid.\n * @param {GridRowId} id Id as [[GridRowId]].\n * @param {GridRowModel | Partial} row Row as [[GridRowModel]].\n * @param {string} detailErrorMessage A custom error message to display for invalid IDs\n */\nexport function checkGridRowIdIsValid(id, row, detailErrorMessage = 'A row was provided without id in the rows prop:') {\n if (id == null) {\n 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.', detailErrorMessage, JSON.stringify(row)].join('\\n'));\n }\n}\nexport const getRowIdFromRowModel = (rowModel, getRowId, detailErrorMessage) => {\n const id = getRowId ? getRowId(rowModel) : rowModel.id;\n checkGridRowIdIsValid(id, rowModel, detailErrorMessage);\n return id;\n};\nexport const createRowsInternalCache = ({\n rows,\n getRowId,\n loading,\n rowCount\n}) => {\n const updates = {\n type: 'full',\n rows: []\n };\n const dataRowIdToModelLookup = {};\n const dataRowIdToIdLookup = {};\n for (let i = 0; i < rows.length; i += 1) {\n const model = rows[i];\n const id = getRowIdFromRowModel(model, getRowId);\n dataRowIdToModelLookup[id] = model;\n dataRowIdToIdLookup[id] = id;\n updates.rows.push(id);\n }\n return {\n rowsBeforePartialUpdates: rows,\n loadingPropBeforePartialUpdates: loading,\n rowCountPropBeforePartialUpdates: rowCount,\n updates,\n dataRowIdToIdLookup,\n dataRowIdToModelLookup\n };\n};\nexport const getTopLevelRowCount = ({\n tree,\n rowCountProp = 0\n}) => {\n const rootGroupNode = tree[GRID_ROOT_GROUP_ID];\n return Math.max(rowCountProp, rootGroupNode.children.length + (rootGroupNode.footerId == null ? 0 : 1));\n};\nexport const getRowsStateFromCache = ({\n apiRef,\n rowCountProp = 0,\n loadingProp,\n previousTree,\n previousTreeDepths,\n previousGroupsToFetch\n}) => {\n const cache = apiRef.current.caches.rows;\n\n // 1. Apply the \"rowTreeCreation\" family processing.\n const {\n tree: unProcessedTree,\n treeDepths: unProcessedTreeDepths,\n dataRowIds: unProcessedDataRowIds,\n groupingName,\n groupsToFetch = []\n } = apiRef.current.applyStrategyProcessor('rowTreeCreation', {\n previousTree,\n previousTreeDepths,\n updates: cache.updates,\n dataRowIdToIdLookup: cache.dataRowIdToIdLookup,\n dataRowIdToModelLookup: cache.dataRowIdToModelLookup,\n previousGroupsToFetch\n });\n\n // 2. Apply the \"hydrateRows\" pipe-processing.\n const groupingParamsWithHydrateRows = apiRef.current.unstable_applyPipeProcessors('hydrateRows', {\n tree: unProcessedTree,\n treeDepths: unProcessedTreeDepths,\n dataRowIdToIdLookup: cache.dataRowIdToIdLookup,\n dataRowIds: unProcessedDataRowIds,\n dataRowIdToModelLookup: cache.dataRowIdToModelLookup\n });\n\n // 3. Reset the cache updates\n apiRef.current.caches.rows.updates = {\n type: 'partial',\n actions: {\n insert: [],\n modify: [],\n remove: []\n },\n idToActionLookup: {}\n };\n return _extends({}, groupingParamsWithHydrateRows, {\n totalRowCount: Math.max(rowCountProp, groupingParamsWithHydrateRows.dataRowIds.length),\n totalTopLevelRowCount: getTopLevelRowCount({\n tree: groupingParamsWithHydrateRows.tree,\n rowCountProp\n }),\n groupingName,\n loading: loadingProp,\n groupsToFetch\n });\n};\nexport const isAutogeneratedRow = row => GRID_ID_AUTOGENERATED in row;\nexport const isAutogeneratedRowNode = rowNode => rowNode.type === 'skeletonRow' || rowNode.type === 'footer' || rowNode.type === 'group' && rowNode.isAutoGenerated || rowNode.type === 'pinnedRow' && rowNode.isAutoGenerated;\nexport const getTreeNodeDescendants = (tree, parentId, skipAutoGeneratedRows) => {\n const node = tree[parentId];\n if (node.type !== 'group') {\n return [];\n }\n const validDescendants = [];\n for (let i = 0; i < node.children.length; i += 1) {\n const child = node.children[i];\n if (!skipAutoGeneratedRows || !isAutogeneratedRowNode(tree[child])) {\n validDescendants.push(child);\n }\n const childDescendants = getTreeNodeDescendants(tree, child, skipAutoGeneratedRows);\n for (let j = 0; j < childDescendants.length; j += 1) {\n validDescendants.push(childDescendants[j]);\n }\n }\n if (!skipAutoGeneratedRows && node.footerId != null) {\n validDescendants.push(node.footerId);\n }\n return validDescendants;\n};\nexport const updateCacheWithNewRows = ({\n previousCache,\n getRowId,\n updates,\n groupKeys\n}) => {\n if (previousCache.updates.type === 'full') {\n throw new Error('MUI X: Unable to prepare a partial update if a full update is not applied yet.');\n }\n\n // Remove duplicate updates.\n // A server can batch updates, and send several updates for the same row in one fn call.\n const uniqueUpdates = new Map();\n updates.forEach(update => {\n const id = getRowIdFromRowModel(update, getRowId, 'A row was provided without id when calling updateRows():');\n if (uniqueUpdates.has(id)) {\n uniqueUpdates.set(id, _extends({}, uniqueUpdates.get(id), update));\n } else {\n uniqueUpdates.set(id, update);\n }\n });\n const partialUpdates = {\n type: 'partial',\n actions: {\n insert: [...(previousCache.updates.actions.insert ?? [])],\n modify: [...(previousCache.updates.actions.modify ?? [])],\n remove: [...(previousCache.updates.actions.remove ?? [])]\n },\n idToActionLookup: _extends({}, previousCache.updates.idToActionLookup),\n groupKeys\n };\n const dataRowIdToModelLookup = _extends({}, previousCache.dataRowIdToModelLookup);\n const dataRowIdToIdLookup = _extends({}, previousCache.dataRowIdToIdLookup);\n const alreadyAppliedActionsToRemove = {\n insert: {},\n modify: {},\n remove: {}\n };\n\n // Depending on the action already applied to the data row,\n // We might want drop the already-applied-update.\n // For instance:\n // - if you delete then insert, then you don't want to apply the deletion in the tree.\n // - if you insert, then modify, then you just want to apply the insertion in the tree.\n uniqueUpdates.forEach((partialRow, id) => {\n const actionAlreadyAppliedToRow = partialUpdates.idToActionLookup[id];\n\n // Action === \"delete\"\n // eslint-disable-next-line no-underscore-dangle\n if (partialRow._action === 'delete') {\n // If the data row has been removed since the last state update,\n // Then do nothing.\n if (actionAlreadyAppliedToRow === 'remove' || !dataRowIdToModelLookup[id]) {\n return;\n }\n\n // If the data row has been inserted / modified since the last state update,\n // Then drop this \"insert\" / \"modify\" update.\n if (actionAlreadyAppliedToRow != null) {\n alreadyAppliedActionsToRemove[actionAlreadyAppliedToRow][id] = true;\n }\n\n // Remove the data row from the lookups and add it to the \"delete\" update.\n partialUpdates.actions.remove.push(id);\n delete dataRowIdToModelLookup[id];\n delete dataRowIdToIdLookup[id];\n return;\n }\n const oldRow = dataRowIdToModelLookup[id];\n\n // Action === \"modify\"\n if (oldRow) {\n // If the data row has been removed since the last state update,\n // Then drop this \"remove\" update and add it to the \"modify\" update instead.\n if (actionAlreadyAppliedToRow === 'remove') {\n alreadyAppliedActionsToRemove.remove[id] = true;\n partialUpdates.actions.modify.push(id);\n }\n // If the date has not been inserted / modified since the last state update,\n // Then add it to the \"modify\" update (if it has been inserted it should just remain \"inserted\").\n else if (actionAlreadyAppliedToRow == null) {\n partialUpdates.actions.modify.push(id);\n }\n\n // Update the data row lookups.\n dataRowIdToModelLookup[id] = _extends({}, oldRow, partialRow);\n return;\n }\n\n // Action === \"insert\"\n // If the data row has been removed since the last state update,\n // Then drop the \"remove\" update and add it to the \"insert\" update instead.\n if (actionAlreadyAppliedToRow === 'remove') {\n alreadyAppliedActionsToRemove.remove[id] = true;\n partialUpdates.actions.insert.push(id);\n }\n // If the data row has not been inserted since the last state update,\n // Then add it to the \"insert\" update.\n // `actionAlreadyAppliedToRow` can't be equal to \"modify\", otherwise we would have an `oldRow` above.\n else if (actionAlreadyAppliedToRow == null) {\n partialUpdates.actions.insert.push(id);\n }\n\n // Update the data row lookups.\n dataRowIdToModelLookup[id] = partialRow;\n dataRowIdToIdLookup[id] = id;\n });\n const actionTypeWithActionsToRemove = Object.keys(alreadyAppliedActionsToRemove);\n for (let i = 0; i < actionTypeWithActionsToRemove.length; i += 1) {\n const actionType = actionTypeWithActionsToRemove[i];\n const idsToRemove = alreadyAppliedActionsToRemove[actionType];\n if (Object.keys(idsToRemove).length > 0) {\n partialUpdates.actions[actionType] = partialUpdates.actions[actionType].filter(id => !idsToRemove[id]);\n }\n }\n return {\n dataRowIdToModelLookup,\n dataRowIdToIdLookup,\n updates: partialUpdates,\n rowsBeforePartialUpdates: previousCache.rowsBeforePartialUpdates,\n loadingPropBeforePartialUpdates: previousCache.loadingPropBeforePartialUpdates,\n rowCountPropBeforePartialUpdates: previousCache.rowCountPropBeforePartialUpdates\n };\n};\nexport function calculatePinnedRowsHeight(apiRef) {\n const pinnedRows = gridPinnedRowsSelector(apiRef);\n const topPinnedRowsHeight = pinnedRows?.top?.reduce((acc, value) => {\n acc += apiRef.current.unstable_getRowHeight(value.id);\n return acc;\n }, 0) || 0;\n const bottomPinnedRowsHeight = pinnedRows?.bottom?.reduce((acc, value) => {\n acc += apiRef.current.unstable_getRowHeight(value.id);\n return acc;\n }, 0) || 0;\n return {\n top: topPinnedRowsHeight,\n bottom: bottomPinnedRowsHeight\n };\n}\nexport function getMinimalContentHeight(apiRef) {\n const dimensions = gridDimensionsSelector(apiRef.current.state);\n return `var(--DataGrid-overlayHeight, ${2 * dimensions.rowHeight}px)`;\n}\nexport function computeRowsUpdates(apiRef, updates, getRowId) {\n const nonPinnedRowsUpdates = [];\n updates.forEach(update => {\n const id = getRowIdFromRowModel(update, getRowId, 'A row was provided without id when calling updateRows():');\n const rowNode = apiRef.current.getRowNode(id);\n if (rowNode?.type === 'pinnedRow') {\n // @ts-ignore because otherwise `release:build` doesn't work\n const pinnedRowsCache = apiRef.current.caches.pinnedRows;\n const prevModel = pinnedRowsCache.idLookup[id];\n if (prevModel) {\n pinnedRowsCache.idLookup[id] = _extends({}, prevModel, update);\n }\n } else {\n nonPinnedRowsUpdates.push(update);\n }\n });\n return nonPinnedRowsUpdates;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"id\", \"value\", \"formattedValue\", \"api\", \"field\", \"row\", \"rowNode\", \"colDef\", \"cellMode\", \"isEditable\", \"hasFocus\", \"tabIndex\", \"hideDescendantCount\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { isAutogeneratedRowNode } from \"../../hooks/features/rows/gridRowsUtils.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['booleanCell']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nfunction GridBooleanCellRaw(props) {\n const {\n value\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes\n };\n const classes = useUtilityClasses(ownerState);\n const Icon = React.useMemo(() => value ? rootProps.slots.booleanCellTrueIcon : rootProps.slots.booleanCellFalseIcon, [rootProps.slots.booleanCellFalseIcon, rootProps.slots.booleanCellTrueIcon, value]);\n return /*#__PURE__*/_jsx(Icon, _extends({\n fontSize: \"small\",\n className: classes.root,\n titleAccess: apiRef.current.getLocaleText(value ? 'booleanCellTrueLabel' : 'booleanCellFalseLabel'),\n \"data-value\": Boolean(value)\n }, other));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridBooleanCellRaw.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * GridApi that let you manipulate the grid.\n */\n api: PropTypes.object.isRequired,\n /**\n * The mode of the cell.\n */\n cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,\n /**\n * The column of the row that the current cell belongs to.\n */\n colDef: PropTypes.object.isRequired,\n /**\n * The column field of the cell that triggered the event.\n */\n field: PropTypes.string.isRequired,\n /**\n * A ref allowing to set imperative focus.\n * It can be passed to the element that should receive focus.\n * @ignore - do not document.\n */\n focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.shape({\n focus: PropTypes.func.isRequired\n })\n })]),\n /**\n * The cell value formatted with the column valueFormatter.\n */\n formattedValue: PropTypes.any,\n /**\n * If true, the cell is the active element.\n */\n hasFocus: PropTypes.bool.isRequired,\n hideDescendantCount: PropTypes.bool,\n /**\n * The grid row id.\n */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n /**\n * If true, the cell is editable.\n */\n isEditable: PropTypes.bool,\n /**\n * The row model of the row that the current cell belongs to.\n */\n row: PropTypes.any.isRequired,\n /**\n * The node of the row that the current cell belongs to.\n */\n rowNode: PropTypes.object.isRequired,\n /**\n * the tabIndex value.\n */\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\n /**\n * The cell value.\n * If the column has `valueGetter`, use `params.row` to directly access the fields.\n */\n value: PropTypes.any\n} : void 0;\nconst GridBooleanCell = /*#__PURE__*/React.memo(GridBooleanCellRaw);\nexport { GridBooleanCell };\nexport const renderBooleanCell = params => {\n if (params.field !== '__row_group_by_columns_group__' && isAutogeneratedRowNode(params.rowNode)) {\n return '';\n }\n return /*#__PURE__*/_jsx(GridBooleanCell, _extends({}, params));\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"id\", \"value\", \"formattedValue\", \"api\", \"field\", \"row\", \"rowNode\", \"colDef\", \"cellMode\", \"isEditable\", \"tabIndex\", \"className\", \"hasFocus\", \"isValidating\", \"isProcessingProps\", \"error\", \"onValueChange\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses, unstable_useId as useId, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['editBooleanCell']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nfunction GridEditBooleanCell(props) {\n const {\n id: idProp,\n value,\n field,\n className,\n hasFocus,\n onValueChange\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const inputRef = React.useRef(null);\n const id = useId();\n const [valueState, setValueState] = React.useState(value);\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes\n };\n const classes = useUtilityClasses(ownerState);\n const handleChange = React.useCallback(async event => {\n const newValue = event.target.checked;\n if (onValueChange) {\n await onValueChange(event, newValue);\n }\n setValueState(newValue);\n await apiRef.current.setEditCellValue({\n id: idProp,\n field,\n value: newValue\n }, event);\n }, [apiRef, field, idProp, onValueChange]);\n React.useEffect(() => {\n setValueState(value);\n }, [value]);\n useEnhancedEffect(() => {\n if (hasFocus) {\n inputRef.current.focus();\n }\n }, [hasFocus]);\n return /*#__PURE__*/_jsx(\"label\", _extends({\n htmlFor: id,\n className: clsx(classes.root, className)\n }, other, {\n children: /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({\n id: id,\n inputRef: inputRef,\n checked: Boolean(valueState),\n onChange: handleChange,\n size: \"small\"\n }, rootProps.slotProps?.baseCheckbox))\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridEditBooleanCell.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * GridApi that let you manipulate the grid.\n */\n api: PropTypes.object.isRequired,\n /**\n * The mode of the cell.\n */\n cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,\n changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),\n /**\n * The column of the row that the current cell belongs to.\n */\n colDef: PropTypes.object.isRequired,\n /**\n * The column field of the cell that triggered the event.\n */\n field: PropTypes.string.isRequired,\n /**\n * The cell value formatted with the column valueFormatter.\n */\n formattedValue: PropTypes.any,\n /**\n * If true, the cell is the active element.\n */\n hasFocus: PropTypes.bool.isRequired,\n /**\n * The grid row id.\n */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n /**\n * If true, the cell is editable.\n */\n isEditable: PropTypes.bool,\n isProcessingProps: PropTypes.bool,\n isValidating: PropTypes.bool,\n /**\n * Callback called when the value is changed by the user.\n * @param {React.ChangeEvent} event The event source of the callback.\n * @param {boolean} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.\n * @returns {Promise | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`\n */\n onValueChange: PropTypes.func,\n /**\n * The row model of the row that the current cell belongs to.\n */\n row: PropTypes.any.isRequired,\n /**\n * The node of the row that the current cell belongs to.\n */\n rowNode: PropTypes.object.isRequired,\n /**\n * the tabIndex value.\n */\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\n /**\n * The cell value.\n * If the column has `valueGetter`, use `params.row` to directly access the fields.\n */\n value: PropTypes.any\n} : void 0;\nexport { GridEditBooleanCell };\nexport const renderEditBooleanCell = params => /*#__PURE__*/_jsx(GridEditBooleanCell, _extends({}, params));","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"item\", \"applyValue\", \"apiRef\", \"focusElementRef\", \"isFilterActive\", \"clearButton\", \"tabIndex\", \"label\", \"variant\", \"InputLabelProps\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { refType, unstable_useId as useId } from '@mui/utils';\nimport { styled } from '@mui/material/styles';\nimport { useGridRootProps } from \"../../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst BooleanOperatorContainer = styled('div')({\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n [`& button`]: {\n margin: 'auto 0px 5px 5px'\n }\n});\nfunction GridFilterInputBoolean(props) {\n const {\n item,\n applyValue,\n apiRef,\n focusElementRef,\n clearButton,\n tabIndex,\n label: labelProp,\n variant = 'standard'\n } = props,\n others = _objectWithoutPropertiesLoose(props, _excluded);\n const [filterValueState, setFilterValueState] = React.useState(item.value || '');\n const rootProps = useGridRootProps();\n const labelId = useId();\n const selectId = useId();\n const baseSelectProps = rootProps.slotProps?.baseSelect || {};\n const isSelectNative = baseSelectProps.native ?? false;\n const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};\n const onFilterChange = React.useCallback(event => {\n const value = event.target.value;\n setFilterValueState(value);\n applyValue(_extends({}, item, {\n value\n }));\n }, [applyValue, item]);\n React.useEffect(() => {\n setFilterValueState(item.value || '');\n }, [item.value]);\n const label = labelProp ?? apiRef.current.getLocaleText('filterPanelInputLabel');\n return /*#__PURE__*/_jsxs(BooleanOperatorContainer, {\n children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {\n fullWidth: true,\n children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, rootProps.slotProps?.baseInputLabel, {\n id: labelId,\n shrink: true,\n variant: variant,\n children: label\n })), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({\n labelId: labelId,\n id: selectId,\n label: label,\n value: filterValueState,\n onChange: onFilterChange,\n variant: variant,\n notched: variant === 'outlined' ? true : undefined,\n native: isSelectNative,\n displayEmpty: true,\n inputProps: {\n ref: focusElementRef,\n tabIndex\n }\n }, others /* FIXME: typing error */, baseSelectProps, {\n children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {\n native: isSelectNative,\n value: \"\",\n children: apiRef.current.getLocaleText('filterValueAny')\n })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {\n native: isSelectNative,\n value: \"true\",\n children: apiRef.current.getLocaleText('filterValueTrue')\n })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {\n native: isSelectNative,\n value: \"false\",\n children: apiRef.current.getLocaleText('filterValueFalse')\n }))]\n }))]\n }), clearButton]\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GridFilterInputBoolean.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n apiRef: PropTypes.shape({\n current: PropTypes.object.isRequired\n }).isRequired,\n applyValue: PropTypes.func.isRequired,\n clearButton: PropTypes.node,\n focusElementRef: refType,\n /**\n * It is `true` if the filter either has a value or an operator with no value\n * required is selected (for example `isEmpty`)\n */\n isFilterActive: PropTypes.bool,\n item: PropTypes.shape({\n field: PropTypes.string.isRequired,\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n operator: PropTypes.string.isRequired,\n value: PropTypes.any\n }).isRequired\n} : void 0;\nexport { GridFilterInputBoolean };","import { GridFilterInputBoolean } from \"../components/panel/filterPanel/GridFilterInputBoolean.js\";\nexport const getGridBooleanOperators = () => [{\n value: 'is',\n getApplyFilterFn: filterItem => {\n if (!filterItem.value) {\n return null;\n }\n const valueAsBoolean = String(filterItem.value) === 'true';\n return value => {\n return Boolean(value) === valueAsBoolean;\n };\n },\n InputComponent: GridFilterInputBoolean\n}];","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { GRID_STRING_COL_DEF } from \"./gridStringColDef.js\";\nimport { renderBooleanCell } from \"../components/cell/GridBooleanCell.js\";\nimport { renderEditBooleanCell } from \"../components/cell/GridEditBooleanCell.js\";\nimport { gridNumberComparator } from \"../hooks/features/sorting/gridSortingUtils.js\";\nimport { getGridBooleanOperators } from \"./gridBooleanOperators.js\";\nconst gridBooleanFormatter = (value, row, column, apiRef) => {\n return value ? apiRef.current.getLocaleText('booleanCellTrueLabel') : apiRef.current.getLocaleText('booleanCellFalseLabel');\n};\nconst stringToBoolean = value => {\n switch (value.toLowerCase().trim()) {\n case 'true':\n case 'yes':\n case '1':\n return true;\n case 'false':\n case 'no':\n case '0':\n case 'null':\n case 'undefined':\n return false;\n default:\n return undefined;\n }\n};\nexport const GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {\n type: 'boolean',\n display: 'flex',\n align: 'center',\n headerAlign: 'center',\n renderCell: renderBooleanCell,\n renderEditCell: renderEditBooleanCell,\n sortComparator: gridNumberComparator,\n valueFormatter: gridBooleanFormatter,\n filterOperators: getGridBooleanOperators(),\n getApplyQuickFilterFn: undefined,\n // @ts-ignore\n aggregable: false,\n // @ts-ignore\n pastedValueParser: value => stringToBoolean(value)\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"field\", \"id\", \"value\", \"formattedValue\", \"row\", \"rowNode\", \"colDef\", \"isEditable\", \"cellMode\", \"hasFocus\", \"tabIndex\", \"api\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_composeClasses as composeClasses, unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['checkboxInput']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCellCheckboxRenderer(props, ref) {\n const {\n field,\n id,\n value: isChecked,\n rowNode,\n hasFocus,\n tabIndex\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes\n };\n const classes = useUtilityClasses(ownerState);\n const checkboxElement = React.useRef(null);\n const rippleRef = React.useRef(null);\n const handleRef = useForkRef(checkboxElement, ref);\n const handleChange = event => {\n const params = {\n value: event.target.checked,\n id\n };\n apiRef.current.publishEvent('rowSelectionCheckboxChange', params, event);\n };\n React.useLayoutEffect(() => {\n if (tabIndex === 0) {\n const element = apiRef.current.getCellElement(id, field);\n if (element) {\n element.tabIndex = -1;\n }\n }\n }, [apiRef, tabIndex, id, field]);\n React.useEffect(() => {\n if (hasFocus) {\n const input = checkboxElement.current?.querySelector('input');\n input?.focus({\n preventScroll: true\n });\n } else if (rippleRef.current) {\n // Only available in @mui/material v5.4.1 or later\n rippleRef.current.stop({});\n }\n }, [hasFocus]);\n const handleKeyDown = React.useCallback(event => {\n if (event.key === ' ') {\n // We call event.stopPropagation to avoid selecting the row and also scrolling to bottom\n // TODO: Remove and add a check inside useGridKeyboardNavigation\n event.stopPropagation();\n }\n }, []);\n if (rowNode.type === 'footer' || rowNode.type === 'pinnedRow') {\n return null;\n }\n const isSelectable = apiRef.current.isRowSelectable(id);\n const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');\n return /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({\n ref: handleRef,\n tabIndex: tabIndex,\n checked: isChecked,\n onChange: handleChange,\n className: classes.root,\n inputProps: {\n 'aria-label': label\n },\n onKeyDown: handleKeyDown,\n disabled: !isSelectable,\n touchRippleRef: rippleRef /* FIXME: typing error */\n }, rootProps.slotProps?.baseCheckbox, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridCellCheckboxForwardRef.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * GridApi that let you manipulate the grid.\n */\n api: PropTypes.object.isRequired,\n /**\n * The mode of the cell.\n */\n cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,\n /**\n * The column of the row that the current cell belongs to.\n */\n colDef: PropTypes.object.isRequired,\n /**\n * The column field of the cell that triggered the event.\n */\n field: PropTypes.string.isRequired,\n /**\n * A ref allowing to set imperative focus.\n * It can be passed to the element that should receive focus.\n * @ignore - do not document.\n */\n focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.shape({\n focus: PropTypes.func.isRequired\n })\n })]),\n /**\n * The cell value formatted with the column valueFormatter.\n */\n formattedValue: PropTypes.any,\n /**\n * If true, the cell is the active element.\n */\n hasFocus: PropTypes.bool.isRequired,\n /**\n * The grid row id.\n */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n /**\n * If true, the cell is editable.\n */\n isEditable: PropTypes.bool,\n /**\n * The row model of the row that the current cell belongs to.\n */\n row: PropTypes.any.isRequired,\n /**\n * The node of the row that the current cell belongs to.\n */\n rowNode: PropTypes.object.isRequired,\n /**\n * the tabIndex value.\n */\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\n /**\n * The cell value.\n * If the column has `valueGetter`, use `params.row` to directly access the fields.\n */\n value: PropTypes.any\n} : void 0;\nexport { GridCellCheckboxForwardRef };\nexport const GridCellCheckboxRenderer = GridCellCheckboxForwardRef;","import { GridSignature } from \"../../utils/useGridApiEventHandler.js\";\nexport function isMultipleRowSelectionEnabled(props) {\n if (props.signature === GridSignature.DataGrid) {\n // DataGrid Community has multiple row selection enabled only if checkbox selection is enabled.\n return props.checkboxSelection && props.disableMultipleRowSelection !== true;\n }\n return !props.disableMultipleRowSelection;\n}","import { createSelector } from \"../../../utils/createSelector.js\";\nexport const gridFocusStateSelector = state => state.focus;\nexport const gridFocusCellSelector = createSelector(gridFocusStateSelector, focusState => focusState.cell);\nexport const gridFocusColumnHeaderSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnHeader);\nexport const gridFocusColumnHeaderFilterSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnHeaderFilter);\nexport const gridFocusColumnGroupHeaderSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnGroupHeader);\nexport const gridTabIndexStateSelector = state => state.tabIndex;\nexport const gridTabIndexCellSelector = createSelector(gridTabIndexStateSelector, state => state.cell);\nexport const gridTabIndexColumnHeaderSelector = createSelector(gridTabIndexStateSelector, state => state.columnHeader);\nexport const gridTabIndexColumnHeaderFilterSelector = createSelector(gridTabIndexStateSelector, state => state.columnHeaderFilter);\nexport const gridTabIndexColumnGroupHeaderSelector = createSelector(gridTabIndexStateSelector, state => state.columnGroupHeader);","import { createSelector, createSelectorMemoized } from \"../../../utils/createSelector.js\";\nimport { gridRowsLookupSelector } from \"../rows/gridRowsSelector.js\";\nexport const gridRowSelectionStateSelector = state => state.rowSelection;\nexport const selectedGridRowsCountSelector = createSelector(gridRowSelectionStateSelector, selection => selection.length);\nexport const selectedGridRowsSelector = createSelectorMemoized(gridRowSelectionStateSelector, gridRowsLookupSelector, (selectedRows, rowsLookup) => new Map(selectedRows.map(id => [id, rowsLookup[id]])));\nexport const selectedIdsLookupSelector = createSelectorMemoized(gridRowSelectionStateSelector, selection => selection.reduce((lookup, rowId) => {\n lookup[rowId] = rowId;\n return lookup;\n}, {}));","import { createSelector, createSelectorMemoized } from \"../../../utils/createSelector.js\";\nimport { gridRowTreeSelector, gridRowsLookupSelector } from \"../rows/gridRowsSelector.js\";\nimport { GRID_ID_AUTOGENERATED, isAutogeneratedRowNode } from \"../rows/gridRowsUtils.js\";\n/**\n * @category Sorting\n * @ignore - do not document.\n */\nconst gridSortingStateSelector = state => state.sorting;\n\n/**\n * Get the id of the rows after the sorting process.\n * @category Sorting\n */\nexport const gridSortedRowIdsSelector = createSelector(gridSortingStateSelector, sortingState => sortingState.sortedRows);\n\n/**\n * Get the id and the model of the rows after the sorting process.\n * @category Sorting\n */\nexport const gridSortedRowEntriesSelector = createSelectorMemoized(gridSortedRowIdsSelector, gridRowsLookupSelector, gridRowTreeSelector, (sortedIds, idRowsLookup, rowTree) => sortedIds.reduce((acc, id) => {\n const model = idRowsLookup[id];\n if (model) {\n acc.push({\n id,\n model\n });\n }\n const rowNode = rowTree[id];\n if (rowNode && isAutogeneratedRowNode(rowNode)) {\n acc.push({\n id,\n model: {\n [GRID_ID_AUTOGENERATED]: id\n }\n });\n }\n return acc;\n}, []));\n\n/**\n * Get the current sorting model.\n * @category Sorting\n */\nexport const gridSortModelSelector = createSelector(gridSortingStateSelector, sorting => sorting.sortModel);\n/**\n * @category Sorting\n * @ignore - do not document.\n */\nexport const gridSortColumnLookupSelector = createSelectorMemoized(gridSortModelSelector, sortModel => {\n const result = sortModel.reduce((res, sortItem, index) => {\n res[sortItem.field] = {\n sortDirection: sortItem.sort,\n sortIndex: sortModel.length > 1 ? index + 1 : undefined\n };\n return res;\n }, {});\n return result;\n});","import { createSelector, createSelectorMemoized } from \"../../../utils/createSelector.js\";\nimport { gridSortedRowEntriesSelector } from \"../sorting/gridSortingSelector.js\";\nimport { gridColumnLookupSelector } from \"../columns/gridColumnsSelector.js\";\nimport { gridRowMaximumTreeDepthSelector, gridRowTreeSelector } from \"../rows/gridRowsSelector.js\";\n\n/**\n * @category Filtering\n */\nconst gridFilterStateSelector = state => state.filter;\n\n/**\n * Get the current filter model.\n * @category Filtering\n */\nexport const gridFilterModelSelector = createSelector(gridFilterStateSelector, filterState => filterState.filterModel);\n\n/**\n * Get the current quick filter values.\n * @category Filtering\n */\nexport const gridQuickFilterValuesSelector = createSelector(gridFilterModelSelector, filterModel => filterModel.quickFilterValues);\n\n/**\n * @category Visible rows\n * @ignore - do not document.\n */\nexport const gridVisibleRowsLookupSelector = state => state.visibleRowsLookup;\n\n/**\n * @category Filtering\n * @ignore - do not document.\n */\nexport const gridFilteredRowsLookupSelector = createSelector(gridFilterStateSelector, filterState => filterState.filteredRowsLookup);\n\n/**\n * @category Filtering\n * @ignore - do not document.\n */\nexport const gridFilteredChildrenCountLookupSelector = createSelector(gridFilterStateSelector, filterState => filterState.filteredChildrenCountLookup);\n\n/**\n * @category Filtering\n * @ignore - do not document.\n */\nexport const gridFilteredDescendantCountLookupSelector = createSelector(gridFilterStateSelector, filterState => filterState.filteredDescendantCountLookup);\n\n/**\n * Get the id and the model of the rows accessible after the filtering process.\n * Does not contain the collapsed children.\n * @category Filtering\n */\nexport const gridExpandedSortedRowEntriesSelector = createSelectorMemoized(gridVisibleRowsLookupSelector, gridSortedRowEntriesSelector, (visibleRowsLookup, sortedRows) => sortedRows.filter(row => visibleRowsLookup[row.id] !== false));\n\n/**\n * Get the id of the rows accessible after the filtering process.\n * Does not contain the collapsed children.\n * @category Filtering\n */\nexport const gridExpandedSortedRowIdsSelector = createSelectorMemoized(gridExpandedSortedRowEntriesSelector, visibleSortedRowEntries => visibleSortedRowEntries.map(row => row.id));\n\n/**\n * Get the id and the model of the rows accessible after the filtering process.\n * Contains the collapsed children.\n * @category Filtering\n */\nexport const gridFilteredSortedRowEntriesSelector = createSelectorMemoized(gridFilteredRowsLookupSelector, gridSortedRowEntriesSelector, (filteredRowsLookup, sortedRows) => sortedRows.filter(row => filteredRowsLookup[row.id] !== false));\n\n/**\n * Get the id of the rows accessible after the filtering process.\n * Contains the collapsed children.\n * @category Filtering\n */\nexport const gridFilteredSortedRowIdsSelector = createSelectorMemoized(gridFilteredSortedRowEntriesSelector, filteredSortedRowEntries => filteredSortedRowEntries.map(row => row.id));\n\n/**\n * Get the ids to position in the current tree level lookup of the rows accessible after the filtering process.\n * Does not contain the collapsed children.\n * @category Filtering\n * @ignore - do not document.\n */\nexport const gridExpandedSortedRowTreeLevelPositionLookupSelector = createSelectorMemoized(gridExpandedSortedRowIdsSelector, gridRowTreeSelector, (visibleSortedRowIds, rowTree) => {\n const depthPositionCounter = {};\n let lastDepth = 0;\n return visibleSortedRowIds.reduce((acc, rowId) => {\n const rowNode = rowTree[rowId];\n if (!depthPositionCounter[rowNode.depth]) {\n depthPositionCounter[rowNode.depth] = 0;\n }\n\n // going deeper in the tree should reset the counter\n // since it might have been used in some other branch at the same level, up in the tree\n // going back up should keep the counter and continue where it left off\n if (rowNode.depth > lastDepth) {\n depthPositionCounter[rowNode.depth] = 0;\n }\n lastDepth = rowNode.depth;\n depthPositionCounter[rowNode.depth] += 1;\n acc[rowId] = depthPositionCounter[rowNode.depth];\n return acc;\n }, {});\n});\n\n/**\n * Get the id and the model of the top level rows accessible after the filtering process.\n * @category Filtering\n */\nexport const gridFilteredSortedTopLevelRowEntriesSelector = createSelectorMemoized(gridExpandedSortedRowEntriesSelector, gridRowTreeSelector, gridRowMaximumTreeDepthSelector, (visibleSortedRows, rowTree, rowTreeDepth) => {\n if (rowTreeDepth < 2) {\n return visibleSortedRows;\n }\n return visibleSortedRows.filter(row => rowTree[row.id]?.depth === 0);\n});\n\n/**\n * Get the amount of rows accessible after the filtering process.\n * @category Filtering\n */\nexport const gridExpandedRowCountSelector = createSelector(gridExpandedSortedRowEntriesSelector, visibleSortedRows => visibleSortedRows.length);\n\n/**\n * Get the amount of top level rows accessible after the filtering process.\n * @category Filtering\n */\nexport const gridFilteredTopLevelRowCountSelector = createSelector(gridFilteredSortedTopLevelRowEntriesSelector, visibleSortedTopLevelRows => visibleSortedTopLevelRows.length);\n\n/**\n * Get the amount of rows accessible after the filtering process.\n * Includes top level and descendant rows.\n * @category Filtering\n */\nexport const gridFilteredRowCountSelector = createSelector(gridFilteredSortedRowEntriesSelector, filteredSortedRowEntries => filteredSortedRowEntries.length);\n\n/**\n * Get the amount of descendant rows accessible after the filtering process.\n * @category Filtering\n */\nexport const gridFilteredDescendantRowCountSelector = createSelector(gridFilteredRowCountSelector, gridFilteredTopLevelRowCountSelector, (totalRowCount, topLevelRowCount) => totalRowCount - topLevelRowCount);\n\n/**\n * @category Filtering\n * @ignore - do not document.\n */\nexport const gridFilterActiveItemsSelector = createSelectorMemoized(gridFilterModelSelector, gridColumnLookupSelector, (filterModel, columnLookup) => filterModel.items?.filter(item => {\n if (!item.field) {\n return false;\n }\n const column = columnLookup[item.field];\n if (!column?.filterOperators || column?.filterOperators?.length === 0) {\n return false;\n }\n const filterOperator = column.filterOperators.find(operator => operator.value === item.operator);\n if (!filterOperator) {\n return false;\n }\n return !filterOperator.InputComponent || item.value != null && item.value?.toString() !== '';\n}));\n/**\n * @category Filtering\n * @ignore - do not document.\n */\nexport const gridFilterActiveItemsLookupSelector = createSelectorMemoized(gridFilterActiveItemsSelector, activeFilters => {\n const result = activeFilters.reduce((res, filterItem) => {\n if (!res[filterItem.field]) {\n res[filterItem.field] = [filterItem];\n } else {\n res[filterItem.field].push(filterItem);\n }\n return res;\n }, {});\n return result;\n});","import * as React from 'react';\nexport function useGridApiMethod(privateApiRef, apiMethods, visibility) {\n const isFirstRender = React.useRef(true);\n React.useEffect(() => {\n isFirstRender.current = false;\n privateApiRef.current.register(visibility, apiMethods);\n }, [privateApiRef, visibility, apiMethods]);\n if (isFirstRender.current) {\n privateApiRef.current.register(visibility, apiMethods);\n }\n}","import * as React from 'react';\nexport function useGridLogger(privateApiRef, name) {\n const logger = React.useRef(null);\n if (logger.current) {\n return logger.current;\n }\n const newLogger = privateApiRef.current.getLogger(name);\n logger.current = newLogger;\n return newLogger;\n}","import * as React from 'react';\nimport { isFunction } from \"../../utils/utils.js\";\nimport { useGridLogger } from \"./useGridLogger.js\";\nexport const useGridNativeEventListener = (apiRef, ref, eventName, handler, options) => {\n const logger = useGridLogger(apiRef, 'useNativeEventListener');\n const [added, setAdded] = React.useState(false);\n const handlerRef = React.useRef(handler);\n const targetElement = isFunction(ref) ? ref() : ref?.current ?? null;\n const wrapHandler = React.useCallback(event => {\n return handlerRef.current && handlerRef.current(event);\n }, []);\n React.useEffect(() => {\n handlerRef.current = handler;\n }, [handler]);\n React.useEffect(() => {\n if (targetElement && eventName && !added) {\n logger.debug(`Binding native ${eventName} event`);\n targetElement.addEventListener(eventName, wrapHandler, options);\n setAdded(true);\n const unsubscribe = () => {\n logger.debug(`Clearing native ${eventName} event`);\n targetElement.removeEventListener(eventName, wrapHandler, options);\n };\n apiRef.current.subscribeEvent('unmount', unsubscribe);\n }\n }, [targetElement, wrapHandler, eventName, added, logger, options, apiRef]);\n};","import * as React from 'react';\nexport const useFirstRender = callback => {\n const isFirstRender = React.useRef(true);\n if (isFirstRender.current) {\n isFirstRender.current = false;\n callback();\n }\n};","import * as React from 'react';\nimport { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';\nconst noop = () => {};\n\n/**\n * Runs an effect once, when `condition` is true.\n */\nexport const useRunOnce = (condition, effect) => {\n const didRun = React.useRef(false);\n useEnhancedEffect(() => {\n if (didRun.current || !condition) {\n return noop;\n }\n didRun.current = true;\n return effect();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [didRun.current || condition]);\n};","import { GridSignature } from \"../../utils/index.js\";\nconst MAX_PAGE_SIZE = 100;\nexport const defaultPageSize = autoPageSize => autoPageSize ? 0 : 100;\nexport const getPageCount = (rowCount, pageSize, page) => {\n if (pageSize > 0 && rowCount > 0) {\n return Math.ceil(rowCount / pageSize);\n }\n if (rowCount === -1) {\n // With unknown row-count, we can assume a page after the current one\n return page + 2;\n }\n return 0;\n};\nexport const getDefaultGridPaginationModel = autoPageSize => ({\n page: 0,\n pageSize: autoPageSize ? 0 : 100\n});\nexport const getValidPage = (page, pageCount = 0) => {\n if (pageCount === 0) {\n return page;\n }\n return Math.max(Math.min(page, pageCount - 1), 0);\n};\nexport const throwIfPageSizeExceedsTheLimit = (pageSize, signatureProp) => {\n if (signatureProp === GridSignature.DataGrid && pageSize > MAX_PAGE_SIZE) {\n 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'));\n }\n};","import { createSelector, createSelectorMemoized } from \"../../../utils/createSelector.js\";\nimport { gridExpandedSortedRowEntriesSelector, gridExpandedSortedRowIdsSelector, gridFilteredSortedTopLevelRowEntriesSelector } from \"../filter/gridFilterSelector.js\";\nimport { gridRowMaximumTreeDepthSelector, gridRowTreeSelector } from \"../rows/gridRowsSelector.js\";\nimport { getPageCount } from \"./gridPaginationUtils.js\";\n\n/**\n * @category Pagination\n * @ignore - do not document.\n */\nexport const gridPaginationSelector = state => state.pagination;\n\n/**\n * Get the pagination model\n * @category Pagination\n */\nexport const gridPaginationModelSelector = createSelector(gridPaginationSelector, pagination => pagination.paginationModel);\n\n/**\n * Get the row count\n * @category Pagination\n */\nexport const gridPaginationRowCountSelector = createSelector(gridPaginationSelector, pagination => pagination.rowCount);\n\n/**\n * Get the pagination meta\n * @category Pagination\n */\nexport const gridPaginationMetaSelector = createSelector(gridPaginationSelector, pagination => pagination.meta);\n\n/**\n * Get the index of the page to render if the pagination is enabled\n * @category Pagination\n */\nexport const gridPageSelector = createSelector(gridPaginationModelSelector, paginationModel => paginationModel.page);\n\n/**\n * Get the maximum amount of rows to display on a single page if the pagination is enabled\n * @category Pagination\n */\nexport const gridPageSizeSelector = createSelector(gridPaginationModelSelector, paginationModel => paginationModel.pageSize);\n\n/**\n * Get the amount of pages needed to display all the rows if the pagination is enabled\n * @category Pagination\n */\nexport const gridPageCountSelector = createSelector(gridPaginationModelSelector, gridPaginationRowCountSelector, (paginationModel, rowCount) => getPageCount(rowCount, paginationModel.pageSize, paginationModel.page));\n\n/**\n * Get the index of the first and the last row to include in the current page if the pagination is enabled.\n * @category Pagination\n */\nexport const gridPaginationRowRangeSelector = createSelectorMemoized(gridPaginationModelSelector, gridRowTreeSelector, gridRowMaximumTreeDepthSelector, gridExpandedSortedRowEntriesSelector, gridFilteredSortedTopLevelRowEntriesSelector, (paginationModel, rowTree, rowTreeDepth, visibleSortedRowEntries, visibleSortedTopLevelRowEntries) => {\n const visibleTopLevelRowCount = visibleSortedTopLevelRowEntries.length;\n const topLevelFirstRowIndex = Math.min(paginationModel.pageSize * paginationModel.page, visibleTopLevelRowCount - 1);\n const topLevelLastRowIndex = Math.min(topLevelFirstRowIndex + paginationModel.pageSize - 1, visibleTopLevelRowCount - 1);\n\n // The range contains no element\n if (topLevelFirstRowIndex === -1 || topLevelLastRowIndex === -1) {\n return null;\n }\n\n // The tree is flat, there is no need to look for children\n if (rowTreeDepth < 2) {\n return {\n firstRowIndex: topLevelFirstRowIndex,\n lastRowIndex: topLevelLastRowIndex\n };\n }\n const topLevelFirstRow = visibleSortedTopLevelRowEntries[topLevelFirstRowIndex];\n const topLevelRowsInCurrentPageCount = topLevelLastRowIndex - topLevelFirstRowIndex + 1;\n const firstRowIndex = visibleSortedRowEntries.findIndex(row => row.id === topLevelFirstRow.id);\n let lastRowIndex = firstRowIndex;\n let topLevelRowAdded = 0;\n while (lastRowIndex < visibleSortedRowEntries.length && topLevelRowAdded <= topLevelRowsInCurrentPageCount) {\n const row = visibleSortedRowEntries[lastRowIndex];\n const depth = rowTree[row.id]?.depth;\n if (depth === undefined) {\n lastRowIndex += 1;\n } else {\n if (topLevelRowAdded < topLevelRowsInCurrentPageCount || depth > 0) {\n lastRowIndex += 1;\n }\n if (depth === 0) {\n topLevelRowAdded += 1;\n }\n }\n }\n return {\n firstRowIndex,\n lastRowIndex: lastRowIndex - 1\n };\n});\n\n/**\n * Get the id and the model of each row to include in the current page if the pagination is enabled.\n * @category Pagination\n */\nexport const gridPaginatedVisibleSortedGridRowEntriesSelector = createSelectorMemoized(gridExpandedSortedRowEntriesSelector, gridPaginationRowRangeSelector, (visibleSortedRowEntries, paginationRange) => {\n if (!paginationRange) {\n return [];\n }\n return visibleSortedRowEntries.slice(paginationRange.firstRowIndex, paginationRange.lastRowIndex + 1);\n});\n\n/**\n * Get the id of each row to include in the current page if the pagination is enabled.\n * @category Pagination\n */\nexport const gridPaginatedVisibleSortedGridRowIdsSelector = createSelectorMemoized(gridExpandedSortedRowIdsSelector, gridPaginationRowRangeSelector, (visibleSortedRowIds, paginationRange) => {\n if (!paginationRange) {\n return [];\n }\n return visibleSortedRowIds.slice(paginationRange.firstRowIndex, paginationRange.lastRowIndex + 1);\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"field\", \"colDef\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { isMultipleRowSelectionEnabled } from \"../../hooks/features/rowSelection/utils.js\";\nimport { useGridSelector } from \"../../hooks/utils/useGridSelector.js\";\nimport { gridTabIndexColumnHeaderSelector } from \"../../hooks/features/focus/gridFocusStateSelector.js\";\nimport { gridRowSelectionStateSelector } from \"../../hooks/features/rowSelection/gridRowSelectionSelector.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { gridExpandedSortedRowIdsSelector } from \"../../hooks/features/filter/gridFilterSelector.js\";\nimport { gridPaginatedVisibleSortedGridRowIdsSelector } from \"../../hooks/features/pagination/gridPaginationSelector.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['checkboxInput']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderCheckbox(props, ref) {\n const other = _objectWithoutPropertiesLoose(props, _excluded);\n const [, forceUpdate] = React.useState(false);\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes\n };\n const classes = useUtilityClasses(ownerState);\n const tabIndexState = useGridSelector(apiRef, gridTabIndexColumnHeaderSelector);\n const selection = useGridSelector(apiRef, gridRowSelectionStateSelector);\n const visibleRowIds = useGridSelector(apiRef, gridExpandedSortedRowIdsSelector);\n const paginatedVisibleRowIds = useGridSelector(apiRef, gridPaginatedVisibleSortedGridRowIdsSelector);\n const filteredSelection = React.useMemo(() => {\n if (typeof rootProps.isRowSelectable !== 'function') {\n return selection;\n }\n return selection.filter(id => {\n // The row might have been deleted\n if (!apiRef.current.getRow(id)) {\n return false;\n }\n return rootProps.isRowSelectable(apiRef.current.getRowParams(id));\n });\n }, [apiRef, rootProps.isRowSelectable, selection]);\n\n // All the rows that could be selected / unselected by toggling this checkbox\n const selectionCandidates = React.useMemo(() => {\n const rowIds = !rootProps.pagination || !rootProps.checkboxSelectionVisibleOnly ? visibleRowIds : paginatedVisibleRowIds;\n\n // Convert to an object to make O(1) checking if a row exists or not\n // TODO create selector that returns visibleRowIds/paginatedVisibleRowIds as an object\n return rowIds.reduce((acc, id) => {\n acc[id] = true;\n return acc;\n }, {});\n }, [rootProps.pagination, rootProps.checkboxSelectionVisibleOnly, paginatedVisibleRowIds, visibleRowIds]);\n\n // Amount of rows selected and that are visible in the current page\n const currentSelectionSize = React.useMemo(() => filteredSelection.filter(id => selectionCandidates[id]).length, [filteredSelection, selectionCandidates]);\n const isIndeterminate = currentSelectionSize > 0 && currentSelectionSize < Object.keys(selectionCandidates).length;\n const isChecked = currentSelectionSize > 0;\n const handleChange = event => {\n const params = {\n value: event.target.checked\n };\n apiRef.current.publishEvent('headerSelectionCheckboxChange', params);\n };\n const tabIndex = tabIndexState !== null && tabIndexState.field === props.field ? 0 : -1;\n React.useLayoutEffect(() => {\n const element = apiRef.current.getColumnHeaderElement(props.field);\n if (tabIndex === 0 && element) {\n element.tabIndex = -1;\n }\n }, [tabIndex, apiRef, props.field]);\n const handleKeyDown = React.useCallback(event => {\n if (event.key === ' ') {\n // imperative toggle the checkbox because Space is disable by some preventDefault\n apiRef.current.publishEvent('headerSelectionCheckboxChange', {\n value: !isChecked\n });\n }\n }, [apiRef, isChecked]);\n const handleSelectionChange = React.useCallback(() => {\n forceUpdate(p => !p);\n }, []);\n React.useEffect(() => {\n return apiRef.current.subscribeEvent('rowSelectionChange', handleSelectionChange);\n }, [apiRef, handleSelectionChange]);\n const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectAllRows' : 'checkboxSelectionSelectAllRows');\n const checked = rootProps.indeterminateCheckboxAction === 'select' ? isChecked && !isIndeterminate : isChecked;\n return /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({\n ref: ref,\n indeterminate: isIndeterminate,\n checked: checked,\n onChange: handleChange,\n className: classes.root,\n inputProps: {\n 'aria-label': label\n },\n tabIndex: tabIndex,\n onKeyDown: handleKeyDown,\n disabled: !isMultipleRowSelectionEnabled(rootProps)\n }, rootProps.slotProps?.baseCheckbox, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridHeaderCheckbox.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The column of the current header component.\n */\n colDef: PropTypes.object.isRequired,\n /**\n * The column field of the column that triggered the event\n */\n field: PropTypes.string.isRequired\n} : void 0;\nexport { GridHeaderCheckbox };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { GridCellCheckboxRenderer } from \"../components/columnSelection/GridCellCheckboxRenderer.js\";\nimport { GridHeaderCheckbox } from \"../components/columnSelection/GridHeaderCheckbox.js\";\nimport { selectedIdsLookupSelector } from \"../hooks/features/rowSelection/gridRowSelectionSelector.js\";\nimport { GRID_BOOLEAN_COL_DEF } from \"./gridBooleanColDef.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const GRID_CHECKBOX_SELECTION_FIELD = '__check__';\nexport const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF, {\n type: 'custom',\n field: GRID_CHECKBOX_SELECTION_FIELD,\n width: 50,\n resizable: false,\n sortable: false,\n filterable: false,\n // @ts-ignore\n aggregable: false,\n disableColumnMenu: true,\n disableReorder: true,\n disableExport: true,\n getApplyQuickFilterFn: undefined,\n display: 'flex',\n valueGetter: (value, row, column, apiRef) => {\n const selectionLookup = selectedIdsLookupSelector(apiRef);\n const rowId = apiRef.current.getRowId(row);\n return selectionLookup[rowId] !== undefined;\n },\n renderHeader: params => /*#__PURE__*/_jsx(GridHeaderCheckbox, _extends({}, params)),\n renderCell: params => /*#__PURE__*/_jsx(GridCellCheckboxRenderer, _extends({}, params))\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"item\", \"applyValue\", \"type\", \"apiRef\", \"focusElementRef\", \"InputProps\", \"isFilterActive\", \"clearButton\", \"tabIndex\", \"disabled\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useId as useId } from '@mui/utils';\nimport { useTimeout } from \"../../../hooks/utils/useTimeout.js\";\nimport { useGridRootProps } from \"../../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction convertFilterItemValueToInputValue(itemValue, inputType) {\n if (itemValue == null) {\n return '';\n }\n const dateCopy = new Date(itemValue);\n if (Number.isNaN(dateCopy.getTime())) {\n return '';\n }\n if (inputType === 'date') {\n return dateCopy.toISOString().substring(0, 10);\n }\n if (inputType === 'datetime-local') {\n // The date picker expects the date to be in the local timezone.\n // But .toISOString() converts it to UTC with zero offset.\n // So we need to subtract the timezone offset.\n dateCopy.setMinutes(dateCopy.getMinutes() - dateCopy.getTimezoneOffset());\n return dateCopy.toISOString().substring(0, 19);\n }\n return dateCopy.toISOString().substring(0, 10);\n}\nfunction GridFilterInputDate(props) {\n const {\n item,\n applyValue,\n type,\n apiRef,\n focusElementRef,\n InputProps,\n clearButton,\n tabIndex,\n disabled\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const filterTimeout = useTimeout();\n const [filterValueState, setFilterValueState] = React.useState(() => convertFilterItemValueToInputValue(item.value, type));\n const [applying, setIsApplying] = React.useState(false);\n const id = useId();\n const rootProps = useGridRootProps();\n const onFilterChange = React.useCallback(event => {\n filterTimeout.clear();\n const value = event.target.value;\n setFilterValueState(value);\n setIsApplying(true);\n filterTimeout.start(rootProps.filterDebounceMs, () => {\n const date = new Date(value);\n applyValue(_extends({}, item, {\n value: Number.isNaN(date.getTime()) ? undefined : date\n }));\n setIsApplying(false);\n });\n }, [applyValue, item, rootProps.filterDebounceMs, filterTimeout]);\n React.useEffect(() => {\n const value = convertFilterItemValueToInputValue(item.value, type);\n setFilterValueState(value);\n }, [item.value, type]);\n return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({\n fullWidth: true,\n id: id,\n label: apiRef.current.getLocaleText('filterPanelInputLabel'),\n placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),\n value: filterValueState,\n onChange: onFilterChange,\n variant: \"standard\",\n type: type || 'text',\n InputLabelProps: {\n shrink: true\n },\n inputRef: focusElementRef,\n InputProps: _extends({}, applying || clearButton ? {\n endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {\n fontSize: \"small\",\n color: \"action\"\n }) : clearButton\n } : {}, {\n disabled\n }, InputProps, {\n inputProps: _extends({\n max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31',\n tabIndex\n }, InputProps?.inputProps)\n })\n }, other, rootProps.slotProps?.baseTextField));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridFilterInputDate.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n apiRef: PropTypes.shape({\n current: PropTypes.object.isRequired\n }).isRequired,\n applyValue: PropTypes.func.isRequired,\n clearButton: PropTypes.node,\n focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),\n /**\n * It is `true` if the filter either has a value or an operator with no value\n * required is selected (for example `isEmpty`)\n */\n isFilterActive: PropTypes.bool,\n item: PropTypes.shape({\n field: PropTypes.string.isRequired,\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n operator: PropTypes.string.isRequired,\n value: PropTypes.any\n }).isRequired\n} : void 0;\nexport { GridFilterInputDate };","import { GridFilterInputDate } from \"../components/panel/filterPanel/GridFilterInputDate.js\";\nfunction buildApplyFilterFn(filterItem, compareFn, showTime, keepHours) {\n if (!filterItem.value) {\n return null;\n }\n const date = new Date(filterItem.value);\n if (showTime) {\n date.setSeconds(0, 0);\n } else {\n // In GMT-X timezone, the date will be one day behind.\n // For 2022-08-16:\n // GMT+2: Tue Aug 16 2022 02:00:00 GMT+0200\n // GMT-4: Mon Aug 15 2022 20:00:00 GMT-0400\n //\n // We need to add the offset before resetting the hours.\n date.setMinutes(date.getMinutes() + date.getTimezoneOffset());\n date.setHours(0, 0, 0, 0);\n }\n const time = date.getTime();\n return value => {\n if (!value) {\n return false;\n }\n if (keepHours) {\n return compareFn(value.getTime(), time);\n }\n\n // Make a copy of the date to not reset the hours in the original object\n const dateCopy = new Date(value);\n if (showTime) {\n dateCopy.setSeconds(0, 0);\n } else {\n dateCopy.setHours(0, 0, 0, 0);\n }\n return compareFn(dateCopy.getTime(), time);\n };\n}\nexport const getGridDateOperators = showTime => [{\n value: 'is',\n getApplyFilterFn: filterItem => {\n return buildApplyFilterFn(filterItem, (value1, value2) => value1 === value2, showTime);\n },\n InputComponent: GridFilterInputDate,\n InputComponentProps: {\n type: showTime ? 'datetime-local' : 'date'\n }\n}, {\n value: 'not',\n getApplyFilterFn: filterItem => {\n return buildApplyFilterFn(filterItem, (value1, value2) => value1 !== value2, showTime);\n },\n InputComponent: GridFilterInputDate,\n InputComponentProps: {\n type: showTime ? 'datetime-local' : 'date'\n }\n}, {\n value: 'after',\n getApplyFilterFn: filterItem => {\n return buildApplyFilterFn(filterItem, (value1, value2) => value1 > value2, showTime);\n },\n InputComponent: GridFilterInputDate,\n InputComponentProps: {\n type: showTime ? 'datetime-local' : 'date'\n }\n}, {\n value: 'onOrAfter',\n getApplyFilterFn: filterItem => {\n return buildApplyFilterFn(filterItem, (value1, value2) => value1 >= value2, showTime);\n },\n InputComponent: GridFilterInputDate,\n InputComponentProps: {\n type: showTime ? 'datetime-local' : 'date'\n }\n}, {\n value: 'before',\n getApplyFilterFn: filterItem => {\n return buildApplyFilterFn(filterItem, (value1, value2) => value1 < value2, showTime, !showTime);\n },\n InputComponent: GridFilterInputDate,\n InputComponentProps: {\n type: showTime ? 'datetime-local' : 'date'\n }\n}, {\n value: 'onOrBefore',\n getApplyFilterFn: filterItem => {\n return buildApplyFilterFn(filterItem, (value1, value2) => value1 <= value2, showTime);\n },\n InputComponent: GridFilterInputDate,\n InputComponentProps: {\n type: showTime ? 'datetime-local' : 'date'\n }\n}, {\n value: 'isEmpty',\n getApplyFilterFn: () => {\n return value => {\n return value == null;\n };\n },\n requiresFilterValue: false\n}, {\n value: 'isNotEmpty',\n getApplyFilterFn: () => {\n return value => {\n return value != null;\n };\n },\n requiresFilterValue: false\n}];","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"id\", \"value\", \"formattedValue\", \"api\", \"field\", \"row\", \"rowNode\", \"colDef\", \"cellMode\", \"isEditable\", \"tabIndex\", \"hasFocus\", \"inputProps\", \"isValidating\", \"isProcessingProps\", \"onValueChange\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';\nimport InputBase from '@mui/material/InputBase';\nimport { styled } from '@mui/material/styles';\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst StyledInputBase = styled(InputBase)({\n fontSize: 'inherit'\n});\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['editInputCell']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nfunction GridEditDateCell(props) {\n const {\n id,\n value: valueProp,\n field,\n colDef,\n hasFocus,\n inputProps,\n onValueChange\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const isDateTime = colDef.type === 'dateTime';\n const apiRef = useGridApiContext();\n const inputRef = React.useRef();\n const valueTransformed = React.useMemo(() => {\n let parsedDate;\n if (valueProp == null) {\n parsedDate = null;\n } else if (valueProp instanceof Date) {\n parsedDate = valueProp;\n } else {\n parsedDate = new Date((valueProp ?? '').toString());\n }\n let formattedDate;\n if (parsedDate == null || Number.isNaN(parsedDate.getTime())) {\n formattedDate = '';\n } else {\n const localDate = new Date(parsedDate.getTime() - parsedDate.getTimezoneOffset() * 60 * 1000);\n formattedDate = localDate.toISOString().substr(0, isDateTime ? 16 : 10);\n }\n return {\n parsed: parsedDate,\n formatted: formattedDate\n };\n }, [valueProp, isDateTime]);\n const [valueState, setValueState] = React.useState(valueTransformed);\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes\n };\n const classes = useUtilityClasses(ownerState);\n const parseValueToDate = React.useCallback(value => {\n if (value === '') {\n return null;\n }\n const [date, time] = value.split('T');\n const [year, month, day] = date.split('-');\n const parsedDate = new Date();\n parsedDate.setFullYear(Number(year), Number(month) - 1, Number(day));\n parsedDate.setHours(0, 0, 0, 0);\n if (time) {\n const [hours, minutes] = time.split(':');\n parsedDate.setHours(Number(hours), Number(minutes), 0, 0);\n }\n return parsedDate;\n }, []);\n const handleChange = React.useCallback(async event => {\n const newFormattedDate = event.target.value;\n const newParsedDate = parseValueToDate(newFormattedDate);\n if (onValueChange) {\n await onValueChange(event, newParsedDate);\n }\n setValueState({\n parsed: newParsedDate,\n formatted: newFormattedDate\n });\n apiRef.current.setEditCellValue({\n id,\n field,\n value: newParsedDate\n }, event);\n }, [apiRef, field, id, onValueChange, parseValueToDate]);\n React.useEffect(() => {\n setValueState(state => {\n if (valueTransformed.parsed !== state.parsed && valueTransformed.parsed?.getTime() !== state.parsed?.getTime()) {\n return valueTransformed;\n }\n return state;\n });\n }, [valueTransformed]);\n useEnhancedEffect(() => {\n if (hasFocus) {\n inputRef.current.focus();\n }\n }, [hasFocus]);\n return /*#__PURE__*/_jsx(StyledInputBase, _extends({\n inputRef: inputRef,\n fullWidth: true,\n className: classes.root,\n type: isDateTime ? 'datetime-local' : 'date',\n inputProps: _extends({\n max: isDateTime ? '9999-12-31T23:59' : '9999-12-31'\n }, inputProps),\n value: valueState.formatted,\n onChange: handleChange\n }, other));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridEditDateCell.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * GridApi that let you manipulate the grid.\n */\n api: PropTypes.object.isRequired,\n /**\n * The mode of the cell.\n */\n cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,\n changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),\n /**\n * The column of the row that the current cell belongs to.\n */\n colDef: PropTypes.object.isRequired,\n /**\n * The column field of the cell that triggered the event.\n */\n field: PropTypes.string.isRequired,\n /**\n * The cell value formatted with the column valueFormatter.\n */\n formattedValue: PropTypes.any,\n /**\n * If true, the cell is the active element.\n */\n hasFocus: PropTypes.bool.isRequired,\n /**\n * The grid row id.\n */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n /**\n * If true, the cell is editable.\n */\n isEditable: PropTypes.bool,\n isProcessingProps: PropTypes.bool,\n isValidating: PropTypes.bool,\n /**\n * Callback called when the value is changed by the user.\n * @param {React.ChangeEvent} event The event source of the callback.\n * @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.\n * @returns {Promise | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`\n */\n onValueChange: PropTypes.func,\n /**\n * The row model of the row that the current cell belongs to.\n */\n row: PropTypes.any.isRequired,\n /**\n * The node of the row that the current cell belongs to.\n */\n rowNode: PropTypes.object.isRequired,\n /**\n * the tabIndex value.\n */\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\n /**\n * The cell value.\n * If the column has `valueGetter`, use `params.row` to directly access the fields.\n */\n value: PropTypes.any\n} : void 0;\nexport { GridEditDateCell };\nexport const renderEditDateCell = params => /*#__PURE__*/_jsx(GridEditDateCell, _extends({}, params));","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { gridDateComparator } from \"../hooks/features/sorting/gridSortingUtils.js\";\nimport { getGridDateOperators } from \"./gridDateOperators.js\";\nimport { GRID_STRING_COL_DEF } from \"./gridStringColDef.js\";\nimport { renderEditDateCell } from \"../components/cell/GridEditDateCell.js\";\nfunction throwIfNotDateObject({\n value,\n columnType,\n rowId,\n field\n}) {\n if (!(value instanceof Date)) {\n throw new Error([`MUI X: \\`${columnType}\\` column type only accepts \\`Date\\` objects as values.`, 'Use `valueGetter` to transform the value into a `Date` object.', `Row ID: ${rowId}, field: \"${field}\".`].join('\\n'));\n }\n}\nexport const gridDateFormatter = (value, row, column, apiRef) => {\n if (!value) {\n return '';\n }\n const rowId = apiRef.current.getRowId(row);\n throwIfNotDateObject({\n value,\n columnType: 'date',\n rowId,\n field: column.field\n });\n return value.toLocaleDateString();\n};\nexport const gridDateTimeFormatter = (value, row, column, apiRef) => {\n if (!value) {\n return '';\n }\n const rowId = apiRef.current.getRowId(row);\n throwIfNotDateObject({\n value,\n columnType: 'dateTime',\n rowId,\n field: column.field\n });\n return value.toLocaleString();\n};\nexport const GRID_DATE_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {\n type: 'date',\n sortComparator: gridDateComparator,\n valueFormatter: gridDateFormatter,\n filterOperators: getGridDateOperators(),\n renderEditCell: renderEditDateCell,\n // @ts-ignore\n pastedValueParser: value => new Date(value)\n});\nexport const GRID_DATETIME_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {\n type: 'dateTime',\n sortComparator: gridDateComparator,\n valueFormatter: gridDateTimeFormatter,\n filterOperators: getGridDateOperators(true),\n renderEditCell: renderEditDateCell,\n // @ts-ignore\n pastedValueParser: value => new Date(value)\n});","import { GridFilterInputValue } from \"../components/panel/filterPanel/GridFilterInputValue.js\";\nimport { GridFilterInputMultipleValue } from \"../components/panel/filterPanel/GridFilterInputMultipleValue.js\";\nconst parseNumericValue = value => {\n if (value == null) {\n return null;\n }\n return Number(value);\n};\nexport const getGridNumericQuickFilterFn = value => {\n if (value == null || Number.isNaN(value) || value === '') {\n return null;\n }\n return columnValue => {\n return parseNumericValue(columnValue) === parseNumericValue(value);\n };\n};\nexport const getGridNumericOperators = () => [{\n value: '=',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || Number.isNaN(filterItem.value)) {\n return null;\n }\n return value => {\n return parseNumericValue(value) === filterItem.value;\n };\n },\n InputComponent: GridFilterInputValue,\n InputComponentProps: {\n type: 'number'\n }\n}, {\n value: '!=',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || Number.isNaN(filterItem.value)) {\n return null;\n }\n return value => {\n return parseNumericValue(value) !== filterItem.value;\n };\n },\n InputComponent: GridFilterInputValue,\n InputComponentProps: {\n type: 'number'\n }\n}, {\n value: '>',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || Number.isNaN(filterItem.value)) {\n return null;\n }\n return value => {\n if (value == null) {\n return false;\n }\n return parseNumericValue(value) > filterItem.value;\n };\n },\n InputComponent: GridFilterInputValue,\n InputComponentProps: {\n type: 'number'\n }\n}, {\n value: '>=',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || Number.isNaN(filterItem.value)) {\n return null;\n }\n return value => {\n if (value == null) {\n return false;\n }\n return parseNumericValue(value) >= filterItem.value;\n };\n },\n InputComponent: GridFilterInputValue,\n InputComponentProps: {\n type: 'number'\n }\n}, {\n value: '<',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || Number.isNaN(filterItem.value)) {\n return null;\n }\n return value => {\n if (value == null) {\n return false;\n }\n return parseNumericValue(value) < filterItem.value;\n };\n },\n InputComponent: GridFilterInputValue,\n InputComponentProps: {\n type: 'number'\n }\n}, {\n value: '<=',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || Number.isNaN(filterItem.value)) {\n return null;\n }\n return value => {\n if (value == null) {\n return false;\n }\n return parseNumericValue(value) <= filterItem.value;\n };\n },\n InputComponent: GridFilterInputValue,\n InputComponentProps: {\n type: 'number'\n }\n}, {\n value: 'isEmpty',\n getApplyFilterFn: () => {\n return value => {\n return value == null;\n };\n },\n requiresFilterValue: false\n}, {\n value: 'isNotEmpty',\n getApplyFilterFn: () => {\n return value => {\n return value != null;\n };\n },\n requiresFilterValue: false\n}, {\n value: 'isAnyOf',\n getApplyFilterFn: filterItem => {\n if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {\n return null;\n }\n return value => {\n return value != null && filterItem.value.includes(Number(value));\n };\n },\n InputComponent: GridFilterInputMultipleValue,\n InputComponentProps: {\n type: 'number'\n }\n}];","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { gridNumberComparator } from \"../hooks/features/sorting/gridSortingUtils.js\";\nimport { isNumber } from \"../utils/utils.js\";\nimport { getGridNumericOperators, getGridNumericQuickFilterFn } from \"./gridNumericOperators.js\";\nimport { GRID_STRING_COL_DEF } from \"./gridStringColDef.js\";\nexport const GRID_NUMERIC_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {\n type: 'number',\n align: 'right',\n headerAlign: 'right',\n sortComparator: gridNumberComparator,\n valueParser: value => value === '' ? null : Number(value),\n valueFormatter: value => isNumber(value) ? value.toLocaleString() : value || '',\n filterOperators: getGridNumericOperators(),\n getApplyQuickFilterFn: getGridNumericQuickFilterFn\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport function isSingleSelectColDef(colDef) {\n return colDef?.type === 'singleSelect';\n}\nexport function getValueOptions(column, additionalParams) {\n if (!column) {\n return undefined;\n }\n return typeof column.valueOptions === 'function' ? column.valueOptions(_extends({\n field: column.field\n }, additionalParams)) : column.valueOptions;\n}\nexport function getValueFromValueOptions(value, valueOptions, getOptionValue) {\n if (valueOptions === undefined) {\n return undefined;\n }\n const result = valueOptions.find(option => {\n const optionValue = getOptionValue(option);\n return String(optionValue) === String(value);\n });\n return getOptionValue(result);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"id\", \"value\", \"formattedValue\", \"api\", \"field\", \"row\", \"rowNode\", \"colDef\", \"cellMode\", \"isEditable\", \"tabIndex\", \"className\", \"hasFocus\", \"isValidating\", \"isProcessingProps\", \"error\", \"onValueChange\", \"initialOpen\"],\n _excluded2 = [\"MenuProps\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';\nimport { GridCellEditStopReasons } from \"../../models/params/gridEditCellParams.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { GridEditModes } from \"../../models/gridEditRowModel.js\";\nimport { getValueFromValueOptions, getValueOptions, isSingleSelectColDef } from \"../panel/filterPanel/filterPanelUtils.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { createElement as _createElement } from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction isKeyboardEvent(event) {\n return !!event.key;\n}\nfunction GridEditSingleSelectCell(props) {\n const rootProps = useGridRootProps();\n const {\n id,\n value: valueProp,\n field,\n row,\n colDef,\n hasFocus,\n error,\n onValueChange,\n initialOpen = rootProps.editMode === GridEditModes.Cell\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const ref = React.useRef();\n const inputRef = React.useRef();\n const [open, setOpen] = React.useState(initialOpen);\n const baseSelectProps = rootProps.slotProps?.baseSelect || {};\n const isSelectNative = baseSelectProps.native ?? false;\n const _ref = rootProps.slotProps?.baseSelect || {},\n {\n MenuProps\n } = _ref,\n otherBaseSelectProps = _objectWithoutPropertiesLoose(_ref, _excluded2);\n useEnhancedEffect(() => {\n if (hasFocus) {\n inputRef.current?.focus();\n }\n }, [hasFocus]);\n if (!isSingleSelectColDef(colDef)) {\n return null;\n }\n const valueOptions = getValueOptions(colDef, {\n id,\n row\n });\n if (!valueOptions) {\n return null;\n }\n const getOptionValue = colDef.getOptionValue;\n const getOptionLabel = colDef.getOptionLabel;\n const handleChange = async event => {\n if (!isSingleSelectColDef(colDef) || !valueOptions) {\n return;\n }\n setOpen(false);\n const target = event.target;\n // NativeSelect casts the value to a string.\n const formattedTargetValue = getValueFromValueOptions(target.value, valueOptions, getOptionValue);\n if (onValueChange) {\n await onValueChange(event, formattedTargetValue);\n }\n await apiRef.current.setEditCellValue({\n id,\n field,\n value: formattedTargetValue\n }, event);\n };\n const handleClose = (event, reason) => {\n if (rootProps.editMode === GridEditModes.Row) {\n setOpen(false);\n return;\n }\n if (reason === 'backdropClick' || event.key === 'Escape') {\n const params = apiRef.current.getCellParams(id, field);\n apiRef.current.publishEvent('cellEditStop', _extends({}, params, {\n reason: event.key === 'Escape' ? GridCellEditStopReasons.escapeKeyDown : GridCellEditStopReasons.cellFocusOut\n }));\n }\n };\n const handleOpen = event => {\n if (isKeyboardEvent(event) && event.key === 'Enter') {\n return;\n }\n setOpen(true);\n };\n if (!valueOptions || !colDef) {\n return null;\n }\n return /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({\n ref: ref,\n inputRef: inputRef,\n value: valueProp,\n onChange: handleChange,\n open: open,\n onOpen: handleOpen,\n MenuProps: _extends({\n onClose: handleClose\n }, MenuProps),\n error: error,\n native: isSelectNative,\n fullWidth: true\n }, other, otherBaseSelectProps, {\n children: valueOptions.map(valueOption => {\n const value = getOptionValue(valueOption);\n return /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, rootProps.slotProps?.baseSelectOption || {}, {\n native: isSelectNative,\n key: value,\n value: value\n }), getOptionLabel(valueOption));\n })\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridEditSingleSelectCell.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * GridApi that let you manipulate the grid.\n */\n api: PropTypes.object.isRequired,\n /**\n * The mode of the cell.\n */\n cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,\n changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),\n /**\n * The column of the row that the current cell belongs to.\n */\n colDef: PropTypes.object.isRequired,\n /**\n * The column field of the cell that triggered the event.\n */\n field: PropTypes.string.isRequired,\n /**\n * The cell value formatted with the column valueFormatter.\n */\n formattedValue: PropTypes.any,\n /**\n * If true, the cell is the active element.\n */\n hasFocus: PropTypes.bool.isRequired,\n /**\n * The grid row id.\n */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n /**\n * If true, the select opens by default.\n */\n initialOpen: PropTypes.bool,\n /**\n * If true, the cell is editable.\n */\n isEditable: PropTypes.bool,\n isProcessingProps: PropTypes.bool,\n isValidating: PropTypes.bool,\n /**\n * Callback called when the value is changed by the user.\n * @param {SelectChangeEvent} event The event source of the callback.\n * @param {any} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.\n * @returns {Promise | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`\n */\n onValueChange: PropTypes.func,\n /**\n * The row model of the row that the current cell belongs to.\n */\n row: PropTypes.any.isRequired,\n /**\n * The node of the row that the current cell belongs to.\n */\n rowNode: PropTypes.object.isRequired,\n /**\n * the tabIndex value.\n */\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\n /**\n * The cell value.\n * If the column has `valueGetter`, use `params.row` to directly access the fields.\n */\n value: PropTypes.any\n} : void 0;\nexport { GridEditSingleSelectCell };\nexport const renderEditSingleSelectCell = params => /*#__PURE__*/_jsx(GridEditSingleSelectCell, _extends({}, params));","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"item\", \"applyValue\", \"type\", \"apiRef\", \"focusElementRef\", \"placeholder\", \"tabIndex\", \"label\", \"variant\", \"isFilterActive\", \"clearButton\", \"InputLabelProps\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useId as useId } from '@mui/utils';\nimport { styled } from '@mui/material/styles';\nimport { useGridRootProps } from \"../../../hooks/utils/useGridRootProps.js\";\nimport { getValueFromValueOptions, getValueOptions, isSingleSelectColDef } from \"./filterPanelUtils.js\";\nimport { createElement as _createElement } from \"react\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst renderSingleSelectOptions = ({\n column,\n OptionComponent,\n getOptionLabel,\n getOptionValue,\n isSelectNative,\n baseSelectOptionProps\n}) => {\n const iterableColumnValues = ['', ...(getValueOptions(column) || [])];\n return iterableColumnValues.map(option => {\n const value = getOptionValue(option);\n let label = getOptionLabel(option);\n if (label === '') {\n label = ' '; // To force the height of the empty option\n }\n return /*#__PURE__*/_createElement(OptionComponent, _extends({}, baseSelectOptionProps, {\n native: isSelectNative,\n key: value,\n value: value\n }), label);\n });\n};\nconst SingleSelectOperatorContainer = styled('div')({\n display: 'flex',\n alignItems: 'flex-end',\n width: '100%',\n [`& button`]: {\n margin: 'auto 0px 5px 5px'\n }\n});\nfunction GridFilterInputSingleSelect(props) {\n const {\n item,\n applyValue,\n type,\n apiRef,\n focusElementRef,\n placeholder,\n tabIndex,\n label: labelProp,\n variant = 'standard',\n clearButton\n } = props,\n others = _objectWithoutPropertiesLoose(props, _excluded);\n const filterValue = item.value ?? '';\n const id = useId();\n const labelId = useId();\n const rootProps = useGridRootProps();\n const isSelectNative = rootProps.slotProps?.baseSelect?.native ?? false;\n let resolvedColumn = null;\n if (item.field) {\n const column = apiRef.current.getColumn(item.field);\n if (isSingleSelectColDef(column)) {\n resolvedColumn = column;\n }\n }\n const getOptionValue = resolvedColumn?.getOptionValue;\n const getOptionLabel = resolvedColumn?.getOptionLabel;\n const currentValueOptions = React.useMemo(() => {\n return getValueOptions(resolvedColumn);\n }, [resolvedColumn]);\n const onFilterChange = React.useCallback(event => {\n let value = event.target.value;\n\n // NativeSelect casts the value to a string.\n value = getValueFromValueOptions(value, currentValueOptions, getOptionValue);\n applyValue(_extends({}, item, {\n value\n }));\n }, [currentValueOptions, getOptionValue, applyValue, item]);\n if (!isSingleSelectColDef(resolvedColumn)) {\n return null;\n }\n const label = labelProp ?? apiRef.current.getLocaleText('filterPanelInputLabel');\n return /*#__PURE__*/_jsxs(SingleSelectOperatorContainer, {\n children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {\n fullWidth: true,\n children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, rootProps.slotProps?.baseInputLabel, {\n id: labelId,\n htmlFor: id,\n shrink: true,\n variant: variant,\n children: label\n })), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({\n id: id,\n label: label,\n labelId: labelId,\n value: filterValue,\n onChange: onFilterChange,\n variant: variant,\n type: type || 'text',\n inputProps: {\n tabIndex,\n ref: focusElementRef,\n placeholder: placeholder ?? apiRef.current.getLocaleText('filterPanelInputPlaceholder')\n },\n native: isSelectNative,\n notched: variant === 'outlined' ? true : undefined\n }, others /* FIXME: typing error */, rootProps.slotProps?.baseSelect, {\n children: renderSingleSelectOptions({\n column: resolvedColumn,\n OptionComponent: rootProps.slots.baseSelectOption,\n getOptionLabel,\n getOptionValue,\n isSelectNative,\n baseSelectOptionProps: rootProps.slotProps?.baseSelectOption\n })\n }))]\n }), clearButton]\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GridFilterInputSingleSelect.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n apiRef: PropTypes.shape({\n current: PropTypes.object.isRequired\n }).isRequired,\n applyValue: PropTypes.func.isRequired,\n clearButton: PropTypes.node,\n focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),\n /**\n * It is `true` if the filter either has a value or an operator with no value\n * required is selected (for example `isEmpty`)\n */\n isFilterActive: PropTypes.bool,\n item: PropTypes.shape({\n field: PropTypes.string.isRequired,\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n operator: PropTypes.string.isRequired,\n value: PropTypes.any\n }).isRequired\n} : void 0;\nexport { GridFilterInputSingleSelect };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"item\", \"applyValue\", \"type\", \"apiRef\", \"focusElementRef\", \"color\", \"error\", \"helperText\", \"size\", \"variant\"],\n _excluded2 = [\"key\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';\nimport { unstable_useId as useId } from '@mui/utils';\nimport { getValueOptions, isSingleSelectColDef } from \"./filterPanelUtils.js\";\nimport { useGridRootProps } from \"../../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst filter = createFilterOptions();\nfunction GridFilterInputMultipleSingleSelect(props) {\n const {\n item,\n applyValue,\n apiRef,\n focusElementRef,\n color,\n error,\n helperText,\n size,\n variant = 'standard'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const TextFieldProps = {\n color,\n error,\n helperText,\n size,\n variant\n };\n const id = useId();\n const rootProps = useGridRootProps();\n let resolvedColumn = null;\n if (item.field) {\n const column = apiRef.current.getColumn(item.field);\n if (isSingleSelectColDef(column)) {\n resolvedColumn = column;\n }\n }\n const getOptionValue = resolvedColumn?.getOptionValue;\n const getOptionLabel = resolvedColumn?.getOptionLabel;\n const isOptionEqualToValue = React.useCallback((option, value) => getOptionValue(option) === getOptionValue(value), [getOptionValue]);\n const resolvedValueOptions = React.useMemo(() => {\n return getValueOptions(resolvedColumn) || [];\n }, [resolvedColumn]);\n\n // The value is computed from the item.value and used directly\n // If it was done by a useEffect/useState, the Autocomplete could receive incoherent value and options\n const filteredValues = React.useMemo(() => {\n if (!Array.isArray(item.value)) {\n return [];\n }\n return item.value.reduce((acc, value) => {\n const resolvedValue = resolvedValueOptions.find(v => getOptionValue(v) === value);\n if (resolvedValue != null) {\n acc.push(resolvedValue);\n }\n return acc;\n }, []);\n }, [getOptionValue, item.value, resolvedValueOptions]);\n const handleChange = React.useCallback((event, value) => {\n applyValue(_extends({}, item, {\n value: value.map(getOptionValue)\n }));\n }, [applyValue, item, getOptionValue]);\n return /*#__PURE__*/_jsx(Autocomplete, _extends({\n multiple: true,\n options: resolvedValueOptions,\n isOptionEqualToValue: isOptionEqualToValue,\n filterOptions: filter,\n id: id,\n value: filteredValues,\n onChange: handleChange,\n getOptionLabel: getOptionLabel,\n renderTags: (value, getTagProps) => value.map((option, index) => {\n const _getTagProps = getTagProps({\n index\n }),\n {\n key\n } = _getTagProps,\n tagProps = _objectWithoutPropertiesLoose(_getTagProps, _excluded2);\n return /*#__PURE__*/_jsx(rootProps.slots.baseChip, _extends({\n variant: \"outlined\",\n size: \"small\",\n label: getOptionLabel(option)\n }, tagProps), key);\n }),\n renderInput: params => /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({}, params, {\n label: apiRef.current.getLocaleText('filterPanelInputLabel'),\n placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),\n InputLabelProps: _extends({}, params.InputLabelProps, {\n shrink: true\n }),\n inputRef: focusElementRef,\n type: \"singleSelect\"\n }, TextFieldProps, rootProps.slotProps?.baseTextField))\n }, other));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridFilterInputMultipleSingleSelect.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n apiRef: PropTypes.shape({\n current: PropTypes.object.isRequired\n }).isRequired,\n applyValue: PropTypes.func.isRequired,\n focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),\n item: PropTypes.shape({\n field: PropTypes.string.isRequired,\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n operator: PropTypes.string.isRequired,\n value: PropTypes.any\n }).isRequired,\n type: PropTypes.oneOf(['singleSelect'])\n} : void 0;\nexport { GridFilterInputMultipleSingleSelect };","import { GridFilterInputSingleSelect } from \"../components/panel/filterPanel/GridFilterInputSingleSelect.js\";\nimport { GridFilterInputMultipleSingleSelect } from \"../components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js\";\nimport { isObject } from \"../utils/utils.js\";\nconst parseObjectValue = value => {\n if (value == null || !isObject(value)) {\n return value;\n }\n return value.value;\n};\nexport const getGridSingleSelectOperators = () => [{\n value: 'is',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || filterItem.value === '') {\n return null;\n }\n return value => parseObjectValue(value) === parseObjectValue(filterItem.value);\n },\n InputComponent: GridFilterInputSingleSelect\n}, {\n value: 'not',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || filterItem.value === '') {\n return null;\n }\n return value => parseObjectValue(value) !== parseObjectValue(filterItem.value);\n },\n InputComponent: GridFilterInputSingleSelect\n}, {\n value: 'isAnyOf',\n getApplyFilterFn: filterItem => {\n if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {\n return null;\n }\n const filterItemValues = filterItem.value.map(parseObjectValue);\n return value => filterItemValues.includes(parseObjectValue(value));\n },\n InputComponent: GridFilterInputMultipleSingleSelect\n}];","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { GRID_STRING_COL_DEF } from \"./gridStringColDef.js\";\nimport { renderEditSingleSelectCell } from \"../components/cell/GridEditSingleSelectCell.js\";\nimport { getGridSingleSelectOperators } from \"./gridSingleSelectOperators.js\";\nimport { getValueOptions, isSingleSelectColDef } from \"../components/panel/filterPanel/filterPanelUtils.js\";\nimport { isObject } from \"../utils/utils.js\";\nconst isArrayOfObjects = options => {\n return typeof options[0] === 'object';\n};\nconst defaultGetOptionValue = value => {\n return isObject(value) ? value.value : value;\n};\nconst defaultGetOptionLabel = value => {\n return isObject(value) ? value.label : String(value);\n};\nexport const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {\n type: 'singleSelect',\n getOptionLabel: defaultGetOptionLabel,\n getOptionValue: defaultGetOptionValue,\n valueFormatter(value, row, colDef, apiRef) {\n // const { id, field, value, api } = params;\n const rowId = apiRef.current.getRowId(row);\n if (!isSingleSelectColDef(colDef)) {\n return '';\n }\n const valueOptions = getValueOptions(colDef, {\n id: rowId,\n row\n });\n if (value == null) {\n return '';\n }\n if (!valueOptions) {\n return value;\n }\n if (!isArrayOfObjects(valueOptions)) {\n return colDef.getOptionLabel(value);\n }\n const valueOption = valueOptions.find(option => colDef.getOptionValue(option) === value);\n return valueOption ? colDef.getOptionLabel(valueOption) : '';\n },\n renderEditCell: renderEditSingleSelectCell,\n filterOperators: getGridSingleSelectOperators(),\n // @ts-ignore\n pastedValueParser: (value, row, column) => {\n const colDef = column;\n const valueOptions = getValueOptions(colDef) || [];\n const getOptionValue = colDef.getOptionValue;\n const valueOption = valueOptions.find(option => {\n if (getOptionValue(option) === value) {\n return true;\n }\n return false;\n });\n if (valueOption) {\n return value;\n }\n // do not paste the value if it is not in the valueOptions\n return undefined;\n }\n});","import { GRID_STRING_COL_DEF } from \"./gridStringColDef.js\";\nimport { GRID_NUMERIC_COL_DEF } from \"./gridNumericColDef.js\";\nimport { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from \"./gridDateColDef.js\";\nimport { GRID_BOOLEAN_COL_DEF } from \"./gridBooleanColDef.js\";\nimport { GRID_SINGLE_SELECT_COL_DEF } from \"./gridSingleSelectColDef.js\";\nimport { GRID_ACTIONS_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from \"./gridActionsColDef.js\";\nexport const DEFAULT_GRID_COL_TYPE_KEY = 'string';\nexport const getGridDefaultColumnTypes = () => {\n const nativeColumnTypes = {\n string: GRID_STRING_COL_DEF,\n number: GRID_NUMERIC_COL_DEF,\n date: GRID_DATE_COL_DEF,\n dateTime: GRID_DATETIME_COL_DEF,\n boolean: GRID_BOOLEAN_COL_DEF,\n singleSelect: GRID_SINGLE_SELECT_COL_DEF,\n [GRID_ACTIONS_COLUMN_TYPE]: GRID_ACTIONS_COL_DEF,\n custom: GRID_STRING_COL_DEF\n };\n return nativeColumnTypes;\n};","import { createSelector } from \"../../../utils/createSelector.js\";\nexport const gridHeaderFilteringStateSelector = state => state.headerFiltering;\nexport const gridHeaderFilteringEnabledSelector = createSelector(gridHeaderFilteringStateSelector,\n// No initialization in MIT, so we need to default to false to be used by `getTotalHeaderHeight`\nheaderFilteringState => headerFilteringState?.enabled ?? false);\nexport const gridHeaderFilteringEditFieldSelector = createSelector(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.editing);\nexport const gridHeaderFilteringMenuSelector = createSelector(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.menuOpen);","import { createSelector, createSelectorMemoized } from \"../../../utils/createSelector.js\";\n/**\n * @category ColumnGrouping\n * @ignore - do not document.\n */\nexport const gridColumnGroupingSelector = state => state.columnGrouping;\nexport const gridColumnGroupsUnwrappedModelSelector = createSelectorMemoized(gridColumnGroupingSelector, columnGrouping => columnGrouping?.unwrappedGroupingModel ?? {});\nexport const gridColumnGroupsLookupSelector = createSelectorMemoized(gridColumnGroupingSelector, columnGrouping => columnGrouping?.lookup ?? {});\nexport const gridColumnGroupsHeaderStructureSelector = createSelectorMemoized(gridColumnGroupingSelector, columnGrouping => columnGrouping?.headerStructure ?? []);\nexport const gridColumnGroupsHeaderMaxDepthSelector = createSelector(gridColumnGroupingSelector, columnGrouping => columnGrouping?.maxDepth ?? 0);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { DEFAULT_GRID_COL_TYPE_KEY, GRID_STRING_COL_DEF, getGridDefaultColumnTypes } from \"../../../colDef/index.js\";\nimport { gridColumnsStateSelector, gridColumnVisibilityModelSelector } from \"./gridColumnsSelector.js\";\nimport { clamp } from \"../../../utils/utils.js\";\nimport { gridDensityFactorSelector } from \"../density/densitySelector.js\";\nimport { gridHeaderFilteringEnabledSelector } from \"../headerFiltering/gridHeaderFilteringSelectors.js\";\nimport { gridColumnGroupsHeaderMaxDepthSelector } from \"../columnGrouping/gridColumnGroupsSelector.js\";\nexport const COLUMNS_DIMENSION_PROPERTIES = ['maxWidth', 'minWidth', 'width', 'flex'];\nconst COLUMN_TYPES = getGridDefaultColumnTypes();\n\n/**\n * Computes width for flex columns.\n * Based on CSS Flexbox specification:\n * https://drafts.csswg.org/css-flexbox-1/#resolve-flexible-lengths\n */\nexport function computeFlexColumnsWidth({\n initialFreeSpace,\n totalFlexUnits,\n flexColumns\n}) {\n const uniqueFlexColumns = new Set(flexColumns.map(col => col.field));\n const flexColumnsLookup = {\n all: {},\n frozenFields: [],\n freeze: field => {\n const value = flexColumnsLookup.all[field];\n if (value && value.frozen !== true) {\n flexColumnsLookup.all[field].frozen = true;\n flexColumnsLookup.frozenFields.push(field);\n }\n }\n };\n\n // Step 5 of https://drafts.csswg.org/css-flexbox-1/#resolve-flexible-lengths\n function loopOverFlexItems() {\n // 5a: If all the flex items on the line are frozen, free space has been distributed.\n if (flexColumnsLookup.frozenFields.length === uniqueFlexColumns.size) {\n return;\n }\n const violationsLookup = {\n min: {},\n max: {}\n };\n let remainingFreeSpace = initialFreeSpace;\n let flexUnits = totalFlexUnits;\n let totalViolation = 0;\n\n // 5b: Calculate the remaining free space\n flexColumnsLookup.frozenFields.forEach(field => {\n remainingFreeSpace -= flexColumnsLookup.all[field].computedWidth;\n flexUnits -= flexColumnsLookup.all[field].flex;\n });\n for (let i = 0; i < flexColumns.length; i += 1) {\n const column = flexColumns[i];\n if (flexColumnsLookup.all[column.field] && flexColumnsLookup.all[column.field].frozen === true) {\n continue;\n }\n\n // 5c: Distribute remaining free space proportional to the flex factors\n const widthPerFlexUnit = remainingFreeSpace / flexUnits;\n let computedWidth = widthPerFlexUnit * column.flex;\n\n // 5d: Fix min/max violations\n if (computedWidth < column.minWidth) {\n totalViolation += column.minWidth - computedWidth;\n computedWidth = column.minWidth;\n violationsLookup.min[column.field] = true;\n } else if (computedWidth > column.maxWidth) {\n totalViolation += column.maxWidth - computedWidth;\n computedWidth = column.maxWidth;\n violationsLookup.max[column.field] = true;\n }\n flexColumnsLookup.all[column.field] = {\n frozen: false,\n computedWidth,\n flex: column.flex\n };\n }\n\n // 5e: Freeze over-flexed items\n if (totalViolation < 0) {\n // Freeze all the items with max violations\n Object.keys(violationsLookup.max).forEach(field => {\n flexColumnsLookup.freeze(field);\n });\n } else if (totalViolation > 0) {\n // Freeze all the items with min violations\n Object.keys(violationsLookup.min).forEach(field => {\n flexColumnsLookup.freeze(field);\n });\n } else {\n // Freeze all items\n flexColumns.forEach(({\n field\n }) => {\n flexColumnsLookup.freeze(field);\n });\n }\n\n // 5f: Return to the start of this loop\n loopOverFlexItems();\n }\n loopOverFlexItems();\n return flexColumnsLookup.all;\n}\n\n/**\n * Compute the `computedWidth` (ie: the width the column should have during rendering) based on the `width` / `flex` / `minWidth` / `maxWidth` properties of `GridColDef`.\n * The columns already have been merged with there `type` default values for `minWidth`, `maxWidth` and `width`, thus the `!` for those properties below.\n * TODO: Unit test this function in depth and only keep basic cases for the whole grid testing.\n * TODO: Improve the `GridColDef` typing to reflect the fact that `minWidth` / `maxWidth` and `width` can't be null after the merge with the `type` default values.\n */\nexport const hydrateColumnsWidth = (rawState, dimensions) => {\n const columnsLookup = {};\n let totalFlexUnits = 0;\n let widthAllocatedBeforeFlex = 0;\n const flexColumns = [];\n\n // For the non-flex columns, compute their width\n // For the flex columns, compute their minimum width and how much width must be allocated during the flex allocation\n rawState.orderedFields.forEach(columnField => {\n let column = rawState.lookup[columnField];\n let computedWidth = 0;\n let isFlex = false;\n if (rawState.columnVisibilityModel[columnField] !== false) {\n if (column.flex && column.flex > 0) {\n totalFlexUnits += column.flex;\n isFlex = true;\n } else {\n computedWidth = clamp(column.width || GRID_STRING_COL_DEF.width, column.minWidth || GRID_STRING_COL_DEF.minWidth, column.maxWidth || GRID_STRING_COL_DEF.maxWidth);\n }\n widthAllocatedBeforeFlex += computedWidth;\n }\n if (column.computedWidth !== computedWidth) {\n column = _extends({}, column, {\n computedWidth\n });\n }\n if (isFlex) {\n flexColumns.push(column);\n }\n columnsLookup[columnField] = column;\n });\n const availableWidth = dimensions === undefined ? 0 : dimensions.viewportOuterSize.width - (dimensions.hasScrollY ? dimensions.scrollbarSize : 0);\n const initialFreeSpace = Math.max(availableWidth - widthAllocatedBeforeFlex, 0);\n\n // Allocate the remaining space to the flex columns\n if (totalFlexUnits > 0 && availableWidth > 0) {\n const computedColumnWidths = computeFlexColumnsWidth({\n initialFreeSpace,\n totalFlexUnits,\n flexColumns\n });\n Object.keys(computedColumnWidths).forEach(field => {\n columnsLookup[field].computedWidth = computedColumnWidths[field].computedWidth;\n });\n }\n return _extends({}, rawState, {\n lookup: columnsLookup\n });\n};\n\n/**\n * Apply the order and the dimensions of the initial state.\n * The columns not registered in `orderedFields` will be placed after the imported columns.\n */\nexport const applyInitialState = (columnsState, initialState) => {\n if (!initialState) {\n return columnsState;\n }\n const {\n orderedFields = [],\n dimensions = {}\n } = initialState;\n const columnsWithUpdatedDimensions = Object.keys(dimensions);\n if (columnsWithUpdatedDimensions.length === 0 && orderedFields.length === 0) {\n return columnsState;\n }\n const orderedFieldsLookup = {};\n const cleanOrderedFields = [];\n for (let i = 0; i < orderedFields.length; i += 1) {\n const field = orderedFields[i];\n\n // Ignores the fields in the initialState that matches no field on the current column state\n if (columnsState.lookup[field]) {\n orderedFieldsLookup[field] = true;\n cleanOrderedFields.push(field);\n }\n }\n const newOrderedFields = cleanOrderedFields.length === 0 ? columnsState.orderedFields : [...cleanOrderedFields, ...columnsState.orderedFields.filter(field => !orderedFieldsLookup[field])];\n const newColumnLookup = _extends({}, columnsState.lookup);\n for (let i = 0; i < columnsWithUpdatedDimensions.length; i += 1) {\n const field = columnsWithUpdatedDimensions[i];\n const newColDef = _extends({}, newColumnLookup[field], {\n hasBeenResized: true\n });\n Object.entries(dimensions[field]).forEach(([key, value]) => {\n newColDef[key] = value === -1 ? Infinity : value;\n });\n newColumnLookup[field] = newColDef;\n }\n const newColumnsState = _extends({}, columnsState, {\n orderedFields: newOrderedFields,\n lookup: newColumnLookup\n });\n return newColumnsState;\n};\nfunction getDefaultColTypeDef(type) {\n let colDef = COLUMN_TYPES[DEFAULT_GRID_COL_TYPE_KEY];\n if (type && COLUMN_TYPES[type]) {\n colDef = COLUMN_TYPES[type];\n }\n return colDef;\n}\nexport const createColumnsState = ({\n apiRef,\n columnsToUpsert,\n initialState,\n columnVisibilityModel = gridColumnVisibilityModelSelector(apiRef),\n keepOnlyColumnsToUpsert = false\n}) => {\n const isInsideStateInitializer = !apiRef.current.state.columns;\n let columnsState;\n if (isInsideStateInitializer) {\n columnsState = {\n orderedFields: [],\n lookup: {},\n columnVisibilityModel\n };\n } else {\n const currentState = gridColumnsStateSelector(apiRef.current.state);\n columnsState = {\n orderedFields: keepOnlyColumnsToUpsert ? [] : [...currentState.orderedFields],\n lookup: _extends({}, currentState.lookup),\n // Will be cleaned later if keepOnlyColumnsToUpsert=true\n columnVisibilityModel\n };\n }\n let columnsToKeep = {};\n if (keepOnlyColumnsToUpsert && !isInsideStateInitializer) {\n columnsToKeep = Object.keys(columnsState.lookup).reduce((acc, key) => _extends({}, acc, {\n [key]: false\n }), {});\n }\n const columnsToUpsertLookup = {};\n columnsToUpsert.forEach(newColumn => {\n const {\n field\n } = newColumn;\n columnsToUpsertLookup[field] = true;\n columnsToKeep[field] = true;\n let existingState = columnsState.lookup[field];\n if (existingState == null) {\n existingState = _extends({}, getDefaultColTypeDef(newColumn.type), {\n field,\n hasBeenResized: false\n });\n columnsState.orderedFields.push(field);\n } else if (keepOnlyColumnsToUpsert) {\n columnsState.orderedFields.push(field);\n }\n\n // If the column type has changed - merge the existing state with the default column type definition\n if (existingState && existingState.type !== newColumn.type) {\n existingState = _extends({}, getDefaultColTypeDef(newColumn.type), {\n field\n });\n }\n let hasBeenResized = existingState.hasBeenResized;\n COLUMNS_DIMENSION_PROPERTIES.forEach(key => {\n if (newColumn[key] !== undefined) {\n hasBeenResized = true;\n if (newColumn[key] === -1) {\n newColumn[key] = Infinity;\n }\n }\n });\n columnsState.lookup[field] = _extends({}, existingState, newColumn, {\n hasBeenResized\n });\n });\n if (keepOnlyColumnsToUpsert && !isInsideStateInitializer) {\n Object.keys(columnsState.lookup).forEach(field => {\n if (!columnsToKeep[field]) {\n delete columnsState.lookup[field];\n }\n });\n }\n const columnsStateWithPreProcessing = apiRef.current.unstable_applyPipeProcessors('hydrateColumns', columnsState);\n const columnsStateWithPortableColumns = applyInitialState(columnsStateWithPreProcessing, initialState);\n return hydrateColumnsWidth(columnsStateWithPortableColumns, apiRef.current.getRootDimensions?.() ?? undefined);\n};\nexport function getFirstNonSpannedColumnToRender({\n firstColumnToRender,\n apiRef,\n firstRowToRender,\n lastRowToRender,\n visibleRows\n}) {\n let firstNonSpannedColumnToRender = firstColumnToRender;\n for (let i = firstRowToRender; i < lastRowToRender; i += 1) {\n const row = visibleRows[i];\n if (row) {\n const rowId = visibleRows[i].id;\n const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, firstColumnToRender);\n if (cellColSpanInfo && cellColSpanInfo.spannedByColSpan) {\n firstNonSpannedColumnToRender = cellColSpanInfo.leftVisibleCellIndex;\n }\n }\n }\n return firstNonSpannedColumnToRender;\n}\nexport function getTotalHeaderHeight(apiRef, props) {\n const densityFactor = gridDensityFactorSelector(apiRef);\n const maxDepth = gridColumnGroupsHeaderMaxDepthSelector(apiRef);\n const isHeaderFilteringEnabled = gridHeaderFilteringEnabledSelector(apiRef);\n const columnHeadersHeight = Math.floor(props.columnHeaderHeight * densityFactor);\n const filterHeadersHeight = isHeaderFilteringEnabled ? Math.floor((props.headerFilterHeight ?? props.columnHeaderHeight) * densityFactor) : 0;\n return columnHeadersHeight * (1 + (maxDepth ?? 0)) + filterHeadersHeight;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses, unstable_useEventCallback as useEventCallback } from '@mui/utils';\nimport { styled } from '@mui/system';\nimport { fastMemo } from '@mui/x-internals/fastMemo';\nimport { useGridRootProps } from \"../hooks/utils/useGridRootProps.js\";\nimport { getDataGridUtilityClass, gridClasses } from \"../constants/index.js\";\nimport { useGridApiContext } from \"../hooks/utils/useGridApiContext.js\";\nimport { useGridApiEventHandler } from \"../hooks/utils/useGridApiEventHandler.js\";\nimport { useGridSelector } from \"../hooks/utils/useGridSelector.js\";\nimport { gridDimensionsSelector } from \"../hooks/features/dimensions/gridDimensionsSelectors.js\";\nimport { gridDensityFactorSelector } from \"../hooks/features/density/densitySelector.js\";\nimport { gridColumnsTotalWidthSelector } from \"../hooks/features/columns/gridColumnsSelector.js\";\nimport { useTimeout } from \"../hooks/utils/useTimeout.js\";\nimport { getTotalHeaderHeight } from \"../hooks/features/columns/gridColumnsUtils.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst CLIFF = 1;\nconst SLOP = 1.5;\nconst useUtilityClasses = ownerState => {\n const {\n scrollDirection,\n classes\n } = ownerState;\n const slots = {\n root: ['scrollArea', `scrollArea--${scrollDirection}`]\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridScrollAreaRawRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'ScrollArea',\n overridesResolver: (props, styles) => [{\n [`&.${gridClasses['scrollArea--left']}`]: styles['scrollArea--left']\n }, {\n [`&.${gridClasses['scrollArea--right']}`]: styles['scrollArea--right']\n }, styles.scrollArea]\n})(() => ({\n position: 'absolute',\n top: 0,\n zIndex: 101,\n width: 20,\n bottom: 0,\n [`&.${gridClasses['scrollArea--left']}`]: {\n left: 0\n },\n [`&.${gridClasses['scrollArea--right']}`]: {\n right: 0\n }\n}));\nfunction GridScrollAreaRaw(props) {\n const {\n scrollDirection\n } = props;\n const rootRef = React.useRef(null);\n const apiRef = useGridApiContext();\n const timeout = useTimeout();\n const densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);\n const columnsTotalWidth = useGridSelector(apiRef, gridColumnsTotalWidthSelector);\n const dimensions = useGridSelector(apiRef, gridDimensionsSelector);\n const scrollPosition = React.useRef({\n left: 0,\n top: 0\n });\n const getCanScrollMore = () => {\n if (scrollDirection === 'left') {\n // Only render if the user has not reached yet the start of the list\n return scrollPosition.current.left > 0;\n }\n if (scrollDirection === 'right') {\n // Only render if the user has not reached yet the end of the list\n const maxScrollLeft = columnsTotalWidth - dimensions.viewportInnerSize.width;\n return scrollPosition.current.left < maxScrollLeft;\n }\n return false;\n };\n const [dragging, setDragging] = React.useState(false);\n const [canScrollMore, setCanScrollMore] = React.useState(getCanScrollMore);\n const rootProps = useGridRootProps();\n const ownerState = _extends({}, rootProps, {\n scrollDirection\n });\n const classes = useUtilityClasses(ownerState);\n const totalHeaderHeight = getTotalHeaderHeight(apiRef, rootProps);\n const headerHeight = Math.floor(rootProps.columnHeaderHeight * densityFactor);\n const style = {\n height: headerHeight,\n top: totalHeaderHeight - headerHeight\n };\n if (scrollDirection === 'left') {\n style.left = dimensions.leftPinnedWidth;\n } else if (scrollDirection === 'right') {\n style.right = dimensions.rightPinnedWidth + (dimensions.hasScrollX ? dimensions.scrollbarSize : 0);\n }\n const handleScrolling = newScrollPosition => {\n scrollPosition.current = newScrollPosition;\n setCanScrollMore(getCanScrollMore);\n };\n const handleDragOver = useEventCallback(event => {\n let offset;\n\n // Prevents showing the forbidden cursor\n event.preventDefault();\n if (scrollDirection === 'left') {\n offset = event.clientX - rootRef.current.getBoundingClientRect().right;\n } else if (scrollDirection === 'right') {\n offset = Math.max(1, event.clientX - rootRef.current.getBoundingClientRect().left);\n } else {\n throw new Error('MUI X: Wrong drag direction');\n }\n offset = (offset - CLIFF) * SLOP + CLIFF;\n\n // Avoid freeze and inertia.\n timeout.start(0, () => {\n apiRef.current.scroll({\n left: scrollPosition.current.left + offset,\n top: scrollPosition.current.top\n });\n });\n });\n const handleColumnHeaderDragStart = useEventCallback(() => {\n setDragging(true);\n });\n const handleColumnHeaderDragEnd = useEventCallback(() => {\n setDragging(false);\n });\n useGridApiEventHandler(apiRef, 'scrollPositionChange', handleScrolling);\n useGridApiEventHandler(apiRef, 'columnHeaderDragStart', handleColumnHeaderDragStart);\n useGridApiEventHandler(apiRef, 'columnHeaderDragEnd', handleColumnHeaderDragEnd);\n if (!dragging || !canScrollMore) {\n return null;\n }\n return /*#__PURE__*/_jsx(GridScrollAreaRawRoot, {\n ref: rootRef,\n className: clsx(classes.root),\n ownerState: ownerState,\n onDragOver: handleDragOver,\n style: style\n });\n}\nexport const GridScrollArea = fastMemo(GridScrollAreaRaw);","'use client';\n\nimport * as React from 'react';\n\n/**\n * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.\n * This is useful for effects that are only needed for client-side rendering but not for SSR.\n *\n * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * and confirm it doesn't apply to your use-case.\n */\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nexport default useEnhancedEffect;","import * as React from 'react';\nimport { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';\nconst isDevEnvironment = process.env.NODE_ENV === 'development';\nconst noop = () => {};\nexport function useResizeObserver(ref, fn, enabled) {\n const fnRef = React.useRef(null);\n fnRef.current = fn;\n useEnhancedEffect(() => {\n if (enabled === false || typeof ResizeObserver === 'undefined') {\n return noop;\n }\n let frameID = 0;\n const target = ref.current;\n const observer = new ResizeObserver(entries => {\n // See https://github.com/mui/mui-x/issues/8733\n // In dev, we avoid the React warning by moving the task to the next frame.\n // In prod, we want the task to run in the same frame as to avoid tear.\n if (isDevEnvironment) {\n frameID = requestAnimationFrame(() => {\n fnRef.current(entries);\n });\n } else {\n fnRef.current(entries);\n }\n });\n if (target) {\n observer.observe(target);\n }\n return () => {\n if (frameID) {\n cancelAnimationFrame(frameID);\n }\n observer.disconnect();\n };\n }, [ref, enabled]);\n}","import * as React from 'react';\nexport const GridPrivateApiContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== 'production') {\n GridPrivateApiContext.displayName = 'GridPrivateApiContext';\n}\nexport function useGridPrivateApiContext() {\n const privateApiRef = React.useContext(GridPrivateApiContext);\n if (privateApiRef === undefined) {\n 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'));\n }\n return privateApiRef;\n}","import * as React from 'react';\nimport { gridPaginationRowRangeSelector, gridPaginatedVisibleSortedGridRowEntriesSelector } from \"../features/pagination/gridPaginationSelector.js\";\nimport { gridExpandedSortedRowEntriesSelector } from \"../features/filter/gridFilterSelector.js\";\nexport const getVisibleRows = (apiRef, props) => {\n let rows;\n let range;\n if (props.pagination && props.paginationMode === 'client') {\n range = gridPaginationRowRangeSelector(apiRef);\n rows = gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef);\n } else {\n rows = gridExpandedSortedRowEntriesSelector(apiRef);\n if (rows.length === 0) {\n range = null;\n } else {\n range = {\n firstRowIndex: 0,\n lastRowIndex: rows.length - 1\n };\n }\n }\n return {\n rows,\n range\n };\n};\n\n/**\n * Computes the list of rows that are reachable by scroll.\n * Depending on whether pagination is enabled, it will return the rows in the current page.\n * - If the pagination is disabled or in server mode, it equals all the visible rows.\n * - If the row tree has several layers, it contains up to `state.pageSize` top level rows and all their descendants.\n * - If the row tree is flat, it only contains up to `state.pageSize` rows.\n */\nexport const useGridVisibleRows = (apiRef, props) => {\n const response = getVisibleRows(apiRef, props);\n return React.useMemo(() => ({\n rows: response.rows,\n range: response.range\n }), [response.rows, response.range]);\n};","const userAgent = typeof navigator !== 'undefined' ? navigator.userAgent.toLowerCase() : 'empty';\nexport const isFirefox = userAgent.includes('firefox');","export const gridRowsMetaSelector = state => state.rowsMeta;","import { createSelector, createSelectorMemoized } from \"../../../utils/createSelector.js\";\n/**\n * Get the columns state\n * @category Virtualization\n */\nexport const gridVirtualizationSelector = state => state.virtualization;\n\n/**\n * Get the enabled state for virtualization\n * @category Virtualization\n * @deprecated Use `gridVirtualizationColumnEnabledSelector` and `gridVirtualizationRowEnabledSelector`\n */\nexport const gridVirtualizationEnabledSelector = createSelector(gridVirtualizationSelector, state => state.enabled);\n\n/**\n * Get the enabled state for column virtualization\n * @category Virtualization\n */\nexport const gridVirtualizationColumnEnabledSelector = createSelector(gridVirtualizationSelector, state => state.enabledForColumns);\n\n/**\n * Get the enabled state for row virtualization\n * @category Virtualization\n */\nexport const gridVirtualizationRowEnabledSelector = createSelector(gridVirtualizationSelector, state => state.enabledForRows);\n\n/**\n * Get the render context\n * @category Virtualization\n * @ignore - do not document.\n */\nexport const gridRenderContextSelector = createSelector(gridVirtualizationSelector, state => state.renderContext);\n\n/**\n * Get the render context, with only columns filled in.\n * This is cached, so it can be used to only re-render when the column interval changes.\n * @category Virtualization\n * @ignore - do not document.\n */\nexport const gridRenderContextColumnsSelector = createSelectorMemoized(state => state.virtualization.renderContext.firstColumnIndex, state => state.virtualization.renderContext.lastColumnIndex, (firstColumnIndex, lastColumnIndex) => ({\n firstColumnIndex,\n lastColumnIndex\n}));","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridApiMethod } from \"../../utils/useGridApiMethod.js\";\nexport const EMPTY_RENDER_CONTEXT = {\n firstRowIndex: 0,\n lastRowIndex: 0,\n firstColumnIndex: 0,\n lastColumnIndex: 0\n};\nexport const virtualizationStateInitializer = (state, props) => {\n const {\n disableVirtualization,\n autoHeight\n } = props;\n const virtualization = {\n enabled: !disableVirtualization,\n enabledForColumns: !disableVirtualization,\n enabledForRows: !disableVirtualization && !autoHeight,\n renderContext: EMPTY_RENDER_CONTEXT\n };\n return _extends({}, state, {\n virtualization\n });\n};\nexport function useGridVirtualization(apiRef, props) {\n /*\n * API METHODS\n */\n\n const setVirtualization = enabled => {\n apiRef.current.setState(state => _extends({}, state, {\n virtualization: _extends({}, state.virtualization, {\n enabled,\n enabledForColumns: enabled,\n enabledForRows: enabled && !props.autoHeight\n })\n }));\n };\n const setColumnVirtualization = enabled => {\n apiRef.current.setState(state => _extends({}, state, {\n virtualization: _extends({}, state.virtualization, {\n enabledForColumns: enabled\n })\n }));\n };\n const api = {\n unstable_setVirtualization: setVirtualization,\n unstable_setColumnVirtualization: setColumnVirtualization\n };\n useGridApiMethod(apiRef, api, 'public');\n\n /*\n * EFFECTS\n */\n\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(() => {\n setVirtualization(!props.disableVirtualization);\n }, [props.disableVirtualization, props.autoHeight]);\n /* eslint-enable react-hooks/exhaustive-deps */\n}","import { createSelector } from \"../../../utils/createSelector.js\";\nconst gridRowSpanningStateSelector = state => state.rowSpanning;\nexport const gridRowSpanningHiddenCellsSelector = createSelector(gridRowSpanningStateSelector, rowSpanning => rowSpanning.hiddenCells);\nexport const gridRowSpanningSpannedCellsSelector = createSelector(gridRowSpanningStateSelector, rowSpanning => rowSpanning.spannedCells);\nexport const gridRowSpanningHiddenCellsOriginMapSelector = createSelector(gridRowSpanningStateSelector, rowSpanning => rowSpanning.hiddenCellOriginMap);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { unstable_useEnhancedEffect as useEnhancedEffect, unstable_useEventCallback as useEventCallback } from '@mui/utils';\nimport useLazyRef from '@mui/utils/useLazyRef';\nimport useTimeout from '@mui/utils/useTimeout';\nimport { useResizeObserver } from '@mui/x-internals/useResizeObserver';\nimport { useRtl } from '@mui/system/RtlProvider';\nimport { useGridPrivateApiContext } from \"../../utils/useGridPrivateApiContext.js\";\nimport { useGridRootProps } from \"../../utils/useGridRootProps.js\";\nimport { useGridSelector } from \"../../utils/useGridSelector.js\";\nimport { useRunOnce } from \"../../utils/useRunOnce.js\";\nimport { gridVisibleColumnDefinitionsSelector, gridVisiblePinnedColumnDefinitionsSelector, gridColumnPositionsSelector, gridHasColSpanSelector } from \"../columns/gridColumnsSelector.js\";\nimport { gridDimensionsSelector } from \"../dimensions/gridDimensionsSelectors.js\";\nimport { gridPinnedRowsSelector } from \"../rows/gridRowsSelector.js\";\nimport { gridFocusCellSelector, gridTabIndexCellSelector } from \"../focus/gridFocusStateSelector.js\";\nimport { useGridVisibleRows, getVisibleRows } from \"../../utils/useGridVisibleRows.js\";\nimport { useGridApiEventHandler } from \"../../utils/index.js\";\nimport * as platform from \"../../../utils/platform.js\";\nimport { clamp, range } from \"../../../utils/utils.js\";\nimport { selectedIdsLookupSelector } from \"../rowSelection/gridRowSelectionSelector.js\";\nimport { gridRowsMetaSelector } from \"../rows/gridRowsMetaSelector.js\";\nimport { getFirstNonSpannedColumnToRender } from \"../columns/gridColumnsUtils.js\";\nimport { getMinimalContentHeight } from \"../rows/gridRowsUtils.js\";\nimport { gridRenderContextSelector, gridVirtualizationRowEnabledSelector, gridVirtualizationColumnEnabledSelector } from \"./gridVirtualizationSelectors.js\";\nimport { EMPTY_RENDER_CONTEXT } from \"./useGridVirtualization.js\";\nimport { gridRowSpanningHiddenCellsOriginMapSelector } from \"../rows/gridRowSpanningSelectors.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst MINIMUM_COLUMN_WIDTH = 50;\nvar ScrollDirection = /*#__PURE__*/function (ScrollDirection) {\n ScrollDirection[ScrollDirection[\"NONE\"] = 0] = \"NONE\";\n ScrollDirection[ScrollDirection[\"UP\"] = 1] = \"UP\";\n ScrollDirection[ScrollDirection[\"DOWN\"] = 2] = \"DOWN\";\n ScrollDirection[ScrollDirection[\"LEFT\"] = 3] = \"LEFT\";\n ScrollDirection[ScrollDirection[\"RIGHT\"] = 4] = \"RIGHT\";\n return ScrollDirection;\n}(ScrollDirection || {});\nconst EMPTY_SCROLL_POSITION = {\n top: 0,\n left: 0\n};\nexport const EMPTY_DETAIL_PANELS = Object.freeze(new Map());\nconst createScrollCache = (isRtl, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer) => ({\n direction: ScrollDirection.NONE,\n buffer: bufferForDirection(isRtl, ScrollDirection.NONE, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer)\n});\nlet isJSDOM = false;\ntry {\n if (typeof window !== 'undefined') {\n isJSDOM = /jsdom/.test(window.navigator.userAgent);\n }\n} catch (_) {\n /* ignore */\n}\nexport const useGridVirtualScroller = () => {\n const apiRef = useGridPrivateApiContext();\n const rootProps = useGridRootProps();\n const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);\n const enabledForRows = useGridSelector(apiRef, gridVirtualizationRowEnabledSelector) && !isJSDOM;\n const enabledForColumns = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector) && !isJSDOM;\n const dimensions = useGridSelector(apiRef, gridDimensionsSelector);\n const outerSize = dimensions.viewportOuterSize;\n const pinnedRows = useGridSelector(apiRef, gridPinnedRowsSelector);\n const pinnedColumns = useGridSelector(apiRef, gridVisiblePinnedColumnDefinitionsSelector);\n const hasBottomPinnedRows = pinnedRows.bottom.length > 0;\n const [panels, setPanels] = React.useState(EMPTY_DETAIL_PANELS);\n const isRtl = useRtl();\n const cellFocus = useGridSelector(apiRef, gridFocusCellSelector);\n const cellTabIndex = useGridSelector(apiRef, gridTabIndexCellSelector);\n const rowsMeta = useGridSelector(apiRef, gridRowsMetaSelector);\n const selectedRowsLookup = useGridSelector(apiRef, selectedIdsLookupSelector);\n const currentPage = useGridVisibleRows(apiRef, rootProps);\n const gridRootRef = apiRef.current.rootElementRef;\n const mainRef = apiRef.current.mainElementRef;\n const scrollerRef = apiRef.current.virtualScrollerRef;\n const scrollbarVerticalRef = React.useRef(null);\n const scrollbarHorizontalRef = React.useRef(null);\n const contentHeight = dimensions.contentSize.height;\n const columnsTotalWidth = dimensions.columnsTotalWidth;\n const hasColSpan = useGridSelector(apiRef, gridHasColSpanSelector);\n useResizeObserver(mainRef, () => apiRef.current.resize());\n\n /*\n * Scroll context logic\n * ====================\n * We only render the cells contained in the `renderContext`. However, when the user starts scrolling the grid\n * in a direction, we want to render as many cells as possible in that direction, as to avoid presenting white\n * areas if the user scrolls too fast/far and the viewport ends up in a region we haven't rendered yet. To render\n * more cells, we store some offsets to add to the viewport in `scrollCache.buffer`. Those offsets make the render\n * context wider in the direction the user is going, but also makes the buffer around the viewport `0` for the\n * dimension (horizontal or vertical) in which the user is not scrolling. So if the normal viewport is 8 columns\n * wide, with a 1 column buffer (10 columns total), then we want it to be exactly 8 columns wide during vertical\n * scroll.\n * However, we don't want the rows in the old context to re-render from e.g. 10 columns to 8 columns, because that's\n * work that's not necessary. Thus we store the context at the start of the scroll in `frozenContext`, and the rows\n * that are part of this old context will keep their same render context as to avoid re-rendering.\n */\n const scrollPosition = React.useRef(EMPTY_SCROLL_POSITION);\n const previousContextScrollPosition = React.useRef(EMPTY_SCROLL_POSITION);\n const previousRowContext = React.useRef(EMPTY_RENDER_CONTEXT);\n const renderContext = useGridSelector(apiRef, gridRenderContextSelector);\n const scrollTimeout = useTimeout();\n const frozenContext = React.useRef(undefined);\n const scrollCache = useLazyRef(() => createScrollCache(isRtl, rootProps.rowBufferPx, rootProps.columnBufferPx, dimensions.rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6)).current;\n const focusedCell = {\n rowIndex: React.useMemo(() => cellFocus ? currentPage.rows.findIndex(row => row.id === cellFocus.id) : -1, [cellFocus, currentPage.rows]),\n columnIndex: React.useMemo(() => cellFocus ? visibleColumns.findIndex(column => column.field === cellFocus.field) : -1, [cellFocus, visibleColumns])\n };\n const updateRenderContext = React.useCallback(nextRenderContext => {\n if (areRenderContextsEqual(nextRenderContext, apiRef.current.state.virtualization.renderContext)) {\n return;\n }\n const didRowsIntervalChange = nextRenderContext.firstRowIndex !== previousRowContext.current.firstRowIndex || nextRenderContext.lastRowIndex !== previousRowContext.current.lastRowIndex;\n apiRef.current.setState(state => {\n return _extends({}, state, {\n virtualization: _extends({}, state.virtualization, {\n renderContext: nextRenderContext\n })\n });\n });\n\n // The lazy-loading hook is listening to `renderedRowsIntervalChange`,\n // but only does something if the dimensions are also available.\n // So we wait until we have valid dimensions before publishing the first event.\n if (dimensions.isReady && didRowsIntervalChange) {\n previousRowContext.current = nextRenderContext;\n apiRef.current.publishEvent('renderedRowsIntervalChange', nextRenderContext);\n }\n previousContextScrollPosition.current = scrollPosition.current;\n }, [apiRef, dimensions.isReady]);\n const triggerUpdateRenderContext = () => {\n const newScroll = {\n top: scrollerRef.current.scrollTop,\n left: scrollerRef.current.scrollLeft\n };\n const dx = newScroll.left - scrollPosition.current.left;\n const dy = newScroll.top - scrollPosition.current.top;\n const isScrolling = dx !== 0 || dy !== 0;\n scrollPosition.current = newScroll;\n const direction = isScrolling ? directionForDelta(dx, dy) : ScrollDirection.NONE;\n\n // Since previous render, we have scrolled...\n const rowScroll = Math.abs(scrollPosition.current.top - previousContextScrollPosition.current.top);\n const columnScroll = Math.abs(scrollPosition.current.left - previousContextScrollPosition.current.left);\n\n // PERF: use the computed minimum column width instead of a static one\n const didCrossThreshold = rowScroll >= dimensions.rowHeight || columnScroll >= MINIMUM_COLUMN_WIDTH;\n const didChangeDirection = scrollCache.direction !== direction;\n const shouldUpdate = didCrossThreshold || didChangeDirection;\n if (!shouldUpdate) {\n return renderContext;\n }\n\n // Render a new context\n\n if (didChangeDirection) {\n switch (direction) {\n case ScrollDirection.NONE:\n case ScrollDirection.LEFT:\n case ScrollDirection.RIGHT:\n frozenContext.current = undefined;\n break;\n default:\n frozenContext.current = renderContext;\n break;\n }\n }\n scrollCache.direction = direction;\n scrollCache.buffer = bufferForDirection(isRtl, direction, rootProps.rowBufferPx, rootProps.columnBufferPx, dimensions.rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6);\n const inputs = inputsSelector(apiRef, rootProps, enabledForRows, enabledForColumns);\n const nextRenderContext = computeRenderContext(inputs, scrollPosition.current, scrollCache);\n\n // Prevents batching render context changes\n ReactDOM.flushSync(() => {\n updateRenderContext(nextRenderContext);\n });\n scrollTimeout.start(1000, triggerUpdateRenderContext);\n return nextRenderContext;\n };\n const forceUpdateRenderContext = () => {\n const inputs = inputsSelector(apiRef, rootProps, enabledForRows, enabledForColumns);\n const nextRenderContext = computeRenderContext(inputs, scrollPosition.current, scrollCache);\n // Reset the frozen context when the render context changes, see the illustration in https://github.com/mui/mui-x/pull/12353\n frozenContext.current = undefined;\n updateRenderContext(nextRenderContext);\n };\n const handleScroll = useEventCallback(event => {\n const {\n scrollTop,\n scrollLeft\n } = event.currentTarget;\n\n // On iOS and macOS, negative offsets are possible when swiping past the start\n if (scrollTop < 0) {\n return;\n }\n if (!isRtl) {\n if (scrollLeft < 0) {\n return;\n }\n }\n if (isRtl) {\n if (scrollLeft > 0) {\n return;\n }\n }\n const nextRenderContext = triggerUpdateRenderContext();\n apiRef.current.publishEvent('scrollPositionChange', {\n top: scrollTop,\n left: scrollLeft,\n renderContext: nextRenderContext\n });\n });\n const handleWheel = useEventCallback(event => {\n apiRef.current.publishEvent('virtualScrollerWheel', {}, event);\n });\n const handleTouchMove = useEventCallback(event => {\n apiRef.current.publishEvent('virtualScrollerTouchMove', {}, event);\n });\n const getRows = (params = {}) => {\n if (!params.rows && !currentPage.range) {\n return [];\n }\n const baseRenderContext = params.renderContext ?? renderContext;\n const isLastSection = !hasBottomPinnedRows && params.position === undefined || hasBottomPinnedRows && params.position === 'bottom';\n const isPinnedSection = params.position !== undefined;\n let rowIndexOffset;\n // FIXME: Why is the switch check exhaustiveness not validated with typescript-eslint?\n // eslint-disable-next-line default-case\n switch (params.position) {\n case 'top':\n rowIndexOffset = 0;\n break;\n case 'bottom':\n rowIndexOffset = pinnedRows.top.length + currentPage.rows.length;\n break;\n case undefined:\n rowIndexOffset = pinnedRows.top.length;\n break;\n }\n const rowModels = params.rows ?? currentPage.rows;\n const firstRowToRender = baseRenderContext.firstRowIndex;\n const lastRowToRender = Math.min(baseRenderContext.lastRowIndex, rowModels.length);\n const rowIndexes = params.rows ? range(0, params.rows.length) : range(firstRowToRender, lastRowToRender);\n let virtualRowIndex = -1;\n if (!isPinnedSection && focusedCell.rowIndex !== -1) {\n if (focusedCell.rowIndex < firstRowToRender) {\n virtualRowIndex = focusedCell.rowIndex;\n rowIndexes.unshift(virtualRowIndex);\n }\n if (focusedCell.rowIndex >= lastRowToRender) {\n virtualRowIndex = focusedCell.rowIndex;\n rowIndexes.push(virtualRowIndex);\n }\n }\n const rows = [];\n const rowProps = rootProps.slotProps?.row;\n const columnPositions = gridColumnPositionsSelector(apiRef);\n rowIndexes.forEach(rowIndexInPage => {\n const {\n id,\n model\n } = rowModels[rowIndexInPage];\n const rowIndex = (currentPage?.range?.firstRowIndex || 0) + rowIndexOffset + rowIndexInPage;\n\n // NOTE: This is an expensive feature, the colSpan code could be optimized.\n if (hasColSpan) {\n const minFirstColumn = pinnedColumns.left.length;\n const maxLastColumn = visibleColumns.length - pinnedColumns.right.length;\n apiRef.current.calculateColSpan({\n rowId: id,\n minFirstColumn,\n maxLastColumn,\n columns: visibleColumns\n });\n if (pinnedColumns.left.length > 0) {\n apiRef.current.calculateColSpan({\n rowId: id,\n minFirstColumn: 0,\n maxLastColumn: pinnedColumns.left.length,\n columns: visibleColumns\n });\n }\n if (pinnedColumns.right.length > 0) {\n apiRef.current.calculateColSpan({\n rowId: id,\n minFirstColumn: visibleColumns.length - pinnedColumns.right.length,\n maxLastColumn: visibleColumns.length,\n columns: visibleColumns\n });\n }\n }\n const hasFocus = cellFocus?.id === id;\n const baseRowHeight = !apiRef.current.rowHasAutoHeight(id) ? apiRef.current.unstable_getRowHeight(id) : 'auto';\n let isSelected;\n if (selectedRowsLookup[id] == null) {\n isSelected = false;\n } else {\n isSelected = apiRef.current.isRowSelectable(id);\n }\n let isFirstVisible = false;\n if (params.position === undefined) {\n isFirstVisible = rowIndexInPage === 0;\n }\n let isLastVisible = false;\n const isLastVisibleInSection = rowIndexInPage === rowModels.length - 1;\n if (isLastSection) {\n if (!isPinnedSection) {\n const lastIndex = currentPage.rows.length - 1;\n const isLastVisibleRowIndex = rowIndexInPage === lastIndex;\n if (isLastVisibleRowIndex) {\n isLastVisible = true;\n }\n } else {\n isLastVisible = isLastVisibleInSection;\n }\n }\n const isVirtualRow = rowIndexInPage === virtualRowIndex;\n const isNotVisible = isVirtualRow;\n let tabbableCell = null;\n if (cellTabIndex !== null && cellTabIndex.id === id) {\n const cellParams = apiRef.current.getCellParams(id, cellTabIndex.field);\n tabbableCell = cellParams.cellMode === 'view' ? cellTabIndex.field : null;\n }\n let currentRenderContext = baseRenderContext;\n if (!isPinnedSection && frozenContext.current && rowIndexInPage >= frozenContext.current.firstRowIndex && rowIndexInPage < frozenContext.current.lastRowIndex) {\n currentRenderContext = frozenContext.current;\n }\n const offsetLeft = computeOffsetLeft(columnPositions, currentRenderContext, pinnedColumns.left.length);\n const showBottomBorder = isLastVisibleInSection && params.position === 'top';\n rows.push(/*#__PURE__*/_jsx(rootProps.slots.row, _extends({\n row: model,\n rowId: id,\n index: rowIndex,\n selected: isSelected,\n offsetTop: params.rows ? undefined : rowsMeta.positions[rowIndexInPage],\n offsetLeft: offsetLeft,\n dimensions: dimensions,\n rowHeight: baseRowHeight,\n tabbableCell: tabbableCell,\n pinnedColumns: pinnedColumns,\n visibleColumns: visibleColumns,\n renderContext: currentRenderContext,\n focusedColumnIndex: hasFocus ? focusedCell.columnIndex : undefined,\n isFirstVisible: isFirstVisible,\n isLastVisible: isLastVisible,\n isNotVisible: isNotVisible,\n showBottomBorder: showBottomBorder\n }, rowProps), id));\n if (isNotVisible) {\n return;\n }\n const panel = panels.get(id);\n if (panel) {\n rows.push(panel);\n }\n if (params.position === undefined && isLastVisibleInSection) {\n rows.push(apiRef.current.getInfiniteLoadingTriggerElement?.({\n lastRowId: id\n }));\n }\n });\n return rows;\n };\n const needsHorizontalScrollbar = outerSize.width && columnsTotalWidth >= outerSize.width;\n const scrollerStyle = React.useMemo(() => ({\n overflowX: !needsHorizontalScrollbar ? 'hidden' : undefined,\n overflowY: rootProps.autoHeight ? 'hidden' : undefined\n }), [needsHorizontalScrollbar, rootProps.autoHeight]);\n const contentSize = React.useMemo(() => {\n const size = {\n width: needsHorizontalScrollbar ? columnsTotalWidth : 'auto',\n height: contentHeight\n };\n if (rootProps.autoHeight && currentPage.rows.length === 0) {\n size.height = getMinimalContentHeight(apiRef); // Give room to show the overlay when there no rows.\n }\n return size;\n }, [apiRef, columnsTotalWidth, contentHeight, needsHorizontalScrollbar, rootProps.autoHeight, currentPage.rows.length]);\n React.useEffect(() => {\n apiRef.current.publishEvent('virtualScrollerContentSizeChange');\n }, [apiRef, contentSize]);\n useEnhancedEffect(() => {\n // FIXME: Is this really necessary?\n apiRef.current.resize();\n }, [apiRef, rowsMeta.currentPageTotalHeight]);\n useEnhancedEffect(() => {\n // TODO a scroll reset should not be necessary\n if (enabledForColumns) {\n scrollerRef.current.scrollLeft = 0;\n }\n if (enabledForRows) {\n scrollerRef.current.scrollTop = 0;\n }\n }, [enabledForColumns, enabledForRows, gridRootRef, scrollerRef]);\n useRunOnce(outerSize.width !== 0, () => {\n const inputs = inputsSelector(apiRef, rootProps, enabledForRows, enabledForColumns);\n const initialRenderContext = computeRenderContext(inputs, scrollPosition.current, scrollCache);\n updateRenderContext(initialRenderContext);\n apiRef.current.publishEvent('scrollPositionChange', {\n top: scrollPosition.current.top,\n left: scrollPosition.current.left,\n renderContext: initialRenderContext\n });\n });\n apiRef.current.register('private', {\n updateRenderContext: forceUpdateRenderContext\n });\n useGridApiEventHandler(apiRef, 'columnsChange', forceUpdateRenderContext);\n useGridApiEventHandler(apiRef, 'filteredRowsSet', forceUpdateRenderContext);\n useGridApiEventHandler(apiRef, 'rowExpansionChange', forceUpdateRenderContext);\n return {\n renderContext,\n setPanels,\n getRows,\n getContainerProps: () => ({\n ref: mainRef\n }),\n getScrollerProps: () => ({\n ref: scrollerRef,\n onScroll: handleScroll,\n onWheel: handleWheel,\n onTouchMove: handleTouchMove,\n style: scrollerStyle,\n role: 'presentation',\n // `tabIndex` shouldn't be used along role=presentation, but it fixes a Firefox bug\n // https://github.com/mui/mui-x/pull/13891#discussion_r1683416024\n tabIndex: platform.isFirefox ? -1 : undefined\n }),\n getContentProps: () => ({\n style: contentSize,\n role: 'presentation'\n }),\n getRenderZoneProps: () => ({\n role: 'rowgroup'\n }),\n getScrollbarVerticalProps: () => ({\n ref: scrollbarVerticalRef,\n role: 'presentation'\n }),\n getScrollbarHorizontalProps: () => ({\n ref: scrollbarHorizontalRef,\n role: 'presentation'\n })\n };\n};\nfunction inputsSelector(apiRef, rootProps, enabledForRows, enabledForColumns) {\n const dimensions = gridDimensionsSelector(apiRef.current.state);\n const currentPage = getVisibleRows(apiRef, rootProps);\n const visibleColumns = gridVisibleColumnDefinitionsSelector(apiRef);\n const hiddenCellsOriginMap = gridRowSpanningHiddenCellsOriginMapSelector(apiRef);\n const lastRowId = apiRef.current.state.rows.dataRowIds.at(-1);\n const lastColumn = visibleColumns.at(-1);\n return {\n enabledForRows,\n enabledForColumns,\n apiRef,\n autoHeight: rootProps.autoHeight,\n rowBufferPx: rootProps.rowBufferPx,\n columnBufferPx: rootProps.columnBufferPx,\n leftPinnedWidth: dimensions.leftPinnedWidth,\n columnsTotalWidth: dimensions.columnsTotalWidth,\n viewportInnerWidth: dimensions.viewportInnerSize.width,\n viewportInnerHeight: dimensions.viewportInnerSize.height,\n lastRowHeight: lastRowId !== undefined ? apiRef.current.unstable_getRowHeight(lastRowId) : 0,\n lastColumnWidth: lastColumn?.computedWidth ?? 0,\n rowsMeta: gridRowsMetaSelector(apiRef.current.state),\n columnPositions: gridColumnPositionsSelector(apiRef),\n rows: currentPage.rows,\n range: currentPage.range,\n pinnedColumns: gridVisiblePinnedColumnDefinitionsSelector(apiRef),\n visibleColumns,\n hiddenCellsOriginMap\n };\n}\nfunction computeRenderContext(inputs, scrollPosition, scrollCache) {\n const renderContext = {\n firstRowIndex: 0,\n lastRowIndex: inputs.rows.length,\n firstColumnIndex: 0,\n lastColumnIndex: inputs.visibleColumns.length\n };\n const {\n top,\n left\n } = scrollPosition;\n const realLeft = Math.abs(left) + inputs.leftPinnedWidth;\n if (inputs.enabledForRows) {\n // Clamp the value because the search may return an index out of bounds.\n // In the last index, this is not needed because Array.slice doesn't include it.\n let firstRowIndex = Math.min(getNearestIndexToRender(inputs, top, {\n atStart: true,\n lastPosition: inputs.rowsMeta.positions[inputs.rowsMeta.positions.length - 1] + inputs.lastRowHeight\n }), inputs.rowsMeta.positions.length - 1);\n\n // If any of the cells in the `firstRowIndex` is hidden due to an extended row span,\n // Make sure the row from where the rowSpan is originated is visible.\n const rowSpanHiddenCellOrigin = inputs.hiddenCellsOriginMap[firstRowIndex];\n if (rowSpanHiddenCellOrigin) {\n const minSpannedRowIndex = Math.min(...Object.values(rowSpanHiddenCellOrigin));\n firstRowIndex = Math.min(firstRowIndex, minSpannedRowIndex);\n }\n const lastRowIndex = inputs.autoHeight ? firstRowIndex + inputs.rows.length : getNearestIndexToRender(inputs, top + inputs.viewportInnerHeight);\n renderContext.firstRowIndex = firstRowIndex;\n renderContext.lastRowIndex = lastRowIndex;\n }\n if (inputs.enabledForColumns) {\n let firstColumnIndex = 0;\n let lastColumnIndex = inputs.columnPositions.length;\n let hasRowWithAutoHeight = false;\n const [firstRowToRender, lastRowToRender] = getIndexesToRender({\n firstIndex: renderContext.firstRowIndex,\n lastIndex: renderContext.lastRowIndex,\n minFirstIndex: 0,\n maxLastIndex: inputs.rows.length,\n bufferBefore: scrollCache.buffer.rowBefore,\n bufferAfter: scrollCache.buffer.rowAfter,\n positions: inputs.rowsMeta.positions,\n lastSize: inputs.lastRowHeight\n });\n for (let i = firstRowToRender; i < lastRowToRender && !hasRowWithAutoHeight; i += 1) {\n const row = inputs.rows[i];\n hasRowWithAutoHeight = inputs.apiRef.current.rowHasAutoHeight(row.id);\n }\n if (!hasRowWithAutoHeight) {\n firstColumnIndex = binarySearch(realLeft, inputs.columnPositions, {\n atStart: true,\n lastPosition: inputs.columnsTotalWidth\n });\n lastColumnIndex = binarySearch(realLeft + inputs.viewportInnerWidth, inputs.columnPositions);\n }\n renderContext.firstColumnIndex = firstColumnIndex;\n renderContext.lastColumnIndex = lastColumnIndex;\n }\n const actualRenderContext = deriveRenderContext(inputs, renderContext, scrollCache);\n return actualRenderContext;\n}\nfunction getNearestIndexToRender(inputs, offset, options) {\n const lastMeasuredIndexRelativeToAllRows = inputs.apiRef.current.getLastMeasuredRowIndex();\n let allRowsMeasured = lastMeasuredIndexRelativeToAllRows === Infinity;\n if (inputs.range?.lastRowIndex && !allRowsMeasured) {\n // Check if all rows in this page are already measured\n allRowsMeasured = lastMeasuredIndexRelativeToAllRows >= inputs.range.lastRowIndex;\n }\n const lastMeasuredIndexRelativeToCurrentPage = clamp(lastMeasuredIndexRelativeToAllRows - (inputs.range?.firstRowIndex || 0), 0, inputs.rowsMeta.positions.length);\n if (allRowsMeasured || inputs.rowsMeta.positions[lastMeasuredIndexRelativeToCurrentPage] >= offset) {\n // If all rows were measured (when no row has \"auto\" as height) or all rows before the offset\n // were measured, then use a binary search because it's faster.\n return binarySearch(offset, inputs.rowsMeta.positions, options);\n }\n\n // Otherwise, use an exponential search.\n // If rows have \"auto\" as height, their positions will be based on estimated heights.\n // In this case, we can skip several steps until we find a position higher than the offset.\n // Inspired by https://github.com/bvaughn/react-virtualized/blob/master/source/Grid/utils/CellSizeAndPositionManager.js\n return exponentialSearch(offset, inputs.rowsMeta.positions, lastMeasuredIndexRelativeToCurrentPage, options);\n}\n\n/**\n * Accepts as input a raw render context (the area visible in the viewport) and adds\n * computes the actual render context based on pinned elements, buffer dimensions and\n * spanning.\n */\nfunction deriveRenderContext(inputs, nextRenderContext, scrollCache) {\n const [firstRowToRender, lastRowToRender] = getIndexesToRender({\n firstIndex: nextRenderContext.firstRowIndex,\n lastIndex: nextRenderContext.lastRowIndex,\n minFirstIndex: 0,\n maxLastIndex: inputs.rows.length,\n bufferBefore: scrollCache.buffer.rowBefore,\n bufferAfter: scrollCache.buffer.rowAfter,\n positions: inputs.rowsMeta.positions,\n lastSize: inputs.lastRowHeight\n });\n const [initialFirstColumnToRender, lastColumnToRender] = getIndexesToRender({\n firstIndex: nextRenderContext.firstColumnIndex,\n lastIndex: nextRenderContext.lastColumnIndex,\n minFirstIndex: inputs.pinnedColumns.left.length,\n maxLastIndex: inputs.visibleColumns.length - inputs.pinnedColumns.right.length,\n bufferBefore: scrollCache.buffer.columnBefore,\n bufferAfter: scrollCache.buffer.columnAfter,\n positions: inputs.columnPositions,\n lastSize: inputs.lastColumnWidth\n });\n const firstColumnToRender = getFirstNonSpannedColumnToRender({\n firstColumnToRender: initialFirstColumnToRender,\n apiRef: inputs.apiRef,\n firstRowToRender,\n lastRowToRender,\n visibleRows: inputs.rows\n });\n return {\n firstRowIndex: firstRowToRender,\n lastRowIndex: lastRowToRender,\n firstColumnIndex: firstColumnToRender,\n lastColumnIndex: lastColumnToRender\n };\n}\n/**\n * Use binary search to avoid looping through all possible positions.\n * The `options.atStart` provides the possibility to match for the first element that\n * intersects the screen, even if said element's start position is before `offset`. In\n * other words, we search for `offset + width`.\n */\nfunction binarySearch(offset, positions, options = undefined, sliceStart = 0, sliceEnd = positions.length) {\n if (positions.length <= 0) {\n return -1;\n }\n if (sliceStart >= sliceEnd) {\n return sliceStart;\n }\n const pivot = sliceStart + Math.floor((sliceEnd - sliceStart) / 2);\n const position = positions[pivot];\n let isBefore;\n if (options?.atStart) {\n const width = (pivot === positions.length - 1 ? options.lastPosition : positions[pivot + 1]) - position;\n isBefore = offset - width < position;\n } else {\n isBefore = offset <= position;\n }\n return isBefore ? binarySearch(offset, positions, options, sliceStart, pivot) : binarySearch(offset, positions, options, pivot + 1, sliceEnd);\n}\nfunction exponentialSearch(offset, positions, index, options = undefined) {\n let interval = 1;\n while (index < positions.length && Math.abs(positions[index]) < offset) {\n index += interval;\n interval *= 2;\n }\n return binarySearch(offset, positions, options, Math.floor(index / 2), Math.min(index, positions.length));\n}\nfunction getIndexesToRender({\n firstIndex,\n lastIndex,\n bufferBefore,\n bufferAfter,\n minFirstIndex,\n maxLastIndex,\n positions,\n lastSize\n}) {\n const firstPosition = positions[firstIndex] - bufferBefore;\n const lastPosition = positions[lastIndex] + bufferAfter;\n const firstIndexPadded = binarySearch(firstPosition, positions, {\n atStart: true,\n lastPosition: positions[positions.length - 1] + lastSize\n });\n const lastIndexPadded = binarySearch(lastPosition, positions);\n return [clamp(firstIndexPadded, minFirstIndex, maxLastIndex), clamp(lastIndexPadded, minFirstIndex, maxLastIndex)];\n}\nexport function areRenderContextsEqual(context1, context2) {\n if (context1 === context2) {\n return true;\n }\n return context1.firstRowIndex === context2.firstRowIndex && context1.lastRowIndex === context2.lastRowIndex && context1.firstColumnIndex === context2.firstColumnIndex && context1.lastColumnIndex === context2.lastColumnIndex;\n}\nexport function computeOffsetLeft(columnPositions, renderContext, pinnedLeftLength) {\n const left = (columnPositions[renderContext.firstColumnIndex] ?? 0) - (columnPositions[pinnedLeftLength] ?? 0);\n return Math.abs(left);\n}\nfunction directionForDelta(dx, dy) {\n if (dx === 0 && dy === 0) {\n return ScrollDirection.NONE;\n }\n /* eslint-disable */\n if (Math.abs(dy) >= Math.abs(dx)) {\n if (dy > 0) {\n return ScrollDirection.DOWN;\n } else {\n return ScrollDirection.UP;\n }\n } else {\n if (dx > 0) {\n return ScrollDirection.RIGHT;\n } else {\n return ScrollDirection.LEFT;\n }\n }\n /* eslint-enable */\n}\nfunction bufferForDirection(isRtl, direction, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer) {\n if (isRtl) {\n switch (direction) {\n case ScrollDirection.LEFT:\n direction = ScrollDirection.RIGHT;\n break;\n case ScrollDirection.RIGHT:\n direction = ScrollDirection.LEFT;\n break;\n default:\n }\n }\n switch (direction) {\n case ScrollDirection.NONE:\n return {\n rowAfter: rowBufferPx,\n rowBefore: rowBufferPx,\n columnAfter: columnBufferPx,\n columnBefore: columnBufferPx\n };\n case ScrollDirection.LEFT:\n return {\n rowAfter: 0,\n rowBefore: 0,\n columnAfter: 0,\n columnBefore: horizontalBuffer\n };\n case ScrollDirection.RIGHT:\n return {\n rowAfter: 0,\n rowBefore: 0,\n columnAfter: horizontalBuffer,\n columnBefore: 0\n };\n case ScrollDirection.UP:\n return {\n rowAfter: 0,\n rowBefore: verticalBuffer,\n columnAfter: 0,\n columnBefore: 0\n };\n case ScrollDirection.DOWN:\n return {\n rowAfter: verticalBuffer,\n rowBefore: 0,\n columnAfter: 0,\n columnBefore: 0\n };\n default:\n // eslint unable to figure out enum exhaustiveness\n throw new Error('unreachable');\n }\n}","import { useGridSelector } from \"../../utils/index.js\";\nimport { useGridApiContext } from \"../../utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../utils/useGridRootProps.js\";\nimport { gridExpandedRowCountSelector } from \"../filter/index.js\";\nimport { gridRowCountSelector, gridRowsLoadingSelector } from \"../rows/index.js\";\n/**\n * Uses the grid state to determine which overlay to display.\n * Returns the active overlay type and the active loading overlay variant.\n */\nexport const useGridOverlays = () => {\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const totalRowCount = useGridSelector(apiRef, gridRowCountSelector);\n const visibleRowCount = useGridSelector(apiRef, gridExpandedRowCountSelector);\n const noRows = totalRowCount === 0;\n const loading = useGridSelector(apiRef, gridRowsLoadingSelector);\n const showNoRowsOverlay = !loading && noRows;\n const showNoResultsOverlay = !loading && totalRowCount > 0 && visibleRowCount === 0;\n let overlayType = null;\n let loadingOverlayVariant = null;\n if (showNoRowsOverlay) {\n overlayType = 'noRowsOverlay';\n }\n if (showNoResultsOverlay) {\n overlayType = 'noResultsOverlay';\n }\n if (loading) {\n overlayType = 'loadingOverlay';\n loadingOverlayVariant = rootProps.slotProps?.loadingOverlay?.[noRows ? 'noRowsVariant' : 'variant'] || null;\n }\n return {\n overlayType,\n loadingOverlayVariant\n };\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/system';\nimport composeClasses from '@mui/utils/composeClasses';\nimport clsx from 'clsx';\nimport { useGridSelector } from \"../../hooks/utils/useGridSelector.js\";\nimport { gridDimensionsSelector } from \"../../hooks/features/dimensions/index.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { useGridVisibleRows } from \"../../hooks/utils/useGridVisibleRows.js\";\nimport { getMinimalContentHeight } from \"../../hooks/features/rows/gridRowsUtils.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GridOverlayWrapperRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'OverlayWrapper',\n shouldForwardProp: prop => prop !== 'overlayType' && prop !== 'loadingOverlayVariant',\n overridesResolver: (props, styles) => styles.overlayWrapper\n})(({\n overlayType,\n loadingOverlayVariant\n}) =>\n// Skeleton overlay should flow with the scroll container and not be sticky\nloadingOverlayVariant !== 'skeleton' ? {\n position: 'sticky',\n // To stay in place while scrolling\n top: 'var(--DataGrid-headersTotalHeight)',\n left: 0,\n width: 0,\n // To stay above the content instead of shifting it down\n height: 0,\n // To stay above the content instead of shifting it down\n zIndex: overlayType === 'loadingOverlay' ? 5 // Should be above pinned columns, pinned rows, and detail panel\n : 4 // Should be above pinned columns and detail panel\n} : {});\nconst GridOverlayWrapperInner = styled('div', {\n name: 'MuiDataGrid',\n slot: 'OverlayWrapperInner',\n shouldForwardProp: prop => prop !== 'overlayType' && prop !== 'loadingOverlayVariant',\n overridesResolver: (props, styles) => styles.overlayWrapperInner\n})({});\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['overlayWrapper'],\n inner: ['overlayWrapperInner']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nfunction GridOverlayWrapper(props) {\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const currentPage = useGridVisibleRows(apiRef, rootProps);\n const dimensions = useGridSelector(apiRef, gridDimensionsSelector);\n let height = dimensions.viewportOuterSize.height - dimensions.topContainerHeight - dimensions.bottomContainerHeight - (dimensions.hasScrollX ? dimensions.scrollbarSize : 0);\n if (rootProps.autoHeight && currentPage.rows.length === 0 || height === 0) {\n height = getMinimalContentHeight(apiRef);\n }\n const classes = useUtilityClasses(_extends({}, props, {\n classes: rootProps.classes\n }));\n return /*#__PURE__*/_jsx(GridOverlayWrapperRoot, _extends({\n className: clsx(classes.root)\n }, props, {\n children: /*#__PURE__*/_jsx(GridOverlayWrapperInner, _extends({\n className: clsx(classes.inner),\n style: {\n height,\n width: dimensions.viewportOuterSize.width\n }\n }, props))\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridOverlays.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n loadingOverlayVariant: PropTypes.oneOf(['circular-progress', 'linear-progress', 'skeleton']),\n overlayType: PropTypes.oneOf(['loadingOverlay', 'noResultsOverlay', 'noRowsOverlay'])\n} : void 0;\nexport function GridOverlays(props) {\n const {\n overlayType\n } = props;\n const rootProps = useGridRootProps();\n if (!overlayType) {\n return null;\n }\n const Overlay = rootProps.slots?.[overlayType];\n const overlayProps = rootProps.slotProps?.[overlayType];\n return /*#__PURE__*/_jsx(GridOverlayWrapper, _extends({}, props, {\n children: /*#__PURE__*/_jsx(Overlay, _extends({}, overlayProps))\n }));\n}","export const gridColumnMenuSelector = state => state.columnMenu;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { fastMemo } from '@mui/x-internals/fastMemo';\nimport { useGridPrivateApiContext } from \"../hooks/utils/useGridPrivateApiContext.js\";\nimport { useGridSelector } from \"../hooks/utils/useGridSelector.js\";\nimport { useGridRootProps } from \"../hooks/utils/useGridRootProps.js\";\nimport { gridColumnVisibilityModelSelector, gridVisibleColumnDefinitionsSelector } from \"../hooks/features/columns/gridColumnsSelector.js\";\nimport { gridFilterActiveItemsLookupSelector } from \"../hooks/features/filter/gridFilterSelector.js\";\nimport { gridSortColumnLookupSelector } from \"../hooks/features/sorting/gridSortingSelector.js\";\nimport { gridTabIndexColumnHeaderSelector, gridTabIndexCellSelector, gridFocusColumnHeaderSelector, gridTabIndexColumnGroupHeaderSelector, gridFocusColumnGroupHeaderSelector } from \"../hooks/features/focus/gridFocusStateSelector.js\";\nimport { gridColumnGroupsHeaderMaxDepthSelector, gridColumnGroupsHeaderStructureSelector } from \"../hooks/features/columnGrouping/gridColumnGroupsSelector.js\";\nimport { gridColumnMenuSelector } from \"../hooks/features/columnMenu/columnMenuSelector.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction GridHeaders() {\n const apiRef = useGridPrivateApiContext();\n const rootProps = useGridRootProps();\n const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);\n const filterColumnLookup = useGridSelector(apiRef, gridFilterActiveItemsLookupSelector);\n const sortColumnLookup = useGridSelector(apiRef, gridSortColumnLookupSelector);\n const columnHeaderTabIndexState = useGridSelector(apiRef, gridTabIndexColumnHeaderSelector);\n const cellTabIndexState = useGridSelector(apiRef, gridTabIndexCellSelector);\n const columnGroupHeaderTabIndexState = useGridSelector(apiRef, gridTabIndexColumnGroupHeaderSelector);\n const columnHeaderFocus = useGridSelector(apiRef, gridFocusColumnHeaderSelector);\n const columnGroupHeaderFocus = useGridSelector(apiRef, gridFocusColumnGroupHeaderSelector);\n const headerGroupingMaxDepth = useGridSelector(apiRef, gridColumnGroupsHeaderMaxDepthSelector);\n const columnMenuState = useGridSelector(apiRef, gridColumnMenuSelector);\n const columnVisibility = useGridSelector(apiRef, gridColumnVisibilityModelSelector);\n const columnGroupsHeaderStructure = useGridSelector(apiRef, gridColumnGroupsHeaderStructureSelector);\n const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null && cellTabIndexState === null);\n const columnsContainerRef = apiRef.current.columnHeadersContainerRef;\n return /*#__PURE__*/_jsx(rootProps.slots.columnHeaders, _extends({\n ref: columnsContainerRef,\n visibleColumns: visibleColumns,\n filterColumnLookup: filterColumnLookup,\n sortColumnLookup: sortColumnLookup,\n columnHeaderTabIndexState: columnHeaderTabIndexState,\n columnGroupHeaderTabIndexState: columnGroupHeaderTabIndexState,\n columnHeaderFocus: columnHeaderFocus,\n columnGroupHeaderFocus: columnGroupHeaderFocus,\n headerGroupingMaxDepth: headerGroupingMaxDepth,\n columnMenuState: columnMenuState,\n columnVisibility: columnVisibility,\n columnGroupsHeaderStructure: columnGroupsHeaderStructure,\n hasOtherElementInTabSequence: hasOtherElementInTabSequence\n }, rootProps.slotProps?.columnHeaders));\n}\nconst MemoizedGridHeaders = fastMemo(GridHeaders);\nexport { MemoizedGridHeaders as GridHeaders };","import * as React from 'react';\nexport const GridConfigurationContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== 'production') {\n GridConfigurationContext.displayName = 'GridConfigurationContext';\n}","import * as React from 'react';\nimport { GridConfigurationContext } from \"../../components/GridConfigurationContext.js\";\nexport const useGridConfiguration = () => {\n const configuration = React.useContext(GridConfigurationContext);\n if (configuration === undefined) {\n 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'));\n }\n return configuration;\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { styled } from '@mui/system';\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { useGridConfiguration } from \"../../hooks/utils/useGridConfiguration.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst GridPanelAnchor = styled('div')({\n position: 'absolute',\n top: `var(--DataGrid-headersTotalHeight)`,\n left: 0\n});\nconst Element = styled('div', {\n name: 'MuiDataGrid',\n slot: 'Main',\n overridesResolver: (props, styles) => styles.main\n})({\n flexGrow: 1,\n position: 'relative',\n overflow: 'hidden'\n});\nexport const GridMainContainer = /*#__PURE__*/React.forwardRef((props, ref) => {\n const rootProps = useGridRootProps();\n const configuration = useGridConfiguration();\n const ariaAttributes = configuration.hooks.useGridAriaAttributes();\n return /*#__PURE__*/_jsxs(Element, _extends({\n ref: ref,\n ownerState: rootProps,\n className: props.className,\n tabIndex: -1\n }, ariaAttributes, {\n children: [/*#__PURE__*/_jsx(GridPanelAnchor, {\n role: \"presentation\",\n \"data-id\": \"gridPanelAnchor\"\n }), props.children]\n }));\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport { styled } from '@mui/system';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { gridClasses, getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = () => {\n const slots = {\n root: ['topContainer']\n };\n return composeClasses(slots, getDataGridUtilityClass, {});\n};\nconst Element = styled('div')({\n position: 'sticky',\n zIndex: 4,\n top: 0\n});\nexport function GridTopContainer(props) {\n const classes = useUtilityClasses();\n return /*#__PURE__*/_jsx(Element, _extends({}, props, {\n className: clsx(classes.root, props.className, gridClasses['container--top']),\n role: \"presentation\"\n }));\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport { styled } from '@mui/system';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { gridClasses, getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = () => {\n const slots = {\n root: ['bottomContainer']\n };\n return composeClasses(slots, getDataGridUtilityClass, {});\n};\nconst Element = styled('div')({\n position: 'sticky',\n zIndex: 4,\n bottom: 'calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))'\n});\nexport function GridBottomContainer(props) {\n const classes = useUtilityClasses();\n return /*#__PURE__*/_jsx(Element, _extends({}, props, {\n className: clsx(classes.root, props.className, gridClasses['container--bottom']),\n role: \"presentation\"\n }));\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport { styled } from '@mui/system';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = (props, overflowedContent) => {\n const {\n classes\n } = props;\n const slots = {\n root: ['virtualScrollerContent', overflowedContent && 'virtualScrollerContent--overflowed']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst VirtualScrollerContentRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'VirtualScrollerContent',\n overridesResolver: (props, styles) => styles.virtualScrollerContent\n})({});\nconst GridVirtualScrollerContent = /*#__PURE__*/React.forwardRef(function GridVirtualScrollerContent(props, ref) {\n const rootProps = useGridRootProps();\n const overflowedContent = !rootProps.autoHeight && props.style?.minHeight === 'auto';\n const classes = useUtilityClasses(rootProps, overflowedContent);\n return /*#__PURE__*/_jsx(VirtualScrollerContentRoot, _extends({\n ref: ref\n }, props, {\n ownerState: rootProps,\n className: clsx(classes.root, props.className)\n }));\n});\nexport { GridVirtualScrollerContent };","import * as React from 'react';\nimport { styled } from '@mui/system';\nimport { fastMemo } from '@mui/x-internals/fastMemo';\nimport { useGridSelector } from \"../../hooks/utils/useGridSelector.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { gridDimensionsSelector } from \"../../hooks/features/dimensions/index.js\";\nimport { gridClasses } from \"../../constants/index.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst Filler = styled('div')({\n display: 'flex',\n flexDirection: 'row',\n width: 'var(--DataGrid-rowWidth)',\n boxSizing: 'border-box'\n});\nconst Pinned = styled('div')({\n position: 'sticky',\n height: '100%',\n boxSizing: 'border-box',\n borderTop: '1px solid var(--rowBorderColor)',\n backgroundColor: 'var(--DataGrid-pinnedBackground)'\n});\nconst PinnedLeft = styled(Pinned)({\n left: 0,\n borderRight: '1px solid var(--rowBorderColor)'\n});\nconst PinnedRight = styled(Pinned)({\n right: 0,\n borderLeft: '1px solid var(--rowBorderColor)'\n});\nconst Main = styled('div')({\n flexGrow: 1,\n borderTop: '1px solid var(--rowBorderColor)'\n});\nfunction GridVirtualScrollerFiller({\n rowsLength\n}) {\n const apiRef = useGridApiContext();\n const {\n viewportOuterSize,\n minimumSize,\n hasScrollX,\n hasScrollY,\n scrollbarSize,\n leftPinnedWidth,\n rightPinnedWidth\n } = useGridSelector(apiRef, gridDimensionsSelector);\n const scrollbarHeight = hasScrollX ? scrollbarSize : 0;\n const expandedHeight = viewportOuterSize.height - minimumSize.height - scrollbarHeight;\n const height = Math.max(scrollbarHeight, expandedHeight);\n if (height === 0) {\n return null;\n }\n return /*#__PURE__*/_jsxs(Filler, {\n className: gridClasses.filler,\n role: \"presentation\",\n style: {\n height,\n '--rowBorderColor': rowsLength === 0 ? 'transparent' : 'var(--DataGrid-rowBorderColor)'\n },\n children: [leftPinnedWidth > 0 && /*#__PURE__*/_jsx(PinnedLeft, {\n className: gridClasses['filler--pinnedLeft'],\n style: {\n width: leftPinnedWidth\n }\n }), /*#__PURE__*/_jsx(Main, {}), rightPinnedWidth > 0 && /*#__PURE__*/_jsx(PinnedRight, {\n className: gridClasses['filler--pinnedRight'],\n style: {\n width: rightPinnedWidth + (hasScrollY ? scrollbarSize : 0)\n }\n })]\n });\n}\nconst Memoized = fastMemo(GridVirtualScrollerFiller);\nexport { Memoized as GridVirtualScrollerFiller };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\"];\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport { styled } from '@mui/system';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { useGridSelector } from \"../../hooks/utils/useGridSelector.js\";\nimport { gridRowsMetaSelector } from \"../../hooks/features/rows/index.js\";\nimport { gridRenderContextSelector } from \"../../hooks/features/virtualization/index.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['virtualScrollerRenderZone']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst VirtualScrollerRenderZoneRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'VirtualScrollerRenderZone',\n overridesResolver: (props, styles) => styles.virtualScrollerRenderZone\n})({\n position: 'absolute',\n display: 'flex',\n // Prevents margin collapsing when using `getRowSpacing`\n flexDirection: 'column'\n});\nconst GridVirtualScrollerRenderZone = /*#__PURE__*/React.forwardRef(function GridVirtualScrollerRenderZone(props, ref) {\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n const offsetTop = useGridSelector(apiRef, () => {\n const renderContext = gridRenderContextSelector(apiRef);\n const rowsMeta = gridRowsMetaSelector(apiRef.current.state);\n return rowsMeta.positions[renderContext.firstRowIndex] ?? 0;\n });\n return /*#__PURE__*/_jsx(VirtualScrollerRenderZoneRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className),\n ownerState: rootProps,\n style: {\n transform: `translate3d(0, ${offsetTop}px, 0)`\n }\n }, other));\n});\nexport { GridVirtualScrollerRenderZone };","import { createSelector } from \"../../../utils/createSelector.js\";\nexport const gridColumnResizeSelector = state => state.columnResize;\nexport const gridResizingColumnFieldSelector = createSelector(gridColumnResizeSelector, columnResize => columnResize.resizingColumnField);","export const DEFAULT_GRID_AUTOSIZE_OPTIONS = {\n includeHeaders: true,\n includeOutliers: false,\n outliersFactor: 1.5,\n expand: false\n};\n\n/**\n * The Resize API interface that is available in the grid `apiRef`.\n */","/**\n * Select the row editing state.\n */\nexport const gridEditRowsStateSelector = state => state.editRows;","export const gridPreferencePanelStateSelector = state => state.preferencePanel;","var GridPreferencePanelsValue = /*#__PURE__*/function (GridPreferencePanelsValue) {\n GridPreferencePanelsValue[\"filters\"] = \"filters\";\n GridPreferencePanelsValue[\"columns\"] = \"columns\";\n return GridPreferencePanelsValue;\n}(GridPreferencePanelsValue || {});\nexport { GridPreferencePanelsValue };","import * as React from 'react';\nimport { styled } from '@mui/system';\nimport { unstable_composeClasses as composeClasses, unstable_useForkRef as useForkRef, unstable_useEventCallback as useEventCallback } from '@mui/utils';\nimport { useOnMount } from \"../../hooks/utils/useOnMount.js\";\nimport { useGridPrivateApiContext } from \"../../hooks/utils/useGridPrivateApiContext.js\";\nimport { gridDimensionsSelector, useGridSelector } from \"../../hooks/index.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = (ownerState, position) => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['scrollbar', `scrollbar--${position}`],\n content: ['scrollbarContent']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst Scrollbar = styled('div')({\n position: 'absolute',\n display: 'inline-block',\n zIndex: 6,\n '& > div': {\n display: 'inline-block'\n },\n // In macOS Safari and Gnome Web, scrollbars are overlaid and don't affect the layout. So we consider\n // their size to be 0px throughout all the calculations, but the floating scrollbar container does need\n // to appear and have a real size. We set it to 14px because it seems like an acceptable value and we\n // don't have a method to find the required size for scrollbars on those platforms.\n '--size': 'calc(max(var(--DataGrid-scrollbarSize), 14px))'\n});\nconst ScrollbarVertical = styled(Scrollbar)({\n width: 'var(--size)',\n height: 'calc(var(--DataGrid-hasScrollY) * (100% - var(--DataGrid-topContainerHeight) - var(--DataGrid-bottomContainerHeight) - var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize)))',\n overflowY: 'auto',\n overflowX: 'hidden',\n // Disable focus-visible style, it's a scrollbar.\n outline: 0,\n '& > div': {\n width: 'var(--size)'\n },\n top: 'var(--DataGrid-topContainerHeight)',\n right: '0px'\n});\nconst ScrollbarHorizontal = styled(Scrollbar)({\n width: '100%',\n height: 'var(--size)',\n overflowY: 'hidden',\n overflowX: 'auto',\n // Disable focus-visible style, it's a scrollbar.\n outline: 0,\n '& > div': {\n height: 'var(--size)'\n },\n bottom: '0px'\n});\nconst Content = styled('div')({\n display: 'inline-block'\n});\nconst GridVirtualScrollbar = /*#__PURE__*/React.forwardRef(function GridVirtualScrollbar(props, ref) {\n const apiRef = useGridPrivateApiContext();\n const rootProps = useGridRootProps();\n const isLocked = React.useRef(false);\n const lastPosition = React.useRef(0);\n const scrollbarRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const classes = useUtilityClasses(rootProps, props.position);\n const dimensions = useGridSelector(apiRef, gridDimensionsSelector);\n const propertyDimension = props.position === 'vertical' ? 'height' : 'width';\n const propertyScroll = props.position === 'vertical' ? 'scrollTop' : 'scrollLeft';\n const hasScroll = props.position === 'vertical' ? dimensions.hasScrollX : dimensions.hasScrollY;\n const contentSize = dimensions.minimumSize[propertyDimension] + (hasScroll ? dimensions.scrollbarSize : 0);\n const scrollbarSize = props.position === 'vertical' ? dimensions.viewportInnerSize.height : dimensions.viewportOuterSize.width;\n const scrollbarInnerSize = scrollbarSize * (contentSize / dimensions.viewportOuterSize[propertyDimension]);\n const onScrollerScroll = useEventCallback(() => {\n const scroller = apiRef.current.virtualScrollerRef.current;\n const scrollbar = scrollbarRef.current;\n if (scroller[propertyScroll] === lastPosition.current) {\n return;\n }\n if (isLocked.current) {\n isLocked.current = false;\n return;\n }\n isLocked.current = true;\n const value = scroller[propertyScroll] / contentSize;\n scrollbar[propertyScroll] = value * scrollbarInnerSize;\n lastPosition.current = scroller[propertyScroll];\n });\n const onScrollbarScroll = useEventCallback(() => {\n const scroller = apiRef.current.virtualScrollerRef.current;\n const scrollbar = scrollbarRef.current;\n if (isLocked.current) {\n isLocked.current = false;\n return;\n }\n isLocked.current = true;\n const value = scrollbar[propertyScroll] / scrollbarInnerSize;\n scroller[propertyScroll] = value * contentSize;\n });\n useOnMount(() => {\n const scroller = apiRef.current.virtualScrollerRef.current;\n const scrollbar = scrollbarRef.current;\n scroller.addEventListener('scroll', onScrollerScroll, {\n capture: true\n });\n scrollbar.addEventListener('scroll', onScrollbarScroll, {\n capture: true\n });\n return () => {\n scroller.removeEventListener('scroll', onScrollerScroll, {\n capture: true\n });\n scrollbar.removeEventListener('scroll', onScrollbarScroll, {\n capture: true\n });\n };\n });\n React.useEffect(() => {\n const content = contentRef.current;\n content.style.setProperty(propertyDimension, `${scrollbarInnerSize}px`);\n }, [scrollbarInnerSize, propertyDimension]);\n const Container = props.position === 'vertical' ? ScrollbarVertical : ScrollbarHorizontal;\n return /*#__PURE__*/_jsx(Container, {\n ref: useForkRef(ref, scrollbarRef),\n className: classes.root,\n tabIndex: -1,\n \"aria-hidden\": \"true\",\n children: /*#__PURE__*/_jsx(Content, {\n ref: contentRef,\n className: classes.content\n })\n });\n});\nexport { GridVirtualScrollbar };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { styled } from '@mui/system';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { GridScrollArea } from \"../GridScrollArea.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { useGridSelector } from \"../../hooks/utils/useGridSelector.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { gridDimensionsSelector } from \"../../hooks/features/dimensions/index.js\";\nimport { useGridVirtualScroller } from \"../../hooks/features/virtualization/useGridVirtualScroller.js\";\nimport { useGridOverlays } from \"../../hooks/features/overlays/useGridOverlays.js\";\nimport { GridOverlays as Overlays } from \"../base/GridOverlays.js\";\nimport { GridHeaders } from \"../GridHeaders.js\";\nimport { GridMainContainer as Container } from \"./GridMainContainer.js\";\nimport { GridTopContainer as TopContainer } from \"./GridTopContainer.js\";\nimport { GridBottomContainer as BottomContainer } from \"./GridBottomContainer.js\";\nimport { GridVirtualScrollerContent as Content } from \"./GridVirtualScrollerContent.js\";\nimport { GridVirtualScrollerFiller as SpaceFiller } from \"./GridVirtualScrollerFiller.js\";\nimport { GridVirtualScrollerRenderZone as RenderZone } from \"./GridVirtualScrollerRenderZone.js\";\nimport { GridVirtualScrollbar as Scrollbar } from \"./GridVirtualScrollbar.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = (ownerState, dimensions, loadingOverlayVariant) => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['main', dimensions.rightPinnedWidth > 0 && 'main--hasPinnedRight', loadingOverlayVariant === 'skeleton' && 'main--hasSkeletonLoadingOverlay'],\n scroller: ['virtualScroller', dimensions.hasScrollX && 'virtualScroller--hasScrollX']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst Scroller = styled('div', {\n name: 'MuiDataGrid',\n slot: 'VirtualScroller',\n overridesResolver: (props, styles) => styles.virtualScroller\n})({\n position: 'relative',\n height: '100%',\n overflow: 'scroll',\n scrollbarWidth: 'none' /* Firefox */,\n '&::-webkit-scrollbar': {\n display: 'none' /* Safari and Chrome */\n },\n '@media print': {\n overflow: 'hidden'\n },\n // See https://github.com/mui/mui-x/issues/10547\n zIndex: 0\n});\nfunction GridVirtualScroller(props) {\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const dimensions = useGridSelector(apiRef, gridDimensionsSelector);\n const overlaysProps = useGridOverlays();\n const classes = useUtilityClasses(rootProps, dimensions, overlaysProps.loadingOverlayVariant);\n const virtualScroller = useGridVirtualScroller();\n const {\n getContainerProps,\n getScrollerProps,\n getContentProps,\n getRenderZoneProps,\n getScrollbarVerticalProps,\n getScrollbarHorizontalProps,\n getRows\n } = virtualScroller;\n const rows = getRows();\n return /*#__PURE__*/_jsxs(Container, _extends({\n className: classes.root\n }, getContainerProps(), {\n children: [/*#__PURE__*/_jsx(GridScrollArea, {\n scrollDirection: \"left\"\n }), /*#__PURE__*/_jsx(GridScrollArea, {\n scrollDirection: \"right\"\n }), /*#__PURE__*/_jsxs(Scroller, _extends({\n className: classes.scroller\n }, getScrollerProps(), {\n ownerState: rootProps,\n children: [/*#__PURE__*/_jsxs(TopContainer, {\n children: [/*#__PURE__*/_jsx(GridHeaders, {}), /*#__PURE__*/_jsx(rootProps.slots.pinnedRows, {\n position: \"top\",\n virtualScroller: virtualScroller\n })]\n }), /*#__PURE__*/_jsx(Overlays, _extends({}, overlaysProps)), /*#__PURE__*/_jsx(Content, _extends({}, getContentProps(), {\n children: /*#__PURE__*/_jsxs(RenderZone, _extends({}, getRenderZoneProps(), {\n children: [rows, /*#__PURE__*/_jsx(rootProps.slots.detailPanels, {\n virtualScroller: virtualScroller\n })]\n }))\n })), /*#__PURE__*/_jsx(SpaceFiller, {\n rowsLength: rows.length\n }), /*#__PURE__*/_jsx(BottomContainer, {\n children: /*#__PURE__*/_jsx(rootProps.slots.pinnedRows, {\n position: \"bottom\",\n virtualScroller: virtualScroller\n })\n })]\n })), dimensions.hasScrollY && /*#__PURE__*/_jsx(Scrollbar, _extends({\n position: \"vertical\"\n }, getScrollbarVerticalProps())), dimensions.hasScrollX && /*#__PURE__*/_jsx(Scrollbar, _extends({\n position: \"horizontal\"\n }, getScrollbarHorizontalProps())), props.children]\n }));\n}\nexport { GridVirtualScroller };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function GridFooterPlaceholder() {\n const rootProps = useGridRootProps();\n if (rootProps.hideFooter) {\n return null;\n }\n return /*#__PURE__*/_jsx(rootProps.slots.footer, _extends({}, rootProps.slotProps?.footer /* FIXME: typing error */));\n}","// Based on https://stackoverflow.com/a/59518678\nlet cachedSupportsPreventScroll;\nexport function doesSupportPreventScroll() {\n if (cachedSupportsPreventScroll === undefined) {\n document.createElement('div').focus({\n get preventScroll() {\n cachedSupportsPreventScroll = true;\n return false;\n }\n });\n }\n return cachedSupportsPreventScroll;\n}","import { gridClasses } from \"../constants/gridClasses.js\";\nexport function isOverflown(element) {\n return element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;\n}\nexport function findParentElementFromClassName(elem, className) {\n return elem.closest(`.${className}`);\n}\n\n// TODO, eventually replaces this function with CSS.escape, once available in jsdom, either added manually or built in\n// https://github.com/jsdom/jsdom/issues/1550#issuecomment-236734471\nexport function escapeOperandAttributeSelector(operand) {\n return operand.replace(/[\"\\\\]/g, '\\\\$&');\n}\nexport function getGridColumnHeaderElement(root, field) {\n return root.querySelector(`[role=\"columnheader\"][data-field=\"${escapeOperandAttributeSelector(field)}\"]`);\n}\nfunction getGridRowElementSelector(id) {\n return `.${gridClasses.row}[data-id=\"${escapeOperandAttributeSelector(String(id))}\"]`;\n}\nexport function getGridRowElement(root, id) {\n return root.querySelector(getGridRowElementSelector(id));\n}\nexport function getGridCellElement(root, {\n id,\n field\n}) {\n const rowSelector = getGridRowElementSelector(id);\n const cellSelector = `.${gridClasses.cell}[data-field=\"${escapeOperandAttributeSelector(field)}\"]`;\n const selector = `${rowSelector} ${cellSelector}`;\n return root.querySelector(selector);\n}\n\n// https://www.abeautifulsite.net/posts/finding-the-active-element-in-a-shadow-root/\nexport const getActiveElement = (root = document) => {\n const activeEl = root.activeElement;\n if (!activeEl) {\n return null;\n }\n if (activeEl.shadowRoot) {\n return getActiveElement(activeEl.shadowRoot);\n }\n return activeEl;\n};\nexport function isEventTargetInPortal(event) {\n if (\n // The target is not an element when triggered by a Select inside the cell\n // See https://github.com/mui/material-ui/issues/10534\n event.target.nodeType === 1 && !event.currentTarget.contains(event.target)) {\n return true;\n }\n return false;\n}\nexport function getFieldFromHeaderElem(colCellEl) {\n return colCellEl.getAttribute('data-field');\n}\nexport function findHeaderElementFromField(elem, field) {\n return elem.querySelector(`[data-field=\"${escapeOperandAttributeSelector(field)}\"]`);\n}\nexport function getFieldsFromGroupHeaderElem(colCellEl) {\n return colCellEl.getAttribute('data-fields').slice(2, -2).split('-|-');\n}\nexport function findGroupHeaderElementsFromField(elem, field) {\n return Array.from(elem.querySelectorAll(`[data-fields*=\"|-${escapeOperandAttributeSelector(field)}-|\"]`) ?? []);\n}\nexport function findGridCellElementsFromCol(col, api) {\n const root = findParentElementFromClassName(col, gridClasses.root);\n if (!root) {\n throw new Error('MUI X: The root element is not found.');\n }\n const ariaColIndex = col.getAttribute('aria-colindex');\n if (!ariaColIndex) {\n return [];\n }\n const colIndex = Number(ariaColIndex) - 1;\n const cells = [];\n if (!api.virtualScrollerRef?.current) {\n return [];\n }\n queryRows(api).forEach(rowElement => {\n const rowId = rowElement.getAttribute('data-id');\n if (!rowId) {\n return;\n }\n let columnIndex = colIndex;\n const cellColSpanInfo = api.unstable_getCellColSpanInfo(rowId, colIndex);\n if (cellColSpanInfo && cellColSpanInfo.spannedByColSpan) {\n columnIndex = cellColSpanInfo.leftVisibleCellIndex;\n }\n const cell = rowElement.querySelector(`[data-colindex=\"${columnIndex}\"]`);\n if (cell) {\n cells.push(cell);\n }\n });\n return cells;\n}\nexport function findGridElement(api, klass) {\n return api.rootElementRef.current.querySelector(`.${gridClasses[klass]}`);\n}\nconst findPinnedCells = ({\n api,\n colIndex,\n position,\n filterFn\n}) => {\n if (colIndex === null) {\n return [];\n }\n const cells = [];\n queryRows(api).forEach(rowElement => {\n const rowId = rowElement.getAttribute('data-id');\n if (!rowId) {\n return;\n }\n rowElement.querySelectorAll(`.${gridClasses[position === 'left' ? 'cell--pinnedLeft' : 'cell--pinnedRight']}`).forEach(cell => {\n const currentColIndex = parseCellColIndex(cell);\n if (currentColIndex !== null && filterFn(currentColIndex)) {\n cells.push(cell);\n }\n });\n });\n return cells;\n};\nexport function findLeftPinnedCellsAfterCol(api, col, isRtl) {\n const colIndex = parseCellColIndex(col);\n return findPinnedCells({\n api,\n colIndex,\n position: isRtl ? 'right' : 'left',\n filterFn: index => isRtl ? index < colIndex : index > colIndex\n });\n}\nexport function findRightPinnedCellsBeforeCol(api, col, isRtl) {\n const colIndex = parseCellColIndex(col);\n return findPinnedCells({\n api,\n colIndex,\n position: isRtl ? 'left' : 'right',\n filterFn: index => isRtl ? index > colIndex : index < colIndex\n });\n}\nconst findPinnedHeaders = ({\n api,\n colIndex,\n position,\n filterFn\n}) => {\n if (!api.columnHeadersContainerRef?.current) {\n return [];\n }\n if (colIndex === null) {\n return [];\n }\n const elements = [];\n api.columnHeadersContainerRef.current.querySelectorAll(`.${gridClasses[position === 'left' ? 'columnHeader--pinnedLeft' : 'columnHeader--pinnedRight']}`).forEach(element => {\n const currentColIndex = parseCellColIndex(element);\n if (currentColIndex !== null && filterFn(currentColIndex)) {\n elements.push(element);\n }\n });\n return elements;\n};\nexport function findLeftPinnedHeadersAfterCol(api, col, isRtl) {\n const colIndex = parseCellColIndex(col);\n return findPinnedHeaders({\n api,\n position: isRtl ? 'right' : 'left',\n colIndex,\n filterFn: index => isRtl ? index < colIndex : index > colIndex\n });\n}\nexport function findRightPinnedHeadersBeforeCol(api, col, isRtl) {\n const colIndex = parseCellColIndex(col);\n return findPinnedHeaders({\n api,\n position: isRtl ? 'left' : 'right',\n colIndex,\n filterFn: index => isRtl ? index > colIndex : index < colIndex\n });\n}\nexport function findGridHeader(api, field) {\n const headers = api.columnHeadersContainerRef.current;\n return headers.querySelector(`:scope > div > [data-field=\"${escapeOperandAttributeSelector(field)}\"][role=\"columnheader\"]`);\n}\nexport function findGridCells(api, field) {\n const container = api.virtualScrollerRef.current;\n return Array.from(container.querySelectorAll(`:scope > div > div > div > [data-field=\"${escapeOperandAttributeSelector(field)}\"][role=\"gridcell\"]`));\n}\nfunction queryRows(api) {\n return api.virtualScrollerRef.current.querySelectorAll(\n // Use > to ignore rows from nested data grids (for example in detail panel)\n `:scope > div > div > .${gridClasses.row}`);\n}\nfunction parseCellColIndex(col) {\n const ariaColIndex = col.getAttribute('aria-colindex');\n if (!ariaColIndex) {\n return null;\n }\n return Number(ariaColIndex) - 1;\n}","import * as React from 'react';\nimport { getGridCellElement, getGridColumnHeaderElement, getGridRowElement } from \"../../../utils/domUtils.js\";\nimport { useGridApiMethod } from \"../../utils/useGridApiMethod.js\";\nimport { gridFocusCellSelector, gridTabIndexCellSelector } from \"../focus/gridFocusStateSelector.js\";\nexport class MissingRowIdError extends Error {}\n\n/**\n * @requires useGridColumns (method)\n * @requires useGridRows (method)\n * @requires useGridFocus (state)\n * @requires useGridEditing (method)\n * TODO: Impossible priority - useGridEditing also needs to be after useGridParamsApi\n * TODO: Impossible priority - useGridFocus also needs to be after useGridParamsApi\n */\nexport function useGridParamsApi(apiRef) {\n const getColumnHeaderParams = React.useCallback(field => ({\n field,\n colDef: apiRef.current.getColumn(field)\n }), [apiRef]);\n const getRowParams = React.useCallback(id => {\n const row = apiRef.current.getRow(id);\n if (!row) {\n throw new MissingRowIdError(`No row with id #${id} found`);\n }\n const params = {\n id,\n columns: apiRef.current.getAllColumns(),\n row\n };\n return params;\n }, [apiRef]);\n const getCellParams = React.useCallback((id, field) => {\n const colDef = apiRef.current.getColumn(field);\n const row = apiRef.current.getRow(id);\n const rowNode = apiRef.current.getRowNode(id);\n if (!row || !rowNode) {\n throw new MissingRowIdError(`No row with id #${id} found`);\n }\n const rawValue = row[field];\n const value = colDef?.valueGetter ? colDef.valueGetter(rawValue, row, colDef, apiRef) : rawValue;\n const cellFocus = gridFocusCellSelector(apiRef);\n const cellTabIndex = gridTabIndexCellSelector(apiRef);\n const params = {\n id,\n field,\n row,\n rowNode,\n colDef,\n cellMode: apiRef.current.getCellMode(id, field),\n hasFocus: cellFocus !== null && cellFocus.field === field && cellFocus.id === id,\n tabIndex: cellTabIndex && cellTabIndex.field === field && cellTabIndex.id === id ? 0 : -1,\n value,\n formattedValue: value,\n isEditable: false,\n api: {}\n };\n if (colDef && colDef.valueFormatter) {\n params.formattedValue = colDef.valueFormatter(value, row, colDef, apiRef);\n }\n params.isEditable = colDef && apiRef.current.isCellEditable(params);\n return params;\n }, [apiRef]);\n const getCellValue = React.useCallback((id, field) => {\n const colDef = apiRef.current.getColumn(field);\n const row = apiRef.current.getRow(id);\n if (!row) {\n throw new MissingRowIdError(`No row with id #${id} found`);\n }\n if (!colDef || !colDef.valueGetter) {\n return row[field];\n }\n return colDef.valueGetter(row[colDef.field], row, colDef, apiRef);\n }, [apiRef]);\n const getRowValue = React.useCallback((row, colDef) => {\n const field = colDef.field;\n if (!colDef || !colDef.valueGetter) {\n return row[field];\n }\n const value = row[colDef.field];\n return colDef.valueGetter(value, row, colDef, apiRef);\n }, [apiRef]);\n const getRowFormattedValue = React.useCallback((row, colDef) => {\n const value = getRowValue(row, colDef);\n if (!colDef || !colDef.valueFormatter) {\n return value;\n }\n return colDef.valueFormatter(value, row, colDef, apiRef);\n }, [apiRef, getRowValue]);\n const getColumnHeaderElement = React.useCallback(field => {\n if (!apiRef.current.rootElementRef.current) {\n return null;\n }\n return getGridColumnHeaderElement(apiRef.current.rootElementRef.current, field);\n }, [apiRef]);\n const getRowElement = React.useCallback(id => {\n if (!apiRef.current.rootElementRef.current) {\n return null;\n }\n return getGridRowElement(apiRef.current.rootElementRef.current, id);\n }, [apiRef]);\n const getCellElement = React.useCallback((id, field) => {\n if (!apiRef.current.rootElementRef.current) {\n return null;\n }\n return getGridCellElement(apiRef.current.rootElementRef.current, {\n id,\n field\n });\n }, [apiRef]);\n const paramsApi = {\n getCellValue,\n getCellParams,\n getCellElement,\n getRowValue,\n getRowFormattedValue,\n getRowParams,\n getRowElement,\n getColumnHeaderParams,\n getColumnHeaderElement\n };\n useGridApiMethod(apiRef, paramsApi, 'public');\n}","import { GridPinnedColumnPosition } from \"../hooks/features/columns/gridColumnsInterfaces.js\";\nexport const shouldCellShowRightBorder = (pinnedPosition, indexInSection, sectionLength, showCellVerticalBorderRootProp, gridHasFiller) => {\n const isSectionLastCell = indexInSection === sectionLength - 1;\n if (pinnedPosition === GridPinnedColumnPosition.LEFT && isSectionLastCell) {\n return true;\n }\n if (showCellVerticalBorderRootProp) {\n if (pinnedPosition === GridPinnedColumnPosition.LEFT) {\n return true;\n }\n if (pinnedPosition === GridPinnedColumnPosition.RIGHT) {\n return !isSectionLastCell;\n }\n // pinnedPosition === undefined, middle section\n return !isSectionLastCell || gridHasFiller;\n }\n return false;\n};\nexport const shouldCellShowLeftBorder = (pinnedPosition, indexInSection) => {\n return pinnedPosition === GridPinnedColumnPosition.RIGHT && indexInSection === 0;\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"column\", \"rowId\", \"editCellState\", \"align\", \"children\", \"colIndex\", \"width\", \"className\", \"style\", \"gridHasScrollX\", \"colSpan\", \"disableDragEvents\", \"isNotVisible\", \"pinnedOffset\", \"pinnedPosition\", \"sectionIndex\", \"sectionLength\", \"gridHasFiller\", \"onClick\", \"onDoubleClick\", \"onMouseDown\", \"onMouseUp\", \"onMouseOver\", \"onKeyDown\", \"onKeyUp\", \"onDragEnter\", \"onDragOver\"],\n _excluded2 = [\"changeReason\", \"unstable_updateValueOnRender\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_useForkRef as useForkRef, unstable_composeClasses as composeClasses, unstable_ownerDocument as ownerDocument, unstable_capitalize as capitalize } from '@mui/utils';\nimport { fastMemo } from '@mui/x-internals/fastMemo';\nimport { useRtl } from '@mui/system/RtlProvider';\nimport { doesSupportPreventScroll } from \"../../utils/doesSupportPreventScroll.js\";\nimport { getDataGridUtilityClass, gridClasses } from \"../../constants/gridClasses.js\";\nimport { GridCellModes } from \"../../models/index.js\";\nimport { useGridSelector, objectShallowCompare } from \"../../hooks/utils/useGridSelector.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { gridFocusCellSelector } from \"../../hooks/features/focus/gridFocusStateSelector.js\";\nimport { MissingRowIdError } from \"../../hooks/features/rows/useGridParamsApi.js\";\nimport { shouldCellShowLeftBorder, shouldCellShowRightBorder } from \"../../utils/cellBorderUtils.js\";\nimport { GridPinnedColumnPosition } from \"../../hooks/features/columns/gridColumnsInterfaces.js\";\nimport { gridRowSpanningHiddenCellsSelector, gridRowSpanningSpannedCellsSelector } from \"../../hooks/features/rows/gridRowSpanningSelectors.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport let PinnedPosition = /*#__PURE__*/function (PinnedPosition) {\n PinnedPosition[PinnedPosition[\"NONE\"] = 0] = \"NONE\";\n PinnedPosition[PinnedPosition[\"LEFT\"] = 1] = \"LEFT\";\n PinnedPosition[PinnedPosition[\"RIGHT\"] = 2] = \"RIGHT\";\n PinnedPosition[PinnedPosition[\"VIRTUAL\"] = 3] = \"VIRTUAL\";\n return PinnedPosition;\n}({});\nexport const gridPinnedColumnPositionLookup = {\n [PinnedPosition.LEFT]: GridPinnedColumnPosition.LEFT,\n [PinnedPosition.RIGHT]: GridPinnedColumnPosition.RIGHT,\n [PinnedPosition.NONE]: undefined,\n [PinnedPosition.VIRTUAL]: undefined\n};\nconst EMPTY_CELL_PARAMS = {\n id: -1,\n field: '__unset__',\n row: {},\n rowNode: {\n id: -1,\n depth: 0,\n type: 'leaf',\n parent: -1,\n groupingKey: null\n },\n colDef: {\n type: 'string',\n field: '__unset__',\n computedWidth: 0\n },\n cellMode: GridCellModes.View,\n hasFocus: false,\n tabIndex: -1,\n value: null,\n formattedValue: '__unset__',\n isEditable: false,\n api: {}\n};\nconst useUtilityClasses = ownerState => {\n const {\n align,\n showLeftBorder,\n showRightBorder,\n pinnedPosition,\n isEditable,\n isSelected,\n isSelectionMode,\n classes\n } = ownerState;\n const slots = {\n root: ['cell', `cell--text${capitalize(align)}`, isSelected && 'selected', isEditable && 'cell--editable', showLeftBorder && 'cell--withLeftBorder', showRightBorder && 'cell--withRightBorder', pinnedPosition === PinnedPosition.LEFT && 'cell--pinnedLeft', pinnedPosition === PinnedPosition.RIGHT && 'cell--pinnedRight', isSelectionMode && !isEditable && 'cell--selectionMode']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nlet warnedOnce = false;\n\n// TODO(v7): Removing the wrapper will break the docs performance visualization demo.\n\nconst GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {\n const {\n column,\n rowId,\n editCellState,\n align,\n colIndex,\n width,\n className,\n style: styleProp,\n colSpan,\n disableDragEvents,\n isNotVisible,\n pinnedOffset,\n pinnedPosition,\n sectionIndex,\n sectionLength,\n gridHasFiller,\n onClick,\n onDoubleClick,\n onMouseDown,\n onMouseUp,\n onMouseOver,\n onKeyDown,\n onKeyUp,\n onDragEnter,\n onDragOver\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const isRtl = useRtl();\n const field = column.field;\n const cellParams = useGridSelector(apiRef, () => {\n // This is required because `.getCellParams` tries to get the `state.rows.tree` entry\n // associated with `rowId`/`fieldId`, but this selector runs after the state has been\n // updated, while `rowId`/`fieldId` reference an entry in the old state.\n try {\n const result = apiRef.current.getCellParams(rowId, field);\n result.api = apiRef.current;\n return result;\n } catch (e) {\n if (e instanceof MissingRowIdError) {\n return EMPTY_CELL_PARAMS;\n }\n throw e;\n }\n }, objectShallowCompare);\n const isSelected = useGridSelector(apiRef, () => apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {\n id: rowId,\n field\n }));\n const hiddenCells = useGridSelector(apiRef, gridRowSpanningHiddenCellsSelector);\n const spannedCells = useGridSelector(apiRef, gridRowSpanningSpannedCellsSelector);\n const {\n cellMode,\n hasFocus,\n isEditable = false,\n value\n } = cellParams;\n const canManageOwnFocus = column.type === 'actions' && column.getActions?.(apiRef.current.getRowParams(rowId)).some(action => !action.props.disabled);\n const tabIndex = (cellMode === 'view' || !isEditable) && !canManageOwnFocus ? cellParams.tabIndex : -1;\n const {\n classes: rootClasses,\n getCellClassName\n } = rootProps;\n\n // There is a hidden grid state access in `applyPipeProcessor('cellClassName', ...)`\n const pipesClassName = useGridSelector(apiRef, () => apiRef.current.unstable_applyPipeProcessors('cellClassName', [], {\n id: rowId,\n field\n }).filter(Boolean).join(' '));\n const classNames = [pipesClassName];\n if (column.cellClassName) {\n classNames.push(typeof column.cellClassName === 'function' ? column.cellClassName(cellParams) : column.cellClassName);\n }\n if (column.display === 'flex') {\n classNames.push(gridClasses['cell--flex']);\n }\n if (getCellClassName) {\n classNames.push(getCellClassName(cellParams));\n }\n const valueToRender = cellParams.formattedValue ?? value;\n const cellRef = React.useRef(null);\n const handleRef = useForkRef(ref, cellRef);\n const focusElementRef = React.useRef(null);\n const isSelectionMode = rootProps.cellSelection ?? false;\n const position = gridPinnedColumnPositionLookup[pinnedPosition];\n const showLeftBorder = shouldCellShowLeftBorder(position, sectionIndex);\n const showRightBorder = shouldCellShowRightBorder(position, sectionIndex, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);\n const ownerState = {\n align,\n showLeftBorder,\n showRightBorder,\n isEditable,\n classes: rootProps.classes,\n pinnedPosition,\n isSelected,\n isSelectionMode\n };\n const classes = useUtilityClasses(ownerState);\n const publishMouseUp = React.useCallback(eventName => event => {\n const params = apiRef.current.getCellParams(rowId, field || '');\n apiRef.current.publishEvent(eventName, params, event);\n if (onMouseUp) {\n onMouseUp(event);\n }\n }, [apiRef, field, onMouseUp, rowId]);\n const publishMouseDown = React.useCallback(eventName => event => {\n const params = apiRef.current.getCellParams(rowId, field || '');\n apiRef.current.publishEvent(eventName, params, event);\n if (onMouseDown) {\n onMouseDown(event);\n }\n }, [apiRef, field, onMouseDown, rowId]);\n const publish = React.useCallback((eventName, propHandler) => event => {\n // The row might have been deleted during the click\n if (!apiRef.current.getRow(rowId)) {\n return;\n }\n const params = apiRef.current.getCellParams(rowId, field || '');\n apiRef.current.publishEvent(eventName, params, event);\n if (propHandler) {\n propHandler(event);\n }\n }, [apiRef, field, rowId]);\n const isCellRowSpanned = hiddenCells[rowId]?.[field] ?? false;\n const rowSpan = spannedCells[rowId]?.[field] ?? 1;\n const style = React.useMemo(() => {\n if (isNotVisible) {\n return {\n padding: 0,\n opacity: 0,\n width: 0,\n border: 0\n };\n }\n const cellStyle = _extends({\n '--width': `${width}px`\n }, styleProp);\n const isLeftPinned = pinnedPosition === PinnedPosition.LEFT;\n const isRightPinned = pinnedPosition === PinnedPosition.RIGHT;\n if (isLeftPinned || isRightPinned) {\n let side = isLeftPinned ? 'left' : 'right';\n if (isRtl) {\n side = isLeftPinned ? 'right' : 'left';\n }\n cellStyle[side] = pinnedOffset;\n }\n if (rowSpan > 1) {\n cellStyle.height = `calc(var(--height) * ${rowSpan})`;\n cellStyle.zIndex = 5;\n }\n return cellStyle;\n }, [width, isNotVisible, styleProp, pinnedOffset, pinnedPosition, isRtl, rowSpan]);\n React.useEffect(() => {\n if (!hasFocus || cellMode === GridCellModes.Edit) {\n return;\n }\n const doc = ownerDocument(apiRef.current.rootElementRef.current);\n if (cellRef.current && !cellRef.current.contains(doc.activeElement)) {\n const focusableElement = cellRef.current.querySelector('[tabindex=\"0\"]');\n const elementToFocus = focusElementRef.current || focusableElement || cellRef.current;\n if (doesSupportPreventScroll()) {\n elementToFocus.focus({\n preventScroll: true\n });\n } else {\n const scrollPosition = apiRef.current.getScrollPosition();\n elementToFocus.focus();\n apiRef.current.scroll(scrollPosition);\n }\n }\n }, [hasFocus, cellMode, apiRef]);\n if (isCellRowSpanned) {\n return /*#__PURE__*/_jsx(\"div\", {\n \"data-colindex\": colIndex,\n role: \"presentation\",\n style: _extends({}, style, {\n minWidth: 'var(--width)',\n maxWidth: 'var(--width)'\n })\n });\n }\n if (cellParams === EMPTY_CELL_PARAMS) {\n return null;\n }\n let handleFocus = other.onFocus;\n if (process.env.NODE_ENV === 'test' && rootProps.experimentalFeatures?.warnIfFocusStateIsNotSynced) {\n handleFocus = event => {\n const focusedCell = gridFocusCellSelector(apiRef);\n if (focusedCell?.id === rowId && focusedCell.field === field) {\n if (typeof other.onFocus === 'function') {\n other.onFocus(event);\n }\n return;\n }\n if (!warnedOnce) {\n console.warn([`MUI X: The cell with id=${rowId} and field=${field} received focus.`, `According to the state, the focus should be at id=${focusedCell?.id}, field=${focusedCell?.field}.`, \"Not syncing the state may cause unwanted behaviors since the `cellFocusIn` event won't be fired.\", 'Call `fireEvent.mouseUp` before the `fireEvent.click` to sync the focus with the state.'].join('\\n'));\n warnedOnce = true;\n }\n };\n }\n let children;\n let title;\n if (editCellState === null && column.renderCell) {\n children = column.renderCell(cellParams);\n }\n if (editCellState !== null && column.renderEditCell) {\n const updatedRow = apiRef.current.getRowWithUpdatedValues(rowId, column.field);\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const editCellStateRest = _objectWithoutPropertiesLoose(editCellState, _excluded2);\n const formattedValue = column.valueFormatter ? column.valueFormatter(editCellState.value, updatedRow, column, apiRef) : cellParams.formattedValue;\n const params = _extends({}, cellParams, {\n row: updatedRow,\n formattedValue\n }, editCellStateRest);\n children = column.renderEditCell(params);\n classNames.push(gridClasses['cell--editing']);\n classNames.push(rootClasses?.['cell--editing']);\n }\n if (children === undefined) {\n const valueString = valueToRender?.toString();\n children = valueString;\n title = valueString;\n }\n if (/*#__PURE__*/React.isValidElement(children) && canManageOwnFocus) {\n children = /*#__PURE__*/React.cloneElement(children, {\n focusElementRef\n });\n }\n const draggableEventHandlers = disableDragEvents ? null : {\n onDragEnter: publish('cellDragEnter', onDragEnter),\n onDragOver: publish('cellDragOver', onDragOver)\n };\n return /*#__PURE__*/_jsx(\"div\", _extends({\n ref: handleRef,\n className: clsx(className, classNames, classes.root),\n role: \"gridcell\",\n \"data-field\": field,\n \"data-colindex\": colIndex,\n \"aria-colindex\": colIndex + 1,\n \"aria-colspan\": colSpan,\n \"aria-rowspan\": rowSpan,\n style: style,\n title: title,\n tabIndex: tabIndex,\n onClick: publish('cellClick', onClick),\n onDoubleClick: publish('cellDoubleClick', onDoubleClick),\n onMouseOver: publish('cellMouseOver', onMouseOver),\n onMouseDown: publishMouseDown('cellMouseDown'),\n onMouseUp: publishMouseUp('cellMouseUp'),\n onKeyDown: publish('cellKeyDown', onKeyDown),\n onKeyUp: publish('cellKeyUp', onKeyUp)\n }, draggableEventHandlers, other, {\n onFocus: handleFocus,\n children: children\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridCell.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n align: PropTypes.oneOf(['center', 'left', 'right']).isRequired,\n className: PropTypes.string,\n colIndex: PropTypes.number.isRequired,\n colSpan: PropTypes.number,\n column: PropTypes.object.isRequired,\n disableDragEvents: PropTypes.bool,\n editCellState: PropTypes.shape({\n changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),\n isProcessingProps: PropTypes.bool,\n isValidating: PropTypes.bool,\n value: PropTypes.any\n }),\n gridHasFiller: PropTypes.bool.isRequired,\n isNotVisible: PropTypes.bool.isRequired,\n onClick: PropTypes.func,\n onDoubleClick: PropTypes.func,\n onDragEnter: PropTypes.func,\n onDragOver: PropTypes.func,\n onKeyDown: PropTypes.func,\n onMouseDown: PropTypes.func,\n onMouseUp: PropTypes.func,\n pinnedOffset: PropTypes.number.isRequired,\n pinnedPosition: PropTypes.oneOf([0, 1, 2, 3]).isRequired,\n rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n sectionIndex: PropTypes.number.isRequired,\n sectionLength: PropTypes.number.isRequired,\n width: PropTypes.number.isRequired\n} : void 0;\nconst MemoizedGridCell = fastMemo(GridCell);\nexport { MemoizedGridCell as GridCell };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"label\", \"icon\", \"showInMenu\", \"onClick\"],\n _excluded2 = [\"label\", \"icon\", \"showInMenu\", \"onClick\", \"closeMenuOnClick\", \"closeMenu\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport MenuItem from '@mui/material/MenuItem';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {\n const rootProps = useGridRootProps();\n if (!props.showInMenu) {\n const {\n label,\n icon,\n onClick\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const handleClick = event => {\n onClick?.(event);\n };\n return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({\n ref: ref,\n size: \"small\",\n role: \"menuitem\",\n \"aria-label\": label\n }, other, {\n onClick: handleClick\n }, rootProps.slotProps?.baseIconButton, {\n children: /*#__PURE__*/React.cloneElement(icon, {\n fontSize: 'small'\n })\n }));\n }\n const {\n label,\n icon,\n onClick,\n closeMenuOnClick = true,\n closeMenu\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded2);\n const handleClick = event => {\n onClick?.(event);\n if (closeMenuOnClick) {\n closeMenu?.();\n }\n };\n return /*#__PURE__*/_jsxs(MenuItem, _extends({\n ref: ref\n }, other, {\n onClick: handleClick,\n children: [icon && /*#__PURE__*/_jsx(ListItemIcon, {\n children: icon\n }), label]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridActionsCellItem.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component\n */\n component: PropTypes.elementType,\n icon: PropTypes.element,\n label: PropTypes.string.isRequired,\n showInMenu: PropTypes.bool\n} : void 0;\nexport { GridActionsCellItem };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"field\", \"type\", \"align\", \"width\", \"height\", \"empty\", \"style\", \"className\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport Skeleton from '@mui/material/Skeleton';\nimport { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize } from '@mui/utils';\nimport { fastMemo } from '@mui/x-internals/fastMemo';\nimport { createRandomNumberGenerator } from \"../../utils/utils.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst CIRCULAR_CONTENT_SIZE = '1.3em';\nconst CONTENT_HEIGHT = '1.2em';\nconst DEFAULT_CONTENT_WIDTH_RANGE = [40, 80];\nconst CONTENT_WIDTH_RANGE_BY_TYPE = {\n number: [40, 60],\n string: [40, 80],\n date: [40, 60],\n dateTime: [60, 80],\n singleSelect: [40, 80]\n};\nconst useUtilityClasses = ownerState => {\n const {\n align,\n classes,\n empty\n } = ownerState;\n const slots = {\n root: ['cell', 'cellSkeleton', `cell--text${align ? capitalize(align) : 'Left'}`, empty && 'cellEmpty']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst randomNumberGenerator = createRandomNumberGenerator(12345);\nfunction GridSkeletonCell(props) {\n const {\n field,\n type,\n align,\n width,\n height,\n empty = false,\n style,\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes,\n align,\n empty\n };\n const classes = useUtilityClasses(ownerState);\n\n // Memo prevents the non-circular skeleton widths changing to random widths on every render\n const skeletonProps = React.useMemo(() => {\n const isCircularContent = type === 'boolean' || type === 'actions';\n if (isCircularContent) {\n return {\n variant: 'circular',\n width: CIRCULAR_CONTENT_SIZE,\n height: CIRCULAR_CONTENT_SIZE\n };\n }\n\n // The width of the skeleton is a random number between the min and max values\n // The min and max values are determined by the type of the column\n const [min, max] = type ? CONTENT_WIDTH_RANGE_BY_TYPE[type] ?? DEFAULT_CONTENT_WIDTH_RANGE : DEFAULT_CONTENT_WIDTH_RANGE;\n return {\n variant: 'text',\n width: `${Math.round(randomNumberGenerator(min, max))}%`,\n height: CONTENT_HEIGHT\n };\n }, [type]);\n return /*#__PURE__*/_jsx(\"div\", _extends({\n \"data-field\": field,\n className: clsx(classes.root, className),\n style: _extends({\n height,\n maxWidth: width,\n minWidth: width\n }, style)\n }, other, {\n children: !empty && /*#__PURE__*/_jsx(Skeleton, _extends({}, skeletonProps))\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridSkeletonCell.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n align: PropTypes.string,\n /**\n * If `true`, the cell will not display the skeleton but still reserve the cell space.\n * @default false\n */\n empty: PropTypes.bool,\n field: PropTypes.string,\n height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),\n type: PropTypes.oneOf(['actions', 'boolean', 'custom', 'date', 'dateTime', 'number', 'singleSelect', 'string']),\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n} : void 0;\nconst Memoized = fastMemo(GridSkeletonCell);\nexport { Memoized as GridSkeletonCell };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { alpha, styled, darken, lighten, decomposeColor, recomposeColor } from '@mui/material/styles';\nimport { gridClasses as c } from \"../../constants/gridClasses.js\";\nimport { useGridSelector } from \"../../hooks/utils/useGridSelector.js\";\nimport { useGridPrivateApiContext } from \"../../hooks/utils/useGridPrivateApiContext.js\";\nimport { gridDimensionsSelector } from \"../../hooks/features/dimensions/gridDimensionsSelectors.js\";\nfunction getBorderColor(theme) {\n if (theme.vars) {\n return theme.vars.palette.TableCell.border;\n }\n if (theme.palette.mode === 'light') {\n return lighten(alpha(theme.palette.divider, 1), 0.88);\n }\n return darken(alpha(theme.palette.divider, 1), 0.68);\n}\nconst columnHeaderStyles = {\n [`& .${c.iconButtonContainer}`]: {\n visibility: 'visible',\n width: 'auto'\n },\n [`& .${c.menuIcon}`]: {\n width: 'auto',\n visibility: 'visible'\n }\n};\nconst columnSeparatorTargetSize = 10;\nconst columnSeparatorOffset = -5;\nconst focusOutlineWidth = 1;\nconst separatorIconDragStyles = {\n width: 3,\n rx: 1.5,\n x: 10.5\n};\n\n// Emotion thinks it knows better than us which selector we should use.\n// https://github.com/emotion-js/emotion/issues/1105#issuecomment-1722524968\nconst ignoreSsrWarning = '/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */';\nexport const GridRootStyles = styled('div', {\n name: 'MuiDataGrid',\n slot: 'Root',\n overridesResolver: (props, styles) => [{\n [`&.${c.autoHeight}`]: styles.autoHeight\n }, {\n [`&.${c.aggregationColumnHeader}`]: styles.aggregationColumnHeader\n }, {\n [`&.${c['aggregationColumnHeader--alignLeft']}`]: styles['aggregationColumnHeader--alignLeft']\n }, {\n [`&.${c['aggregationColumnHeader--alignCenter']}`]: styles['aggregationColumnHeader--alignCenter']\n }, {\n [`&.${c['aggregationColumnHeader--alignRight']}`]: styles['aggregationColumnHeader--alignRight']\n }, {\n [`&.${c.aggregationColumnHeaderLabel}`]: styles.aggregationColumnHeaderLabel\n }, {\n [`&.${c['root--disableUserSelection']} .${c.cell}`]: styles['root--disableUserSelection']\n }, {\n [`&.${c.autosizing}`]: styles.autosizing\n }, {\n [`& .${c.editBooleanCell}`]: styles.editBooleanCell\n }, {\n [`& .${c.cell}`]: styles.cell\n }, {\n [`& .${c['cell--editing']}`]: styles['cell--editing']\n }, {\n [`& .${c['cell--textCenter']}`]: styles['cell--textCenter']\n }, {\n [`& .${c['cell--textLeft']}`]: styles['cell--textLeft']\n }, {\n [`& .${c['cell--textRight']}`]: styles['cell--textRight']\n }, {\n [`& .${c['cell--rangeTop']}`]: styles['cell--rangeTop']\n }, {\n [`& .${c['cell--rangeBottom']}`]: styles['cell--rangeBottom']\n }, {\n [`& .${c['cell--rangeLeft']}`]: styles['cell--rangeLeft']\n }, {\n [`& .${c['cell--rangeRight']}`]: styles['cell--rangeRight']\n }, {\n [`& .${c['cell--withRightBorder']}`]: styles['cell--withRightBorder']\n }, {\n [`& .${c.cellCheckbox}`]: styles.cellCheckbox\n }, {\n [`& .${c.cellSkeleton}`]: styles.cellSkeleton\n }, {\n [`& .${c.checkboxInput}`]: styles.checkboxInput\n }, {\n [`& .${c['columnHeader--alignCenter']}`]: styles['columnHeader--alignCenter']\n }, {\n [`& .${c['columnHeader--alignLeft']}`]: styles['columnHeader--alignLeft']\n }, {\n [`& .${c['columnHeader--alignRight']}`]: styles['columnHeader--alignRight']\n }, {\n [`& .${c['columnHeader--dragging']}`]: styles['columnHeader--dragging']\n }, {\n [`& .${c['columnHeader--moving']}`]: styles['columnHeader--moving']\n }, {\n [`& .${c['columnHeader--numeric']}`]: styles['columnHeader--numeric']\n }, {\n [`& .${c['columnHeader--sortable']}`]: styles['columnHeader--sortable']\n }, {\n [`& .${c['columnHeader--sorted']}`]: styles['columnHeader--sorted']\n }, {\n [`& .${c['columnHeader--withRightBorder']}`]: styles['columnHeader--withRightBorder']\n }, {\n [`& .${c.columnHeader}`]: styles.columnHeader\n }, {\n [`& .${c.headerFilterRow}`]: styles.headerFilterRow\n }, {\n [`& .${c.columnHeaderCheckbox}`]: styles.columnHeaderCheckbox\n }, {\n [`& .${c.columnHeaderDraggableContainer}`]: styles.columnHeaderDraggableContainer\n }, {\n [`& .${c.columnHeaderTitleContainer}`]: styles.columnHeaderTitleContainer\n }, {\n [`& .${c['columnSeparator--resizable']}`]: styles['columnSeparator--resizable']\n }, {\n [`& .${c['columnSeparator--resizing']}`]: styles['columnSeparator--resizing']\n }, {\n [`& .${c.columnSeparator}`]: styles.columnSeparator\n }, {\n [`& .${c.filterIcon}`]: styles.filterIcon\n }, {\n [`& .${c.iconSeparator}`]: styles.iconSeparator\n }, {\n [`& .${c.menuIcon}`]: styles.menuIcon\n }, {\n [`& .${c.menuIconButton}`]: styles.menuIconButton\n }, {\n [`& .${c.menuOpen}`]: styles.menuOpen\n }, {\n [`& .${c.menuList}`]: styles.menuList\n }, {\n [`& .${c['row--editable']}`]: styles['row--editable']\n }, {\n [`& .${c['row--editing']}`]: styles['row--editing']\n }, {\n [`& .${c['row--dragging']}`]: styles['row--dragging']\n }, {\n [`& .${c.row}`]: styles.row\n }, {\n [`& .${c.rowReorderCellPlaceholder}`]: styles.rowReorderCellPlaceholder\n }, {\n [`& .${c.rowReorderCell}`]: styles.rowReorderCell\n }, {\n [`& .${c['rowReorderCell--draggable']}`]: styles['rowReorderCell--draggable']\n }, {\n [`& .${c.sortIcon}`]: styles.sortIcon\n }, {\n [`& .${c.withBorderColor}`]: styles.withBorderColor\n }, {\n [`& .${c.treeDataGroupingCell}`]: styles.treeDataGroupingCell\n }, {\n [`& .${c.treeDataGroupingCellToggle}`]: styles.treeDataGroupingCellToggle\n }, {\n [`& .${c.treeDataGroupingCellLoadingContainer}`]: styles.treeDataGroupingCellLoadingContainer\n }, {\n [`& .${c.detailPanelToggleCell}`]: styles.detailPanelToggleCell\n }, {\n [`& .${c['detailPanelToggleCell--expanded']}`]: styles['detailPanelToggleCell--expanded']\n }, styles.root]\n})(({\n theme: t\n}) => {\n const apiRef = useGridPrivateApiContext();\n const dimensions = useGridSelector(apiRef, gridDimensionsSelector);\n const borderColor = getBorderColor(t);\n const radius = t.shape.borderRadius;\n const containerBackground = t.vars ? t.vars.palette.background.default : t.mixins.MuiDataGrid?.containerBackground ?? t.palette.background.default;\n const pinnedBackground = t.mixins.MuiDataGrid?.pinnedBackground ?? containerBackground;\n const overlayBackground = t.vars ? `rgba(${t.vars.palette.background.defaultChannel} / ${t.vars.palette.action.disabledOpacity})` : alpha(t.palette.background.default, t.palette.action.disabledOpacity);\n const hoverOpacity = (t.vars || t).palette.action.hoverOpacity;\n const hoverColor = (t.vars || t).palette.action.hover;\n const selectedOpacity = (t.vars || t).palette.action.selectedOpacity;\n const selectedBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / ${selectedOpacity})` : alpha(t.palette.primary.main, selectedOpacity);\n const selectedHoverBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / calc(\n ${t.vars.palette.action.selectedOpacity} +\n ${t.vars.palette.action.hoverOpacity}\n ))` : alpha(t.palette.primary.main, t.palette.action.selectedOpacity + t.palette.action.hoverOpacity);\n const pinnedHoverBackground = t.vars ? hoverColor : blend(pinnedBackground, hoverColor, hoverOpacity);\n const pinnedSelectedBackground = t.vars ? selectedBackground : blend(pinnedBackground, selectedBackground, selectedOpacity);\n const pinnedSelectedHoverBackground = t.vars ? hoverColor : blend(pinnedSelectedBackground, hoverColor, hoverOpacity);\n const selectedStyles = {\n backgroundColor: selectedBackground,\n '&:hover': {\n backgroundColor: selectedHoverBackground,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: selectedBackground\n }\n }\n };\n const gridStyle = _extends({\n '--unstable_DataGrid-radius': typeof radius === 'number' ? `${radius}px` : radius,\n '--unstable_DataGrid-headWeight': t.typography.fontWeightMedium,\n '--unstable_DataGrid-overlayBackground': overlayBackground,\n '--DataGrid-containerBackground': containerBackground,\n '--DataGrid-pinnedBackground': pinnedBackground,\n '--DataGrid-rowBorderColor': borderColor,\n '--DataGrid-cellOffsetMultiplier': 2,\n '--DataGrid-width': '0px',\n '--DataGrid-hasScrollX': '0',\n '--DataGrid-hasScrollY': '0',\n '--DataGrid-scrollbarSize': '10px',\n '--DataGrid-rowWidth': '0px',\n '--DataGrid-columnsTotalWidth': '0px',\n '--DataGrid-leftPinnedWidth': '0px',\n '--DataGrid-rightPinnedWidth': '0px',\n '--DataGrid-headerHeight': '0px',\n '--DataGrid-headersTotalHeight': '0px',\n '--DataGrid-topContainerHeight': '0px',\n '--DataGrid-bottomContainerHeight': '0px',\n flex: 1,\n boxSizing: 'border-box',\n position: 'relative',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor,\n borderRadius: 'var(--unstable_DataGrid-radius)',\n color: (t.vars || t).palette.text.primary\n }, t.typography.body2, {\n outline: 'none',\n height: '100%',\n display: 'flex',\n minWidth: 0,\n // See https://github.com/mui/mui-x/issues/8547\n minHeight: 0,\n flexDirection: 'column',\n overflow: 'hidden',\n overflowAnchor: 'none',\n // Keep the same scrolling position\n [`.${c.main} > *:first-child${ignoreSsrWarning}`]: {\n borderTopLeftRadius: 'var(--unstable_DataGrid-radius)',\n borderTopRightRadius: 'var(--unstable_DataGrid-radius)'\n },\n [`&.${c.autoHeight}`]: {\n height: 'auto'\n },\n [`&.${c.autosizing}`]: {\n [`& .${c.columnHeaderTitleContainerContent} > *`]: {\n overflow: 'visible !important'\n },\n '@media (hover: hover)': {\n [`& .${c.iconButtonContainer}`]: {\n width: '0 !important',\n visibility: 'hidden !important'\n },\n [`& .${c.menuIcon}`]: {\n width: '0 !important',\n visibility: 'hidden !important'\n }\n },\n [`& .${c.cell}`]: {\n overflow: 'visible !important',\n whiteSpace: 'nowrap',\n minWidth: 'max-content !important',\n maxWidth: 'max-content !important'\n },\n [`& .${c.groupingCriteriaCell}`]: {\n width: 'unset'\n },\n [`& .${c.treeDataGroupingCell}`]: {\n width: 'unset'\n }\n },\n [`& .${c.columnHeader}, & .${c.cell}`]: {\n WebkitTapHighlightColor: 'transparent',\n padding: '0 10px',\n boxSizing: 'border-box'\n },\n [`& .${c.columnHeader}:focus-within, & .${c.cell}:focus-within`]: {\n outline: `solid ${t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / 0.5)` : alpha(t.palette.primary.main, 0.5)} ${focusOutlineWidth}px`,\n outlineOffset: focusOutlineWidth * -1\n },\n [`& .${c.columnHeader}:focus, & .${c.cell}:focus`]: {\n outline: `solid ${t.palette.primary.main} ${focusOutlineWidth}px`,\n outlineOffset: focusOutlineWidth * -1\n },\n // Hide the column separator when:\n // - the column is focused and has an outline\n // - the next column is focused and has an outline\n // - the column has a left or right border\n // - the next column is pinned right and has a left border\n [`& .${c.columnHeader}:focus,\n & .${c['columnHeader--withLeftBorder']},\n & .${c['columnHeader--withRightBorder']},\n & .${c['columnHeader--siblingFocused']},\n & .${c['virtualScroller--hasScrollX']} .${c['columnHeader--lastUnpinned']},\n & .${c['virtualScroller--hasScrollX']} .${c['columnHeader--last']}\n `]: {\n [`& .${c.columnSeparator}`]: {\n opacity: 0\n },\n // Show resizable separators at all times on touch devices\n '@media (hover: none)': {\n [`& .${c['columnSeparator--resizable']}`]: {\n opacity: 1\n }\n },\n [`& .${c['columnSeparator--resizable']}:hover`]: {\n opacity: 1\n }\n },\n [`&.${c['root--noToolbar']} [aria-rowindex=\"1\"] [aria-colindex=\"1\"]`]: {\n borderTopLeftRadius: 'calc(var(--unstable_DataGrid-radius) - 1px)'\n },\n [`&.${c['root--noToolbar']} [aria-rowindex=\"1\"] .${c['columnHeader--last']}`]: {\n borderTopRightRadius: dimensions.hasScrollX && (!dimensions.hasScrollY || dimensions.scrollbarSize === 0) ? 'calc(var(--unstable_DataGrid-radius) - 1px)' : undefined\n },\n [`& .${c.columnHeaderCheckbox}, & .${c.cellCheckbox}`]: {\n padding: 0,\n justifyContent: 'center',\n alignItems: 'center'\n },\n [`& .${c.columnHeader}`]: {\n position: 'relative',\n display: 'flex',\n alignItems: 'center'\n },\n [`& .${c['virtualScroller--hasScrollX']} .${c['columnHeader--last']}`]: {\n overflow: 'hidden'\n },\n [`& .${c['columnHeader--sorted']} .${c.iconButtonContainer}, & .${c['columnHeader--filtered']} .${c.iconButtonContainer}`]: {\n visibility: 'visible',\n width: 'auto'\n },\n [`& .${c.columnHeader}:not(.${c['columnHeader--sorted']}) .${c.sortIcon}`]: {\n opacity: 0,\n transition: t.transitions.create(['opacity'], {\n duration: t.transitions.duration.shorter\n })\n },\n [`& .${c.columnHeaderTitleContainer}`]: {\n display: 'flex',\n alignItems: 'center',\n gap: t.spacing(0.25),\n minWidth: 0,\n flex: 1,\n whiteSpace: 'nowrap',\n overflow: 'hidden'\n },\n [`& .${c.columnHeaderTitleContainerContent}`]: {\n overflow: 'hidden',\n display: 'flex',\n alignItems: 'center'\n },\n [`& .${c['columnHeader--filledGroup']} .${c.columnHeaderTitleContainer}`]: {\n borderBottomWidth: '1px',\n borderBottomStyle: 'solid',\n boxSizing: 'border-box'\n },\n [`& .${c.sortIcon}, & .${c.filterIcon}`]: {\n fontSize: 'inherit'\n },\n [`& .${c['columnHeader--sortable']}`]: {\n cursor: 'pointer'\n },\n [`& .${c['columnHeader--alignCenter']} .${c.columnHeaderTitleContainer}`]: {\n justifyContent: 'center'\n },\n [`& .${c['columnHeader--alignRight']} .${c.columnHeaderDraggableContainer}, & .${c['columnHeader--alignRight']} .${c.columnHeaderTitleContainer}`]: {\n flexDirection: 'row-reverse'\n },\n [`& .${c['columnHeader--alignCenter']} .${c.menuIcon}`]: {\n marginLeft: 'auto'\n },\n [`& .${c['columnHeader--alignRight']} .${c.menuIcon}`]: {\n marginRight: 'auto',\n marginLeft: -5\n },\n [`& .${c['columnHeader--moving']}`]: {\n backgroundColor: (t.vars || t).palette.action.hover\n },\n [`& .${c['columnHeader--pinnedLeft']}, & .${c['columnHeader--pinnedRight']}`]: {\n position: 'sticky',\n zIndex: 4,\n // Should be above the column separator\n background: 'var(--DataGrid-pinnedBackground)'\n },\n [`& .${c.columnSeparator}`]: {\n position: 'absolute',\n overflow: 'hidden',\n zIndex: 3,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n maxWidth: columnSeparatorTargetSize,\n color: borderColor\n },\n [`& .${c.columnHeaders}`]: {\n width: 'var(--DataGrid-rowWidth)'\n },\n '@media (hover: hover)': {\n [`& .${c.columnHeader}:hover`]: columnHeaderStyles,\n [`& .${c.columnHeader}:not(.${c['columnHeader--sorted']}):hover .${c.sortIcon}`]: {\n opacity: 0.5\n }\n },\n '@media (hover: none)': {\n [`& .${c.columnHeader}`]: columnHeaderStyles,\n [`& .${c.columnHeader}:focus,\n & .${c['columnHeader--siblingFocused']}`]: {\n [`.${c['columnSeparator--resizable']}`]: {\n color: (t.vars || t).palette.primary.main\n }\n }\n },\n [`& .${c['columnSeparator--sideLeft']}`]: {\n left: columnSeparatorOffset\n },\n [`& .${c['columnSeparator--sideRight']}`]: {\n right: columnSeparatorOffset\n },\n [`& .${c['columnHeader--withRightBorder']} .${c['columnSeparator--sideLeft']}`]: {\n left: columnSeparatorOffset - 0.5\n },\n [`& .${c['columnHeader--withRightBorder']} .${c['columnSeparator--sideRight']}`]: {\n right: columnSeparatorOffset - 0.5\n },\n [`& .${c['columnSeparator--resizable']}`]: {\n cursor: 'col-resize',\n touchAction: 'none',\n [`&.${c['columnSeparator--resizing']}`]: {\n color: (t.vars || t).palette.primary.main\n },\n // Always appear as draggable on touch devices\n '@media (hover: none)': {\n [`& .${c.iconSeparator} rect`]: separatorIconDragStyles\n },\n '@media (hover: hover)': {\n '&:hover': {\n color: (t.vars || t).palette.primary.main,\n [`& .${c.iconSeparator} rect`]: separatorIconDragStyles\n }\n },\n '& svg': {\n pointerEvents: 'none'\n }\n },\n [`& .${c.iconSeparator}`]: {\n color: 'inherit',\n transition: t.transitions.create(['color', 'width'], {\n duration: t.transitions.duration.shortest\n })\n },\n [`& .${c.menuIcon}`]: {\n width: 0,\n visibility: 'hidden',\n fontSize: 20,\n marginRight: -5,\n display: 'flex',\n alignItems: 'center'\n },\n [`.${c.menuOpen}`]: {\n visibility: 'visible',\n width: 'auto'\n },\n [`& .${c.headerFilterRow}`]: {\n [`& .${c.columnHeader}`]: {\n boxSizing: 'border-box',\n borderBottom: '1px solid var(--DataGrid-rowBorderColor)'\n }\n },\n /* Bottom border of the top-container */\n [`& .${c['row--borderBottom']} .${c.columnHeader},\n & .${c['row--borderBottom']} .${c.filler},\n & .${c['row--borderBottom']} .${c.scrollbarFiller}`]: {\n borderBottom: `1px solid var(--DataGrid-rowBorderColor)`\n },\n [`& .${c['row--borderBottom']} .${c.cell}`]: {\n borderBottom: `1px solid var(--rowBorderColor)`\n },\n /* Row styles */\n [`.${c.row}`]: {\n display: 'flex',\n width: 'var(--DataGrid-rowWidth)',\n breakInside: 'avoid',\n // Avoid the row to be broken in two different print pages.\n\n '--rowBorderColor': 'var(--DataGrid-rowBorderColor)',\n [`&.${c['row--firstVisible']}`]: {\n '--rowBorderColor': 'transparent'\n },\n '&:hover': {\n backgroundColor: (t.vars || t).palette.action.hover,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n },\n [`&.${c.rowSkeleton}:hover`]: {\n backgroundColor: 'transparent'\n },\n '&.Mui-selected': selectedStyles\n },\n [`& .${c['container--top']}, & .${c['container--bottom']}`]: {\n '[role=row]': {\n background: 'var(--DataGrid-containerBackground)'\n }\n },\n /* Cell styles */\n [`& .${c.cell}`]: {\n height: 'var(--height)',\n width: 'var(--width)',\n lineHeight: 'calc(var(--height) - 1px)',\n // -1px for the border\n\n boxSizing: 'border-box',\n borderTop: `1px solid var(--rowBorderColor)`,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n '&.Mui-selected': selectedStyles\n },\n [`& .${c['virtualScrollerContent--overflowed']} .${c['row--lastVisible']} .${c.cell}`]: {\n borderTopColor: 'transparent'\n },\n [`& .${c['pinnedRows--top']} :first-of-type`]: {\n [`& .${c.cell}, .${c.scrollbarFiller}`]: {\n borderTop: 'none'\n }\n },\n [`&.${c['root--disableUserSelection']} .${c.cell}`]: {\n userSelect: 'none'\n },\n [`& .${c['row--dynamicHeight']} > .${c.cell}`]: {\n whiteSpace: 'initial',\n lineHeight: 'inherit'\n },\n [`& .${c.cellEmpty}`]: {\n padding: 0,\n height: 'unset'\n },\n [`& .${c.cell}.${c['cell--selectionMode']}`]: {\n cursor: 'default'\n },\n [`& .${c.cell}.${c['cell--editing']}`]: {\n padding: 1,\n display: 'flex',\n boxShadow: t.shadows[2],\n backgroundColor: (t.vars || t).palette.background.paper,\n '&:focus-within': {\n outline: `${focusOutlineWidth}px solid ${(t.vars || t).palette.primary.main}`,\n outlineOffset: focusOutlineWidth * -1\n }\n },\n [`& .${c['row--editing']}`]: {\n boxShadow: t.shadows[2]\n },\n [`& .${c['row--editing']} .${c.cell}`]: {\n boxShadow: t.shadows[0],\n backgroundColor: (t.vars || t).palette.background.paper\n },\n [`& .${c.editBooleanCell}`]: {\n display: 'flex',\n height: '100%',\n width: '100%',\n alignItems: 'center',\n justifyContent: 'center'\n },\n [`& .${c.booleanCell}[data-value=\"true\"]`]: {\n color: (t.vars || t).palette.text.secondary\n },\n [`& .${c.booleanCell}[data-value=\"false\"]`]: {\n color: (t.vars || t).palette.text.disabled\n },\n [`& .${c.actionsCell}`]: {\n display: 'inline-flex',\n alignItems: 'center',\n gridGap: t.spacing(1)\n },\n [`& .${c.rowReorderCell}`]: {\n display: 'inline-flex',\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n opacity: (t.vars || t).palette.action.disabledOpacity\n },\n [`& .${c['rowReorderCell--draggable']}`]: {\n cursor: 'move',\n opacity: 1\n },\n [`& .${c.rowReorderCellContainer}`]: {\n padding: 0,\n display: 'flex',\n alignItems: 'stretch'\n },\n [`.${c.withBorderColor}`]: {\n borderColor\n },\n [`& .${c['cell--withLeftBorder']}, & .${c['columnHeader--withLeftBorder']}`]: {\n borderLeftColor: 'var(--DataGrid-rowBorderColor)',\n borderLeftWidth: '1px',\n borderLeftStyle: 'solid'\n },\n [`& .${c['cell--withRightBorder']}, & .${c['columnHeader--withRightBorder']}`]: {\n borderRightColor: 'var(--DataGrid-rowBorderColor)',\n borderRightWidth: '1px',\n borderRightStyle: 'solid'\n },\n [`& .${c['cell--flex']}`]: {\n display: 'flex',\n alignItems: 'center',\n lineHeight: 'inherit'\n },\n [`& .${c['cell--textLeft']}`]: {\n textAlign: 'left',\n justifyContent: 'flex-start'\n },\n [`& .${c['cell--textRight']}`]: {\n textAlign: 'right',\n justifyContent: 'flex-end'\n },\n [`& .${c['cell--textCenter']}`]: {\n textAlign: 'center',\n justifyContent: 'center'\n },\n [`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {\n position: 'sticky',\n zIndex: 3,\n background: 'var(--DataGrid-pinnedBackground)'\n },\n [`& .${c.virtualScrollerContent} .${c.row}`]: {\n '&:hover': {\n [`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {\n backgroundColor: pinnedHoverBackground\n }\n },\n [`&.Mui-selected`]: {\n [`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {\n backgroundColor: pinnedSelectedBackground\n },\n '&:hover': {\n [`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {\n backgroundColor: pinnedSelectedHoverBackground\n }\n }\n }\n },\n [`& .${c.cellOffsetLeft}`]: {\n flex: '0 0 auto',\n display: 'inline-block'\n },\n [`& .${c.cellSkeleton}`]: {\n flex: '0 0 auto',\n height: '100%',\n display: 'inline-flex',\n alignItems: 'center'\n },\n [`& .${c.columnHeaderDraggableContainer}`]: {\n display: 'flex',\n width: '100%',\n height: '100%'\n },\n [`& .${c.rowReorderCellPlaceholder}`]: {\n display: 'none'\n },\n [`& .${c['columnHeader--dragging']}, & .${c['row--dragging']}`]: {\n background: (t.vars || t).palette.background.paper,\n padding: '0 12px',\n borderRadius: 'var(--unstable_DataGrid-radius)',\n opacity: (t.vars || t).palette.action.disabledOpacity\n },\n [`& .${c['row--dragging']}`]: {\n background: (t.vars || t).palette.background.paper,\n padding: '0 12px',\n borderRadius: 'var(--unstable_DataGrid-radius)',\n opacity: (t.vars || t).palette.action.disabledOpacity,\n [`& .${c.rowReorderCellPlaceholder}`]: {\n display: 'flex'\n }\n },\n [`& .${c.treeDataGroupingCell}`]: {\n display: 'flex',\n alignItems: 'center',\n width: '100%'\n },\n [`& .${c.treeDataGroupingCellToggle}`]: {\n flex: '0 0 28px',\n alignSelf: 'stretch',\n marginRight: t.spacing(2)\n },\n [`& .${c.treeDataGroupingCellLoadingContainer}`]: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: '100%'\n },\n [`& .${c.groupingCriteriaCell}`]: {\n display: 'flex',\n alignItems: 'center',\n width: '100%'\n },\n [`& .${c.groupingCriteriaCellToggle}`]: {\n flex: '0 0 28px',\n alignSelf: 'stretch',\n marginRight: t.spacing(2)\n },\n /* ScrollbarFiller styles */\n [`.${c.scrollbarFiller}`]: {\n minWidth: 'calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))',\n alignSelf: 'stretch',\n [`&.${c['scrollbarFiller--borderTop']}`]: {\n borderTop: '1px solid var(--DataGrid-rowBorderColor)'\n },\n [`&.${c['scrollbarFiller--borderBottom']}`]: {\n borderBottom: '1px solid var(--DataGrid-rowBorderColor)'\n },\n [`&.${c['scrollbarFiller--pinnedRight']}`]: {\n backgroundColor: 'var(--DataGrid-pinnedBackground)',\n position: 'sticky',\n right: 0\n }\n },\n [`& .${c.filler}`]: {\n flex: 1\n },\n [`& .${c['filler--borderBottom']}`]: {\n borderBottom: '1px solid var(--DataGrid-rowBorderColor)'\n },\n /* Hide grid rows, row filler, and vertical scrollbar when skeleton overlay is visible */\n [`& .${c['main--hasSkeletonLoadingOverlay']}`]: {\n [`& .${c.virtualScrollerContent}`]: {\n // We use visibility hidden so that the virtual scroller content retains its height.\n // Position fixed is used to remove the virtual scroller content from the flow.\n // https://github.com/mui/mui-x/issues/14061\n position: 'fixed',\n visibility: 'hidden'\n },\n [`& .${c['scrollbar--vertical']}, & .${c.pinnedRows}, & .${c.virtualScroller} > .${c.filler}`]: {\n display: 'none'\n }\n }\n });\n return gridStyle;\n});\n\n/**\n * Blend a transparent overlay color with a background color, resulting in a single\n * RGB color.\n */\nfunction blend(background, overlay, opacity, gamma = 1) {\n const f = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);\n const backgroundColor = decomposeColor(background);\n const overlayColor = decomposeColor(overlay);\n const rgb = [f(backgroundColor.values[0], overlayColor.values[0]), f(backgroundColor.values[1], overlayColor.values[1]), f(backgroundColor.values[2], overlayColor.values[2])];\n return recomposeColor({\n type: 'rgb',\n values: rgb\n });\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_useForkRef as useForkRef, unstable_useEnhancedEffect as useEnhancedEffect, unstable_capitalize as capitalize, unstable_composeClasses as composeClasses } from '@mui/utils';\nimport { GridRootStyles } from \"./GridRootStyles.js\";\nimport { useGridSelector } from \"../../hooks/utils/useGridSelector.js\";\nimport { useGridPrivateApiContext } from \"../../hooks/utils/useGridPrivateApiContext.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { gridDensitySelector } from \"../../hooks/features/density/densitySelector.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = (ownerState, density) => {\n const {\n autoHeight,\n classes,\n showCellVerticalBorder\n } = ownerState;\n const slots = {\n root: ['root', autoHeight && 'autoHeight', `root--density${capitalize(density)}`, ownerState.slots.toolbar === null && 'root--noToolbar', 'withBorderColor', showCellVerticalBorder && 'withVerticalBorder']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {\n const rootProps = useGridRootProps();\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridPrivateApiContext();\n const density = useGridSelector(apiRef, gridDensitySelector);\n const rootElementRef = apiRef.current.rootElementRef;\n const handleRef = useForkRef(rootElementRef, ref);\n const ownerState = rootProps;\n const classes = useUtilityClasses(ownerState, density);\n\n // Our implementation of \n const [mountedState, setMountedState] = React.useState(false);\n useEnhancedEffect(() => {\n setMountedState(true);\n }, []);\n if (!mountedState) {\n return null;\n }\n return /*#__PURE__*/_jsx(GridRootStyles, _extends({\n ref: handleRef,\n className: clsx(className, classes.root),\n ownerState: ownerState\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridRoot.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { GridRoot };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { styled } from '@mui/system';\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['footerContainer', 'withBorderColor']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridFooterContainerRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'FooterContainer',\n overridesResolver: (props, styles) => styles.footerContainer\n})({\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n minHeight: 52,\n borderTop: '1px solid'\n});\nconst GridFooterContainer = /*#__PURE__*/React.forwardRef(function GridFooterContainer(props, ref) {\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n return /*#__PURE__*/_jsx(GridFooterContainerRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className),\n ownerState: rootProps\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridFooterContainer.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { GridFooterContainer };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { styled } from '@mui/system';\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['overlay']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridOverlayRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'Overlay',\n overridesResolver: (_, styles) => styles.overlay\n})({\n width: '100%',\n height: '100%',\n display: 'flex',\n alignSelf: 'center',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: 'var(--unstable_DataGrid-overlayBackground)'\n});\nconst GridOverlay = /*#__PURE__*/React.forwardRef(function GridOverlay(props, ref) {\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n return /*#__PURE__*/_jsx(GridOverlayRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className),\n ownerState: rootProps\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridOverlay.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { GridOverlay };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"children\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { styled } from '@mui/system';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['toolbarContainer']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridToolbarContainerRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'ToolbarContainer',\n overridesResolver: (_, styles) => styles.toolbarContainer\n})(({\n theme\n}) => ({\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n gap: theme.spacing(1),\n padding: theme.spacing(0.5, 0.5, 0)\n}));\nconst GridToolbarContainer = /*#__PURE__*/React.forwardRef(function GridToolbarContainer(props, ref) {\n const {\n className,\n children\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n if (!children) {\n return null;\n }\n return /*#__PURE__*/_jsx(GridToolbarContainerRoot, _extends({\n ref: ref,\n className: clsx(className, classes.root),\n ownerState: rootProps\n }, other, {\n children: children\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridToolbarContainer.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { GridToolbarContainer };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n open\n } = ownerState;\n const slots = {\n root: ['menuIcon', open && 'menuOpen'],\n button: ['menuIconButton']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nexport const ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(props => {\n const {\n colDef,\n open,\n columnMenuId,\n columnMenuButtonId,\n iconButtonRef\n } = props;\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const ownerState = _extends({}, props, {\n classes: rootProps.classes\n });\n const classes = useUtilityClasses(ownerState);\n const handleMenuIconClick = React.useCallback(event => {\n event.preventDefault();\n event.stopPropagation();\n apiRef.current.toggleColumnMenu(colDef.field);\n }, [apiRef, colDef.field]);\n return /*#__PURE__*/_jsx(\"div\", {\n className: classes.root,\n children: /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({\n title: apiRef.current.getLocaleText('columnMenuLabel'),\n enterDelay: 1000\n }, rootProps.slotProps?.baseTooltip, {\n children: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({\n ref: iconButtonRef,\n tabIndex: -1,\n className: classes.button,\n \"aria-label\": apiRef.current.getLocaleText('columnMenuLabel'),\n size: \"small\",\n onClick: handleMenuIconClick,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": open,\n \"aria-controls\": open ? columnMenuId : undefined,\n id: columnMenuButtonId\n }, rootProps.slotProps?.baseIconButton, {\n children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuIcon, {\n fontSize: \"inherit\"\n })\n }))\n }))\n });\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useEventCallback as useEventCallback, HTMLElementType } from '@mui/utils';\nimport { useGridApiContext } from \"../../../hooks/utils/useGridApiContext.js\";\nimport { GridMenu } from \"../GridMenu.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction GridColumnHeaderMenu({\n columnMenuId,\n columnMenuButtonId,\n ContentComponent,\n contentComponentProps,\n field,\n open,\n target,\n onExited\n}) {\n const apiRef = useGridApiContext();\n const colDef = apiRef.current.getColumn(field);\n const hideMenu = useEventCallback(event => {\n if (event) {\n // Prevent triggering the sorting\n event.stopPropagation();\n if (target?.contains(event.target)) {\n return;\n }\n }\n apiRef.current.hideColumnMenu();\n });\n if (!target || !colDef) {\n return null;\n }\n return /*#__PURE__*/_jsx(GridMenu, {\n placement: `bottom-${colDef.align === 'right' ? 'start' : 'end'}`,\n open: open,\n target: target,\n onClose: hideMenu,\n onExited: onExited,\n children: /*#__PURE__*/_jsx(ContentComponent, _extends({\n colDef: colDef,\n hideMenu: hideMenu,\n open: open,\n id: columnMenuId,\n labelledby: columnMenuButtonId\n }, contentComponentProps))\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GridColumnHeaderMenu.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n columnMenuButtonId: PropTypes.string,\n columnMenuId: PropTypes.string,\n ContentComponent: PropTypes.elementType.isRequired,\n contentComponentProps: PropTypes.any,\n field: PropTypes.string.isRequired,\n onExited: PropTypes.func,\n open: PropTypes.bool.isRequired,\n target: HTMLElementType\n} : void 0;\nexport { GridColumnHeaderMenu };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"aria-label\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { styled } from '@mui/system';\nimport { isOverflown } from \"../../utils/domUtils.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['columnHeaderTitle']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridColumnHeaderTitleRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'ColumnHeaderTitle',\n overridesResolver: (props, styles) => styles.columnHeaderTitle\n})({\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n fontWeight: 'var(--unstable_DataGrid-headWeight)',\n lineHeight: 'normal'\n});\nconst ColumnHeaderInnerTitle = /*#__PURE__*/React.forwardRef(function ColumnHeaderInnerTitle(props, ref) {\n // Tooltip adds aria-label to the props, which is not needed since the children prop is a string\n // See https://github.com/mui/mui-x/pull/14482\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n return /*#__PURE__*/_jsx(GridColumnHeaderTitleRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className),\n ownerState: rootProps\n }, other));\n});\n// No React.memo here as if we display the sort icon, we need to recalculate the isOver\nfunction GridColumnHeaderTitle(props) {\n const {\n label,\n description\n } = props;\n const rootProps = useGridRootProps();\n const titleRef = React.useRef(null);\n const [tooltip, setTooltip] = React.useState('');\n const handleMouseOver = React.useCallback(() => {\n if (!description && titleRef?.current) {\n const isOver = isOverflown(titleRef.current);\n if (isOver) {\n setTooltip(label);\n } else {\n setTooltip('');\n }\n }\n }, [description, label]);\n return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({\n title: description || tooltip\n }, rootProps.slotProps?.baseTooltip, {\n children: /*#__PURE__*/_jsx(ColumnHeaderInnerTitle, {\n onMouseOver: handleMouseOver,\n ref: titleRef,\n children: label\n })\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridColumnHeaderTitle.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n columnWidth: PropTypes.number.isRequired,\n description: PropTypes.node,\n label: PropTypes.string.isRequired\n} : void 0;\nexport { GridColumnHeaderTitle };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"resizable\", \"resizing\", \"height\", \"side\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize } from '@mui/utils';\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar GridColumnHeaderSeparatorSides = /*#__PURE__*/function (GridColumnHeaderSeparatorSides) {\n GridColumnHeaderSeparatorSides[\"Left\"] = \"left\";\n GridColumnHeaderSeparatorSides[\"Right\"] = \"right\";\n return GridColumnHeaderSeparatorSides;\n}(GridColumnHeaderSeparatorSides || {});\nconst useUtilityClasses = ownerState => {\n const {\n resizable,\n resizing,\n classes,\n side\n } = ownerState;\n const slots = {\n root: ['columnSeparator', resizable && 'columnSeparator--resizable', resizing && 'columnSeparator--resizing', side && `columnSeparator--side${capitalize(side)}`],\n icon: ['iconSeparator']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nfunction GridColumnHeaderSeparatorRaw(props) {\n const {\n height,\n side = GridColumnHeaderSeparatorSides.Right\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootProps = useGridRootProps();\n const ownerState = _extends({}, props, {\n side,\n classes: rootProps.classes\n });\n const classes = useUtilityClasses(ownerState);\n const stopClick = React.useCallback(event => {\n event.preventDefault();\n event.stopPropagation();\n }, []);\n return (\n /*#__PURE__*/\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions\n _jsx(\"div\", _extends({\n className: classes.root,\n style: {\n minHeight: height\n }\n }, other, {\n onClick: stopClick,\n children: /*#__PURE__*/_jsx(rootProps.slots.columnResizeIcon, {\n className: classes.icon\n })\n }))\n );\n}\nconst GridColumnHeaderSeparator = /*#__PURE__*/React.memo(GridColumnHeaderSeparatorRaw);\nprocess.env.NODE_ENV !== \"production\" ? GridColumnHeaderSeparatorRaw.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n height: PropTypes.number.isRequired,\n resizable: PropTypes.bool.isRequired,\n resizing: PropTypes.bool.isRequired,\n side: PropTypes.oneOf(['left', 'right'])\n} : void 0;\nexport { GridColumnHeaderSeparator, GridColumnHeaderSeparatorSides };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"classes\", \"columnMenuOpen\", \"colIndex\", \"height\", \"isResizing\", \"sortDirection\", \"hasFocus\", \"tabIndex\", \"separatorSide\", \"isDraggable\", \"headerComponent\", \"description\", \"elementId\", \"width\", \"columnMenuIconButton\", \"columnMenu\", \"columnTitleIconButtons\", \"headerClassName\", \"label\", \"resizable\", \"draggableContainerProps\", \"columnHeaderSeparatorProps\", \"style\"];\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport { unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { useGridPrivateApiContext } from \"../../hooks/utils/useGridPrivateApiContext.js\";\nimport { GridColumnHeaderTitle } from \"./GridColumnHeaderTitle.js\";\nimport { GridColumnHeaderSeparator } from \"./GridColumnHeaderSeparator.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst GridGenericColumnHeaderItem = /*#__PURE__*/React.forwardRef(function GridGenericColumnHeaderItem(props, ref) {\n const {\n classes,\n colIndex,\n height,\n isResizing,\n sortDirection,\n hasFocus,\n tabIndex,\n separatorSide,\n isDraggable,\n headerComponent,\n description,\n width,\n columnMenuIconButton = null,\n columnMenu = null,\n columnTitleIconButtons = null,\n headerClassName,\n label,\n resizable,\n draggableContainerProps,\n columnHeaderSeparatorProps,\n style\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridPrivateApiContext();\n const rootProps = useGridRootProps();\n const headerCellRef = React.useRef(null);\n const handleRef = useForkRef(headerCellRef, ref);\n let ariaSort = 'none';\n if (sortDirection != null) {\n ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';\n }\n React.useLayoutEffect(() => {\n const columnMenuState = apiRef.current.state.columnMenu;\n if (hasFocus && !columnMenuState.open) {\n const focusableElement = headerCellRef.current.querySelector('[tabindex=\"0\"]');\n const elementToFocus = focusableElement || headerCellRef.current;\n elementToFocus?.focus();\n if (apiRef.current.columnHeadersContainerRef?.current) {\n apiRef.current.columnHeadersContainerRef.current.scrollLeft = 0;\n }\n }\n }, [apiRef, hasFocus]);\n return /*#__PURE__*/_jsxs(\"div\", _extends({\n ref: handleRef,\n className: clsx(classes.root, headerClassName),\n style: _extends({}, style, {\n height,\n width\n }),\n role: \"columnheader\",\n tabIndex: tabIndex,\n \"aria-colindex\": colIndex + 1,\n \"aria-sort\": ariaSort\n }, other, {\n children: [/*#__PURE__*/_jsxs(\"div\", _extends({\n className: classes.draggableContainer,\n draggable: isDraggable,\n role: \"presentation\"\n }, draggableContainerProps, {\n children: [/*#__PURE__*/_jsxs(\"div\", {\n className: classes.titleContainer,\n role: \"presentation\",\n children: [/*#__PURE__*/_jsx(\"div\", {\n className: classes.titleContainerContent,\n children: headerComponent !== undefined ? headerComponent : /*#__PURE__*/_jsx(GridColumnHeaderTitle, {\n label: label,\n description: description,\n columnWidth: width\n })\n }), columnTitleIconButtons]\n }), columnMenuIconButton]\n })), /*#__PURE__*/_jsx(GridColumnHeaderSeparator, _extends({\n resizable: !rootProps.disableColumnResize && !!resizable,\n resizing: isResizing,\n height: height,\n side: separatorSide\n }, columnHeaderSeparatorProps)), columnMenu]\n }));\n});\nexport { GridGenericColumnHeaderItem };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils';\nimport { fastMemo } from '@mui/x-internals/fastMemo';\nimport { useGridPrivateApiContext } from \"../../hooks/utils/useGridPrivateApiContext.js\";\nimport { ColumnHeaderMenuIcon } from \"./ColumnHeaderMenuIcon.js\";\nimport { GridColumnHeaderMenu } from \"../menu/columnMenu/GridColumnHeaderMenu.js\";\nimport { gridClasses, getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { GridGenericColumnHeaderItem } from \"./GridGenericColumnHeaderItem.js\";\nimport { isEventTargetInPortal } from \"../../utils/domUtils.js\";\nimport { shouldCellShowLeftBorder, shouldCellShowRightBorder } from \"../../utils/cellBorderUtils.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n colDef,\n classes,\n isDragging,\n sortDirection,\n showRightBorder,\n showLeftBorder,\n filterItemsCounter,\n pinnedPosition,\n isLastUnpinned,\n isSiblingFocused\n } = ownerState;\n const isColumnSorted = sortDirection != null;\n const isColumnFiltered = filterItemsCounter != null && filterItemsCounter > 0;\n // todo refactor to a prop on col isNumeric or ?? ie: coltype===price wont work\n const isColumnNumeric = colDef.type === 'number';\n const slots = {\n root: ['columnHeader', colDef.headerAlign === 'left' && 'columnHeader--alignLeft', colDef.headerAlign === 'center' && 'columnHeader--alignCenter', colDef.headerAlign === 'right' && 'columnHeader--alignRight', colDef.sortable && 'columnHeader--sortable', isDragging && 'columnHeader--moving', isColumnSorted && 'columnHeader--sorted', isColumnFiltered && 'columnHeader--filtered', isColumnNumeric && 'columnHeader--numeric', 'withBorderColor', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', pinnedPosition === 'left' && 'columnHeader--pinnedLeft', pinnedPosition === 'right' && 'columnHeader--pinnedRight',\n // TODO: Remove classes below and restore `:has` selectors when they are supported in jsdom\n // See https://github.com/mui/mui-x/pull/14559\n isLastUnpinned && 'columnHeader--lastUnpinned', isSiblingFocused && 'columnHeader--siblingFocused'],\n draggableContainer: ['columnHeaderDraggableContainer'],\n titleContainer: ['columnHeaderTitleContainer'],\n titleContainerContent: ['columnHeaderTitleContainerContent']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nfunction GridColumnHeaderItem(props) {\n const {\n colDef,\n columnMenuOpen,\n colIndex,\n headerHeight,\n isResizing,\n isLast,\n sortDirection,\n sortIndex,\n filterItemsCounter,\n hasFocus,\n tabIndex,\n disableReorder,\n separatorSide,\n style,\n pinnedPosition,\n indexInSection,\n sectionLength,\n gridHasFiller\n } = props;\n const apiRef = useGridPrivateApiContext();\n const rootProps = useGridRootProps();\n const headerCellRef = React.useRef(null);\n const columnMenuId = useId();\n const columnMenuButtonId = useId();\n const iconButtonRef = React.useRef(null);\n const [showColumnMenuIcon, setShowColumnMenuIcon] = React.useState(columnMenuOpen);\n const isDraggable = React.useMemo(() => !rootProps.disableColumnReorder && !disableReorder && !colDef.disableReorder, [rootProps.disableColumnReorder, disableReorder, colDef.disableReorder]);\n let headerComponent;\n if (colDef.renderHeader) {\n headerComponent = colDef.renderHeader(apiRef.current.getColumnHeaderParams(colDef.field));\n }\n const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);\n const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showColumnVerticalBorder, gridHasFiller);\n const ownerState = _extends({}, props, {\n classes: rootProps.classes,\n showRightBorder,\n showLeftBorder\n });\n const classes = useUtilityClasses(ownerState);\n const publish = React.useCallback(eventName => event => {\n // Ignore portal\n // See https://github.com/mui/mui-x/issues/1721\n if (isEventTargetInPortal(event)) {\n return;\n }\n apiRef.current.publishEvent(eventName, apiRef.current.getColumnHeaderParams(colDef.field), event);\n }, [apiRef, colDef.field]);\n const mouseEventsHandlers = React.useMemo(() => ({\n onClick: publish('columnHeaderClick'),\n onDoubleClick: publish('columnHeaderDoubleClick'),\n onMouseOver: publish('columnHeaderOver'),\n // TODO remove as it's not used\n onMouseOut: publish('columnHeaderOut'),\n // TODO remove as it's not used\n onMouseEnter: publish('columnHeaderEnter'),\n // TODO remove as it's not used\n onMouseLeave: publish('columnHeaderLeave'),\n // TODO remove as it's not used\n onKeyDown: publish('columnHeaderKeyDown'),\n onFocus: publish('columnHeaderFocus'),\n onBlur: publish('columnHeaderBlur')\n }), [publish]);\n const draggableEventHandlers = React.useMemo(() => isDraggable ? {\n onDragStart: publish('columnHeaderDragStart'),\n onDragEnter: publish('columnHeaderDragEnter'),\n onDragOver: publish('columnHeaderDragOver'),\n onDragEnd: publish('columnHeaderDragEnd')\n } : {}, [isDraggable, publish]);\n const columnHeaderSeparatorProps = React.useMemo(() => ({\n onMouseDown: publish('columnSeparatorMouseDown'),\n onDoubleClick: publish('columnSeparatorDoubleClick')\n }), [publish]);\n React.useEffect(() => {\n if (!showColumnMenuIcon) {\n setShowColumnMenuIcon(columnMenuOpen);\n }\n }, [showColumnMenuIcon, columnMenuOpen]);\n const handleExited = React.useCallback(() => {\n setShowColumnMenuIcon(false);\n }, []);\n const columnMenuIconButton = !rootProps.disableColumnMenu && !colDef.disableColumnMenu && /*#__PURE__*/_jsx(ColumnHeaderMenuIcon, {\n colDef: colDef,\n columnMenuId: columnMenuId,\n columnMenuButtonId: columnMenuButtonId,\n open: showColumnMenuIcon,\n iconButtonRef: iconButtonRef\n });\n const columnMenu = /*#__PURE__*/_jsx(GridColumnHeaderMenu, {\n columnMenuId: columnMenuId,\n columnMenuButtonId: columnMenuButtonId,\n field: colDef.field,\n open: columnMenuOpen,\n target: iconButtonRef.current,\n ContentComponent: rootProps.slots.columnMenu,\n contentComponentProps: rootProps.slotProps?.columnMenu,\n onExited: handleExited\n });\n const sortingOrder = colDef.sortingOrder ?? rootProps.sortingOrder;\n const showSortIcon = (colDef.sortable || sortDirection != null) && !colDef.hideSortIcons && !rootProps.disableColumnSorting;\n const columnTitleIconButtons = /*#__PURE__*/_jsxs(React.Fragment, {\n children: [!rootProps.disableColumnFilter && /*#__PURE__*/_jsx(rootProps.slots.columnHeaderFilterIconButton, _extends({\n field: colDef.field,\n counter: filterItemsCounter\n }, rootProps.slotProps?.columnHeaderFilterIconButton)), showSortIcon && /*#__PURE__*/_jsx(rootProps.slots.columnHeaderSortIcon, _extends({\n field: colDef.field,\n direction: sortDirection,\n index: sortIndex,\n sortingOrder: sortingOrder,\n disabled: !colDef.sortable\n }, rootProps.slotProps?.columnHeaderSortIcon))]\n });\n React.useLayoutEffect(() => {\n const columnMenuState = apiRef.current.state.columnMenu;\n if (hasFocus && !columnMenuState.open) {\n const focusableElement = headerCellRef.current.querySelector('[tabindex=\"0\"]');\n const elementToFocus = focusableElement || headerCellRef.current;\n elementToFocus?.focus();\n if (apiRef.current.columnHeadersContainerRef?.current) {\n apiRef.current.columnHeadersContainerRef.current.scrollLeft = 0;\n }\n }\n }, [apiRef, hasFocus]);\n const headerClassName = typeof colDef.headerClassName === 'function' ? colDef.headerClassName({\n field: colDef.field,\n colDef\n }) : colDef.headerClassName;\n const label = colDef.headerName ?? colDef.field;\n return /*#__PURE__*/_jsx(GridGenericColumnHeaderItem, _extends({\n ref: headerCellRef,\n classes: classes,\n columnMenuOpen: columnMenuOpen,\n colIndex: colIndex,\n height: headerHeight,\n isResizing: isResizing,\n sortDirection: sortDirection,\n hasFocus: hasFocus,\n tabIndex: tabIndex,\n separatorSide: separatorSide,\n isDraggable: isDraggable,\n headerComponent: headerComponent,\n description: colDef.description,\n elementId: colDef.field,\n width: colDef.computedWidth,\n columnMenuIconButton: columnMenuIconButton,\n columnTitleIconButtons: columnTitleIconButtons,\n headerClassName: clsx(headerClassName, isLast && gridClasses['columnHeader--last']),\n label: label,\n resizable: !rootProps.disableColumnResize && !!colDef.resizable,\n \"data-field\": colDef.field,\n columnMenu: columnMenu,\n draggableContainerProps: draggableEventHandlers,\n columnHeaderSeparatorProps: columnHeaderSeparatorProps,\n style: style\n }, mouseEventsHandlers));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridColumnHeaderItem.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n colDef: PropTypes.object.isRequired,\n colIndex: PropTypes.number.isRequired,\n columnMenuOpen: PropTypes.bool.isRequired,\n disableReorder: PropTypes.bool,\n filterItemsCounter: PropTypes.number,\n gridHasFiller: PropTypes.bool.isRequired,\n hasFocus: PropTypes.bool,\n headerHeight: PropTypes.number.isRequired,\n indexInSection: PropTypes.number.isRequired,\n isDragging: PropTypes.bool.isRequired,\n isLast: PropTypes.bool.isRequired,\n isLastUnpinned: PropTypes.bool.isRequired,\n isResizing: PropTypes.bool.isRequired,\n isSiblingFocused: PropTypes.bool.isRequired,\n pinnedPosition: PropTypes.oneOf(['left', 'right']),\n sectionLength: PropTypes.number.isRequired,\n separatorSide: PropTypes.oneOf(['left', 'right']),\n sortDirection: PropTypes.oneOf(['asc', 'desc']),\n sortIndex: PropTypes.number,\n style: PropTypes.object,\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired\n} : void 0;\nconst Memoized = fastMemo(GridColumnHeaderItem);\nexport { Memoized as GridColumnHeaderItem };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\"];\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { styled } from '@mui/system';\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['iconButtonContainer']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridIconButtonContainerRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'IconButtonContainer',\n overridesResolver: (props, styles) => styles.iconButtonContainer\n})(() => ({\n display: 'flex',\n visibility: 'hidden',\n width: 0\n}));\nexport const GridIconButtonContainer = /*#__PURE__*/React.forwardRef(function GridIconButtonContainer(props, ref) {\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n return /*#__PURE__*/_jsx(GridIconButtonContainerRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className),\n ownerState: rootProps\n }, other));\n});","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"direction\", \"index\", \"sortingOrder\", \"disabled\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport composeClasses from '@mui/utils/composeClasses';\nimport Badge from '@mui/material/Badge';\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { GridIconButtonContainer } from \"./GridIconButtonContainer.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n icon: ['sortIcon']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nfunction getIcon(icons, direction, className, sortingOrder) {\n let Icon;\n const iconProps = {};\n if (direction === 'asc') {\n Icon = icons.columnSortedAscendingIcon;\n } else if (direction === 'desc') {\n Icon = icons.columnSortedDescendingIcon;\n } else {\n Icon = icons.columnUnsortedIcon;\n iconProps.sortingOrder = sortingOrder;\n }\n return Icon ? /*#__PURE__*/_jsx(Icon, _extends({\n fontSize: \"small\",\n className: className\n }, iconProps)) : null;\n}\nfunction GridColumnHeaderSortIconRaw(props) {\n const {\n direction,\n index,\n sortingOrder,\n disabled\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const ownerState = _extends({}, props, {\n classes: rootProps.classes\n });\n const classes = useUtilityClasses(ownerState);\n const iconElement = getIcon(rootProps.slots, direction, classes.icon, sortingOrder);\n if (!iconElement) {\n return null;\n }\n const iconButton = /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({\n tabIndex: -1,\n \"aria-label\": apiRef.current.getLocaleText('columnHeaderSortIconLabel'),\n title: apiRef.current.getLocaleText('columnHeaderSortIconLabel'),\n size: \"small\",\n disabled: disabled\n }, rootProps.slotProps?.baseIconButton, other, {\n children: iconElement\n }));\n return /*#__PURE__*/_jsxs(GridIconButtonContainer, {\n children: [index != null && /*#__PURE__*/_jsx(Badge, {\n badgeContent: index,\n color: \"default\",\n overlap: \"circular\",\n children: iconButton\n }), index == null && iconButton]\n });\n}\nconst GridColumnHeaderSortIcon = /*#__PURE__*/React.memo(GridColumnHeaderSortIconRaw);\nprocess.env.NODE_ENV !== \"production\" ? GridColumnHeaderSortIconRaw.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n direction: PropTypes.oneOf(['asc', 'desc']),\n disabled: PropTypes.bool,\n field: PropTypes.string.isRequired,\n index: PropTypes.number,\n sortingOrder: PropTypes.arrayOf(PropTypes.oneOf(['asc', 'desc'])).isRequired\n} : void 0;\nexport { GridColumnHeaderSortIcon };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils';\nimport Badge from '@mui/material/Badge';\nimport { useGridSelector } from \"../../hooks/index.js\";\nimport { gridPreferencePanelStateSelector } from \"../../hooks/features/preferencesPanel/gridPreferencePanelSelector.js\";\nimport { GridPreferencePanelsValue } from \"../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { GridIconButtonContainer } from \"./GridIconButtonContainer.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n icon: ['filterIcon']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nfunction GridColumnHeaderFilterIconButton(props) {\n const {\n counter,\n field,\n onClick\n } = props;\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const ownerState = _extends({}, props, {\n classes: rootProps.classes\n });\n const classes = useUtilityClasses(ownerState);\n const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);\n const labelId = useId();\n const panelId = useId();\n const toggleFilter = React.useCallback(event => {\n event.preventDefault();\n event.stopPropagation();\n const {\n open,\n openedPanelValue\n } = gridPreferencePanelStateSelector(apiRef.current.state);\n if (open && openedPanelValue === GridPreferencePanelsValue.filters) {\n apiRef.current.hideFilterPanel();\n } else {\n apiRef.current.showFilterPanel(undefined, panelId, labelId);\n }\n if (onClick) {\n onClick(apiRef.current.getColumnHeaderParams(field), event);\n }\n }, [apiRef, field, onClick, panelId, labelId]);\n if (!counter) {\n return null;\n }\n const open = preferencePanel.open && preferencePanel.labelId === labelId;\n const iconButton = /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({\n id: labelId,\n onClick: toggleFilter,\n color: \"default\",\n \"aria-label\": apiRef.current.getLocaleText('columnHeaderFiltersLabel'),\n size: \"small\",\n tabIndex: -1,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": open,\n \"aria-controls\": open ? panelId : undefined\n }, rootProps.slotProps?.baseIconButton, {\n children: /*#__PURE__*/_jsx(rootProps.slots.columnFilteredIcon, {\n className: classes.icon,\n fontSize: \"small\"\n })\n }));\n return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({\n title: apiRef.current.getLocaleText('columnHeaderFiltersTooltipActive')(counter),\n enterDelay: 1000\n }, rootProps.slotProps?.baseTooltip, {\n children: /*#__PURE__*/_jsxs(GridIconButtonContainer, {\n children: [counter > 1 && /*#__PURE__*/_jsx(Badge, {\n badgeContent: counter,\n color: \"default\",\n children: iconButton\n }), counter === 1 && iconButton]\n })\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridColumnHeaderFilterIconButton.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n counter: PropTypes.number,\n field: PropTypes.string.isRequired,\n onClick: PropTypes.func\n} : void 0;\nexport { GridColumnHeaderFilterIconButton };","import * as React from 'react';\nimport { createSvgIcon } from '@mui/material/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const GridArrowUpwardIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\"\n}), 'ArrowUpward');\nexport const GridArrowDownwardIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z\"\n}), 'ArrowDownward');\nexport const GridKeyboardArrowRight = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z\"\n}), 'KeyboardArrowRight');\nexport const GridExpandMoreIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z\"\n}), 'ExpandMore');\nexport const GridFilterListIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z\"\n}), 'FilterList');\nexport const GridFilterAltIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'FilterAlt');\nexport const GridSearchIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'Search');\nexport const GridMenuIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z\"\n}), 'Menu');\nexport const GridCheckCircleIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'CheckCircle');\nexport const GridColumnIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'ColumnIcon');\nexport const GridSeparatorIcon = createSvgIcon(/*#__PURE__*/_jsx(\"rect\", {\n width: \"1\",\n height: \"24\",\n x: \"11.5\",\n rx: \"0.5\"\n}), 'Separator');\nexport const GridViewHeadlineIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z\"\n}), 'ViewHeadline');\nexport const GridTableRowsIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z\"\n}), 'TableRows');\nexport const GridViewStreamIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M4 18h17v-6H4v6zM4 5v6h17V5H4z\"\n}), 'ViewStream');\nexport const GridTripleDotsVerticalIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'TripleDotsVertical');\nexport const GridCloseIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'Close');\nexport const GridAddIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\"\n}), 'Add');\nexport const GridRemoveIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M19 13H5v-2h14v2z\"\n}), 'Remove');\nexport const GridLoadIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'Load');\nexport const GridDragIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'Drag');\nexport const GridSaveAltIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'SaveAlt');\nexport const GridCheckIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"\n}), 'Check');\nexport const GridMoreVertIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'MoreVert');\nexport const GridVisibilityOffIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'VisibilityOff');\nexport const GridViewColumnIcon = createSvgIcon(/*#__PURE__*/_jsx(\"g\", {\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z\"\n })\n}), 'ViewColumn');\nexport const GridClearIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'Clear');\nexport const GridDeleteIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z\"\n}), 'Delete');\nexport const GridDeleteForeverIcon = createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'Delete');","// Non printable keys have a name, for example \"ArrowRight\", see the whole list:\n// https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values\n// So event.key.length === 1 is often enough.\n//\n// However, we also need to ignore shortcuts, for example: select all:\n// - Windows: Ctrl+A, event.ctrlKey is true\n// - macOS: ⌘ Command+A, event.metaKey is true\nexport function isPrintableKey(event) {\n return event.key.length === 1 && !event.ctrlKey && !event.metaKey;\n}\nexport const GRID_MULTIPLE_SELECTION_KEYS = ['Meta', 'Control', 'Shift'];\nexport const GRID_CELL_EXIT_EDIT_MODE_KEYS = ['Enter', 'Escape', 'Tab'];\nexport const GRID_CELL_EDIT_COMMIT_KEYS = ['Enter', 'Tab'];\nexport const isMultipleKey = key => GRID_MULTIPLE_SELECTION_KEYS.indexOf(key) > -1;\nexport const isCellEnterEditModeKeys = event => isPrintableKey(event) || event.key === 'Enter' || event.key === 'Backspace' || event.key === 'Delete';\nexport const isCellExitEditModeKeys = key => GRID_CELL_EXIT_EDIT_MODE_KEYS.indexOf(key) > -1;\nexport const isCellEditCommitKeys = key => GRID_CELL_EDIT_COMMIT_KEYS.indexOf(key) > -1;\nexport const isNavigationKey = key => key.indexOf('Arrow') === 0 || key.indexOf('Page') === 0 || key === ' ' || key === 'Home' || key === 'End';\nexport const isKeyboardEvent = event => !!event.key;\nexport const isHideMenuKey = key => key === 'Tab' || key === 'Escape';\n\n// In theory, on macOS, ctrl + v doesn't trigger a paste, so the function should return false.\n// However, maybe it's overkill to fix, so let's be lazy.\nexport function isPasteShortcut(event) {\n if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'v' && !event.shiftKey && !event.altKey) {\n return true;\n }\n return false;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"hideMenu\", \"colDef\", \"id\", \"labelledby\", \"className\", \"children\", \"open\"];\nimport clsx from 'clsx';\nimport PropTypes from 'prop-types';\nimport * as React from 'react';\nimport MenuList from '@mui/material/MenuList';\nimport { styled } from '@mui/material/styles';\nimport { isHideMenuKey } from \"../../../utils/keyboardUtils.js\";\nimport { gridClasses } from \"../../../constants/gridClasses.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst StyledMenuList = styled(MenuList)(() => ({\n minWidth: 248\n}));\nconst GridColumnMenuContainer = /*#__PURE__*/React.forwardRef(function GridColumnMenuContainer(props, ref) {\n const {\n hideMenu,\n id,\n labelledby,\n className,\n children,\n open\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const handleListKeyDown = React.useCallback(event => {\n if (event.key === 'Tab') {\n event.preventDefault();\n }\n if (isHideMenuKey(event.key)) {\n hideMenu(event);\n }\n }, [hideMenu]);\n return /*#__PURE__*/_jsx(StyledMenuList, _extends({\n id: id,\n ref: ref,\n className: clsx(gridClasses.menuList, className),\n \"aria-labelledby\": labelledby,\n onKeyDown: handleListKeyDown,\n autoFocus: open\n }, other, {\n children: children\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridColumnMenuContainer.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n colDef: PropTypes.object.isRequired,\n hideMenu: PropTypes.func.isRequired,\n id: PropTypes.string,\n labelledby: PropTypes.string,\n open: PropTypes.bool.isRequired\n} : void 0;\nexport { GridColumnMenuContainer };","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"displayOrder\"];\nimport * as React from 'react';\nimport Divider from '@mui/material/Divider';\nimport { useGridPrivateApiContext } from \"../../utils/useGridPrivateApiContext.js\";\nconst useGridColumnMenuSlots = props => {\n const apiRef = useGridPrivateApiContext();\n const {\n defaultSlots,\n defaultSlotProps,\n slots = {},\n slotProps = {},\n hideMenu,\n colDef,\n addDividers = true\n } = props;\n const processedComponents = React.useMemo(() => _extends({}, defaultSlots, slots), [defaultSlots, slots]);\n const processedSlotProps = React.useMemo(() => {\n if (!slotProps || Object.keys(slotProps).length === 0) {\n return defaultSlotProps;\n }\n const mergedProps = _extends({}, slotProps);\n Object.entries(defaultSlotProps).forEach(([key, currentSlotProps]) => {\n mergedProps[key] = _extends({}, currentSlotProps, slotProps[key] || {});\n });\n return mergedProps;\n }, [defaultSlotProps, slotProps]);\n const defaultItems = apiRef.current.unstable_applyPipeProcessors('columnMenu', [], props.colDef);\n const userItems = React.useMemo(() => {\n const defaultComponentKeys = Object.keys(defaultSlots);\n return Object.keys(slots).filter(key => !defaultComponentKeys.includes(key));\n }, [slots, defaultSlots]);\n return React.useMemo(() => {\n const uniqueItems = Array.from(new Set([...defaultItems, ...userItems]));\n const cleansedItems = uniqueItems.filter(key => processedComponents[key] != null);\n const sorted = cleansedItems.sort((a, b) => {\n const leftItemProps = processedSlotProps[a];\n const rightItemProps = processedSlotProps[b];\n const leftDisplayOrder = Number.isFinite(leftItemProps?.displayOrder) ? leftItemProps.displayOrder : 100;\n const rightDisplayOrder = Number.isFinite(rightItemProps?.displayOrder) ? rightItemProps.displayOrder : 100;\n return leftDisplayOrder - rightDisplayOrder;\n });\n return sorted.reduce((acc, key, index) => {\n let itemProps = {\n colDef,\n onClick: hideMenu\n };\n const processedComponentProps = processedSlotProps[key];\n if (processedComponentProps) {\n const customProps = _objectWithoutPropertiesLoose(processedComponentProps, _excluded);\n itemProps = _extends({}, itemProps, customProps);\n }\n return addDividers && index !== sorted.length - 1 ? [...acc, [processedComponents[key], itemProps], [Divider, {}]] : [...acc, [processedComponents[key], itemProps]];\n }, []);\n }, [addDividers, colDef, defaultItems, hideMenu, processedComponents, processedSlotProps, userItems]);\n};\nexport { useGridColumnMenuSlots };","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport MenuItem from '@mui/material/MenuItem';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\nimport { useGridApiContext } from \"../../../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../../../hooks/utils/useGridRootProps.js\";\nimport { gridVisibleColumnDefinitionsSelector } from \"../../../../hooks/features/columns/index.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction GridColumnMenuHideItem(props) {\n const {\n colDef,\n onClick\n } = props;\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const visibleColumns = gridVisibleColumnDefinitionsSelector(apiRef);\n const columnsWithMenu = visibleColumns.filter(col => col.disableColumnMenu !== true);\n // do not allow to hide the last column with menu\n const disabled = columnsWithMenu.length === 1;\n const toggleColumn = React.useCallback(event => {\n /**\n * Disabled `MenuItem` would trigger `click` event\n * after imperative `.click()` call on HTML element.\n * Also, click is triggered in testing environment as well.\n */\n if (disabled) {\n return;\n }\n apiRef.current.setColumnVisibility(colDef.field, false);\n onClick(event);\n }, [apiRef, colDef.field, onClick, disabled]);\n if (rootProps.disableColumnSelector) {\n return null;\n }\n if (colDef.hideable === false) {\n return null;\n }\n return /*#__PURE__*/_jsxs(MenuItem, {\n onClick: toggleColumn,\n disabled: disabled,\n children: [/*#__PURE__*/_jsx(ListItemIcon, {\n children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuHideIcon, {\n fontSize: \"small\"\n })\n }), /*#__PURE__*/_jsx(ListItemText, {\n children: apiRef.current.getLocaleText('columnMenuHideColumn')\n })]\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GridColumnMenuHideItem.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n colDef: PropTypes.object.isRequired,\n onClick: PropTypes.func.isRequired\n} : void 0;\nexport { GridColumnMenuHideItem };","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport MenuItem from '@mui/material/MenuItem';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\nimport { GridPreferencePanelsValue } from \"../../../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js\";\nimport { useGridApiContext } from \"../../../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction GridColumnMenuManageItem(props) {\n const {\n onClick\n } = props;\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const showColumns = React.useCallback(event => {\n onClick(event); // hide column menu\n apiRef.current.showPreferences(GridPreferencePanelsValue.columns);\n }, [apiRef, onClick]);\n if (rootProps.disableColumnSelector) {\n return null;\n }\n return /*#__PURE__*/_jsxs(MenuItem, {\n onClick: showColumns,\n children: [/*#__PURE__*/_jsx(ListItemIcon, {\n children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuManageColumnsIcon, {\n fontSize: \"small\"\n })\n }), /*#__PURE__*/_jsx(ListItemText, {\n children: apiRef.current.getLocaleText('columnMenuManageColumns')\n })]\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GridColumnMenuManageItem.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n colDef: PropTypes.object.isRequired,\n onClick: PropTypes.func.isRequired\n} : void 0;\nexport { GridColumnMenuManageItem };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { GridColumnMenuHideItem } from \"./GridColumnMenuHideItem.js\";\nimport { GridColumnMenuManageItem } from \"./GridColumnMenuManageItem.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction GridColumnMenuColumnsItem(props) {\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(GridColumnMenuHideItem, _extends({}, props)), /*#__PURE__*/_jsx(GridColumnMenuManageItem, _extends({}, props))]\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GridColumnMenuColumnsItem.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n colDef: PropTypes.object.isRequired,\n onClick: PropTypes.func.isRequired\n} : void 0;\nexport { GridColumnMenuColumnsItem };","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport MenuItem from '@mui/material/MenuItem';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\nimport { useGridApiContext } from \"../../../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction GridColumnMenuFilterItem(props) {\n const {\n colDef,\n onClick\n } = props;\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const showFilter = React.useCallback(event => {\n onClick(event);\n apiRef.current.showFilterPanel(colDef.field);\n }, [apiRef, colDef.field, onClick]);\n if (rootProps.disableColumnFilter || !colDef.filterable) {\n return null;\n }\n return /*#__PURE__*/_jsxs(MenuItem, {\n onClick: showFilter,\n children: [/*#__PURE__*/_jsx(ListItemIcon, {\n children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuFilterIcon, {\n fontSize: \"small\"\n })\n }), /*#__PURE__*/_jsx(ListItemText, {\n children: apiRef.current.getLocaleText('columnMenuFilter')\n })]\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GridColumnMenuFilterItem.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n colDef: PropTypes.object.isRequired,\n onClick: PropTypes.func.isRequired\n} : void 0;\nexport { GridColumnMenuFilterItem };","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport MenuItem from '@mui/material/MenuItem';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\nimport { useGridSelector } from \"../../../../hooks/utils/useGridSelector.js\";\nimport { gridSortModelSelector } from \"../../../../hooks/features/sorting/gridSortingSelector.js\";\nimport { useGridApiContext } from \"../../../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction GridColumnMenuSortItem(props) {\n const {\n colDef,\n onClick\n } = props;\n const apiRef = useGridApiContext();\n const sortModel = useGridSelector(apiRef, gridSortModelSelector);\n const rootProps = useGridRootProps();\n const sortDirection = React.useMemo(() => {\n if (!colDef) {\n return null;\n }\n const sortItem = sortModel.find(item => item.field === colDef.field);\n return sortItem?.sort;\n }, [colDef, sortModel]);\n const sortingOrder = colDef.sortingOrder ?? rootProps.sortingOrder;\n const onSortMenuItemClick = React.useCallback(event => {\n onClick(event);\n const direction = event.currentTarget.getAttribute('data-value') || null;\n apiRef.current.sortColumn(colDef.field, direction === sortDirection ? null : direction);\n }, [apiRef, colDef, onClick, sortDirection]);\n if (rootProps.disableColumnSorting || !colDef || !colDef.sortable || !sortingOrder.some(item => !!item)) {\n return null;\n }\n const getLabel = key => {\n const label = apiRef.current.getLocaleText(key);\n return typeof label === 'function' ? label(colDef) : label;\n };\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [sortingOrder.includes('asc') && sortDirection !== 'asc' ? /*#__PURE__*/_jsxs(MenuItem, {\n onClick: onSortMenuItemClick,\n \"data-value\": \"asc\",\n children: [/*#__PURE__*/_jsx(ListItemIcon, {\n children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuSortAscendingIcon, {\n fontSize: \"small\"\n })\n }), /*#__PURE__*/_jsx(ListItemText, {\n children: getLabel('columnMenuSortAsc')\n })]\n }) : null, sortingOrder.includes('desc') && sortDirection !== 'desc' ? /*#__PURE__*/_jsxs(MenuItem, {\n onClick: onSortMenuItemClick,\n \"data-value\": \"desc\",\n children: [/*#__PURE__*/_jsx(ListItemIcon, {\n children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuSortDescendingIcon, {\n fontSize: \"small\"\n })\n }), /*#__PURE__*/_jsx(ListItemText, {\n children: getLabel('columnMenuSortDesc')\n })]\n }) : null, sortingOrder.includes(null) && sortDirection != null ? /*#__PURE__*/_jsxs(MenuItem, {\n onClick: onSortMenuItemClick,\n children: [/*#__PURE__*/_jsx(ListItemIcon, {}), /*#__PURE__*/_jsx(ListItemText, {\n children: apiRef.current.getLocaleText('columnMenuUnsort')\n })]\n }) : null]\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GridColumnMenuSortItem.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n colDef: PropTypes.object.isRequired,\n onClick: PropTypes.func.isRequired\n} : void 0;\nexport { GridColumnMenuSortItem };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"defaultSlots\", \"defaultSlotProps\", \"slots\", \"slotProps\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGridColumnMenuSlots } from \"../../../hooks/features/columnMenu/useGridColumnMenuSlots.js\";\nimport { GridColumnMenuContainer } from \"./GridColumnMenuContainer.js\";\nimport { GridColumnMenuColumnsItem } from \"./menuItems/GridColumnMenuColumnsItem.js\";\nimport { GridColumnMenuFilterItem } from \"./menuItems/GridColumnMenuFilterItem.js\";\nimport { GridColumnMenuSortItem } from \"./menuItems/GridColumnMenuSortItem.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const GRID_COLUMN_MENU_SLOTS = {\n columnMenuSortItem: GridColumnMenuSortItem,\n columnMenuFilterItem: GridColumnMenuFilterItem,\n columnMenuColumnsItem: GridColumnMenuColumnsItem\n};\nexport const GRID_COLUMN_MENU_SLOT_PROPS = {\n columnMenuSortItem: {\n displayOrder: 10\n },\n columnMenuFilterItem: {\n displayOrder: 20\n },\n columnMenuColumnsItem: {\n displayOrder: 30\n }\n};\nconst GridGenericColumnMenu = /*#__PURE__*/React.forwardRef(function GridGenericColumnMenu(props, ref) {\n const {\n defaultSlots,\n defaultSlotProps,\n slots,\n slotProps\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const orderedSlots = useGridColumnMenuSlots(_extends({}, other, {\n defaultSlots,\n defaultSlotProps,\n slots,\n slotProps\n }));\n return /*#__PURE__*/_jsx(GridColumnMenuContainer, _extends({\n ref: ref\n }, other, {\n children: orderedSlots.map(([Component, otherProps], index) => /*#__PURE__*/_jsx(Component, _extends({}, otherProps), index))\n }));\n});\nconst GridColumnMenu = /*#__PURE__*/React.forwardRef(function GridColumnMenu(props, ref) {\n return /*#__PURE__*/_jsx(GridGenericColumnMenu, _extends({}, props, {\n ref: ref,\n defaultSlots: GRID_COLUMN_MENU_SLOTS,\n defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridColumnMenu.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n colDef: PropTypes.object.isRequired,\n hideMenu: PropTypes.func.isRequired,\n id: PropTypes.string,\n labelledby: PropTypes.string,\n open: PropTypes.bool.isRequired,\n /**\n * Could be used to pass new props or override props specific to a column menu component\n * e.g. `displayOrder`\n */\n slotProps: PropTypes.object,\n /**\n * `slots` could be used to add new and (or) override default column menu items\n * If you register a nee component you must pass it's `displayOrder` in `slotProps`\n * or it will be placed in the end of the list\n */\n slots: PropTypes.object\n} : void 0;\nexport { GridColumnMenu, GridGenericColumnMenu };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"slotProps\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport FocusTrap from '@mui/material/Unstable_TrapFocus';\nimport { styled } from '@mui/material/styles';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['panelWrapper']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridPanelWrapperRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'PanelWrapper',\n overridesResolver: (props, styles) => styles.panelWrapper\n})({\n display: 'flex',\n flexDirection: 'column',\n flex: 1,\n '&:focus': {\n outline: 0\n }\n});\nconst isEnabled = () => true;\nconst GridPanelWrapper = /*#__PURE__*/React.forwardRef(function GridPanelWrapper(props, ref) {\n const {\n className,\n slotProps = {}\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n return /*#__PURE__*/_jsx(FocusTrap, _extends({\n open: true,\n disableEnforceFocus: true,\n isEnabled: isEnabled\n }, slotProps.TrapFocus, {\n children: /*#__PURE__*/_jsx(GridPanelWrapperRoot, _extends({\n ref: ref,\n tabIndex: -1,\n className: clsx(className, classes.root),\n ownerState: rootProps\n }, other))\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridPanelWrapper.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n slotProps: PropTypes.object\n} : void 0;\nexport { GridPanelWrapper };","export const checkColumnVisibilityModelsSame = (a, b) => {\n // Filter `false` values only, as `true` and not having a key are the same\n const aFalseValues = new Set(Object.keys(a).filter(key => a[key] === false));\n const bFalseValues = new Set(Object.keys(b).filter(key => b[key] === false));\n if (aFalseValues.size !== bFalseValues.size) {\n return false;\n }\n let result = true;\n aFalseValues.forEach(key => {\n if (!bFalseValues.has(key)) {\n result = false;\n }\n });\n return result;\n};\nexport const defaultSearchPredicate = (column, searchValue) => (column.headerName || column.field).toLowerCase().indexOf(searchValue) > -1;","import _extends from \"@babel/runtime/helpers/esm/extends\";\n/* eslint-disable @typescript-eslint/no-use-before-define */\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport composeClasses from '@mui/utils/composeClasses';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport { styled } from '@mui/material/styles';\nimport { gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector } from \"../../hooks/features/columns/gridColumnsSelector.js\";\nimport { useGridSelector } from \"../../hooks/utils/useGridSelector.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useLazyRef } from \"../../hooks/utils/useLazyRef.js\";\nimport { checkColumnVisibilityModelsSame, defaultSearchPredicate } from \"./utils.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['columnsManagement'],\n header: ['columnsManagementHeader'],\n footer: ['columnsManagementFooter'],\n row: ['columnsManagementRow']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst collator = new Intl.Collator();\nfunction GridColumnsManagement(props) {\n const apiRef = useGridApiContext();\n const searchInputRef = React.useRef(null);\n const columns = useGridSelector(apiRef, gridColumnDefinitionsSelector);\n const initialColumnVisibilityModel = useLazyRef(() => gridColumnVisibilityModelSelector(apiRef)).current;\n const columnVisibilityModel = useGridSelector(apiRef, gridColumnVisibilityModelSelector);\n const rootProps = useGridRootProps();\n const [searchValue, setSearchValue] = React.useState('');\n const classes = useUtilityClasses(rootProps);\n const {\n sort,\n searchPredicate = defaultSearchPredicate,\n autoFocusSearchField = true,\n disableShowHideToggle = false,\n disableResetButton = false,\n toggleAllMode = 'all',\n getTogglableColumns\n } = props;\n const isResetDisabled = React.useMemo(() => checkColumnVisibilityModelsSame(columnVisibilityModel, initialColumnVisibilityModel), [columnVisibilityModel, initialColumnVisibilityModel]);\n const sortedColumns = React.useMemo(() => {\n switch (sort) {\n case 'asc':\n return [...columns].sort((a, b) => collator.compare(a.headerName || a.field, b.headerName || b.field));\n case 'desc':\n return [...columns].sort((a, b) => -collator.compare(a.headerName || a.field, b.headerName || b.field));\n default:\n return columns;\n }\n }, [columns, sort]);\n const toggleColumn = event => {\n const {\n name: field\n } = event.target;\n apiRef.current.setColumnVisibility(field, columnVisibilityModel[field] === false);\n };\n const currentColumns = React.useMemo(() => {\n const togglableColumns = getTogglableColumns ? getTogglableColumns(sortedColumns) : null;\n const togglableSortedColumns = togglableColumns ? sortedColumns.filter(({\n field\n }) => togglableColumns.includes(field)) : sortedColumns;\n if (!searchValue) {\n return togglableSortedColumns;\n }\n return togglableSortedColumns.filter(column => searchPredicate(column, searchValue.toLowerCase()));\n }, [sortedColumns, searchValue, searchPredicate, getTogglableColumns]);\n const toggleAllColumns = React.useCallback(isVisible => {\n const currentModel = gridColumnVisibilityModelSelector(apiRef);\n const newModel = _extends({}, currentModel);\n const togglableColumns = getTogglableColumns ? getTogglableColumns(columns) : null;\n (toggleAllMode === 'filteredOnly' ? currentColumns : columns).forEach(col => {\n if (col.hideable && (togglableColumns == null || togglableColumns.includes(col.field))) {\n if (isVisible) {\n // delete the key from the model instead of setting it to `true`\n delete newModel[col.field];\n } else {\n newModel[col.field] = false;\n }\n }\n });\n return apiRef.current.setColumnVisibilityModel(newModel);\n }, [apiRef, columns, getTogglableColumns, toggleAllMode, currentColumns]);\n const handleSearchValueChange = React.useCallback(event => {\n setSearchValue(event.target.value);\n }, []);\n const hideableColumns = React.useMemo(() => currentColumns.filter(col => col.hideable), [currentColumns]);\n const allHideableColumnsVisible = React.useMemo(() => hideableColumns.every(column => columnVisibilityModel[column.field] == null || columnVisibilityModel[column.field] !== false), [columnVisibilityModel, hideableColumns]);\n const allHideableColumnsHidden = React.useMemo(() => hideableColumns.every(column => columnVisibilityModel[column.field] === false), [columnVisibilityModel, hideableColumns]);\n const firstSwitchRef = React.useRef(null);\n React.useEffect(() => {\n if (autoFocusSearchField) {\n searchInputRef.current.focus();\n } else if (firstSwitchRef.current && typeof firstSwitchRef.current.focus === 'function') {\n firstSwitchRef.current.focus();\n }\n }, [autoFocusSearchField]);\n let firstHideableColumnFound = false;\n const isFirstHideableColumn = column => {\n if (firstHideableColumnFound === false && column.hideable !== false) {\n firstHideableColumnFound = true;\n return true;\n }\n return false;\n };\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(GridColumnsManagementHeader, {\n className: classes.header,\n ownerState: rootProps,\n children: /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({\n placeholder: apiRef.current.getLocaleText('columnsManagementSearchTitle'),\n inputRef: searchInputRef,\n value: searchValue,\n onChange: handleSearchValueChange,\n variant: \"outlined\",\n size: \"small\",\n InputProps: {\n startAdornment: /*#__PURE__*/_jsx(rootProps.slots.baseInputAdornment, {\n position: \"start\",\n children: /*#__PURE__*/_jsx(rootProps.slots.quickFilterIcon, {})\n }),\n sx: {\n pl: 1.5\n }\n },\n fullWidth: true\n }, rootProps.slotProps?.baseTextField))\n }), /*#__PURE__*/_jsxs(GridColumnsManagementBody, {\n className: classes.root,\n ownerState: rootProps,\n children: [currentColumns.map(column => /*#__PURE__*/_jsx(FormControlLabel, {\n className: classes.row,\n control: /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({\n disabled: column.hideable === false,\n checked: columnVisibilityModel[column.field] !== false,\n onClick: toggleColumn,\n name: column.field,\n sx: {\n p: 0.5\n },\n inputRef: isFirstHideableColumn(column) ? firstSwitchRef : undefined\n }, rootProps.slotProps?.baseCheckbox)),\n label: column.headerName || column.field\n }, column.field)), currentColumns.length === 0 && /*#__PURE__*/_jsx(GridColumnsManagementEmptyText, {\n ownerState: rootProps,\n children: apiRef.current.getLocaleText('columnsManagementNoColumns')\n })]\n }), (!disableShowHideToggle || !disableResetButton) && currentColumns.length > 0 ? /*#__PURE__*/_jsxs(GridColumnsManagementFooter, {\n ownerState: rootProps,\n className: classes.footer,\n children: [!disableShowHideToggle ? /*#__PURE__*/_jsx(FormControlLabel, {\n control: /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({\n disabled: hideableColumns.length === 0,\n checked: allHideableColumnsVisible,\n indeterminate: !allHideableColumnsVisible && !allHideableColumnsHidden,\n onClick: () => toggleAllColumns(!allHideableColumnsVisible),\n name: apiRef.current.getLocaleText('columnsManagementShowHideAllText'),\n sx: {\n p: 0.5\n }\n }, rootProps.slotProps?.baseCheckbox)),\n label: apiRef.current.getLocaleText('columnsManagementShowHideAllText')\n }) : /*#__PURE__*/_jsx(\"span\", {}), !disableResetButton ? /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({\n onClick: () => apiRef.current.setColumnVisibilityModel(initialColumnVisibilityModel),\n disabled: isResetDisabled\n }, rootProps.slotProps?.baseButton, {\n children: apiRef.current.getLocaleText('columnsManagementReset')\n })) : null]\n }) : null]\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GridColumnsManagement.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * If `true`, the column search field will be focused automatically.\n * If `false`, the first column switch input will be focused automatically.\n * This helps to avoid input keyboard panel to popup automatically on touch devices.\n * @default true\n */\n autoFocusSearchField: PropTypes.bool,\n /**\n * If `true`, the `Reset` button will not be disabled\n * @default false\n */\n disableResetButton: PropTypes.bool,\n /**\n * If `true`, the `Show/Hide all` toggle checkbox will not be displayed.\n * @default false\n */\n disableShowHideToggle: PropTypes.bool,\n /**\n * Returns the list of togglable columns.\n * If used, only those columns will be displayed in the panel\n * which are passed as the return value of the function.\n * @param {GridColDef[]} columns The `ColDef` list of all columns.\n * @returns {GridColDef['field'][]} The list of togglable columns' field names.\n */\n getTogglableColumns: PropTypes.func,\n searchPredicate: PropTypes.func,\n sort: PropTypes.oneOf(['asc', 'desc']),\n /**\n * Changes the behavior of the `Show/Hide All` toggle when the search field is used:\n * - `all`: Will toggle all columns.\n * - `filteredOnly`: Will only toggle columns that match the search criteria.\n * @default 'all'\n */\n toggleAllMode: PropTypes.oneOf(['all', 'filteredOnly'])\n} : void 0;\nconst GridColumnsManagementBody = styled('div', {\n name: 'MuiDataGrid',\n slot: 'ColumnsManagement',\n overridesResolver: (props, styles) => styles.columnsManagement\n})(({\n theme\n}) => ({\n padding: theme.spacing(0, 3, 1.5),\n display: 'flex',\n flexDirection: 'column',\n overflow: 'auto',\n flex: '1 1',\n maxHeight: 400,\n alignItems: 'flex-start'\n}));\nconst GridColumnsManagementHeader = styled('div', {\n name: 'MuiDataGrid',\n slot: 'ColumnsManagementHeader',\n overridesResolver: (props, styles) => styles.columnsManagementHeader\n})(({\n theme\n}) => ({\n padding: theme.spacing(1.5, 3)\n}));\nconst GridColumnsManagementFooter = styled('div', {\n name: 'MuiDataGrid',\n slot: 'ColumnsManagementFooter',\n overridesResolver: (props, styles) => styles.columnsManagementFooter\n})(({\n theme\n}) => ({\n padding: theme.spacing(0.5, 1, 0.5, 3),\n display: 'flex',\n justifyContent: 'space-between',\n borderTop: `1px solid ${theme.palette.divider}`\n}));\nconst GridColumnsManagementEmptyText = styled('div')(({\n theme\n}) => ({\n padding: theme.spacing(0.5, 0),\n color: theme.palette.grey[500]\n}));\nexport { GridColumnsManagement };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { GridPanelWrapper } from \"./GridPanelWrapper.js\";\nimport { GridColumnsManagement } from \"../columnsManagement/index.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction GridColumnsPanel(props) {\n const rootProps = useGridRootProps();\n return /*#__PURE__*/_jsx(GridPanelWrapper, _extends({}, props, {\n children: /*#__PURE__*/_jsx(GridColumnsManagement, _extends({}, rootProps.slotProps?.columnsManagement))\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridColumnsPanel.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n slotProps: PropTypes.object\n} : void 0;\nexport { GridColumnsPanel };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"className\", \"classes\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { styled } from '@mui/material/styles';\nimport { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport ClickAwayListener from '@mui/material/ClickAwayListener';\nimport Paper from '@mui/material/Paper';\nimport Popper from '@mui/material/Popper';\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const gridPanelClasses = generateUtilityClasses('MuiDataGrid', ['panel', 'paper']);\nconst GridPanelRoot = styled(Popper, {\n name: 'MuiDataGrid',\n slot: 'Panel',\n overridesResolver: (props, styles) => styles.panel\n})(({\n theme\n}) => ({\n zIndex: theme.zIndex.modal\n}));\nconst GridPaperRoot = styled(Paper, {\n name: 'MuiDataGrid',\n slot: 'Paper',\n overridesResolver: (props, styles) => styles.paper\n})(({\n theme\n}) => ({\n backgroundColor: (theme.vars || theme).palette.background.paper,\n minWidth: 300,\n maxHeight: 450,\n display: 'flex',\n maxWidth: `calc(100vw - ${theme.spacing(0.5)})`,\n overflow: 'auto'\n}));\nconst GridPanel = /*#__PURE__*/React.forwardRef((props, ref) => {\n const {\n children,\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const classes = gridPanelClasses;\n const [isPlaced, setIsPlaced] = React.useState(false);\n const handleClickAway = React.useCallback(() => {\n apiRef.current.hidePreferences();\n }, [apiRef]);\n const handleKeyDown = React.useCallback(event => {\n if (event.key === 'Escape') {\n apiRef.current.hidePreferences();\n }\n }, [apiRef]);\n const modifiers = React.useMemo(() => [{\n name: 'flip',\n enabled: true,\n options: {\n rootBoundary: 'document'\n }\n }, {\n name: 'isPlaced',\n enabled: true,\n phase: 'main',\n fn: () => {\n setIsPlaced(true);\n },\n effect: () => () => {\n setIsPlaced(false);\n }\n }], []);\n const [anchorEl, setAnchorEl] = React.useState(null);\n React.useEffect(() => {\n const panelAnchor = apiRef.current.rootElementRef?.current?.querySelector('[data-id=\"gridPanelAnchor\"]');\n if (panelAnchor) {\n setAnchorEl(panelAnchor);\n }\n }, [apiRef]);\n if (!anchorEl) {\n return null;\n }\n return /*#__PURE__*/_jsx(GridPanelRoot, _extends({\n ref: ref,\n placement: \"bottom-start\",\n className: clsx(className, classes.panel),\n ownerState: rootProps,\n anchorEl: anchorEl,\n modifiers: modifiers\n }, other, {\n children: /*#__PURE__*/_jsx(ClickAwayListener, {\n mouseEvent: \"onMouseUp\",\n onClickAway: handleClickAway,\n children: /*#__PURE__*/_jsx(GridPaperRoot, {\n className: classes.paper,\n ownerState: rootProps,\n elevation: 8,\n onKeyDown: handleKeyDown,\n children: isPlaced && children\n })\n })\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridPanel.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Popper render function or node.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * If `true`, the component is shown.\n */\n open: PropTypes.bool.isRequired,\n ownerState: PropTypes.object\n} : void 0;\nexport { GridPanel };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { styled } from '@mui/system';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['panelContent']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridPanelContentRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'PanelContent',\n overridesResolver: (props, styles) => styles.panelContent\n})({\n display: 'flex',\n flexDirection: 'column',\n overflow: 'auto',\n flex: '1 1',\n maxHeight: 400\n});\nfunction GridPanelContent(props) {\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n return /*#__PURE__*/_jsx(GridPanelContentRoot, _extends({\n className: clsx(className, classes.root),\n ownerState: rootProps\n }, other));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridPanelContent.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { GridPanelContent };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { styled } from '@mui/system';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['panelFooter']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridPanelFooterRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'PanelFooter',\n overridesResolver: (props, styles) => styles.panelFooter\n})(({\n theme\n}) => ({\n padding: theme.spacing(0.5),\n display: 'flex',\n justifyContent: 'space-between'\n}));\nfunction GridPanelFooter(props) {\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n return /*#__PURE__*/_jsx(GridPanelFooterRoot, _extends({\n className: clsx(className, classes.root),\n ownerState: rootProps\n }, other));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridPanelFooter.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { GridPanelFooter };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { styled } from '@mui/system';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['panelHeader']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridPanelHeaderRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'PanelHeader',\n overridesResolver: (props, styles) => styles.panelHeader\n})(({\n theme\n}) => ({\n padding: theme.spacing(1)\n}));\nfunction GridPanelHeader(props) {\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n return /*#__PURE__*/_jsx(GridPanelHeaderRoot, _extends({\n className: clsx(className, classes.root),\n ownerState: rootProps\n }, other));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridPanelHeader.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { GridPanelHeader };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"item\", \"hasMultipleFilters\", \"deleteFilter\", \"applyFilterChanges\", \"showMultiFilterOperators\", \"disableMultiFilterOperator\", \"applyMultiFilterOperatorChanges\", \"focusElementRef\", \"logicOperators\", \"columnsSort\", \"filterColumns\", \"deleteIconProps\", \"logicOperatorInputProps\", \"operatorInputProps\", \"columnInputProps\", \"valueInputProps\", \"readOnly\", \"children\"],\n _excluded2 = [\"InputComponentProps\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_composeClasses as composeClasses, unstable_useId as useId, unstable_capitalize as capitalize } from '@mui/utils';\nimport { styled } from '@mui/material/styles';\nimport clsx from 'clsx';\nimport { gridFilterableColumnDefinitionsSelector, gridColumnLookupSelector } from \"../../../hooks/features/columns/gridColumnsSelector.js\";\nimport { gridFilterModelSelector } from \"../../../hooks/features/filter/gridFilterSelector.js\";\nimport { useGridSelector } from \"../../../hooks/utils/useGridSelector.js\";\nimport { GridLogicOperator } from \"../../../models/gridFilterItem.js\";\nimport { useGridApiContext } from \"../../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../../hooks/utils/useGridRootProps.js\";\nimport { getDataGridUtilityClass } from \"../../../constants/gridClasses.js\";\nimport { getValueFromValueOptions, getValueOptions } from \"./filterPanelUtils.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { createElement as _createElement } from \"react\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['filterForm'],\n deleteIcon: ['filterFormDeleteIcon'],\n logicOperatorInput: ['filterFormLogicOperatorInput'],\n columnInput: ['filterFormColumnInput'],\n operatorInput: ['filterFormOperatorInput'],\n valueInput: ['filterFormValueInput']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridFilterFormRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'FilterForm',\n overridesResolver: (props, styles) => styles.filterForm\n})(({\n theme\n}) => ({\n display: 'flex',\n padding: theme.spacing(1)\n}));\nconst FilterFormDeleteIcon = styled('div', {\n name: 'MuiDataGrid',\n slot: 'FilterFormDeleteIcon',\n overridesResolver: (_, styles) => styles.filterFormDeleteIcon\n})(({\n theme\n}) => ({\n flexShrink: 0,\n justifyContent: 'flex-end',\n marginRight: theme.spacing(0.5),\n marginBottom: theme.spacing(0.2)\n}));\nconst FilterFormLogicOperatorInput = styled('div', {\n name: 'MuiDataGrid',\n slot: 'FilterFormLogicOperatorInput',\n overridesResolver: (_, styles) => styles.filterFormLogicOperatorInput\n})({\n minWidth: 55,\n marginRight: 5,\n justifyContent: 'end'\n});\nconst FilterFormColumnInput = styled('div', {\n name: 'MuiDataGrid',\n slot: 'FilterFormColumnInput',\n overridesResolver: (_, styles) => styles.filterFormColumnInput\n})({\n width: 150\n});\nconst FilterFormOperatorInput = styled('div', {\n name: 'MuiDataGrid',\n slot: 'FilterFormOperatorInput',\n overridesResolver: (_, styles) => styles.filterFormOperatorInput\n})({\n width: 150\n});\nconst FilterFormValueInput = styled('div', {\n name: 'MuiDataGrid',\n slot: 'FilterFormValueInput',\n overridesResolver: (_, styles) => styles.filterFormValueInput\n})({\n width: 190\n});\nconst getLogicOperatorLocaleKey = logicOperator => {\n switch (logicOperator) {\n case GridLogicOperator.And:\n return 'filterPanelOperatorAnd';\n case GridLogicOperator.Or:\n return 'filterPanelOperatorOr';\n default:\n throw new Error('MUI X: Invalid `logicOperator` property in the `GridFilterPanel`.');\n }\n};\nconst getColumnLabel = col => col.headerName || col.field;\nconst collator = new Intl.Collator();\nconst GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props, ref) {\n const {\n item,\n hasMultipleFilters,\n deleteFilter,\n applyFilterChanges,\n showMultiFilterOperators,\n disableMultiFilterOperator,\n applyMultiFilterOperatorChanges,\n focusElementRef,\n logicOperators = [GridLogicOperator.And, GridLogicOperator.Or],\n columnsSort,\n filterColumns,\n deleteIconProps = {},\n logicOperatorInputProps = {},\n operatorInputProps = {},\n columnInputProps = {},\n valueInputProps = {},\n readOnly\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const columnLookup = useGridSelector(apiRef, gridColumnLookupSelector);\n const filterableColumns = useGridSelector(apiRef, gridFilterableColumnDefinitionsSelector);\n const filterModel = useGridSelector(apiRef, gridFilterModelSelector);\n const columnSelectId = useId();\n const columnSelectLabelId = useId();\n const operatorSelectId = useId();\n const operatorSelectLabelId = useId();\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n const valueRef = React.useRef(null);\n const filterSelectorRef = React.useRef(null);\n const multiFilterOperator = filterModel.logicOperator ?? GridLogicOperator.And;\n const hasLogicOperatorColumn = hasMultipleFilters && logicOperators.length > 0;\n const baseFormControlProps = rootProps.slotProps?.baseFormControl || {};\n const baseSelectProps = rootProps.slotProps?.baseSelect || {};\n const isBaseSelectNative = baseSelectProps.native ?? false;\n const baseInputLabelProps = rootProps.slotProps?.baseInputLabel || {};\n const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};\n const {\n InputComponentProps\n } = valueInputProps,\n valueInputPropsOther = _objectWithoutPropertiesLoose(valueInputProps, _excluded2);\n const {\n filteredColumns,\n selectedField\n } = React.useMemo(() => {\n let itemField = item.field;\n\n // Yields a valid value if the current filter belongs to a column that is not filterable\n const selectedNonFilterableColumn = columnLookup[item.field].filterable === false ? columnLookup[item.field] : null;\n if (selectedNonFilterableColumn) {\n return {\n filteredColumns: [selectedNonFilterableColumn],\n selectedField: itemField\n };\n }\n if (filterColumns === undefined || typeof filterColumns !== 'function') {\n return {\n filteredColumns: filterableColumns,\n selectedField: itemField\n };\n }\n const filteredFields = filterColumns({\n field: item.field,\n columns: filterableColumns,\n currentFilters: filterModel?.items || []\n });\n return {\n filteredColumns: filterableColumns.filter(column => {\n const isFieldIncluded = filteredFields.includes(column.field);\n if (column.field === item.field && !isFieldIncluded) {\n itemField = undefined;\n }\n return isFieldIncluded;\n }),\n selectedField: itemField\n };\n }, [filterColumns, filterModel?.items, filterableColumns, item.field, columnLookup]);\n const sortedFilteredColumns = React.useMemo(() => {\n switch (columnsSort) {\n case 'asc':\n return filteredColumns.sort((a, b) => collator.compare(getColumnLabel(a), getColumnLabel(b)));\n case 'desc':\n return filteredColumns.sort((a, b) => -collator.compare(getColumnLabel(a), getColumnLabel(b)));\n default:\n return filteredColumns;\n }\n }, [filteredColumns, columnsSort]);\n const currentColumn = item.field ? apiRef.current.getColumn(item.field) : null;\n const currentOperator = React.useMemo(() => {\n if (!item.operator || !currentColumn) {\n return null;\n }\n return currentColumn.filterOperators?.find(operator => operator.value === item.operator);\n }, [item, currentColumn]);\n const changeColumn = React.useCallback(event => {\n const field = event.target.value;\n const column = apiRef.current.getColumn(field);\n if (column.field === currentColumn.field) {\n // column did not change\n return;\n }\n\n // try to keep the same operator when column change\n const newOperator = column.filterOperators.find(operator => operator.value === item.operator) || column.filterOperators[0];\n\n // Erase filter value if the input component or filtered column type is modified\n const eraseFilterValue = !newOperator.InputComponent || newOperator.InputComponent !== currentOperator?.InputComponent || column.type !== currentColumn.type;\n let filterValue = eraseFilterValue ? undefined : item.value;\n\n // Check filter value against the new valueOptions\n if (column.type === 'singleSelect' && filterValue !== undefined) {\n const colDef = column;\n const valueOptions = getValueOptions(colDef);\n if (Array.isArray(filterValue)) {\n filterValue = filterValue.filter(val => {\n return (\n // Only keep values that are in the new value options\n getValueFromValueOptions(val, valueOptions, colDef?.getOptionValue) !== undefined\n );\n });\n } else if (getValueFromValueOptions(item.value, valueOptions, colDef?.getOptionValue) === undefined) {\n // Reset the filter value if it is not in the new value options\n filterValue = undefined;\n }\n }\n applyFilterChanges(_extends({}, item, {\n field,\n operator: newOperator.value,\n value: filterValue\n }));\n }, [apiRef, applyFilterChanges, item, currentColumn, currentOperator]);\n const changeOperator = React.useCallback(event => {\n const operator = event.target.value;\n const newOperator = currentColumn?.filterOperators.find(op => op.value === operator);\n const eraseItemValue = !newOperator?.InputComponent || newOperator?.InputComponent !== currentOperator?.InputComponent;\n applyFilterChanges(_extends({}, item, {\n operator,\n value: eraseItemValue ? undefined : item.value\n }));\n }, [applyFilterChanges, item, currentColumn, currentOperator]);\n const changeLogicOperator = React.useCallback(event => {\n const logicOperator = event.target.value === GridLogicOperator.And.toString() ? GridLogicOperator.And : GridLogicOperator.Or;\n applyMultiFilterOperatorChanges(logicOperator);\n }, [applyMultiFilterOperatorChanges]);\n const handleDeleteFilter = () => {\n deleteFilter(item);\n };\n React.useImperativeHandle(focusElementRef, () => ({\n focus: () => {\n if (currentOperator?.InputComponent) {\n valueRef?.current?.focus();\n } else {\n filterSelectorRef.current.focus();\n }\n }\n }), [currentOperator]);\n return /*#__PURE__*/_jsxs(GridFilterFormRoot, _extends({\n ref: ref,\n className: classes.root,\n \"data-id\": item.id,\n ownerState: rootProps\n }, other, {\n children: [/*#__PURE__*/_jsx(FilterFormDeleteIcon, _extends({\n variant: \"standard\",\n as: rootProps.slots.baseFormControl\n }, baseFormControlProps, deleteIconProps, {\n className: clsx(classes.deleteIcon, baseFormControlProps.className, deleteIconProps.className),\n ownerState: rootProps,\n children: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({\n \"aria-label\": apiRef.current.getLocaleText('filterPanelDeleteIconLabel'),\n title: apiRef.current.getLocaleText('filterPanelDeleteIconLabel'),\n onClick: handleDeleteFilter,\n size: \"small\",\n disabled: readOnly\n }, rootProps.slotProps?.baseIconButton, {\n children: /*#__PURE__*/_jsx(rootProps.slots.filterPanelDeleteIcon, {\n fontSize: \"small\"\n })\n }))\n })), /*#__PURE__*/_jsx(FilterFormLogicOperatorInput, _extends({\n variant: \"standard\",\n as: rootProps.slots.baseFormControl\n }, baseFormControlProps, logicOperatorInputProps, {\n sx: [hasLogicOperatorColumn ? {\n display: 'flex'\n } : {\n display: 'none'\n }, showMultiFilterOperators ? {\n visibility: 'visible'\n } : {\n visibility: 'hidden'\n }, baseFormControlProps.sx, logicOperatorInputProps.sx],\n className: clsx(classes.logicOperatorInput, baseFormControlProps.className, logicOperatorInputProps.className),\n ownerState: rootProps,\n children: /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({\n inputProps: {\n 'aria-label': apiRef.current.getLocaleText('filterPanelLogicOperator')\n },\n value: multiFilterOperator ?? '',\n onChange: changeLogicOperator,\n disabled: !!disableMultiFilterOperator || logicOperators.length === 1,\n native: isBaseSelectNative\n }, rootProps.slotProps?.baseSelect, {\n children: logicOperators.map(logicOperator => /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {\n native: isBaseSelectNative,\n key: logicOperator.toString(),\n value: logicOperator.toString()\n }), apiRef.current.getLocaleText(getLogicOperatorLocaleKey(logicOperator))))\n }))\n })), /*#__PURE__*/_jsxs(FilterFormColumnInput, _extends({\n variant: \"standard\",\n as: rootProps.slots.baseFormControl\n }, baseFormControlProps, columnInputProps, {\n className: clsx(classes.columnInput, baseFormControlProps.className, columnInputProps.className),\n ownerState: rootProps,\n children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, baseInputLabelProps, {\n htmlFor: columnSelectId,\n id: columnSelectLabelId,\n children: apiRef.current.getLocaleText('filterPanelColumns')\n })), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({\n labelId: columnSelectLabelId,\n id: columnSelectId,\n label: apiRef.current.getLocaleText('filterPanelColumns'),\n value: selectedField ?? '',\n onChange: changeColumn,\n native: isBaseSelectNative,\n disabled: readOnly\n }, rootProps.slotProps?.baseSelect, {\n children: sortedFilteredColumns.map(col => /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {\n native: isBaseSelectNative,\n key: col.field,\n value: col.field\n }), getColumnLabel(col)))\n }))]\n })), /*#__PURE__*/_jsxs(FilterFormOperatorInput, _extends({\n variant: \"standard\",\n as: rootProps.slots.baseFormControl\n }, baseFormControlProps, operatorInputProps, {\n className: clsx(classes.operatorInput, baseFormControlProps.className, operatorInputProps.className),\n ownerState: rootProps,\n children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, baseInputLabelProps, {\n htmlFor: operatorSelectId,\n id: operatorSelectLabelId,\n children: apiRef.current.getLocaleText('filterPanelOperator')\n })), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({\n labelId: operatorSelectLabelId,\n label: apiRef.current.getLocaleText('filterPanelOperator'),\n id: operatorSelectId,\n value: item.operator,\n onChange: changeOperator,\n native: isBaseSelectNative,\n inputRef: filterSelectorRef,\n disabled: readOnly\n }, rootProps.slotProps?.baseSelect, {\n children: currentColumn?.filterOperators?.map(operator => /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {\n native: isBaseSelectNative,\n key: operator.value,\n value: operator.value\n }), operator.label || apiRef.current.getLocaleText(`filterOperator${capitalize(operator.value)}`)))\n }))]\n })), /*#__PURE__*/_jsx(FilterFormValueInput, _extends({\n variant: \"standard\",\n as: rootProps.slots.baseFormControl\n }, baseFormControlProps, valueInputPropsOther, {\n className: clsx(classes.valueInput, baseFormControlProps.className, valueInputPropsOther.className),\n ownerState: rootProps,\n children: currentOperator?.InputComponent ? /*#__PURE__*/_jsx(currentOperator.InputComponent, _extends({\n apiRef: apiRef,\n item: item,\n applyValue: applyFilterChanges,\n focusElementRef: valueRef,\n disabled: readOnly\n }, currentOperator.InputComponentProps, InputComponentProps), item.field) : null\n }))]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridFilterForm.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Callback called when the operator, column field or value is changed.\n * @param {GridFilterItem} item The updated [[GridFilterItem]].\n */\n applyFilterChanges: PropTypes.func.isRequired,\n /**\n * Callback called when the logic operator is changed.\n * @param {GridLogicOperator} operator The new logic operator.\n */\n applyMultiFilterOperatorChanges: PropTypes.func.isRequired,\n /**\n * @ignore - do not document.\n */\n children: PropTypes.node,\n /**\n * Props passed to the column input component.\n * @default {}\n */\n columnInputProps: PropTypes.any,\n /**\n * Changes how the options in the columns selector should be ordered.\n * If not specified, the order is derived from the `columns` prop.\n */\n columnsSort: PropTypes.oneOf(['asc', 'desc']),\n /**\n * Callback called when the delete button is clicked.\n * @param {GridFilterItem} item The deleted [[GridFilterItem]].\n */\n deleteFilter: PropTypes.func.isRequired,\n /**\n * Props passed to the delete icon.\n * @default {}\n */\n deleteIconProps: PropTypes.any,\n /**\n * If `true`, disables the logic operator field but still renders it.\n */\n disableMultiFilterOperator: PropTypes.bool,\n /**\n * Allows to filter the columns displayed in the filter form.\n * @param {FilterColumnsArgs} args The columns of the grid and name of field.\n * @returns {GridColDef['field'][]} The filtered fields array.\n */\n filterColumns: PropTypes.func,\n /**\n * A ref allowing to set imperative focus.\n * It can be passed to the el\n */\n focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),\n /**\n * If `true`, the logic operator field is rendered.\n * The field will be invisible if `showMultiFilterOperators` is also `true`.\n */\n hasMultipleFilters: PropTypes.bool.isRequired,\n /**\n * The [[GridFilterItem]] representing this form.\n */\n item: PropTypes.shape({\n field: PropTypes.string.isRequired,\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n operator: PropTypes.string.isRequired,\n value: PropTypes.any\n }).isRequired,\n /**\n * Props passed to the logic operator input component.\n * @default {}\n */\n logicOperatorInputProps: PropTypes.any,\n /**\n * Sets the available logic operators.\n * @default [GridLogicOperator.And, GridLogicOperator.Or]\n */\n logicOperators: PropTypes.arrayOf(PropTypes.oneOf(['and', 'or']).isRequired),\n /**\n * Props passed to the operator input component.\n * @default {}\n */\n operatorInputProps: PropTypes.any,\n /**\n * `true` if the filter is disabled/read only.\n * i.e. `colDef.fiterable = false` but passed in `filterModel`\n * @default false\n */\n readOnly: PropTypes.bool,\n /**\n * If `true`, the logic operator field is visible.\n */\n showMultiFilterOperators: PropTypes.bool,\n /**\n * Props passed to the value input component.\n * @default {}\n */\n valueInputProps: PropTypes.any\n} : void 0;\n\n/**\n * Demos:\n * - [Filtering - overview](https://mui.com/x/react-data-grid/filtering/)\n *\n * API:\n * - [GridFilterForm API](https://mui.com/x/api/data-grid/grid-filter-form/)\n */\nexport { GridFilterForm };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"logicOperators\", \"columnsSort\", \"filterFormProps\", \"getColumnForNewFilter\", \"children\", \"disableAddFilterButton\", \"disableRemoveAllButton\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { GridLogicOperator } from \"../../../models/gridFilterItem.js\";\nimport { useGridApiContext } from \"../../../hooks/utils/useGridApiContext.js\";\nimport { GridPanelContent } from \"../GridPanelContent.js\";\nimport { GridPanelFooter } from \"../GridPanelFooter.js\";\nimport { GridPanelWrapper } from \"../GridPanelWrapper.js\";\nimport { GridFilterForm } from \"./GridFilterForm.js\";\nimport { useGridRootProps } from \"../../../hooks/utils/useGridRootProps.js\";\nimport { useGridSelector } from \"../../../hooks/utils/useGridSelector.js\";\nimport { gridFilterModelSelector } from \"../../../hooks/features/filter/gridFilterSelector.js\";\nimport { gridFilterableColumnDefinitionsSelector, gridFilterableColumnLookupSelector } from \"../../../hooks/features/columns/gridColumnsSelector.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst getGridFilter = col => ({\n field: col.field,\n operator: col.filterOperators[0].value,\n id: Math.round(Math.random() * 1e5)\n});\nconst GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(props, ref) {\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const filterModel = useGridSelector(apiRef, gridFilterModelSelector);\n const filterableColumns = useGridSelector(apiRef, gridFilterableColumnDefinitionsSelector);\n const filterableColumnsLookup = useGridSelector(apiRef, gridFilterableColumnLookupSelector);\n const lastFilterRef = React.useRef(null);\n const placeholderFilter = React.useRef(null);\n const {\n logicOperators = [GridLogicOperator.And, GridLogicOperator.Or],\n columnsSort,\n filterFormProps,\n getColumnForNewFilter,\n disableAddFilterButton = false,\n disableRemoveAllButton = false\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const applyFilter = apiRef.current.upsertFilterItem;\n const applyFilterLogicOperator = React.useCallback(operator => {\n apiRef.current.setFilterLogicOperator(operator);\n }, [apiRef]);\n const getDefaultFilter = React.useCallback(() => {\n let nextColumnWithOperator;\n if (getColumnForNewFilter && typeof getColumnForNewFilter === 'function') {\n // To allow override the column for default (first) filter\n const nextFieldName = getColumnForNewFilter({\n currentFilters: filterModel?.items || [],\n columns: filterableColumns\n });\n if (nextFieldName === null) {\n return null;\n }\n nextColumnWithOperator = filterableColumns.find(({\n field\n }) => field === nextFieldName);\n } else {\n nextColumnWithOperator = filterableColumns.find(colDef => colDef.filterOperators?.length);\n }\n if (!nextColumnWithOperator) {\n return null;\n }\n return getGridFilter(nextColumnWithOperator);\n }, [filterModel?.items, filterableColumns, getColumnForNewFilter]);\n const getNewFilter = React.useCallback(() => {\n if (getColumnForNewFilter === undefined || typeof getColumnForNewFilter !== 'function') {\n return getDefaultFilter();\n }\n const currentFilters = filterModel.items.length ? filterModel.items : [getDefaultFilter()].filter(Boolean);\n\n // If no items are there in filterModel, we have to pass defaultFilter\n const nextColumnFieldName = getColumnForNewFilter({\n currentFilters: currentFilters,\n columns: filterableColumns\n });\n if (nextColumnFieldName === null) {\n return null;\n }\n const nextColumnWithOperator = filterableColumns.find(({\n field\n }) => field === nextColumnFieldName);\n if (!nextColumnWithOperator) {\n return null;\n }\n return getGridFilter(nextColumnWithOperator);\n }, [filterModel.items, filterableColumns, getColumnForNewFilter, getDefaultFilter]);\n const items = React.useMemo(() => {\n if (filterModel.items.length) {\n return filterModel.items;\n }\n if (!placeholderFilter.current) {\n placeholderFilter.current = getDefaultFilter();\n }\n return placeholderFilter.current ? [placeholderFilter.current] : [];\n }, [filterModel.items, getDefaultFilter]);\n const hasMultipleFilters = items.length > 1;\n const {\n readOnlyFilters,\n validFilters\n } = React.useMemo(() => items.reduce((acc, item) => {\n if (filterableColumnsLookup[item.field]) {\n acc.validFilters.push(item);\n } else {\n acc.readOnlyFilters.push(item);\n }\n return acc;\n }, {\n readOnlyFilters: [],\n validFilters: []\n }), [items, filterableColumnsLookup]);\n const addNewFilter = React.useCallback(() => {\n const newFilter = getNewFilter();\n if (!newFilter) {\n return;\n }\n apiRef.current.upsertFilterItems([...items, newFilter]);\n }, [apiRef, getNewFilter, items]);\n const deleteFilter = React.useCallback(item => {\n const shouldCloseFilterPanel = validFilters.length === 1;\n apiRef.current.deleteFilterItem(item);\n if (shouldCloseFilterPanel) {\n apiRef.current.hideFilterPanel();\n }\n }, [apiRef, validFilters.length]);\n const handleRemoveAll = React.useCallback(() => {\n if (validFilters.length === 1 && validFilters[0].value === undefined) {\n apiRef.current.deleteFilterItem(validFilters[0]);\n return apiRef.current.hideFilterPanel();\n }\n return apiRef.current.setFilterModel(_extends({}, filterModel, {\n items: readOnlyFilters\n }), 'removeAllFilterItems');\n }, [apiRef, readOnlyFilters, filterModel, validFilters]);\n React.useEffect(() => {\n if (logicOperators.length > 0 && filterModel.logicOperator && !logicOperators.includes(filterModel.logicOperator)) {\n applyFilterLogicOperator(logicOperators[0]);\n }\n }, [logicOperators, applyFilterLogicOperator, filterModel.logicOperator]);\n React.useEffect(() => {\n if (validFilters.length > 0) {\n lastFilterRef.current.focus();\n }\n }, [validFilters.length]);\n return /*#__PURE__*/_jsxs(GridPanelWrapper, _extends({\n ref: ref\n }, other, {\n children: [/*#__PURE__*/_jsxs(GridPanelContent, {\n children: [readOnlyFilters.map((item, index) => /*#__PURE__*/_jsx(GridFilterForm, _extends({\n item: item,\n applyFilterChanges: applyFilter,\n deleteFilter: deleteFilter,\n hasMultipleFilters: hasMultipleFilters,\n showMultiFilterOperators: index > 0,\n disableMultiFilterOperator: index !== 1,\n applyMultiFilterOperatorChanges: applyFilterLogicOperator,\n focusElementRef: null,\n readOnly: true,\n logicOperators: logicOperators,\n columnsSort: columnsSort\n }, filterFormProps), item.id == null ? index : item.id)), validFilters.map((item, index) => /*#__PURE__*/_jsx(GridFilterForm, _extends({\n item: item,\n applyFilterChanges: applyFilter,\n deleteFilter: deleteFilter,\n hasMultipleFilters: hasMultipleFilters,\n showMultiFilterOperators: readOnlyFilters.length + index > 0,\n disableMultiFilterOperator: readOnlyFilters.length + index !== 1,\n applyMultiFilterOperatorChanges: applyFilterLogicOperator,\n focusElementRef: index === validFilters.length - 1 ? lastFilterRef : null,\n logicOperators: logicOperators,\n columnsSort: columnsSort\n }, filterFormProps), item.id == null ? index + readOnlyFilters.length : item.id))]\n }), !rootProps.disableMultipleColumnsFiltering && !(disableAddFilterButton && disableRemoveAllButton) ? /*#__PURE__*/_jsxs(GridPanelFooter, {\n children: [!disableAddFilterButton ? /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({\n onClick: addNewFilter,\n startIcon: /*#__PURE__*/_jsx(rootProps.slots.filterPanelAddIcon, {})\n }, rootProps.slotProps?.baseButton, {\n children: apiRef.current.getLocaleText('filterPanelAddFilter')\n })) : /*#__PURE__*/_jsx(\"span\", {}), !disableRemoveAllButton && validFilters.length > 0 ? /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({\n onClick: handleRemoveAll,\n startIcon: /*#__PURE__*/_jsx(rootProps.slots.filterPanelRemoveAllIcon, {})\n }, rootProps.slotProps?.baseButton, {\n children: apiRef.current.getLocaleText('filterPanelRemoveAll')\n })) : null]\n }) : null]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridFilterPanel.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * @ignore - do not document.\n */\n children: PropTypes.node,\n /**\n * Changes how the options in the columns selector should be ordered.\n * If not specified, the order is derived from the `columns` prop.\n */\n columnsSort: PropTypes.oneOf(['asc', 'desc']),\n /**\n * If `true`, the `Add filter` button will not be displayed.\n * @default false\n */\n disableAddFilterButton: PropTypes.bool,\n /**\n * If `true`, the `Remove all` button will be disabled\n * @default false\n */\n disableRemoveAllButton: PropTypes.bool,\n /**\n * Props passed to each filter form.\n */\n filterFormProps: PropTypes.shape({\n columnInputProps: PropTypes.any,\n columnsSort: PropTypes.oneOf(['asc', 'desc']),\n deleteIconProps: PropTypes.any,\n filterColumns: PropTypes.func,\n logicOperatorInputProps: PropTypes.any,\n operatorInputProps: PropTypes.any,\n valueInputProps: PropTypes.any\n }),\n /**\n * Function that returns the next filter item to be picked as default filter.\n * @param {GetColumnForNewFilterArgs} args Currently configured filters and columns.\n * @returns {GridColDef['field']} The field to be used for the next filter or `null` to prevent adding a filter.\n */\n getColumnForNewFilter: PropTypes.func,\n /**\n * Sets the available logic operators.\n * @default [GridLogicOperator.And, GridLogicOperator.Or]\n */\n logicOperators: PropTypes.arrayOf(PropTypes.oneOf(['and', 'or']).isRequired),\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\n\n/**\n * Demos:\n * - [Filtering - overview](https://mui.com/x/react-data-grid/filtering/)\n *\n * API:\n * - [GridFilterPanel API](https://mui.com/x/api/data-grid/grid-filter-panel/)\n */\nexport { GridFilterPanel, getGridFilter };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useId as useId } from '@mui/material/utils';\nimport { useGridSelector } from \"../../hooks/utils/useGridSelector.js\";\nimport { gridPreferencePanelStateSelector } from \"../../hooks/features/preferencesPanel/gridPreferencePanelSelector.js\";\nimport { GridPreferencePanelsValue } from \"../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function GridToolbarColumnsButton(props, ref) {\n const {\n slotProps = {}\n } = props;\n const buttonProps = slotProps.button || {};\n const tooltipProps = slotProps.tooltip || {};\n const columnButtonId = useId();\n const columnPanelId = useId();\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);\n const showColumns = event => {\n if (preferencePanel.open && preferencePanel.openedPanelValue === GridPreferencePanelsValue.columns) {\n apiRef.current.hidePreferences();\n } else {\n apiRef.current.showPreferences(GridPreferencePanelsValue.columns, columnPanelId, columnButtonId);\n }\n buttonProps.onClick?.(event);\n };\n\n // Disable the button if the corresponding is disabled\n if (rootProps.disableColumnSelector) {\n return null;\n }\n const isOpen = preferencePanel.open && preferencePanel.panelId === columnPanelId;\n return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({\n title: apiRef.current.getLocaleText('toolbarColumnsLabel'),\n enterDelay: 1000\n }, tooltipProps, rootProps.slotProps?.baseTooltip, {\n children: /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({\n ref: ref,\n id: columnButtonId,\n size: \"small\",\n \"aria-label\": apiRef.current.getLocaleText('toolbarColumnsLabel'),\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": isOpen,\n \"aria-controls\": isOpen ? columnPanelId : undefined,\n startIcon: /*#__PURE__*/_jsx(rootProps.slots.columnSelectorIcon, {})\n }, buttonProps, {\n onClick: showColumns\n }, rootProps.slotProps?.baseButton, {\n children: apiRef.current.getLocaleText('toolbarColumns')\n }))\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridToolbarColumnsButton.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The props used for each slot inside.\n * @default {}\n */\n slotProps: PropTypes.object\n} : void 0;\nexport { GridToolbarColumnsButton };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useId as useId, unstable_useForkRef as useForkRef } from '@mui/utils';\nimport MenuList from '@mui/material/MenuList';\nimport MenuItem from '@mui/material/MenuItem';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport { gridDensitySelector } from \"../../hooks/features/density/densitySelector.js\";\nimport { isHideMenuKey } from \"../../utils/keyboardUtils.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { useGridSelector } from \"../../hooks/utils/useGridSelector.js\";\nimport { GridMenu } from \"../menu/GridMenu.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { gridClasses } from \"../../constants/gridClasses.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function GridToolbarDensitySelector(props, ref) {\n const {\n slotProps = {}\n } = props;\n const buttonProps = slotProps.button || {};\n const tooltipProps = slotProps.tooltip || {};\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const density = useGridSelector(apiRef, gridDensitySelector);\n const densityButtonId = useId();\n const densityMenuId = useId();\n const [open, setOpen] = React.useState(false);\n const buttonRef = React.useRef(null);\n const handleRef = useForkRef(ref, buttonRef);\n const densityOptions = [{\n icon: /*#__PURE__*/_jsx(rootProps.slots.densityCompactIcon, {}),\n label: apiRef.current.getLocaleText('toolbarDensityCompact'),\n value: 'compact'\n }, {\n icon: /*#__PURE__*/_jsx(rootProps.slots.densityStandardIcon, {}),\n label: apiRef.current.getLocaleText('toolbarDensityStandard'),\n value: 'standard'\n }, {\n icon: /*#__PURE__*/_jsx(rootProps.slots.densityComfortableIcon, {}),\n label: apiRef.current.getLocaleText('toolbarDensityComfortable'),\n value: 'comfortable'\n }];\n const startIcon = React.useMemo(() => {\n switch (density) {\n case 'compact':\n return /*#__PURE__*/_jsx(rootProps.slots.densityCompactIcon, {});\n case 'comfortable':\n return /*#__PURE__*/_jsx(rootProps.slots.densityComfortableIcon, {});\n default:\n return /*#__PURE__*/_jsx(rootProps.slots.densityStandardIcon, {});\n }\n }, [density, rootProps]);\n const handleDensitySelectorOpen = event => {\n setOpen(prevOpen => !prevOpen);\n buttonProps.onClick?.(event);\n };\n const handleDensitySelectorClose = () => {\n setOpen(false);\n };\n const handleDensityUpdate = newDensity => {\n apiRef.current.setDensity(newDensity);\n setOpen(false);\n };\n const handleListKeyDown = event => {\n if (event.key === 'Tab') {\n event.preventDefault();\n }\n if (isHideMenuKey(event.key)) {\n setOpen(false);\n }\n };\n\n // Disable the button if the corresponding is disabled\n if (rootProps.disableDensitySelector) {\n return null;\n }\n const densityElements = densityOptions.map((option, index) => /*#__PURE__*/_jsxs(MenuItem, {\n onClick: () => handleDensityUpdate(option.value),\n selected: option.value === density,\n children: [/*#__PURE__*/_jsx(ListItemIcon, {\n children: option.icon\n }), option.label]\n }, index));\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({\n title: apiRef.current.getLocaleText('toolbarDensityLabel'),\n enterDelay: 1000\n }, tooltipProps, rootProps.slotProps?.baseTooltip, {\n children: /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({\n ref: handleRef,\n size: \"small\",\n startIcon: startIcon,\n \"aria-label\": apiRef.current.getLocaleText('toolbarDensityLabel'),\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": open,\n \"aria-controls\": open ? densityMenuId : undefined,\n id: densityButtonId\n }, buttonProps, {\n onClick: handleDensitySelectorOpen\n }, rootProps.slotProps?.baseButton, {\n children: apiRef.current.getLocaleText('toolbarDensity')\n }))\n })), /*#__PURE__*/_jsx(GridMenu, {\n open: open,\n target: buttonRef.current,\n onClose: handleDensitySelectorClose,\n position: \"bottom-start\",\n children: /*#__PURE__*/_jsx(MenuList, {\n id: densityMenuId,\n className: gridClasses.menuList,\n \"aria-labelledby\": densityButtonId,\n onKeyDown: handleListKeyDown,\n autoFocusItem: open,\n children: densityElements\n })\n })]\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? GridToolbarDensitySelector.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The props used for each slot inside.\n * @default {}\n */\n slotProps: PropTypes.object\n} : void 0;\nexport { GridToolbarDensitySelector };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize, unstable_useId as useId } from '@mui/utils';\nimport Badge from '@mui/material/Badge';\nimport { gridColumnLookupSelector } from \"../../hooks/features/columns/gridColumnsSelector.js\";\nimport { useGridSelector } from \"../../hooks/utils/useGridSelector.js\";\nimport { gridFilterActiveItemsSelector } from \"../../hooks/features/filter/gridFilterSelector.js\";\nimport { gridPreferencePanelStateSelector } from \"../../hooks/features/preferencesPanel/gridPreferencePanelSelector.js\";\nimport { GridPreferencePanelsValue } from \"../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { getDataGridUtilityClass } from \"../../constants/gridClasses.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['toolbarFilterList']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridToolbarFilterListRoot = styled('ul', {\n name: 'MuiDataGrid',\n slot: 'ToolbarFilterList',\n overridesResolver: (_props, styles) => styles.toolbarFilterList\n})(({\n theme\n}) => ({\n margin: theme.spacing(1, 1, 0.5),\n padding: theme.spacing(0, 1)\n}));\nconst GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolbarFilterButton(props, ref) {\n const {\n slotProps = {}\n } = props;\n const buttonProps = slotProps.button || {};\n const tooltipProps = slotProps.tooltip || {};\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const activeFilters = useGridSelector(apiRef, gridFilterActiveItemsSelector);\n const lookup = useGridSelector(apiRef, gridColumnLookupSelector);\n const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);\n const classes = useUtilityClasses(rootProps);\n const filterButtonId = useId();\n const filterPanelId = useId();\n const tooltipContentNode = React.useMemo(() => {\n if (preferencePanel.open) {\n return apiRef.current.getLocaleText('toolbarFiltersTooltipHide');\n }\n if (activeFilters.length === 0) {\n return apiRef.current.getLocaleText('toolbarFiltersTooltipShow');\n }\n const getOperatorLabel = item => lookup[item.field].filterOperators.find(operator => operator.value === item.operator).label || apiRef.current.getLocaleText(`filterOperator${capitalize(item.operator)}`).toString();\n const getFilterItemValue = item => {\n const {\n getValueAsString\n } = lookup[item.field].filterOperators.find(operator => operator.value === item.operator);\n return getValueAsString ? getValueAsString(item.value) : item.value;\n };\n return /*#__PURE__*/_jsxs(\"div\", {\n children: [apiRef.current.getLocaleText('toolbarFiltersTooltipActive')(activeFilters.length), /*#__PURE__*/_jsx(GridToolbarFilterListRoot, {\n className: classes.root,\n ownerState: rootProps,\n children: activeFilters.map((item, index) => _extends({}, lookup[item.field] && /*#__PURE__*/_jsx(\"li\", {\n children: `${lookup[item.field].headerName || item.field}\n ${getOperatorLabel(item)}\n ${\n // implicit check for null and undefined\n item.value != null ? getFilterItemValue(item) : ''}`\n }, index)))\n })]\n });\n }, [apiRef, rootProps, preferencePanel.open, activeFilters, lookup, classes]);\n const toggleFilter = event => {\n const {\n open,\n openedPanelValue\n } = preferencePanel;\n if (open && openedPanelValue === GridPreferencePanelsValue.filters) {\n apiRef.current.hidePreferences();\n } else {\n apiRef.current.showPreferences(GridPreferencePanelsValue.filters, filterPanelId, filterButtonId);\n }\n buttonProps.onClick?.(event);\n };\n\n // Disable the button if the corresponding is disabled\n if (rootProps.disableColumnFilter) {\n return null;\n }\n const isOpen = preferencePanel.open && preferencePanel.panelId === filterPanelId;\n return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({\n title: tooltipContentNode,\n enterDelay: 1000\n }, tooltipProps, rootProps.slotProps?.baseTooltip, {\n children: /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({\n ref: ref,\n id: filterButtonId,\n size: \"small\",\n \"aria-label\": apiRef.current.getLocaleText('toolbarFiltersLabel'),\n \"aria-controls\": isOpen ? filterPanelId : undefined,\n \"aria-expanded\": isOpen,\n \"aria-haspopup\": true,\n startIcon: /*#__PURE__*/_jsx(Badge, {\n badgeContent: activeFilters.length,\n color: \"primary\",\n children: /*#__PURE__*/_jsx(rootProps.slots.openFilterButtonIcon, {})\n })\n }, buttonProps, {\n onClick: toggleFilter\n }, rootProps.slotProps?.baseButton, {\n children: apiRef.current.getLocaleText('toolbarFilters')\n }))\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridToolbarFilterButton.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The props used for each slot inside.\n * @default {}\n */\n slotProps: PropTypes.object\n} : void 0;\nexport { GridToolbarFilterButton };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useId as useId, unstable_useForkRef as useForkRef } from '@mui/utils';\nimport MenuList from '@mui/material/MenuList';\nimport { isHideMenuKey } from \"../../utils/keyboardUtils.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { GridMenu } from \"../menu/GridMenu.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { gridClasses } from \"../../constants/gridClasses.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function GridToolbarExportContainer(props, ref) {\n const {\n children,\n slotProps = {}\n } = props;\n const buttonProps = slotProps.button || {};\n const tooltipProps = slotProps.tooltip || {};\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const exportButtonId = useId();\n const exportMenuId = useId();\n const [open, setOpen] = React.useState(false);\n const buttonRef = React.useRef(null);\n const handleRef = useForkRef(ref, buttonRef);\n const handleMenuOpen = event => {\n setOpen(prevOpen => !prevOpen);\n buttonProps.onClick?.(event);\n };\n const handleMenuClose = () => setOpen(false);\n const handleListKeyDown = event => {\n if (event.key === 'Tab') {\n event.preventDefault();\n }\n if (isHideMenuKey(event.key)) {\n handleMenuClose();\n }\n };\n if (children == null) {\n return null;\n }\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({\n title: apiRef.current.getLocaleText('toolbarExportLabel'),\n enterDelay: 1000\n }, tooltipProps, rootProps.slotProps?.baseTooltip, {\n children: /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({\n ref: handleRef,\n size: \"small\",\n startIcon: /*#__PURE__*/_jsx(rootProps.slots.exportIcon, {}),\n \"aria-expanded\": open,\n \"aria-label\": apiRef.current.getLocaleText('toolbarExportLabel'),\n \"aria-haspopup\": \"menu\",\n \"aria-controls\": open ? exportMenuId : undefined,\n id: exportButtonId\n }, buttonProps, {\n onClick: handleMenuOpen\n }, rootProps.slotProps?.baseButton, {\n children: apiRef.current.getLocaleText('toolbarExport')\n }))\n })), /*#__PURE__*/_jsx(GridMenu, {\n open: open,\n target: buttonRef.current,\n onClose: handleMenuClose,\n position: \"bottom-start\",\n children: /*#__PURE__*/_jsx(MenuList, {\n id: exportMenuId,\n className: gridClasses.menuList,\n \"aria-labelledby\": exportButtonId,\n onKeyDown: handleListKeyDown,\n autoFocusItem: open,\n children: React.Children.map(children, child => {\n if (! /*#__PURE__*/React.isValidElement(child)) {\n return child;\n }\n return /*#__PURE__*/React.cloneElement(child, {\n hideMenu: handleMenuClose\n });\n })\n })\n })]\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? GridToolbarExportContainer.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The props used for each slot inside.\n * @default {}\n */\n slotProps: PropTypes.object\n} : void 0;\nexport { GridToolbarExportContainer };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"hideMenu\", \"options\"],\n _excluded2 = [\"hideMenu\", \"options\"],\n _excluded3 = [\"csvOptions\", \"printOptions\", \"excelOptions\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport MenuItem from '@mui/material/MenuItem';\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { GridToolbarExportContainer } from \"./GridToolbarExportContainer.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function GridCsvExportMenuItem(props) {\n const apiRef = useGridApiContext();\n const {\n hideMenu,\n options\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n return /*#__PURE__*/_jsx(MenuItem, _extends({\n onClick: () => {\n apiRef.current.exportDataAsCsv(options);\n hideMenu?.();\n }\n }, other, {\n children: apiRef.current.getLocaleText('toolbarExportCSV')\n }));\n}\nexport function GridPrintExportMenuItem(props) {\n const apiRef = useGridApiContext();\n const {\n hideMenu,\n options\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded2);\n return /*#__PURE__*/_jsx(MenuItem, _extends({\n onClick: () => {\n apiRef.current.exportDataAsPrint(options);\n hideMenu?.();\n }\n }, other, {\n children: apiRef.current.getLocaleText('toolbarExportPrint')\n }));\n}\nconst GridToolbarExport = /*#__PURE__*/React.forwardRef(function GridToolbarExport(props, ref) {\n const {\n csvOptions = {},\n printOptions = {},\n excelOptions\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded3);\n const apiRef = useGridApiContext();\n const preProcessedButtons = apiRef.current.unstable_applyPipeProcessors('exportMenu', [], {\n excelOptions,\n csvOptions,\n printOptions\n }).sort((a, b) => a.componentName > b.componentName ? 1 : -1);\n if (preProcessedButtons.length === 0) {\n return null;\n }\n return /*#__PURE__*/_jsx(GridToolbarExportContainer, _extends({}, other, {\n ref: ref,\n children: preProcessedButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button.component, {\n key: index\n }))\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridToolbarExport.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n csvOptions: PropTypes.object,\n printOptions: PropTypes.object,\n /**\n * The props used for each slot inside.\n * @default {}\n */\n slotProps: PropTypes.object\n} : void 0;\nexport { GridToolbarExport };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"quickFilterParser\", \"quickFilterFormatter\", \"debounceMs\", \"className\"];\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport PropTypes from 'prop-types';\nimport TextField from '@mui/material/TextField';\nimport { styled } from '@mui/material/styles';\nimport { unstable_debounce as debounce } from '@mui/utils';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { getDataGridUtilityClass } from \"../../constants/index.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { useGridSelector } from \"../../hooks/utils/useGridSelector.js\";\nimport { gridQuickFilterValuesSelector } from \"../../hooks/features/filter/index.js\";\nimport { isDeepEqual } from \"../../utils/utils.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['toolbarQuickFilter']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridToolbarQuickFilterRoot = styled(TextField, {\n name: 'MuiDataGrid',\n slot: 'ToolbarQuickFilter',\n overridesResolver: (props, styles) => styles.toolbarQuickFilter\n})(({\n theme\n}) => ({\n width: 'auto',\n paddingBottom: theme.spacing(0.5),\n '& input': {\n marginLeft: theme.spacing(0.5)\n },\n '& .MuiInput-underline:before': {\n borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`\n },\n [`& input[type=\"search\"]::-webkit-search-decoration,\n & input[type=\"search\"]::-webkit-search-cancel-button,\n & input[type=\"search\"]::-webkit-search-results-button,\n & input[type=\"search\"]::-webkit-search-results-decoration`]: {\n /* clears the 'X' icon from Chrome */\n display: 'none'\n }\n}));\nconst defaultSearchValueParser = searchText => searchText.split(' ').filter(word => word !== '');\nconst defaultSearchValueFormatter = values => values.join(' ');\nfunction GridToolbarQuickFilter(props) {\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n const quickFilterValues = useGridSelector(apiRef, gridQuickFilterValuesSelector);\n const {\n quickFilterParser = defaultSearchValueParser,\n quickFilterFormatter = defaultSearchValueFormatter,\n debounceMs = rootProps.filterDebounceMs,\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const [searchValue, setSearchValue] = React.useState(() => quickFilterFormatter(quickFilterValues ?? []));\n const prevQuickFilterValuesRef = React.useRef(quickFilterValues);\n React.useEffect(() => {\n if (!isDeepEqual(prevQuickFilterValuesRef.current, quickFilterValues)) {\n // The model of quick filter value has been updated\n prevQuickFilterValuesRef.current = quickFilterValues;\n\n // Update the input value if needed to match the new model\n setSearchValue(prevSearchValue => isDeepEqual(quickFilterParser(prevSearchValue), quickFilterValues) ? prevSearchValue : quickFilterFormatter(quickFilterValues ?? []));\n }\n }, [quickFilterValues, quickFilterFormatter, quickFilterParser]);\n const updateSearchValue = React.useCallback(newSearchValue => {\n const newQuickFilterValues = quickFilterParser(newSearchValue);\n prevQuickFilterValuesRef.current = newQuickFilterValues;\n apiRef.current.setQuickFilterValues(newQuickFilterValues);\n }, [apiRef, quickFilterParser]);\n const debouncedUpdateSearchValue = React.useMemo(() => debounce(updateSearchValue, debounceMs), [updateSearchValue, debounceMs]);\n const handleSearchValueChange = React.useCallback(event => {\n const newSearchValue = event.target.value;\n setSearchValue(newSearchValue);\n debouncedUpdateSearchValue(newSearchValue);\n }, [debouncedUpdateSearchValue]);\n const handleSearchReset = React.useCallback(() => {\n setSearchValue('');\n updateSearchValue('');\n }, [updateSearchValue]);\n return /*#__PURE__*/_jsx(GridToolbarQuickFilterRoot, _extends({\n as: rootProps.slots.baseTextField,\n ownerState: rootProps,\n variant: \"standard\",\n value: searchValue,\n onChange: handleSearchValueChange,\n className: clsx(className, classes.root),\n placeholder: apiRef.current.getLocaleText('toolbarQuickFilterPlaceholder'),\n \"aria-label\": apiRef.current.getLocaleText('toolbarQuickFilterLabel'),\n type: \"search\"\n }, other, {\n InputProps: _extends({\n startAdornment: /*#__PURE__*/_jsx(rootProps.slots.quickFilterIcon, {\n fontSize: \"small\"\n }),\n endAdornment: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({\n \"aria-label\": apiRef.current.getLocaleText('toolbarQuickFilterDeleteIconLabel'),\n size: \"small\",\n sx: [searchValue ? {\n visibility: 'visible'\n } : {\n visibility: 'hidden'\n }],\n onClick: handleSearchReset\n }, rootProps.slotProps?.baseIconButton, {\n children: /*#__PURE__*/_jsx(rootProps.slots.quickFilterClearIcon, {\n fontSize: \"small\"\n })\n }))\n }, other.InputProps)\n }, rootProps.slotProps?.baseTextField));\n}\nprocess.env.NODE_ENV !== \"production\" ? GridToolbarQuickFilter.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The debounce time in milliseconds.\n * @default 150\n */\n debounceMs: PropTypes.number,\n /**\n * Function responsible for formatting values of quick filter in a string when the model is modified\n * @param {any[]} values The new values passed to the quick filter model\n * @returns {string} The string to display in the text field\n * @default (values: string[]) => values.join(' ')\n */\n quickFilterFormatter: PropTypes.func,\n /**\n * Function responsible for parsing text input in an array of independent values for quick filtering.\n * @param {string} input The value entered by the user\n * @returns {any[]} The array of value on which quick filter is applied\n * @default (searchText: string) => searchText\n * .split(' ')\n * .filter((word) => word !== '')\n */\n quickFilterParser: PropTypes.func\n} : void 0;\n\n/**\n * Demos:\n * - [Filtering - overview](https://mui.com/x/react-data-grid/filtering/)\n * - [Filtering - quick filter](https://mui.com/x/react-data-grid/filtering/quick-filter/)\n *\n * API:\n * - [GridToolbarQuickFilter API](https://mui.com/x/api/data-grid/grid-toolbar-quick-filter/)\n */\nexport { GridToolbarQuickFilter };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"csvOptions\", \"printOptions\", \"excelOptions\", \"showQuickFilter\", \"quickFilterProps\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport Box from '@mui/material/Box';\nimport { GridToolbarContainer } from \"../containers/GridToolbarContainer.js\";\nimport { GridToolbarColumnsButton } from \"./GridToolbarColumnsButton.js\";\nimport { GridToolbarDensitySelector } from \"./GridToolbarDensitySelector.js\";\nimport { GridToolbarFilterButton } from \"./GridToolbarFilterButton.js\";\nimport { GridToolbarExport } from \"./GridToolbarExport.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { GridToolbarQuickFilter } from \"./GridToolbarQuickFilter.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst GridToolbar = /*#__PURE__*/React.forwardRef(function GridToolbar(props, ref) {\n // TODO v7: think about where export option should be passed.\n // from slotProps={{ toolbarExport: { ...exportOption } }} seems to be more appropriate\n const {\n csvOptions,\n printOptions,\n excelOptions,\n showQuickFilter = false,\n quickFilterProps = {}\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootProps = useGridRootProps();\n if (rootProps.disableColumnFilter && rootProps.disableColumnSelector && rootProps.disableDensitySelector && !showQuickFilter) {\n return null;\n }\n return /*#__PURE__*/_jsxs(GridToolbarContainer, _extends({\n ref: ref\n }, other, {\n children: [/*#__PURE__*/_jsx(GridToolbarColumnsButton, {}), /*#__PURE__*/_jsx(GridToolbarFilterButton, {}), /*#__PURE__*/_jsx(GridToolbarDensitySelector, {}), /*#__PURE__*/_jsx(GridToolbarExport, {\n csvOptions: csvOptions,\n printOptions: printOptions\n // TODO: remove the reference to excelOptions in community package\n ,\n excelOptions: excelOptions\n }), /*#__PURE__*/_jsx(Box, {\n sx: {\n flex: 1\n }\n }), showQuickFilter && /*#__PURE__*/_jsx(GridToolbarQuickFilter, _extends({}, quickFilterProps))]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridToolbar.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Props passed to the quick filter component.\n */\n quickFilterProps: PropTypes.object,\n /**\n * Show the quick filter component.\n * @default false\n */\n showQuickFilter: PropTypes.bool,\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { GridToolbar };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"selectedRowCount\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { styled } from '@mui/system';\nimport { useGridApiContext } from \"../hooks/utils/useGridApiContext.js\";\nimport { getDataGridUtilityClass } from \"../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['selectedRowCount']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridSelectedRowCountRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'SelectedRowCount',\n overridesResolver: (props, styles) => styles.selectedRowCount\n})(({\n theme\n}) => ({\n alignItems: 'center',\n display: 'flex',\n margin: theme.spacing(0, 2),\n visibility: 'hidden',\n width: 0,\n height: 0,\n [theme.breakpoints.up('sm')]: {\n visibility: 'visible',\n width: 'auto',\n height: 'auto'\n }\n}));\nconst GridSelectedRowCount = /*#__PURE__*/React.forwardRef(function GridSelectedRowCount(props, ref) {\n const {\n className,\n selectedRowCount\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const ownerState = useGridRootProps();\n const classes = useUtilityClasses(ownerState);\n const rowSelectedText = apiRef.current.getLocaleText('footerRowSelected')(selectedRowCount);\n return /*#__PURE__*/_jsx(GridSelectedRowCountRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className),\n ownerState: ownerState\n }, other, {\n children: rowSelectedText\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridSelectedRowCount.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n selectedRowCount: PropTypes.number.isRequired,\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { GridSelectedRowCount };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGridSelector } from \"../hooks/utils/useGridSelector.js\";\nimport { gridTopLevelRowCountSelector } from \"../hooks/features/rows/gridRowsSelector.js\";\nimport { selectedGridRowsCountSelector } from \"../hooks/features/rowSelection/gridRowSelectionSelector.js\";\nimport { gridFilteredTopLevelRowCountSelector } from \"../hooks/features/filter/gridFilterSelector.js\";\nimport { useGridApiContext } from \"../hooks/utils/useGridApiContext.js\";\nimport { GridSelectedRowCount } from \"./GridSelectedRowCount.js\";\nimport { GridFooterContainer } from \"./containers/GridFooterContainer.js\";\nimport { useGridRootProps } from \"../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref) {\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const totalTopLevelRowCount = useGridSelector(apiRef, gridTopLevelRowCountSelector);\n const selectedRowCount = useGridSelector(apiRef, selectedGridRowsCountSelector);\n const visibleTopLevelRowCount = useGridSelector(apiRef, gridFilteredTopLevelRowCountSelector);\n const selectedRowCountElement = !rootProps.hideFooterSelectedRowCount && selectedRowCount > 0 ? /*#__PURE__*/_jsx(GridSelectedRowCount, {\n selectedRowCount: selectedRowCount\n }) : /*#__PURE__*/_jsx(\"div\", {});\n const rowCountElement = !rootProps.hideFooterRowCount && !rootProps.pagination ? /*#__PURE__*/_jsx(rootProps.slots.footerRowCount, _extends({}, rootProps.slotProps?.footerRowCount, {\n rowCount: totalTopLevelRowCount,\n visibleRowCount: visibleTopLevelRowCount\n })) : null;\n const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.slots.pagination && /*#__PURE__*/_jsx(rootProps.slots.pagination, _extends({}, rootProps.slotProps?.pagination));\n return /*#__PURE__*/_jsxs(GridFooterContainer, _extends({\n ref: ref\n }, props, {\n children: [selectedRowCountElement, rowCountElement, paginationElement]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridFooter.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { GridFooter };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { gridColumnDefinitionsSelector } from \"../../hooks/features/columns/gridColumnsSelector.js\";\nimport { useGridSelector } from \"../../hooks/utils/useGridSelector.js\";\nimport { gridPreferencePanelStateSelector } from \"../../hooks/features/preferencesPanel/gridPreferencePanelSelector.js\";\nimport { GridPreferencePanelsValue } from \"../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js\";\nimport { useGridApiContext } from \"../../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../../hooks/utils/useGridRootProps.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function GridPreferencesPanel() {\n const apiRef = useGridApiContext();\n const columns = useGridSelector(apiRef, gridColumnDefinitionsSelector);\n const rootProps = useGridRootProps();\n const preferencePanelState = useGridSelector(apiRef, gridPreferencePanelStateSelector);\n const panelContent = apiRef.current.unstable_applyPipeProcessors('preferencePanel', null, preferencePanelState.openedPanelValue ?? GridPreferencePanelsValue.filters);\n return /*#__PURE__*/_jsx(rootProps.slots.panel, _extends({\n as: rootProps.slots.basePopper,\n open: columns.length > 0 && preferencePanelState.open,\n id: preferencePanelState.panelId,\n \"aria-labelledby\": preferencePanelState.labelId\n }, rootProps.slotProps?.panel, rootProps.slotProps?.basePopper, {\n children: panelContent\n }));\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridRootProps } from \"../hooks/utils/useGridRootProps.js\";\nimport { GridPreferencesPanel } from \"./panel/GridPreferencesPanel.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function GridHeader() {\n const rootProps = useGridRootProps();\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(GridPreferencesPanel, {}), rootProps.slots.toolbar && /*#__PURE__*/_jsx(rootProps.slots.toolbar, _extends({}, rootProps.slotProps?.toolbar))]\n });\n}","import { GridPinnedColumnPosition } from \"../../hooks/features/columns/index.js\";\nexport const getPinnedCellOffset = (pinnedPosition, computedWidth, columnIndex, columnPositions, dimensions) => {\n const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;\n let pinnedOffset;\n switch (pinnedPosition) {\n case GridPinnedColumnPosition.LEFT:\n pinnedOffset = columnPositions[columnIndex];\n break;\n case GridPinnedColumnPosition.RIGHT:\n pinnedOffset = dimensions.columnsTotalWidth - columnPositions[columnIndex] - computedWidth + scrollbarWidth;\n break;\n default:\n pinnedOffset = 0;\n break;\n }\n return pinnedOffset;\n};","import * as React from 'react';\nimport clsx from 'clsx';\nimport { gridClasses } from \"../constants/index.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst classes = {\n root: gridClasses.scrollbarFiller,\n header: gridClasses['scrollbarFiller--header'],\n borderTop: gridClasses['scrollbarFiller--borderTop'],\n borderBottom: gridClasses['scrollbarFiller--borderBottom'],\n pinnedRight: gridClasses['scrollbarFiller--pinnedRight']\n};\nfunction GridScrollbarFillerCell({\n header,\n borderTop = true,\n borderBottom,\n pinnedRight\n}) {\n return /*#__PURE__*/_jsx(\"div\", {\n role: \"presentation\",\n className: clsx(classes.root, header && classes.header, borderTop && classes.borderTop, borderBottom && classes.borderBottom, pinnedRight && classes.pinnedRight)\n });\n}\nexport { GridScrollbarFillerCell };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport { styled } from '@mui/system';\nimport useForkRef from '@mui/utils/useForkRef';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { useGridApiContext } from \"../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../hooks/utils/useGridRootProps.js\";\nimport { GridPinnedColumnPosition, gridColumnPositionsSelector, gridColumnsTotalWidthSelector, gridDimensionsSelector, gridVisibleColumnDefinitionsSelector, gridVisiblePinnedColumnDefinitionsSelector, useGridApiEventHandler, useGridSelector } from \"../hooks/index.js\";\nimport { getDataGridUtilityClass, gridClasses } from \"../constants/gridClasses.js\";\nimport { getPinnedCellOffset } from \"../internals/utils/getPinnedCellOffset.js\";\nimport { shouldCellShowLeftBorder, shouldCellShowRightBorder } from \"../utils/cellBorderUtils.js\";\nimport { escapeOperandAttributeSelector } from \"../utils/domUtils.js\";\nimport { GridScrollbarFillerCell } from \"./GridScrollbarFillerCell.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst SkeletonOverlay = styled('div', {\n name: 'MuiDataGrid',\n slot: 'SkeletonLoadingOverlay',\n overridesResolver: (props, styles) => styles.skeletonLoadingOverlay\n})({\n minWidth: '100%',\n width: 'max-content',\n // prevents overflow: clip; cutting off the x axis\n height: '100%',\n overflow: 'clip' // y axis is hidden while the x axis is allowed to overflow\n});\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['skeletonLoadingOverlay']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst getColIndex = el => parseInt(el.getAttribute('data-colindex'), 10);\nconst GridSkeletonLoadingOverlay = /*#__PURE__*/React.forwardRef(function GridSkeletonLoadingOverlay(props, forwardedRef) {\n const rootProps = useGridRootProps();\n const {\n slots\n } = rootProps;\n const classes = useUtilityClasses({\n classes: rootProps.classes\n });\n const ref = React.useRef(null);\n const handleRef = useForkRef(ref, forwardedRef);\n const apiRef = useGridApiContext();\n const dimensions = useGridSelector(apiRef, gridDimensionsSelector);\n const viewportHeight = dimensions?.viewportInnerSize.height ?? 0;\n const skeletonRowsCount = Math.ceil(viewportHeight / dimensions.rowHeight);\n const totalWidth = useGridSelector(apiRef, gridColumnsTotalWidthSelector);\n const positions = useGridSelector(apiRef, gridColumnPositionsSelector);\n const inViewportCount = React.useMemo(() => positions.filter(value => value <= totalWidth).length, [totalWidth, positions]);\n const allVisibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);\n const columns = React.useMemo(() => allVisibleColumns.slice(0, inViewportCount), [allVisibleColumns, inViewportCount]);\n const pinnedColumns = useGridSelector(apiRef, gridVisiblePinnedColumnDefinitionsSelector);\n const getPinnedStyle = React.useCallback((computedWidth, index, position) => {\n const pinnedOffset = getPinnedCellOffset(position, computedWidth, index, positions, dimensions);\n return {\n [position]: pinnedOffset\n };\n }, [dimensions, positions]);\n const getPinnedPosition = React.useCallback(field => {\n if (pinnedColumns.left.findIndex(col => col.field === field) !== -1) {\n return GridPinnedColumnPosition.LEFT;\n }\n if (pinnedColumns.right.findIndex(col => col.field === field) !== -1) {\n return GridPinnedColumnPosition.RIGHT;\n }\n return undefined;\n }, [pinnedColumns.left, pinnedColumns.right]);\n const children = React.useMemo(() => {\n const array = [];\n for (let i = 0; i < skeletonRowsCount; i += 1) {\n const rowCells = [];\n for (let colIndex = 0; colIndex < columns.length; colIndex += 1) {\n const column = columns[colIndex];\n const pinnedPosition = getPinnedPosition(column.field);\n const isPinnedLeft = pinnedPosition === GridPinnedColumnPosition.LEFT;\n const isPinnedRight = pinnedPosition === GridPinnedColumnPosition.RIGHT;\n const sectionLength = pinnedPosition ? pinnedColumns[pinnedPosition].length // pinned section\n : columns.length - pinnedColumns.left.length - pinnedColumns.right.length; // middle section\n const sectionIndex = pinnedPosition ? pinnedColumns[pinnedPosition].findIndex(col => col.field === column.field) // pinned section\n : colIndex - pinnedColumns.left.length; // middle section\n const pinnedStyle = pinnedPosition && getPinnedStyle(column.computedWidth, colIndex, pinnedPosition);\n const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;\n const showRightBorder = shouldCellShowRightBorder(pinnedPosition, sectionIndex, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);\n const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, sectionIndex);\n const isLastColumn = colIndex === columns.length - 1;\n const isFirstPinnedRight = isPinnedRight && sectionIndex === 0;\n const hasFillerBefore = isFirstPinnedRight && gridHasFiller;\n const hasFillerAfter = isLastColumn && !isFirstPinnedRight && gridHasFiller;\n const expandedWidth = dimensions.viewportOuterSize.width - dimensions.columnsTotalWidth;\n const emptyCellWidth = Math.max(0, expandedWidth);\n const emptyCell = /*#__PURE__*/_jsx(slots.skeletonCell, {\n width: emptyCellWidth,\n empty: true\n }, `skeleton-filler-column-${i}`);\n const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;\n const hasScrollbarFiller = isLastColumn && scrollbarWidth !== 0;\n if (hasFillerBefore) {\n rowCells.push(emptyCell);\n }\n rowCells.push(/*#__PURE__*/_jsx(slots.skeletonCell, {\n field: column.field,\n type: column.type,\n align: column.align,\n width: \"var(--width)\",\n height: dimensions.rowHeight,\n \"data-colindex\": colIndex,\n className: clsx(isPinnedLeft && gridClasses['cell--pinnedLeft'], isPinnedRight && gridClasses['cell--pinnedRight'], showRightBorder && gridClasses['cell--withRightBorder'], showLeftBorder && gridClasses['cell--withLeftBorder']),\n style: _extends({\n '--width': `${column.computedWidth}px`\n }, pinnedStyle)\n }, `skeleton-column-${i}-${column.field}`));\n if (hasFillerAfter) {\n rowCells.push(emptyCell);\n }\n if (hasScrollbarFiller) {\n rowCells.push(/*#__PURE__*/_jsx(GridScrollbarFillerCell, {\n pinnedRight: pinnedColumns.right.length > 0\n }, `skeleton-scrollbar-filler-${i}`));\n }\n }\n array.push(/*#__PURE__*/_jsx(\"div\", {\n className: clsx(gridClasses.row, gridClasses.rowSkeleton, i === 0 && gridClasses['row--firstVisible']),\n children: rowCells\n }, `skeleton-row-${i}`));\n }\n return array;\n }, [slots, columns, pinnedColumns, skeletonRowsCount, rootProps.showCellVerticalBorder, dimensions.columnsTotalWidth, dimensions.viewportOuterSize.width, dimensions.rowHeight, dimensions.hasScrollY, dimensions.scrollbarSize, getPinnedPosition, getPinnedStyle]);\n\n // Sync the column resize of the overlay columns with the grid\n const handleColumnResize = params => {\n const {\n colDef,\n width\n } = params;\n const cells = ref.current?.querySelectorAll(`[data-field=\"${escapeOperandAttributeSelector(colDef.field)}\"]`);\n if (!cells) {\n throw new Error('MUI X: Expected skeleton cells to be defined with `data-field` attribute.');\n }\n const resizedColIndex = columns.findIndex(col => col.field === colDef.field);\n const pinnedPosition = getPinnedPosition(colDef.field);\n const isPinnedLeft = pinnedPosition === GridPinnedColumnPosition.LEFT;\n const isPinnedRight = pinnedPosition === GridPinnedColumnPosition.RIGHT;\n const currentWidth = getComputedStyle(cells[0]).getPropertyValue('--width');\n const delta = parseInt(currentWidth, 10) - width;\n if (cells) {\n cells.forEach(element => {\n element.style.setProperty('--width', `${width}px`);\n });\n }\n if (isPinnedLeft) {\n const pinnedCells = ref.current?.querySelectorAll(`.${gridClasses['cell--pinnedLeft']}`);\n pinnedCells?.forEach(element => {\n const colIndex = getColIndex(element);\n if (colIndex > resizedColIndex) {\n element.style.left = `${parseInt(getComputedStyle(element).left, 10) - delta}px`;\n }\n });\n }\n if (isPinnedRight) {\n const pinnedCells = ref.current?.querySelectorAll(`.${gridClasses['cell--pinnedRight']}`);\n pinnedCells?.forEach(element => {\n const colIndex = getColIndex(element);\n if (colIndex < resizedColIndex) {\n element.style.right = `${parseInt(getComputedStyle(element).right, 10) + delta}px`;\n }\n });\n }\n };\n useGridApiEventHandler(apiRef, 'columnResize', handleColumnResize);\n return /*#__PURE__*/_jsx(SkeletonOverlay, _extends({\n className: classes.root,\n ref: handleRef\n }, props, {\n children: children\n }));\n});\nexport { GridSkeletonLoadingOverlay };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"variant\", \"noRowsVariant\", \"style\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport LinearProgress from '@mui/material/LinearProgress';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport { GridOverlay } from \"./containers/GridOverlay.js\";\nimport { GridSkeletonLoadingOverlay } from \"./GridSkeletonLoadingOverlay.js\";\nimport { useGridApiContext } from \"../hooks/utils/useGridApiContext.js\";\nimport { gridRowCountSelector, useGridSelector } from \"../hooks/index.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst LOADING_VARIANTS = {\n 'circular-progress': {\n component: CircularProgress,\n style: {}\n },\n 'linear-progress': {\n component: LinearProgress,\n style: {\n display: 'block'\n }\n },\n skeleton: {\n component: GridSkeletonLoadingOverlay,\n style: {\n display: 'block'\n }\n }\n};\nconst GridLoadingOverlay = /*#__PURE__*/React.forwardRef(function GridLoadingOverlay(props, ref) {\n const {\n variant = 'circular-progress',\n noRowsVariant = 'circular-progress',\n style\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const rowsCount = useGridSelector(apiRef, gridRowCountSelector);\n const activeVariant = LOADING_VARIANTS[rowsCount === 0 ? noRowsVariant : variant];\n return /*#__PURE__*/_jsx(GridOverlay, _extends({\n ref: ref,\n style: _extends({}, activeVariant.style, style)\n }, other, {\n children: /*#__PURE__*/_jsx(activeVariant.component, {})\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridLoadingOverlay.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The variant of the overlay when no rows are displayed.\n * @default 'circular-progress'\n */\n noRowsVariant: PropTypes.oneOf(['circular-progress', 'linear-progress', 'skeleton']),\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The variant of the overlay.\n * @default 'circular-progress'\n */\n variant: PropTypes.oneOf(['circular-progress', 'linear-progress', 'skeleton'])\n} : void 0;\nexport { GridLoadingOverlay };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGridApiContext } from \"../hooks/utils/useGridApiContext.js\";\nimport { GridOverlay } from \"./containers/GridOverlay.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GridNoRowsOverlay = /*#__PURE__*/React.forwardRef(function GridNoRowsOverlay(props, ref) {\n const apiRef = useGridApiContext();\n const noRowsLabel = apiRef.current.getLocaleText('noRowsLabel');\n return /*#__PURE__*/_jsx(GridOverlay, _extends({\n ref: ref\n }, props, {\n children: noRowsLabel\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridNoRowsOverlay.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { GridNoRowsOverlay };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { styled } from '@mui/material/styles';\nimport PropTypes from 'prop-types';\nimport TablePagination, { tablePaginationClasses } from '@mui/material/TablePagination';\nimport { useGridSelector } from \"../hooks/utils/useGridSelector.js\";\nimport { useGridApiContext } from \"../hooks/utils/useGridApiContext.js\";\nimport { useGridRootProps } from \"../hooks/utils/useGridRootProps.js\";\nimport { gridPaginationModelSelector, gridPaginationRowCountSelector, gridPageCountSelector } from \"../hooks/features/pagination/gridPaginationSelector.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GridPaginationRoot = styled(TablePagination)(({\n theme\n}) => ({\n maxHeight: 'calc(100% + 1px)',\n // border width\n [`& .${tablePaginationClasses.selectLabel}`]: {\n display: 'none',\n [theme.breakpoints.up('sm')]: {\n display: 'block'\n }\n },\n [`& .${tablePaginationClasses.input}`]: {\n display: 'none',\n [theme.breakpoints.up('sm')]: {\n display: 'inline-flex'\n }\n }\n}));\nconst wrapLabelDisplayedRows = (labelDisplayedRows, estimated) => {\n return ({\n from,\n to,\n count,\n page\n }) => labelDisplayedRows({\n from,\n to,\n count,\n page,\n estimated\n });\n};\nconst defaultLabelDisplayedRows = ({\n from,\n to,\n count,\n estimated\n}) => {\n if (!estimated) {\n return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;\n }\n return `${from}–${to} of ${count !== -1 ? count : `more than ${estimated > to ? estimated : to}`}`;\n};\n\n// A mutable version of a readonly array.\n\nconst GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(props, ref) {\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const paginationModel = useGridSelector(apiRef, gridPaginationModelSelector);\n const rowCount = useGridSelector(apiRef, gridPaginationRowCountSelector);\n const pageCount = useGridSelector(apiRef, gridPageCountSelector);\n const {\n paginationMode,\n loading,\n estimatedRowCount\n } = rootProps;\n const computedProps = React.useMemo(() => {\n if (rowCount === -1 && paginationMode === 'server' && loading) {\n return {\n backIconButtonProps: {\n disabled: true\n },\n nextIconButtonProps: {\n disabled: true\n }\n };\n }\n return {};\n }, [loading, paginationMode, rowCount]);\n const lastPage = React.useMemo(() => Math.max(0, pageCount - 1), [pageCount]);\n const computedPage = React.useMemo(() => {\n if (rowCount === -1) {\n return paginationModel.page;\n }\n return paginationModel.page <= lastPage ? paginationModel.page : lastPage;\n }, [lastPage, paginationModel.page, rowCount]);\n const handlePageSizeChange = React.useCallback(event => {\n const pageSize = Number(event.target.value);\n apiRef.current.setPageSize(pageSize);\n }, [apiRef]);\n const handlePageChange = React.useCallback((_, page) => {\n apiRef.current.setPage(page);\n }, [apiRef]);\n const isPageSizeIncludedInPageSizeOptions = pageSize => {\n for (let i = 0; i < rootProps.pageSizeOptions.length; i += 1) {\n const option = rootProps.pageSizeOptions[i];\n if (typeof option === 'number') {\n if (option === pageSize) {\n return true;\n }\n } else if (option.value === pageSize) {\n return true;\n }\n }\n return false;\n };\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const warnedOnceMissingInPageSizeOptions = React.useRef(false);\n const pageSize = rootProps.paginationModel?.pageSize ?? paginationModel.pageSize;\n if (!warnedOnceMissingInPageSizeOptions.current && !rootProps.autoPageSize && !isPageSizeIncludedInPageSizeOptions(pageSize)) {\n console.warn([`MUI X: The page size \\`${paginationModel.pageSize}\\` is not present in the \\`pageSizeOptions\\`.`, `Add it to show the pagination select.`].join('\\n'));\n warnedOnceMissingInPageSizeOptions.current = true;\n }\n }\n const pageSizeOptions = isPageSizeIncludedInPageSizeOptions(paginationModel.pageSize) ? rootProps.pageSizeOptions : [];\n const locales = apiRef.current.getLocaleText('MuiTablePagination');\n const wrappedLabelDisplayedRows = wrapLabelDisplayedRows(locales.labelDisplayedRows || defaultLabelDisplayedRows, estimatedRowCount);\n return /*#__PURE__*/_jsx(GridPaginationRoot, _extends({\n ref: ref,\n component: \"div\",\n count: rowCount,\n page: computedPage\n // TODO: Remove the cast once the type is fixed in Material UI and that the min Material UI version\n // for x-data-grid is past the fix.\n // Note that Material UI will not mutate the array, so this is safe.\n ,\n rowsPerPageOptions: pageSizeOptions,\n rowsPerPage: paginationModel.pageSize,\n onPageChange: handlePageChange,\n onRowsPerPageChange: handlePageSizeChange\n }, computedProps, locales, {\n labelDisplayedRows: wrappedLabelDisplayedRows\n }, props));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridPagination.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n component: PropTypes.elementType\n} : void 0;\nexport { GridPagination };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"rowCount\", \"visibleRowCount\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { styled } from '@mui/system';\nimport { useGridApiContext } from \"../hooks/utils/useGridApiContext.js\";\nimport { getDataGridUtilityClass } from \"../constants/gridClasses.js\";\nimport { useGridRootProps } from \"../hooks/utils/useGridRootProps.js\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['rowCount']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridRowCountRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'RowCount',\n overridesResolver: (props, styles) => styles.rowCount\n})(({\n theme\n}) => ({\n alignItems: 'center',\n display: 'flex',\n margin: theme.spacing(0, 2)\n}));\nconst GridRowCount = /*#__PURE__*/React.forwardRef(function GridRowCount(props, ref) {\n const {\n className,\n rowCount,\n visibleRowCount\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const ownerState = useGridRootProps();\n const classes = useUtilityClasses(ownerState);\n if (rowCount === 0) {\n return null;\n }\n const text = visibleRowCount < rowCount ? apiRef.current.getLocaleText('footerTotalVisibleRows')(visibleRowCount, rowCount) : rowCount.toLocaleString();\n return /*#__PURE__*/_jsxs(GridRowCountRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className),\n ownerState: ownerState\n }, other, {\n children: [apiRef.current.getLocaleText('footerTotalRows'), \" \", text]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridRowCount.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n rowCount: PropTypes.number.isRequired,\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n visibleRowCount: PropTypes.number.isRequired\n} : void 0;\nexport { GridRowCount };","import { unstable_composeClasses as composeClasses } from '@mui/utils';\nimport { getDataGridUtilityClass } from \"../constants/gridClasses.js\";\nexport function composeGridClasses(classes, slots) {\n return composeClasses(slots, getDataGridUtilityClass, classes);\n}","// Can't import from pro package - hence duplication\nexport const GRID_DETAIL_PANEL_TOGGLE_FIELD = '__detail_panel_toggle__';","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"selected\", \"rowId\", \"row\", \"index\", \"style\", \"rowHeight\", \"className\", \"visibleColumns\", \"pinnedColumns\", \"offsetTop\", \"offsetLeft\", \"dimensions\", \"renderContext\", \"focusedColumnIndex\", \"isFirstVisible\", \"isLastVisible\", \"isNotVisible\", \"showBottomBorder\", \"focusedCell\", \"tabbableCell\", \"onClick\", \"onDoubleClick\", \"onMouseEnter\", \"onMouseLeave\", \"onMouseOut\", \"onMouseOver\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { fastMemo } from '@mui/x-internals/fastMemo';\nimport { GridEditModes, GridRowModes, GridCellModes } from \"../models/gridEditRowModel.js\";\nimport { useGridApiContext } from \"../hooks/utils/useGridApiContext.js\";\nimport { gridClasses } from \"../constants/gridClasses.js\";\nimport { composeGridClasses } from \"../utils/composeGridClasses.js\";\nimport { useGridRootProps } from \"../hooks/utils/useGridRootProps.js\";\nimport { gridColumnPositionsSelector } from \"../hooks/features/columns/gridColumnsSelector.js\";\nimport { useGridSelector, objectShallowCompare } from \"../hooks/utils/useGridSelector.js\";\nimport { useGridVisibleRows } from \"../hooks/utils/useGridVisibleRows.js\";\nimport { findParentElementFromClassName, isEventTargetInPortal } from \"../utils/domUtils.js\";\nimport { GRID_CHECKBOX_SELECTION_COL_DEF } from \"../colDef/gridCheckboxSelectionColDef.js\";\nimport { GRID_ACTIONS_COLUMN_TYPE } from \"../colDef/gridActionsColDef.js\";\nimport { GRID_DETAIL_PANEL_TOGGLE_FIELD } from \"../constants/gridDetailPanelToggleField.js\";\nimport { gridSortModelSelector } from \"../hooks/features/sorting/gridSortingSelector.js\";\nimport { gridRowMaximumTreeDepthSelector } from \"../hooks/features/rows/gridRowsSelector.js\";\nimport { gridEditRowsStateSelector } from \"../hooks/features/editing/gridEditingSelectors.js\";\nimport { PinnedPosition, gridPinnedColumnPositionLookup } from \"./cell/GridCell.js\";\nimport { GridScrollbarFillerCell as ScrollbarFiller } from \"./GridScrollbarFillerCell.js\";\nimport { getPinnedCellOffset } from \"../internals/utils/getPinnedCellOffset.js\";\nimport { useGridConfiguration } from \"../hooks/utils/useGridConfiguration.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction EmptyCell({\n width\n}) {\n if (!width) {\n return null;\n }\n return /*#__PURE__*/_jsx(\"div\", {\n role: \"presentation\",\n className: clsx(gridClasses.cell, gridClasses.cellEmpty),\n style: {\n '--width': `${width}px`\n }\n });\n}\nconst GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {\n const {\n selected,\n rowId,\n row,\n index,\n style: styleProp,\n rowHeight,\n className,\n visibleColumns,\n pinnedColumns,\n offsetLeft,\n dimensions,\n renderContext,\n focusedColumnIndex,\n isFirstVisible,\n isLastVisible,\n isNotVisible,\n showBottomBorder,\n onClick,\n onDoubleClick,\n onMouseEnter,\n onMouseLeave,\n onMouseOut,\n onMouseOver\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridApiContext();\n const configuration = useGridConfiguration();\n const ref = React.useRef(null);\n const rootProps = useGridRootProps();\n const currentPage = useGridVisibleRows(apiRef, rootProps);\n const sortModel = useGridSelector(apiRef, gridSortModelSelector);\n const treeDepth = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector);\n const columnPositions = useGridSelector(apiRef, gridColumnPositionsSelector);\n const editRowsState = useGridSelector(apiRef, gridEditRowsStateSelector);\n const handleRef = useForkRef(ref, refProp);\n const rowNode = apiRef.current.getRowNode(rowId);\n const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;\n const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;\n const editing = apiRef.current.getRowMode(rowId) === GridRowModes.Edit;\n const editable = rootProps.editMode === GridEditModes.Row;\n const hasFocusCell = focusedColumnIndex !== undefined;\n const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < renderContext.firstColumnIndex;\n const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >= renderContext.lastColumnIndex;\n const classes = composeGridClasses(rootProps.classes, {\n root: ['row', selected && 'selected', editable && 'row--editable', editing && 'row--editing', isFirstVisible && 'row--firstVisible', isLastVisible && 'row--lastVisible', showBottomBorder && 'row--borderBottom', rowHeight === 'auto' && 'row--dynamicHeight']\n });\n const getRowAriaAttributes = configuration.hooks.useGridRowAriaAttributes();\n React.useLayoutEffect(() => {\n if (currentPage.range) {\n // The index prop is relative to the rows from all pages. As example, the index prop of the\n // first row is 5 if `paginationModel.pageSize=5` and `paginationModel.page=1`. However, the index used by the virtualization\n // doesn't care about pagination and considers the rows from the current page only, so the\n // first row always has index=0. We need to subtract the index of the first row to make it\n // compatible with the index used by the virtualization.\n const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(rowId);\n // pinned rows are not part of the visible rows\n if (rowIndex != null) {\n apiRef.current.unstable_setLastMeasuredRowIndex(rowIndex);\n }\n }\n const rootElement = ref.current;\n const hasFixedHeight = rowHeight !== 'auto';\n if (!rootElement || hasFixedHeight || typeof ResizeObserver === 'undefined') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(entries => {\n const [entry] = entries;\n const height = entry.borderBoxSize && entry.borderBoxSize.length > 0 ? entry.borderBoxSize[0].blockSize : entry.contentRect.height;\n apiRef.current.unstable_storeRowHeightMeasurement(rowId, height);\n });\n resizeObserver.observe(rootElement);\n return () => resizeObserver.disconnect();\n }, [apiRef, currentPage.range, index, rowHeight, rowId]);\n const publish = React.useCallback((eventName, propHandler) => event => {\n // Ignore portal\n if (isEventTargetInPortal(event)) {\n return;\n }\n\n // The row might have been deleted\n if (!apiRef.current.getRow(rowId)) {\n return;\n }\n apiRef.current.publishEvent(eventName, apiRef.current.getRowParams(rowId), event);\n if (propHandler) {\n propHandler(event);\n }\n }, [apiRef, rowId]);\n const publishClick = React.useCallback(event => {\n const cell = findParentElementFromClassName(event.target, gridClasses.cell);\n const field = cell?.getAttribute('data-field');\n\n // Check if the field is available because the cell that fills the empty\n // space of the row has no field.\n if (field) {\n // User clicked in the checkbox added by checkboxSelection\n if (field === GRID_CHECKBOX_SELECTION_COL_DEF.field) {\n return;\n }\n\n // User opened a detail panel\n if (field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {\n return;\n }\n\n // User reorders a row\n if (field === '__reorder__') {\n return;\n }\n\n // User is editing a cell\n if (apiRef.current.getCellMode(rowId, field) === GridCellModes.Edit) {\n return;\n }\n\n // User clicked a button from the \"actions\" column type\n const column = apiRef.current.getColumn(field);\n if (column?.type === GRID_ACTIONS_COLUMN_TYPE) {\n return;\n }\n }\n publish('rowClick', onClick)(event);\n }, [apiRef, onClick, publish, rowId]);\n const {\n slots,\n slotProps,\n disableColumnReorder\n } = rootProps;\n const rowReordering = rootProps.rowReordering;\n const sizes = useGridSelector(apiRef, () => _extends({}, apiRef.current.unstable_getRowInternalSizes(rowId)), objectShallowCompare);\n let minHeight = rowHeight;\n if (minHeight === 'auto' && sizes) {\n const numberOfBaseSizes = 1;\n const maximumSize = sizes.baseCenter ?? 0;\n if (maximumSize > 0 && numberOfBaseSizes > 1) {\n minHeight = maximumSize;\n }\n }\n const style = React.useMemo(() => {\n if (isNotVisible) {\n return {\n opacity: 0,\n width: 0,\n height: 0\n };\n }\n const rowStyle = _extends({}, styleProp, {\n maxHeight: rowHeight === 'auto' ? 'none' : rowHeight,\n // max-height doesn't support \"auto\"\n minHeight,\n '--height': typeof rowHeight === 'number' ? `${rowHeight}px` : rowHeight\n });\n if (sizes?.spacingTop) {\n const property = rootProps.rowSpacingType === 'border' ? 'borderTopWidth' : 'marginTop';\n rowStyle[property] = sizes.spacingTop;\n }\n if (sizes?.spacingBottom) {\n const property = rootProps.rowSpacingType === 'border' ? 'borderBottomWidth' : 'marginBottom';\n let propertyValue = rowStyle[property];\n // avoid overriding existing value\n if (typeof propertyValue !== 'number') {\n propertyValue = parseInt(propertyValue || '0', 10);\n }\n propertyValue += sizes.spacingBottom;\n rowStyle[property] = propertyValue;\n }\n return rowStyle;\n }, [isNotVisible, rowHeight, styleProp, minHeight, sizes, rootProps.rowSpacingType]);\n const rowClassNames = apiRef.current.unstable_applyPipeProcessors('rowClassName', [], rowId);\n const ariaAttributes = rowNode ? getRowAriaAttributes(rowNode, index) : undefined;\n if (typeof rootProps.getRowClassName === 'function') {\n const indexRelativeToCurrentPage = index - (currentPage.range?.firstRowIndex || 0);\n const rowParams = _extends({}, apiRef.current.getRowParams(rowId), {\n isFirstVisible: indexRelativeToCurrentPage === 0,\n isLastVisible: indexRelativeToCurrentPage === currentPage.rows.length - 1,\n indexRelativeToCurrentPage\n });\n rowClassNames.push(rootProps.getRowClassName(rowParams));\n }\n const getCell = (column, indexInSection, indexRelativeToAllColumns, sectionLength, pinnedPosition = PinnedPosition.NONE) => {\n const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, indexRelativeToAllColumns);\n if (cellColSpanInfo?.spannedByColSpan) {\n return null;\n }\n const width = cellColSpanInfo?.cellProps.width ?? column.computedWidth;\n const colSpan = cellColSpanInfo?.cellProps.colSpan ?? 1;\n const pinnedOffset = getPinnedCellOffset(gridPinnedColumnPositionLookup[pinnedPosition], column.computedWidth, indexRelativeToAllColumns, columnPositions, dimensions);\n if (rowNode?.type === 'skeletonRow') {\n return /*#__PURE__*/_jsx(slots.skeletonCell, {\n type: column.type,\n width: width,\n height: rowHeight,\n field: column.field,\n align: column.align\n }, column.field);\n }\n const editCellState = editRowsState[rowId]?.[column.field] ?? null;\n\n // when the cell is a reorder cell we are not allowing to reorder the col\n // fixes https://github.com/mui/mui-x/issues/11126\n const isReorderCell = column.field === '__reorder__';\n const isEditingRows = Object.keys(editRowsState).length > 0;\n const canReorderColumn = !(disableColumnReorder || column.disableReorder);\n const canReorderRow = rowReordering && !sortModel.length && treeDepth <= 1 && !isEditingRows;\n const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);\n const cellIsNotVisible = pinnedPosition === PinnedPosition.VIRTUAL;\n return /*#__PURE__*/_jsx(slots.cell, _extends({\n column: column,\n width: width,\n rowId: rowId,\n align: column.align || 'left',\n colIndex: indexRelativeToAllColumns,\n colSpan: colSpan,\n disableDragEvents: disableDragEvents,\n editCellState: editCellState,\n isNotVisible: cellIsNotVisible,\n pinnedOffset: pinnedOffset,\n pinnedPosition: pinnedPosition,\n sectionIndex: indexInSection,\n sectionLength: sectionLength,\n gridHasFiller: gridHasFiller\n }, slotProps?.cell), column.field);\n };\n\n /* Start of rendering */\n\n if (!rowNode) {\n return null;\n }\n const leftCells = pinnedColumns.left.map((column, i) => {\n const indexRelativeToAllColumns = i;\n return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.left.length, PinnedPosition.LEFT);\n });\n const rightCells = pinnedColumns.right.map((column, i) => {\n const indexRelativeToAllColumns = visibleColumns.length - pinnedColumns.right.length + i;\n return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.right.length, PinnedPosition.RIGHT);\n });\n const middleColumnsLength = visibleColumns.length - pinnedColumns.left.length - pinnedColumns.right.length;\n const cells = [];\n if (hasVirtualFocusCellLeft) {\n cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength, PinnedPosition.VIRTUAL));\n }\n for (let i = renderContext.firstColumnIndex; i < renderContext.lastColumnIndex; i += 1) {\n const column = visibleColumns[i];\n const indexInSection = i - pinnedColumns.left.length;\n cells.push(getCell(column, indexInSection, i, middleColumnsLength));\n }\n if (hasVirtualFocusCellRight) {\n cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength, PinnedPosition.VIRTUAL));\n }\n const eventHandlers = row ? {\n onClick: publishClick,\n onDoubleClick: publish('rowDoubleClick', onDoubleClick),\n onMouseEnter: publish('rowMouseEnter', onMouseEnter),\n onMouseLeave: publish('rowMouseLeave', onMouseLeave),\n onMouseOut: publish('rowMouseOut', onMouseOut),\n onMouseOver: publish('rowMouseOver', onMouseOver)\n } : null;\n const expandedWidth = dimensions.viewportOuterSize.width - dimensions.columnsTotalWidth - scrollbarWidth;\n const emptyCellWidth = Math.max(0, expandedWidth);\n return /*#__PURE__*/_jsxs(\"div\", _extends({\n ref: handleRef,\n \"data-id\": rowId,\n \"data-rowindex\": index,\n role: \"row\",\n className: clsx(...rowClassNames, classes.root, className),\n style: style\n }, ariaAttributes, eventHandlers, other, {\n children: [leftCells, /*#__PURE__*/_jsx(\"div\", {\n role: \"presentation\",\n className: gridClasses.cellOffsetLeft,\n style: {\n width: offsetLeft\n }\n }), cells, emptyCellWidth > 0 && /*#__PURE__*/_jsx(EmptyCell, {\n width: emptyCellWidth\n }), rightCells.length > 0 && /*#__PURE__*/_jsx(\"div\", {\n role: \"presentation\",\n className: gridClasses.filler\n }), rightCells, scrollbarWidth !== 0 && /*#__PURE__*/_jsx(ScrollbarFiller, {\n pinnedRight: pinnedColumns.right.length > 0\n })]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridRow.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"pnpm proptypes\" |\n // ----------------------------------------------------------------------\n dimensions: PropTypes.shape({\n bottomContainerHeight: PropTypes.number.isRequired,\n columnsTotalWidth: PropTypes.number.isRequired,\n contentSize: PropTypes.shape({\n height: PropTypes.number.isRequired,\n width: PropTypes.number.isRequired\n }).isRequired,\n groupHeaderHeight: PropTypes.number.isRequired,\n hasScrollX: PropTypes.bool.isRequired,\n hasScrollY: PropTypes.bool.isRequired,\n headerFilterHeight: PropTypes.number.isRequired,\n headerHeight: PropTypes.number.isRequired,\n headersTotalHeight: PropTypes.number.isRequired,\n isReady: PropTypes.bool.isRequired,\n leftPinnedWidth: PropTypes.number.isRequired,\n minimumSize: PropTypes.shape({\n height: PropTypes.number.isRequired,\n width: PropTypes.number.isRequired\n }).isRequired,\n rightPinnedWidth: PropTypes.number.isRequired,\n root: PropTypes.shape({\n height: PropTypes.number.isRequired,\n width: PropTypes.number.isRequired\n }).isRequired,\n rowHeight: PropTypes.number.isRequired,\n rowWidth: PropTypes.number.isRequired,\n scrollbarSize: PropTypes.number.isRequired,\n topContainerHeight: PropTypes.number.isRequired,\n viewportInnerSize: PropTypes.shape({\n height: PropTypes.number.isRequired,\n width: PropTypes.number.isRequired\n }).isRequired,\n viewportOuterSize: PropTypes.shape({\n height: PropTypes.number.isRequired,\n width: PropTypes.number.isRequired\n }).isRequired\n }).isRequired,\n /**\n * Determines which cell has focus.\n * If `null`, no cell in this row has focus.\n */\n focusedColumnIndex: PropTypes.number,\n /**\n * Index of the row in the whole sorted and filtered dataset.\n * If some rows above have expanded children, this index also take those children into account.\n */\n index: PropTypes.number.isRequired,\n isFirstVisible: PropTypes.bool.isRequired,\n isLastVisible: PropTypes.bool.isRequired,\n isNotVisible: PropTypes.bool.isRequired,\n offsetLeft: PropTypes.number.isRequired,\n offsetTop: PropTypes.number,\n onClick: PropTypes.func,\n onDoubleClick: PropTypes.func,\n onMouseEnter: PropTypes.func,\n onMouseLeave: PropTypes.func,\n pinnedColumns: PropTypes.object.isRequired,\n renderContext: PropTypes.shape({\n firstColumnIndex: PropTypes.number.isRequired,\n firstRowIndex: PropTypes.number.isRequired,\n lastColumnIndex: PropTypes.number.isRequired,\n lastRowIndex: PropTypes.number.isRequired\n }).isRequired,\n row: PropTypes.object.isRequired,\n rowHeight: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,\n rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n selected: PropTypes.bool.isRequired,\n showBottomBorder: PropTypes.bool.isRequired,\n /**\n * Determines which cell should be tabbable by having tabIndex=0.\n * If `null`, no cell in this row is in the tab sequence.\n */\n tabbableCell: PropTypes.string,\n visibleColumns: PropTypes.arrayOf(PropTypes.object).isRequired\n} : void 0;\nconst MemoizedGridRow = fastMemo(GridRow);\nexport { MemoizedGridRow as GridRow };","import { gridVisibleColumnDefinitionsSelector } from \"../features/columns/gridColumnsSelector.js\";\nimport { useGridSelector } from \"./useGridSelector.js\";\nimport { useGridRootProps } from \"./useGridRootProps.js\";\nimport { gridColumnGroupsHeaderMaxDepthSelector } from \"../features/columnGrouping/gridColumnGroupsSelector.js\";\nimport { gridPinnedRowsCountSelector } from \"../features/rows/gridRowsSelector.js\";\nimport { useGridPrivateApiContext } from \"./useGridPrivateApiContext.js\";\nimport { isMultipleRowSelectionEnabled } from \"../features/rowSelection/utils.js\";\nimport { gridExpandedRowCountSelector } from \"../features/filter/gridFilterSelector.js\";\nexport const useGridAriaAttributes = () => {\n const apiRef = useGridPrivateApiContext();\n const rootProps = useGridRootProps();\n const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);\n const accessibleRowCount = useGridSelector(apiRef, gridExpandedRowCountSelector);\n const headerGroupingMaxDepth = useGridSelector(apiRef, gridColumnGroupsHeaderMaxDepthSelector);\n const pinnedRowsCount = useGridSelector(apiRef, gridPinnedRowsCountSelector);\n return {\n role: 'grid',\n 'aria-colcount': visibleColumns.length,\n 'aria-rowcount': headerGroupingMaxDepth + 1 + pinnedRowsCount + accessibleRowCount,\n 'aria-multiselectable': isMultipleRowSelectionEnabled(rootProps)\n };\n};","import * as React from 'react';\nimport { selectedIdsLookupSelector } from \"../rowSelection/index.js\";\nimport { useGridSelector } from \"../../utils/useGridSelector.js\";\nimport { gridColumnGroupsHeaderMaxDepthSelector } from \"../columnGrouping/gridColumnGroupsSelector.js\";\nimport { useGridPrivateApiContext } from \"../../utils/useGridPrivateApiContext.js\";\nexport const useGridRowAriaAttributes = () => {\n const apiRef = useGridPrivateApiContext();\n const selectedIdsLookup = useGridSelector(apiRef, selectedIdsLookupSelector);\n const headerGroupingMaxDepth = useGridSelector(apiRef, gridColumnGroupsHeaderMaxDepthSelector);\n return React.useCallback((rowNode, index) => {\n const ariaAttributes = {};\n const ariaRowIndex = index + headerGroupingMaxDepth + 2; // 1 for the header row and 1 as it's 1-based\n ariaAttributes['aria-rowindex'] = ariaRowIndex;\n if (apiRef.current.isRowSelectable(rowNode.id)) {\n ariaAttributes['aria-selected'] = selectedIdsLookup[rowNode.id] !== undefined;\n }\n return ariaAttributes;\n }, [apiRef, selectedIdsLookup, headerGroupingMaxDepth]);\n};","import * as React from 'react';\nimport { GridApiContext } from \"../components/GridApiContext.js\";\nimport { GridPrivateApiContext } from \"../hooks/utils/useGridPrivateApiContext.js\";\nimport { GridRootPropsContext } from \"./GridRootPropsContext.js\";\nimport { GridConfigurationContext } from \"../components/GridConfigurationContext.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function GridContextProvider({\n privateApiRef,\n configuration,\n props,\n children\n}) {\n const apiRef = React.useRef(privateApiRef.current.getPublicApi());\n return /*#__PURE__*/_jsx(GridConfigurationContext.Provider, {\n value: configuration,\n children: /*#__PURE__*/_jsx(GridRootPropsContext.Provider, {\n value: props,\n children: /*#__PURE__*/_jsx(GridPrivateApiContext.Provider, {\n value: privateApiRef,\n children: /*#__PURE__*/_jsx(GridApiContext.Provider, {\n value: apiRef,\n children: children\n })\n })\n })\n });\n}","import * as React from 'react';\nexport const useGridRefs = apiRef => {\n const rootElementRef = React.useRef(null);\n const mainElementRef = React.useRef(null);\n const virtualScrollerRef = React.useRef(null);\n const columnHeadersContainerRef = React.useRef(null);\n apiRef.current.register('public', {\n rootElementRef\n });\n apiRef.current.register('private', {\n mainElementRef,\n virtualScrollerRef,\n columnHeadersContainerRef\n });\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useRtl } from '@mui/system/RtlProvider';\nexport const useGridIsRtl = apiRef => {\n const isRtl = useRtl();\n if (apiRef.current.state.isRtl === undefined) {\n apiRef.current.state.isRtl = isRtl;\n }\n const isFirstEffect = React.useRef(true);\n React.useEffect(() => {\n if (isFirstEffect.current) {\n isFirstEffect.current = false;\n } else {\n apiRef.current.setState(state => _extends({}, state, {\n isRtl\n }));\n }\n }, [apiRef, isRtl]);\n};","import * as React from 'react';\nimport { localStorageAvailable } from \"../../utils/utils.js\";\nimport { useGridApiMethod } from \"../utils/index.js\";\nconst forceDebug = localStorageAvailable() && window.localStorage.getItem('DEBUG') != null;\nconst noop = () => {};\nconst noopLogger = {\n debug: noop,\n info: noop,\n warn: noop,\n error: noop\n};\nconst LOG_LEVELS = ['debug', 'info', 'warn', 'error'];\nfunction getAppender(name, logLevel, appender = console) {\n const minLogLevelIdx = LOG_LEVELS.indexOf(logLevel);\n if (minLogLevelIdx === -1) {\n throw new Error(`MUI X: Log level ${logLevel} not recognized.`);\n }\n const logger = LOG_LEVELS.reduce((loggerObj, method, idx) => {\n if (idx >= minLogLevelIdx) {\n loggerObj[method] = (...args) => {\n const [message, ...other] = args;\n appender[method](`MUI X: ${name} - ${message}`, ...other);\n };\n } else {\n loggerObj[method] = noop;\n }\n return loggerObj;\n }, {});\n return logger;\n}\nexport const useGridLoggerFactory = (apiRef, props) => {\n const getLogger = React.useCallback(name => {\n if (forceDebug) {\n return getAppender(name, 'debug', props.logger);\n }\n if (!props.logLevel) {\n return noopLogger;\n }\n return getAppender(name, props.logLevel.toString(), props.logger);\n }, [props.logLevel, props.logger]);\n useGridApiMethod(apiRef, {\n getLogger\n }, 'private');\n};","// Used https://gist.github.com/mudge/5830382 as a starting point.\n// See https://github.com/browserify/events/blob/master/events.js for\n// the Node.js (https://nodejs.org/api/events.html) polyfill used by webpack.\nexport class EventManager {\n constructor() {\n this.maxListeners = 20;\n this.warnOnce = false;\n this.events = {};\n }\n on(eventName, listener, options = {}) {\n let collection = this.events[eventName];\n if (!collection) {\n collection = {\n highPriority: new Map(),\n regular: new Map()\n };\n this.events[eventName] = collection;\n }\n if (options.isFirst) {\n collection.highPriority.set(listener, true);\n } else {\n collection.regular.set(listener, true);\n }\n if (process.env.NODE_ENV !== 'production') {\n const collectionSize = collection.highPriority.size + collection.regular.size;\n if (collectionSize > this.maxListeners && !this.warnOnce) {\n this.warnOnce = true;\n console.warn([`Possible EventEmitter memory leak detected. ${collectionSize} ${eventName} listeners added.`].join('\\n'));\n }\n }\n }\n removeListener(eventName, listener) {\n if (this.events[eventName]) {\n this.events[eventName].regular.delete(listener);\n this.events[eventName].highPriority.delete(listener);\n }\n }\n removeAllListeners() {\n this.events = {};\n }\n emit(eventName, ...args) {\n const collection = this.events[eventName];\n if (!collection) {\n return;\n }\n const highPriorityListeners = Array.from(collection.highPriority.keys());\n const regularListeners = Array.from(collection.regular.keys());\n for (let i = highPriorityListeners.length - 1; i >= 0; i -= 1) {\n const listener = highPriorityListeners[i];\n if (collection.highPriority.has(listener)) {\n listener.apply(this, args);\n }\n }\n for (let i = 0; i < regularListeners.length; i += 1) {\n const listener = regularListeners[i];\n if (collection.regular.has(listener)) {\n listener.apply(this, args);\n }\n }\n }\n once(eventName, listener) {\n // eslint-disable-next-line consistent-this\n const that = this;\n this.on(eventName, function oneTimeListener(...args) {\n that.removeListener(eventName, oneTimeListener);\n listener.apply(that, args);\n });\n }\n}","export class Store {\n static create(value) {\n return new Store(value);\n }\n constructor(_value) {\n this.value = void 0;\n this.listeners = void 0;\n this.subscribe = fn => {\n this.listeners.add(fn);\n return () => {\n this.listeners.delete(fn);\n };\n };\n this.getSnapshot = () => {\n return this.value;\n };\n this.update = value => {\n this.value = value;\n this.listeners.forEach(l => l(value));\n };\n this.value = _value;\n this.listeners = new Set();\n }\n}","import * as React from 'react';\nimport { EventManager } from '@mui/x-internals/EventManager';\nimport { Store } from \"../../utils/Store.js\";\nimport { useGridApiMethod } from \"../utils/useGridApiMethod.js\";\nimport { GridSignature } from \"../utils/useGridApiEventHandler.js\";\nconst SYMBOL_API_PRIVATE = Symbol('mui.api_private');\nconst isSyntheticEvent = event => {\n return event.isPropagationStopped !== undefined;\n};\nexport function unwrapPrivateAPI(publicApi) {\n return publicApi[SYMBOL_API_PRIVATE];\n}\nlet globalId = 0;\nfunction createPrivateAPI(publicApiRef) {\n const existingPrivateApi = publicApiRef.current?.[SYMBOL_API_PRIVATE];\n if (existingPrivateApi) {\n return existingPrivateApi;\n }\n const state = {};\n const privateApi = {\n state,\n store: Store.create(state),\n instanceId: {\n id: globalId\n }\n };\n globalId += 1;\n privateApi.getPublicApi = () => publicApiRef.current;\n privateApi.register = (visibility, methods) => {\n Object.keys(methods).forEach(methodName => {\n const method = methods[methodName];\n const currentPrivateMethod = privateApi[methodName];\n if (currentPrivateMethod?.spying === true) {\n currentPrivateMethod.target = method;\n } else {\n privateApi[methodName] = method;\n }\n if (visibility === 'public') {\n const publicApi = publicApiRef.current;\n const currentPublicMethod = publicApi[methodName];\n if (currentPublicMethod?.spying === true) {\n currentPublicMethod.target = method;\n } else {\n publicApi[methodName] = method;\n }\n }\n });\n };\n privateApi.register('private', {\n caches: {},\n eventManager: new EventManager()\n });\n return privateApi;\n}\nfunction createPublicAPI(privateApiRef) {\n const publicApi = {\n get state() {\n return privateApiRef.current.state;\n },\n get store() {\n return privateApiRef.current.store;\n },\n get instanceId() {\n return privateApiRef.current.instanceId;\n },\n [SYMBOL_API_PRIVATE]: privateApiRef.current\n };\n return publicApi;\n}\nexport function useGridApiInitialization(inputApiRef, props) {\n const publicApiRef = React.useRef();\n const privateApiRef = React.useRef();\n if (!privateApiRef.current) {\n privateApiRef.current = createPrivateAPI(publicApiRef);\n }\n if (!publicApiRef.current) {\n publicApiRef.current = createPublicAPI(privateApiRef);\n }\n const publishEvent = React.useCallback((...args) => {\n const [name, params, event = {}] = args;\n event.defaultMuiPrevented = false;\n if (isSyntheticEvent(event) && event.isPropagationStopped()) {\n return;\n }\n const details = props.signature === GridSignature.DataGridPro || props.signature === GridSignature.DataGridPremium ? {\n api: privateApiRef.current.getPublicApi()\n } : {};\n privateApiRef.current.eventManager.emit(name, params, event, details);\n }, [privateApiRef, props.signature]);\n const subscribeEvent = React.useCallback((event, handler, options) => {\n privateApiRef.current.eventManager.on(event, handler, options);\n const api = privateApiRef.current;\n return () => {\n api.eventManager.removeListener(event, handler);\n };\n }, [privateApiRef]);\n useGridApiMethod(privateApiRef, {\n subscribeEvent,\n publishEvent\n }, 'public');\n if (inputApiRef && !inputApiRef.current?.state) {\n inputApiRef.current = publicApiRef.current;\n }\n React.useImperativeHandle(inputApiRef, () => publicApiRef.current, [publicApiRef]);\n React.useEffect(() => {\n const api = privateApiRef.current;\n return () => {\n api.publishEvent('unmount');\n };\n }, [privateApiRef]);\n return privateApiRef;\n}","import * as React from 'react';\nexport const useGridLocaleText = (apiRef, props) => {\n const getLocaleText = React.useCallback(key => {\n if (props.localeText[key] == null) {\n throw new Error(`Missing translation for key ${key}.`);\n }\n return props.localeText[key];\n }, [props.localeText]);\n apiRef.current.register('public', {\n getLocaleText\n });\n};","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _toPropertyKey from \"@babel/runtime/helpers/esm/toPropertyKey\";\nimport * as React from 'react';\nimport { useGridApiMethod } from \"../../utils/useGridApiMethod.js\";\n/**\n * Implement the Pipeline Pattern\n *\n * More information and detailed example in (TODO add link to technical doc when ready)\n *\n * Some plugins contains custom logic to enrich data provided by other plugins or components.\n * For instance, the row grouping plugin needs to add / remove the grouping columns when the grid columns are updated.\n *\n * =====================================================================================================================\n *\n * The plugin containing the custom logic must use:\n *\n * - `useGridRegisterPipeProcessor` to register their processor.\n *\n * - `apiRef.current.requestPipeProcessorsApplication` to imperatively re-apply a group.\n * This method should be used in last resort.\n * Most of the time, the application should be triggered by an update on the deps of the processor.\n *\n * =====================================================================================================================\n *\n * The plugin or component that needs to enrich its data must use:\n *\n * - `apiRef.current.unstable_applyPipeProcessors` to run in chain all the processors of a given group.\n *\n * - `useGridRegisterPipeApplier` to re-apply the whole pipe when requested.\n * The applier will be called when:\n * * a processor is registered.\n * * `apiRef.current.requestPipeProcessorsApplication` is called for the given group.\n */\nexport const useGridPipeProcessing = apiRef => {\n const cache = React.useRef({});\n const isRunning = React.useRef(false);\n const runAppliers = React.useCallback(groupCache => {\n if (isRunning.current || !groupCache) {\n return;\n }\n isRunning.current = true;\n Object.values(groupCache.appliers).forEach(callback => {\n callback();\n });\n isRunning.current = false;\n }, []);\n const registerPipeProcessor = React.useCallback((group, id, processor) => {\n if (!cache.current[group]) {\n cache.current[group] = {\n processors: new Map(),\n processorsAsArray: [],\n appliers: {}\n };\n }\n const groupCache = cache.current[group];\n const oldProcessor = groupCache.processors.get(id);\n if (oldProcessor !== processor) {\n groupCache.processors.set(id, processor);\n groupCache.processorsAsArray = Array.from(cache.current[group].processors.values());\n runAppliers(groupCache);\n }\n return () => {\n cache.current[group].processors.delete(id);\n cache.current[group].processorsAsArray = Array.from(cache.current[group].processors.values());\n };\n }, [runAppliers]);\n const registerPipeApplier = React.useCallback((group, id, applier) => {\n if (!cache.current[group]) {\n cache.current[group] = {\n processors: new Map(),\n processorsAsArray: [],\n appliers: {}\n };\n }\n cache.current[group].appliers[id] = applier;\n return () => {\n const _appliers = cache.current[group].appliers,\n otherAppliers = _objectWithoutPropertiesLoose(_appliers, [id].map(_toPropertyKey));\n cache.current[group].appliers = otherAppliers;\n };\n }, []);\n const requestPipeProcessorsApplication = React.useCallback(group => {\n runAppliers(cache.current[group]);\n }, [runAppliers]);\n const applyPipeProcessors = React.useCallback((...args) => {\n const [group, value, context] = args;\n if (!cache.current[group]) {\n return value;\n }\n const processors = cache.current[group].processorsAsArray;\n let result = value;\n for (let i = 0; i < processors.length; i += 1) {\n result = processors[i](result, context);\n }\n return result;\n }, []);\n const preProcessingPrivateApi = {\n registerPipeProcessor,\n registerPipeApplier,\n requestPipeProcessorsApplication\n };\n const preProcessingPublicApi = {\n unstable_applyPipeProcessors: applyPipeProcessors\n };\n useGridApiMethod(apiRef, preProcessingPrivateApi, 'private');\n useGridApiMethod(apiRef, preProcessingPublicApi, 'public');\n};","import * as React from 'react';\nimport { useFirstRender } from \"../../utils/useFirstRender.js\";\nexport const useGridRegisterPipeProcessor = (apiRef, group, callback) => {\n const cleanup = React.useRef();\n const id = React.useRef(`mui-${Math.round(Math.random() * 1e9)}`);\n const registerPreProcessor = React.useCallback(() => {\n cleanup.current = apiRef.current.registerPipeProcessor(group, id.current, callback);\n }, [apiRef, callback, group]);\n useFirstRender(() => {\n registerPreProcessor();\n });\n const isFirstRender = React.useRef(true);\n React.useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n } else {\n registerPreProcessor();\n }\n return () => {\n if (cleanup.current) {\n cleanup.current();\n cleanup.current = null;\n }\n };\n }, [registerPreProcessor]);\n};","import * as React from 'react';\nimport { useFirstRender } from \"../../utils/useFirstRender.js\";\nexport const useGridRegisterPipeApplier = (apiRef, group, callback) => {\n const cleanup = React.useRef();\n const id = React.useRef(`mui-${Math.round(Math.random() * 1e9)}`);\n const registerPreProcessor = React.useCallback(() => {\n cleanup.current = apiRef.current.registerPipeApplier(group, id.current, callback);\n }, [apiRef, callback, group]);\n useFirstRender(() => {\n registerPreProcessor();\n });\n const isFirstRender = React.useRef(true);\n React.useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n } else {\n registerPreProcessor();\n }\n return () => {\n if (cleanup.current) {\n cleanup.current();\n cleanup.current = null;\n }\n };\n }, [registerPreProcessor]);\n};","import * as React from 'react';\nimport { useFirstRender } from \"../../utils/useFirstRender.js\";\nexport const useGridRegisterStrategyProcessor = (apiRef, strategyName, group, processor) => {\n const registerPreProcessor = React.useCallback(() => {\n apiRef.current.registerStrategyProcessor(strategyName, group, processor);\n }, [apiRef, processor, group, strategyName]);\n useFirstRender(() => {\n registerPreProcessor();\n });\n const isFirstRender = React.useRef(true);\n React.useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n } else {\n registerPreProcessor();\n }\n }, [registerPreProcessor]);\n};","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _toPropertyKey from \"@babel/runtime/helpers/esm/toPropertyKey\";\nimport * as React from 'react';\nimport { useGridApiMethod } from \"../../utils/useGridApiMethod.js\";\nexport const GRID_DEFAULT_STRATEGY = 'none';\nexport const GRID_STRATEGIES_PROCESSORS = {\n rowTreeCreation: 'rowTree',\n filtering: 'rowTree',\n sorting: 'rowTree',\n visibleRowsLookupCreation: 'rowTree'\n};\n/**\n * Implements a variant of the Strategy Pattern (see https://en.wikipedia.org/wiki/Strategy_pattern)\n *\n * More information and detailed example in (TODO add link to technical doc when ready)\n *\n * Some plugins contains custom logic that must only be applied if the right strategy is active.\n * For instance, the row grouping plugin has a custom filtering algorithm.\n * This algorithm must be applied by the filtering plugin if the row grouping is the current way of grouping rows,\n * but not if the tree data is the current way of grouping rows.\n *\n * =====================================================================================================================\n *\n * The plugin containing the custom logic must use:\n *\n * - `useGridRegisterStrategyProcessor` to register their processor.\n * When the processor of the active strategy changes, it will fire `\"activeStrategyProcessorChange\"` to re-apply the processor.\n *\n * - `apiRef.current.setStrategyAvailability` to tell if their strategy can be used.\n *\n * =====================================================================================================================\n *\n * The plugin or component that needs to apply the custom logic of the current strategy must use:\n *\n * - `apiRef.current.applyStrategyProcessor` to run the processor of the active strategy for a given processor name.\n *\n * - the \"strategyAvailabilityChange\" event to update something when the active strategy changes.\n * Warning: Be careful not to apply the processor several times.\n * For instance \"rowsSet\" is fired by `useGridRows` whenever the active strategy changes.\n * So listening to both would most likely run your logic twice.\n *\n * - The \"activeStrategyProcessorChange\" event to update something when the processor of the active strategy changes.\n *\n * =====================================================================================================================\n *\n * Each processor name is part of a strategy group which can only have one active strategy at the time.\n * For now, there is only one strategy group named `rowTree` which customize\n * - row tree creation algorithm.\n * - sorting algorithm.\n * - filtering algorithm.\n */\nexport const useGridStrategyProcessing = apiRef => {\n const availableStrategies = React.useRef(new Map());\n const strategiesCache = React.useRef({});\n const registerStrategyProcessor = React.useCallback((strategyName, processorName, processor) => {\n const cleanup = () => {\n const _ref = strategiesCache.current[processorName],\n otherProcessors = _objectWithoutPropertiesLoose(_ref, [strategyName].map(_toPropertyKey));\n strategiesCache.current[processorName] = otherProcessors;\n };\n if (!strategiesCache.current[processorName]) {\n strategiesCache.current[processorName] = {};\n }\n const groupPreProcessors = strategiesCache.current[processorName];\n const previousProcessor = groupPreProcessors[strategyName];\n groupPreProcessors[strategyName] = processor;\n if (!previousProcessor || previousProcessor === processor) {\n return cleanup;\n }\n if (strategyName === apiRef.current.getActiveStrategy(GRID_STRATEGIES_PROCESSORS[processorName])) {\n apiRef.current.publishEvent('activeStrategyProcessorChange', processorName);\n }\n return cleanup;\n }, [apiRef]);\n const applyStrategyProcessor = React.useCallback((processorName, params) => {\n const activeStrategy = apiRef.current.getActiveStrategy(GRID_STRATEGIES_PROCESSORS[processorName]);\n if (activeStrategy == null) {\n throw new Error(\"Can't apply a strategy processor before defining an active strategy\");\n }\n const groupCache = strategiesCache.current[processorName];\n if (!groupCache || !groupCache[activeStrategy]) {\n throw new Error(`No processor found for processor \"${processorName}\" on strategy \"${activeStrategy}\"`);\n }\n const processor = groupCache[activeStrategy];\n return processor(params);\n }, [apiRef]);\n const getActiveStrategy = React.useCallback(strategyGroup => {\n const strategyEntries = Array.from(availableStrategies.current.entries());\n const availableStrategyEntry = strategyEntries.find(([, strategy]) => {\n if (strategy.group !== strategyGroup) {\n return false;\n }\n return strategy.isAvailable();\n });\n return availableStrategyEntry?.[0] ?? GRID_DEFAULT_STRATEGY;\n }, []);\n const setStrategyAvailability = React.useCallback((strategyGroup, strategyName, isAvailable) => {\n availableStrategies.current.set(strategyName, {\n group: strategyGroup,\n isAvailable\n });\n apiRef.current.publishEvent('strategyAvailabilityChange');\n }, [apiRef]);\n const strategyProcessingApi = {\n registerStrategyProcessor,\n applyStrategyProcessor,\n getActiveStrategy,\n setStrategyAvailability\n };\n useGridApiMethod(apiRef, strategyProcessingApi, 'private');\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridApiMethod } from \"../utils/index.js\";\nimport { isFunction } from \"../../utils/utils.js\";\nexport const useGridStateInitialization = apiRef => {\n const controlStateMapRef = React.useRef({});\n const [, rawForceUpdate] = React.useState();\n const registerControlState = React.useCallback(controlStateItem => {\n controlStateMapRef.current[controlStateItem.stateId] = controlStateItem;\n }, []);\n const setState = React.useCallback((state, reason) => {\n let newState;\n if (isFunction(state)) {\n newState = state(apiRef.current.state);\n } else {\n newState = state;\n }\n if (apiRef.current.state === newState) {\n return false;\n }\n let ignoreSetState = false;\n\n // Apply the control state constraints\n const updatedControlStateIds = [];\n Object.keys(controlStateMapRef.current).forEach(stateId => {\n const controlState = controlStateMapRef.current[stateId];\n const oldSubState = controlState.stateSelector(apiRef.current.state, apiRef.current.instanceId);\n const newSubState = controlState.stateSelector(newState, apiRef.current.instanceId);\n if (newSubState === oldSubState) {\n return;\n }\n updatedControlStateIds.push({\n stateId: controlState.stateId,\n hasPropChanged: newSubState !== controlState.propModel\n });\n\n // The state is controlled, the prop should always win\n if (controlState.propModel !== undefined && newSubState !== controlState.propModel) {\n ignoreSetState = true;\n }\n });\n if (updatedControlStateIds.length > 1) {\n // Each hook modify its own state, and it should not leak\n // Events are here to forward to other hooks and apply changes.\n // You are trying to update several states in a no isolated way.\n throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${updatedControlStateIds[0].stateId}, therefore, you're not allowed to update ${updatedControlStateIds.map(el => el.stateId).join(', ')} in the same transaction.`);\n }\n if (!ignoreSetState) {\n // We always assign it as we mutate rows for perf reason.\n apiRef.current.state = newState;\n apiRef.current.publishEvent('stateChange', newState);\n apiRef.current.store.update(newState);\n }\n if (updatedControlStateIds.length === 1) {\n const {\n stateId,\n hasPropChanged\n } = updatedControlStateIds[0];\n const controlState = controlStateMapRef.current[stateId];\n const model = controlState.stateSelector(newState, apiRef.current.instanceId);\n if (controlState.propOnChange && hasPropChanged) {\n controlState.propOnChange(model, {\n reason,\n api: apiRef.current\n });\n }\n if (!ignoreSetState) {\n apiRef.current.publishEvent(controlState.changeEvent, model, {\n reason\n });\n }\n }\n return !ignoreSetState;\n }, [apiRef]);\n const updateControlState = React.useCallback((key, state, reason) => {\n return apiRef.current.setState(previousState => {\n return _extends({}, previousState, {\n [key]: state(previousState[key])\n });\n }, reason);\n }, [apiRef]);\n const forceUpdate = React.useCallback(() => rawForceUpdate(() => apiRef.current.state), [apiRef]);\n const publicStateApi = {\n setState,\n forceUpdate\n };\n const privateStateApi = {\n updateControlState,\n registerControlState\n };\n useGridApiMethod(apiRef, publicStateApi, 'public');\n useGridApiMethod(apiRef, privateStateApi, 'private');\n};","import { useGridRefs } from \"./useGridRefs.js\";\nimport { useGridIsRtl } from \"./useGridIsRtl.js\";\nimport { useGridLoggerFactory } from \"./useGridLoggerFactory.js\";\nimport { useGridApiInitialization } from \"./useGridApiInitialization.js\";\nimport { useGridLocaleText } from \"./useGridLocaleText.js\";\nimport { useGridPipeProcessing } from \"./pipeProcessing/index.js\";\nimport { useGridStrategyProcessing } from \"./strategyProcessing/index.js\";\nimport { useGridStateInitialization } from \"./useGridStateInitialization.js\";\n\n/**\n * Initialize the technical pieces of the DataGrid (logger, state, ...) that any DataGrid implementation needs\n */\nexport const useGridInitialization = (inputApiRef, props) => {\n const privateApiRef = useGridApiInitialization(inputApiRef, props);\n useGridRefs(privateApiRef);\n useGridIsRtl(privateApiRef);\n useGridLoggerFactory(privateApiRef, props);\n useGridStateInitialization(privateApiRef);\n useGridPipeProcessing(privateApiRef);\n useGridStrategyProcessing(privateApiRef);\n useGridLocaleText(privateApiRef, props);\n privateApiRef.current.register('private', {\n rootProps: props\n });\n return privateApiRef;\n};","import * as React from 'react';\nexport const useGridInitializeState = (initializer, privateApiRef, props) => {\n const isInitialized = React.useRef(false);\n if (!isInitialized.current) {\n privateApiRef.current.state = initializer(privateApiRef.current.state, props, privateApiRef);\n isInitialized.current = true;\n }\n};","import { warnOnce } from '@mui/x-internals/warning';\nimport { GRID_CHECKBOX_SELECTION_COL_DEF } from \"../../../../colDef/index.js\";\nfunction sanitizeCellValue(value, csvOptions) {\n if (value === null || value === undefined) {\n return '';\n }\n const valueStr = typeof value === 'string' ? value : `${value}`;\n if (csvOptions.shouldAppendQuotes || csvOptions.escapeFormulas) {\n const escapedValue = valueStr.replace(/\"/g, '\"\"');\n if (csvOptions.escapeFormulas) {\n // See https://owasp.org/www-community/attacks/CSV_Injection\n if (['=', '+', '-', '@', '\\t', '\\r'].includes(escapedValue[0])) {\n return `\"'${escapedValue}\"`;\n }\n }\n // Make sure value containing delimiter or line break won't be split into multiple cells\n if ([csvOptions.delimiter, '\\n', '\\r', '\"'].some(delimiter => valueStr.includes(delimiter))) {\n return `\"${escapedValue}\"`;\n }\n return escapedValue;\n }\n return valueStr;\n}\nexport const serializeCellValue = (cellParams, options) => {\n const {\n csvOptions,\n ignoreValueFormatter\n } = options;\n let value;\n if (ignoreValueFormatter) {\n const columnType = cellParams.colDef.type;\n if (columnType === 'number') {\n value = String(cellParams.value);\n } else if (columnType === 'date' || columnType === 'dateTime') {\n value = cellParams.value?.toISOString();\n } else if (typeof cellParams.value?.toString === 'function') {\n value = cellParams.value.toString();\n } else {\n value = cellParams.value;\n }\n } else {\n value = cellParams.formattedValue;\n }\n return sanitizeCellValue(value, csvOptions);\n};\nclass CSVRow {\n constructor(options) {\n this.options = void 0;\n this.rowString = '';\n this.isEmpty = true;\n this.options = options;\n }\n addValue(value) {\n if (!this.isEmpty) {\n this.rowString += this.options.csvOptions.delimiter;\n }\n if (typeof this.options.sanitizeCellValue === 'function') {\n this.rowString += this.options.sanitizeCellValue(value, this.options.csvOptions);\n } else {\n this.rowString += value;\n }\n this.isEmpty = false;\n }\n getRowString() {\n return this.rowString;\n }\n}\nconst serializeRow = ({\n id,\n columns,\n getCellParams,\n csvOptions,\n ignoreValueFormatter\n}) => {\n const row = new CSVRow({\n csvOptions\n });\n columns.forEach(column => {\n const cellParams = getCellParams(id, column.field);\n if (process.env.NODE_ENV !== 'production') {\n if (String(cellParams.formattedValue) === '[object Object]') {\n warnOnce(['MUI X: When the value of a field is an object or a `renderCell` is provided, the CSV export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);\n }\n }\n row.addValue(serializeCellValue(cellParams, {\n ignoreValueFormatter,\n csvOptions\n }));\n });\n return row.getRowString();\n};\nexport function buildCSV(options) {\n const {\n columns,\n rowIds,\n csvOptions,\n ignoreValueFormatter,\n apiRef\n } = options;\n const CSVBody = rowIds.reduce((acc, id) => `${acc}${serializeRow({\n id,\n columns,\n getCellParams: apiRef.current.getCellParams,\n ignoreValueFormatter,\n csvOptions\n })}\\r\\n`, '').trim();\n if (!csvOptions.includeHeaders) {\n return CSVBody;\n }\n const filteredColumns = columns.filter(column => column.field !== GRID_CHECKBOX_SELECTION_COL_DEF.field);\n const headerRows = [];\n if (csvOptions.includeColumnGroupsHeaders) {\n const columnGroupLookup = apiRef.current.getAllGroupDetails();\n let maxColumnGroupsDepth = 0;\n const columnGroupPathsLookup = filteredColumns.reduce((acc, column) => {\n const columnGroupPath = apiRef.current.getColumnGroupPath(column.field);\n acc[column.field] = columnGroupPath;\n maxColumnGroupsDepth = Math.max(maxColumnGroupsDepth, columnGroupPath.length);\n return acc;\n }, {});\n for (let i = 0; i < maxColumnGroupsDepth; i += 1) {\n const headerGroupRow = new CSVRow({\n csvOptions,\n sanitizeCellValue\n });\n headerRows.push(headerGroupRow);\n filteredColumns.forEach(column => {\n const columnGroupId = (columnGroupPathsLookup[column.field] || [])[i];\n const columnGroup = columnGroupLookup[columnGroupId];\n headerGroupRow.addValue(columnGroup ? columnGroup.headerName || columnGroup.groupId : '');\n });\n }\n }\n const mainHeaderRow = new CSVRow({\n csvOptions,\n sanitizeCellValue\n });\n filteredColumns.forEach(column => {\n mainHeaderRow.addValue(column.headerName || column.field);\n });\n headerRows.push(mainHeaderRow);\n const CSVHead = `${headerRows.map(row => row.getRowString()).join('\\r\\n')}\\r\\n`;\n return `${CSVHead}${CSVBody}`.trim();\n}","import * as React from 'react';\nimport { useGridApiOptionHandler, useGridNativeEventListener } from \"../../utils/index.js\";\nimport { gridFocusCellSelector } from \"../focus/gridFocusStateSelector.js\";\nimport { serializeCellValue } from \"../export/serializers/csvSerializer.js\";\nfunction writeToClipboardPolyfill(data) {\n const span = document.createElement('span');\n span.style.whiteSpace = 'pre';\n span.style.userSelect = 'all';\n span.style.opacity = '0px';\n span.textContent = data;\n document.body.appendChild(span);\n const range = document.createRange();\n range.selectNode(span);\n const selection = window.getSelection();\n selection.removeAllRanges();\n selection.addRange(range);\n try {\n document.execCommand('copy');\n } finally {\n document.body.removeChild(span);\n }\n}\nfunction copyToClipboard(data) {\n if (navigator.clipboard) {\n navigator.clipboard.writeText(data).catch(() => {\n writeToClipboardPolyfill(data);\n });\n } else {\n writeToClipboardPolyfill(data);\n }\n}\nfunction hasNativeSelection(element) {\n // When getSelection is called on an